391d911a by lttnew

订单

1 parent f584c37d
...@@ -1574,6 +1574,25 @@ export function certifiedNew(data) { ...@@ -1574,6 +1574,25 @@ export function certifiedNew(data) {
1574 }) 1574 })
1575 } 1575 }
1576 1576
1577 // 再次支付订单
1578 export function payForOrder(data) {
1579 let url = '/system/certifiedNew/payForOrder'
1580 const params = []
1581 if (data.id) params.push(`id=${data.id}`)
1582 if (data.renewYear) params.push(`renewYear=${data.renewYear}`)
1583 params.push(`type=${data.type}`)
1584 if (data.contactPerson) params.push(`contactPerson=${data.contactPerson}`)
1585 if (data.contactTel) params.push(`contactTel=${data.contactTel}`)
1586 if (params.length > 0) {
1587 url += '?' + params.join('&')
1588 }
1589 return request({
1590 url,
1591 method: 'post',
1592 showLoading: false
1593 })
1594 }
1595
1577 // 订单详情 1596 // 订单详情
1578 export function orderDetail(orderId) { 1597 export function orderDetail(orderId) {
1579 return request({ 1598 return request({
...@@ -1734,6 +1753,15 @@ export function getMyRecentExam() { ...@@ -1734,6 +1753,15 @@ export function getMyRecentExam() {
1734 }) 1753 })
1735 } 1754 }
1736 1755
1756 // 取消订单
1757 export function cancelOrder(id) {
1758 return request({
1759 url: `/common/order/cancelOrder/${id}`,
1760 method: 'post',
1761 data: { id }
1762 })
1763 }
1764
1737 // 考点申请列表 1765 // 考点申请列表
1738 export function examPointApplyList(params) { 1766 export function examPointApplyList(params) {
1739 return request({ 1767 return request({
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
6 <text class="modal-title">{{ title }}</text> 6 <text class="modal-title">{{ title }}</text>
7 </view> 7 </view>
8 <view class="modal-body"> 8 <view class="modal-body">
9 <rich-text v-if="isHtml" :nodes="content"></rich-text> 9 <text class="modal-text">{{ content }}</text>
10 <text v-else class="modal-text">{{ content }}</text> 10 <text v-if="extraContent && !isHtml" class="modal-extra">{{ extraContent }}</text>
11 </view> 11 </view>
12 <view class="modal-footer"> 12 <view class="modal-footer">
13 <button class="btn-cancel" @click="onCancel" v-if="showCancel">{{ cancelText }}</button> 13 <button class="btn-cancel" @click="onCancel" v-if="showCancel">{{ cancelText }}</button>
...@@ -33,6 +33,10 @@ const props = defineProps({ ...@@ -33,6 +33,10 @@ const props = defineProps({
33 type: Boolean, 33 type: Boolean,
34 default: false 34 default: false
35 }, 35 },
36 extraContent: {
37 type: String,
38 default: ''
39 },
36 showCancel: { 40 showCancel: {
37 type: Boolean, 41 type: Boolean,
38 default: true 42 default: true
...@@ -51,7 +55,7 @@ const props = defineProps({ ...@@ -51,7 +55,7 @@ const props = defineProps({
51 }, 55 },
52 maskCloseable: { 56 maskCloseable: {
53 type: Boolean, 57 type: Boolean,
54 default: true 58 default: false
55 } 59 }
56 }) 60 })
57 61
...@@ -156,6 +160,17 @@ defineExpose({ open, close }) ...@@ -156,6 +160,17 @@ defineExpose({ open, close })
156 word-break: break-word; 160 word-break: break-word;
157 } 161 }
158 162
163 .modal-extra {
164 display: block;
165 margin-top: 16rpx;
166 font-size: 28rpx;
167 color: #AD181F;
168 line-height: 1.6;
169 text-align: left;
170 white-space: pre-wrap;
171 word-break: break-word;
172 }
173
159 .modal-footer { 174 .modal-footer {
160 display: flex; 175 display: flex;
161 padding: 0 30rpx 30rpx; 176 padding: 0 30rpx 30rpx;
......
1 // dev 1 // dev
2 // const baseUrl_api = 'http://192.168.1.134:8787' 2 const baseUrl_api = 'http://192.168.1.134:8787'
3 // const baseUrl_api = 'http://47.98.186.233:8787' 3 // const baseUrl_api = 'http://47.98.186.233:8787'
4 const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/' 4 // const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/'
5 const loginImage_api = 'https://tk001.wxjylt.com/stage-api' 5 const loginImage_api = 'https://tk001.wxjylt.com/stage-api'
6 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do' 6 const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
7 7
......
...@@ -106,6 +106,8 @@ import * as api from '@/common/api.js' ...@@ -106,6 +106,8 @@ import * as api from '@/common/api.js'
106 import {minShengPay} from '@/common/pay.js' 106 import {minShengPay} from '@/common/pay.js'
107 import config from '@/config.js' 107 import config from '@/config.js'
108 108
109 // 订单信息(再次支付时传入)
110 const payForm = ref({})
109 const form = ref({ 111 const form = ref({
110 renewYear: 1, 112 renewYear: 1,
111 contactPerson: '', 113 contactPerson: '',
...@@ -122,11 +124,11 @@ const payName = ref('') ...@@ -122,11 +124,11 @@ const payName = ref('')
122 const assoName = ref('') 124 const assoName = ref('')
123 125
124 const memberTotalFee = computed(() => { 126 const memberTotalFee = computed(() => {
127 const total = memberFee.value * form.value.renewYear
125 if (preferentialPolicy.value) { 128 if (preferentialPolicy.value) {
126 return (memberFee.value * form.value.renewYear - memberFee.value * 1).toFixed(2) 129 return (total - memberFee.value).toFixed(2)
127 } else {
128 return (memberFee.value * form.value.renewYear).toFixed(2)
129 } 130 }
131 return total.toFixed(2)
130 }) 132 })
131 133
132 // 年限减 134 // 年限减
...@@ -156,7 +158,7 @@ const handelPay = async () => { ...@@ -156,7 +158,7 @@ const handelPay = async () => {
156 }) 158 })
157 return 159 return
158 } 160 }
159 161
160 // 对公转账校验 162 // 对公转账校验
161 if (payType.value === '3') { 163 if (payType.value === '3') {
162 if (!form.value.contactPerson) { 164 if (!form.value.contactPerson) {
...@@ -182,40 +184,53 @@ const handelPay = async () => { ...@@ -182,40 +184,53 @@ const handelPay = async () => {
182 return 184 return
183 } 185 }
184 } 186 }
185 187
186 // 显示 loading
187 uni.showLoading({ 188 uni.showLoading({
188 title: '支付中...', 189 title: '加载中...'
189 mask: true
190 }) 190 })
191 if (isPaying.value) return 191 if (isPaying.value) return
192 isPaying.value = true 192 isPaying.value = true
193 193
194 // 构建请求参数 194 let data
195 const params = { 195 // 再次支付
196 renewYear: form.value.renewYear, 196 if (payForm.value.id && payForm.value.payStatus === '0') {
197 type: payType.value, 197 const [err, res] = await to(api.payForOrder({
198 } 198 id: payForm.value.id,
199 199 renewYear: form.value.renewYear,
200 // 对公转账需要传联系人信息 200 type: payType.value,
201 if (payType.value === '3') { 201 contactPerson: form.value.contactPerson,
202 params.contactPerson = form.value.contactPerson 202 contactTel: form.value.contactTel
203 params.contactTel = form.value.contactTel 203 }))
204 } 204 if (err || res.code !== 200) {
205 205 uni.hideLoading()
206 // 创建订单 - 参考PC端逻辑 206 isPaying.value = false
207 const [orderErr, orderRes] = await to(api.certifiedNew(params)) 207 uni.showToast({
208 if (orderErr) { 208 title: res?.msg || '创建订单失败',
209 uni.hideLoading() 209 icon: 'none'
210 isPaying.value = false 210 })
211 uni.showToast({ 211 return
212 title: '创建订单失败', 212 }
213 icon: 'none' 213 data = res.data
214 }) 214 } else {
215 return 215 // 第一次下单
216 const [err, res] = await to(api.certifiedNew({
217 renewYear: form.value.renewYear,
218 type: payType.value,
219 contactPerson: form.value.contactPerson,
220 contactTel: form.value.contactTel
221 }))
222 if (err || res.code !== 200) {
223 uni.hideLoading()
224 isPaying.value = false
225 uni.showToast({
226 title: res?.msg || '创建订单失败',
227 icon: 'none'
228 })
229 return
230 }
231 data = res.data
216 } 232 }
217 233
218 const data = orderRes.data
219 // 无需支付,直接成功 234 // 无需支付,直接成功
220 if (data.payFlag == 0) { 235 if (data.payFlag == 0) {
221 uni.hideLoading() 236 uni.hideLoading()
...@@ -225,7 +240,7 @@ const handelPay = async () => { ...@@ -225,7 +240,7 @@ const handelPay = async () => {
225 }) 240 })
226 return 241 return
227 } 242 }
228 243
229 // 对公转账 - 跳转转账信息页面 244 // 对公转账 - 跳转转账信息页面
230 if (data.payFlag == 2) { 245 if (data.payFlag == 2) {
231 uni.hideLoading() 246 uni.hideLoading()
...@@ -235,21 +250,20 @@ const handelPay = async () => { ...@@ -235,21 +250,20 @@ const handelPay = async () => {
235 }) 250 })
236 return 251 return
237 } 252 }
238 253
239 // 民生支付 254 // 民生支付
240 if (data.payResult && data.payResult.encryptedData) { 255 if (data.payResult && data.payResult.encryptedData) {
256 uni.hideLoading()
241 try { 257 try {
242 const res = await minShengPay(data.orderId, data.payResult.encryptedData) 258 const res = await minShengPay(data.orderId, data.payResult.encryptedData)
243 if (res == 'OK') { 259 if (res == 'OK') {
244 isPaying.value = false 260 isPaying.value = false
245 // 支付成功,跳转到成功页面
246 uni.redirectTo({ 261 uni.redirectTo({
247 url: `/myCenter/sucPay?orderId=${data.orderId}` 262 url: `/myCenter/sucPay?orderId=${data.orderId}`
248 }) 263 })
249 } 264 }
250 } catch (e) { 265 } catch (e) {
251 console.error('支付失败', e) 266 console.error('支付失败', e)
252 uni.hideLoading()
253 isPaying.value = false 267 isPaying.value = false
254 } 268 }
255 return 269 return
...@@ -260,10 +274,25 @@ const handelPay = async () => { ...@@ -260,10 +274,25 @@ const handelPay = async () => {
260 274
261 onLoad((option) => { 275 onLoad((option) => {
262 console.log(66, option) 276 console.log(66, option)
277 // 接收订单ID(再次支付时)
278 if (option.orderId) {
279 payForm.value.id = option.orderId
280 payForm.value.payStatus = '0'
281 // 获取订单详情
282 to(api.orderDetail(option.orderId)).then(([err, res]) => {
283 if (!err && res.data) {
284 const content = res.data.content ? JSON.parse(res.data.content) : {}
285 form.value.renewYear = content.yearCount || 1
286 payName.value = res.data.orderName || ''
287 }
288 })
289 }
263 // 接收年限 290 // 接收年限
264 form.value.renewYear = Number(option.renewYear || 1) 291 if (option.renewYear) {
292 form.value.renewYear = Number(option.renewYear)
293 }
265 // 接收缴费单位和所属协会 294 // 接收缴费单位和所属协会
266 payName.value = decodeURIComponent(option.payName || '') 295 payName.value = payName.value || decodeURIComponent(option.payName || '')
267 console.log(77, payName.value) 296 console.log(77, payName.value)
268 assoName.value = decodeURIComponent(option.assoName || '') 297 assoName.value = decodeURIComponent(option.assoName || '')
269 // 初始化获取费用和优惠 298 // 初始化获取费用和优惠
......
...@@ -119,6 +119,17 @@ ...@@ -119,6 +119,17 @@
119 <view class="modal-tip">友情提示:非考点无法申请级位考试</view> 119 <view class="modal-tip">友情提示:非考点无法申请级位考试</view>
120 </view> 120 </view>
121 </uni-popup> 121 </uni-popup>
122
123 <uni-popup ref="unpaidPopup" type="center" :mask-click="false">
124 <view class="custom-modal">
125 <view class="modal-title">系统提示</view>
126 <view class="modal-content">您有一笔订单尚未支付,请及时支付或取消订单。</view>
127 <view class="modal-btns">
128 <button class="btn-cancel" @click="closeUnpaidPopup()">取消订单</button>
129 <button class="btn-confirm" @click="goToPay()">去支付</button>
130 </view>
131 </view>
132 </uni-popup>
122 </view> 133 </view>
123 </template> 134 </template>
124 135
...@@ -139,7 +150,9 @@ ...@@ -139,7 +150,9 @@
139 150
140 const verifyPopup = ref(null) 151 const verifyPopup = ref(null)
141 const applyPopup = ref(null) 152 const applyPopup = ref(null)
153 const unpaidPopup = ref(null)
142 const verifyResult = ref({}) 154 const verifyResult = ref({})
155 const payForm = ref({})
143 156
144 const form = ref({ 157 const form = ref({
145 type: '1', 158 type: '1',
...@@ -237,6 +250,7 @@ ...@@ -237,6 +250,7 @@
237 await getForm() 250 await getForm()
238 await canUseDiscountApi() 251 await canUseDiscountApi()
239 await getZtxDiscountPolicyApi() 252 await getZtxDiscountPolicyApi()
253 handelGetMyRecent()
240 } 254 }
241 255
242 async function getMyMemberCertUnitFeeApi() { 256 async function getMyMemberCertUnitFeeApi() {
...@@ -485,6 +499,13 @@ ...@@ -485,6 +499,13 @@
485 return 499 return
486 } 500 }
487 501
502 // 检查是否有未支付订单
503 try {
504 await handelGetMyRecent()
505 } catch (e) {
506 return
507 }
508
488 try { 509 try {
489 const res = await handelVerify() 510 const res = await handelVerify()
490 verifyResult.value = res 511 verifyResult.value = res
...@@ -516,6 +537,50 @@ ...@@ -516,6 +537,50 @@
516 submitData() 537 submitData()
517 } 538 }
518 539
540 // 新增:关闭未支付订单弹窗
541 function closeUnpaidPopup() {
542 unpaidPopup.value.close()
543 handelCancelOrder()
544 }
545
546 // 新增:去支付
547 function goToPay() {
548 unpaidPopup.value.close()
549 uni.navigateTo({
550 url: `/myCenter/goPay?payName=${encodeURIComponent(form.value.name || '')}&orderId=${payForm.value.id}`
551 })
552 }
553
554 // 新增:获取最近认证记录,判断是否有未支付订单
555 function handelGetMyRecent() {
556 return new Promise(async (resolve, reject) => {
557 const res = await api.getMyRecent() ?? {}
558 payForm.value = res.data?.comOrder ?? {}
559 if (payForm.value.content) payForm.value.content = JSON.parse(payForm.value.content)
560 if (payForm.value.payStatus === '0') {
561 unpaidPopup.value.open()
562 return reject(res)
563 } else {
564 return resolve(true)
565 }
566 })
567 }
568
569 // 新增:取消订单
570 async function handelCancelOrder() {
571 if (!payForm.value.id) return
572 uni.showLoading({ title: '取消中...' })
573 try {
574 await api.cancelOrder(payForm.value.id)
575 uni.showToast({ title: '取消成功', icon: 'success' })
576 await init()
577 } catch (e) {
578 uni.showToast({ title: '取消失败', icon: 'none' })
579 } finally {
580 uni.hideLoading()
581 }
582 }
583
519 // 新增:打开考点申请弹窗(备用,如需调用可加触发逻辑) 584 // 新增:打开考点申请弹窗(备用,如需调用可加触发逻辑)
520 function openApplyPopup() { 585 function openApplyPopup() {
521 applyPopup.value.open() 586 applyPopup.value.open()
...@@ -902,22 +967,26 @@ ...@@ -902,22 +967,26 @@
902 } 967 }
903 968
904 .btn-red { 969 .btn-red {
905 background-color: #F56C6C; 970 background: linear-gradient(135deg, #AD181F 0%, #c42a2a 100%);
906 color: #fff; 971 color: #fff;
907 border-radius: 8rpx; 972 border-radius: 44rpx;
908 height: 80rpx; 973 height: 88rpx;
909 line-height: 80rpx; 974 line-height: 88rpx;
910 font-size: 32rpx; 975 font-size: 32rpx;
911 width: 100%; 976 width: 100%;
977 border: none;
912 } 978 }
913 979
914 .fixedBottom { 980 .fixedBottom {
981 display: flex;
982 justify-content: center;
983 padding: 30rpx;
915 position: fixed; 984 position: fixed;
916 bottom: 0; 985 bottom: 0;
917 left: 0; 986 left: 0;
918 right: 0; 987 right: 0;
919 padding: 20rpx 30rpx;
920 background: #fff; 988 background: #fff;
989 box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
921 z-index: 99; 990 z-index: 99;
922 } 991 }
923 992
......
...@@ -119,7 +119,8 @@ const onTabSwitch = () => { ...@@ -119,7 +119,8 @@ const onTabSwitch = () => {
119 <style lang="scss" scoped> 119 <style lang="scss" scoped>
120 .notice-page { 120 .notice-page {
121 position: relative; 121 position: relative;
122 min-height: 100vh; 122 height: 100vh;
123 overflow: hidden;
123 background: #ededf0; 124 background: #ededf0;
124 box-sizing: border-box; 125 box-sizing: border-box;
125 } 126 }
......
...@@ -202,7 +202,7 @@ ...@@ -202,7 +202,7 @@
202 <view class="date"> 202 <view class="date">
203 <view class="data-header"> 203 <view class="data-header">
204 <text class="member-label">{{ getOrderLabel(item) }}·</text> 204 <text class="member-label">{{ getOrderLabel(item) }}·</text>
205 <text class="value ">{{ item.orderName || '——' }}</text> 205 <text class="value ">{{ item.wfCode || '——' }} · {{ item.payType == '3' ? '对公转账' : '民生付' }}</text>
206 </view> 206 </view>
207 <text :class="{ 207 <text :class="{
208 'status-wait': item.payStatus == 3, 208 'status-wait': item.payStatus == 3,
...@@ -214,25 +214,6 @@ ...@@ -214,25 +214,6 @@
214 </text> 214 </text>
215 </view> 215 </view>
216 </view> 216 </view>
217 <!-- <view class="card-header code-row">
218 <view class="date">
219 <view class="data-header">
220 <text class="value">
221 <text class="tradeNo">订单编号:</text>
222 {{ item.tradeNo || '——' }}
223 </text>
224 </view>
225 </view>
226 </view> -->
227 <!-- <view class="card-header code-row">
228 <view class="date">
229 <view class="data-header">
230 <text class="value">
231 {{ item.wfCode || '——' }}
232 </text>
233 </view>
234 </view>
235 </view> -->
236 <view class="member-time"> 217 <view class="member-time">
237 <view class="label"> 218 <view class="label">
238 <text class="star"></text> 219 <text class="star"></text>
...@@ -248,68 +229,32 @@ ...@@ -248,68 +229,32 @@
248 </view> 229 </view>
249 </view> 230 </view>
250 </view> 231 </view>
251 232
252 <!-- 核心:前2tab仅展示缴费年限,后2tab仅展示人数合计 --> 233 <!-- 缴费方式 -->
253 <!-- <view v-if="item.content" class="info-section flex f-j-s"> 234 <!-- <view class="pay-way-row">
254 <view v-if="currentTab === '0' || currentTab === '1'" class="single-info"> 235 <text class="pay-way-label">缴费方式:</text>
255 <view class="label">缴费年限:</view> 236 <text class="pay-way-value">{{ item.payType == '3' ? '对公转账' : '民生付' }}</text>
256 <view class="value">{{ item.content.yearCount || 0 }}</view>
257 </view>
258 <view v-if="currentTab === '2' || currentTab === '3' || currentTab === '4'" class="single-info">
259 <view class="label">人数合计</view>
260 <view class="value">{{ item.content.personCount || 0 }}</view>
261 </view>
262 <view class="line"></view>
263 <view class="single-info">
264 <view class="label">订单状态</view>
265 <view :class="item.effect == 1 ? 'text-success' : 'text-warning'" class="value">
266 {{ item.effect == 1 ? '已生效' : '未生效' }}
267 </view>
268 </view>
269 <view class="line"></view>
270 <view class="single-info">
271 <view class="label">缴费状态</view>
272 <view
273 :class="{
274 'text-primary': item.payStatus == 0,
275 'text-success': item.payStatus == 1,
276 'text-danger': item.payStatus == 2
277 }"
278 class="value"
279 >
280 {{ item.payStatus == 0 ? '待缴费' : item.payStatus == 1 ? '缴费成功' : '订单取消' }}
281 </view>
282 </view>
283 </view> --> 237 </view> -->
284 238
285 <!-- 按钮组:靠右紧凑展示 --> 239 <!-- 按钮组:靠右展示 -->
286 <view class="btn-group"> 240 <view class="btn-group">
287 <view> 241 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) -->
288 <text class="more" @click.stop="goToDetail(item)">更多</text> 242 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2 &&item.price>0">
289 </view> 243 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice"
290 <view class="btn-flex"> 244 @click.stop="makeInvoiceFN(item)">
291 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> 245 申请开票
292 <template> 246 </button>
293 <button class="btn btn-info" @click.stop="goToDetail(item)">查看明细</button> 247 </template>
294 </template> 248 <!-- 已申请票据:查看票据 -->
295 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> 249 <template v-if="item.invoiceStatus == 1">
296 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2 &&item.price>0"> 250 <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看票据</button>
297 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice" 251 </template>
298 @click.stop="makeInvoiceFN(item)"> 252 <!-- 未缴费:去缴费 + 取消订单 -->
299 申请开票 253 <template v-if="item.payStatus == 0">
300 </button> 254 <!-- 支付按钮:仅 auditStatus==='0' && payStatus==='0' 时可点 -->
301 </template> 255 <button :disabled="!(item.auditStatus == '0' && item.payStatus == 0)" class="btn btn-pay" @click.stop="handlePay(item)">去支付</button>
302 <!-- 已申请票据:查看票据 --> 256 <button :disabled="item.payStatus != 0" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button>
303 <template v-if="item.invoiceStatus == 1"> 257 </template>
304 <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看票据</button>
305 </template>
306 <!-- 未缴费:去缴费 + 取消订单 -->
307 <!-- <template v-if="item.payStatus == 0">
308 <button class="btn btn-cancel" @click="handleCancel(item)">取消订单</button>
309 <button class="btn btn-pay" @click="handlePay(item)">去缴费</button>
310 </template> -->
311 </view>
312
313 </view> 258 </view>
314 </view> 259 </view>
315 </view> 260 </view>
...@@ -575,7 +520,7 @@ const getAuditStatusText = (status) => { ...@@ -575,7 +520,7 @@ const getAuditStatusText = (status) => {
575 520
576 const getOrderLabel = (item) => { 521 const getOrderLabel = (item) => {
577 const map = { 522 const map = {
578 0: '会员', 523 0: '个人',
579 1: '单位', 524 1: '单位',
580 2: '级位', 525 2: '级位',
581 3: '段位', 526 3: '段位',
...@@ -608,8 +553,10 @@ const initData = async () => { ...@@ -608,8 +553,10 @@ const initData = async () => {
608 console.log("接口返回:", res); 553 console.log("接口返回:", res);
609 554
610 if (!res || !res.rows || res.rows.length === 0) { 555 if (!res || !res.rows || res.rows.length === 0) {
556 if (pageNum.value === 1) {
557 list.value = [];
558 }
611 hasMore.value = false; 559 hasMore.value = false;
612 loading.value = false;
613 return; 560 return;
614 } 561 }
615 // 安全解析content字段 562 // 安全解析content字段
...@@ -669,8 +616,6 @@ const confirmDel = async () => { ...@@ -669,8 +616,6 @@ const confirmDel = async () => {
669 }; 616 };
670 617
671 const goToDetail = (item) => { 618 const goToDetail = (item) => {
672 console.log("goToDetail:", item);
673 console.log("currentTab.value", currentTab.value);
674 const form = encodeURIComponent(JSON.stringify(item)) 619 const form = encodeURIComponent(JSON.stringify(item))
675 switch (currentTab.value) { 620 switch (currentTab.value) {
676 case '1': 621 case '1':
...@@ -696,15 +641,13 @@ const closeDelPopup = () => { ...@@ -696,15 +641,13 @@ const closeDelPopup = () => {
696 currentOrder.value = null; 641 currentOrder.value = null;
697 }; 642 };
698 643
699 // 去缴费 644 // 去缴费 - 跳转到单位会员支付页面
700 const handlePay = async (item) => { 645 const handlePay = async (item) => {
701 if (item.payStatus !== 0) return; 646 if (item.payStatus !== 0) return;
702 try { 647 // 跳转到单位会员支付页面
703 await api.goPay({id: item.id}); 648 uni.navigateTo({
704 uni.navigateTo({url: `/pages/pay/pay?orderId=${item.id}`}); 649 url: `/myCenter/goPay?orderId=${item.id}&renewYear=${item.content?.yearCount || 1}`
705 } catch (e) { 650 });
706 uni.showToast({title: '发起支付失败', icon: 'none'});
707 }
708 }; 651 };
709 652
710 // 申请开票 653 // 申请开票
...@@ -781,7 +724,7 @@ const handleCancel = (item) => { ...@@ -781,7 +724,7 @@ const handleCancel = (item) => {
781 const confirmCancel = async () => { 724 const confirmCancel = async () => {
782 if (!currentOrder.value) return; 725 if (!currentOrder.value) return;
783 try { 726 try {
784 await api.cancelPay(currentOrder.value.id); 727 await api.cancelOrder(currentOrder.value.id);
785 uni.showToast({title: '取消成功', icon: 'success'}); 728 uni.showToast({title: '取消成功', icon: 'success'});
786 pageNum.value = 1; 729 pageNum.value = 1;
787 list.value = []; 730 list.value = [];
...@@ -811,7 +754,8 @@ const onTabSwitch = (index, url) => { ...@@ -811,7 +754,8 @@ const onTabSwitch = (index, url) => {
811 height: 100vh; 754 height: 100vh;
812 display: flex; 755 display: flex;
813 flex-direction: column; 756 flex-direction: column;
814 padding-bottom: calc(120rpx + env(safe-area-inset-bottom)); 757 overflow: hidden;
758 padding-bottom: 0;
815 box-sizing: border-box; 759 box-sizing: border-box;
816 760
817 &.no-scroll { 761 &.no-scroll {
...@@ -985,14 +929,17 @@ const onTabSwitch = (index, url) => { ...@@ -985,14 +929,17 @@ const onTabSwitch = (index, url) => {
985 // 滚动列表容器 929 // 滚动列表容器
986 .order-list-scroll { 930 .order-list-scroll {
987 flex: 1; 931 flex: 1;
988 height: auto; 932 height: 0;
989 overflow: auto; 933 min-height: 0;
934 overflow: hidden;
990 background: #ededf0; 935 background: #ededf0;
991 } 936 }
992 937
993 // 订单列表 938 // 订单列表
994 .order-list { 939 .order-list {
995 padding: 0 24rpx 34rpx; 940 min-height: 100%;
941 box-sizing: border-box;
942 padding: 0 24rpx calc(180rpx + env(safe-area-inset-bottom));
996 943
997 .order-card { 944 .order-card {
998 background: #fff; 945 background: #fff;
...@@ -1192,29 +1139,18 @@ const onTabSwitch = (index, url) => { ...@@ -1192,29 +1139,18 @@ const onTabSwitch = (index, url) => {
1192 // 按钮组 1139 // 按钮组
1193 .btn-group { 1140 .btn-group {
1194 display: flex; 1141 display: flex;
1195 justify-content: space-between; 1142 justify-content: flex-end;
1196 align-items: center; 1143 align-items: center;
1197 gap: 16rpx; 1144 gap: 16rpx;
1198 width: 100%; 1145 width: 100%;
1199 margin-top: 16rpx; 1146 margin-top: 16rpx;
1200 1147 flex-wrap: wrap;
1201 .more { 1148
1202 color: #999;
1203 font-size: 26rpx;
1204 font-weight: 700;
1205 }
1206
1207 .btn-flex {
1208 display: flex;
1209 justify-content: flex-end;
1210 gap: 16rpx;
1211 }
1212
1213 .btn { 1149 .btn {
1214 // 固定宽度,所有按钮一样大 1150 // 固定宽度,所有按钮一样大
1215 width: 126rpx; 1151 width: 140rpx;
1216 height: 44rpx; 1152 height: 48rpx;
1217 line-height: 44rpx; 1153 line-height: 48rpx;
1218 padding: 0; 1154 padding: 0;
1219 border-radius: 10rpx; 1155 border-radius: 10rpx;
1220 font-size: 24rpx; 1156 font-size: 24rpx;
...@@ -1276,6 +1212,26 @@ const onTabSwitch = (index, url) => { ...@@ -1276,6 +1212,26 @@ const onTabSwitch = (index, url) => {
1276 } 1212 }
1277 } 1213 }
1278 1214
1215 // 缴费方式行
1216 .pay-way-row {
1217 display: flex;
1218 align-items: center;
1219 padding: 10rpx 0;
1220 border-top: 1rpx dashed #f0f0f0;
1221 margin-top: 8rpx;
1222
1223 .pay-way-label {
1224 font-size: 26rpx;
1225 color: #999;
1226 flex-shrink: 0;
1227 }
1228
1229 .pay-way-value {
1230 font-size: 26rpx;
1231 color: #333;
1232 font-weight: 500;
1233 }
1234 }
1279 1235
1280 // 加载/无更多提示 1236 // 加载/无更多提示
1281 .loading-tip, .no-more { 1237 .loading-tip, .no-more {
......
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
43 <view class="info-value">{{ validityDate }}</view> 43 <view class="info-value">{{ validityDate }}</view>
44 </view> 44 </view>
45 </view> 45 </view>
46 <image class="action-card" :src="config.baseUrl_api + '/fs/static/img/btn01.png'" mode="widthFix" @click="goPath('/myCenter/examPointApplyList')"></image> 46 <image class="action-card" :src="config.baseUrl_api + '/fs/static/img/btn01.png'" mode="widthFix" @click="goPath('/myCenter/examPointApplyList')"></image>
47 <image class="action-card" :src="config.baseUrl_api + '/fs/static/img/btn02.png'" mode="widthFix" @click="goAuthPayV2"></image> 47 <image class="action-card" :src="config.baseUrl_api + '/fs/static/img/btn02.png'" mode="widthFix" @click="goAuthPayV2"></image>
48 <image class="action-card" :src="config.baseUrl_api + '/fs/static/img/btn03.png'" mode="widthFix" @click="goPath('/personalVip/addVip')"></image> 48 <image class="action-card" :src="config.baseUrl_api + '/fs/static/img/btn03.png'" mode="widthFix" @click="goPath('/personalVip/addVip')"></image>
49 <image class="action-card" :src="config.baseUrl_api + '/fs/static/img/btn04.png'" mode="widthFix" @click="goPath('/personalVip/payment')"></image> 49 <image class="action-card" :src="config.baseUrl_api + '/fs/static/img/btn04.png'" mode="widthFix" @click="goPath('/personalVip/payment')"></image>
...@@ -87,6 +87,19 @@ ...@@ -87,6 +87,19 @@
87 </view> 87 </view>
88 </view> 88 </view>
89 </uni-popup> 89 </uni-popup>
90
91 <uni-popup ref="unpaidPopup" type="center" :mask-click="false">
92 <view class="dialog-wrapper">
93 <view class="dialog-title">系统提示</view>
94 <view class="dialog-message">您有一笔订单尚未支付,请及时支付或取消订单。</view>
95 <view class="dialog-footer">
96 <button class="dialog-btn cancel" @click="handelCancelOrder()">取消订单</button>
97 <button class="dialog-btn confirm" @click="goToPay()">去支付</button>
98 </view>
99 </view>
100 </uni-popup>
101
102 <CustomModal ref="customModalRef" :title="modalConfig.title" :content="modalConfig.content" :extraContent="modalConfig.extraContent" :showCancel="modalConfig.showCancel" :showConfirm="modalConfig.showConfirm" :cancelText="modalConfig.cancelText" :confirmText="modalConfig.confirmText" @confirm="modalConfig.onConfirm" @cancel="modalConfig.onCancel" />
90 </view> 103 </view>
91 </template> 104 </template>
92 105
...@@ -94,9 +107,11 @@ ...@@ -94,9 +107,11 @@
94 import config from '@/config.js' 107 import config from '@/config.js'
95 import { computed, ref } from 'vue' 108 import { computed, ref } from 'vue'
96 import { onLoad, onShow } from '@dcloudio/uni-app' 109 import { onLoad, onShow } from '@dcloudio/uni-app'
110 import to from 'await-to-js'
97 import * as api from '@/common/api.js' 111 import * as api from '@/common/api.js'
98 import { getInfo } from '@/common/login' 112 import { getInfo } from '@/common/login'
99 import DaoGuanTabBar from '@/components/dao-guan-tab-bar.vue' 113 import DaoGuanTabBar from '@/components/dao-guan-tab-bar.vue'
114 import CustomModal from '@/components/custom-modal.vue'
100 115
101 const app = getApp() 116 const app = getApp()
102 const userType = ref('1') 117 const userType = ref('1')
...@@ -109,10 +124,22 @@ const authPayPopup = ref(null) ...@@ -109,10 +124,22 @@ const authPayPopup = ref(null)
109 const authPayPopupMsg = ref('') 124 const authPayPopupMsg = ref('')
110 const passwordTipPopup = ref(null) 125 const passwordTipPopup = ref(null)
111 const examPointPopup = ref(null) 126 const examPointPopup = ref(null)
127 const unpaidPopup = ref(null)
128 const payForm = ref({})
129 const customModalRef = ref(null)
130 const modalConfig = ref({})
112 const showDirectlyForAuthPay = ref(false) 131 const showDirectlyForAuthPay = ref(false)
113 const directUnderFlagForAuthPay = ref(0) 132 const directUnderFlagForAuthPay = ref(0)
114 const associateIdForAuthPay = ref(0) 133 const associateIdForAuthPay = ref(0)
115 134
135 // 图片是否存在标识
136 const btn01Exist = ref(true)
137 const btn02Exist = ref(true)
138 const btn03Exist = ref(true)
139 const btn04Exist = ref(true)
140 const btn05Exist = ref(true)
141 const btn06Exist = ref(true)
142
116 const memberName = computed(() => { 143 const memberName = computed(() => {
117 return memberInfo.value.name || deptInfo.value.deptName || app.globalData?.dept?.deptName || '--' 144 return memberInfo.value.name || deptInfo.value.deptName || app.globalData?.dept?.deptName || '--'
118 }) 145 })
...@@ -157,6 +184,8 @@ onShow(() => { ...@@ -157,6 +184,8 @@ onShow(() => {
157 }) 184 })
158 185
159 function init() { 186 function init() {
187 checkImgExist()
188 handelGetMyRecent()
160 api.getMyOwnMemberInfo().then(res => { 189 api.getMyOwnMemberInfo().then(res => {
161 const data = res && res.data ? res.data : {} 190 const data = res && res.data ? res.data : {}
162 app.globalData.authenticationStatus = data.authenticationStatus 191 app.globalData.authenticationStatus = data.authenticationStatus
...@@ -183,6 +212,27 @@ function init() { ...@@ -183,6 +212,27 @@ function init() {
183 }) 212 })
184 } 213 }
185 214
215 // 检查图片是否存在,不存在则显示按钮
216 function checkImgExist() {
217 const btnKeys = ['btn01Exist', 'btn02Exist', 'btn03Exist', 'btn04Exist', 'btn05Exist', 'btn06Exist']
218 const refsMap = { btn01Exist, btn02Exist, btn03Exist, btn04Exist, btn05Exist, btn06Exist }
219 const paths = [
220 '/fs/static/img/btn01.png',
221 '/fs/static/img/btn02.png',
222 '/fs/static/img/btn03.png',
223 '/fs/static/img/btn04.png',
224 '/fs/static/img/btn05.png',
225 '/fs/static/img/btn06.png'
226 ]
227 btnKeys.forEach((key, index) => {
228 uni.getImageInfo({
229 src: config.baseUrl_api + paths[index],
230 success: () => { /* 图片存在 */ },
231 fail: () => { refsMap[key].value = false }
232 })
233 })
234 }
235
186 function handleAccountStatus() { 236 function handleAccountStatus() {
187 console.log('handleAccountStatus22',userType.value , app.globalData.authenticationStatus) 237 console.log('handleAccountStatus22',userType.value , app.globalData.authenticationStatus)
188 if (userType.value != '1' && app.globalData.authenticationStatus != '2' && app.globalData.authenticationStatus != '4') { 238 if (userType.value != '1' && app.globalData.authenticationStatus != '2' && app.globalData.authenticationStatus != '4') {
...@@ -313,10 +363,10 @@ function goAuthPayV2() { ...@@ -313,10 +363,10 @@ function goAuthPayV2() {
313 showAuthPayDialog('当前账号状态暂无法办理缴费业务') 363 showAuthPayDialog('当前账号状态暂无法办理缴费业务')
314 return 364 return
315 } 365 }
316 if (authPayDisabled.value) { 366 // if (authPayDisabled.value) {
317 showAuthPayDialog('您有一笔缴费正在审核中,请勿重复缴费。您可前往【认证详情】查看审核进度。') 367 // showAuthPayDialog('您有一笔缴费正在审核中,请勿重复缴费。您可前往【认证详情】查看审核进度。')
318 return 368 // return
319 } 369 // }
320 goPath('/myCenter/perfect') 370 goPath('/myCenter/perfect')
321 } 371 }
322 372
...@@ -360,6 +410,69 @@ console.log('checkDialogs',app.globalData.memberInfo?.activeStatus,app.globalDat ...@@ -360,6 +410,69 @@ console.log('checkDialogs',app.globalData.memberInfo?.activeStatus,app.globalDat
360 const onTabSwitch = () => { 410 const onTabSwitch = () => {
361 // tab switch handled by component 411 // tab switch handled by component
362 } 412 }
413
414 // 订单未支付相关方法
415 function showModal(options) {
416 modalConfig.value = {
417 title: options.title || '',
418 content: options.content || '',
419 extraContent: options.extraContent || '',
420 showCancel: options.showCancel !== false,
421 showConfirm: options.showConfirm !== false,
422 cancelText: options.cancelText || '取消',
423 confirmText: options.confirmText || '确定',
424 onConfirm: options.onConfirm,
425 onCancel: options.onCancel
426 }
427 customModalRef.value?.open()
428 }
429
430 function closeUnpaidPopup() {
431 unpaidPopup.value?.close()
432 }
433
434 function goToPay() {
435 const memberInfoData = memberInfo.value || app.globalData.memberInfo || {}
436 const assoName = memberInfoData.associateName || memberInfoData.assoName || ''
437 uni.navigateTo({
438 url: `/myCenter/goPay?payName=${encodeURIComponent(payForm.value.orderName || memberInfoData.deptName || '')}&assoName=${encodeURIComponent(assoName)}&orderId=${payForm.value.id}`
439 })
440 }
441
442 function handelCancelOrder() {
443 if (!payForm.value.id) return
444 showModal({
445 title: '确认取消',
446 content: '确定要取消该订单吗?',
447 cancelText: '取消',
448 confirmText: '确定',
449 onConfirm: async () => {
450 uni.showLoading({ title: '加载中...', mask: true })
451 const [err, result] = await to(api.cancelOrder(payForm.value.id))
452 uni.hideLoading()
453 if (!err && result?.code === 200) {
454 uni.showToast({ title: '订单已取消', icon: 'none' })
455 unpaidPopup.value?.close()
456 } else {
457 uni.showToast({ title: result?.msg || '取消失败', icon: 'none' })
458 }
459 }
460 })
461 }
462
463 function handelGetMyRecent() {
464 return new Promise(async (resolve) => {
465 const res = await to(api.getMyRecent())
466 if (res[0] || !res[1]?.data) return resolve(false)
467 payForm.value = res[1].data?.comOrder || {}
468 if (payForm.value.content) payForm.value.content = JSON.parse(payForm.value.content)
469 if (payForm.value.payStatus === '0') {
470 unpaidPopup.value?.open()
471 return resolve(false)
472 }
473 return resolve(true)
474 })
475 }
363 </script> 476 </script>
364 477
365 <style lang="scss" scoped> 478 <style lang="scss" scoped>
...@@ -598,4 +711,16 @@ const onTabSwitch = () => { ...@@ -598,4 +711,16 @@ const onTabSwitch = () => {
598 font-size: 24rpx; 711 font-size: 24rpx;
599 text-align: right; 712 text-align: right;
600 } 713 }
714
715 .action-btn {
716 width: 100%;
717 height: 88rpx;
718 line-height: 88rpx;
719 background: linear-gradient(135deg, #AD181F 0%, #c42a2a 100%);
720 color: #fff;
721 font-size: 30rpx;
722 font-weight: 500;
723 text-align: center;
724 border-radius: 44rpx;
725 }
601 </style> 726 </style>
......
...@@ -842,85 +842,68 @@ function goAuthPay() { ...@@ -842,85 +842,68 @@ function goAuthPay() {
842 goPath('/myCenter/perfect') 842 goPath('/myCenter/perfect')
843 } 843 }
844 844
845 function init() { 845 async function init() {
846 isInit.value = true 846 isInit.value = true
847 847
848 848 try {
849 loginServer.getMyOwnMemberInfo().then(res => { 849 const res = await loginServer.getMyOwnMemberInfo()
850 console.log(43, res) 850 console.log(43, res)
851 userType.value = app.globalData.userType 851 userType.value = app.globalData.userType
852 memberInfo.value = app.globalData.memberInfo 852 memberInfo.value = app.globalData.memberInfo
853 const memberResData = res && res.data ? res.data : {} 853 const memberResData = res && res.data ? res.data : {}
854 updateAuthPayDisabled(memberResData) 854 updateAuthPayDisabled(memberResData)
855 updateAuthPayRule(memberResData) 855 updateAuthPayRule(memberResData)
856 // deptInfo.value = app.globalData.dept || {} 856
857 // app.globalData.deptInfo = res.dept || {}
858
859 if (userType.value != '1' && app.globalData.authenticationStatus != '2' && app.globalData.authenticationStatus != '4') { 857 if (userType.value != '1' && app.globalData.authenticationStatus != '2' && app.globalData.authenticationStatus != '4') {
860 // 注册引导 858 uni.navigateTo({ url: '/pages/index/perfect' })
861 uni.navigateTo({ 859 return
862 url: '/pages/index/perfect'
863 });
864 } 860 }
865 // console.log(userType.value, app.globalData.authenticationStatus)
866 if (app.globalData.authenticationStatus == '5') { 861 if (app.globalData.authenticationStatus == '5') {
867 if (app.globalData.genFlag == 1) { 862 if (app.globalData.genFlag == 1) {
868 uni.showModal({ 863 uni.showModal({ title: '提示', content: '您的会员已过期' })
869 title: '提示',
870 content: '您的会员已过期',
871 success: function (res) {
872 }
873 })
874 } else { 864 } else {
875 uni.showModal({ 865 uni.showModal({
876 title: '提示', 866 title: '提示',
877 content: '会员已过期,请及时续费', 867 content: '会员已过期,请及时续费',
878 success: function (res) { 868 success: function (res) {
879 if (res.confirm) { 869 if (res.confirm) {
880 uni.navigateTo({ 870 uni.navigateTo({ url: '/myCenter/auth' })
881 url: '/myCenter/auth'
882 });
883 } 871 }
884 } 872 }
885 }) 873 })
886 } 874 }
887 875 return
888 } 876 }
889 if (app.globalData.authenticationStatus == '4') { 877 if (app.globalData.authenticationStatus == '4') {
890 uni.showModal({ 878 uni.showModal({ title: '提示', content: '你的会员即将过期,将会影响你的业务,请及时续费!' })
891 title: '提示',
892 content: '你的会员即将过期,将会影响你的业务,请及时续费!',
893 success: function (res) {
894 }
895 })
896 } 879 }
897 if (app.globalData.memberInfo?.activeStatus == 0) { 880 if (app.globalData.memberInfo?.activeStatus == 0) {
898 uni.showModal({ 881 uni.showModal({
899 content: '账号未激活,请前去激活', 882 content: '账号未激活,请前去激活',
900 success: function (res) { 883 success: function (res) {
901 if (res.confirm) { 884 if (res.confirm) {
902 uni.navigateTo({ 885 uni.navigateTo({ url: '/myCenter/auth' })
903 url: '/myCenter/auth'
904 });
905 } 886 }
906
907 } 887 }
908 }) 888 })
889 return
909 } 890 }
910 891
911 checkDialogs() 892 checkDialogs()
912 uni.hideLoading(); 893 uni.hideLoading()
913 }) 894
914 895 // 以下接口只在不需要跳转时调用
915 api.getRemindCount().then(res => { 896 const [countRes, blackRes] = await Promise.all([
916 numData.value = res.data 897 api.getRemindCount(),
917 }) 898 api.getBlack()
918 899 ])
919 api.getBlack().then(res => { 900 numData.value = countRes.data
920 isBlack.value = res.data 901 isBlack.value = blackRes.data
921 }) 902
922 903 getNews()
923 getNews() 904 } catch (e) {
905 console.log('init error:', e)
906 }
924 } 907 }
925 908
926 function getNews() { 909 function getNews() {
......
...@@ -266,6 +266,7 @@ ...@@ -266,6 +266,7 @@
266 :cancelText="modalConfig.cancelText" 266 :cancelText="modalConfig.cancelText"
267 :confirmText="modalConfig.confirmText" 267 :confirmText="modalConfig.confirmText"
268 :content="modalConfig.content" 268 :content="modalConfig.content"
269 :extraContent="modalConfig.extraContent"
269 :isHtml="modalConfig.isHtml" 270 :isHtml="modalConfig.isHtml"
270 :showCancel="modalConfig.showCancel" 271 :showCancel="modalConfig.showCancel"
271 :showConfirm="modalConfig.showConfirm" 272 :showConfirm="modalConfig.showConfirm"
...@@ -325,6 +326,7 @@ function showModal(options) { ...@@ -325,6 +326,7 @@ function showModal(options) {
325 modalConfig.value = { 326 modalConfig.value = {
326 title: options.title || '', 327 title: options.title || '',
327 content: options.content || '', 328 content: options.content || '',
329 extraContent: options.extraContent || '',
328 isHtml: options.isHtml || false, 330 isHtml: options.isHtml || false,
329 showCancel: options.showCancel !== false, 331 showCancel: options.showCancel !== false,
330 showConfirm: options.showConfirm !== false, 332 showConfirm: options.showConfirm !== false,
...@@ -475,6 +477,66 @@ function switchStep(step) { ...@@ -475,6 +477,66 @@ function switchStep(step) {
475 } 477 }
476 } 478 }
477 479
480 // 订单信息(用于待支付订单弹框)
481 const payForm = ref({})
482
483 // 获取最近认证记录,判断是否有未支付订单
484 function handelGetMyRecent() {
485 return new Promise(async (resolve, reject) => {
486 const res = await api.getMyRecent() ?? {}
487 payForm.value = res.data?.comOrder ?? {}
488 // payStatus: '0' 未支付, '1' 已支付, '2' 已取消
489 if (payForm.value.content) payForm.value.content = JSON.parse(payForm.value.content)
490 if (payForm.value.payStatus === '0') {
491 showModal({
492 title: '系统提示',
493 content: '您有一笔订单尚未支付,请及时支付或取消订单。',
494 cancelText: '取消订单',
495 confirmText: '去支付',
496 onConfirm: () => {
497 // 去支付,跳转到缴费页面
498 const assoName = assoFullName.value
499 uni.navigateTo({
500 url: `/myCenter/goPay?payName=${encodeURIComponent(payForm.value.orderName || form.value.name || '')}&assoName=${encodeURIComponent(assoName)}&orderId=${payForm.value.id}`
501 })
502 },
503 onCancel: () => {
504 handelCancelOrder()
505 }
506 })
507 return reject(res)
508 } else {
509 return resolve(true)
510 }
511 })
512 }
513
514 // 取消订单
515 async function handelCancelOrder() {
516 if (!payForm.value.id) return
517 const res = await new Promise((resolve) => {
518 showModal({
519 title: '确认取消',
520 content: '是否确认取消该订单?',
521 cancelText: '否',
522 confirmText: '是',
523 onConfirm: () => resolve(true),
524 onCancel: () => resolve(false)
525 })
526 })
527 if (!res) return
528 uni.showLoading({ title: '取消中...' })
529 try {
530 await api.cancelOrder(payForm.value.id)
531 uni.showToast({ title: '取消成功', icon: 'success' })
532 await init()
533 } catch (e) {
534 uni.showToast({ title: '取消失败', icon: 'none' })
535 } finally {
536 uni.hideLoading()
537 }
538 }
539
478 // 获取审核详情 540 // 获取审核详情
479 function getMyCertStageFN() { 541 function getMyCertStageFN() {
480 auditLoading.value = true 542 auditLoading.value = true
...@@ -533,9 +595,14 @@ function getImageUrl(url) { ...@@ -533,9 +595,14 @@ function getImageUrl(url) {
533 function getBusinessLicenseUrl() { 595 function getBusinessLicenseUrl() {
534 if (!form.value.businessLicense) return '' 596 if (!form.value.businessLicense) return ''
535 try { 597 try {
536 const arr = JSON.parse(form.value.businessLicense) 598 const license = JSON.parse(form.value.businessLicense)
537 if (Array.isArray(arr) && arr.length > 0) { 599 // 如果是数组,取第一个元素的url
538 return arr[0].url || '' 600 if (Array.isArray(license) && license.length > 0) {
601 return license[0].url || ''
602 }
603 // 如果是对象,直接取url
604 if (typeof license === 'object' && license.url) {
605 return license.url
539 } 606 }
540 } catch (e) { 607 } catch (e) {
541 // 如果不是JSON格式,可能是直接返回的URL 608 // 如果不是JSON格式,可能是直接返回的URL
...@@ -562,11 +629,11 @@ onLoad(option => { ...@@ -562,11 +629,11 @@ onLoad(option => {
562 function init() { 629 function init() {
563 getDetail() 630 getDetail()
564 getRegionsList() 631 getRegionsList()
565
566 // getMyMemberCertUnitFeeApi() 632 // getMyMemberCertUnitFeeApi()
567 canUseDiscountApi() 633 canUseDiscountApi()
568 getZtxDiscountPolicyApi() 634 getZtxDiscountPolicyApi()
569 getMyStatusAPI() 635 getMyStatusAPI()
636 handelGetMyRecent()
570 } 637 }
571 638
572 // 获取详情 639 // 获取详情
...@@ -630,13 +697,19 @@ function getDetail() { ...@@ -630,13 +697,19 @@ function getDetail() {
630 form.value.legalIdcPhoto2 = photos[1] || '' 697 form.value.legalIdcPhoto2 = photos[1] || ''
631 } 698 }
632 699
633 // 处理营业执照 700 // 处理营业执照,保留原始数据格式
634 if (form.value.businessLicense) { 701 if (form.value.businessLicense) {
635 try { 702 try {
636 const license = JSON.parse(form.value.businessLicense) 703 const license = JSON.parse(form.value.businessLicense)
637 form.value.businessLicense = license.url || license 704 // 如果是数组,取第一个元素的名称
638 form.value.businessLicenseName = license.name 705 if (Array.isArray(license) && license.length > 0) {
706 form.value.businessLicenseName = license[0].name || ''
707 } else if (typeof license === 'object' && license.url) {
708 form.value.businessLicenseName = license.name || ''
709 }
710 // businessLicense 保持原始值,不做转换
639 } catch (e) { 711 } catch (e) {
712 // 已经是纯URL字符串,不做处理
640 } 713 }
641 } 714 }
642 715
...@@ -910,43 +983,56 @@ async function submitStep2() { ...@@ -910,43 +983,56 @@ async function submitStep2() {
910 uni.showToast({title: '请阅读并同意注册须知、入会须知、免责声明', duration: 2000, icon: 'none'}) 983 uni.showToast({title: '请阅读并同意注册须知、入会须知、免责声明', duration: 2000, icon: 'none'})
911 return 984 return
912 } 985 }
913 986
987 // 检查是否有未支付订单
988 try {
989 await handelGetMyRecent()
990 } catch (e) {
991 return
992 }
993
914 const creditCodePass = await onCreditCodeBlur(false) 994 const creditCodePass = await onCreditCodeBlur(false)
915 if (!creditCodePass) { 995 if (!creditCodePass) {
916 uni.showToast({title: '社会信用代码已存在,请联系中跆协修改', icon: 'none', duration: 3000}) 996 uni.showToast({title: '社会信用代码已存在,请联系中跆协修改', icon: 'none', duration: 3000})
917 return 997 return
918 } 998 }
999
1000 // 先校验企业信息
919 uni.showLoading({title: '验证中...'}) 1001 uni.showLoading({title: '验证中...'})
920 await api.checkBusinessLicense({ 1002 let checkRes
921 creditCode: form.value.creditCode, 1003 try {
922 companyName: form.value.companyName, 1004 checkRes = await api.checkBusinessLicense({
923 legalIdcCode: form.value.legalIdcCode, 1005 creditCode: form.value.creditCode,
924 legal: form.value.legal 1006 companyName: form.value.companyName,
925 }).then(checkRes => { 1007 legalIdcCode: form.value.legalIdcCode,
926 uni.hideLoading() 1008 legal: form.value.legal
927 if (checkRes.code != 200 || !checkRes.data.passFlag) { 1009 })
928 showModal({ 1010 } catch (e) {
929 title: '系统提示',
930 content: '企业信息异常请检查相关资料信息,确认无误后再次提交!',
931 cancelText: '返回修改',
932 confirmText: '确认无误',
933 onConfirm: () => submitCertification()
934 })
935 } else {
936 // 校验通过,提交认证(PC端逻辑)
937 submitCertification()
938 }
939 }).catch(() => {
940 uni.hideLoading() 1011 uni.hideLoading()
941 showModal({ 1012 showModal({
942 title: '系统提示', 1013 title: '系统提示',
943 content: '企业信息异常请检查相关资料信息,确认无误后再次提交!', 1014 content: '企业信息验证失败,请检查相关资料信息,确认无误后再次提交!',
944 cancelText: '返回修改', 1015 cancelText: '返回修改',
945 confirmText: '确认无误', 1016 confirmText: '确认无误',
946 onConfirm: () => submitCertification() 1017 onConfirm: () => submitCertification()
947 }) 1018 })
948 }) 1019 return
949 1020 }
1021 uni.hideLoading()
1022
1023 if (checkRes.code != 200 || !checkRes.data?.passFlag) {
1024 const errMsg = checkRes.data?.msg || ''
1025 showModal({
1026 title: '系统提示',
1027 content: errMsg,
1028 extraContent: '企业信息异常请检查相关资料信息,确认无误后再次提交!',
1029 cancelText: '返回修改',
1030 confirmText: '确认无误',
1031 onConfirm: () => submitCertification()
1032 })
1033 } else {
1034 submitCertification()
1035 }
950 } 1036 }
951 1037
952 // 提交认证信息(100%对齐PC端入参格式) 1038 // 提交认证信息(100%对齐PC端入参格式)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!