|
@@ -31,12 +31,14 @@
|
|
|
<agree-content-dialog ref="agreeContentDialogRef"></agree-content-dialog>
|
|
|
<agree-dialog ref="agreeDialogRef" @confirm-btn="confirmBtn"></agree-dialog>
|
|
|
<agree-dialog ref="agreeYkDialog" @confirm-btn="ykConfirmBtn"></agree-dialog>
|
|
|
+ <tel-dialog ref="telDialogRef" @telClose="telClose" @bindBtn="bindBtn" v-if="telDialogFlag"></tel-dialog>
|
|
|
</view>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import {
|
|
|
ref,
|
|
|
+ nextTick,
|
|
|
reactive
|
|
|
} from "vue"
|
|
|
import {
|
|
@@ -52,6 +54,8 @@
|
|
|
toast,
|
|
|
getUserIdentity
|
|
|
} from "@/utils/common";
|
|
|
+ import telDialog from './telDialog.vue'
|
|
|
+ import cacheManager from "@/utils/cacheManager.js";
|
|
|
import {
|
|
|
error
|
|
|
} from "uview-plus";
|
|
@@ -65,6 +69,8 @@
|
|
|
const agreeContentDialogRef = ref(null);
|
|
|
const agreeDialogRef = ref(null);
|
|
|
const agreeYkDialog = ref(null);
|
|
|
+ const telDialogRef = ref(null);
|
|
|
+ let telDialogFlag = ref(false);
|
|
|
|
|
|
onLoad((options) => {})
|
|
|
|
|
@@ -84,7 +90,22 @@
|
|
|
indexData.isAgreed = true;
|
|
|
getYzmBtn();
|
|
|
}
|
|
|
-
|
|
|
+ const telClose = () => {
|
|
|
+ telDialogFlag.value = false;
|
|
|
+ }
|
|
|
+ const bindBtn = (res) => {
|
|
|
+ telDialogFlag.value = false;
|
|
|
+ if (res.cardId == 0) {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: `/pages/selectGradesTerms/index`
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ uni.redirectTo({
|
|
|
+ url: `/pages/study/index`
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
const ykConfirmBtn = () => {
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/selectGradesTerms/index`
|
|
@@ -137,26 +158,23 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const wxLoginClick = () => {
|
|
|
-
|
|
|
- //获取服务商信息判断手机端是否安装了app
|
|
|
- // uni.getProvider({
|
|
|
- // service: 'oauth',// oauth 代表授权登录
|
|
|
- // success: function (res) {
|
|
|
- // // 登录
|
|
|
- // uni.login({
|
|
|
- // // 表示授权方式 如果不设置则弹出登录列表选择界面
|
|
|
- // provider: 'weixin',
|
|
|
- // "onlyAuthorize": true, // 微信登录仅请求授权认证
|
|
|
- // success: function (loginRes) {
|
|
|
- // console.log('loginRes',loginRes);
|
|
|
-
|
|
|
- // }
|
|
|
- // });
|
|
|
- // }
|
|
|
- // });
|
|
|
-
|
|
|
-
|
|
|
+ const wxLoginClick = () => {
|
|
|
+ //获取服务商信息判断手机端是否安装了app
|
|
|
+ // uni.getProvider({
|
|
|
+ // service: 'oauth',// oauth 代表授权登录
|
|
|
+ // success: function (res) {
|
|
|
+ // // 登录
|
|
|
+ // uni.login({
|
|
|
+ // // 表示授权方式 如果不设置则弹出登录列表选择界面
|
|
|
+ // provider: 'weixin',
|
|
|
+ // "onlyAuthorize": true, // 微信登录仅请求授权认证
|
|
|
+ // success: function (loginRes) {
|
|
|
+ // console.log('loginRes',loginRes);
|
|
|
+
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // });
|
|
|
uni.login({
|
|
|
"provider": "weixin",
|
|
|
"onlyAuthorize": true, // 微信登录仅请求授权认证
|
|
@@ -170,8 +188,20 @@
|
|
|
"apple": false,
|
|
|
"code": code
|
|
|
}
|
|
|
- wxLogin(req).then(res => {
|
|
|
+ wxLogin(req).then(res => {
|
|
|
console.log(res);
|
|
|
+ if (!res.data.bind) {
|
|
|
+ console.log('未绑定');
|
|
|
+ cacheManager.set('wxLogin', {
|
|
|
+ bind: res.data.bing
|
|
|
+ })
|
|
|
+ telDialogFlag.value = true;
|
|
|
+ nextTick(() => {
|
|
|
+ telDialogRef.value.getOpenId(res.data.openId);
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+
|
|
|
+ }
|
|
|
}).catch((error) => {
|
|
|
console.log(error);
|
|
|
})
|
|
@@ -183,4 +213,4 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-</script>
|
|
|
+</script>
|