2a11a442 by lttnew

个人绑定失败

1 parent 1c937c08
......@@ -969,7 +969,7 @@ function handleDelete(row) {
box-sizing: border-box;
&.dropdown-open-page {
padding-bottom: calc(420rpx + env(safe-area-inset-bottom));
padding-bottom: calc(490rpx + env(safe-area-inset-bottom));
}
}
......@@ -1428,7 +1428,7 @@ function handleDelete(row) {
justify-content: space-around;
align-items: center;
padding-top: 60rpx;
padding-bottom: calc(20rpx + env(safe-area-inset-bottom));
padding-bottom: calc(10rpx + env(safe-area-inset-bottom));
background: #fff;
border-top: 1rpx solid #f0f0f0;
......
<template>
<template>
<view class="page-container">
<!-- 会员卡区域 -->
<view class="member-card">
......@@ -221,11 +221,11 @@ const perInfo = computed(() => userStore.perInfo ?? {})
console.log(222, userInfo.value)
console.log(333, perInfo.value)
// 是否已绑定学员:绑定非会员时只有姓名,没有会员卡号,也应视为已绑定,避免反复弹绑定框。
const isBound = computed(() => {
const perName = perInfo.value?.perName
return perName !== undefined && perName !== null && perName !== ''
})
// 是否已绑定学员:绑定非会员时只有姓名,没有会员卡号,也应视为已绑定,避免反复弹绑定框。
const isBound = computed(() => {
const perName = perInfo.value?.perName
return perName !== undefined && perName !== null && perName !== ''
})
const bindPopup = ref(null)
const bindForm = ref({
......@@ -236,8 +236,8 @@ const showConfirm = ref(false)
// 标记是否已经弹出过绑定框(避免重复弹出)
let hasOpenedBindPopup = false
onShow(() => {
let webUserName = uni.getStorageSync('webUserName')
onShow(() => {
let webUserName = uni.getStorageSync('webUserName')
if (!webUserName) {
// 登录后需要等待数据加载完成
wxLogin().then(res => {
......@@ -259,14 +259,14 @@ onShow(() => {
})
// 检查是否需要弹出绑定框
const checkAndOpenBindPopup = () => {
// 确保 userStore 数据已更新
const currentPerInfo = userStore.perInfo
const hasBoundName = currentPerInfo?.perName
if (currentPerInfo && !hasBoundName && !hasOpenedBindPopup) {
hasOpenedBindPopup = true
nextTick(() => {
openBindPopup()
const checkAndOpenBindPopup = () => {
// 确保 userStore 数据已更新
const currentPerInfo = userStore.perInfo
const hasBoundName = currentPerInfo?.perName
if (currentPerInfo && !hasBoundName && !hasOpenedBindPopup) {
hasOpenedBindPopup = true
nextTick(() => {
openBindPopup()
})
}
}
......@@ -365,16 +365,18 @@ const confirmBind = async () => {
idcCode: bindForm.value.idcCode
}))
uni.hideLoading()
// if (res.data != 1) {
// // handelGo()
// closeBindPopup()
// } else {
uni.showToast({
title: '绑定成功',
icon: 'success'
})
if(res?.data == '1'){
closeBindPopup()
await getWebInfo()
}else{
uni.showToast({
title: res?.data || '绑定失败',
icon: null,
duration: 3000
})
}
// }
if (err) {
console.log(err)
......@@ -437,18 +439,18 @@ const goToAuth = () => {
});
};
const goToScore = () => {
if (!isBound.value) {
uni.showToast({title: '请先绑定学员', icon: 'none'})
return
}
const perId = userInfo.value.perId ?? ''
const name = perInfo.value?.perName ? encodeURIComponent(perInfo.value.perName) : ''
const idcCode = perInfo.value?.perIdcCode ? encodeURIComponent(perInfo.value.perIdcCode) : ''
uni.navigateTo({
url: `/personal/memberInfo?perId=${perId}&name=${name}&idcCode=${idcCode}`
});
};
const goToScore = () => {
if (!isBound.value) {
uni.showToast({title: '请先绑定学员', icon: 'none'})
return
}
const perId = userInfo.value.perId ?? ''
const name = perInfo.value?.perName ? encodeURIComponent(perInfo.value.perName) : ''
const idcCode = perInfo.value?.perIdcCode ? encodeURIComponent(perInfo.value.perIdcCode) : ''
uni.navigateTo({
url: `/personal/memberInfo?perId=${perId}&name=${name}&idcCode=${idcCode}`
});
};
const goToWebView = (type) => {
// const url = "https://member.taekwondo.org.cn/#/authAccurate?type=" + type
......@@ -480,15 +482,15 @@ const goToOrder = () => {
});
};
// 导航到缴费
const goToPay = () => {
const perId = userInfo.value.perId ?? ''
const name = perInfo.value?.perName ? encodeURIComponent(perInfo.value.perName) : ''
const idcCode = perInfo.value?.perIdcCode ? encodeURIComponent(perInfo.value.perIdcCode) : ''
uni.navigateTo({
url: `/personal/addVip_per?perId=${perId}&name=${name}&idcCode=${idcCode}`
});
};
// 导航到缴费
const goToPay = () => {
const perId = userInfo.value.perId ?? ''
const name = perInfo.value?.perName ? encodeURIComponent(perInfo.value.perName) : ''
const idcCode = perInfo.value?.perIdcCode ? encodeURIComponent(perInfo.value.perIdcCode) : ''
uni.navigateTo({
url: `/personal/addVip_per?perId=${perId}&name=${name}&idcCode=${idcCode}`
});
};
// 下载电子会员证
const downCert = async () => {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!