feat: 优化会员认证和支付流程
- App.vue: 添加 globalData 初始化,修复选择证件照后跳转登录页的问题 - common/api.js: certifiedNew 接口改为 URL 参数传参 - myCenter/goPay.vue: 使用 await-to-js 重构支付逻辑,添加 loading 状态 - myCenter/sucPay.vue: 接收 orderId 参数,通过接口获取订单信息并展示 - personal/sucPay.vue: 调整订单信息字段绑定 - config.js: 更新 API 基础地址
Showing
7 changed files
with
1364 additions
and
1213 deletions
| 1 | <script> | 1 | <script> |
| 2 | import { | 2 | import { |
| 3 | getInfo | 3 | getInfo |
| 4 | } from '@/common/login.js'; | 4 | } from '@/common/login.js'; |
| 5 | import * as api from '@/common/api.js'; | 5 | import * as api from '@/common/api.js'; |
| 6 | import config from '@/config.js'; | 6 | import config from '@/config.js'; |
| 7 | 7 | ||
| 8 | let loginUrl=['login/login', 'login/register'] | 8 | let loginUrl = ['login/login', 'login/register', 'personal/addVip_per'] |
| 9 | let firstload = false | 9 | let firstload = false |
| 10 | export default { | 10 | export default { |
| 11 | onLaunch: function(options) { | 11 | globalData: { |
| 12 | console.log('App Launch', options); | 12 | isLogin: false, |
| 13 | baseUrl_api: '', | ||
| 14 | user: null, | ||
| 15 | userType: '', | ||
| 16 | userInfo: null, | ||
| 17 | deptType: '', | ||
| 18 | genFlag: '', | ||
| 19 | authenticationStatus: '', | ||
| 20 | memberInfo: null, | ||
| 21 | isExam: false | ||
| 22 | }, | ||
| 23 | onLaunch: function(options) { | ||
| 24 | console.log('App Launch', options); | ||
| 13 | 25 | ||
| 14 | this.globalData.baseUrl_api = config.baseUrl_api; | 26 | this.globalData.baseUrl_api = config.baseUrl_api; |
| 15 | if(loginUrl.indexOf(options.path)==-1){ | 27 | if (loginUrl.indexOf(options.path) == -1) { |
| 16 | let userName = uni.getStorageSync('userName') | 28 | let userName = uni.getStorageSync('userName') |
| 17 | if (userName) { | 29 | if (userName) { |
| 18 | getInfo().then(() => { | 30 | getInfo().then(() => { |
| 19 | this.globalData.isLogin = true; | 31 | this.globalData.isLogin = true; |
| 20 | firstload = true | 32 | firstload = true |
| 21 | let firstLoadCallback = getApp().firstLoadCallback; | 33 | let firstLoadCallback = getApp().firstLoadCallback; |
| 22 | if (firstLoadCallback) { | 34 | if (firstLoadCallback) { |
| 23 | firstLoadCallback(); | 35 | firstLoadCallback(); |
| 24 | } | 36 | } |
| 25 | }).catch(() => { | 37 | }).catch(() => { |
| 26 | firstload = true | 38 | firstload = true |
| 27 | uni.redirectTo({ | 39 | uni.redirectTo({ |
| 28 | url: '/login/login' | 40 | url: '/login/login' |
| 29 | }) | 41 | }) |
| 30 | }) | 42 | }) |
| 31 | } else { | 43 | } else { |
| 32 | this.globalData.isLogin = false; | 44 | this.globalData.isLogin = false; |
| 33 | firstload = true | 45 | firstload = true |
| 34 | uni.redirectTo({ | 46 | uni.redirectTo({ |
| 35 | url: '/login/login' | 47 | url: '/login/login' |
| 36 | }) | 48 | }) |
| 37 | } | 49 | } |
| 38 | } | 50 | } |
| 39 | }, | 51 | }, |
| 40 | onShow: function() { | 52 | onShow: function() { |
| 41 | console.log('App Show',firstload,this.globalData.isLogin); | 53 | console.log('App Show', firstload, this.globalData.isLogin); |
| 42 | if(firstload&&!this.globalData.isLogin){ | 54 | // if (firstload && !this.globalData.isLogin) { |
| 43 | uni.redirectTo({ | 55 | // uni.redirectTo({ |
| 44 | url: '/login/login' | 56 | // url: '/login/login' |
| 45 | }) | 57 | // }) |
| 46 | } | 58 | // } |
| 47 | }, | 59 | }, |
| 48 | onHide: function() { | 60 | onHide: function() { |
| 49 | console.log('App Hide'); | 61 | console.log('App Hide'); |
| 50 | } | 62 | } |
| 51 | }; | 63 | }; |
| 52 | </script> | 64 | </script> |
| 53 | 65 | ||
| 54 | <style lang="scss"> | 66 | <style lang="scss"> | ... | ... |
| ... | @@ -1306,11 +1306,10 @@ export function checkBusinessLicense(data) { | ... | @@ -1306,11 +1306,10 @@ export function checkBusinessLicense(data) { |
| 1306 | } | 1306 | } |
| 1307 | 1307 | ||
| 1308 | // 生成团体订单renewYear | 1308 | // 生成团体订单renewYear |
| 1309 | export function certifiedNew(params) { | 1309 | export function certifiedNew(renewYear) { |
| 1310 | return request({ | 1310 | return request({ |
| 1311 | url: `/system/certifiedNew/commit`, | 1311 | url: `/system/certifiedNew/commit?renewYear=${renewYear}`, |
| 1312 | method: 'post', | 1312 | method: 'post' |
| 1313 | params | ||
| 1314 | }) | 1313 | }) |
| 1315 | } | 1314 | } |
| 1316 | 1315 | ... | ... |
| ... | @@ -5,11 +5,11 @@ | ... | @@ -5,11 +5,11 @@ |
| 5 | // staging 会员系统 | 5 | // staging 会员系统 |
| 6 | // const baseUrl_api = "http://22yidpjzjifv.ngrok.xiaomiqiu123.top/stage-api/"; | 6 | // const baseUrl_api = "http://22yidpjzjifv.ngrok.xiaomiqiu123.top/stage-api/"; |
| 7 | // const baseUrl_api = "https://ztx.itechtop.cn:8443/stage-api"; | 7 | // const baseUrl_api = "https://ztx.itechtop.cn:8443/stage-api"; |
| 8 | const baseUrl_api = 'http://192.168.1.189:8788' | 8 | const baseUrl_api = 'http://192.168.1.189:8787' |
| 9 | // const baseUrl_api = 'https://tkcn.19wk.cn:8443/stage-api' | 9 | // const baseUrl_api = 'https://tkcn.19wk.cn:8443/stage-api' |
| 10 | // const baseUrl_api = 'http://tk004.wxjylt.com/stage-api' | 10 | // const baseUrl_api = 'http://tk004.wxjylt.com/stage-api' |
| 11 | 11 | ||
| 12 | // const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api' | 12 | // const baseUrl_api = 'https://system.taekwondo.org.cn/stage-api' |
| 13 | export default { | 13 | export default { |
| 14 | baseUrl_api | 14 | baseUrl_api |
| 15 | } | 15 | } |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view :class="{ 'lock-scroll': popupShow }"> | 2 | <view :class="{ 'lock-scroll': popupShow }"> |
| 3 | <view v-if="showDirectly&&directUnderFlag==0"> | 3 | <view v-if="showDirectly&&directUnderFlag==0"> |
| 4 | <view class="flexbox"> | 4 | <view class="flexbox"> |
| 5 | <view> | 5 | <view> |
| 6 | 有效日期至 <text class="text-primary">{{form?.validityDate?.slice(0,10) }}</text> | 6 | 有效日期至 <text class="text-primary">{{form?.validityDate?.slice(0,10) }}</text> |
| 7 | </view> | 7 | </view> |
| 8 | <view> | 8 | <view> |
| 9 | <text v-if="activeStatus==0&&authenticationStatusa" class="text-danger">未激活</text> | 9 | <text v-if="activeStatus==0&&authenticationStatusa" class="text-danger">未激活</text> |
| 10 | <text v-else> | 10 | <text v-else> |
| 11 | <text v-if="authenticationStatusa == 0 ||!authenticationStatusa" class="text-danger">未认证</text> | 11 | <text v-if="authenticationStatusa == 0 ||!authenticationStatusa" class="text-danger">未认证</text> |
| 12 | <text v-if="authenticationStatusa == 1" class="text-success">认证中</text> | 12 | <text v-if="authenticationStatusa == 1" class="text-success">认证中</text> |
| 13 | <text v-if="authenticationStatusa == 2" class="text-success">已认证</text> | 13 | <text v-if="authenticationStatusa == 2" class="text-success">已认证</text> |
| 14 | <text v-if="authenticationStatusa == 3" class="text-danger">认证未通过</text> | 14 | <text v-if="authenticationStatusa == 3" class="text-danger">认证未通过</text> |
| 15 | <text v-if="authenticationStatusa == 4" class="text-danger">即将过期</text> | 15 | <text v-if="authenticationStatusa == 4" class="text-danger">即将过期</text> |
| 16 | <text v-if="authenticationStatusa == 5" class="text-danger">已过期</text> | 16 | <text v-if="authenticationStatusa == 5" class="text-danger">已过期</text> |
| 17 | </text> | 17 | </text> |
| 18 | </view> | 18 | </view> |
| 19 | </view> | 19 | </view> |
| 20 | <view class="flexbox" style="justify-content: flex-end;padding: 0 30rpx 40rpx;"> | 20 | <view class="flexbox" style="justify-content: flex-end;padding: 0 30rpx 40rpx;"> |
| 21 | <button class="btn-red" style="margin: 0 20rpx 0 0;" size="mini" | 21 | <button class="btn-red" style="margin: 0 20rpx 0 0;" size="mini" |
| 22 | v-if="activeStatus==0&&authenticationStatusa" @click="payTheFees">激活</button> | 22 | v-if="activeStatus==0&&authenticationStatusa" @click="payTheFees">激活</button> |
| 23 | <view v-else > | 23 | <view v-else> |
| 24 | <button class="btn-red" style="margin: 0 20rpx 0 0;" size="mini" :disabled="auditStatus==1||auditStatus==2||form.isPoints==0" | 24 | <button class="btn-red" style="margin: 0 20rpx 0 0;" size="mini" |
| 25 | @click="showApplyDialog">考点申请</button> | 25 | :disabled="auditStatus==1||auditStatus==2||form.isPoints==0" |
| 26 | <button class="btn-red" style="margin: 0 20rpx 0 0;" size="mini" :disabled="btn" | 26 | @click="showApplyDialog">考点申请</button> |
| 27 | @click="payTheFees">去缴费</button> | 27 | <button class="btn-red" style="margin: 0 20rpx 0 0;" size="mini" :disabled="btn" |
| 28 | <button class="btn-red-kx" style="margin: 0 20rpx 0 0;" size="mini" v-if="form.deptType!=1" | 28 | @click="payTheFees">去缴费</button> |
| 29 | @click="auditEditFN">审核详情</button> | 29 | <button class="btn-red-kx" style="margin: 0 20rpx 0 0;" size="mini" v-if="form.deptType!=1" |
| 30 | </view> | 30 | @click="auditEditFN">审核详情</button> |
| 31 | </view> | 31 | </view> |
| 32 | </view> | 32 | </view> |
| 33 | <view class="mainbox"> | 33 | </view> |
| 34 | <uni-list> | 34 | <view class="mainbox"> |
| 35 | <uni-list-item v-if="authenticationStatusa != 1&&authenticationStatusa != 0&&authenticationStatusa != 3" | 35 | <uni-list> |
| 36 | title="所属协会" :rightText="form.aname"> | 36 | <uni-list-item v-if="authenticationStatusa != 1&&authenticationStatusa != 0&&authenticationStatusa != 3" |
| 37 | </uni-list-item> | 37 | title="所属协会" :rightText="form.aname"> |
| 38 | <uni-list-item title="会员编号" v-if="form.menCode" :rightText="form.menCode" /> | 38 | </uni-list-item> |
| 39 | <uni-list-item title="机构名称" :rightText="form.name" /> | 39 | <uni-list-item title="会员编号" v-if="form.menCode" :rightText="form.menCode" /> |
| 40 | <uni-list-item title="所属省份"> | 40 | <uni-list-item title="机构名称" :rightText="form.name" /> |
| 41 | <template v-slot:footer> | 41 | <uni-list-item title="所属省份"> |
| 42 | <view class="frrr"> | 42 | <template v-slot:footer> |
| 43 | <uni-data-picker readonly :clear-icon="false" | 43 | <view class="frrr"> |
| 44 | v-model="form.belongProvinceId" :localdata="options"> | 44 | <uni-data-picker readonly :clear-icon="false" v-model="form.belongProvinceId" |
| 45 | </uni-data-picker> | 45 | :localdata="options"> |
| 46 | </view> | 46 | </uni-data-picker> |
| 47 | </template> | 47 | </view> |
| 48 | </uni-list-item> | 48 | </template> |
| 49 | <uni-list-item title="社会信用代码" | 49 | </uni-list-item> |
| 50 | v-if="authenticationStatusa != 1&&authenticationStatusa != 0&&authenticationStatusa != 3&&newResult||form.associateId&&form.associateId>0||activeStatus==1" | 50 | <uni-list-item title="社会信用代码" |
| 51 | :rightText="form.creditCode" /> | 51 | v-if="authenticationStatusa != 1&&authenticationStatusa != 0&&authenticationStatusa != 3&&newResult||form.associateId&&form.associateId>0||activeStatus==1" |
| 52 | <uni-list-item v-if="form.certSiteContact" title="联系人" :rightText="form.certSiteContact" /> | 52 | :rightText="form.creditCode" /> |
| 53 | <uni-list-item v-else title="联系人" :rightText="form.contact" /> | 53 | <uni-list-item v-if="form.certSiteContact" title="联系人" :rightText="form.certSiteContact" /> |
| 54 | <uni-list-item v-if="form.certSiteTel" title="联系方式" :rightText="form.certSiteTel" /> | 54 | <uni-list-item v-else title="联系人" :rightText="form.contact" /> |
| 55 | <uni-list-item v-else title="联系方式" :rightText="form.phone" /> | 55 | <uni-list-item v-if="form.certSiteTel" title="联系方式" :rightText="form.certSiteTel" /> |
| 56 | <uni-list-item title="认证地址"> | 56 | <uni-list-item v-else title="联系方式" :rightText="form.phone" /> |
| 57 | <template v-slot:footer> | 57 | <uni-list-item title="认证地址"> |
| 58 | <view class="frrr"> | 58 | <template v-slot:footer> |
| 59 | <uni-data-picker readonly :clear-icon="false" v-if="form.certRegionId" | 59 | <view class="frrr"> |
| 60 | v-model="form.certRegionId" :localdata="options"> | 60 | <uni-data-picker readonly :clear-icon="false" v-if="form.certRegionId" |
| 61 | </uni-data-picker> | 61 | v-model="form.certRegionId" :localdata="options"> |
| 62 | <uni-data-picker readonly :clear-icon="false" v-else-if="form.certCityId" | 62 | </uni-data-picker> |
| 63 | v-model="form.certCityId" :localdata="options"> | 63 | <uni-data-picker readonly :clear-icon="false" v-else-if="form.certCityId" |
| 64 | </uni-data-picker> | 64 | v-model="form.certCityId" :localdata="options"> |
| 65 | <uni-data-picker readonly :clear-icon="false" v-else-if="form.certProvinceId" | 65 | </uni-data-picker> |
| 66 | v-model="form.certProvinceId" :localdata="options"> | 66 | <uni-data-picker readonly :clear-icon="false" v-else-if="form.certProvinceId" |
| 67 | </uni-data-picker> | 67 | v-model="form.certProvinceId" :localdata="options"> |
| 68 | </view> | 68 | </uni-data-picker> |
| 69 | </template> | 69 | </view> |
| 70 | </uni-list-item> | 70 | </template> |
| 71 | <uni-list-item title="认证详细地址" :rightText="form.certAddress" /> | 71 | </uni-list-item> |
| 72 | <uni-list-item title="法人姓名" :rightText="form.certLegal||'--'" /> | 72 | <uni-list-item title="认证详细地址" :rightText="form.certAddress" /> |
| 73 | 73 | <uni-list-item title="法人姓名" :rightText="form.certLegal||'--'" /> | |
| 74 | <uni-list-item v-if="form.deptType==6" title="是否为考点" :rightText="form.isPoints==0?'是':'否'" /> | 74 | |
| 75 | <uni-list-item title="法人身份证" clickable> | 75 | <uni-list-item v-if="form.deptType==6" title="是否为考点" :rightText="form.isPoints==0?'是':'否'" /> |
| 76 | <template v-slot:footer> | 76 | <uni-list-item title="法人身份证" clickable> |
| 77 | <view v-if="form.legalIdcPhotoArr&&form.legalIdcPhotoArr?.length>0" class="frrr"> | 77 | <template v-slot:footer> |
| 78 | <image class="ylImage" mode="aspectFit" @click="showImage(form.legalIdcPhotoArr,index)" | 78 | <view v-if="form.legalIdcPhotoArr&&form.legalIdcPhotoArr?.length>0" class="frrr"> |
| 79 | v-for="(item,index) in form.legalIdcPhotoArr" :key="item" :src="item"> | 79 | <image class="ylImage" mode="aspectFit" @click="showImage(form.legalIdcPhotoArr,index)" |
| 80 | </image> | 80 | v-for="(item,index) in form.legalIdcPhotoArr" :key="item" :src="item"> |
| 81 | </view> | 81 | </image> |
| 82 | </template> | 82 | </view> |
| 83 | </uni-list-item> | 83 | </template> |
| 84 | 84 | </uni-list-item> | |
| 85 | <uni-list-item title="营业执照" clickable> | 85 | |
| 86 | <template v-slot:footer> | 86 | <uni-list-item title="营业执照" clickable> |
| 87 | <view class="frrr" @click="download(form.businessLicenseArr[0]?.url)" | 87 | <template v-slot:footer> |
| 88 | v-if="form.businessLicenseArr&&form.businessLicenseArr?.length>0"> | 88 | <view class="frrr" @click="download(form.businessLicenseArr[0]?.url)" |
| 89 | <text class="text-primary">{{form.businessLicenseArr[0]?.name}}</text> | 89 | v-if="form.businessLicenseArr&&form.businessLicenseArr?.length>0"> |
| 90 | </view> | 90 | <text class="text-primary">{{form.businessLicenseArr[0]?.name}}</text> |
| 91 | </template> | 91 | </view> |
| 92 | </uni-list-item> | 92 | </template> |
| 93 | <uni-list-item title="机构照片" clickable> | 93 | </uni-list-item> |
| 94 | <template v-slot:footer > | 94 | <uni-list-item title="机构照片" clickable> |
| 95 | <view class="frrr"> | 95 | <template v-slot:footer> |
| 96 | <view v-if="form.picturesArr&&form.picturesArr?.length>0" class="photoBook" | 96 | <view class="frrr"> |
| 97 | @click="showImage(form.picturesArr,0)"> | 97 | <view v-if="form.picturesArr&&form.picturesArr?.length>0" class="photoBook" |
| 98 | <image mode="aspectFit" class="ylImage" :src="form.picturesArr[0]"> | 98 | @click="showImage(form.picturesArr,0)"> |
| 99 | </image> | 99 | <image mode="aspectFit" class="ylImage" :src="form.picturesArr[0]"> |
| 100 | <text>共{{form.picturesArr?.length}}张</text> | 100 | </image> |
| 101 | </view> | 101 | <text>共{{form.picturesArr?.length}}张</text> |
| 102 | </view> | 102 | </view> |
| 103 | </template> | 103 | </view> |
| 104 | </uni-list-item> | 104 | </template> |
| 105 | </uni-list> | 105 | </uni-list-item> |
| 106 | </view> | 106 | </uni-list> |
| 107 | <!-- 弹窗添加触摸事件拦截 --> | 107 | </view> |
| 108 | <uni-popup ref="applyPopup" type="center" | 108 | <!-- 弹窗添加触摸事件拦截 --> |
| 109 | @touchmove.stop.prevent="() => {}" | 109 | <uni-popup ref="applyPopup" type="center" @touchmove.stop.prevent="() => {}" @open="onPopupOpen" |
| 110 | @open="onPopupOpen" | 110 | @close="onPopupClose"> |
| 111 | @close="onPopupClose"> | 111 | <view class="apply-dialog" @touchmove.stop.prevent="() => {}"> |
| 112 | <view class="apply-dialog" @touchmove.stop.prevent="() => {}"> | 112 | <view class="dialog-title">考点申请</view> |
| 113 | <view class="dialog-title">考点申请</view> | 113 | <view class="dialog-content"> |
| 114 | <view class="dialog-content"> | 114 | <text class="remind">友情提示:非考点无法申请级位考试</text> |
| 115 | <text class="remind">友情提示:非考点无法申请级位考试</text> | 115 | </view> |
| 116 | </view> | 116 | <view class="dialog-buttons"> |
| 117 | <view class="dialog-buttons"> | 117 | <button class="btn-cancel" @click="closeApplyDialog">暂不申请</button> |
| 118 | <button class="btn-cancel" @click="closeApplyDialog">暂不申请</button> | 118 | <button class="btn-confirm" @click="goToApplyPage">立即申请</button> |
| 119 | <button class="btn-confirm" @click="goToApplyPage">立即申请</button> | 119 | </view> |
| 120 | </view> | 120 | </view> |
| 121 | </view> | 121 | </uni-popup> |
| 122 | </uni-popup> | 122 | <view class="height1"></view> |
| 123 | <view class="height1"></view> | 123 | </view> |
| 124 | </view> | 124 | </template> |
| 125 | </template> | 125 | |
| 126 | 126 | <script setup> | |
| 127 | <script setup> | 127 | import * as api from '@/common/api.js' |
| 128 | import * as api from '@/common/api.js' | 128 | import config from '@/config.js' |
| 129 | import config from '@/config.js' | 129 | import * as loginServer from '@/common/login.js'; |
| 130 | import * as loginServer from '@/common/login.js'; | 130 | |
| 131 | 131 | import _ from 'underscore' | |
| 132 | import _ from 'underscore' | 132 | import { |
| 133 | import { | 133 | ref, |
| 134 | ref, onUnmounted | 134 | onUnmounted |
| 135 | } from 'vue' | 135 | } from 'vue' |
| 136 | import { | 136 | import { |
| 137 | onLoad,onShow | 137 | onLoad, |
| 138 | } from '@dcloudio/uni-app' | 138 | onShow |
| 139 | const app = getApp() | 139 | } from '@dcloudio/uni-app' |
| 140 | const form = ref({ | 140 | const app = getApp() |
| 141 | type: 1 | 141 | const form = ref({ |
| 142 | }) | 142 | type: 1 |
| 143 | const userType = ref() | 143 | }) |
| 144 | const activeStatus = ref(0) | 144 | const userType = ref() |
| 145 | const directUnderFlag = ref(0) | 145 | const activeStatus = ref(0) |
| 146 | const showDirectly = ref(true) | 146 | const directUnderFlag = ref(0) |
| 147 | const authenticationStatusa = ref() | 147 | const showDirectly = ref(true) |
| 148 | const result = ref(false) | 148 | const authenticationStatusa = ref() |
| 149 | const newResult = ref(false) | 149 | const result = ref(false) |
| 150 | const btn = ref(false) | 150 | const newResult = ref(false) |
| 151 | const type = ref(true) | 151 | const btn = ref(false) |
| 152 | const flag = ref(false) | 152 | const type = ref(true) |
| 153 | const pr = ref({}) | 153 | const flag = ref(false) |
| 154 | const applicationForMembership1 = ref({}) | 154 | const pr = ref({}) |
| 155 | const options = ref([]) | 155 | const applicationForMembership1 = ref({}) |
| 156 | const applyPopup = ref(null) | 156 | const options = ref([]) |
| 157 | // 新增:控制弹窗显示状态(用于锁定滚动) | 157 | const applyPopup = ref(null) |
| 158 | const popupShow = ref(false) | 158 | // 新增:控制弹窗显示状态(用于锁定滚动) |
| 159 | // 考点审核状态 0 未提交 1 审核中 2 审核成功 3 审核失败 | 159 | const popupShow = ref(false) |
| 160 | const auditStatus = ref(0) | 160 | // 考点审核状态 0 未提交 1 审核中 2 审核成功 3 审核失败 |
| 161 | 161 | const auditStatus = ref(0) | |
| 162 | onShow(() => { | 162 | |
| 163 | init() | 163 | onShow(() => { |
| 164 | if (form.value.deptType != 1) { // 修复:原代码deptType未定义,改为form.value.deptType | 164 | init() |
| 165 | getMyStatusAPI() | 165 | if (form.value.deptType != 1) { // 修复:原代码deptType未定义,改为form.value.deptType |
| 166 | } | 166 | getMyStatusAPI() |
| 167 | }) | 167 | } |
| 168 | 168 | }) | |
| 169 | // 页面卸载时恢复滚动(防止异常锁死) | 169 | |
| 170 | onUnmounted(() => { | 170 | // 页面卸载时恢复滚动(防止异常锁死) |
| 171 | uni.setPageScrollEnabled({ enabled: true }) | 171 | onUnmounted(() => { |
| 172 | popupShow.value = false | 172 | uni.setPageScrollEnabled({ |
| 173 | }) | 173 | enabled: true |
| 174 | 174 | }) | |
| 175 | function init() { | 175 | popupShow.value = false |
| 176 | api.regionsList().then(res => { | 176 | }) |
| 177 | options.value = res.data | 177 | |
| 178 | }) | 178 | function init() { |
| 179 | api.getMyOwnMemberInfo().then(res => { | 179 | api.regionsList().then(res => { |
| 180 | console.log(res) | 180 | options.value = res.data |
| 181 | userType.value = app.globalData.userType | 181 | }) |
| 182 | newResult.value = res.data.newResult | 182 | api.getMyOwnMemberInfo().then(res => { |
| 183 | result.value = res.data.result | 183 | console.log(res) |
| 184 | authenticationStatusa.value = res.data.authenticationStatus | 184 | userType.value = app.globalData.userType |
| 185 | showDirectly.value = !res.data.memberInfo.associateId | 185 | newResult.value = res.data.newResult |
| 186 | activeStatus.value = res.data.memberInfo.activeStatus | 186 | result.value = res.data.result |
| 187 | pr.value = res.data.pr | 187 | authenticationStatusa.value = res.data.authenticationStatus |
| 188 | directUnderFlag.value = res.data.memberInfo.directUnderFlag | 188 | showDirectly.value = !res.data.memberInfo.associateId |
| 189 | if (authenticationStatusa.value == 0) { | 189 | activeStatus.value = res.data.memberInfo.activeStatus |
| 190 | btn.value = false | 190 | pr.value = res.data.pr |
| 191 | } else if (authenticationStatusa.value == 1) { | 191 | directUnderFlag.value = res.data.memberInfo.directUnderFlag |
| 192 | btn.value = true | 192 | if (authenticationStatusa.value == 0) { |
| 193 | } else { | 193 | btn.value = false |
| 194 | btn.value = !result.value | 194 | } else if (authenticationStatusa.value == 1) { |
| 195 | } | 195 | btn.value = true |
| 196 | // 认证信息 | 196 | } else { |
| 197 | if (authenticationStatusa.value == 0 || authenticationStatusa.value == 3) { | 197 | btn.value = !result.value |
| 198 | type.value = false | 198 | } |
| 199 | } | 199 | // 认证信息 |
| 200 | // 至少审核通过一次 | 200 | if (authenticationStatusa.value == 0 || authenticationStatusa.value == 3) { |
| 201 | if (authenticationStatusa.value != 0) { | 201 | type.value = false |
| 202 | if (newResult.value) { | 202 | } |
| 203 | // 至少认证过一次 | 203 | // 至少审核通过一次 |
| 204 | flag.value = true | 204 | if (authenticationStatusa.value != 0) { |
| 205 | } | 205 | if (newResult.value) { |
| 206 | } | 206 | // 至少认证过一次 |
| 207 | if (!res.data.memberInfo) { | 207 | flag.value = true |
| 208 | res.data.memberInfo = {} | 208 | } |
| 209 | } | 209 | } |
| 210 | if (!res.data.dept) { | 210 | if (!res.data.memberInfo) { |
| 211 | res.data.dept = {} | 211 | res.data.memberInfo = {} |
| 212 | } | 212 | } |
| 213 | form.value = { | 213 | if (!res.data.dept) { |
| 214 | ...res.data.dept, | 214 | res.data.dept = {} |
| 215 | ...res.data.memberInfo | 215 | } |
| 216 | } | 216 | form.value = { |
| 217 | // 入会材料 | 217 | ...res.data.dept, |
| 218 | if (form.value.materials) { | 218 | ...res.data.memberInfo |
| 219 | form.value.materials1 = JSON.parse(form.value.materials) | 219 | } |
| 220 | } | 220 | // 入会材料 |
| 221 | // 入会申请书 | 221 | if (form.value.materials) { |
| 222 | if (form.value.applicationForMembership) { | 222 | form.value.materials1 = JSON.parse(form.value.materials) |
| 223 | form.value.applicationForMembership1 = JSON.parse(form.value.applicationForMembership) | 223 | } |
| 224 | } | 224 | // 入会申请书 |
| 225 | applicationForMembership1.value = form.value.applicationForMembership || [] | 225 | if (form.value.applicationForMembership) { |
| 226 | form.value.deptType = res.data.dept.deptType | 226 | form.value.applicationForMembership1 = JSON.parse(form.value.applicationForMembership) |
| 227 | 227 | } | |
| 228 | if (form.value.businessLicense) { | 228 | applicationForMembership1.value = form.value.applicationForMembership || [] |
| 229 | form.value.businessLicenseArr = [] | 229 | form.value.deptType = res.data.dept.deptType |
| 230 | try{ | 230 | |
| 231 | form.value.businessLicenseArr = JSON.parse(form.value.businessLicense) || [] | 231 | if (form.value.businessLicense) { |
| 232 | }catch(e){ | 232 | form.value.businessLicenseArr = [] |
| 233 | form.value.businessLicenseArr=[{url:form.value.businessLicense,name:'营业执照'}] | 233 | try { |
| 234 | } | 234 | form.value.businessLicenseArr = JSON.parse(form.value.businessLicense) || [] |
| 235 | console.log('营业执照',form.value.businessLicenseArr) | 235 | } catch (e) { |
| 236 | } | 236 | form.value.businessLicenseArr = [{ |
| 237 | if (form.value.certLegalIdcPhoto && form.value.certLegalIdcPhoto!=null) { | 237 | url: form.value.businessLicense, |
| 238 | form.value.legalIdcPhotoArr = [] | 238 | name: '营业执照' |
| 239 | var arr = form.value.certLegalIdcPhoto?.split(',') || [] | 239 | }] |
| 240 | if (arr.length > 0) { | 240 | } |
| 241 | arr = _.map(arr, (p) => { | 241 | console.log('营业执照', form.value.businessLicenseArr) |
| 242 | if(p.indexOf('http')==-1){ | 242 | } |
| 243 | console.log(p) | 243 | if (form.value.certLegalIdcPhoto && form.value.certLegalIdcPhoto != null) { |
| 244 | p = config.baseUrl_api + p | 244 | form.value.legalIdcPhotoArr = [] |
| 245 | } | 245 | var arr = form.value.certLegalIdcPhoto?.split(',') || [] |
| 246 | return p | 246 | if (arr.length > 0) { |
| 247 | }) | 247 | arr = _.map(arr, (p) => { |
| 248 | form.value.legalIdcPhotoArr = arr | 248 | if (p.indexOf('http') == -1) { |
| 249 | } | 249 | console.log(p) |
| 250 | console.log('法人身份证',form.value.legalIdcPhotoArr) | 250 | p = config.baseUrl_api + p |
| 251 | } | 251 | } |
| 252 | if (form.value.certPictures) { | 252 | return p |
| 253 | form.value.picturesArr = [] | 253 | }) |
| 254 | var arr = form.value.certPictures.split(',') || [] | 254 | form.value.legalIdcPhotoArr = arr |
| 255 | if (arr.length > 0) { | 255 | } |
| 256 | arr = _.map(arr, (p) => { | 256 | console.log('法人身份证', form.value.legalIdcPhotoArr) |
| 257 | if(p.indexOf('http')==-1){ | 257 | } |
| 258 | p = config.baseUrl_api + p | 258 | if (form.value.certPictures) { |
| 259 | } | 259 | form.value.picturesArr = [] |
| 260 | return p | 260 | var arr = form.value.certPictures.split(',') || [] |
| 261 | }) | 261 | if (arr.length > 0) { |
| 262 | form.value.picturesArr = arr | 262 | arr = _.map(arr, (p) => { |
| 263 | } | 263 | if (p.indexOf('http') == -1) { |
| 264 | console.log(form.value.picturesArr) | 264 | p = config.baseUrl_api + p |
| 265 | } | 265 | } |
| 266 | }) | 266 | return p |
| 267 | } | 267 | }) |
| 268 | 268 | form.value.picturesArr = arr | |
| 269 | async function getMyStatusAPI() { | 269 | } |
| 270 | const { data } = await api.getMyStatus() | 270 | console.log(form.value.picturesArr) |
| 271 | if (data && data.auditStatus) { | 271 | } |
| 272 | auditStatus.value = data.auditStatus | 272 | }) |
| 273 | } else { | 273 | } |
| 274 | auditStatus.value = 0 | 274 | |
| 275 | } | 275 | async function getMyStatusAPI() { |
| 276 | } | 276 | const { |
| 277 | 277 | data | |
| 278 | // 新增:弹窗打开时锁定滚动 | 278 | } = await api.getMyStatus() |
| 279 | function onPopupOpen() { | 279 | if (data && data.auditStatus) { |
| 280 | popupShow.value = true | 280 | auditStatus.value = data.auditStatus |
| 281 | // 1. 小程序API锁定页面滚动 | 281 | } else { |
| 282 | uni.setPageScrollEnabled({ enabled: false }) | 282 | auditStatus.value = 0 |
| 283 | // 延时兜底(防止API生效延迟) | 283 | } |
| 284 | setTimeout(() => { | 284 | } |
| 285 | uni.setPageScrollEnabled({ enabled: false }) | 285 | |
| 286 | }, 100) | 286 | // 新增:弹窗打开时锁定滚动 |
| 287 | } | 287 | function onPopupOpen() { |
| 288 | 288 | popupShow.value = true | |
| 289 | // 新增:弹窗关闭时恢复滚动 | 289 | // 1. 小程序API锁定页面滚动 |
| 290 | function onPopupClose() { | 290 | uni.setPageScrollEnabled({ |
| 291 | popupShow.value = false | 291 | enabled: false |
| 292 | // 恢复页面滚动 | 292 | }) |
| 293 | uni.setPageScrollEnabled({ enabled: true }) | 293 | // 延时兜底(防止API生效延迟) |
| 294 | setTimeout(() => { | 294 | setTimeout(() => { |
| 295 | uni.setPageScrollEnabled({ enabled: true }) | 295 | uni.setPageScrollEnabled({ |
| 296 | }, 100) | 296 | enabled: false |
| 297 | } | 297 | }) |
| 298 | 298 | }, 100) | |
| 299 | function showApplyDialog() { | 299 | } |
| 300 | applyPopup.value.open() | 300 | |
| 301 | } | 301 | // 新增:弹窗关闭时恢复滚动 |
| 302 | 302 | function onPopupClose() { | |
| 303 | // 关闭申请弹窗 | 303 | popupShow.value = false |
| 304 | function closeApplyDialog() { | 304 | // 恢复页面滚动 |
| 305 | applyPopup.value.close() | 305 | uni.setPageScrollEnabled({ |
| 306 | } | 306 | enabled: true |
| 307 | 307 | }) | |
| 308 | // 跳转到考点申请页面 | 308 | setTimeout(() => { |
| 309 | function goToApplyPage() { | 309 | uni.setPageScrollEnabled({ |
| 310 | closeApplyDialog() | 310 | enabled: true |
| 311 | uni.navigateTo({ | 311 | }) |
| 312 | url: `/myCenter/examPointApply?memId=${form.value.memId}` | 312 | }, 100) |
| 313 | }) | 313 | } |
| 314 | } | 314 | |
| 315 | 315 | function showApplyDialog() { | |
| 316 | function auditEditFN() { | 316 | applyPopup.value.open() |
| 317 | uni.navigateTo({ | 317 | } |
| 318 | url: `/myCenter/reviewList` | 318 | |
| 319 | }) | 319 | // 关闭申请弹窗 |
| 320 | } | 320 | function closeApplyDialog() { |
| 321 | 321 | applyPopup.value.close() | |
| 322 | function showImage(arr, index) { | 322 | } |
| 323 | uni.previewImage({ | 323 | |
| 324 | urls: arr, | 324 | // 跳转到考点申请页面 |
| 325 | current: index, | 325 | function goToApplyPage() { |
| 326 | success: function(res) {} | 326 | closeApplyDialog() |
| 327 | }) | 327 | uni.navigateTo({ |
| 328 | } | 328 | url: `/myCenter/examPointApply?memId=${form.value.memId}` |
| 329 | 329 | }) | |
| 330 | function download(url) { | 330 | } |
| 331 | console.log(url) | 331 | |
| 332 | if (url.indexOf('.png') > -1 || url.indexOf('.jpg') > -1) { | 332 | function auditEditFN() { |
| 333 | if(url.indexOf('http')>-1){ | 333 | uni.navigateTo({ |
| 334 | uni.previewImage({ | 334 | url: `/myCenter/reviewList` |
| 335 | urls: [url], | 335 | }) |
| 336 | success: function(res) {} | 336 | } |
| 337 | }) | 337 | |
| 338 | } else { | 338 | function showImage(arr, index) { |
| 339 | uni.previewImage({ | 339 | uni.previewImage({ |
| 340 | urls: [config.baseUrl_api + url], | 340 | urls: arr, |
| 341 | success: function(res) {} | 341 | current: index, |
| 342 | }) | 342 | success: function(res) {} |
| 343 | } | 343 | }) |
| 344 | } else { | 344 | } |
| 345 | if(url.indexOf('http')>-1){ | 345 | |
| 346 | goWebView(url) | 346 | function download(url) { |
| 347 | } else { | 347 | console.log(url) |
| 348 | goWebView(config.baseUrl_api + url) | 348 | if (url.indexOf('.png') > -1 || url.indexOf('.jpg') > -1) { |
| 349 | } | 349 | if (url.indexOf('http') > -1) { |
| 350 | } | 350 | uni.previewImage({ |
| 351 | } | 351 | urls: [url], |
| 352 | 352 | success: function(res) {} | |
| 353 | function goWebView(url) { | 353 | }) |
| 354 | url = url.replace("http://", "https://") | 354 | } else { |
| 355 | uni.showLoading({ | 355 | uni.previewImage({ |
| 356 | title: '下载中' | 356 | urls: [config.baseUrl_api + url], |
| 357 | }); | 357 | success: function(res) {} |
| 358 | uni.downloadFile({ | 358 | }) |
| 359 | url: url, | 359 | } |
| 360 | success: function(res) { | 360 | } else { |
| 361 | uni.hideLoading(); | 361 | if (url.indexOf('http') > -1) { |
| 362 | var filePath = res.tempFilePath; | 362 | goWebView(url) |
| 363 | uni.showLoading({ | 363 | } else { |
| 364 | title: '正在打开' | 364 | goWebView(config.baseUrl_api + url) |
| 365 | }); | 365 | } |
| 366 | uni.openDocument({ | 366 | } |
| 367 | filePath: filePath, | 367 | } |
| 368 | showMenu: true, | 368 | |
| 369 | success: function(res) { | 369 | function goWebView(url) { |
| 370 | uni.hideLoading(); | 370 | url = url.replace("http://", "https://") |
| 371 | }, | 371 | uni.showLoading({ |
| 372 | fail: function(err) { | 372 | title: '下载中' |
| 373 | uni.hideLoading(); | 373 | }); |
| 374 | uni.showToast({ | 374 | uni.downloadFile({ |
| 375 | title: err, | 375 | url: url, |
| 376 | icon: 'none', | 376 | success: function(res) { |
| 377 | duration: 2000 | 377 | uni.hideLoading(); |
| 378 | }); | 378 | var filePath = res.tempFilePath; |
| 379 | } | 379 | uni.showLoading({ |
| 380 | }); | 380 | title: '正在打开' |
| 381 | }, | 381 | }); |
| 382 | fail: function(error) { | 382 | uni.openDocument({ |
| 383 | uni.hideLoading(); | 383 | filePath: filePath, |
| 384 | uni.showToast({ | 384 | showMenu: true, |
| 385 | title: `下载失败`, | 385 | success: function(res) { |
| 386 | icon: 'none', | 386 | uni.hideLoading(); |
| 387 | duration: 2000 | 387 | }, |
| 388 | }); | 388 | fail: function(err) { |
| 389 | } | 389 | uni.hideLoading(); |
| 390 | }); | 390 | uni.showToast({ |
| 391 | } | 391 | title: err, |
| 392 | 392 | icon: 'none', | |
| 393 | function payTheFees(){ | 393 | duration: 2000 |
| 394 | if (!form.value.name) { | 394 | }); |
| 395 | uni.showToast({ | 395 | } |
| 396 | title: `请先完善团体信息`, | 396 | }); |
| 397 | icon: 'none' | 397 | }, |
| 398 | }); | 398 | fail: function(error) { |
| 399 | return; // 新增:防止无名称时跳转 | 399 | uni.hideLoading(); |
| 400 | } | 400 | uni.showToast({ |
| 401 | uni.navigateTo({ | 401 | title: `下载失败`, |
| 402 | url:`/myCenter/perfect` | 402 | icon: 'none', |
| 403 | }) | 403 | duration: 2000 |
| 404 | } | 404 | }); |
| 405 | </script> | 405 | } |
| 406 | 406 | }); | |
| 407 | <style scoped lang="scss"> | 407 | } |
| 408 | // 新增:锁定滚动的核心样式 | 408 | |
| 409 | .lock-scroll { | 409 | function payTheFees() { |
| 410 | position: fixed !important; | 410 | if (!form.value.name) { |
| 411 | top: 0; | 411 | uni.showToast({ |
| 412 | left: 0; | 412 | title: `请先完善团体信息`, |
| 413 | right: 0; | 413 | icon: 'none' |
| 414 | bottom: 0; | 414 | }); |
| 415 | overflow: hidden !important; | 415 | return; // 新增:防止无名称时跳转 |
| 416 | height: 100vh !important; | 416 | } |
| 417 | } | 417 | uni.navigateTo({ |
| 418 | 418 | url: `/myCenter/perfect` | |
| 419 | .height1{height: 100rpx;} | 419 | }) |
| 420 | .photobox { | 420 | } |
| 421 | position: relative; | 421 | </script> |
| 422 | margin: 30rpx auto; | 422 | |
| 423 | 423 | <style scoped lang="scss"> | |
| 424 | .photo { | 424 | // 新增:锁定滚动的核心样式 |
| 425 | width: 210rpx; | 425 | .lock-scroll { |
| 426 | height: 280rpx; | 426 | position: fixed !important; |
| 427 | background-color: #f4f4f4; | 427 | top: 0; |
| 428 | display: block; | 428 | left: 0; |
| 429 | margin: auto; | 429 | right: 0; |
| 430 | } | 430 | bottom: 0; |
| 431 | } | 431 | overflow: hidden !important; |
| 432 | .ylImage { | 432 | height: 100vh !important; |
| 433 | width: 300rpx; | 433 | } |
| 434 | height: 200rpx; | 434 | |
| 435 | display: block; | 435 | .height1 { |
| 436 | box-shadow: 0 0 10rpx #ddd; | 436 | height: 100rpx; |
| 437 | border-radius: 8rpx; | 437 | } |
| 438 | } | 438 | |
| 439 | 439 | .photobox { | |
| 440 | .photoBook{position: relative;border-radius: 10rpx; overflow: hidden; | 440 | position: relative; |
| 441 | &::after{content: '';position: absolute;width: 100%;height: 100%;top: 0;left: 0; | 441 | margin: 30rpx auto; |
| 442 | background: linear-gradient(180deg,rgba(0, 0, 0, 0),rgba(0, 0, 0, 0.7)); | 442 | |
| 443 | } | 443 | .photo { |
| 444 | text{ position: absolute;z-index: 1; | 444 | width: 210rpx; |
| 445 | font-size: 24rpx; | 445 | height: 280rpx; |
| 446 | color: #fff; | 446 | background-color: #f4f4f4; |
| 447 | bottom: 4rpx; | 447 | display: block; |
| 448 | right: 8rpx;} | 448 | margin: auto; |
| 449 | } | 449 | } |
| 450 | .frrr{width: 100%;text-align: right; | 450 | } |
| 451 | text-align: right; | 451 | |
| 452 | display: flex; | 452 | .ylImage { |
| 453 | flex-wrap: wrap; | 453 | width: 300rpx; |
| 454 | justify-content: flex-end;} | 454 | height: 200rpx; |
| 455 | :deep(.selected-list){font-size: 32rpx;padding: 0;} | 455 | display: block; |
| 456 | :deep(.input-value){padding: 0;} | 456 | box-shadow: 0 0 10rpx #ddd; |
| 457 | :deep(.uni-list-item__extra-text) { | 457 | border-radius: 8rpx; |
| 458 | font-size: 32rpx;color: #000; | 458 | } |
| 459 | } | 459 | |
| 460 | 460 | .photoBook { | |
| 461 | :deep(.uni-list-item__extra) { | 461 | position: relative; |
| 462 | flex: 1 1 auto; | 462 | border-radius: 10rpx; |
| 463 | } | 463 | overflow: hidden; |
| 464 | 464 | ||
| 465 | :deep(.uni-list-item__content) { | 465 | &::after { |
| 466 | flex: 0 0 auto; | 466 | content: ''; |
| 467 | } | 467 | position: absolute; |
| 468 | 468 | width: 100%; | |
| 469 | :deep(.uni-list-item__content-title) { | 469 | height: 100%; |
| 470 | color: #999; | 470 | top: 0; |
| 471 | } | 471 | left: 0; |
| 472 | 472 | background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.7)); | |
| 473 | .flexbox { | 473 | } |
| 474 | padding: 30rpx; | 474 | |
| 475 | background-color: #fff; | 475 | text { |
| 476 | justify-content: space-between; | 476 | position: absolute; |
| 477 | } | 477 | z-index: 1; |
| 478 | 478 | font-size: 24rpx; | |
| 479 | .mainbox { | 479 | color: #fff; |
| 480 | margin: 30rpx; | 480 | bottom: 4rpx; |
| 481 | } | 481 | right: 8rpx; |
| 482 | .apply-dialog { | 482 | } |
| 483 | width: 530rpx; | 483 | } |
| 484 | background: #fff; | 484 | |
| 485 | border-radius: 16rpx; | 485 | .frrr { |
| 486 | padding: 40rpx; | 486 | width: 100%; |
| 487 | // 新增:禁止弹窗内部滚动 | 487 | text-align: right; |
| 488 | touch-action: none; | 488 | text-align: right; |
| 489 | } | 489 | display: flex; |
| 490 | .dialog-title { | 490 | flex-wrap: wrap; |
| 491 | font-size: 32rpx; | 491 | justify-content: flex-end; |
| 492 | font-weight: bold; | 492 | } |
| 493 | text-align: center; | 493 | |
| 494 | margin-bottom: 30rpx; | 494 | :deep(.selected-list) { |
| 495 | } | 495 | font-size: 32rpx; |
| 496 | .dialog-content { | 496 | padding: 0; |
| 497 | margin: 40rpx; | 497 | } |
| 498 | } | 498 | |
| 499 | .remind { | 499 | :deep(.input-value) { |
| 500 | color: #FF8124; | 500 | padding: 0; |
| 501 | font-size: 26rpx; | 501 | } |
| 502 | margin-top: 40rpx; | 502 | |
| 503 | } | 503 | :deep(.uni-list-item__extra-text) { |
| 504 | .dialog-buttons { | 504 | font-size: 32rpx; |
| 505 | display: flex; | 505 | color: #000; |
| 506 | justify-content: space-between; | 506 | } |
| 507 | margin-top: 40rpx; | 507 | |
| 508 | } | 508 | :deep(.uni-list-item__extra) { |
| 509 | .btn-cancel { | 509 | flex: 1 1 auto; |
| 510 | width: 225rpx; | 510 | } |
| 511 | height: 80rpx; | 511 | |
| 512 | line-height: 80rpx; | 512 | :deep(.uni-list-item__content) { |
| 513 | border: 1rpx solid #ddd; | 513 | flex: 0 0 auto; |
| 514 | border-radius: 40rpx; | 514 | } |
| 515 | background: #fff; | 515 | |
| 516 | color: #333; | 516 | :deep(.uni-list-item__content-title) { |
| 517 | text-align: center; | 517 | color: #999; |
| 518 | font-size: 14px; | 518 | } |
| 519 | } | 519 | |
| 520 | .btn-confirm { | 520 | .flexbox { |
| 521 | width: 225rpx; | 521 | padding: 30rpx; |
| 522 | height: 80rpx; | 522 | background-color: #fff; |
| 523 | line-height: 80rpx; | 523 | justify-content: space-between; |
| 524 | border-radius: 40rpx; | 524 | } |
| 525 | background: #C4121B; | 525 | |
| 526 | font-size: 14px; | 526 | .mainbox { |
| 527 | color: #fff; | 527 | margin: 30rpx; |
| 528 | text-align: center; | 528 | } |
| 529 | } | 529 | |
| 530 | 530 | .apply-dialog { | |
| 531 | // 新增:给uni-popup蒙版添加禁止滚动样式 | 531 | width: 530rpx; |
| 532 | :deep(.uni-popup__mask) { | 532 | background: #fff; |
| 533 | touch-action: none !important; | 533 | border-radius: 16rpx; |
| 534 | } | 534 | padding: 40rpx; |
| 535 | // 新增:禁止弹窗内部滚动 | ||
| 536 | touch-action: none; | ||
| 537 | } | ||
| 538 | |||
| 539 | .dialog-title { | ||
| 540 | font-size: 32rpx; | ||
| 541 | font-weight: bold; | ||
| 542 | text-align: center; | ||
| 543 | margin-bottom: 30rpx; | ||
| 544 | } | ||
| 545 | |||
| 546 | .dialog-content { | ||
| 547 | margin: 40rpx; | ||
| 548 | } | ||
| 549 | |||
| 550 | .remind { | ||
| 551 | color: #FF8124; | ||
| 552 | font-size: 26rpx; | ||
| 553 | margin-top: 40rpx; | ||
| 554 | } | ||
| 555 | |||
| 556 | .dialog-buttons { | ||
| 557 | display: flex; | ||
| 558 | justify-content: space-between; | ||
| 559 | margin-top: 40rpx; | ||
| 560 | } | ||
| 561 | |||
| 562 | .btn-cancel { | ||
| 563 | width: 225rpx; | ||
| 564 | height: 80rpx; | ||
| 565 | line-height: 80rpx; | ||
| 566 | border: 1rpx solid #ddd; | ||
| 567 | border-radius: 40rpx; | ||
| 568 | background: #fff; | ||
| 569 | color: #333; | ||
| 570 | text-align: center; | ||
| 571 | font-size: 14px; | ||
| 572 | } | ||
| 573 | |||
| 574 | .btn-confirm { | ||
| 575 | width: 225rpx; | ||
| 576 | height: 80rpx; | ||
| 577 | line-height: 80rpx; | ||
| 578 | border-radius: 40rpx; | ||
| 579 | background: #C4121B; | ||
| 580 | font-size: 14px; | ||
| 581 | color: #fff; | ||
| 582 | text-align: center; | ||
| 583 | } | ||
| 584 | |||
| 585 | // 新增:给uni-popup蒙版添加禁止滚动样式 | ||
| 586 | :deep(.uni-popup__mask) { | ||
| 587 | touch-action: none !important; | ||
| 588 | } | ||
| 535 | </style> | 589 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view class="container"> | 2 | <view class="container"> |
| 3 | <view class="content"> | 3 | <view class="content"> |
| 4 | <view class="card"> | 4 | <view class="card"> |
| 5 | <view class="yearRow"> | 5 | <view class="yearRow"> |
| 6 | <view class="label">缴费年限</view> | 6 | <view class="label">缴费年限</view> |
| 7 | <view class="control"> | 7 | <view class="control"> |
| 8 | <image class="icon" @click="minusYear" src="/static/dd_02.png" mode="widthFix" v-if="form.renewYear > 1" ></image> | 8 | <image class="icon" @click="minusYear" src="/static/dd_02.png" mode="widthFix" |
| 9 | <image class="icon" src="/static/dd_02_g.png" mode="widthFix" v-else ></image> | 9 | v-if="form.renewYear > 1"></image> |
| 10 | <text class="num">{{ form.renewYear }}年</text> | 10 | <image class="icon" src="/static/dd_02_g.png" mode="widthFix" v-else></image> |
| 11 | <image class="icon" src="/static/btn_03.png" mode="widthFix" @click="plusYear" v-if="form.renewYear < 5" ></image> | 11 | <text class="num">{{ form.renewYear }}年</text> |
| 12 | <image class="icon" src="/static/btn_03_g.png" mode="widthFix" v-else ></image> | 12 | <image class="icon" src="/static/btn_03.png" mode="widthFix" @click="plusYear" |
| 13 | </view> | 13 | v-if="form.renewYear < 5"></image> |
| 14 | </view> | 14 | <image class="icon" src="/static/btn_03_g.png" mode="widthFix" v-else></image> |
| 15 | </view> | 15 | </view> |
| 16 | 16 | </view> | |
| 17 | <view class="card "> | 17 | </view> |
| 18 | <!-- 费用合计 --> | 18 | |
| 19 | <view class="row "> | 19 | <view class="card "> |
| 20 | <text class="label">费用合计</text> | 20 | <!-- 费用合计 --> |
| 21 | <text class="value red">{{ form.renewYear * memberFee }}元</text> | 21 | <view class="row "> |
| 22 | </view> | 22 | <text class="label">费用合计</text> |
| 23 | 23 | <text class="value red">{{ (form.renewYear * memberFee).toFixed(2) }}元</text> | |
| 24 | <view class="hintRow" v-if="preferentialPolicy"> | 24 | </view> |
| 25 | <text class="hintText">温馨提示:根据中国跆协{{ preferentialData.name || '优惠' }}政策减免一年费用,每个单位在政策有效期内只享受一次</text> | 25 | |
| 26 | </view> | 26 | <view class="hintRow" v-if="preferentialPolicy"> |
| 27 | </view> | 27 | <text |
| 28 | 28 | class="hintText">温馨提示:根据中国跆协{{ preferentialData.name || '优惠' }}政策减免一年费用,每个单位在政策有效期内只享受一次</text> | |
| 29 | <view class="payRow "> | 29 | </view> |
| 30 | <radio-group @change="onPayTypeChange"> | 30 | </view> |
| 31 | <label class="radioItem"> | 31 | |
| 32 | <radio value="1" :checked="payType === '1'" class="custom-radio" /> | 32 | <view class="payRow "> |
| 33 | <view class="payInfo"> | 33 | <radio-group @change="onPayTypeChange"> |
| 34 | <image class="icon" src="/static/min.png" mode="widthFix"></image> | 34 | <label class="radioItem"> |
| 35 | <text>民生付</text> | 35 | <radio value="1" :checked="payType === '1'" class="custom-radio" /> |
| 36 | </view> | 36 | <view class="payInfo"> |
| 37 | </label> | 37 | <image class="icon" src="/static/min.png" mode="widthFix"></image> |
| 38 | </radio-group> | 38 | <text>民生付</text> |
| 39 | </view> | 39 | </view> |
| 40 | 40 | </label> | |
| 41 | <view class="totalRow "> | 41 | </radio-group> |
| 42 | <text class="label">支付费用合计</text> | 42 | </view> |
| 43 | <text class="value redBig">{{ memberTotalFee }}元</text> | 43 | |
| 44 | </view> | 44 | <view class="totalRow "> |
| 45 | 45 | <text class="label">支付费用合计</text> | |
| 46 | </view> | 46 | <text class="value redBig">{{ memberTotalFee }}元</text> |
| 47 | 47 | </view> | |
| 48 | <view class="bottomBtn"> | 48 | |
| 49 | <view class="deductRow"> | 49 | </view> |
| 50 | <text class="label">减免费用</text> | 50 | |
| 51 | <text class="value red">-{{ memberFee }}元</text> | 51 | <view class="bottomBtn"> |
| 52 | </view> | 52 | <view class="deductRow"> |
| 53 | <button class="payBtn" @click="handelPay" :loading="isPaying">立即支付 ¥{{ memberTotalFee }}</button> | 53 | <text class="label">减免费用</text> |
| 54 | </view> | 54 | <text class="value red">-{{ memberFee.toFixed(2) }}元</text> |
| 55 | 55 | </view> | |
| 56 | </view> | 56 | <button class="payBtn" @click="handelPay" :loading="isPaying">立即支付 ¥{{ memberTotalFee }}</button> |
| 57 | </template> | 57 | </view> |
| 58 | 58 | ||
| 59 | <script setup> | 59 | </view> |
| 60 | import { ref, computed } from 'vue' | 60 | </template> |
| 61 | import { onLoad } from '@dcloudio/uni-app'; | 61 | |
| 62 | import * as api from '@/common/api.js' | 62 | <script setup> |
| 63 | 63 | import { | |
| 64 | const form = ref({ | 64 | ref, |
| 65 | renewYear: 1 | 65 | computed |
| 66 | }) | 66 | } from 'vue' |
| 67 | const memberFee = ref(0) | 67 | import { |
| 68 | const preferentialPolicy = ref(false) | 68 | onLoad |
| 69 | const preferentialData = ref({ name: '优惠' }) | 69 | } from '@dcloudio/uni-app'; |
| 70 | const payType = ref('1') | 70 | import to from 'await-to-js' |
| 71 | const isPaying = ref(false) | 71 | import * as api from '@/common/api.js' |
| 72 | 72 | ||
| 73 | const memberTotalFee = computed(() => { | 73 | const form = ref({ |
| 74 | if (preferentialPolicy.value) { | 74 | renewYear: 1 |
| 75 | return memberFee.value * form.value.renewYear - memberFee.value * 1 | 75 | }) |
| 76 | } else { | 76 | const memberFee = ref(0) |
| 77 | return memberFee.value * form.value.renewYear | 77 | const preferentialPolicy = ref(false) |
| 78 | } | 78 | const preferentialData = ref({ |
| 79 | }) | 79 | name: '优惠' |
| 80 | 80 | }) | |
| 81 | // 年限减 | 81 | const payType = ref('1') |
| 82 | const minusYear = () => { | 82 | const isPaying = ref(false) |
| 83 | if (form.value.renewYear > 1) { | 83 | |
| 84 | form.value.renewYear-- | 84 | const memberTotalFee = computed(() => { |
| 85 | } | 85 | if (preferentialPolicy.value) { |
| 86 | } | 86 | return (memberFee.value * form.value.renewYear - memberFee.value * 1).toFixed(2) |
| 87 | // 年限加 | 87 | } else { |
| 88 | const plusYear = () => { | 88 | return (memberFee.value * form.value.renewYear).toFixed(2) |
| 89 | if (form.value.renewYear < 6) { | 89 | } |
| 90 | form.value.renewYear++ | 90 | }) |
| 91 | } | 91 | |
| 92 | } | 92 | // 年限减 |
| 93 | 93 | const minusYear = () => { | |
| 94 | // 支付方式切换 | 94 | if (form.value.renewYear > 1) { |
| 95 | const onPayTypeChange = (e) => { | 95 | form.value.renewYear-- |
| 96 | payType.value = e.detail.value | 96 | } |
| 97 | } | 97 | } |
| 98 | 98 | // 年限加 | |
| 99 | // 支付操作 | 99 | const plusYear = () => { |
| 100 | const handelPay = async () => { | 100 | if (form.value.renewYear < 6) { |
| 101 | // if (memberTotalFee.value <= 0) return | 101 | form.value.renewYear++ |
| 102 | 102 | } | |
| 103 | isPaying.value = true | 103 | } |
| 104 | const { data } = await api.certifiedNew({ renewYear: form.value.renewYear }) | 104 | |
| 105 | isPaying.value = false | 105 | // 支付方式切换 |
| 106 | if (data.payFlag == 0) { | 106 | const onPayTypeChange = (e) => { |
| 107 | uni.navigateTo({ | 107 | payType.value = e.detail.value |
| 108 | url: `/myCenter/sucPay` | 108 | } |
| 109 | }) | 109 | |
| 110 | } else { | 110 | // 支付操作 |
| 111 | if (data.orderId) { | 111 | const handelPay = async () => { |
| 112 | api.callBack2(data.orderId) | 112 | if (memberTotalFee.value < 0) { |
| 113 | uni.navigateTo({ | 113 | uni.showToast({ |
| 114 | url: `/myCenter/sucPay` | 114 | title: '支付金额异常', |
| 115 | }) | 115 | icon: 'none' |
| 116 | 116 | }) | |
| 117 | } | 117 | return |
| 118 | } | 118 | } |
| 119 | } | 119 | |
| 120 | 120 | // 显示 loading | |
| 121 | onLoad((option) => { | 121 | uni.showLoading({ |
| 122 | // 接收年限 | 122 | title: '支付中...', |
| 123 | form.value.renewYear = Number(option.renewYear || 1) | 123 | mask: true |
| 124 | // 初始化获取费用和优惠 | 124 | }) |
| 125 | init() | 125 | isPaying.value = true |
| 126 | }) | 126 | |
| 127 | 127 | // 创建订单 | |
| 128 | // 初始化接口 | 128 | const [orderErr, orderRes] = await to(api.certifiedNew(form.value.renewYear)) |
| 129 | async function init() { | 129 | if (orderErr) { |
| 130 | try { | 130 | uni.hideLoading() |
| 131 | await getMyMemberCertUnitFeeApi() | 131 | isPaying.value = false |
| 132 | await canUseDiscountApi() | 132 | uni.showToast({ |
| 133 | await getZtxDiscountPolicyApi() | 133 | title: '创建订单失败', |
| 134 | } catch (err) { | 134 | icon: 'none' |
| 135 | console.error('初始化失败:', err) | 135 | }) |
| 136 | } | 136 | return |
| 137 | } | 137 | } |
| 138 | 138 | ||
| 139 | // 获取会员单价 | 139 | const data = orderRes.data |
| 140 | async function getMyMemberCertUnitFeeApi() { | 140 | // 无需支付,直接成功 |
| 141 | const res = await api.getMyMemberCertUnitFee() | 141 | if (data.payFlag == 0) { |
| 142 | memberFee.value = Number(res.data || 1500) | 142 | uni.hideLoading() |
| 143 | } | 143 | isPaying.value = false |
| 144 | 144 | uni.navigateTo({ | |
| 145 | // 是否可用优惠 | 145 | url: `/myCenter/sucPay?orderId=${data.orderId}` |
| 146 | async function canUseDiscountApi() { | 146 | }) |
| 147 | const res = await api.canUseDiscount() | 147 | return |
| 148 | preferentialPolicy.value = res.data || true | 148 | } |
| 149 | } | 149 | |
| 150 | 150 | // 需要支付回调 | |
| 151 | // 获取优惠政策详情 | 151 | if (data.orderId) { |
| 152 | async function getZtxDiscountPolicyApi() { | 152 | await to(api.callBack2(data.orderId)) |
| 153 | const res = await api.getZtxDiscountPolicy() | 153 | uni.hideLoading() |
| 154 | preferentialData.value = res.data || { name: '优惠' } | 154 | isPaying.value = false |
| 155 | } | 155 | |
| 156 | </script> | 156 | uni.navigateTo({ |
| 157 | 157 | url: `/myCenter/sucPay?orderId=${data.orderId}` | |
| 158 | <style scoped> | 158 | }) |
| 159 | /* 整体容器 */ | 159 | } |
| 160 | .container { | 160 | } |
| 161 | min-height: 100vh; | 161 | |
| 162 | background-color: #f7f7f7; | 162 | onLoad((option) => { |
| 163 | } | 163 | // 接收年限 |
| 164 | 164 | form.value.renewYear = Number(option.renewYear || 1) | |
| 165 | /* 内容区域 */ | 165 | // 初始化获取费用和优惠 |
| 166 | .content { | 166 | init() |
| 167 | padding: 20rpx 20rpx 120rpx; | 167 | }) |
| 168 | } | 168 | |
| 169 | 169 | // 初始化接口 | |
| 170 | /* 卡片 */ | 170 | async function init() { |
| 171 | .card { | 171 | uni.showLoading({ |
| 172 | background: #fff; | 172 | title: '加载中...' |
| 173 | border-radius: 8rpx; | 173 | }) |
| 174 | padding: 25rpx 20rpx; | 174 | const [err] = await to(Promise.all([ |
| 175 | margin-bottom: 20rpx; | 175 | getMyMemberCertUnitFeeApi(), |
| 176 | } | 176 | canUseDiscountApi(), |
| 177 | 177 | getZtxDiscountPolicyApi() | |
| 178 | /* 缴费年限行 */ | 178 | ])) |
| 179 | .yearRow { | 179 | uni.hideLoading() |
| 180 | display: flex; | 180 | if (err) { |
| 181 | align-items: center; | 181 | console.error('初始化失败:', err) |
| 182 | justify-content: space-between; | 182 | } |
| 183 | margin-bottom: 20rpx; | 183 | } |
| 184 | } | 184 | |
| 185 | 185 | // 获取会员单价 | |
| 186 | .yearRow .label { | 186 | async function getMyMemberCertUnitFeeApi() { |
| 187 | font-size: 28rpx; | 187 | const [err, res] = await to(api.getMyMemberCertUnitFee()) |
| 188 | color: #333; | 188 | if (!err && res.data) { |
| 189 | } | 189 | memberFee.value = Number(res.data || 1500) |
| 190 | 190 | } | |
| 191 | .yearRow .control { | 191 | } |
| 192 | display: flex; | 192 | |
| 193 | align-items: center; | 193 | // 是否可用优惠 |
| 194 | } | 194 | async function canUseDiscountApi() { |
| 195 | .control image { | 195 | const [err, res] = await to(api.canUseDiscount()) |
| 196 | width: 50rpx; | 196 | if (!err && res.data !== undefined) { |
| 197 | height: 50rpx; | 197 | preferentialPolicy.value = res.data |
| 198 | } | 198 | } |
| 199 | 199 | } | |
| 200 | /* 加减按钮样式 */ | 200 | |
| 201 | .num-btn { | 201 | // 获取优惠政策详情 |
| 202 | width: 40rpx; | 202 | async function getZtxDiscountPolicyApi() { |
| 203 | height: 40rpx; | 203 | const [err, res] = await to(api.getZtxDiscountPolicy()) |
| 204 | border-radius: 50%; | 204 | if (!err && res.data) { |
| 205 | display: flex; | 205 | preferentialData.value = res.data |
| 206 | align-items: center; | 206 | } |
| 207 | justify-content: center; | 207 | } |
| 208 | background-color: #fff; | 208 | </script> |
| 209 | border: 1rpx solid #C4121B; | 209 | |
| 210 | } | 210 | <style scoped> |
| 211 | 211 | /* 整体容器 */ | |
| 212 | .num-btn.disabled { | 212 | .container { |
| 213 | border-color: #ccc; | 213 | min-height: 100vh; |
| 214 | } | 214 | background-color: #f7f7f7; |
| 215 | 215 | } | |
| 216 | .num-btn.disabled .btn-icon { | 216 | |
| 217 | color: #ccc; | 217 | /* 内容区域 */ |
| 218 | } | 218 | .content { |
| 219 | 219 | padding: 20rpx 20rpx 120rpx; | |
| 220 | .btn-icon { | 220 | } |
| 221 | font-size: 24rpx; | 221 | |
| 222 | color: #C4121B; | 222 | /* 卡片 */ |
| 223 | font-weight: bold; | 223 | .card { |
| 224 | } | 224 | background: #fff; |
| 225 | 225 | border-radius: 8rpx; | |
| 226 | .yearRow .num { | 226 | padding: 25rpx 20rpx; |
| 227 | font-size: 28rpx; | 227 | margin-bottom: 20rpx; |
| 228 | color: #333; | 228 | } |
| 229 | min-width: 80rpx; | 229 | |
| 230 | text-align: center; | 230 | /* 缴费年限行 */ |
| 231 | margin: 0 10rpx; | 231 | .yearRow { |
| 232 | } | 232 | display: flex; |
| 233 | 233 | align-items: center; | |
| 234 | 234 | justify-content: space-between; | |
| 235 | /* 通用行 */ | 235 | margin-bottom: 20rpx; |
| 236 | .row { | 236 | } |
| 237 | display: flex; | 237 | |
| 238 | justify-content: space-between; | 238 | .yearRow .label { |
| 239 | align-items: center; | 239 | font-size: 28rpx; |
| 240 | 240 | color: #333; | |
| 241 | } | 241 | } |
| 242 | 242 | ||
| 243 | .row .label { | 243 | .yearRow .control { |
| 244 | font-size: 28rpx; | 244 | display: flex; |
| 245 | color: #333; | 245 | align-items: center; |
| 246 | } | 246 | } |
| 247 | 247 | ||
| 248 | .row .value { | 248 | .control image { |
| 249 | font-size: 30rpx; | 249 | width: 50rpx; |
| 250 | color: #C4121B; | 250 | height: 50rpx; |
| 251 | font-weight: 500; | 251 | } |
| 252 | } | 252 | |
| 253 | 253 | /* 加减按钮样式 */ | |
| 254 | /* 优惠提示 */ | 254 | .num-btn { |
| 255 | .hintRow { | 255 | width: 40rpx; |
| 256 | display: flex; | 256 | height: 40rpx; |
| 257 | align-items: flex-start; | 257 | border-radius: 50%; |
| 258 | font-size: 24rpx; | 258 | display: flex; |
| 259 | line-height: 1.4; | 259 | align-items: center; |
| 260 | } | 260 | justify-content: center; |
| 261 | 261 | background-color: #fff; | |
| 262 | .hint-icon { | 262 | border: 1rpx solid #C4121B; |
| 263 | width: 24rpx; | 263 | } |
| 264 | height: 24rpx; | 264 | |
| 265 | border-radius: 50%; | 265 | .num-btn.disabled { |
| 266 | background-color: #C4121B; | 266 | border-color: #ccc; |
| 267 | display: flex; | 267 | } |
| 268 | align-items: center; | 268 | |
| 269 | justify-content: center; | 269 | .num-btn.disabled .btn-icon { |
| 270 | margin-right: 10rpx; | 270 | color: #ccc; |
| 271 | flex-shrink: 0; | 271 | } |
| 272 | margin-top: 2rpx; | 272 | |
| 273 | } | 273 | .btn-icon { |
| 274 | .icon{ | 274 | font-size: 24rpx; |
| 275 | width:30px; | 275 | color: #C4121B; |
| 276 | } | 276 | font-weight: bold; |
| 277 | 277 | } | |
| 278 | .icon-check { | 278 | |
| 279 | color: #fff; | 279 | .yearRow .num { |
| 280 | font-size: 16rpx; | 280 | font-size: 28rpx; |
| 281 | } | 281 | color: #333; |
| 282 | 282 | min-width: 80rpx; | |
| 283 | .hintRow .hintText { | 283 | text-align: center; |
| 284 | color: #FF8124; | 284 | margin: 0 10rpx; |
| 285 | flex: 1; | 285 | } |
| 286 | margin-top: 10rpx; | 286 | |
| 287 | } | 287 | |
| 288 | 288 | /* 通用行 */ | |
| 289 | /* 减免费用 */ | 289 | .row { |
| 290 | .deductRow { | 290 | display: flex; |
| 291 | background: #fff; | 291 | justify-content: space-between; |
| 292 | padding: 20rpx 20rpx; | 292 | align-items: center; |
| 293 | display: flex; | 293 | |
| 294 | justify-content: space-between; | 294 | } |
| 295 | align-items: center; | 295 | |
| 296 | margin-bottom: 10rpx; | 296 | .row .label { |
| 297 | border-radius: 8rpx; | 297 | font-size: 28rpx; |
| 298 | } | 298 | color: #333; |
| 299 | 299 | } | |
| 300 | .deductRow .label { | 300 | |
| 301 | font-size: 28rpx; | 301 | .row .value { |
| 302 | color: #333; | 302 | font-size: 30rpx; |
| 303 | } | 303 | color: #C4121B; |
| 304 | 304 | font-weight: 500; | |
| 305 | .deductRow .value { | 305 | } |
| 306 | font-size: 30rpx; | 306 | |
| 307 | color: #C4121B; | 307 | /* 优惠提示 */ |
| 308 | } | 308 | .hintRow { |
| 309 | 309 | display: flex; | |
| 310 | /* 支付方式行 */ | 310 | align-items: flex-start; |
| 311 | .payRow { | 311 | font-size: 24rpx; |
| 312 | background: #fff; | 312 | line-height: 1.4; |
| 313 | border-radius: 8rpx; | 313 | } |
| 314 | padding: 20rpx 20rpx; | 314 | |
| 315 | margin-bottom: 20rpx; | 315 | .hint-icon { |
| 316 | } | 316 | width: 24rpx; |
| 317 | 317 | height: 24rpx; | |
| 318 | .radioItem { | 318 | border-radius: 50%; |
| 319 | display: flex; | 319 | background-color: #C4121B; |
| 320 | align-items: center; | 320 | display: flex; |
| 321 | } | 321 | align-items: center; |
| 322 | 322 | justify-content: center; | |
| 323 | /* 自定义红色单选框 */ | 323 | margin-right: 10rpx; |
| 324 | ::v-deep .custom-radio .wx-radio-input { | 324 | flex-shrink: 0; |
| 325 | width: 30rpx; | 325 | margin-top: 2rpx; |
| 326 | height: 30rpx; | 326 | } |
| 327 | border-radius: 50%; | 327 | |
| 328 | border: 2rpx solid #ccc; | 328 | .icon { |
| 329 | } | 329 | width: 30px; |
| 330 | 330 | } | |
| 331 | ::v-deep .custom-radio .wx-radio-input.wx-radio-input-checked { | 331 | |
| 332 | border-color: #C4121B !important; | 332 | .icon-check { |
| 333 | background: #C4121B !important; | 333 | color: #fff; |
| 334 | } | 334 | font-size: 16rpx; |
| 335 | 335 | } | |
| 336 | 336 | ||
| 337 | .payInfo { | 337 | .hintRow .hintText { |
| 338 | display: flex; | 338 | color: #FF8124; |
| 339 | align-items: center; | 339 | flex: 1; |
| 340 | margin-left: 15rpx; | 340 | margin-top: 10rpx; |
| 341 | } | 341 | } |
| 342 | 342 | ||
| 343 | .payInfo .icon { | 343 | /* 减免费用 */ |
| 344 | width: 40rpx; | 344 | .deductRow { |
| 345 | height: 40rpx; | 345 | background: #fff; |
| 346 | margin-right: 10rpx; | 346 | padding: 20rpx 20rpx; |
| 347 | } | 347 | display: flex; |
| 348 | 348 | justify-content: space-between; | |
| 349 | .payInfo text { | 349 | align-items: center; |
| 350 | font-size: 28rpx; | 350 | margin-bottom: 10rpx; |
| 351 | color: #333; | 351 | border-radius: 8rpx; |
| 352 | } | 352 | } |
| 353 | 353 | ||
| 354 | /* 总费用行(突出显示) */ | 354 | .deductRow .label { |
| 355 | .totalRow { | 355 | font-size: 28rpx; |
| 356 | background: #fff; | 356 | color: #333; |
| 357 | border-radius: 8rpx; | 357 | } |
| 358 | padding: 20rpx 20rpx; | 358 | |
| 359 | display: flex; | 359 | .deductRow .value { |
| 360 | justify-content: space-between; | 360 | font-size: 30rpx; |
| 361 | align-items: center; | 361 | color: #C4121B; |
| 362 | margin-top: 10rpx; | 362 | } |
| 363 | } | 363 | |
| 364 | 364 | /* 支付方式行 */ | |
| 365 | .totalRow .label { | 365 | .payRow { |
| 366 | font-size: 28rpx; | 366 | background: #fff; |
| 367 | color: #333; | 367 | border-radius: 8rpx; |
| 368 | } | 368 | padding: 20rpx 20rpx; |
| 369 | 369 | margin-bottom: 20rpx; | |
| 370 | .redBig { | 370 | } |
| 371 | font-size: 32rpx; | 371 | |
| 372 | color: #C4121B; | 372 | .radioItem { |
| 373 | font-weight: bold; | 373 | display: flex; |
| 374 | } | 374 | align-items: center; |
| 375 | 375 | } | |
| 376 | /* 底部按钮 */ | 376 | |
| 377 | .bottomBtn { | 377 | /* 自定义红色单选框 */ |
| 378 | position: fixed; | 378 | ::v-deep .custom-radio .wx-radio-input { |
| 379 | bottom: 0; | 379 | width: 30rpx; |
| 380 | left: 0; | 380 | height: 30rpx; |
| 381 | right: 0; | 381 | border-radius: 50%; |
| 382 | padding: 20rpx 20rpx; | 382 | border: 2rpx solid #ccc; |
| 383 | background: #fff; | 383 | } |
| 384 | border-top: 1rpx solid #eee; | 384 | |
| 385 | } | 385 | ::v-deep .custom-radio .wx-radio-input.wx-radio-input-checked { |
| 386 | 386 | border-color: #C4121B !important; | |
| 387 | .payBtn { | 387 | background: #C4121B !important; |
| 388 | width: 100%; | 388 | } |
| 389 | height: 88rpx; | 389 | |
| 390 | line-height: 88rpx; | 390 | |
| 391 | background-color: #C4121B; | 391 | .payInfo { |
| 392 | color: #fff; | 392 | display: flex; |
| 393 | border-radius: 8rpx; | 393 | align-items: center; |
| 394 | font-size: 32rpx; | 394 | margin-left: 15rpx; |
| 395 | text-align: center; | 395 | } |
| 396 | border: none; | 396 | |
| 397 | } | 397 | .payInfo .icon { |
| 398 | 398 | width: 40rpx; | |
| 399 | .payBtn[disabled] { | 399 | height: 40rpx; |
| 400 | background-color: #ccc; | 400 | margin-right: 10rpx; |
| 401 | color: #999; | 401 | } |
| 402 | } | 402 | |
| 403 | 403 | .payInfo text { | |
| 404 | /* 通用红色文字 */ | 404 | font-size: 28rpx; |
| 405 | .red { | 405 | color: #333; |
| 406 | color: #C4121B; | 406 | } |
| 407 | } | 407 | |
| 408 | /* 总费用行(突出显示) */ | ||
| 409 | .totalRow { | ||
| 410 | background: #fff; | ||
| 411 | border-radius: 8rpx; | ||
| 412 | padding: 20rpx 20rpx; | ||
| 413 | display: flex; | ||
| 414 | justify-content: space-between; | ||
| 415 | align-items: center; | ||
| 416 | margin-top: 10rpx; | ||
| 417 | } | ||
| 418 | |||
| 419 | .totalRow .label { | ||
| 420 | font-size: 28rpx; | ||
| 421 | color: #333; | ||
| 422 | } | ||
| 423 | |||
| 424 | .redBig { | ||
| 425 | font-size: 32rpx; | ||
| 426 | color: #C4121B; | ||
| 427 | font-weight: bold; | ||
| 428 | } | ||
| 429 | |||
| 430 | /* 底部按钮 */ | ||
| 431 | .bottomBtn { | ||
| 432 | position: fixed; | ||
| 433 | bottom: 0; | ||
| 434 | left: 0; | ||
| 435 | right: 0; | ||
| 436 | padding: 20rpx 20rpx; | ||
| 437 | background: #fff; | ||
| 438 | border-top: 1rpx solid #eee; | ||
| 439 | } | ||
| 440 | |||
| 441 | .payBtn { | ||
| 442 | width: 100%; | ||
| 443 | height: 88rpx; | ||
| 444 | line-height: 88rpx; | ||
| 445 | background-color: #C4121B; | ||
| 446 | color: #fff; | ||
| 447 | border-radius: 8rpx; | ||
| 448 | font-size: 32rpx; | ||
| 449 | text-align: center; | ||
| 450 | border: none; | ||
| 451 | } | ||
| 452 | |||
| 453 | .payBtn[disabled] { | ||
| 454 | background-color: #ccc; | ||
| 455 | color: #999; | ||
| 456 | } | ||
| 457 | |||
| 458 | /* 通用红色文字 */ | ||
| 459 | .red { | ||
| 460 | color: #C4121B; | ||
| 461 | } | ||
| 408 | </style> | 462 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view class="success-container"> | 2 | <view class="success-container"> |
| 3 | <!-- 成功图标(渐变圆形+动效) --> | 3 | <!-- 成功图标(渐变圆形+动效) --> |
| 4 | <view class="success-icon"> | 4 | <view class="success-icon"> |
| 5 | <view class="icon-circle"> | 5 | <view class="icon-circle"> |
| 6 | <text class="check-icon">✓</text> | 6 | <text class="check-icon">✓</text> |
| 7 | </view> | 7 | </view> |
| 8 | </view> | 8 | </view> |
| 9 | 9 | ||
| 10 | <!-- 支付成功标题(动画) --> | 10 | <!-- 支付成功标题(动画) --> |
| 11 | <view class="success-title">支付成功</view> | 11 | <view class="success-title">支付成功</view> |
| 12 | <view class="success-subtitle">支付成功,请等待审核</view> | 12 | <view class="success-subtitle">支付成功,请等待审核</view> |
| 13 | 13 | ||
| 14 | <!-- 订单信息卡片(带阴影) --> | 14 | <!-- 订单信息卡片(带阴影) --> |
| 15 | <view class="info-card"> | 15 | <view class="info-card"> |
| 16 | <view class="info-item"> | 16 | <view class="info-item"> |
| 17 | <text class="label">付款账户</text> | 17 | <text class="label">交易流水号</text> |
| 18 | <text class="value">(5437)</text> | 18 | <text class="value">{{ orderInfo.tradeNo || '--' }}</text> |
| 19 | </view> | 19 | </view> |
| 20 | <view class="info-item"> | 20 | <view class="info-item"> |
| 21 | <text class="label">交易流水号</text> | 21 | <text class="label">商户名称</text> |
| 22 | <text class="value">2205051351076117833</text> | 22 | <text class="value">{{ orderInfo.merchantName|| '中国跆拳道协会' }}</text> |
| 23 | </view> | 23 | </view> |
| 24 | <view class="info-item"> | 24 | <view class="info-item"> |
| 25 | <text class="label">商户名称</text> | 25 | <text class="label">订单金额</text> |
| 26 | <text class="value">中国跆拳道协会</text> | 26 | <text class="value amount">{{ orderInfo.price ? orderInfo.price + '元' : '--' }}</text> |
| 27 | </view> | 27 | </view> |
| 28 | <view class="info-item"> | 28 | </view> |
| 29 | <text class="label">订单金额</text> | 29 | |
| 30 | <text class="value amount">1500.00元</text> | 30 | <!-- 确定按钮(渐变+动效) --> |
| 31 | </view> | 31 | <view class="confirm-btn-area"> |
| 32 | <view class="info-item"> | 32 | <button class="confirm-btn" @click="goBack">确定</button> |
| 33 | <text class="label">会员编号</text> | 33 | </view> |
| 34 | <text class="value">CTA00004</text> | 34 | </view> |
| 35 | </view> | 35 | </template> |
| 36 | <view class="info-item"> | 36 | |
| 37 | <text class="label">会员有效期</text> | 37 | <script setup> |
| 38 | <text class="value">2028年1月25日</text> | 38 | import { |
| 39 | </view> | 39 | ref |
| 40 | </view> | 40 | } from 'vue' |
| 41 | 41 | import { | |
| 42 | <!-- 确定按钮(渐变+动效) --> | 42 | onLoad |
| 43 | <view class="confirm-btn-area"> | 43 | } from '@dcloudio/uni-app' |
| 44 | <button class="confirm-btn" @click="goBack">确定</button> | 44 | import to from 'await-to-js' |
| 45 | </view> | 45 | import * as api from '@/common/api.js' |
| 46 | </view> | 46 | |
| 47 | </template> | 47 | const orderInfo = ref({ |
| 48 | 48 | orderId: '', | |
| 49 | <script setup> | 49 | tradeNo: '', |
| 50 | import { onLoad } from '@dcloudio/uni-app' | 50 | merchantName: '中国跆拳道协会', |
| 51 | const goBack = () => { | 51 | price: '' |
| 52 | const pages = getCurrentPages() | 52 | }) |
| 53 | const currentPage = pages[pages.length - 1] | 53 | |
| 54 | const { from } = currentPage.options || {} | 54 | const goBack = () => { |
| 55 | 55 | uni.reLaunch({ | |
| 56 | let delta = 1 | 56 | url: '/myCenter/auth' |
| 57 | 57 | }) | |
| 58 | if (from === 'payOrder') { | 58 | } |
| 59 | delta = 2 // 来自添加会员 / 订单页 → 返回 2 级 | 59 | |
| 60 | }else{ | 60 | onLoad(async (option) => { |
| 61 | delta = 3 | 61 | if (option.orderId) { |
| 62 | } | 62 | const [err, res] = await to(api.getOrderInfo(option.orderId)) |
| 63 | 63 | if (!err && res.data) { | |
| 64 | uni.navigateBack({ delta }) | 64 | orderInfo.value = res.data |
| 65 | } | 65 | } else { |
| 66 | 66 | orderInfo.value.orderId = option.orderId | |
| 67 | onLoad((option) => { | 67 | } |
| 68 | }) | 68 | } |
| 69 | </script> | 69 | }) |
| 70 | 70 | </script> | |
| 71 | <style scoped> | 71 | |
| 72 | /* 全局容器 */ | 72 | <style scoped> |
| 73 | .success-container { | 73 | /* 全局容器 */ |
| 74 | display: flex; | 74 | .success-container { |
| 75 | flex-direction: column; | 75 | display: flex; |
| 76 | align-items: center; | 76 | flex-direction: column; |
| 77 | padding: 100rpx 40rpx 60rpx; | 77 | align-items: center; |
| 78 | min-height: 100vh; | 78 | padding: 100rpx 40rpx 60rpx; |
| 79 | background-color: #f8f9fa; | 79 | min-height: 100vh; |
| 80 | box-sizing: border-box; | 80 | background-color: #f8f9fa; |
| 81 | } | 81 | box-sizing: border-box; |
| 82 | 82 | } | |
| 83 | /* 成功图标容器 */ | 83 | |
| 84 | .success-icon { | 84 | /* 成功图标容器 */ |
| 85 | margin-bottom: 40rpx; | 85 | .success-icon { |
| 86 | animation: fadeIn 0.6s ease-out; | 86 | margin-bottom: 40rpx; |
| 87 | } | 87 | animation: fadeIn 0.6s ease-out; |
| 88 | 88 | } | |
| 89 | /* 渐变圆形背景 */ | 89 | |
| 90 | .icon-circle { | 90 | /* 渐变圆形背景 */ |
| 91 | width: 180rpx; | 91 | .icon-circle { |
| 92 | height: 180rpx; | 92 | width: 180rpx; |
| 93 | border-radius: 50%; | 93 | height: 180rpx; |
| 94 | /* 青绿色渐变 */ | 94 | border-radius: 50%; |
| 95 | background: linear-gradient(135deg, #06c1ae, #04a896); | 95 | /* 青绿色渐变 */ |
| 96 | display: flex; | 96 | background: linear-gradient(135deg, #06c1ae, #04a896); |
| 97 | align-items: center; | 97 | display: flex; |
| 98 | justify-content: center; | 98 | align-items: center; |
| 99 | box-shadow: 0 8rpx 30rpx rgba(6, 193, 174, 0.3); | 99 | justify-content: center; |
| 100 | /* 轻微上浮动效 */ | 100 | box-shadow: 0 8rpx 30rpx rgba(6, 193, 174, 0.3); |
| 101 | animation: scaleIn 0.8s ease-out; | 101 | /* 轻微上浮动效 */ |
| 102 | } | 102 | animation: scaleIn 0.8s ease-out; |
| 103 | 103 | } | |
| 104 | /* 对勾图标 */ | 104 | |
| 105 | .check-icon { | 105 | /* 对勾图标 */ |
| 106 | font-size: 90rpx; | 106 | .check-icon { |
| 107 | color: #ffffff; | 107 | font-size: 90rpx; |
| 108 | font-weight: bold; | 108 | color: #ffffff; |
| 109 | } | 109 | font-weight: bold; |
| 110 | 110 | } | |
| 111 | /* 支付成功标题 */ | 111 | |
| 112 | .success-title { | 112 | /* 支付成功标题 */ |
| 113 | font-size: 48rpx; | 113 | .success-title { |
| 114 | font-weight: 700; | 114 | font-size: 48rpx; |
| 115 | color: #333333; | 115 | font-weight: 700; |
| 116 | margin-bottom: 12rpx; | 116 | color: #333333; |
| 117 | animation: slideUp 0.6s ease-out; | 117 | margin-bottom: 12rpx; |
| 118 | } | 118 | animation: slideUp 0.6s ease-out; |
| 119 | 119 | } | |
| 120 | /* 副标题 */ | 120 | |
| 121 | .success-subtitle { | 121 | /* 副标题 */ |
| 122 | font-size: 28rpx; | 122 | .success-subtitle { |
| 123 | color: #666666; | 123 | font-size: 28rpx; |
| 124 | margin-bottom: 60rpx; | 124 | color: #666666; |
| 125 | animation: slideUp 0.8s ease-out; | 125 | margin-bottom: 60rpx; |
| 126 | } | 126 | animation: slideUp 0.8s ease-out; |
| 127 | 127 | } | |
| 128 | /* 订单信息卡片 */ | 128 | |
| 129 | .info-card { | 129 | /* 订单信息卡片 */ |
| 130 | width: 100%; | 130 | .info-card { |
| 131 | background: #ffffff; | 131 | width: 100%; |
| 132 | border-radius: 20rpx; | 132 | background: #ffffff; |
| 133 | padding: 40rpx 30rpx; | 133 | border-radius: 20rpx; |
| 134 | box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.05); | 134 | padding: 40rpx 30rpx; |
| 135 | margin-bottom: 80rpx; | 135 | box-shadow: 0 6rpx 20rpx rgba(0, 0, 0, 0.05); |
| 136 | animation: fadeIn 1s ease-out; | 136 | margin-bottom: 80rpx; |
| 137 | } | 137 | animation: fadeIn 1s ease-out; |
| 138 | 138 | } | |
| 139 | /* 单个信息项 */ | 139 | |
| 140 | .info-item { | 140 | /* 单个信息项 */ |
| 141 | display: flex; | 141 | .info-item { |
| 142 | justify-content: space-between; | 142 | display: flex; |
| 143 | align-items: center; | 143 | justify-content: space-between; |
| 144 | padding: 24rpx 0; | 144 | align-items: center; |
| 145 | border-bottom: 1rpx solid #f5f5f5; | 145 | padding: 24rpx 0; |
| 146 | } | 146 | border-bottom: 1rpx solid #f5f5f5; |
| 147 | /* 最后一项去掉下划线 */ | 147 | } |
| 148 | .info-item:last-child { | 148 | |
| 149 | border-bottom: none; | 149 | /* 最后一项去掉下划线 */ |
| 150 | } | 150 | .info-item:last-child { |
| 151 | 151 | border-bottom: none; | |
| 152 | /* 标签样式 */ | 152 | } |
| 153 | .label { | 153 | |
| 154 | font-size: 32rpx; | 154 | /* 标签样式 */ |
| 155 | color: #666666; | 155 | .label { |
| 156 | } | 156 | font-size: 32rpx; |
| 157 | 157 | color: #666666; | |
| 158 | /* 值样式 */ | 158 | white-space: nowrap; |
| 159 | .value { | 159 | margin-right: 20rpx; |
| 160 | font-size: 32rpx; | 160 | flex-shrink: 0; |
| 161 | color: #333333; | 161 | } |
| 162 | text-align: right; | 162 | |
| 163 | } | 163 | /* 值样式 */ |
| 164 | /* 金额特殊样式 */ | 164 | .value { |
| 165 | .amount { | 165 | font-size: 32rpx; |
| 166 | color: #cd1e27; | 166 | color: #333333; |
| 167 | font-weight: 600; | 167 | text-align: right; |
| 168 | } | 168 | word-break: break-all; |
| 169 | 169 | word-wrap: break-word; | |
| 170 | /* 确定按钮区域 */ | 170 | } |
| 171 | .confirm-btn-area { | 171 | |
| 172 | width: 100%; | 172 | /* 金额特殊样式 */ |
| 173 | padding: 0 20rpx; | 173 | .amount { |
| 174 | box-sizing: border-box; | 174 | color: #cd1e27; |
| 175 | } | 175 | font-weight: 600; |
| 176 | 176 | } | |
| 177 | /* 确定按钮(渐变+动效) */ | 177 | |
| 178 | .confirm-btn { | 178 | /* 确定按钮区域 */ |
| 179 | width: 100%; | 179 | .confirm-btn-area { |
| 180 | height: 90rpx; | 180 | width: 100%; |
| 181 | line-height: 90rpx; | 181 | padding: 0 20rpx; |
| 182 | /* 按钮渐变背景 */ | 182 | box-sizing: border-box; |
| 183 | background: #fff; | 183 | } |
| 184 | color: #C4121B; | 184 | |
| 185 | font-size: 36rpx; | 185 | /* 确定按钮(渐变+动效) */ |
| 186 | font-weight: 600; | 186 | .confirm-btn { |
| 187 | border-radius: 45rpx; | 187 | width: 100%; |
| 188 | border: 1px solid #C4121B; | 188 | height: 90rpx; |
| 189 | animation: slideUp 1s ease-out; | 189 | line-height: 90rpx; |
| 190 | /* 禁止默认样式 */ | 190 | /* 按钮渐变背景 */ |
| 191 | position: relative; | 191 | background: #fff; |
| 192 | overflow: hidden; | 192 | color: #C4121B; |
| 193 | } | 193 | font-size: 36rpx; |
| 194 | /* 按钮点击反馈 */ | 194 | font-weight: 600; |
| 195 | .confirm-btn::after { | 195 | border-radius: 45rpx; |
| 196 | border: none; | 196 | border: 1px solid #C4121B; |
| 197 | } | 197 | animation: slideUp 1s ease-out; |
| 198 | .confirm-btn:active { | 198 | /* 禁止默认样式 */ |
| 199 | transform: scale(0.98); | 199 | position: relative; |
| 200 | box-shadow: 0 4rpx 10rpx rgba(6, 193, 174, 0.2); | 200 | overflow: hidden; |
| 201 | } | 201 | } |
| 202 | 202 | ||
| 203 | /* 动画定义 */ | 203 | /* 按钮点击反馈 */ |
| 204 | @keyframes fadeIn { | 204 | .confirm-btn::after { |
| 205 | 0% { opacity: 0; } | 205 | border: none; |
| 206 | 100% { opacity: 1; } | 206 | } |
| 207 | } | 207 | |
| 208 | @keyframes scaleIn { | 208 | .confirm-btn:active { |
| 209 | 0% { transform: scale(0); } | 209 | transform: scale(0.98); |
| 210 | 70% { transform: scale(1.1); } | 210 | box-shadow: 0 4rpx 10rpx rgba(6, 193, 174, 0.2); |
| 211 | 100% { transform: scale(1); } | 211 | } |
| 212 | } | 212 | |
| 213 | @keyframes slideUp { | 213 | /* 动画定义 */ |
| 214 | 0% { opacity: 0; transform: translateY(30rpx); } | 214 | @keyframes fadeIn { |
| 215 | 100% { opacity: 1; transform: translateY(0); } | 215 | 0% { |
| 216 | } | 216 | opacity: 0; |
| 217 | } | ||
| 218 | |||
| 219 | 100% { | ||
| 220 | opacity: 1; | ||
| 221 | } | ||
| 222 | } | ||
| 223 | |||
| 224 | @keyframes scaleIn { | ||
| 225 | 0% { | ||
| 226 | transform: scale(0); | ||
| 227 | } | ||
| 228 | |||
| 229 | 70% { | ||
| 230 | transform: scale(1.1); | ||
| 231 | } | ||
| 232 | |||
| 233 | 100% { | ||
| 234 | transform: scale(1); | ||
| 235 | } | ||
| 236 | } | ||
| 237 | |||
| 238 | @keyframes slideUp { | ||
| 239 | 0% { | ||
| 240 | opacity: 0; | ||
| 241 | transform: translateY(30rpx); | ||
| 242 | } | ||
| 243 | |||
| 244 | 100% { | ||
| 245 | opacity: 1; | ||
| 246 | transform: translateY(0); | ||
| 247 | } | ||
| 248 | } | ||
| 217 | </style> | 249 | </style> |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
| ... | @@ -15,7 +15,7 @@ | ... | @@ -15,7 +15,7 @@ |
| 15 | <view class="info-card"> | 15 | <view class="info-card"> |
| 16 | <view class="info-item"> | 16 | <view class="info-item"> |
| 17 | <text class="label">交易流水号</text> | 17 | <text class="label">交易流水号</text> |
| 18 | <text class="value">{{ orderInfo.tradeNo }}</text> | 18 | <text class="value">{{ orderInfo.tradeNo||'--' }}</text> |
| 19 | </view> | 19 | </view> |
| 20 | <view class="info-item"> | 20 | <view class="info-item"> |
| 21 | <text class="label">商户名称</text> | 21 | <text class="label">商户名称</text> | ... | ... |
-
Please register or sign in to post a comment