|
|
@@ -18,11 +18,12 @@
|
|
|
@click="agreeBtn('ystk')" class="agreement-text">《诚祥学隐私政策》</view>,如您同意,请勾选后开始使用
|
|
|
</view>
|
|
|
</view>
|
|
|
- <button v-show="isAgreedTuceng" hover-class="none" @click="tucengClick" class="phone-green-btn wechat-auth-btn" type="default">
|
|
|
+ <button v-show="isAgreedTuceng" hover-class="none" @click="tucengClick"
|
|
|
+ class="phone-green-btn wechat-auth-btn" type="default">
|
|
|
微信一键登录
|
|
|
</button>
|
|
|
- <button v-show="!isAgreedTuceng" hover-class="none" class="phone-green-btn wechat-auth-btn" type="default" open-type="getPhoneNumber"
|
|
|
- @getphonenumber="onWechatAuth">
|
|
|
+ <button v-show="!isAgreedTuceng" hover-class="none" class="phone-green-btn wechat-auth-btn"
|
|
|
+ type="default" open-type="getPhoneNumber" @getphonenumber="onWechatAuth">
|
|
|
微信一键登录
|
|
|
</button>
|
|
|
<view class="qtdl-btn"><text class="qtdl-text" @click="handleChangeFangshi">其他登录</text></view>
|
|
|
@@ -63,16 +64,50 @@
|
|
|
const openId = ref('');
|
|
|
|
|
|
// 新增变量
|
|
|
- const fromAppShare = ref(true) // 是否来自APP分享
|
|
|
+ const fromAppShare = ref(false) // 是否来自APP分享
|
|
|
|
|
|
const store = useIsCanBack();
|
|
|
|
|
|
onLoad((options) => {
|
|
|
+ console.log('options.from', options);
|
|
|
+ getAllImg();
|
|
|
+ if (options.from == 'my') {
|
|
|
+ fromAppShare.value = true
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ console.log('1111111111');
|
|
|
if (options.from === 'appcx') {
|
|
|
id.value = options.id
|
|
|
fromPage.value = options.from;
|
|
|
}
|
|
|
- getAllImg();
|
|
|
+ uni.login().then(res1 => {
|
|
|
+ console.log('res2222222', res1);
|
|
|
+ code.value = res1.code
|
|
|
+ httpApi.loginApplet({
|
|
|
+ code: res1.code,
|
|
|
+ }).then(result => {
|
|
|
+ console.log('result2222', result);
|
|
|
+ openId.value = result.data.openId
|
|
|
+ if (result.data.bind) {
|
|
|
+ // 保存用户信息
|
|
|
+ if (result.data.loginVo.type == 4) {
|
|
|
+ cacheManager.set('auth', result.data.loginVo)
|
|
|
+ store.setIsCanBack(false)
|
|
|
+ gotoPage();
|
|
|
+ } else if (result.data.loginVo.type == 6) {
|
|
|
+ cacheManager.set('auth', result.data.loginVo)
|
|
|
+ store.setIsCanBack(false)
|
|
|
+ gotoPage2();
|
|
|
+ } else {
|
|
|
+ toast('登录失败,您的身份有误,请联系管理员。')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ fromAppShare.value = true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
})
|
|
|
|
|
|
function handleChange() {
|
|
|
@@ -80,12 +115,14 @@
|
|
|
isAgreedTuceng.value = !isAgreedTuceng.value
|
|
|
|
|
|
}
|
|
|
- function tucengClick (){
|
|
|
+
|
|
|
+ function tucengClick() {
|
|
|
if (!isAgreed.value) {
|
|
|
toast('请先阅读并同意用户协议和隐私政策')
|
|
|
return // 直接返回,不执行后面的授权逻辑
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
function agreeBtn(code) {
|
|
|
if (code === 'yhxy') {
|
|
|
uni.navigateTo({
|