From 6a0dd7001d36b6bd2f11ec9be5fd2885e0f0ba59 Mon Sep 17 00:00:00 2001 From: linju-json Date: Mon, 7 Jun 2021 19:59:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BA=E8=BF=8E=E5=90=88=E8=8B=B9=E6=9E=9CAp?= =?UTF-8?q?p=20Store=E7=9A=84=E8=A7=84=E5=88=99=EF=BC=8C=E7=99=BB=E9=99=86?= =?UTF-8?q?=E4=B8=8E=E5=88=86=E4=BA=AB=E5=8A=9F=E8=83=BD=E9=A1=B9=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E4=B9=8B=E5=89=8D=E8=87=AA=E5=8A=A8=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=AE=89=E8=A3=85=E4=BA=86=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E3=80=82=E6=AF=94=E5=A6=82=EF=BC=9A?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E6=9C=AA=E5=AE=89=E8=A3=85=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=88=99=E4=B8=8D=E6=98=BE=E7=A4=BA=E5=BE=AE=E4=BF=A1=E5=BF=AB?= =?UTF-8?q?=E6=8D=B7=E7=99=BB=E9=99=86=E5=92=8C=E5=BE=AE=E4=BF=A1=E5=88=86?= =?UTF-8?q?=E4=BA=AB=E9=80=89=E9=A1=B9=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 2 + .../uni-quick-login/uni-quick-login.vue | 137 +++++++------- package.json | 2 +- pages/list/list.nvue | 141 ++++++++------- pages/ucenter/login-page/index/index.vue | 5 +- uni-starter.config.js | 2 +- .../cloudfunctions/uni-id-cf/index.js | 2 +- .../uni-id-cf/package-lock.json | 2 +- uni_modules/uni-id/package.json | 6 +- .../cloudfunctions/common/uni-id/index.js | 2 +- .../common/uni-id/package-lock.json | 16 +- .../cloudfunctions/common/uni-id/package.json | 3 +- uni_modules/uni-share/changelog.md | 6 + .../uni-share/js_sdk/uni-image-menu.js | 171 ++++++++++++++++++ uni_modules/uni-share/js_sdk/uni-share.js | 12 +- uni_modules/uni-share/package.json | 2 +- uni_modules/uni-share/readme.md | 150 ++++++++------- 17 files changed, 448 insertions(+), 213 deletions(-) create mode 100644 uni_modules/uni-share/js_sdk/uni-image-menu.js diff --git a/changelog.md b/changelog.md index 4a93f5a..8911de1 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,5 @@ +## 1.0.15(2021-06-07) +为迎合苹果App Store的规则,登陆与分享功能项显示之前自动检测是否安装了对应客户端。比如:设备未安装微信则不显示微信快捷登陆和微信分享选项。 ## 1.0.14(2021-06-07) 修改错误的表名称uni-verify为opendb-verify-codes ## 1.0.13(2021-06-04) diff --git a/components/uni-quick-login/uni-quick-login.vue b/components/uni-quick-login/uni-quick-login.vue index 24ead91..f1e4a36 100644 --- a/components/uni-quick-login/uni-quick-login.vue +++ b/components/uni-quick-login/uni-quick-login.vue @@ -39,9 +39,9 @@ } }, props: { - agree:{ - type:Boolean, - default(){ + agree: { + type: Boolean, + default () { return false } }, @@ -105,7 +105,7 @@ //去掉配置项中不存在的项 for (var i = 0; i < servicesList.length; i++) { if (!this.loginConfig.includes(servicesList[i].id)) { - console.log('去掉配置项中不存在的项',servicesList[i].id); + console.log('去掉配置项中不存在的项', servicesList[i].id); servicesList.splice(i, 1) } } @@ -119,15 +119,23 @@ oauthServices.forEach(({ id }) => { - // console.log(9527,id); - if (this.config[id].isChecked&&this.loginConfig.includes(id)) { + if (this.config[id].isChecked && this.loginConfig.includes(id)) { + if (id == 'weixin') { + if (~plus.runtime.isApplicationExist({ + pname: 'com.tencent.mm', + action: 'weixin://' + })) { + // console.log("微信应用未安装"); + return + } + } this.servicesList.push({ ...this.config[id], id }) } }) - // console.log(oauthServices); + // console.log('oauthServices',oauthServices); }, err => { uni.hideLoading() uni.showModal({ @@ -171,13 +179,15 @@ } }, login_before(type, navigateBack = true) { - if(!this.agree){ + if (!this.agree) { return uni.showToast({ title: '你未同意隐私政策协议', icon: 'none' }); } - uni.showLoading({mask:true}) + uni.showLoading({ + mask: true + }) // console.log(arguments); let oauthService = this.oauthServices.find((service) => service.id == type) // console.log(type); @@ -195,10 +205,10 @@ }, err => { uni.hideLoading() - console.log(err); - uni.showModal({ - content: JSON.stringify(err), - showCancel: false + console.log(err); + uni.showModal({ + content: JSON.stringify(err), + showCancel: false }); }) } @@ -233,7 +243,7 @@ console.log(err); if (type == 'univerify') { - if (err.metadata&&err.metadata.error_data) { + if (err.metadata && err.metadata.error_data) { uni.showToast({ title: "一键登录:" + err.metadata.error_data, icon: 'none' @@ -249,33 +259,33 @@ uni.navigateBack() } break; - case 30006: - uni.showModal({ - title: "登录服务初始化错误", - content: err.metadata.error_data, - showCancel: false, - confirmText: '知道了', - }); - break; - case "30008": - uni.showToast({ - title: '点击了第三方登陆', - icon: 'none' - }); - switch (err.index){ - case 0: - this.login_before('weixin',false) - break; - case 1: - this.login_before('apple',false) - break; - default: - break; - } - + case 30006: + uni.showModal({ + title: "登录服务初始化错误", + content: err.metadata.error_data, + showCancel: false, + confirmText: '知道了', + }); break; - default: - console.log(9527,err); + case "30008": + uni.showToast({ + title: '点击了第三方登陆', + icon: 'none' + }); + switch (err.index) { + case 0: + this.login_before('weixin', false) + break; + case 1: + this.login_before('apple', false) + break; + default: + break; + } + + break; + default: + console.log(9527, err); break; } } @@ -283,31 +293,34 @@ }) }, login(params, type) { //联网验证登录 + console.log('type--', type); console.log({ params, type }); - uniCloud.callFunction({ - name:'uni-id-cf', - data:{ - action:'login_by_'+type, - params - }, - success: ({result}) => { - console.log(result); - if (result.code === 0) { - if (type == 'univerify') { - uni.closeAuthView() - } - uni.hideLoading() - loginSuccess(result) - delete result.userInfo.token - this.setUserInfo(result.userInfo) - } - }, - complete: () => { - uni.hideLoading() - } + uniCloud.callFunction({ + name: 'uni-id-cf', + data: { + action: 'login_by_' + type, + params + }, + success: ({ + result + }) => { + console.log(result); + if (result.code === 0) { + if (type == 'univerify') { + uni.closeAuthView() + } + uni.hideLoading() + loginSuccess(result) + delete result.userInfo.token + this.setUserInfo(result.userInfo) + } + }, + complete: () => { + uni.hideLoading() + } }) }, async getUserInfo(e) { @@ -357,4 +370,4 @@ margin-top: 4px; font-size: 26rpx; } - + diff --git a/package.json b/package.json index ebf3c99..aa11656 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "id": "uni-starter", "displayName": "uni-starter", - "version": "1.0.14", + "version": "1.0.15", "description": "云端一体应用快速开发模版", "keywords": [ "uni-starter", diff --git a/pages/list/list.nvue b/pages/list/list.nvue index b46c561..007e6ce 100644 --- a/pages/list/list.nvue +++ b/pages/list/list.nvue @@ -1,17 +1,19 @@