提交 a3cad55d 编写于 作者: DCloud_JSON's avatar DCloud_JSON

修改组件名称

上级 1882983f
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
console.log('App Launch') console.log('App Launch')
initApp(); initApp();
// #ifdef APP-PLUS // #ifdef APP-PLUS
checkIsAgree(); //checkIsAgree(); 暂时先用默认生成的,自定义的等待原生支持后实现。因为启动vue界面时已经,请求了部分权限这并不符合国家的法规
// #endif // #endif
//#ifdef APP-NVUE || H5 //#ifdef APP-NVUE || H5
......
...@@ -35,5 +35,9 @@ module.exports = { ...@@ -35,5 +35,9 @@ module.exports = {
} }
], ],
"download": "https://m3w.cn/uniapp" "download": "https://m3w.cn/uniapp"
},
"marketId":{//用于打开应用市场评分界面
"ios":"id1417078253",
"android":"123456"
} }
} }
...@@ -7,6 +7,10 @@ export default function() { ...@@ -7,6 +7,10 @@ export default function() {
// 初始化appVersion(仅app生效) // 初始化appVersion(仅app生效)
initAppVersion(); initAppVersion();
// baseappConfig挂载到getApp().
getApp({allowDefault: true}).config = baseappConfig;
//自定义路由拦截 //自定义路由拦截
const { const {
"router": { "router": {
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
} }
} }
export default { export default {
name: "login-short-code", name: "send-sms-code",
props: { props: {
/** /**
* 倒计时时长 s * 倒计时时长 s
...@@ -35,6 +35,15 @@ ...@@ -35,6 +35,15 @@
phone: { phone: {
type: [String, Number], type: [String, Number],
default: '' default: ''
},
/*
验证码类型,用于防止不同功能的验证码混用,目前支持的类型login登录、register注册、bind绑定手机、unbind解绑手机
*/
codeType:{
type: String,
default(){
return 'login'
}
} }
}, },
data() { data() {
...@@ -69,7 +78,7 @@ ...@@ -69,7 +78,7 @@
this.request('user-center/sendSmsCode', this.request('user-center/sendSmsCode',
{ {
"mobile": this.phone, "mobile": this.phone,
"type": "login" "type": this.codeType
},(data,result)=>{ },(data,result)=>{
console.log(data,result); console.log(data,result);
uni.showToast({ uni.showToast({
...@@ -79,37 +88,8 @@ ...@@ -79,37 +88,8 @@
this.reverseNumber = Number(this.count); this.reverseNumber = Number(this.count);
this.getCode(); this.getCode();
this.$emit('getCode'); this.$emit('getCode');
}) }
)
// uniCloud.callFunction({
// "name": "user-center",
// "data": {
// "action": "sendSmsCode",
// "params": {
// "mobile": this.phone,
// "type": "login"
// }
// },
// success: (e) => {
// uni.showToast({
// title: "短信验证码发送成功",
// icon: 'none'
// });
// this.reverseNumber = Number(this.count);
// this.getCode();
// this.$emit('getCode');
// },
// fail: (err) => {
// console.log(err);
// uni.showToast({
// title: '短信验证码发送失败',
// icon: 'none'
// });
// },
// complete: () => {
// uni.hideLoading()
// }
// })
}, },
getCode() { getCode() {
if (this.reverseNumber == 0) { if (this.reverseNumber == 0) {
......
...@@ -9,7 +9,6 @@ const debug = true;//开启后,会alert错误信息 ...@@ -9,7 +9,6 @@ const debug = true;//开启后,会alert错误信息
export default function request(name,params,callback=false,{showLoading=false,loadText='',fail=()=>{}}={}){ export default function request(name,params,callback=false,{showLoading=false,loadText='',fail=()=>{}}={}){
// console.log('request'); // console.log('request');
showLoading||loadText? uni.showLoading({title:loadText}):''; showLoading||loadText? uni.showLoading({title:loadText}):'';
let routers = name.split('/'); let routers = name.split('/');
var action = false var action = false
if (routers.length>1){ if (routers.length>1){
...@@ -23,28 +22,12 @@ export default function request(name,params,callback=false,{showLoading=false,lo ...@@ -23,28 +22,12 @@ export default function request(name,params,callback=false,{showLoading=false,lo
console.log(e); console.log(e);
const {result:{data,code}} = e const {result:{data,code}} = e
console.log(data,code); console.log(data,code);
if (code != 0 ) {
if(debug){
uni.showModal({
content: JSON.stringify(e),
showCancel: false,
confirmText: '知道了'
})
}
}
resolve(e) resolve(e)
return callback(data,e.result,e) return callback(data,e.result,e)
}, },
fail(err){ fail(err){
reject(err) reject(err)
console.log(err); console.log(err);
if(debug){
uni.showModal({
content: JSON.stringify(err),
showCancel: false,
confirmText: '知道了'
})
}
fail(err) fail(err)
}, },
complete() { complete() {
......
...@@ -7,6 +7,15 @@ ...@@ -7,6 +7,15 @@
"transformPx" : false, "transformPx" : false,
/* 5+App特有相关 */ /* 5+App特有相关 */
"app-plus" : { "app-plus" : {
"privacy" : {
"prompt" : "template",
"template" : {
"title" : "服务协议和隐私政策",
"message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。<br/>  你可阅读<a href=\"\">《服务协议》</a>和<a href=\"\">《隐私政策》</a>了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。",
"buttonAccept" : "我知道了",
"buttonRefuse" : "暂不同意"
}
},
"compatible" : { "compatible" : {
"ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持
}, },
...@@ -31,14 +40,14 @@ ...@@ -31,14 +40,14 @@
"distribute" : { "distribute" : {
/* android打包配置 */ /* android打包配置 */
"android" : { "android" : {
"permissionExternalStorage" : { // "permissionExternalStorage" : {
"request" : "none", // "request" : "none",
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" // "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
}, // },
"permissionPhoneState" : { // "permissionPhoneState" : {
"request" : "none", // "request" : "none",
"prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。" // "prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。"
}, // },
"permissions" : [ "permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>", "<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>", "<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
}, { }, {
"path": "pages/ucenter/edit/bind-mobile/bind-mobile", "path": "pages/ucenter/edit/bind-mobile/bind-mobile",
"style": { "style": {
"navigationStyle": "custom" "navigationBarTitleText": "绑定手机号码"
} }
}, },
{ {
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
"style": { "style": {
"navigationStyle": "custom" "navigationStyle": "custom"
} }
},{ }, {
"path": "uni_modules/uni-feedback/pages/opendb-feedback/list", "path": "uni_modules/uni-feedback/pages/opendb-feedback/list",
"style": { "style": {
"navigationBarTitleText": "常见问题" "navigationBarTitleText": "常见问题"
...@@ -90,8 +90,7 @@ ...@@ -90,8 +90,7 @@
"style": { "style": {
"navigationBarTitleText": "关于" "navigationBarTitleText": "关于"
// #ifdef APP-PLUS // #ifdef APP-PLUS
, ,"app-plus": {
"app-plus": {
"titleNView": { "titleNView": {
"buttons": [{ "buttons": [{
"type": "share" "type": "share"
...@@ -138,7 +137,9 @@ ...@@ -138,7 +137,9 @@
"path": "uni_modules/uni-agree/pages/uni-agree/uni-agree", "path": "uni_modules/uni-agree/pages/uni-agree/uni-agree",
"style": { "style": {
"navigationStyle": "custom", "navigationStyle": "custom",
"app-plus":{"popGesture": "none"} "app-plus": {
"popGesture": "none"
}
} }
}, { }, {
"path": "pages/ucenter/settings/settings", "path": "pages/ucenter/settings/settings",
...@@ -195,8 +196,8 @@ ...@@ -195,8 +196,8 @@
}, },
{ {
"path":"uni_modules/uni-news-favorite/pages/uni-news-favorite/list", "path": "uni_modules/uni-news-favorite/pages/uni-news-favorite/list",
"style":{ "style": {
"navigationBarTitleText": "阅读记录", "navigationBarTitleText": "阅读记录",
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
disabled /> disabled />
</template> </template>
<!-- banner --> <!-- banner -->
<unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" :collection="collection" <unicloud-db ref="bannerdb" v-slot:default="{data, loading, error, options}" collection="opendb-banner"
:field="field" @load="load"> :field="field" @load="load">
<uni-swiper-dot class="uni-swiper-dot-box" @clickItem="clickItem" :info="data || bannerFormate(data, loading)" <uni-swiper-dot class="uni-swiper-dot-box" @clickItem="clickItem" :info="data || bannerFormate(data, loading)"
:current="current" :mode="mode" :dots-styles="dotsStyles" field="content"> :current="current" :mode="mode" :dots-styles="dotsStyles" field="content">
...@@ -88,8 +88,6 @@ ...@@ -88,8 +88,6 @@
text: 'Grid 9' text: 'Grid 9'
} }
], ],
collection: 'opendb-banner',
// 查询字段,多个字段用 , 分割 // 查询字段,多个字段用 , 分割
field: '_id,bannerfile,open_url,title', field: '_id,bannerfile,open_url,title',
where: 'category_id==grid', where: 'category_id==grid',
......
<template> <template>
<view class="box"> <view class="box">
<!-- 登录框 (选择手机号所属国家和地区需要另行实现) --> <!-- 登录框 (选择手机号所属国家和地区需要另行实现) -->
<uni-easyinput focus type="number" class="phone-input-box" :inputBorder="false" v-model="formData.phone" <uni-easyinput clearable focus type="number" class="input-box" :inputBorder="false" v-model="formData.phone"
maxlength="11" placeholder="请输入手机号"></uni-easyinput> maxlength="11" placeholder="请输入手机号"></uni-easyinput>
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false" v-model="formData.code" maxlength="6" <uni-easyinput clearable type="number" class="input-box" :inputBorder="false" v-model="formData.code" maxlength="6"
placeholder="请输入验证码"> placeholder="请输入验证码">
<template slot="right"> <template slot="right">
<login-short-code ref="shortCode" :phone="formData.phone"></login-short-code> <send-sms-code ref="shortCode" code-type="bind" :phone="formData.phone"></send-sms-code>
</template> </template>
</uni-easyinput> </uni-easyinput>
<button class="send-btn-box" type="primary" @click="submit">提交</button> <button class="send-btn-box" type="primary" @click="submit">提交</button>
...@@ -71,16 +71,15 @@ ...@@ -71,16 +71,15 @@
.box { .box {
align-items: center; align-items: center;
justify-content: center; justify-content: center;
padding: 50rpx;
padding-top: 10px; padding-top: 10px;
} }
.box /deep/ .uni-easyinput__content { .box /deep/ .uni-easyinput__content {
height: 45px; height: 50px;
} }
.phone-input-box { .input-box {
width: 650rpx;
height: 50px;
margin-top: 16px; margin-top: 16px;
background-color: #f9f9f9; background-color: #f9f9f9;
border-radius: 6rpx; border-radius: 6rpx;
......
...@@ -91,8 +91,10 @@ ...@@ -91,8 +91,10 @@
}, },
fail: (err) => { fail: (err) => {
console.log(err); console.log(err);
if(err.code=='30002'){
this.bindMobileBySmsCode() this.bindMobileBySmsCode()
} }
}
}) })
}, },
bindMobileBySmsCode() { bindMobileBySmsCode() {
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
<uni-easyinput type="number" class="phone-input-box" :inputBorder="false" <uni-easyinput type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.code" maxlength="6" placeholder="请输入验证码"> v-model="formData.code" maxlength="6" placeholder="请输入验证码">
<template slot="right"> <template slot="right">
<login-short-code :phone="formData.phone" ref="shortCode"></login-short-code> <send-sms-code :phone="formData.phone" ref="shortCode"></send-sms-code>
</template> </template>
</uni-easyinput> </uni-easyinput>
</uni-forms-item> </uni-forms-item>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<uni-easyinput :focus="formData.phone.length" type="number" class="phone-input-box" :inputBorder="false" <uni-easyinput :focus="formData.phone.length" type="number" class="phone-input-box" :inputBorder="false"
v-model="formData.code" maxlength="6" placeholder="请输入验证码"> v-model="formData.code" maxlength="6" placeholder="请输入验证码">
<template slot="right"> <template slot="right">
<login-short-code ref="shortCode" :phone="formData.phone"></login-short-code> <send-sms-code ref="shortCode" :phone="formData.phone"></send-sms-code>
</template> </template>
</uni-easyinput> </uni-easyinput>
</uni-forms-item> </uni-forms-item>
...@@ -93,7 +93,7 @@ import mixin from '../common/loginPage.mixin.js'; ...@@ -93,7 +93,7 @@ import mixin from '../common/loginPage.mixin.js';
<style> <style>
@import url("../common/loginPage.css"); @import url("../common/loginPage.css");
.phone-input-box{ .content-top-title{
margin-top: 20rpx; margin-bottom: 6px;
} }
</style> </style>
...@@ -112,6 +112,9 @@ ...@@ -112,6 +112,9 @@
return getApp().appVersion return getApp().appVersion
} }
// #endif // #endif
,appConfig(){
return getApp().config
}
}, },
methods: { methods: {
...mapMutations({ ...mapMutations({
...@@ -159,12 +162,12 @@ ...@@ -159,12 +162,12 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
if (uni.getSystemInfoSync().platform == "ios") { if (uni.getSystemInfoSync().platform == "ios") {
// 这里填写appstore应用id // 这里填写appstore应用id
let appstoreid = 'id1417078253'; let appstoreid = this.appConfig.marketId.ios;// 'id1417078253';
plus.runtime.openURL("itms-apps://" + 'itunes.apple.com/cn/app/wechat/' + appstoreid + '?mt=8'); plus.runtime.openURL("itms-apps://" + 'itunes.apple.com/cn/app/wechat/' + appstoreid + '?mt=8');
} }
if (uni.getSystemInfoSync().platform == "android") { if (uni.getSystemInfoSync().platform == "android") {
var Uri = plus.android.importClass("android.net.Uri"); var Uri = plus.android.importClass("android.net.Uri");
var uri = Uri.parse("market://details?id=" + plus.runtime.appid); var uri = Uri.parse("market://details?id=" + this.appConfig.marketId.android);
var Intent = plus.android.importClass('android.content.Intent'); var Intent = plus.android.importClass('android.content.Intent');
var intent = new Intent(Intent.ACTION_VIEW, uri); var intent = new Intent(Intent.ACTION_VIEW, uri);
var main = plus.android.runtimeMainActivity(); var main = plus.android.runtimeMainActivity();
......
...@@ -124,19 +124,20 @@ exports.main = async (event, context) => { ...@@ -124,19 +124,20 @@ exports.main = async (event, context) => {
mobile: params.mobile, mobile: params.mobile,
code: params.code code: params.code
}); });
let verifyCode = await uniID.verifyCode({ // let verifyCode = await uniID.verifyCode({
mobile: params.mobile, // mobile: params.mobile,
code: params.code // code: params.code
}) // })
if (verifyCode.code === 0) { // if (verifyCode.code === 0) {
// } else {
// res = verifyCode
// }
res = await uniID.bindMobile({ res = await uniID.bindMobile({
uid: params.uid, uid: params.uid,
mobile: params.mobile mobile: params.mobile,
code: params.code
}) })
} else { console.log(res);
res = verifyCode
}
console.log(res, verifyCode);
break; break;
case 'register': case 'register':
let { let {
...@@ -210,10 +211,10 @@ exports.main = async (event, context) => { ...@@ -210,10 +211,10 @@ exports.main = async (event, context) => {
break; break;
case 'sendSmsCode': case 'sendSmsCode':
//123546
return uniID.setVerifyCode({ return uniID.setVerifyCode({
mobile: params.mobile, mobile: params.mobile,
code:'123456' code:'123456',
type: params.type
}) })
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册