65e14c9a by 张猛

登录提示

1 parent 259aafe0
......@@ -214,6 +214,7 @@ import {
unbindUser,
downStuCertSingle
} from '@/common/api.js'
import {onShow} from "@dcloudio/uni-app";
const userStore = useUserStore()
const userInfo = computed(() => userStore.user ?? {})
......@@ -233,31 +234,38 @@ const bindForm = ref({
idcCode: ''
})
const showConfirm = ref(false)
// 标记是否已经弹出过绑定框(避免重复弹出)
let hasOpenedBindPopup = false
onMounted(() => {
onShow(() => {
let webUserName = uni.getStorageSync('webUserName')
if (!webUserName) {
wxLogin().then(getWebInfo)
}
})
// 标记是否已经弹出过绑定框(避免重复弹出)
let hasOpenedBindPopup = false
watch(() => perInfo.value, (newVal, oldVal) => {
console.log(444, newVal?.perCode)
// 只有当 perInfo 数据存在且 perCode 为空时才弹出
if (newVal && !newVal.perCode && !hasOpenedBindPopup) {
if (perInfo.value && !perInfo.value.perCode && !hasOpenedBindPopup) {
hasOpenedBindPopup = true
nextTick(() => {
openBindPopup()
})
}
}, {
immediate: true
})
// watch(() => perInfo.value, (newVal, oldVal) => {
// console.log(444, newVal?.perCode)
//
// // 只有当 perInfo 数据存在且 perCode 为空时才弹出
// if (newVal && !newVal.perCode && !hasOpenedBindPopup) {
// hasOpenedBindPopup = true
// nextTick(() => {
// openBindPopup()
// })
// }
// }, {
// immediate: true
// })
// 打开绑定弹框
const openBindPopup = () => {
if (bindPopup.value) {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!