完善功能

This commit is contained in:
wangxiaowei
2026-04-11 23:00:20 +08:00
parent be1ce34a74
commit 74aa8d8ac4
5 changed files with 333 additions and 67 deletions

View File

@ -9,7 +9,7 @@
<view class="info-name" style="position: absolute; top: 40rpx; left: 40rpx;">{{ info.eg_name }}
</view>
<view class="info-name" style="position: absolute; top: 100rpx; left: 40rpx;">{{ info.name }}</view>
<view v-if="info.order.end_time && id == info.order.group_id" style="position: absolute; bottom: 68rpx; right: 40rpx; display: flex; align-items: center;">
<view v-if="info.order && info.order.end_time && id == info.order.group_id" style="position: absolute; bottom: 68rpx; right: 40rpx; display: flex; align-items: center;">
<image class="diamond" src="https://xh.stnav.com/uploads/sport/icon_zs.png" mode="aspectFit">
</image>
<text style="color: #834B08;font-weight: bold;">有效期{{ info.order.end_time }}到期</text>
@ -81,8 +81,18 @@
<!-- Bottom Button -->
<view class="bottom-bar">
<view class="btn-submit" @click="hanldeTakePhoto" v-if="info.order.end_time && id == info.order.group_id">录入人脸</view>
<view class="btn-submit" @click="handleSubmit" v-else>立即开通</view>
<!-- 两个按钮并排显示的情况 -->
<view class="btn-group" v-if="result && result.status == 1 && id == result.group_id && info.order && info.order.id">
<view class="btn-submit btn-half btn-secondary" @click="hanldeTakePhoto">人脸信息</view>
<view class="btn-submit btn-half" @click="handleSubmit">立即续费</view>
</view>
<!-- 单个按钮显示的情况 -->
<template v-else>
<view class="btn-submit btn-disabled" v-if="result && result.status == 0 && id == result.group_id">审核中</view>
<view class="btn-submit" @click="handleSubmit" v-else-if="result && result.status == 2 && id == result.group_id">重新提交</view>
<view class="btn-submit" @click="handleSubmit" v-else>立即开通</view>
</template>
</view>
<!-- 完善信息提示弹窗 -->
@ -125,10 +135,10 @@
</view>
</view>
<view class="buy-modal-tips">
<view class="buy-modal-tips" v-if="!isRenewal">
开通成功之后需要录入人脸信息
</view>
<view class="buy-modal-btn" @click="confirmBuy">立即开通</view>
<view class="buy-modal-btn" @click="confirmBuy">{{ isRenewal ? '立即续费' : '立即开通' }}</view>
</view>
</view>
@ -167,6 +177,8 @@ export default {
end_time: '', // 会员到期时间
},
}, // 套餐详情数据
result: null, // 审核数据
isRenewal: false, // 是否为续费
};
},
created() {
@ -181,12 +193,30 @@ export default {
this.comboType = args.type || 'adult'
this.id = args.id
this.handleGetDetails();
this.handleInit();
},
methods: {
goBack() {
uni.navigateBack();
},
handleInit() {
let self = this;
self._post(
'ground.group/getGroupData',
{
group_id: self.id
},
result => {
self.result = result.data
console.log("🚀 ~ self.result:", self.result)
},
false,
() => {
}
);
},
handleGetDetails() {
let self = this;
self._post(
@ -194,6 +224,7 @@ export default {
{ id: self.id },
result => {
self.info = result.data;
console.log("🚀 ~ self.info:", self.info)
},
false,
() => {
@ -204,64 +235,55 @@ export default {
handleSubmit() {
let self = this;
// 判断之前是否开通过任意一张会员卡,如果开通过且没有过期,提示"您已购买过套餐卡,无需重复购买"
if (self.info.order?.end_time) {
uni.showToast({ title: '您已购买过套餐卡,无需重复购买', icon: 'none' });
if (self.info.order && self.info.order.id) {
self.isRenewal = true;
} else {
self.isRenewal = false;
}
if (!self.result) {
// 没有填写过信息,弹出完善信息提示弹窗
self.showInfoModal = true;
return false;
}
//TODO 如果信息审核没有通过uni.showToast提示"信息审核没通过,请耐心等待"
// 成人卡不需要提交资料
// if (self.id == 2) {
// self.showBuyModal = true;
// } else {
// 其他卡需要先判断是否提交过资料,如果没有提交过资料,弹出提示完善信息的弹窗;如果提交过资料,根据审核状态提示不同的消息或者弹窗
self._post(
'ground.group/getGroupData',
null,
result => {
console.log("🚀 ~ result.data:", result.data)
if (!result.data) {
// 没有填写过信息,弹出完善信息提示弹窗
self.showInfoModal = true;
return false;
}
if (self.result.status == 0) {
setTimeout(() => {
uni.showToast({ title: '信息审核中,请耐心等待', icon: 'none' });
}, 100);
return false;
}
if (result.data.status == 0) {
setTimeout(() => {
uni.showToast({ title: '信息审核中,请耐心等待', icon: 'none' });
}, 100);
return false;
}
if (self.result.status == 2) {
setTimeout(() => {
uni.showToast({ title: '审核失败,请重新提交', icon: 'none' });
}, 100);
// 没有填写过信息,弹出完善信息提示弹窗
self.showInfoModal = true;
return false;
}
if (result.data.status == 2) {
setTimeout(() => {
uni.showToast({ title: '审核失败,请重新提交', icon: 'none' });
}, 100);
// 没有填写过信息,弹出完善信息提示弹窗
self.showInfoModal = true;
return false;
}
if (result.data.status == 1) {
// 已经审核通过,弹出开通会员弹窗
self.showBuyModal = true;
return false;
}
},
false,
() => {
}
);
// }
if (self.result.status == 1) {
// 已经审核通过,弹出开通会员弹窗
self.showBuyModal = true;
return false;
}
},
closeInfoModal() {
this.showInfoModal = false;
},
goToFillInfo() {
this.showInfoModal = false;
let self = this;
self.showInfoModal = false;
uni.navigateTo({
url: '/bundle/combo/info?id=' + this.id
url: '/bundle/combo/info?id=' + self.id,
events:{
data: (e) => {
if (e.notice == 'success') {
self.handleInit()
}
}
}
});
},
closeBuyModal() {
@ -275,7 +297,7 @@ export default {
let self = this
self.showBuyModal = false;
self._post(
'order.group/submitStoreOrder',
'order.group/submitGroupOrder',
{
group_id: self.id,
group_type: self.selectedPlan, // 1-月卡 2-季卡
@ -328,16 +350,29 @@ export default {
)
},
closeSuccessModal() {
this.showSuccessModal = false;
if (this.isRenewal) {
this.handleGetDetails();
return;
}
let orderId = this.info.order ? this.info.order.id : '';
uni.navigateTo({
url: '/bundle/combo/face-list?id=' + this.id + '&order_id=' + this.info.order.id
url: '/bundle/combo/face-list?id=' + this.id + '&order_id=' + orderId
});
},
hanldeTakePhoto() {
if (this.result.status == 0) {
setTimeout(() => {
uni.showToast({ title: '信息审核中,请耐心等待', icon: 'none' });
}, 100);
return false;
}
let orderId = this.info.order ? this.info.order.id : '';
uni.navigateTo({
url: '/bundle/combo/face-list?id=' + this.id + '&order_id=' + this.info.order.id
url: '/bundle/combo/face-list?id=' + this.id + '&order_id=' + orderId
});
}
}
@ -564,8 +599,17 @@ page {
background-color: #fff;
padding: 20rpx 40rpx 60rpx;
box-sizing: border-box;
box-shadow: 0 -4rpx 20rpx rgba(0, 0, 0, 0.05);
.btn-group {
display: flex;
align-items: center;
justify-content: space-between;
gap: 30rpx;
}
.btn-submit {
flex: 1;
background: linear-gradient(90deg, #F6E1B0 0%, #EDC66E 100%);
color: #333;
font-size: 32rpx;
@ -575,6 +619,26 @@ page {
align-items: center;
justify-content: center;
border-radius: 45rpx;
box-shadow: 0 6rpx 12rpx rgba(237, 198, 110, 0.3);
transition: all 0.2s;
}
.btn-submit:active {
transform: scale(0.98);
box-shadow: 0 2rpx 6rpx rgba(237, 198, 110, 0.2);
}
.btn-disabled {
background: #F5F5F5;
color: #999;
box-shadow: none;
}
.btn-secondary {
background: #FDF8EE;
border: 2rpx solid #EDC66E;
color: #834B08;
box-shadow: none;
}
}