作者 芦瑞泽

未安装微信提示框

... ... @@ -634,31 +634,76 @@ export default {
},
// 第三方登录
async thirdLogin(provider, payload = null) {
thirdLogin(provider, payload = null) {
let that = this
if (this.platform === 'wxMiniProgram' && payload === null) return;
if (!this.protocol) {
this.$u.toast("请同意用户协议");
return false;
}
const that = this;
let token = "";
switch (provider) {
case "wechat":
token = await wechat.login(payload);
break;
case "alipay":
break;
case "apple":
token = await apple.appleIdOauth();
break;
default:
break;
}
if (token) {
that.closeAuthModal();
that.getUserInfo(token);
}
},
}
if(provider == 'wechat'){
uni.getProvider({
service: 'oauth',
success: function (res) {
console.log(res)
if(res.providers[0].isAppExist){
that.continue(provider,payload)
}else{
uni.showModal({
content:'尚未安装微信,请先安装微信',
success: (res) => {
if(res.confirm){}
}
})
}
}
});
} else{
that.continue(provider,payload)
}
// const that = this;
// let token = "";
// switch (provider) {
// case "wechat":
// token = await wechat.login(payload);
// break;
// case "alipay":
// break;
// case "apple":
// token = await apple.appleIdOauth();
// break;
// default:
// break;
// }
// if (token) {
// that.closeAuthModal();
// that.getUserInfo(token);
// }
},
async continue(provider,payload){
const that = this;
let token = "";
switch (provider) {
case "wechat":
token = await wechat.login(payload);
break;
case "alipay":
break;
case "apple":
token = await apple.appleIdOauth();
break;
default:
break;
}
if (token) {
that.closeAuthModal();
that.getUserInfo(token);
}
},
// 1.账号登录
async accountLoginSubmit() {
... ...
... ... @@ -2,8 +2,8 @@
"name" : "岱珺珏亿万源",
"appid" : "__UNI__ED8B247",
"description" : "岱珺珏亿万源",
"versionName" : "2.1.2",
"versionCode" : 212,
"versionName" : "2.1.3",
"versionCode" : 213,
"transformPx" : false,
"app-plus" : {
"compatible" : {
... ...
... ... @@ -62,7 +62,8 @@ export default {
},
fail: function(res) {
uni.showToast({
title: '请稍后再试'
title: '请稍后再试',
icon:'none'
});
resolve(false);
api('common.debug', {
... ...