|
|
|
@ -31,7 +31,7 @@ |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<!-- #ifdef APP-NVUE || APP-PLUS --> |
|
|
|
|
<view class="changeType"> |
|
|
|
|
<!-- <view class="changeType"> |
|
|
|
|
<view class="top"> |
|
|
|
|
<view class="devideLine"></view> |
|
|
|
|
<view class="devideText"> |
|
|
|
@ -45,7 +45,7 @@ |
|
|
|
|
微信 |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> --> |
|
|
|
|
<!-- #endif --> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
@ -90,79 +90,79 @@ |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
appwxLogin(){ |
|
|
|
|
var that = this |
|
|
|
|
if(this.checked.length==0){ |
|
|
|
|
uni.$u.toast('请先勾选同意用户协议和隐私政策') |
|
|
|
|
}else{ |
|
|
|
|
uni.login({ |
|
|
|
|
provider: 'weixin', |
|
|
|
|
success: function(loginRes) { |
|
|
|
|
console.log('-------获取openid(unionid)-----'); |
|
|
|
|
console.log(loginRes); |
|
|
|
|
const params={ |
|
|
|
|
access_token: loginRes.authResult.access_token, |
|
|
|
|
openid: loginRes.authResult.openid, |
|
|
|
|
event:'login' |
|
|
|
|
} |
|
|
|
|
console.log(params) |
|
|
|
|
wxapplogin(params,{}).then(res=>{ |
|
|
|
|
console.log(res) |
|
|
|
|
that.$store.commit('login',res.userinfo) |
|
|
|
|
uni.setStorageSync('source','phone') |
|
|
|
|
// uni.reLaunch({ |
|
|
|
|
// url:'/pages/my/my' |
|
|
|
|
// }) |
|
|
|
|
if(that.$store.state.share){ |
|
|
|
|
uni.navigateTo({ |
|
|
|
|
url:"/"+that.$store.state.share |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url:'/pages/my/my' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
// appwxLogin(){ |
|
|
|
|
// var that = this |
|
|
|
|
// if(this.checked.length==0){ |
|
|
|
|
// uni.$u.toast('请先勾选同意用户协议和隐私政策') |
|
|
|
|
// }else{ |
|
|
|
|
// uni.login({ |
|
|
|
|
// provider: 'weixin', |
|
|
|
|
// success: function(loginRes) { |
|
|
|
|
// console.log('-------获取openid(unionid)-----'); |
|
|
|
|
// console.log(loginRes); |
|
|
|
|
// const params={ |
|
|
|
|
// access_token: loginRes.authResult.access_token, |
|
|
|
|
// openid: loginRes.authResult.openid, |
|
|
|
|
// event:'login' |
|
|
|
|
// } |
|
|
|
|
// console.log(params) |
|
|
|
|
// wxapplogin(params,{}).then(res=>{ |
|
|
|
|
// console.log(res) |
|
|
|
|
// that.$store.commit('login',res.userinfo) |
|
|
|
|
// uni.setStorageSync('source','phone') |
|
|
|
|
// // uni.reLaunch({ |
|
|
|
|
// // url:'/pages/my/my' |
|
|
|
|
// // }) |
|
|
|
|
// if(that.$store.state.share){ |
|
|
|
|
// uni.navigateTo({ |
|
|
|
|
// url:"/"+that.$store.state.share |
|
|
|
|
// }) |
|
|
|
|
// }else{ |
|
|
|
|
// uni.reLaunch({ |
|
|
|
|
// url:'/pages/my/my' |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
, |
|
|
|
|
appwxLogin1(){ |
|
|
|
|
if(this.checked.length==0){ |
|
|
|
|
uni.$u.toast('请先勾选同意用户协议和隐私政策'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
var that = this |
|
|
|
|
uni.getProvider({ |
|
|
|
|
service: 'oauth', |
|
|
|
|
success: function(res) { |
|
|
|
|
//支持微信、qq和微博等 |
|
|
|
|
if (~res.provider.indexOf('weixin')) { |
|
|
|
|
uni.login({ |
|
|
|
|
provider: 'weixin', |
|
|
|
|
success: function(loginRes) { |
|
|
|
|
console.log('-------获取openid(unionid)-----'); |
|
|
|
|
console.log(loginRes); |
|
|
|
|
// 获取用户信息 |
|
|
|
|
uni.getUserInfo({ |
|
|
|
|
provider: 'weixin', |
|
|
|
|
success: function(infoRes) { |
|
|
|
|
console.log(infoRes.userInfo); |
|
|
|
|
that.$store.commit('login',infoRes.userInfo) |
|
|
|
|
uni.setStorageSync('source','wx') |
|
|
|
|
uni.reLaunch({ |
|
|
|
|
url:'/pages/my/my' |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// , |
|
|
|
|
// appwxLogin1(){ |
|
|
|
|
// if(this.checked.length==0){ |
|
|
|
|
// uni.$u.toast('请先勾选同意用户协议和隐私政策'); |
|
|
|
|
// return; |
|
|
|
|
// } |
|
|
|
|
// var that = this |
|
|
|
|
// uni.getProvider({ |
|
|
|
|
// service: 'oauth', |
|
|
|
|
// success: function(res) { |
|
|
|
|
// //支持微信、qq和微博等 |
|
|
|
|
// if (~res.provider.indexOf('weixin')) { |
|
|
|
|
// uni.login({ |
|
|
|
|
// provider: 'weixin', |
|
|
|
|
// success: function(loginRes) { |
|
|
|
|
// console.log('-------获取openid(unionid)-----'); |
|
|
|
|
// console.log(loginRes); |
|
|
|
|
// // 获取用户信息 |
|
|
|
|
// uni.getUserInfo({ |
|
|
|
|
// provider: 'weixin', |
|
|
|
|
// success: function(infoRes) { |
|
|
|
|
// console.log(infoRes.userInfo); |
|
|
|
|
// that.$store.commit('login',infoRes.userInfo) |
|
|
|
|
// uni.setStorageSync('source','wx') |
|
|
|
|
// uni.reLaunch({ |
|
|
|
|
// url:'/pages/my/my' |
|
|
|
|
// }) |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
// } |
|
|
|
|
// }); |
|
|
|
|
// } |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</script> |
|
|
|
|