Compare commits
12 Commits
8854cdd32d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 4d62d1bd04 | |||
| aed08c445e | |||
| d897df444b | |||
| 81bc063586 | |||
| a4e9fa5daf | |||
| 5edfca8ff2 | |||
| f8ac363bcd | |||
| 74aa8d8ac4 | |||
| be1ce34a74 | |||
| 2a95c0e176 | |||
| 2e568f8f8d | |||
| c9c1d74957 |
@ -4,31 +4,20 @@
|
||||
|
||||
<view style="margin-top: 20px;">
|
||||
<!-- 青年卡 -->
|
||||
<view class="pr d-c-c mb-20" @click="jumpPage('/bundle/combo/details?type=youth')">
|
||||
<view class="pr d-c-c mb-20" v-for="item in list" :key="item.id" @click="jumpPage(`/bundle/combo/details?id=${item.id}`)">
|
||||
<view class="pr">
|
||||
<image src="https://xh.stnav.com/uploads/sport/qnk.png" style="width: 690rpx; height: 300rpx;" />
|
||||
<view class="kt-btn-bg">
|
||||
<view>立即开通</view>
|
||||
<image :src="item.img" style="width: 690rpx; height: 300rpx;" />
|
||||
<view class="kt-eg-name">
|
||||
{{ item.eg_name }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 成人卡 -->
|
||||
<view class="pr d-c-c mb-20" @click="jumpPage('/bundle/combo/details?type=adult')">
|
||||
<view class="pr">
|
||||
<image src="https://xh.stnav.com/uploads/sport/crk.png" style="width: 690rpx; height: 300rpx;" />
|
||||
<view class="kt-name">{{ item.name }}</view>
|
||||
<view class="kt-btn-bg">
|
||||
<view>立即开通</view>
|
||||
<view :class="item.order ? 'kt-txt2' : 'kt-txt1'">{{ item.order ? '续费' : '立即开通' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 亲子卡 -->
|
||||
<view class="pr d-c-c" @click="jumpPage('/bundle/combo/details?type=family')">
|
||||
<view class="pr">
|
||||
<image src="https://xh.stnav.com/uploads/sport/qzk.png" style="width: 690rpx; height: 300rpx;" />
|
||||
<view class="kt-btn-bg">
|
||||
<view>立即开通</view>
|
||||
|
||||
<view class="kt-price-box" style="position: absolute; right: 40rpx; bottom: 22rpx; display: flex; align-items: center;">
|
||||
<view class="kt-price" v-if="item.month_price && item.month_price > 0" style="color: #977A5D; font-size: 28rpx; font-weight: bold; margin-right: 20rpx;">月卡 ¥{{ item.month_price }}</view>
|
||||
<view class="kt-price" v-if="item.seasonal_price && item.seasonal_price > 0" style="color: #977A5D; font-size: 28rpx; font-weight: bold;">季卡 ¥{{ item.seasonal_price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -45,10 +34,28 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
list: [],
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.handleGetList();
|
||||
},
|
||||
methods: {
|
||||
handleGetList() {
|
||||
// 获取套餐卡列表
|
||||
let self = this;
|
||||
self._post(
|
||||
'ground.group/getGroupList',
|
||||
null,
|
||||
result => {
|
||||
self.list = result.data;
|
||||
},
|
||||
false,
|
||||
() => {
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/*跳转页面*/
|
||||
jumpPage(path) {
|
||||
this.gotoPage(path);
|
||||
@ -63,6 +70,24 @@ page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.kt-eg-name {
|
||||
position: absolute;
|
||||
left: 46rpx;
|
||||
top: 52rpx;
|
||||
color: #C2863E;
|
||||
font-size: 36rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.kt-name {
|
||||
position: absolute;
|
||||
left: 64rpx;
|
||||
top: 118rpx;
|
||||
color: #C2863E;
|
||||
font-size: 36rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.kt-btn-bg {
|
||||
position: absolute;
|
||||
left: 34rpx;
|
||||
@ -76,12 +101,26 @@ page {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
|
||||
& view {
|
||||
|
||||
& .kt-txt1 {
|
||||
padding-left: 60rpx;
|
||||
}
|
||||
|
||||
& .kt-txt2 {
|
||||
padding-left: 80rpx;
|
||||
}
|
||||
|
||||
|
||||
.kt-price {
|
||||
color: #C2863E;
|
||||
margin-left: 10rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.mb-20 {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
|
||||
</style>
|
||||
111
bundle/combo/desc.vue
Normal file
111
bundle/combo/desc.vue
Normal file
@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="main-title">秀湖公园篮球场会员卡注意事项</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">1. 实名制使用</view>
|
||||
<view class="section-content">会员卡实行一人一卡/实名绑定制,仅限登记本人或绑定家庭成员使用,严禁转借、共用、倒卖,一经核实,立即停用会员资格且不予退费。</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">2. 有效期规则</view>
|
||||
<view class="section-content">• 月卡有效期30天,季卡有效期90天,自开卡激活当日起算,到期自动失效。</view>
|
||||
<view class="section-content">• 会员卡一经办理,不予暂停、不予延期、不可折算退费。</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">3. 入场使用规范</view>
|
||||
<view class="section-content">• 仅限球场正常开放时段入场散客运动,不支持预约、包场、占场。</view>
|
||||
<view class="section-content">• 入场须主动出示会员卡或会员码,配合工作人员核验。</view>
|
||||
<view class="section-content">• 未成年人入场须有监护人陪同,自觉遵守球场安全管理规定。</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">4. 场地与安全责任</view>
|
||||
<view class="section-content">• 运动前请做好热身,量力而行,避免运动损伤,球场仅提供场地,不承担意外运动伤害责任。</view>
|
||||
<view class="section-content">• 爱护场地设施、篮板、地面、座椅等,人为损坏需照价赔偿。</view>
|
||||
<view class="section-content">• 严禁穿黑底鞋、高跟鞋、钉鞋入场;严禁携带宠物、玻璃制品、尖锐物品入场。</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">5. 文明运动要求</view>
|
||||
<view class="section-content">• 禁止在场内追逐打闹、争吵斗殴、恶意犯规、高空抛物等危险行为。</view>
|
||||
<view class="section-content">• 禁止随地吐痰、乱扔垃圾,保持场地整洁。</view>
|
||||
<view class="section-content">• 服从现场管理人员引导,对违规劝阻不听者,有权劝离或取消会员资格。</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">6. 天气与场地调整</view>
|
||||
<view class="section-content">遇雨雪、大风、高温、雷电等恶劣天气,或场地维护、市政活动等情况,球场可临时关闭,不另行补偿天数或费用。</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">7. 遗失与补办</view>
|
||||
<view class="section-content">会员卡遗失、损坏请及时到服务台挂失补办,补办需缴纳工本费,补办后原卡作废,会员权益不变。</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">8. 退费与终止</view>
|
||||
<view class="section-content">• 会员卡一经售出,非球场方重大故障原因,概不退费。</view>
|
||||
<view class="section-content">• 会员严重违反管理规定、屡教不改或造成不良影响的,管理方有权直接终止会员权益,不予退款。</view>
|
||||
</view>
|
||||
|
||||
<view class="section">
|
||||
<view class="section-title">9. 其他说明</view>
|
||||
<view class="section-content">会员权益仅限散客入场使用,不含教学、培训、装备租赁、饮品、停车等其他附加服务。</view>
|
||||
<view class="section-content">本球场保留根据运营需要调整会员规则的权利,调整内容将在现场公示后生效。</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background-color: #f7f8fa;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 40rpx 30rpx 60rpx;
|
||||
background-color: #fff;
|
||||
margin: 20rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.main-title {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
margin-bottom: 50rpx;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.section {
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
color: #834B08;
|
||||
margin-bottom: 16rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.section-content {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
line-height: 1.8;
|
||||
margin-bottom: 12rpx;
|
||||
text-align: justify;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -2,56 +2,20 @@
|
||||
<view class="page-container">
|
||||
<!-- Top Background & Card -->
|
||||
<view class="top-section">
|
||||
<!-- 成人卡 -->
|
||||
<template v-if="comboType === 'adult'">
|
||||
<image class="bg-img" src="https://xh.stnav.com/uploads/sport/crk-bg.png"></image>
|
||||
|
||||
<!-- 添加的卡片文字内容 -->
|
||||
<view class="card-text-content" :style="{ top: (statusBarHeight + navHeight + 20) + 'px' }">
|
||||
<view class="card-title">
|
||||
<view class="en">Adult Card</view>
|
||||
<view class="zh">成人卡</view>
|
||||
<view style="width: 100%; height: 100%; position: relative;">
|
||||
<image class="bg-img" src="https://xh.stnav.com/uploads/sport/card-bg.png"></image>
|
||||
<view style="position: absolute; left: 50%; transform: translateX(-50%); bottom: 0;">
|
||||
<image :src="info.img" style="width: 690rpx; height: 290rpx;"></image>
|
||||
<view class="info-name" style="position: absolute; top: 40rpx; left: 40rpx;">{{ info.eg_name }}
|
||||
</view>
|
||||
<view class="card-date">
|
||||
<image class="diamond" src="https://xh.stnav.com/uploads/sport/icon_zs.png" mode="aspectFit"></image>
|
||||
<text>有效期:2026.03.05到期</text>
|
||||
<view class="info-name" style="position: absolute; top: 100rpx; left: 40rpx;">{{ info.name }}</view>
|
||||
<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>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 青年卡 -->
|
||||
<template v-if="comboType === 'youth'">
|
||||
<image class="bg-img" src="https://xh.stnav.com/uploads/sport/qnk-bg.png"></image>
|
||||
|
||||
<!-- 添加的卡片文字内容 -->
|
||||
<view class="card-text-content" :style="{ top: (statusBarHeight + navHeight + 20) + 'px' }">
|
||||
<view class="card-title">
|
||||
<view class="en">Adult Card</view>
|
||||
<view class="zh">青年卡</view>
|
||||
</view>
|
||||
<view class="card-date">
|
||||
<image class="diamond" src="https://xh.stnav.com/uploads/sport/icon_zs.png" mode="aspectFit"></image>
|
||||
<text>有效期:2026.03.05到期</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 亲子卡 -->
|
||||
<template v-if="comboType === 'family'">
|
||||
<image class="bg-img" src="https://xh.stnav.com/uploads/sport/qzk-bg.png"></image>
|
||||
|
||||
<!-- 添加的卡片文字内容 -->
|
||||
<view class="card-text-content" :style="{ top: (statusBarHeight + navHeight + 20) + 'px' }">
|
||||
<view class="card-title-parten">
|
||||
<view class="en">Adult Card</view>
|
||||
<view class="zh">亲子卡</view>
|
||||
</view>
|
||||
<view class="card-date">
|
||||
<image class="diamond" src="https://xh.stnav.com/uploads/sport/icon_zs.png" mode="aspectFit"></image>
|
||||
<text>有效期:2026.03.05到期</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
|
||||
<view class="nav-header" :style="{ paddingTop: statusBarHeight + 'px' }">
|
||||
<view class="nav-content" :style="{ height: navHeight + 'px' }">
|
||||
@ -63,14 +27,16 @@
|
||||
|
||||
<!-- Rights Content -->
|
||||
<view class="content-section">
|
||||
<view class="section-title">
|
||||
<image src="https://xh.stnav.com/uploads/sport/hyqy.png" mode="heightFix" style="height: 40rpx;"></image>
|
||||
<view class="section-title" style="margin-top: 20rpx;">
|
||||
<image src="https://xh.stnav.com/uploads/sport/hyqy.png" mode="heightFix" style="height: 40rpx;">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
<view class="rights-list">
|
||||
<view class="right-item">
|
||||
<view class="icon-circle">
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_vip.png" style="width: 80rpx; height: 80rpx;"></image>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_vip.png"
|
||||
style="width: 80rpx; height: 80rpx;"></image>
|
||||
</view>
|
||||
<view class="right-info">
|
||||
<view class="right-name">VIP优惠</view>
|
||||
@ -79,7 +45,8 @@
|
||||
</view>
|
||||
<view class="right-item">
|
||||
<view class="icon-circle">
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_money.png" style="width: 80rpx; height: 80rpx;"></image>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_money.png"
|
||||
style="width: 80rpx; height: 80rpx;"></image>
|
||||
</view>
|
||||
<view class="right-info">
|
||||
<view class="right-name">入场不限次</view>
|
||||
@ -88,7 +55,8 @@
|
||||
</view>
|
||||
<view class="right-item">
|
||||
<view class="icon-circle">
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_service.png" style="width: 80rpx; height: 80rpx;"></image>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_service.png"
|
||||
style="width: 80rpx; height: 80rpx;"></image>
|
||||
</view>
|
||||
<view class="right-info">
|
||||
<view class="right-name">专属客服</view>
|
||||
@ -97,25 +65,70 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view style="margin-bottom: 28rpx;">
|
||||
<view class="section-title" style="margin-bottom: 34rpx;">
|
||||
<image src="https://xh.stnav.com/uploads/sport/hyyh.png" mode="heightFix" style="height: 40rpx;">
|
||||
</image>
|
||||
</view>
|
||||
|
||||
<view class="combo-cards">
|
||||
<view class="combo-card" v-if="info.month_price && info.month_price > 0">
|
||||
<view class="combo-tag pr">
|
||||
<image src="https://xh.stnav.com/uploads/sport/yk_bg.png" style="width: 112rpx; height: 40rpx;"></image>
|
||||
<view class="combo-type1 pb">月卡</view>
|
||||
</view>
|
||||
<view class="combo-price"><text class="currency">¥</text>{{ info.month_price }}</view>
|
||||
<view class="combo-desc">每月/¥{{ info.month_price }}</view>
|
||||
</view>
|
||||
|
||||
<view class="combo-card" v-if="info.seasonal_price && info.seasonal_price > 0">
|
||||
<view class="combo-tag pr">
|
||||
<image src="https://xh.stnav.com/uploads/sport/jk_bg.png" style="width: 112rpx; height: 40rpx;"></image>
|
||||
<view class="combo-type2">季卡</view>
|
||||
</view>
|
||||
<view class="combo-price"><text class="currency">¥</text>{{ info.seasonal_price }}</view>
|
||||
<view class="combo-desc">每季/¥{{ info.seasonal_price }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Rules Box -->
|
||||
<view class="rules-box">
|
||||
<view class="rules-tag">
|
||||
<image src="https://xh.stnav.com/uploads/sport/jshy.png" style="width: 100rpx; height: 80rpx;"></image>
|
||||
<image src="https://xh.stnav.com/uploads/sport/jshy.png" style="width: 100rpx; height: 80rpx;">
|
||||
</image>
|
||||
</view>
|
||||
<view class="rules-title">权益说明</view>
|
||||
<view class="rules-subtitle">更多会员专属权益与服务内容</view>
|
||||
<view class="rules-list">
|
||||
<view class="rule-item">· 这里是权益说明内容,这里是内容</view>
|
||||
<view class="rule-item">· 这里是权益说明内容,这里是内容</view>
|
||||
<view class="rule-item">· 这里是权益说明内容,这里是内容</view>
|
||||
<view class="rule-item">· 这里是权益说明内容,这里是内容</view>
|
||||
<rich-text :nodes="info.content"></rich-text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- Bottom Button -->
|
||||
<view class="bottom-bar">
|
||||
<view class="btn-submit" @click="handleSubmit">立即开通</view>
|
||||
<view class="xy" style="margin-bottom: 32rpx;display: flex; align-items: center;" @click="yxChekced = !yxChekced">
|
||||
<view style="margin-right: 10rpx;" :class="yxChekced ? 'active' : ''">
|
||||
<view class="icon-box d-c-c card-checkout"><span class="icon iconfont icon-xuanze" :style="{ fontSize: '46rpx', color: yxChekced ? '#365A9A' : '#DCDCDC' }"></span>
|
||||
</view>
|
||||
</view>
|
||||
<view style="font-size: 30rpx; color: #666;">
|
||||
我已认真阅读并查看此协议<text style="color: #FF5951;" @click.stop="openNoticeModal">《秀湖网球中心篮球馆会员卡服务协议》</text>
|
||||
</view>
|
||||
</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" @click="handleSubmit">立即续费</view>
|
||||
<view class="btn-submit btn-half btn-secondary" @click="hanldeTakePhoto">人脸信息</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>
|
||||
|
||||
<!-- 完善信息提示弹窗 -->
|
||||
@ -126,7 +139,7 @@
|
||||
<text class="modal-title">温馨提示</text>
|
||||
<view class="close-icon" @click="closeInfoModal">×</view>
|
||||
</view>
|
||||
<view class="modal-desc">检测到您未填写相关信息,为不影响使用请尽快完善</view>
|
||||
<view class="modal-desc">{{ infoModalDesc }}</view>
|
||||
<view class="modal-btn" @click="goToFillInfo">立即去完善</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -136,42 +149,44 @@
|
||||
<view class="buy-modal-mask" @click="closeBuyModal"></view>
|
||||
<view class="buy-modal-content">
|
||||
<view class="buy-modal-title">会员购买</view>
|
||||
|
||||
|
||||
<view class="plan-list">
|
||||
<view class="plan-item" :class="{ active: selectedPlan === 0 }" @click="selectPlan(0)">
|
||||
<view class="plan-item" v-if="info.month_price && info.month_price > 0" :class="{ active: selectedPlan === 1 }" @click="selectPlan(1)">
|
||||
<view class="plan-name">月卡</view>
|
||||
<view class="plan-price">
|
||||
<text style="font-size: 24rpx; margin-right: 4rpx;">¥</text>
|
||||
<text>50.00</text>
|
||||
<text>{{ info.month_price }}</text>
|
||||
</view>
|
||||
<view class="plan-desc">指导价50元/月</view>
|
||||
<view class="plan-desc" v-if="info.m_price && info.m_price > 0">指导价{{ info.m_price }}元/月</view>
|
||||
<view class="check-mark"></view>
|
||||
</view>
|
||||
<view class="plan-item" :class="{ active: selectedPlan === 1 }" @click="selectPlan(1)">
|
||||
<view class="plan-item" v-if="info.seasonal_price && info.seasonal_price > 0" :class="{ active: selectedPlan === 2 }" @click="selectPlan(2)">
|
||||
<view class="plan-name">季卡</view>
|
||||
<view class="plan-price">
|
||||
<text style="font-size: 24rpx; margin-right: 4rpx;">¥</text>
|
||||
<text>128.00</text>
|
||||
<text>{{ info.seasonal_price }}</text>
|
||||
</view>
|
||||
<view class="plan-desc">指导价128元/季</view>
|
||||
<view class="check-mark"></view>
|
||||
</view>
|
||||
<view class="plan-item" :class="{ active: selectedPlan === 2 }" @click="selectPlan(2)">
|
||||
<view class="plan-name">年卡</view>
|
||||
<view class="plan-price">
|
||||
<text style="font-size: 24rpx; margin-right: 4rpx;">¥</text>
|
||||
<text>218.00</text>
|
||||
</view>
|
||||
<view class="plan-desc">指导价218元/年</view>
|
||||
<view class="plan-desc" v-if="info.s_price && info.s_price > 0">指导价{{ info.s_price }}元/季</view>
|
||||
<view class="check-mark"></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="buy-modal-tips">
|
||||
提示文字在此处显示提示文字在此处显示提示文字在此处显示提示文字在此处显示提示文字在此处显示
|
||||
<view class="buy-modal-tips" v-if="!isRenewal" @click="openNoticeModal">
|
||||
<text style="font-weight: bold; font-size: 32rpx; margin-right: 4rpx;">·</text>查看注意事项
|
||||
</view>
|
||||
<view class="buy-modal-btn" @click="confirmBuy">{{ isRenewal ? '立即续费' : '立即开通' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="buy-modal-btn" @click="confirmBuy">立即开通</view>
|
||||
<!-- 注意事项弹窗 -->
|
||||
<view class="buy-modal-container" v-if="showNoticeModal">
|
||||
<view class="buy-modal-mask" @click="closeNoticeModal"></view>
|
||||
<view class="buy-modal-content" style="height: 500rpx; display: flex; flex-direction: column;">
|
||||
<view class="buy-modal-title" style="margin-bottom: 30rpx; position: relative;">
|
||||
注意事项
|
||||
<view style="position: absolute; right: 0; top: 0; font-size: 40rpx; color: #999; padding: 0 10rpx;" @click="closeNoticeModal">×</view>
|
||||
</view>
|
||||
<view class="buy-modal-btn" @click="closeNoticeModal">我知道了</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -180,10 +195,12 @@
|
||||
<view class="success-modal-mask" @click="closeSuccessModal"></view>
|
||||
<view class="success-modal-content">
|
||||
<view class="success-img-wrapper">
|
||||
<image class="success-img" src="https://xh.stnav.com/uploads/sport/buy-success.png" mode="widthFix"></image>
|
||||
<image class="success-img" src="https://xh.stnav.com/uploads/sport/buy-success.png" mode="widthFix">
|
||||
</image>
|
||||
<view class="success-confirm-btn" @click="closeSuccessModal">确定</view>
|
||||
</view>
|
||||
<image class="success-close" src="https://xh.stnav.com/uploads/sport/icon_close2.png" mode="aspectFit" @click="closeSuccessModal"></image>
|
||||
<image class="success-close" src="https://xh.stnav.com/uploads/sport/icon_close2.png" mode="aspectFit"
|
||||
@click="closeSuccessModal"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -193,13 +210,26 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
statusBarHeight: 20,
|
||||
navHeight: 44,
|
||||
comboType: 'adult', // 套餐类型:adult(成人卡) youth(青年卡) family(亲子卡)
|
||||
showInfoModal: false, // 完善信息提示弹窗
|
||||
infoModalDesc: '检测到您未填写相关信息,为不影响使用请尽快完善', // 完善信息提示文案
|
||||
showBuyModal: false, // 会员购买弹窗
|
||||
showSuccessModal: false, // 购买成功弹窗
|
||||
selectedPlan: 0, // 选择的套餐
|
||||
showNoticeModal: false, // 注意事项弹窗
|
||||
yxChekced: false,
|
||||
selectedPlan: 1, // 选择的套餐 1-月卡 2-季卡
|
||||
info: {
|
||||
order: {
|
||||
id: 0,
|
||||
group_id: 0, // 套餐ID
|
||||
end_time: '', // 会员到期时间
|
||||
},
|
||||
}, // 套餐详情数据
|
||||
result: null, // 审核数据
|
||||
isRenewal: false, // 是否为续费
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@ -212,34 +242,143 @@ export default {
|
||||
},
|
||||
onLoad(args) {
|
||||
this.comboType = args.type || 'adult'
|
||||
this.id = args.id
|
||||
this.handleGetDetails();
|
||||
this.handleInit();
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
|
||||
handleSubmit() {
|
||||
this.showSuccessModal = true;
|
||||
return false
|
||||
//TODO 如果信息审核没有通过,uni.showToast提示"信息审核没通过,请耐心等待"
|
||||
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,
|
||||
() => {
|
||||
}
|
||||
);
|
||||
|
||||
// 检测是否填写过表单信息,没有的话需要跳转到信息完善页面
|
||||
// 测试:默认 true 弹出购买弹窗。如果为 false 弹出提示完善信息弹窗
|
||||
const hasFilledInfo = true;
|
||||
if (!hasFilledInfo) {
|
||||
this.showInfoModal = true;
|
||||
},
|
||||
|
||||
handleGetDetails() {
|
||||
let self = this;
|
||||
self._post(
|
||||
'ground.group/getGroupDetails',
|
||||
{ id: self.id },
|
||||
result => {
|
||||
self.info = result.data;
|
||||
if (self.info.month_price && self.info.month_price > 0) {
|
||||
self.selectedPlan = 1;
|
||||
} else if (self.info.seasonal_price && self.info.seasonal_price > 0) {
|
||||
self.selectedPlan = 2;
|
||||
}
|
||||
console.log("🚀 ~ self.info:", self.info)
|
||||
},
|
||||
false,
|
||||
() => {
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
handleSubmit() {
|
||||
let self = this;
|
||||
if (!self.yxChekced) {
|
||||
uni.showToast({
|
||||
title: '请认真阅读并查看协议',
|
||||
icon: 'none'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (self.info.order && self.info.order.id) {
|
||||
self.isRenewal = true;
|
||||
} else {
|
||||
// 已经填写过信息,弹出开通会员弹窗
|
||||
this.showBuyModal = true;
|
||||
self.isRenewal = false;
|
||||
}
|
||||
|
||||
if (!self.result) {
|
||||
// 没有填写过信息,弹出完善信息提示弹窗
|
||||
self.infoModalDesc = '检测到您未填写相关信息,为不影响使用请尽快完善';
|
||||
self.showInfoModal = true;
|
||||
return false;
|
||||
}
|
||||
|
||||
const getAge = (dateStr) => {
|
||||
if (!dateStr) return 0;
|
||||
const birthDate = new Date(dateStr);
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - birthDate.getFullYear();
|
||||
const m = today.getMonth() - birthDate.getMonth();
|
||||
if (m < 0 || (m === 0 && today.getDate() < birthDate.getDate())) {
|
||||
age--;
|
||||
}
|
||||
return age;
|
||||
};
|
||||
|
||||
let isAgeInvalid = false;
|
||||
if (self.result && self.result.group_id == 1) {
|
||||
if (getAge(self.result.both) >= 18) isAgeInvalid = true;
|
||||
} else if (self.result && self.result.group_id == 3) {
|
||||
if (self.result.child && self.result.child[0] && getAge(self.result.child[0].both) >= 18) isAgeInvalid = true;
|
||||
} else if (self.result && self.result.group_id == 4) {
|
||||
if (self.result.child && self.result.child[0] && getAge(self.result.child[0].both) >= 18) isAgeInvalid = true;
|
||||
if (self.result.child && self.result.child[1] && getAge(self.result.child[1].both) >= 18) isAgeInvalid = true;
|
||||
}
|
||||
|
||||
if (isAgeInvalid) {
|
||||
// 没有填写过信息或者由于年龄不合规,弹出完善信息提示弹窗
|
||||
self.showInfoModal = true;
|
||||
self.infoModalDesc = '所填信息年龄已满18周岁,需要重新填写信息';
|
||||
return false;
|
||||
}
|
||||
|
||||
if (self.result.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;
|
||||
self.infoModalDesc = '检测到您未填写相关信息,为不影响使用请尽快完善';
|
||||
return false;
|
||||
}
|
||||
|
||||
if (self.result.status == 1) {
|
||||
// 已经审核通过,弹出开通会员弹窗
|
||||
self.showBuyModal = true;
|
||||
return true;
|
||||
}
|
||||
},
|
||||
closeInfoModal() {
|
||||
this.showInfoModal = false;
|
||||
},
|
||||
goToFillInfo() {
|
||||
this.showInfoModal = false;
|
||||
let self = this;
|
||||
self.showInfoModal = false;
|
||||
uni.navigateTo({
|
||||
url: '/bundle/combo/info?type=' + this.comboType
|
||||
url: '/bundle/combo/info?id=' + self.id,
|
||||
events:{
|
||||
data: (e) => {
|
||||
if (e.notice == 'success') {
|
||||
self.handleInit()
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
closeBuyModal() {
|
||||
@ -248,15 +387,136 @@ export default {
|
||||
selectPlan(index) {
|
||||
this.selectedPlan = index;
|
||||
},
|
||||
|
||||
confirmBuy() {
|
||||
this.showBuyModal = false;
|
||||
uni.showToast({ title: '正在为您开通...', icon: 'none' });
|
||||
setTimeout(() => {
|
||||
this.showSuccessModal = true;
|
||||
}, 1000);
|
||||
let self = this
|
||||
|
||||
self.showBuyModal = false;
|
||||
self._post(
|
||||
'order.group/submitGroupOrder',
|
||||
{
|
||||
group_id: self.id,
|
||||
group_type: self.selectedPlan, // 1-月卡 2-季卡
|
||||
order_amount: self.selectedPlan === 1 ? self.info.month_price : self.info.seasonal_price
|
||||
},
|
||||
result => {
|
||||
if (result.code == 1) {
|
||||
uni.showLoading({
|
||||
title: '支付中'
|
||||
});
|
||||
const payId = result.data.lists.id;
|
||||
self._post(
|
||||
'order.group/Pay', {
|
||||
order_id: payId,
|
||||
},
|
||||
function (pay) {
|
||||
console.log("🚀 ~ pay:", pay)
|
||||
uni.requestPayment({
|
||||
provider: 'wxpay',
|
||||
timeStamp: pay.data.payment.timeStamp,
|
||||
nonceStr: pay.data.payment.nonceStr,
|
||||
package: 'prepay_id=' + pay.data.payment.prepay_id,
|
||||
signType: 'MD5',
|
||||
paySign: pay.data.payment.paySign,
|
||||
success: res => {
|
||||
uni.hideLoading();
|
||||
setTimeout(() => {
|
||||
self.handleGetDetails();
|
||||
self.showSuccessModal = true;
|
||||
}, 200);
|
||||
},
|
||||
fail: res => {
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}, 200);
|
||||
},
|
||||
});
|
||||
}
|
||||
);
|
||||
} else {
|
||||
uni.showToast({ title: result.msg || '订单创建失败', icon: 'none' });
|
||||
}
|
||||
},
|
||||
false,
|
||||
() => {
|
||||
}
|
||||
)
|
||||
|
||||
},
|
||||
|
||||
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=' + orderId
|
||||
});
|
||||
},
|
||||
|
||||
openNoticeModal() {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
});
|
||||
// 1. 协议文件地址(可替换为实际后端返回的 word 文件 url)
|
||||
const url = 'https://xh.stnav.com/xhlqfwxy.docx';
|
||||
// 2. 下载 word 文件
|
||||
uni.downloadFile({
|
||||
url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
// 3. 预览 word 文件
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
fileType: 'doc',
|
||||
success: () => {
|
||||
// 预览成功
|
||||
uni.hideLoading();
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
setTimeout(() => {
|
||||
uni.showToast({ title: '无法预览文件', icon: 'none' });
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
uni.hideLoading();
|
||||
// setTimeout(() => {
|
||||
// uni.showToast({ title: '下载失败', icon: 'none' });
|
||||
// }, 1000);
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
|
||||
// setTimeout(() => {
|
||||
// uni.showToast({ title: '下载失败', icon: 'none' });
|
||||
// }, 1000);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
closeNoticeModal() {
|
||||
this.showNoticeModal = false;
|
||||
},
|
||||
|
||||
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=' + orderId
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -267,6 +527,79 @@ page {
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.combo-cards {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
gap: 30rpx;
|
||||
padding: 0 30rpx 0;
|
||||
|
||||
.combo-card {
|
||||
width: 216rpx;
|
||||
background: #FFFFFF;
|
||||
border-radius: 16rpx;
|
||||
border: 2rpx solid #F0DCAF;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding-bottom: 50rpx;
|
||||
position: relative;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0,0,0,0.02);
|
||||
|
||||
.combo-tag {
|
||||
position: absolute;
|
||||
top: -8rpx;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 112rpx;
|
||||
height: 40rpx;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
.combo-type1 {
|
||||
font-size: 28rpx;
|
||||
color: #CB8438;
|
||||
font-weight: 500;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.combo-type2 {
|
||||
font-size: 28rpx;
|
||||
color: #fff;
|
||||
font-weight: 500;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
.combo-price {
|
||||
margin-top: 60rpx;
|
||||
font-size: 44rpx;
|
||||
color: #C2863E;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
||||
.currency {
|
||||
font-size: 28rpx;
|
||||
font-weight: normal;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.combo-desc {
|
||||
margin-top: 20rpx;
|
||||
font-size: 22rpx;
|
||||
color: #888888;
|
||||
text-align: center;
|
||||
line-height: 1.6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.page-container {
|
||||
padding-bottom: 200rpx;
|
||||
}
|
||||
@ -275,7 +608,7 @@ page {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 460rpx;
|
||||
|
||||
|
||||
.bg-img {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -298,6 +631,7 @@ page {
|
||||
font-weight: 500;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.zh {
|
||||
font-size: 32rpx;
|
||||
color: #D19A57;
|
||||
@ -312,6 +646,7 @@ page {
|
||||
font-weight: 500;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.zh {
|
||||
font-size: 32rpx;
|
||||
color: #834B08;
|
||||
@ -328,17 +663,13 @@ page {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
|
||||
.diamond {
|
||||
width: 26rpx;
|
||||
height: 20rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.nav-header {
|
||||
position: relative;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 1;
|
||||
width: 100%;
|
||||
|
||||
@ -363,11 +694,11 @@ page {
|
||||
position: relative;
|
||||
z-index: 1;
|
||||
padding: 40rpx 30rpx 0;
|
||||
|
||||
|
||||
.card-img {
|
||||
width: 100%;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 10rpx 20rpx rgba(0,0,0,0.1);
|
||||
box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -480,12 +811,22 @@ page {
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
z-index: 99;
|
||||
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 {
|
||||
background: linear-gradient( 90deg, #F6E1B0 0%, #EDC66E 100%);
|
||||
flex: 1;
|
||||
background: linear-gradient(90deg, #F6E1B0 0%, #EDC66E 100%);
|
||||
color: #333;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
@ -494,6 +835,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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -606,7 +967,7 @@ page {
|
||||
padding: 50rpx 40rpx;
|
||||
padding-bottom: calc(50rpx + env(safe-area-inset-bottom));
|
||||
z-index: 101;
|
||||
|
||||
|
||||
.buy-modal-title {
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
@ -617,11 +978,12 @@ page {
|
||||
|
||||
.plan-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
justify-content: center;
|
||||
gap: 4%;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.plan-item {
|
||||
width: 31%;
|
||||
width: 48%;
|
||||
border: 2rpx solid #EEEEEE;
|
||||
border-radius: 12rpx;
|
||||
padding: 38rpx 0;
|
||||
@ -670,7 +1032,7 @@ page {
|
||||
height: 40rpx;
|
||||
background-color: #D4B481;
|
||||
border-radius: 20rpx 0 0 0;
|
||||
|
||||
|
||||
&::after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
@ -694,7 +1056,7 @@ page {
|
||||
}
|
||||
|
||||
.buy-modal-btn {
|
||||
background: linear-gradient( 90deg, #F6E1B0 0%, #EDC66E 100%);
|
||||
background: linear-gradient(90deg, #F6E1B0 0%, #EDC66E 100%);
|
||||
color: #333;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
@ -752,7 +1114,7 @@ page {
|
||||
transform: translateX(-50%);
|
||||
width: 396rpx;
|
||||
height: 88rpx;
|
||||
background: linear-gradient( 90deg, #F6E1B0 0%, #EDC66E 100%);
|
||||
background: linear-gradient(90deg, #F6E1B0 0%, #EDC66E 100%);
|
||||
border-radius: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -769,4 +1131,27 @@ page {
|
||||
margin-top: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.info-name {
|
||||
font-weight: bold;
|
||||
font-size: 32rpx;
|
||||
color: #834B08;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
|
||||
.diamond {
|
||||
width: 26rpx;
|
||||
height: 20rpx;
|
||||
margin-right: 6rpx;
|
||||
}
|
||||
|
||||
.xy {
|
||||
.active {
|
||||
.card-checkout {
|
||||
.iconfont {
|
||||
color: #365A9A;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
257
bundle/combo/face-list.vue
Normal file
257
bundle/combo/face-list.vue
Normal file
@ -0,0 +1,257 @@
|
||||
<template>
|
||||
<view>
|
||||
<!-- 青年卡 -->
|
||||
<view v-if="id == 1"
|
||||
@click="handleTakePhoto('youth')"
|
||||
class="photo-item" style="display: flex; align-items: center; justify-content: space-between; padding: 30rpx; background-color: #ffffff; border-radius: 12rpx; margin: 20rpx;">
|
||||
<view style="display: flex; align-items: center;">
|
||||
<image src="https://xh.stnav.com/uploads/sport/face2.png" style="width: 90rpx; height: 90rpx; margin-right: 20rpx;"></image>
|
||||
<view>人脸录入</view>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<text style="color: #666; font-size: 28rpx; margin-right: 10rpx;">{{ youthFace ? '已录入' : '去录入' }}</text>
|
||||
<image src="/static/icon/right.png" style="width: 32rpx; height: 32rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 成人卡 -->
|
||||
<view v-if="id == 2"
|
||||
@click="handleTakePhoto('adult')"
|
||||
class="photo-item" style="display: flex; align-items: center; justify-content: space-between; padding: 30rpx; background-color: #ffffff; border-radius: 12rpx; margin: 20rpx;">
|
||||
<view style="display: flex; align-items: center;">
|
||||
<image src="https://xh.stnav.com/uploads/sport/face2.png" style="width: 90rpx; height: 90rpx; margin-right: 20rpx;"></image>
|
||||
<view>人脸录入</view>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<text style="color: #666; font-size: 28rpx; margin-right: 10rpx;">{{ adultFace ? '已录入' : '去录入' }}</text>
|
||||
<image src="/static/icon/right.png" style="width: 32rpx; height: 32rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 子女1 -->
|
||||
<view v-if="id == 3 || id == 4"
|
||||
@click="handleTakePhoto('child1')"
|
||||
class="photo-item" style="display: flex; align-items: center; justify-content: space-between; padding: 30rpx; background-color: #ffffff; border-radius: 12rpx; margin: 20rpx;">
|
||||
<view style="display: flex; align-items: center;">
|
||||
<image src="https://xh.stnav.com/uploads/sport/face2.png" style="width: 90rpx; height: 90rpx; margin-right: 20rpx;"></image>
|
||||
<view>子女1录入</view>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<text style="color: #666; font-size: 28rpx; margin-right: 10rpx;">{{ child1Face ? '已录入' : '去录入' }}</text>
|
||||
<image src="/static/icon/right.png" style="width: 32rpx; height: 32rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 子女2 -->
|
||||
<view v-if="id == 4"
|
||||
@click="handleTakePhoto('child2')"
|
||||
class="photo-item" style="display: flex; align-items: center; justify-content: space-between; padding: 30rpx; background-color: #ffffff; border-radius: 12rpx; margin: 20rpx;">
|
||||
<view style="display: flex; align-items: center;">
|
||||
<image src="https://xh.stnav.com/uploads/sport/face2.png" style="width: 90rpx; height: 90rpx; margin-right: 20rpx;"></image>
|
||||
<view>子女2录入</view>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<text style="color: #666; font-size: 28rpx; margin-right: 10rpx;">{{ child2Face ? '已录入' : '去录入' }}</text>
|
||||
<image src="/static/icon/right.png" style="width: 32rpx; height: 32rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 亲子卡1 -->
|
||||
<view v-if="id == 3 || id == 4"
|
||||
@click="handleTakePhoto('parent1')"
|
||||
class="photo-item" style="display: flex; align-items: center; justify-content: space-between; padding: 30rpx; background-color: #ffffff; border-radius: 12rpx; margin: 20rpx;">
|
||||
<view style="display: flex; align-items: center;">
|
||||
<image src="https://xh.stnav.com/uploads/sport/face2.png" style="width: 90rpx; height: 90rpx; margin-right: 20rpx;"></image>
|
||||
<view>家长1录入</view>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<text style="color: #666; font-size: 28rpx; margin-right: 10rpx;">{{ parent1Face ? '已录入' : '去录入' }}</text>
|
||||
<image src="/static/icon/right.png" style="width: 32rpx; height: 32rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 亲子卡2 -->
|
||||
<view v-if="id == 3 || id == 4"
|
||||
@click="handleTakePhoto('parent2')"
|
||||
class="photo-item" style="display: flex; align-items: center; justify-content: space-between; padding: 30rpx; background-color: #ffffff; border-radius: 12rpx; margin: 20rpx;">
|
||||
<view style="display: flex; align-items: center;">
|
||||
<image src="https://xh.stnav.com/uploads/sport/face2.png" style="width: 90rpx; height: 90rpx; margin-right: 20rpx;"></image>
|
||||
<view>家长2录入</view>
|
||||
</view>
|
||||
<view style="display: flex; align-items: center;">
|
||||
<text style="color: #666; font-size: 28rpx; margin-right: 10rpx;">{{ parent2Face ? '已录入' : '去录入' }}</text>
|
||||
<image src="/static/icon/right.png" style="width: 32rpx; height: 32rpx;"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
order_id: 0,
|
||||
youthFace: '',
|
||||
adultFace: '',
|
||||
child1Face: '',
|
||||
child2Face: '',
|
||||
parent1Face: '',
|
||||
parent2Face: '',
|
||||
}
|
||||
},
|
||||
onLoad(args) {
|
||||
this.id = args.id
|
||||
this.order_id = args.order_id
|
||||
|
||||
this.handleGetGroupData()
|
||||
},
|
||||
methods: {
|
||||
/*获取开通会员信息*/
|
||||
handleGetGroupData() {
|
||||
let self = this;
|
||||
|
||||
self._post(
|
||||
'ground.group/getGroupData',
|
||||
{group_id: self.id},
|
||||
result => {
|
||||
if (result.data && result.data.face_url) {
|
||||
self.youthFace = result.data.face_url;
|
||||
self.adultFace = result.data.face_url;
|
||||
}
|
||||
|
||||
if (result.data && result.data.face_url) {
|
||||
self.child1Face = result.data.face_url;
|
||||
}
|
||||
|
||||
if (result.data && result.data.face_url1) {
|
||||
self.child2Face = result.data.face_url1;
|
||||
}
|
||||
|
||||
if (result.data && result.data.parent.length > 0) {
|
||||
self.parent1Face = result.data.parent[0].face_url;
|
||||
if (result.data.parent.length > 1) {
|
||||
self.parent2Face = result.data.parent[1].face_url;
|
||||
}
|
||||
}
|
||||
},
|
||||
false,
|
||||
() => {
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/*去拍照*/
|
||||
handleTakePhoto(type) {
|
||||
if (type === 'youth' && this.youthFace) {
|
||||
uni.previewImage({
|
||||
urls: [this.youthFace]
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type === 'adult' && this.adultFace) {
|
||||
uni.previewImage({
|
||||
urls: [this.adultFace]
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type === 'child1' && this.child1Face) {
|
||||
uni.previewImage({
|
||||
urls: [this.child1Face]
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type === 'child2' && this.child2Face) {
|
||||
uni.previewImage({
|
||||
urls: [this.child2Face]
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type === 'parent1' && this.parent1Face) {
|
||||
uni.previewImage({
|
||||
urls: [this.parent1Face]
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (type === 'parent2' && this.parent2Face) {
|
||||
uni.previewImage({
|
||||
urls: [this.parent2Face]
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
let self = this
|
||||
uni.navigateTo({
|
||||
url: `/bundle/combo/face-photo?type=${type}`,
|
||||
events:{
|
||||
data: (e) => {
|
||||
self.uploadFile(e.path, e.type)
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/*上传图片*/
|
||||
uploadFile: function(filePath, type) {
|
||||
console.log("🚀 ~ filePath:", filePath)
|
||||
let self = this;
|
||||
let params = {
|
||||
token: uni.getStorageSync('token'),
|
||||
app_id: self.getAppId()
|
||||
};
|
||||
uni.showLoading({
|
||||
title: '图片上传中'
|
||||
});
|
||||
uni.uploadFile({
|
||||
url: self.websiteUrl + '/index.php?s=/api/file.upload/image',
|
||||
filePath: filePath,
|
||||
name: 'iFile',
|
||||
formData: params,
|
||||
success: function(res) {
|
||||
uni.hideLoading();
|
||||
|
||||
let result = typeof res.data === 'object' ? res.data : JSON.parse(res.data);
|
||||
if (result.code === 1) {
|
||||
setTimeout(() => {
|
||||
uni.showLoading({
|
||||
title: '人脸录入中...'
|
||||
});
|
||||
}, 100);
|
||||
|
||||
self._post(
|
||||
'ground.group/hikCreate',
|
||||
{
|
||||
app_id: self.getAppId(),
|
||||
face_url: result.data.file_path,
|
||||
order_id: self.order_id,
|
||||
group_id: self.id,
|
||||
},
|
||||
function(res) {
|
||||
console.log("🚀 ~ res:", res)
|
||||
uni.hideLoading();
|
||||
setTimeout(() => {
|
||||
self.handleGetGroupData()
|
||||
uni.showToast({
|
||||
title: '操作成功',
|
||||
duration: 1500,
|
||||
icon: 'success'
|
||||
});
|
||||
}, 100);
|
||||
}
|
||||
);
|
||||
} else {
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
uni.hideLoading();
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
36
bundle/combo/face-photo.vue
Normal file
36
bundle/combo/face-photo.vue
Normal file
@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<!-- <@devicePosition: 摄像头位置 前置或后置摄像头,值为front, back
|
||||
@quality: 成像质量,值为high(高质量)、normal(普通质量)、low(低质量) -->
|
||||
<view>
|
||||
<hao-camera
|
||||
:devicePosition="back"
|
||||
:quality="low"
|
||||
@confirmPhoto="confirmPhoto"
|
||||
></hao-camera>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import haoCamera from '@/uni_modules/hao-camera/components/hao-camera/hao-camera.vue';
|
||||
export default {
|
||||
components: {
|
||||
haoCamera
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
type: '',
|
||||
}
|
||||
},
|
||||
onLoad(args) {
|
||||
this.type = args.type || '';
|
||||
},
|
||||
methods: {
|
||||
confirmPhoto(filePath){
|
||||
console.log("🚀 ~ filePath:", filePath)
|
||||
let self = this
|
||||
uni.navigateBack()
|
||||
this.getOpenerEventChannel().emit('data',{path: filePath, type: self.type});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@ -3,57 +3,184 @@
|
||||
<navbar title="完善信息" bg="#F6F7F8"></navbar>
|
||||
|
||||
<view class="container" style="padding-top: 20px;">
|
||||
<!-- 基本信息 -->
|
||||
<view class="form-card">
|
||||
<!-- 青年卡-基本信息 -->
|
||||
<view class="form-card" v-if="id == 1">
|
||||
<view class="section-title">
|
||||
基本信息 <text class="required">*</text>
|
||||
基本信息 <text class="required">*</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">姓名</view>
|
||||
<input class="input" type="text" placeholder="请填写姓名" placeholder-class="placeholder-style" v-model="formData.name" />
|
||||
<input class="input" type="text" placeholder="请填写姓名" placeholder-class="placeholder-style"
|
||||
v-model="formData.youth.name" />
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">出生年月</view>
|
||||
<picker mode="date" @change="onDateChange">
|
||||
<view class="picker-view" :class="{'has-value': formData.birth}">
|
||||
<text>{{ formData.birth || '请选择出生年月' }}</text>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_down.png" style="width: 36rpx; height: 36rpx;" mode="aspectFit"></image>
|
||||
<picker mode="date" :end="endDate" @change="onYouthDateChange">
|
||||
<view class="picker-view" :class="{ 'has-value': formData.youth.both }">
|
||||
<text>{{ formData.youth.both || '请选择出生年月' }}</text>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_down.png"
|
||||
style="width: 36rpx; height: 36rpx;" mode="aspectFit"></image>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item no-border">
|
||||
<view class="label">身份证号</view>
|
||||
<input class="input" type="idcard" placeholder="请输入身份证号码" placeholder-class="placeholder-style" v-model="formData.idCard" />
|
||||
<input class="input" type="idcard" placeholder="请输入身份证号码" placeholder-class="placeholder-style"
|
||||
v-model="formData.youth.card" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 随行子女信息 -->
|
||||
<view class="form-card" v-if="comboType === 'family'">
|
||||
<!-- 成人卡-基本信息 -->
|
||||
<view class="form-card" v-if="id == 2">
|
||||
<view class="section-title">
|
||||
随行子女信息 <text class="required">*</text>
|
||||
基本信息 <text class="required">*</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">姓名</view>
|
||||
<input class="input" type="text" placeholder="请填写姓名" placeholder-class="placeholder-style" v-model="formData.childName" />
|
||||
<input class="input" type="text" placeholder="请填写姓名" placeholder-class="placeholder-style"
|
||||
v-model="formData.adult.name" />
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">出生年月</view>
|
||||
<picker mode="date" @change="onChildDateChange">
|
||||
<view class="picker-view" :class="{'has-value': formData.childBirth}">
|
||||
<text>{{ formData.childBirth || '请选择出生年月' }}</text>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_down.png" style="width: 36rpx; height: 36rpx;" mode="aspectFit"></image>
|
||||
<picker mode="date" :end="endDate" @change="onAdultDateChange">
|
||||
<view class="picker-view" :class="{ 'has-value': formData.adult.both }">
|
||||
<text>{{ formData.adult.both || '请选择出生年月' }}</text>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_down.png"
|
||||
style="width: 36rpx; height: 36rpx;" mode="aspectFit"></image>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item no-border">
|
||||
<view class="label">身份证号</view>
|
||||
<input class="input" type="idcard" placeholder="请输入身份证号码" placeholder-class="placeholder-style" v-model="formData.childIdCard" />
|
||||
<input class="input" type="idcard" placeholder="请输入身份证号码" placeholder-class="placeholder-style"
|
||||
v-model="formData.adult.card" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 家长1基本信息 -->
|
||||
<view class="form-card" v-if="id == 3 || id == 4">
|
||||
<view class="section-title">
|
||||
家长1基本信息 <text class="required">*</text>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">姓名</view>
|
||||
<input class="input" type="text" placeholder="请填写姓名" placeholder-class="placeholder-style"
|
||||
v-model="formData.parents[0].name" />
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">出生年月</view>
|
||||
<picker mode="date" :end="endDate" @change="(e) => onParentDateChange(e, 0)">
|
||||
<view class="picker-view" :class="{ 'has-value': formData.parents[0].both }">
|
||||
<text>{{ formData.parents[0].both || '请选择出生年月' }}</text>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_down.png"
|
||||
style="width: 36rpx; height: 36rpx;" mode="aspectFit"></image>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item no-border">
|
||||
<view class="label">身份证号</view>
|
||||
<input class="input" type="idcard" placeholder="请输入身份证号码" placeholder-class="placeholder-style"
|
||||
v-model="formData.parents[0].card" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 家长基本信息2 -->
|
||||
<view class="form-card" v-if="id == 3 || id == 4">
|
||||
<view class="section-title">
|
||||
家长2基本信息 <text class="required">*</text>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">姓名</view>
|
||||
<input class="input" type="text" placeholder="请填写姓名" placeholder-class="placeholder-style"
|
||||
v-model="formData.parents[1].name" />
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">出生年月</view>
|
||||
<picker mode="date" :end="endDate" @change="(e) => onParentDateChange(e, 1)">
|
||||
<view class="picker-view" :class="{ 'has-value': formData.parents[1].both }">
|
||||
<text>{{ formData.parents[1].both || '请选择出生年月' }}</text>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_down.png"
|
||||
style="width: 36rpx; height: 36rpx;" mode="aspectFit"></image>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item no-border">
|
||||
<view class="label">身份证号</view>
|
||||
<input class="input" type="idcard" placeholder="请输入身份证号码" placeholder-class="placeholder-style"
|
||||
v-model="formData.parents[1].card" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 随行子女1信息 -->
|
||||
<view class="form-card" v-if="id == 3 || id == 4">
|
||||
<view class="section-title">
|
||||
随行子女1信息 <text class="required">*</text>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">姓名</view>
|
||||
<input class="input" type="text" placeholder="请填写姓名" placeholder-class="placeholder-style"
|
||||
v-model="formData.child[0].name" />
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">出生年月</view>
|
||||
<picker mode="date" :end="endDate" @change="(e) => onChildDateChange(e, 0)">
|
||||
<view class="picker-view" :class="{ 'has-value': formData.child[0].both }">
|
||||
<text>{{ formData.child[0].both || '请选择出生年月' }}</text>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_down.png"
|
||||
style="width: 36rpx; height: 36rpx;" mode="aspectFit"></image>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item no-border">
|
||||
<view class="label">身份证号</view>
|
||||
<input class="input" type="idcard" placeholder="请输入身份证号码" placeholder-class="placeholder-style"
|
||||
v-model="formData.child[0].card" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 随行子女2信息 -->
|
||||
<view class="form-card" v-if="id == 4">
|
||||
<view class="section-title">
|
||||
随行子女2信息 <text class="required">*</text>
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">姓名</view>
|
||||
<input class="input" type="text" placeholder="请填写姓名" placeholder-class="placeholder-style"
|
||||
v-model="formData.child[1].name" />
|
||||
</view>
|
||||
|
||||
<view class="form-item">
|
||||
<view class="label">出生年月</view>
|
||||
<picker mode="date" :end="endDate" @change="(e) => onChildDateChange(e, 1)">
|
||||
<view class="picker-view" :class="{ 'has-value': formData.child[1].both }">
|
||||
<text>{{ formData.child[1].both || '请选择出生年月' }}</text>
|
||||
<image src="https://xh.stnav.com/uploads/sport/icon_down.png"
|
||||
style="width: 36rpx; height: 36rpx;" mode="aspectFit"></image>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
|
||||
<view class="form-item no-border">
|
||||
<view class="label">身份证号</view>
|
||||
<input class="input" type="idcard" placeholder="请输入身份证号码" placeholder-class="placeholder-style"
|
||||
v-model="formData.child[1].card" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -62,10 +189,11 @@
|
||||
<view class="section-title">
|
||||
联系方式 <text class="required">*</text>
|
||||
</view>
|
||||
|
||||
|
||||
<view class="form-item-row no-border">
|
||||
<view class="label">联系电话</view>
|
||||
<input class="input-grey" type="number" placeholder="请填写联系方式" placeholder-class="placeholder-style-small" v-model="formData.phone" />
|
||||
<input class="input-grey" type="number" placeholder="请填写联系方式"
|
||||
placeholder-class="placeholder-style-small" v-model="formData.mobile" />
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -73,7 +201,7 @@
|
||||
<view class="tips">
|
||||
*提交表单申请,工作人员将在3个工作日内进行审核,如需及时了解,请直接电话咨询,我们将在第一时间解答
|
||||
</view>
|
||||
|
||||
|
||||
<!-- 底部按钮 -->
|
||||
<view class="footer-bar">
|
||||
<view class="btn btn-default" @click="contactUs">联系我们</view>
|
||||
@ -82,10 +210,11 @@
|
||||
|
||||
<!-- 提交成功弹窗 -->
|
||||
<view class="modal-container" v-if="showSuccessPopup">
|
||||
<view class="modal-mask" @click="showSuccessPopup = false"></view>
|
||||
<view class="modal-mask" @click="confirmSuccess"></view>
|
||||
<view class="modal-content">
|
||||
<!-- 注:根据设计图比例此处设为280rpx,猜测28rpx属于笔误 -->
|
||||
<image class="modal-icon" src="https://xh.stnav.com/uploads/sport/add-success.png" style="width: 280rpx; height: 280rpx;"></image>
|
||||
<image class="modal-icon" src="https://xh.stnav.com/uploads/sport/add-success.png"
|
||||
style="width: 280rpx; height: 280rpx;"></image>
|
||||
<view class="modal-title">信息提交成功</view>
|
||||
<view class="modal-desc">请您耐心等候,我们将尽快为您审核</view>
|
||||
<view class="modal-btn" @click="confirmSuccess">好的</view>
|
||||
@ -102,49 +231,340 @@ export default {
|
||||
components: {
|
||||
navbar,
|
||||
},
|
||||
computed: {
|
||||
endDate() {
|
||||
const date = new Date();
|
||||
date.setDate(date.getDate() - 1);
|
||||
const year = date.getFullYear();
|
||||
const month = String(date.getMonth() + 1).padStart(2, '0');
|
||||
const day = String(date.getDate()).padStart(2, '0');
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showSuccessPopup: false,
|
||||
comboType: 'adult', // 套餐类型:adult(成人卡) youth(青年卡) family(亲子卡)
|
||||
formData: {
|
||||
name: '',
|
||||
birth: '',
|
||||
idCard: '',
|
||||
youth: {
|
||||
name: '',
|
||||
both: '',
|
||||
card: '',
|
||||
},
|
||||
adult: {
|
||||
name: '',
|
||||
both: '',
|
||||
card: '',
|
||||
},
|
||||
parents: [
|
||||
{ id: 0, name: '', both: '', card: '' },
|
||||
{ id: 0, name: '', both: '', card: '' }
|
||||
],
|
||||
child: [
|
||||
{ id: 0, name: '', both: '', card: '' },
|
||||
{ id: 0, name: '', both: '', card: '' }
|
||||
],
|
||||
phone: '',
|
||||
childName: '',
|
||||
childBirth: '',
|
||||
childIdCard: ''
|
||||
}
|
||||
group_id: 0
|
||||
},
|
||||
id: 0,
|
||||
isSubmitting: false,
|
||||
setting: {
|
||||
company: {}
|
||||
},
|
||||
info: {}, // 用户信息数据
|
||||
}
|
||||
},
|
||||
onLoad(args) {
|
||||
this.comboType = args.type || 'adult'
|
||||
this.id = args.id
|
||||
this.formData.group_id = this.id
|
||||
this.handleInit()
|
||||
this.handleGetSetting()
|
||||
},
|
||||
methods: {
|
||||
onDateChange(e) {
|
||||
this.formData.birth = e.detail.value;
|
||||
handleInit() {
|
||||
let self = this;
|
||||
self._post(
|
||||
'ground.group/getGroupData',
|
||||
{
|
||||
group_id: self.id
|
||||
},
|
||||
result => {
|
||||
if (result.code && result.data) {
|
||||
const data = result.data;
|
||||
self.info = data;
|
||||
|
||||
self.formData.mobile = data.mobile || '';
|
||||
|
||||
if (data.group_id == 1 ) {
|
||||
// 青年卡
|
||||
self.formData.youth = {
|
||||
name: data.name,
|
||||
both: data.both,
|
||||
card: data.card,
|
||||
}
|
||||
}
|
||||
|
||||
if (data.group_id == 2) {
|
||||
// 成人卡
|
||||
self.formData.adult = {
|
||||
name: data.name,
|
||||
both: data.both,
|
||||
card: data.card,
|
||||
}
|
||||
}
|
||||
|
||||
if (data.group_id == 3 || data.group_id == 4) {
|
||||
// 亲子卡
|
||||
if (data.parent && data.parent.length > 0) {
|
||||
self.$set(self.formData.parents, 0, {
|
||||
id: data.parent[0].id,
|
||||
name: data.parent[0].name,
|
||||
both: data.parent[0].both,
|
||||
card: data.parent[0].card,
|
||||
});
|
||||
}
|
||||
|
||||
if (data.parent && data.parent.length > 1) {
|
||||
self.$set(self.formData.parents, 1, {
|
||||
id: data.parent[1].id,
|
||||
name: data.parent[1].name,
|
||||
both: data.parent[1].both,
|
||||
card: data.parent[1].card,
|
||||
});
|
||||
}
|
||||
|
||||
if (data.child && data.child.length > 0) {
|
||||
self.$set(self.formData.child, 0, {
|
||||
id: data.child[0].id,
|
||||
name: data.child[0].name,
|
||||
both: data.child[0].both,
|
||||
card: data.child[0].card,
|
||||
});
|
||||
} else {
|
||||
self.$set(self.formData.child, 0, {
|
||||
id: 0,
|
||||
name: data.name || '',
|
||||
both: data.both || '',
|
||||
card: data.card || '',
|
||||
});
|
||||
}
|
||||
|
||||
if (data.child && data.child.length > 1) {
|
||||
self.$set(self.formData.child, 1, {
|
||||
id: data.child[1].id,
|
||||
name: data.child[1].name,
|
||||
both: data.child[1].both,
|
||||
card: data.child[1].card,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
false,
|
||||
() => {
|
||||
}
|
||||
);
|
||||
},
|
||||
onChildDateChange(e) {
|
||||
this.formData.childBirth = e.detail.value;
|
||||
|
||||
handleGetSetting() {
|
||||
let self = this;
|
||||
self._post(
|
||||
'ground.ground/groundSetting',
|
||||
{
|
||||
app_id: self.getAppId()
|
||||
},
|
||||
function(res) {
|
||||
if (res.code) {
|
||||
self.setting = res.data;
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
onYouthDateChange(e) {
|
||||
this.formData.youth.both = e.detail.value;
|
||||
},
|
||||
|
||||
onAdultDateChange(e) {
|
||||
this.formData.adult.both = e.detail.value;
|
||||
},
|
||||
|
||||
onParentDateChange(e, index) {
|
||||
this.formData.parents[index].both = e.detail.value;
|
||||
},
|
||||
|
||||
onChildDateChange(e, index) {
|
||||
this.formData.child[index].both = e.detail.value;
|
||||
},
|
||||
|
||||
contactUs() {
|
||||
uni.showToast({ title: '正在连接客服...', icon: 'none' });
|
||||
uni.makePhoneCall({
|
||||
phoneNumber: this.setting.lists.company.contact
|
||||
});
|
||||
},
|
||||
|
||||
submitForm() {
|
||||
if(!this.formData.name || !this.formData.birth || !this.formData.idCard || !this.formData.phone) {
|
||||
return uni.showToast({ title: '请填写完整包含星号的信息', icon: 'none' });
|
||||
let self = this;
|
||||
const regex = /^[1-9]\d{5}(18|19|20)?\d{2}(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])\d{3}[\dXx]$/;
|
||||
|
||||
const validateCardAndAgeMatch = (card, both, prefix, ageRule) => {
|
||||
let idBirthStr = card.length === 15 ? '19' + card.substring(6, 12) : card.substring(6, 14);
|
||||
let idDateStr = `${idBirthStr.substring(0, 4)}-${idBirthStr.substring(4, 6)}-${idBirthStr.substring(6, 8)}`;
|
||||
if (idDateStr !== both) {
|
||||
return `${prefix}出生日期选错了与身份证不符`;
|
||||
}
|
||||
if (ageRule) {
|
||||
const today = new Date();
|
||||
let age = today.getFullYear() - parseInt(idBirthStr.substring(0, 4));
|
||||
const m = (today.getMonth() + 1) - parseInt(idBirthStr.substring(4, 6));
|
||||
if (m < 0 || (m === 0 && today.getDate() < parseInt(idBirthStr.substring(6, 8)))) {
|
||||
age--;
|
||||
}
|
||||
if (ageRule === 'adult' && age < 18) {
|
||||
return `${prefix}必须满18周岁`;
|
||||
}
|
||||
if (ageRule === 'child' && age >= 18) {
|
||||
return `${prefix}须未满18周岁`;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
// id == 1 验证 youth 属性
|
||||
if (self.id == 1) {
|
||||
let youth = self.formData.youth;
|
||||
if (!youth || !youth.name || !youth.both || !youth.card) {
|
||||
return uni.showToast({ title: '请填写完整基本信息', icon: 'none' });
|
||||
}
|
||||
if (!regex.test(youth.card)) {
|
||||
return uni.showToast({ title: '请输入正确的身份证号码', icon: 'none' });
|
||||
}
|
||||
let err = validateCardAndAgeMatch(youth.card, youth.both, '', 'child');
|
||||
if (err) return uni.showToast({ title: err, icon: 'none' });
|
||||
}
|
||||
if(this.comboType === 'family') {
|
||||
if(!this.formData.childName || !this.formData.childBirth || !this.formData.childIdCard) {
|
||||
return uni.showToast({ title: '请填写随行子女信息', icon: 'none' });
|
||||
|
||||
// 成人卡
|
||||
if (self.id == 2) {
|
||||
// 购买成人卡时,需要验证 adult 属性
|
||||
let adult = self.formData.adult;
|
||||
if (!adult || !adult.name || !adult.both || !adult.card) {
|
||||
return uni.showToast({ title: '请填写完整基本信息', icon: 'none' });
|
||||
}
|
||||
if (!regex.test(adult.card)) {
|
||||
return uni.showToast({ title: '请输入正确的身份证号码', icon: 'none' });
|
||||
}
|
||||
let err = validateCardAndAgeMatch(adult.card, adult.both, '', 'adult');
|
||||
if (err) return uni.showToast({ title: err, icon: 'none' });
|
||||
}
|
||||
|
||||
// id == 3(第一个亲子卡) 或 4 时,验证 parents[0] 和 child 属性
|
||||
if (self.id == 3 || self.id == 4) {
|
||||
let p0 = self.formData.parents[0];
|
||||
if (!p0 || !p0.name || !p0.both || !p0.card) {
|
||||
return uni.showToast({ title: '请填写完整家长1基本信息', icon: 'none' });
|
||||
}
|
||||
if (!regex.test(p0.card)) {
|
||||
return uni.showToast({ title: '请输入正确的家长1身份证号码', icon: 'none' });
|
||||
}
|
||||
let err0 = validateCardAndAgeMatch(p0.card, p0.both, '家长1', 'adult');
|
||||
if (err0) return uni.showToast({ title: err0, icon: 'none' });
|
||||
|
||||
let p1 = self.formData.parents[1];
|
||||
if (!p1 || !p1.name || !p1.both || !p1.card) {
|
||||
return uni.showToast({ title: '请填写完整家长2基本信息', icon: 'none' });
|
||||
}
|
||||
if (!regex.test(p1.card)) {
|
||||
return uni.showToast({ title: '请输入正确的家长2身份证号码', icon: 'none' });
|
||||
}
|
||||
let err1 = validateCardAndAgeMatch(p1.card, p1.both, '家长2', 'adult');
|
||||
if (err1) return uni.showToast({ title: err1, icon: 'none' });
|
||||
|
||||
let child0 = self.formData.child[0];
|
||||
if (!child0 || !child0.name || !child0.both || !child0.card) {
|
||||
return uni.showToast({ title: '请填写完整随行子女1信息', icon: 'none' });
|
||||
}
|
||||
if (!regex.test(child0.card)) {
|
||||
return uni.showToast({ title: '请输入正确的子女1身份证号码', icon: 'none' });
|
||||
}
|
||||
let errC0 = validateCardAndAgeMatch(child0.card, child0.both, '子女1', 'child');
|
||||
if (errC0) return uni.showToast({ title: errC0, icon: 'none' });
|
||||
|
||||
// id == 4 时(第二个亲子卡),还需要额外验证 child[1] 属性
|
||||
if (self.id == 4) {
|
||||
let child1 = self.formData.child[1];
|
||||
if (!child1 || !child1.name || !child1.both || !child1.card) {
|
||||
return uni.showToast({ title: '请填写完整随行子女2信息', icon: 'none' });
|
||||
}
|
||||
if (!regex.test(child1.card)) {
|
||||
return uni.showToast({ title: '请输入正确的子女2身份证号码', icon: 'none' });
|
||||
}
|
||||
let errC1 = validateCardAndAgeMatch(child1.card, child1.both, '子女2', 'child');
|
||||
if (errC1) return uni.showToast({ title: errC1, icon: 'none' });
|
||||
}
|
||||
}
|
||||
this.showSuccessPopup = true;
|
||||
|
||||
// 所有场景必填联系电话
|
||||
if (!self.formData.mobile) {
|
||||
return uni.showToast({ title: '请填写联系电话', icon: 'none' });
|
||||
}
|
||||
|
||||
const phoneReg = /^1[3-9]\d{9}$/;
|
||||
if (!phoneReg.test(self.formData.mobile)) {
|
||||
return uni.showToast({ title: '请输入正确的手机号码', icon: 'none' });
|
||||
}
|
||||
|
||||
if (self.isSubmitting) return;
|
||||
self.isSubmitting = true;
|
||||
uni.showLoading({ title: '提交中...', mask: true });
|
||||
|
||||
let submitData = {
|
||||
...self.formData,
|
||||
youth: JSON.stringify(self.formData.youth),
|
||||
adult: JSON.stringify(self.formData.adult),
|
||||
parents: JSON.stringify(self.formData.parents),
|
||||
child: JSON.stringify(self.formData.child)
|
||||
};
|
||||
|
||||
self._post(
|
||||
'ground.group/submitGroupData',
|
||||
submitData,
|
||||
result => {
|
||||
uni.hideLoading();
|
||||
if (result.code) {
|
||||
self.formData = {
|
||||
youth: { name: '', both: '', card: '' },
|
||||
adult: { name: '', both: '', card: '' },
|
||||
parents: [
|
||||
{ name: '', both: '', card: '' },
|
||||
{ name: '', both: '', card: '' }
|
||||
],
|
||||
child: [
|
||||
{ name: '', both: '', card: '' },
|
||||
{ name: '', both: '', card: '' }
|
||||
],
|
||||
phone: '',
|
||||
group_id: self.id
|
||||
};
|
||||
self.showSuccessPopup = true;
|
||||
} else {
|
||||
uni.showToast({ title: '提交失败', icon: 'none' });
|
||||
}
|
||||
},
|
||||
false,
|
||||
() => {
|
||||
uni.hideLoading();
|
||||
self.isSubmitting = false;
|
||||
}
|
||||
)
|
||||
},
|
||||
|
||||
confirmSuccess() {
|
||||
this.showSuccessPopup = false;
|
||||
// 点击好的之后,可以跳转或返回上一页
|
||||
uni.navigateBack();
|
||||
this.getOpenerEventChannel().emit('data', {notice: 'success'});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -178,7 +598,7 @@ page {
|
||||
margin-bottom: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
|
||||
.required {
|
||||
color: #E53935;
|
||||
margin-left: 8rpx;
|
||||
@ -190,27 +610,27 @@ page {
|
||||
margin-bottom: 10rpx;
|
||||
border-bottom: 2rpx solid #F5F5F5;
|
||||
padding-bottom: 16rpx;
|
||||
|
||||
|
||||
&.no-border {
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
|
||||
|
||||
.label {
|
||||
font-size: 28rpx;
|
||||
color: #666666;
|
||||
margin-bottom: 20rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
|
||||
.input {
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
}
|
||||
|
||||
|
||||
.picker-view {
|
||||
font-size: 30rpx;
|
||||
color: #CCCCCC;
|
||||
@ -218,10 +638,11 @@ page {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
&.has-value {
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
.arrow-down {
|
||||
font-size: 30rpx;
|
||||
color: #CCCCCC;
|
||||
@ -235,13 +656,13 @@ page {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 30rpx;
|
||||
|
||||
|
||||
.label {
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
width: 160rpx;
|
||||
}
|
||||
|
||||
|
||||
.input-grey {
|
||||
flex: 1;
|
||||
background-color: #F6F7F8;
|
||||
@ -282,7 +703,7 @@ page {
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
|
||||
.btn {
|
||||
flex: 1;
|
||||
height: 88rpx;
|
||||
@ -292,13 +713,13 @@ page {
|
||||
font-size: 32rpx;
|
||||
border-radius: 8rpx;
|
||||
}
|
||||
|
||||
|
||||
.btn-default {
|
||||
background-color: #FFFFFF;
|
||||
color: #333333;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
|
||||
.btn-primary {
|
||||
background-color: #3B5B9B;
|
||||
color: #FFFFFF;
|
||||
|
||||
@ -189,6 +189,37 @@
|
||||
</view>
|
||||
</view>
|
||||
</Popup>
|
||||
|
||||
<!-- 储值卡选择弹窗 -->
|
||||
<Popup :show="storedCardPopup" :width='750' :padding="0" type="bottom" backgroundColor="#fff" radius="32rpx 32rpx 0 0">
|
||||
<view class="ww100 box-s-b pop-improt typeof pr">
|
||||
<image style="width: 64rpx;height: 64rpx;position: absolute; top: 26rpx;right: 30rpx;" src="@/static/icon/close2.png" mode="" @click="closeStoredCardPopup"></image>
|
||||
|
||||
<view class="d-c-c pt44">
|
||||
<text class="f34 fb">储值卡选择</text>
|
||||
</view>
|
||||
|
||||
<view class="bg-white card">
|
||||
<view class="card-item" v-for="item in storedCardList" :key="item.id" :class="currentStoredCardId == item.id ? 'active' : ''" @click="currentStoredCardId = item.id">
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-title">{{ item.name }}</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="discount">享</view>
|
||||
<view class="sale">
|
||||
<text>{{ item.discount }}</text>
|
||||
<text>折</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-balance">¥{{ formatMoney(item.balance) }}</view>
|
||||
<view class="icon-box d-c-c card-checkout"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-btn" @click="confirmStoredCard">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</Popup>
|
||||
|
||||
<navbar title="确认订单"></navbar>
|
||||
|
||||
@ -296,19 +327,33 @@
|
||||
</view>
|
||||
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
<view v-if="typeId == 1" :class="payType == 'balance' ? 'item active' : 'item'" @tap="payTypeFunc('balance')">
|
||||
<view v-if="typeId == 1" :class="payType == 'balance' ? 'item active' : 'item'" @tap="payTypeFunc('balance')" style="padding-bottom: 10rpx;">
|
||||
<view class="d-s-c">
|
||||
<view class="icon-box d-c-c mr10"><span class="icon iconfont icon-yue"></span></view>
|
||||
<text class="key">平台余额</text>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="mr10 dis" v-if="userAccount > 0">
|
||||
<view class="mr10 dis" v-if="payType == 'balance' && userAccount > 0">
|
||||
<!-- <text class="key">余额支付:(剩余:{{balance}})</text> -->
|
||||
{{ cardType() }} <text style="color: #FF5951;">{{ userDiscount }}</text>折
|
||||
</view>
|
||||
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="typeId == 1" :class="payType == 'storedCard' ? 'item active' : 'item'" @tap="payTypeFunc('storedCard')">
|
||||
<view class="d-s-c">
|
||||
<view class="icon-box d-c-c mr10">
|
||||
<image src="https://xh.stnav.com/uploads/sport/chuzhika.png" mode="heightFix" style="width: 50rpx; height: 50rpx;"></image>
|
||||
</view>
|
||||
<text class="key">储值卡支付</text>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="mr10 dis" v-if="payType == 'storedCard' && userAccount > 0">
|
||||
{{ storedCardName() }} <text style="color: #FF5951;margin-left: 10rpx;">{{ userDiscount }}</text>折
|
||||
</view>
|
||||
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -377,11 +422,15 @@
|
||||
loadding: true,
|
||||
_submitting: false,
|
||||
balancePopup: false,
|
||||
storedCardPopup: false,
|
||||
balance: {},
|
||||
userBalance: {},
|
||||
currentType: '', // 选择的会员卡类型
|
||||
storedCardList: [],
|
||||
currentStoredCardId: '',
|
||||
userAccount: 0,
|
||||
userDiscount: 0
|
||||
userDiscount: 0,
|
||||
storedValueCard: []
|
||||
};
|
||||
},
|
||||
|
||||
@ -402,7 +451,7 @@
|
||||
this.typeId = args.typeId || 1; // 网球场1 篮球场2
|
||||
// this.basketballDate = args.date || null; // 篮球场预约时间
|
||||
this.getData();
|
||||
this.getRecharge()
|
||||
this.getRecharge();
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
@ -604,17 +653,17 @@
|
||||
payTypeFunc(n) {
|
||||
this.payType = n;
|
||||
if (n == 'balance') {
|
||||
this.resetPayDiscount();
|
||||
this.balancePopup = true;
|
||||
} else {
|
||||
// 切换到微信支付时还原价格
|
||||
this.userAccount = 0;
|
||||
this.userDiscount = 0;
|
||||
this.currentType = '';
|
||||
if (typeof this.originalTotal === 'number' && !isNaN(this.originalTotal)) {
|
||||
this.bill.total = this.originalTotal;
|
||||
this.bill.dis = 0;
|
||||
}
|
||||
this.storedCardPopup = false;
|
||||
} else if (n == 'storedCard') {
|
||||
this.resetPayDiscount();
|
||||
this.balancePopup = false;
|
||||
this.storedCardPopup = true;
|
||||
} else {
|
||||
this.resetPayDiscount();
|
||||
this.balancePopup = false;
|
||||
this.storedCardPopup = false;
|
||||
}
|
||||
},
|
||||
|
||||
@ -656,6 +705,19 @@
|
||||
};
|
||||
oldBalancePay.call(this);
|
||||
setTimeout(finish, 3000);
|
||||
} else if (this.payType == 'storedCard') {
|
||||
if (this.currentStoredCardId === '') {
|
||||
uni.showToast({title: '请选择储值卡', icon: 'none'});
|
||||
setTimeout(finish, 3000);
|
||||
return;
|
||||
}
|
||||
const oldStoredCardPay = this.storedCardPay;
|
||||
this.storedCardPay = (...args) => {
|
||||
oldStoredCardPay.apply(this, args);
|
||||
this.storedCardPay = oldStoredCardPay;
|
||||
};
|
||||
oldStoredCardPay.call(this);
|
||||
setTimeout(finish, 3000);
|
||||
} else {
|
||||
finish();
|
||||
}
|
||||
@ -814,6 +876,7 @@
|
||||
},
|
||||
function(res) {
|
||||
self.balance = res.data.lists.balance;
|
||||
self.storedValueCard = res.data.lists.storedValueCard;
|
||||
}
|
||||
)
|
||||
|
||||
@ -823,11 +886,43 @@
|
||||
}, function(res) {
|
||||
console.log("🚀 ~ res:", res)
|
||||
self.userBalance = res.data.userInfo;
|
||||
|
||||
self.storedCardList = [
|
||||
{ id: 1, payType: 1, name: '储值卡一', discount: self.storedValueCard.discount1, balance: self.userBalance.card_balance1 },
|
||||
{ id: 2, payType: 2, name: '储值卡二', discount: self.storedValueCard.discount2, balance: self.userBalance.card_balance2 },
|
||||
{ id: 3, payType: 3, name: '储值卡三', discount: self.storedValueCard.discount3, balance: self.userBalance.card_balance3 },
|
||||
];
|
||||
|
||||
self.loadding = false;
|
||||
uni.hideLoading();
|
||||
});
|
||||
},
|
||||
|
||||
formatMoney(value) {
|
||||
const amount = Number(value) || 0;
|
||||
return amount.toFixed(2);
|
||||
},
|
||||
|
||||
getStoredCardInfo() {
|
||||
return this.storedCardList.find(item => item.id === this.currentStoredCardId);
|
||||
},
|
||||
|
||||
storedCardName() {
|
||||
const currentCard = this.getStoredCardInfo();
|
||||
return currentCard ? currentCard.name : '';
|
||||
},
|
||||
|
||||
resetPayDiscount() {
|
||||
this.userAccount = 0;
|
||||
this.userDiscount = 0;
|
||||
this.currentType = '';
|
||||
this.currentStoredCardId = '';
|
||||
if (typeof this.originalTotal === 'number' && !isNaN(this.originalTotal)) {
|
||||
this.bill.total = this.originalTotal;
|
||||
this.bill.dis = 0;
|
||||
}
|
||||
},
|
||||
|
||||
cardType() {
|
||||
if (this.currentType == 1) {
|
||||
return '白银会员卡'
|
||||
@ -878,12 +973,144 @@
|
||||
this.balancePopup = false;
|
||||
},
|
||||
|
||||
confirmStoredCard() {
|
||||
if (this.currentStoredCardId === '') {
|
||||
uni.showToast({
|
||||
title: '请选择储值卡',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const currentCard = this.getStoredCardInfo();
|
||||
if (!currentCard) {
|
||||
uni.showToast({
|
||||
title: '储值卡不存在',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.userAccount = Number(currentCard.balance);
|
||||
this.userDiscount = Number(currentCard.discount) || 10;
|
||||
|
||||
const baseTotal = Number(this.bill.cdf.total) || 0;
|
||||
const finalPrice = Number((baseTotal * (this.userDiscount / 10)).toFixed(2));
|
||||
const payableTotal = Number((finalPrice + Number(this.bill.dgf.total)).toFixed(2));
|
||||
|
||||
if (this.userAccount < payableTotal) {
|
||||
uni.showToast({
|
||||
title: '储值卡余额不足,请选择其他储值卡',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.bill.dis = Number((baseTotal - finalPrice).toFixed(2));
|
||||
this.bill.total = payableTotal;
|
||||
this.storedCardPopup = false;
|
||||
},
|
||||
|
||||
storedCardPay() {
|
||||
let self = this
|
||||
const currentCard = self.getStoredCardInfo();
|
||||
if (!currentCard) {
|
||||
uni.showToast({
|
||||
title: '请选择储值卡',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (Number(currentCard.balance) < Number(self.bill.total)) {
|
||||
uni.showToast({
|
||||
title: '储值卡余额不足',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: '支付中'
|
||||
});
|
||||
|
||||
try {
|
||||
self._post(
|
||||
'ground.ground/yuexnPay',
|
||||
{
|
||||
app_id: self.getAppId(),
|
||||
order_id: self.orderId,
|
||||
pay_type: currentCard.payType // 传储值卡对应的pay_type
|
||||
},
|
||||
function(res) {
|
||||
if (res.code == 1) {
|
||||
self.result = 'success'
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'none'
|
||||
});
|
||||
self.loadding = false;
|
||||
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({delta: 1})
|
||||
}, 500);
|
||||
} else {
|
||||
self.result = 'fail'
|
||||
self.loadding = false;
|
||||
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({delta: 1})
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
)
|
||||
} catch (error) {
|
||||
self.result = 'fail'
|
||||
self.loadding = false;
|
||||
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
});
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({delta: 1})
|
||||
}, 500);
|
||||
}
|
||||
|
||||
// setTimeout(() => {
|
||||
// currentCard.balance = Number((Number(currentCard.balance) - Number(this.bill.total)).toFixed(2));
|
||||
// this.userAccount = currentCard.balance;
|
||||
// this.result = 'success';
|
||||
// this.loadding = false;
|
||||
// uni.hideLoading();
|
||||
// uni.showToast({
|
||||
// title: '储值卡支付成功',
|
||||
// icon: 'none'
|
||||
// });
|
||||
|
||||
// setTimeout(() => {
|
||||
// uni.navigateBack({delta: 1});
|
||||
// }, 500);
|
||||
// }, 300);
|
||||
},
|
||||
|
||||
|
||||
// 关闭余额支付弹窗
|
||||
closeBalancePopup() {
|
||||
this.resetPayDiscount();
|
||||
this.payType = 'wxpay';
|
||||
this.balancePopup = false;
|
||||
},
|
||||
|
||||
closeStoredCardPopup() {
|
||||
this.resetPayDiscount();
|
||||
this.payType = 'wxpay';
|
||||
this.storedCardPopup = false;
|
||||
},
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
@ -55,7 +55,7 @@
|
||||
|
||||
seeOrder() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/order/cg-my-order'
|
||||
url: '/pages/order/cg-my-order?type=' + this.ground_type
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
18
pages.json
18
pages.json
@ -1066,6 +1066,24 @@
|
||||
"style": {
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "combo/face-photo",
|
||||
"style": {
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "combo/face-list",
|
||||
"style": {
|
||||
"navigationBarTitleText": "人脸列表"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "combo/desc",
|
||||
"style": {
|
||||
"navigationBarTitleText": "注意事项"
|
||||
}
|
||||
}
|
||||
]
|
||||
}],
|
||||
|
||||
@ -17,19 +17,37 @@
|
||||
<image style="width: 40rpx;height: 40rpx;" src="@/static/icon/notice.png" mode=""></image>
|
||||
<view class="notice-txt">{{ setting.notice }}</view>
|
||||
</view> -->
|
||||
|
||||
<!--
|
||||
<view style="display: flex; justify-content: center; margin-bottom: 20rpx;" @click="toRecharge">
|
||||
<image style="width: 690rpx;height: 140rpx;" src="https://xh.stnav.com/uploads/sport/recharge.png" mode=""></image>
|
||||
</view>
|
||||
|
||||
<view style="display: flex; justify-content: center; margin-bottom: 26rpx;" @click="toCombo">
|
||||
<image style="width: 690rpx;height: 200rpx;" src="https://xh.stnav.com/uploads/sport/to-combo2.png" mode=""></image>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- <view style="display: flex; justify-content: center; margin-bottom: 40rpx;" @click="toCombo">
|
||||
<image style="width: 690rpx;height: 230rpx;" src="https://xh.stnav.com/uploads/sport/to-combo1.png" mode=""></image>
|
||||
</view> -->
|
||||
|
||||
<view class="card-container">
|
||||
<view class="card left-card" @click="toRecharge" style="background-image: url('https://xh.stnav.com/uploads/sport/home_image2.png'); background-size: 100% 100%; background-repeat: no-repeat;">
|
||||
<view class="card-text">
|
||||
<view class="card-title" style="color: #4693F6;">网球充值卡</view>
|
||||
<view class="card-subtitle left-subtitle" style="color: #4693F6;">充值立享优惠</view>
|
||||
<view style="margin-top: 50rpx;"><text class="card-btn" style="background-color: #6A9CFD; color: #fff;">立即抢购</text></view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card right-card" @click="toCombo" style="background-image: url('https://xh.stnav.com/uploads/sport/home_image1.png'); background-size: 100% 100%; background-repeat: no-repeat;">
|
||||
<view class="card-text">
|
||||
<view class="card-title" style="color: #D1834F;">篮球会员卡</view>
|
||||
<view class="card-subtitle right-subtitle" style="color: #CD9C7B;">青年卡、亲子卡、成年卡...等你来领</view>
|
||||
<view><text class="card-btn" style="background-color: #D19A62; color: #fff;">立即抢购</text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 预约球馆 -->
|
||||
<view class="info">
|
||||
<view class="title">
|
||||
@ -719,6 +737,62 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.card-container {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
|
||||
.card {
|
||||
width: 330rpx;
|
||||
height: 200rpx;
|
||||
border-radius: 16rpx;
|
||||
position: relative;
|
||||
padding: 24rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.card-text {
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.card-title {
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.card-subtitle {
|
||||
font-size: 22rpx;
|
||||
margin-bottom: 24rpx;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.left-subtitle {
|
||||
width: 160rpx;
|
||||
}
|
||||
|
||||
.right-subtitle {
|
||||
width: 250rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
|
||||
.card-btn {
|
||||
font-size: 20rpx;
|
||||
padding: 6rpx 24rpx;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
|
||||
page {
|
||||
background-color: $xh-bg;
|
||||
}
|
||||
|
||||
@ -138,19 +138,32 @@
|
||||
</view>
|
||||
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
<view :class="payType == 'balance' ? 'item active' : 'item'" @tap="payTypeFunc('balance')">
|
||||
<view :class="payType == 'balance' ? 'item active' : 'item'" @tap="payTypeFunc('balance')" style="padding-bottom: 10rpx;">
|
||||
<view class="d-s-c">
|
||||
<view class="icon-box d-c-c mr10"><span class="icon iconfont icon-yue"></span></view>
|
||||
<text class="key">平台余额</text>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="mr10 dis" v-if="userAccount > 0">
|
||||
<!-- <text class="key">余额支付:(剩余:{{balance}})</text> -->
|
||||
{{ cardType() }}
|
||||
<view class="mr10 dis" v-if="payType == 'balance' && userAccount > 0">
|
||||
{{ cardType() }}
|
||||
</view>
|
||||
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
<view :class="payType == 'storedCard' ? 'item active' : 'item'" @tap="payTypeFunc('storedCard')">
|
||||
<view class="d-s-c">
|
||||
<view class="icon-box d-c-c mr10">
|
||||
<image src="https://xh.stnav.com/uploads/sport/chuzhika.png" mode="heightFix" style="width: 50rpx; height: 50rpx;"></image>
|
||||
</view>
|
||||
<text class="key">储值卡支付</text>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="mr10 dis" v-if="payType == 'storedCard' && userAccount > 0">
|
||||
{{ storedCardName() }}
|
||||
</view>
|
||||
<view class="icon-box d-c-c"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="pay-light-btn" @click="getSelectedContent">确定并支付</view>
|
||||
@ -200,12 +213,12 @@
|
||||
<text class="cg-copy" @click="copy(detail.order_sn)">复制</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="cg-order-info d-b-c mt14" v-if="detail.pay_way > 0">
|
||||
<view class="">交易方式:</view>
|
||||
<view class="">
|
||||
<text v-if="detail.pay_way == 1">余额支付-{{ cardType(detail.pay_way) }}</text>
|
||||
<text v-if="detail.pay_way == 1">余额支付-{{ cardType(detail.pay_type) }}</text>
|
||||
<text v-if="detail.pay_way == 2">微信支付</text>
|
||||
<text v-if="detail.pay_way == 3">储值卡支付-{{ storedCardType(detail.pay_xntype) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -396,6 +409,30 @@
|
||||
</view>
|
||||
</view>
|
||||
</Popup>
|
||||
|
||||
<!-- 储值卡选择弹窗 -->
|
||||
<Popup :show="storedCardPopup" :width='750' :padding="0" type="bottom" backgroundColor="#fff" radius="32rpx 32rpx 0 0">
|
||||
<view class="ww100 box-s-b pop-improt typeof pr">
|
||||
<image style="width: 64rpx;height: 64rpx;position: absolute; top: 26rpx;right: 30rpx;" src="@/static/icon/close2.png" mode="" @click="closeStoredCardPopup"></image>
|
||||
|
||||
<view class="d-c-c pt44">
|
||||
<text class="f34 fb">储值卡选择</text>
|
||||
</view>
|
||||
|
||||
<view class="bg-white card">
|
||||
<view class="card-item" v-for="item in storedCardList" :key="item.id" :class="currentStoredCardId == item.id ? 'active' : ''" @click="currentStoredCardId = item.id">
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-title">{{ item.name }}</view>
|
||||
</view>
|
||||
<view class="d-f a-i-c">
|
||||
<view class="card-balance">¥{{ formatMoney(item.balance) }}</view>
|
||||
<view class="icon-box d-c-c card-checkout"><span class="icon iconfont icon-xuanze"></span></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="card-btn" @click="confirmStoredCard">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</Popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -448,6 +485,10 @@
|
||||
currentType: '', // 选择的会员卡类型
|
||||
userAccount: 0,
|
||||
userDiscount: 0,
|
||||
storedCardPopup: false,
|
||||
storedCardList: [],
|
||||
currentStoredCardId: '',
|
||||
storedValueCard: [],
|
||||
lightDateTime: '',
|
||||
lightPrice: 0,
|
||||
};
|
||||
@ -670,19 +711,31 @@
|
||||
|
||||
// 会员卡类型
|
||||
cardType(type) {
|
||||
if (type == 1) {
|
||||
const t = type || this.currentType;
|
||||
if (t == 1) {
|
||||
return '白银会员卡'
|
||||
} else if (type == 2) {
|
||||
} else if (t == 2) {
|
||||
return '黄金会员卡'
|
||||
} else if (type == 3) {
|
||||
} else if (t == 3) {
|
||||
return '铂金会员卡'
|
||||
} else if (type == 4) {
|
||||
} else if (t == 4) {
|
||||
return '钻石会员卡'
|
||||
} else if (type == 5) {
|
||||
} else if (t == 5) {
|
||||
return '至尊会员卡'
|
||||
}
|
||||
},
|
||||
|
||||
// 储值卡类型
|
||||
storedCardType(type) {
|
||||
if (type == 1) {
|
||||
return '储值卡一'
|
||||
} else if (type == 2) {
|
||||
return '储值卡二'
|
||||
} else if (type == 3) {
|
||||
return '储值卡三'
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 购买灯光前置条件
|
||||
*/
|
||||
@ -708,13 +761,25 @@
|
||||
payTypeFunc(n) {
|
||||
this.payType = n;
|
||||
if (n == 'balance') {
|
||||
this.userAccount = 0;
|
||||
this.userDiscount = 0;
|
||||
this.currentStoredCardId = '';
|
||||
this.balancePopup = true;
|
||||
this.storedCardPopup = false;
|
||||
} else if (n == 'storedCard') {
|
||||
this.userAccount = 0;
|
||||
this.userDiscount = 0;
|
||||
this.currentType = '';
|
||||
this.balancePopup = false;
|
||||
this.storedCardPopup = true;
|
||||
} else {
|
||||
// 切换到微信支付时还原价格
|
||||
this.userAccount = 0;
|
||||
this.userDiscount = 0;
|
||||
this.currentType = '';
|
||||
this.currentStoredCardId = '';
|
||||
this.balancePopup = false;
|
||||
this.storedCardPopup = false;
|
||||
}
|
||||
},
|
||||
|
||||
@ -724,6 +789,49 @@
|
||||
this.balancePopup = false;
|
||||
},
|
||||
|
||||
closeStoredCardPopup() {
|
||||
this.payType = 'wxpay';
|
||||
this.storedCardPopup = false;
|
||||
},
|
||||
|
||||
formatMoney(value) {
|
||||
const amount = Number(value) || 0;
|
||||
return amount.toFixed(2);
|
||||
},
|
||||
|
||||
getStoredCardInfo() {
|
||||
return this.storedCardList.find(item => item.id === this.currentStoredCardId);
|
||||
},
|
||||
|
||||
storedCardName() {
|
||||
const currentCard = this.getStoredCardInfo();
|
||||
return currentCard ? currentCard.name : '';
|
||||
},
|
||||
|
||||
confirmStoredCard() {
|
||||
if (this.currentStoredCardId === '') {
|
||||
uni.showToast({
|
||||
title: '请选择储值卡',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
const currentCard = this.getStoredCardInfo();
|
||||
if (!currentCard) {
|
||||
uni.showToast({
|
||||
title: '储值卡不存在',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.userAccount = Number(currentCard.balance);
|
||||
this.userDiscount = 0;
|
||||
|
||||
this.storedCardPopup = false;
|
||||
},
|
||||
|
||||
getRecharge() {
|
||||
let self = this;
|
||||
uni.showLoading({
|
||||
@ -737,6 +845,7 @@
|
||||
},
|
||||
function(res) {
|
||||
self.balance = res.data.lists.balance;
|
||||
self.storedValueCard = res.data.lists.storedValueCard;
|
||||
}
|
||||
)
|
||||
|
||||
@ -746,6 +855,13 @@
|
||||
}, function(res) {
|
||||
console.log("🚀 ~ res:", res)
|
||||
self.userBalance = res.data.userInfo;
|
||||
|
||||
self.storedCardList = [
|
||||
{ id: 1, payType: 1, name: '储值卡一', discount: self.storedValueCard.discount1, balance: self.userBalance.card_balance1 },
|
||||
{ id: 2, payType: 2, name: '储值卡二', discount: self.storedValueCard.discount2, balance: self.userBalance.card_balance2 },
|
||||
{ id: 3, payType: 3, name: '储值卡三', discount: self.storedValueCard.discount3, balance: self.userBalance.card_balance3 },
|
||||
];
|
||||
|
||||
self.loadding = false;
|
||||
uni.hideLoading();
|
||||
});
|
||||
@ -771,27 +887,13 @@
|
||||
|
||||
|
||||
this.userAccount = this.userBalance['balance' + this.currentType];
|
||||
this.userDiscount = this.balance['discount' + this.currentType];
|
||||
this.userDiscount = 0;
|
||||
|
||||
// this.payType = this.currentType;
|
||||
// this.countPrice();
|
||||
this.balancePopup = false;
|
||||
},
|
||||
|
||||
cardType() {
|
||||
if (this.currentType == 1) {
|
||||
return '白银会员卡'
|
||||
} else if (this.currentType == 2) {
|
||||
return '黄金会员卡'
|
||||
} else if (this.currentType == 3) {
|
||||
return '铂金会员卡'
|
||||
} else if (this.currentType == 4) {
|
||||
return '钻石会员卡'
|
||||
} else if (this.currentType == 5) {
|
||||
return '至尊会员卡'
|
||||
}
|
||||
},
|
||||
|
||||
isSelected(groupIdx, idx) {
|
||||
return this.selectedTimes.some(sel => sel.group === groupIdx && sel.idx === idx);
|
||||
},
|
||||
@ -821,8 +923,17 @@
|
||||
},
|
||||
function(res) {
|
||||
console.log("🚀 ~ res:", res)
|
||||
self.detail.trade[groupIdx][idx].light_price = res.data.lists.set_light_price
|
||||
self.selectedTimes.push({ group: groupIdx, idx, roomId });
|
||||
const lightPrice = res.data.lists.set_light_price
|
||||
self.detail.trade[groupIdx][idx].light_price = lightPrice
|
||||
self.selectedTimes.push({
|
||||
group: groupIdx,
|
||||
idx,
|
||||
roomId,
|
||||
light_price: lightPrice,
|
||||
start_time: self.detail.trade[groupIdx][idx].start_time,
|
||||
end_time: self.detail.trade[groupIdx][idx].end_time,
|
||||
day_time: self.detail.trade[groupIdx][idx].day_time
|
||||
});
|
||||
}
|
||||
)
|
||||
self.loadding = false
|
||||
@ -844,13 +955,21 @@
|
||||
self.lightPrice = 0
|
||||
self.selectedTimes.forEach(sel => {
|
||||
if (!roomMap[sel.roomId]) roomMap[sel.roomId] = [];
|
||||
// 获取时间段
|
||||
const item = trade[sel.group] && trade[sel.group][sel.idx];
|
||||
console.log("🚀 ~ item:", item)
|
||||
if (item) {
|
||||
roomMap[sel.roomId].push(`${item.start_time}-${item.end_time}`);
|
||||
self.lightDateTime = item.day_time
|
||||
self.lightPrice += parseFloat(item.light_price)
|
||||
// 优先从 selectedTimes 中获取 light_price(修复后)
|
||||
if (sel.light_price) {
|
||||
roomMap[sel.roomId].push(`${sel.start_time}-${sel.end_time}`);
|
||||
if (!self.lightDateTime && sel.day_time) {
|
||||
self.lightDateTime = sel.day_time
|
||||
}
|
||||
self.lightPrice += parseFloat(sel.light_price)
|
||||
} else {
|
||||
// 兼容旧数据:如果 selectedTimes 中没有,从 detail.trade 中获取
|
||||
const item = trade[sel.group] && trade[sel.group][sel.idx];
|
||||
if (item) {
|
||||
roomMap[sel.roomId].push(`${item.start_time}-${item.end_time}`);
|
||||
self.lightDateTime = item.day_time
|
||||
self.lightPrice += parseFloat(item.light_price || 0)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -915,9 +1034,18 @@
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.payType == 'storedCard' && self.currentStoredCardId === '') {
|
||||
uni.showToast({
|
||||
title: '请选择储值卡',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
uni.showLoading({
|
||||
title: '正在处理'
|
||||
});
|
||||
});
|
||||
console.log('self.payType=', self.payType)
|
||||
console.log(123123)
|
||||
self._post(
|
||||
'order.GroundOrder/addLightStoreOrder', {
|
||||
@ -1017,6 +1145,54 @@
|
||||
self.getRecharge();
|
||||
}, 1500);
|
||||
|
||||
} else {
|
||||
self.openLightPopup = false;
|
||||
|
||||
console.log("🚀 ~ pay error res:", res)
|
||||
self.result = 'fail'
|
||||
uni.hideLoading();
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '支付失败',
|
||||
icon: 'none'
|
||||
});
|
||||
}, 200);
|
||||
|
||||
setTimeout(() => {
|
||||
self.getData();
|
||||
self.getRecharge();
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
)
|
||||
} else if (self.payType == 'storedCard') {
|
||||
const currentCard = self.getStoredCardInfo();
|
||||
console.log("🚀 ~ getStoredCardInfo:", 12312312321)
|
||||
self._post(
|
||||
'ground.ground/yuexnLightPay', {
|
||||
order_id: payId,
|
||||
pay_type: currentCard.payType
|
||||
},
|
||||
function(pay) {
|
||||
if (pay.code == 1) {
|
||||
self.openLightPopup = false;
|
||||
self.selectedTimes = []
|
||||
self.content = []
|
||||
|
||||
self.result = 'success'
|
||||
uni.hideLoading();
|
||||
setTimeout(() => {
|
||||
uni.showToast({
|
||||
title: '支付成功',
|
||||
icon: 'none'
|
||||
});
|
||||
}, 200);
|
||||
|
||||
setTimeout(() => {
|
||||
self.getData();
|
||||
self.getRecharge();
|
||||
}, 1500);
|
||||
|
||||
} else {
|
||||
self.openLightPopup = false;
|
||||
|
||||
|
||||
@ -157,8 +157,9 @@ export default {
|
||||
.item {
|
||||
width: 90rpx;
|
||||
height: 90rpx;
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user