diff --git a/App.vue b/App.vue index baa7332ec48ee594cc44859d45ab2bea2bacf5c0..c03cf91bad16f073b0dcba224d2ad417397b50b9 100644 --- a/App.vue +++ b/App.vue @@ -10,7 +10,7 @@ console.log('App Launch') initApp(); // #ifdef APP-PLUS - checkIsAgree(); + //checkIsAgree(); 暂时先用默认生成的,自定义的等待原生支持后实现。因为启动vue界面时已经,请求了部分权限这并不符合国家的法规 // #endif //#ifdef APP-NVUE || H5 diff --git a/baseapp.config.js b/baseapp.config.js index b642c10c3fcd692ef5d47f99fca57fab63642adf..706a274414ff0f55ade3d85f341507658e94c8f5 100644 --- a/baseapp.config.js +++ b/baseapp.config.js @@ -34,6 +34,10 @@ module.exports = { "url": "https://ask.dcloud.net.cn/protocol.html" } ], - "download": "https://m3w.cn/uniapp" + "download": "https://m3w.cn/uniapp" + }, + "marketId":{//用于打开应用市场评分界面 + "ios":"id1417078253", + "android":"123456" } } diff --git a/common/appInit.js b/common/appInit.js index ef3362fac5bccb28e7095803ac97147ea36b0229..8da69676e94c6e5c8c5f569485c0320a99494579 100644 --- a/common/appInit.js +++ b/common/appInit.js @@ -5,7 +5,11 @@ import callCheckVersion from '@/uni_modules/uni-upgrade-center-app/utils/call-ch // #endif export default function() { // 初始化appVersion(仅app生效) - initAppVersion(); + initAppVersion(); + + // baseappConfig挂载到getApp(). + getApp({allowDefault: true}).config = baseappConfig; + //自定义路由拦截 const { diff --git a/components/login-short-code/login-short-code.vue b/components/send-sms-code/send-sms-code.vue similarity index 71% rename from components/login-short-code/login-short-code.vue rename to components/send-sms-code/send-sms-code.vue index c8a37bfecbdefba55865424b4e2e5e24ea5ef380..9c56d173734adb37d0c77a770adf5f7391ebd279 100644 --- a/components/login-short-code/login-short-code.vue +++ b/components/send-sms-code/send-sms-code.vue @@ -20,7 +20,7 @@ } } export default { - name: "login-short-code", + name: "send-sms-code", props: { /** * 倒计时时长 s @@ -35,6 +35,15 @@ phone: { type: [String, Number], default: '' + }, + /* + 验证码类型,用于防止不同功能的验证码混用,目前支持的类型login登录、register注册、bind绑定手机、unbind解绑手机 + */ + codeType:{ + type: String, + default(){ + return 'login' + } } }, data() { @@ -69,7 +78,7 @@ this.request('user-center/sendSmsCode', { "mobile": this.phone, - "type": "login" + "type": this.codeType },(data,result)=>{ console.log(data,result); uni.showToast({ @@ -79,37 +88,8 @@ this.reverseNumber = Number(this.count); this.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() { if (this.reverseNumber == 0) { diff --git a/js_sdk/request.js b/js_sdk/request.js index 74fe3e60cbb259f26587a7cd4666e3045a1cb755..ffadc8ffd49639708da9d1c3e1f8a98fb532f851 100644 --- a/js_sdk/request.js +++ b/js_sdk/request.js @@ -9,7 +9,6 @@ const debug = true;//开启后,会alert错误信息 export default function request(name,params,callback=false,{showLoading=false,loadText='',fail=()=>{}}={}){ // console.log('request'); showLoading||loadText? uni.showLoading({title:loadText}):''; - let routers = name.split('/'); var action = false if (routers.length>1){ @@ -23,28 +22,12 @@ export default function request(name,params,callback=false,{showLoading=false,lo console.log(e); const {result:{data,code}} = e console.log(data,code); - if (code != 0 ) { - if(debug){ - uni.showModal({ - content: JSON.stringify(e), - showCancel: false, - confirmText: '知道了' - }) - } - } resolve(e) return callback(data,e.result,e) }, fail(err){ reject(err) console.log(err); - if(debug){ - uni.showModal({ - content: JSON.stringify(err), - showCancel: false, - confirmText: '知道了' - }) - } fail(err) }, complete() { diff --git a/manifest.json b/manifest.json index 01f0f87f32cdbfd4f5e272d6c2d1942b16a47bc2..cab672e01a3c8136f65acc03b202aefc28eb4b8e 100644 --- a/manifest.json +++ b/manifest.json @@ -7,6 +7,15 @@ "transformPx" : false, /* 5+App特有相关 */ "app-plus" : { + "privacy" : { + "prompt" : "template", + "template" : { + "title" : "服务协议和隐私政策", + "message" : "  请你务必审慎阅读、充分理解“服务协议”和“隐私政策”各条款,包括但不限于:为了更好的向你提供服务,我们需要收集你的设备标识、操作日志等信息用于分析、优化应用性能。
  你可阅读《服务协议》《隐私政策》了解详细信息。如果你同意,请点击下面按钮开始接受我们的服务。", + "buttonAccept" : "我知道了", + "buttonRefuse" : "暂不同意" + } + }, "compatible" : { "ignoreVersion" : true //true表示忽略版本检查提示框,HBuilderX1.9.0及以上版本支持 }, @@ -31,14 +40,14 @@ "distribute" : { /* android打包配置 */ "android" : { - "permissionExternalStorage" : { - "request" : "none", - "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" - }, - "permissionPhoneState" : { - "request" : "none", - "prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。" - }, + // "permissionExternalStorage" : { + // "request" : "none", + // "prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。" + // }, + // "permissionPhoneState" : { + // "request" : "none", + // "prompt" : "为保证您正常、安全地使用,需要获取设备识别码(部分手机提示为获取手机号码)使用权限,请允许。" + // }, "permissions" : [ "", "", diff --git a/pages.json b/pages.json index f93fd4b1abec2c701135ce9f37bbf63a3e8e08ef..f4098a88d0e73e2275983e6dadfa8f10e1c952ec 100644 --- a/pages.json +++ b/pages.json @@ -61,16 +61,16 @@ } }, { "path": "pages/ucenter/edit/bind-mobile/bind-mobile", + "style": { + "navigationBarTitleText": "绑定手机号码" + } + }, + { + "path": "pages/ucenter/ucenter", "style": { "navigationStyle": "custom" } - }, - { - "path": "pages/ucenter/ucenter", - "style": { - "navigationStyle": "custom" - } - },{ + }, { "path": "uni_modules/uni-feedback/pages/opendb-feedback/list", "style": { "navigationBarTitleText": "常见问题" @@ -90,8 +90,7 @@ "style": { "navigationBarTitleText": "关于" // #ifdef APP-PLUS - , - "app-plus": { + ,"app-plus": { "titleNView": { "buttons": [{ "type": "share" @@ -138,7 +137,9 @@ "path": "uni_modules/uni-agree/pages/uni-agree/uni-agree", "style": { "navigationStyle": "custom", - "app-plus":{"popGesture": "none"} + "app-plus": { + "popGesture": "none" + } } }, { "path": "pages/ucenter/settings/settings", @@ -195,8 +196,8 @@ }, { - "path":"uni_modules/uni-news-favorite/pages/uni-news-favorite/list", - "style":{ + "path": "uni_modules/uni-news-favorite/pages/uni-news-favorite/list", + "style": { "navigationBarTitleText": "阅读记录", "enablePullDownRefresh": false } @@ -246,4 +247,4 @@ "text": "我的" }] } -} +} diff --git a/pages/grid/grid.vue b/pages/grid/grid.vue index 99a925f9897b8813917106ca2fb90e1a9438f12f..8e59303b8306076134a728938c5fedb7bd266432 100644 --- a/pages/grid/grid.vue +++ b/pages/grid/grid.vue @@ -9,7 +9,7 @@ disabled /> - @@ -88,8 +88,6 @@ text: 'Grid 9' } ], - - collection: 'opendb-banner', // 查询字段,多个字段用 , 分割 field: '_id,bannerfile,open_url,title', where: 'category_id==grid', diff --git a/pages/ucenter/edit/bind-mobile/bind-mobile.vue b/pages/ucenter/edit/bind-mobile/bind-mobile.vue index 4faf72719790ed7fa8efc2dc8c0184e778e832cf..0cc472a64d8d7ab42c02cedfd2949d07d5c17bd1 100644 --- a/pages/ucenter/edit/bind-mobile/bind-mobile.vue +++ b/pages/ucenter/edit/bind-mobile/bind-mobile.vue @@ -1,21 +1,21 @@ - - + diff --git a/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue b/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue index 168a0af6279bb8dad6c48720194a49da3f7798eb..88dade8a3b6ad50a1c7531c83097768e6ec6a568 100644 --- a/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue +++ b/pages/ucenter/login-page/pwd-retrieve/pwd-retrieve.vue @@ -3,46 +3,46 @@ - 重置密码 + 重置密码 - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - + diff --git a/pages/ucenter/ucenter.vue b/pages/ucenter/ucenter.vue index f15a88d288b4dbc5c43a8b138cf2ee451276f23c..d73d51a0d31c6313105af98f1c67d3917e907b14 100644 --- a/pages/ucenter/ucenter.vue +++ b/pages/ucenter/ucenter.vue @@ -111,7 +111,10 @@ appVersion() { return getApp().appVersion } - // #endif + // #endif + ,appConfig(){ + return getApp().config + } }, methods: { ...mapMutations({ @@ -156,15 +159,15 @@ * 去应用市场评分 */ gotoMarket() { - // #ifdef APP-PLUS + // #ifdef APP-PLUS if (uni.getSystemInfoSync().platform == "ios") { // 这里填写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'); } if (uni.getSystemInfoSync().platform == "android") { 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 = new Intent(Intent.ACTION_VIEW, uri); var main = plus.android.runtimeMainActivity(); diff --git a/uniCloud-aliyun/cloudfunctions/user-center/index.js b/uniCloud-aliyun/cloudfunctions/user-center/index.js index f07c82c88ca716139deddc2190069a886293277c..6c7f986dae1bbe35f6df62dcb36326ca67088303 100644 --- a/uniCloud-aliyun/cloudfunctions/user-center/index.js +++ b/uniCloud-aliyun/cloudfunctions/user-center/index.js @@ -124,19 +124,20 @@ exports.main = async (event, context) => { mobile: params.mobile, code: params.code }); - let verifyCode = await uniID.verifyCode({ - mobile: params.mobile, - code: params.code + // let verifyCode = await uniID.verifyCode({ + // mobile: params.mobile, + // code: params.code + // }) + // if (verifyCode.code === 0) { + // } else { + // res = verifyCode + // } + res = await uniID.bindMobile({ + uid: params.uid, + mobile: params.mobile, + code: params.code }) - if (verifyCode.code === 0) { - res = await uniID.bindMobile({ - uid: params.uid, - mobile: params.mobile - }) - } else { - res = verifyCode - } - console.log(res, verifyCode); + console.log(res); break; case 'register': let { @@ -210,10 +211,10 @@ exports.main = async (event, context) => { break; case 'sendSmsCode': - //123546 return uniID.setVerifyCode({ mobile: params.mobile, - code:'123456' + code:'123456', + type: params.type })