8fb19fdf by lttnew

订单

1 parent cfd67a49
...@@ -38,4 +38,17 @@ export function AESDecrypt(str) { ...@@ -38,4 +38,17 @@ export function AESDecrypt(str) {
38 } catch (e) { 38 } catch (e) {
39 return aesStr 39 return aesStr
40 } 40 }
41 }
...\ No newline at end of file ...\ No newline at end of file
41 }
42
43 export function isDaoGuanRole() {
44 const app = getApp()
45 const deptType = app.globalData?.deptType
46 const userType = app.globalData?.userType
47 return deptType == 6 || deptType == '6' || userType == '4'
48 }
49
50 export function reLaunchHomeByRole() {
51 uni.reLaunch({
52 url: isDaoGuanRole() ? '/pages/index/daoGuanPerson' : '/pages/index/home'
53 })
54 }
......
...@@ -78,18 +78,18 @@ ...@@ -78,18 +78,18 @@
78 78
79 <view class="btn-group"> 79 <view class="btn-group">
80 <template v-if="isZtxRole"> 80 <template v-if="isZtxRole">
81 <button :class="{ disabled: isRefundDisabled(item) }" :disabled="isRefundDisabled(item)" class="btn btn-pay" @click.stop="handleRefund(item)">退款</button> 81 <button v-if="canShowRefund(item)" class="btn btn-pay" @click.stop="handleRefund(item)">退款</button>
82 </template> 82 </template>
83 <template v-else> 83 <template v-else>
84 <button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="handlePay(item)">去支付</button> 84 <button v-if="canShowPay(item)" class="btn btn-pay" @click.stop="handlePay(item)">去支付</button>
85 <button v-if="canShowCancel(item)" :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button> 85 <button v-if="canShowCancel(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button>
86 <template v-if="canShowInvoiceApply(item)"> 86 <template v-if="canShowInvoiceApply(item)">
87 <button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button> 87 <button class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button>
88 </template> 88 </template>
89 <template v-if="hasInvoice(item)"> 89 <template v-if="hasInvoice(item)">
90 <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button> 90 <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button>
91 </template> 91 </template>
92 <button v-if="canShowReIssue(item)" :class="{ disabled: isReIssueDisabled(item) }" :disabled="isReIssueDisabled(item)" class="btn btn-view-invoice" @click.stop="handleReIssue(item)">重新开票</button> 92 <button v-if="canShowReIssue(item)" class="btn btn-view-invoice" @click.stop="handleReIssue(item)">换开</button>
93 </template> 93 </template>
94 </view> 94 </view>
95 </view> 95 </view>
...@@ -325,11 +325,13 @@ const hasInvoice = (item) => String(item?.invoiceStatus) === '1' ...@@ -325,11 +325,13 @@ const hasInvoice = (item) => String(item?.invoiceStatus) === '1'
325 325
326 const isPayDisabled = (item) => String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0' 326 const isPayDisabled = (item) => String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0'
327 327
328 const canShowCancel = (item) => String(item?.auditStatus) === '9' 328 const canShowPay = (item) => !isPayDisabled(item)
329
330 const canShowCancel = (item) => !isCancelDisabled(item)
329 331
330 const isCancelDisabled = (item) => String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0' 332 const isCancelDisabled = (item) => String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0'
331 333
332 const canShowInvoiceApply = (item) => !hasInvoice(item) 334 const canShowInvoiceApply = (item) => !isInvoiceDisabled(item)
333 335
334 const isInvoiceDisabled = (item) => { 336 const isInvoiceDisabled = (item) => {
335 return String(item?.payStatus) !== '1' || 337 return String(item?.payStatus) !== '1' ||
...@@ -345,7 +347,7 @@ const isWithinCalendarMonth = (dateValue) => { ...@@ -345,7 +347,7 @@ const isWithinCalendarMonth = (dateValue) => {
345 return date.isSame(dayjs(), 'month') 347 return date.isSame(dayjs(), 'month')
346 } 348 }
347 349
348 const canShowReIssue = (item) => !isZtxRole.value && String(item?.auditStatus) !== '9' 350 const canShowReIssue = (item) => !isZtxRole.value && String(item?.auditStatus) !== '9' && !isReIssueDisabled(item)
349 351
350 const isReIssueDisabled = (item) => { 352 const isReIssueDisabled = (item) => {
351 return !hasInvoice(item) || 353 return !hasInvoice(item) ||
...@@ -357,6 +359,8 @@ const isReIssueDisabled = (item) => { ...@@ -357,6 +359,8 @@ const isReIssueDisabled = (item) => {
357 359
358 const isRefundDisabled = (item) => String(item?.payStatus) !== '1' || hasInvoice(item) 360 const isRefundDisabled = (item) => String(item?.payStatus) !== '1' || hasInvoice(item)
359 361
362 const canShowRefund = (item) => !isRefundDisabled(item)
363
360 364
361 // 数据请求核心方法 365 // 数据请求核心方法
362 const initData = async () => { 366 const initData = async () => {
...@@ -481,14 +485,17 @@ const makeInvoiceFN = (item) => { ...@@ -481,14 +485,17 @@ const makeInvoiceFN = (item) => {
481 // } 485 // }
482 // 设置刷新标记,从开票页面返回时刷新列表 486 // 设置刷新标记,从开票页面返回时刷新列表
483 needRefresh.value = true; 487 needRefresh.value = true;
488 const isB2B = String(item.payType) === '3'
489 const payTypeQuery = `&payType=${encodeURIComponent(item.payType || '')}`
490 const ziZhangBu = isB2B ? '&ziZhangBu=1' : ''
484 // 根据tab类型决定跳转页面:个人/单位会员开非税票,级位/段位/越段考试开增值税票 491 // 根据tab类型决定跳转页面:个人/单位会员开非税票,级位/段位/越段考试开增值税票
485 let url = ''; 492 let url = '';
486 if (currentTab.value === '0' || currentTab.value === '1') { 493 if (currentTab.value === '0' || currentTab.value === '1') {
487 // 个人/单位会员 - 非税开票 494 // 个人/单位会员 - 非税开票
488 url = `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}`; 495 url = `/pages/invoice/applyFeisui?orderId=${item.id}&amount=${item.price}${payTypeQuery}${ziZhangBu}`;
489 } else { 496 } else {
490 // 级位/段位/越段考试 - 增值税开票 497 // 级位/段位/越段考试 - 增值税开票
491 url = `/pages/invoice/apply?orderId=${item.id}&amount=${item.price}`; 498 url = `/pages/invoice/apply?orderId=${item.id}&amount=${item.price}${payTypeQuery}${ziZhangBu}`;
492 } 499 }
493 uni.navigateTo({ url }); 500 uni.navigateTo({ url });
494 }; 501 };
...@@ -923,7 +930,7 @@ const confirmRefund = async (item) => { ...@@ -923,7 +930,7 @@ const confirmRefund = async (item) => {
923 .btn { 930 .btn {
924 width: 140rpx; 931 width: 140rpx;
925 height: 48rpx; 932 height: 48rpx;
926 line-height: 48rpx; 933 line-height: 46rpx;
927 padding: 0; 934 padding: 0;
928 border-radius: 10rpx; 935 border-radius: 10rpx;
929 font-size: 24rpx; 936 font-size: 24rpx;
......
...@@ -141,12 +141,13 @@ ...@@ -141,12 +141,13 @@
141 } from 'vue'; 141 } from 'vue';
142 import * as api from '@/common/api.js'; 142 import * as api from '@/common/api.js';
143 import _ from 'underscore' 143 import _ from 'underscore'
144 import { 144 import {
145 onLoad, 145 onLoad,
146 onShow 146 onShow
147 } from '@dcloudio/uni-app'; 147 } from '@dcloudio/uni-app';
148 import config from '@/config.js' 148 import config from '@/config.js'
149 const app = getApp(); 149 import { reLaunchHomeByRole } from '@/common/utils.js'
150 const app = getApp();
150 151
151 const verifyPopup = ref(null) 152 const verifyPopup = ref(null)
152 const applyPopup = ref(null) 153 const applyPopup = ref(null)
...@@ -653,13 +654,11 @@ ...@@ -653,13 +654,11 @@
653 uni.showModal({ 654 uni.showModal({
654 content: '激活成功,返回首页', 655 content: '激活成功,返回首页',
655 success: function(resp) { 656 success: function(resp) {
656 if (resp.confirm) { 657 if (resp.confirm) {
657 uni.reLaunch({ 658 reLaunchHomeByRole()
658 url: `/pages/index/home` 659 } else {
659 }) 660 uni.navigateBack()
660 } else { 661 }
661 uni.navigateBack()
662 }
663 } 662 }
664 }) 663 })
665 }).catch(err => { 664 }).catch(err => {
...@@ -1070,4 +1069,4 @@ ...@@ -1070,4 +1069,4 @@
1070 .apply-btns { 1069 .apply-btns {
1071 margin-bottom: 20rpx; 1070 margin-bottom: 20rpx;
1072 } 1071 }
1073 </style>
...\ No newline at end of file ...\ No newline at end of file
1072 </style>
......
...@@ -41,8 +41,9 @@ import { ...@@ -41,8 +41,9 @@ import {
41 import { 41 import {
42 onLoad 42 onLoad
43 } from '@dcloudio/uni-app' 43 } from '@dcloudio/uni-app'
44 import to from 'await-to-js' 44 import to from 'await-to-js'
45 import * as api from '@/common/api.js' 45 import * as api from '@/common/api.js'
46 import { reLaunchHomeByRole } from '@/common/utils.js'
46 47
47 const orderInfo = ref({ 48 const orderInfo = ref({
48 orderId: '', 49 orderId: '',
...@@ -51,11 +52,9 @@ const orderInfo = ref({ ...@@ -51,11 +52,9 @@ const orderInfo = ref({
51 price: '' 52 price: ''
52 }) 53 })
53 54
54 const goBack = () => { 55 const goBack = () => {
55 uni.reLaunch({ 56 reLaunchHomeByRole()
56 url: '/pages/index/home' 57 }
57 })
58 }
59 58
60 onLoad(async (option) => { 59 onLoad(async (option) => {
61 // if (option.orderId) { 60 // if (option.orderId) {
......
...@@ -393,7 +393,7 @@ const isPayDisabled = (item) => { ...@@ -393,7 +393,7 @@ const isPayDisabled = (item) => {
393 } 393 }
394 394
395 const isCancelDisabled = (item) => { 395 const isCancelDisabled = (item) => {
396 if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9' 396 if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0'
397 if (isLevelOrder(item)) { 397 if (isLevelOrder(item)) {
398 return String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0' 398 return String(item?.auditStatus) !== '9' || String(item?.payStatus) !== '0'
399 } 399 }
......
...@@ -617,6 +617,7 @@ import * as api from '@/common/api.js'; ...@@ -617,6 +617,7 @@ import * as api from '@/common/api.js';
617 import * as loginServer from '@/common/login.js'; 617 import * as loginServer from '@/common/login.js';
618 import config from '@/config.js' 618 import config from '@/config.js'
619 import {getInfo} from '@/common/login' 619 import {getInfo} from '@/common/login'
620 import { reLaunchHomeByRole } from '@/common/utils.js'
620 import { 621 import {
621 onLoad, 622 onLoad,
622 onShow, 623 onShow,
...@@ -998,7 +999,7 @@ async function submitBindingPhone() { ...@@ -998,7 +999,7 @@ async function submitBindingPhone() {
998 uni.showToast({title: '修改成功', icon: 'success'}) 999 uni.showToast({title: '修改成功', icon: 'success'})
999 closeBindingPhoneDialog() 1000 closeBindingPhoneDialog()
1000 setTimeout(() => { 1001 setTimeout(() => {
1001 uni.reLaunch({url: '/pages/index/home'}) 1002 reLaunchHomeByRole()
1002 }, 1500) 1003 }, 1500)
1003 } catch (e) { 1004 } catch (e) {
1004 // 错误已由 request.js 处理 1005 // 错误已由 request.js 处理
......
...@@ -9,9 +9,10 @@ ...@@ -9,9 +9,10 @@
9 getInfo, 9 getInfo,
10 getWebInfo 10 getWebInfo
11 } from '@/common/login.js'; 11 } from '@/common/login.js';
12 import { 12 import {
13 useUserStore 13 useUserStore
14 } from '../../store/modules/user'; 14 } from '../../store/modules/user';
15 import { reLaunchHomeByRole } from '@/common/utils.js'
15 16
16 const userStore = useUserStore() 17 const userStore = useUserStore()
17 const app = getApp() 18 const app = getApp()
...@@ -28,20 +29,10 @@ ...@@ -28,20 +29,10 @@
28 let userName = uni.getStorageSync('userName') 29 let userName = uni.getStorageSync('userName')
29 console.log('userName', userName) 30 console.log('userName', userName)
30 console.log('app.globalData.userType ', app.globalData.userType ) 31 console.log('app.globalData.userType ', app.globalData.userType )
31 if (userName) { 32 if (userName) {
32 if(app.globalData.userType == 4){ 33 reLaunchHomeByRole()
33 uni.reLaunch({ 34 return
34 url: '/pages/index/daoGuanPerson' 35 }
35 })
36 return
37 }else{
38 uni.reLaunch({
39 url: '/pages/index/home'
40 })
41 return
42 }
43
44 }
45 36
46 let webUserName = uni.getStorageSync('webUserName') 37 let webUserName = uni.getStorageSync('webUserName')
47 if (webUserName) { 38 if (webUserName) {
......
...@@ -90,6 +90,16 @@ ...@@ -90,6 +90,16 @@
90 </view> 90 </view>
91 </view> 91 </view>
92 <view class="fixedBottom"><button class="btn-red" @click="goSubmit">确 定</button></view> 92 <view class="fixedBottom"><button class="btn-red" @click="goSubmit">确 定</button></view>
93 <view v-if="showCustomModal" class="custom-modal-mask" @touchmove.stop.prevent @click.stop>
94 <view class="custom-modal" @click.stop>
95 <view class="custom-modal-title">{{ customModalTitle }}</view>
96 <view class="custom-modal-content">{{ customModalContent }}</view>
97 <view class="custom-modal-btns">
98 <button v-if="customModalShowCancel" class="custom-modal-cancel" @click="handleCustomCancel">{{ customModalCancelText }}</button>
99 <button class="custom-modal-confirm" @click="handleCustomConfirm">{{ customModalConfirmText }}</button>
100 </view>
101 </view>
102 </view>
93 </view> 103 </view>
94 </template> 104 </template>
95 105
...@@ -110,6 +120,14 @@ ...@@ -110,6 +120,14 @@
110 const regionsList = ref([]) 120 const regionsList = ref([])
111 const cardObj = ref({}) 121 const cardObj = ref({})
112 const disabledName = ref(true) 122 const disabledName = ref(true)
123 const showCustomModal = ref(false)
124 const customModalTitle = ref('提示')
125 const customModalContent = ref('')
126 const customModalConfirmText = ref('确定')
127 const customModalCancelText = ref('取消')
128 const customModalShowCancel = ref(false)
129 const customModalConfirmAction = ref(null)
130 const customModalCancelAction = ref(null)
113 const baseFormData = ref({ 131 const baseFormData = ref({
114 photo: '', 132 photo: '',
115 sex: '', 133 sex: '',
...@@ -166,6 +184,35 @@ ...@@ -166,6 +184,35 @@
166 width: '500rpx', 184 width: '500rpx',
167 height: '316rpx' 185 height: '316rpx'
168 }); 186 });
187
188 function openCustomModal(options = {}) {
189 customModalTitle.value = options.title || '提示'
190 customModalContent.value = options.content || ''
191 customModalConfirmText.value = options.confirmText || '确定'
192 customModalCancelText.value = options.cancelText || '取消'
193 customModalShowCancel.value = !!options.showCancel
194 customModalConfirmAction.value = typeof options.onConfirm === 'function' ? options.onConfirm : null
195 customModalCancelAction.value = typeof options.onCancel === 'function' ? options.onCancel : null
196 showCustomModal.value = true
197 }
198
199 function closeCustomModal() {
200 showCustomModal.value = false
201 customModalConfirmAction.value = null
202 customModalCancelAction.value = null
203 }
204
205 function handleCustomConfirm() {
206 const action = customModalConfirmAction.value
207 closeCustomModal()
208 if (action) action()
209 }
210
211 function handleCustomCancel() {
212 const action = customModalCancelAction.value
213 closeCustomModal()
214 if (action) action()
215 }
169 onLoad((option) => { 216 onLoad((option) => {
170 if (option.tab == '1') { 217 if (option.tab == '1') {
171 current.value = 1 218 current.value = 1
...@@ -259,11 +306,8 @@ ...@@ -259,11 +306,8 @@
259 306
260 } else { 307 } else {
261 uni.hideLoading() 308 uni.hideLoading()
262 uni.showModal({ 309 openCustomModal({
263 content: res.msg, 310 content: res.msg
264 success: function(modalRes) {
265
266 }
267 }) 311 })
268 } 312 }
269 313
...@@ -471,10 +515,10 @@ ...@@ -471,10 +515,10 @@
471 return 515 return
472 } 516 }
473 //信息确认弹出 517 //信息确认弹出
474 uni.showModal({ 518 openCustomModal({
475 content: '请确认信息正确', 519 content: '请确认信息正确',
476 success: function(res) { 520 showCancel: true,
477 if (res.confirm) { 521 onConfirm: function() {
478 if (baseFormData.value.idcType == '4') { 522 if (baseFormData.value.idcType == '4') {
479 baseFormData.value.idcType = '0' 523 baseFormData.value.idcType = '0'
480 } 524 }
...@@ -489,42 +533,40 @@ ...@@ -489,42 +533,40 @@
489 api.addPersonToMyDept(baseFormData.value).then(Response => { 533 api.addPersonToMyDept(baseFormData.value).then(Response => {
490 if (Response.data == 0) { 534 if (Response.data == 0) {
491 let msg = '该成员,实名认证未通过,注册失败!' 535 let msg = '该成员,实名认证未通过,注册失败!'
492 uni.showModal({ 536 openCustomModal({
493 content: msg, 537 content: msg,
494 title: '提示', 538 title: '提示'
495 success: function() {}
496 }) 539 })
497 return 540 return
498 } 541 }
499 if (Response.data * 1 < 0) { 542 if (Response.data * 1 < 0) {
500 // 会员调入弹出 543 // 会员调入弹出
501 uni.showModal({ 544 openCustomModal({
502 content: '该会员已存在其他道馆,如需添加,请发起会员调动', 545 content: '该会员已存在其他道馆,如需添加,请发起会员调动',
503 title: '提示', 546 title: '提示'
504 success: function() {}
505 }) 547 })
506 return 548 return
507 } 549 }
508 // let msg = '保存成功' 550 // let msg = '保存成功'
509 uni.showModal({ 551 openCustomModal({
510 content: '保存成功', 552 content: '保存成功',
511 title: '提示', 553 title: '提示',
512 confirmText: '继续添加', 554 confirmText: '继续添加',
513 cancelText: '返回首页', 555 cancelText: '返回首页',
514 success: function(res) { 556 showCancel: true,
557 onConfirm: function() {
515 uni.redirectTo({ 558 uni.redirectTo({
516 url: `/personalVip/addVip?tab=${current.value}&idcType=${baseFormData.value.idcType}` 559 url: `/personalVip/addVip?tab=${current.value}&idcType=${baseFormData.value.idcType}`
517 }); 560 });
518 }, 561 },
519 fail: function() { 562 onCancel: function() {
520 uni.reLaunch({ 563 uni.reLaunch({
521 url: `/pages/index/home` 564 url: `/pages/index/daoGuanPerson`
522 }) 565 })
523 } 566 }
524 }) 567 })
525 568
526 }) 569 })
527 }
528 } 570 }
529 }); 571 });
530 } 572 }
...@@ -662,7 +704,6 @@ ...@@ -662,7 +704,6 @@
662 opacity: 0; 704 opacity: 0;
663 } 705 }
664 706
665
666 :deep(.item-text-overflow) { 707 :deep(.item-text-overflow) {
667 text-align: left; 708 text-align: left;
668 } 709 }
...@@ -676,4 +717,74 @@ ...@@ -676,4 +717,74 @@
676 :deep(.fixUniFormItemStyle .uni-data-picker__text) { 717 :deep(.fixUniFormItemStyle .uni-data-picker__text) {
677 text-align: left !important; 718 text-align: left !important;
678 } 719 }
720
721 .custom-modal-mask {
722 position: fixed;
723 top: 0;
724 left: 0;
725 right: 0;
726 bottom: 0;
727 z-index: 9999;
728 background: rgba(0, 0, 0, 0.5);
729 display: flex;
730 align-items: center;
731 justify-content: center;
732 }
733
734 .custom-modal {
735 width: 600rpx;
736 background: #fff;
737 border-radius: 20rpx;
738 padding: 40rpx 30rpx;
739 box-sizing: border-box;
740 text-align: center;
741 box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.2);
742 }
743
744 .custom-modal-title {
745 font-size: 36rpx;
746 font-weight: 600;
747 color: #333;
748 margin-bottom: 30rpx;
749 }
750
751 .custom-modal-content {
752 font-size: 30rpx;
753 color: #666;
754 line-height: 1.6;
755 margin-bottom: 40rpx;
756 word-break: break-word;
757 }
758
759 .custom-modal-btns {
760 display: flex;
761 justify-content: space-between;
762 gap: 20rpx;
763 }
764
765 .custom-modal-cancel,
766 .custom-modal-confirm {
767 flex: 1;
768 height: 80rpx;
769 line-height: 80rpx;
770 border-radius: 40rpx;
771 font-size: 32rpx;
772 border: none;
773 margin: 0;
774 padding: 0;
775
776 &::after {
777 border: none;
778 }
779 }
780
781 .custom-modal-cancel {
782 background: #f5f5f5;
783 color: #666;
784 }
785
786 .custom-modal-confirm {
787 background: #C4121B;
788 color: #fff;
789 }
679 </style> 790 </style>
......
...@@ -107,6 +107,18 @@ ...@@ -107,6 +107,18 @@
107 </view> 107 </view>
108 </view> 108 </view>
109 109
110 <!-- 自定义退款确认弹窗 -->
111 <view v-if="showRefundPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeRefundPopup">
112 <view class="custom-modal" @click.stop>
113 <view class="modal-title">提示</view>
114 <view class="modal-content">{{ refundModalContent }}</view>
115 <view class="modal-btns">
116 <button class="modal-btn-cancel" @click="closeRefundPopup">取消</button>
117 <button class="modal-btn-confirm" @click="confirmRefund">确定</button>
118 </view>
119 </view>
120 </view>
121
110 <!-- 票据信息弹窗(级位/段位/越段考试) --> 122 <!-- 票据信息弹窗(级位/段位/越段考试) -->
111 <view v-if="showInvoicePopup" class="invoice-popup-mask" @click="closeInvoicePopup"> 123 <view v-if="showInvoicePopup" class="invoice-popup-mask" @click="closeInvoicePopup">
112 <view class="invoice-popup-content" @click.stop> 124 <view class="invoice-popup-content" @click.stop>
...@@ -185,6 +197,7 @@ const queryParams = reactive({ ...@@ -185,6 +197,7 @@ const queryParams = reactive({
185 // 弹窗控制 197 // 弹窗控制
186 const showDelPopup = ref(false); 198 const showDelPopup = ref(false);
187 const showCancelPopup = ref(false); 199 const showCancelPopup = ref(false);
200 const showRefundPopup = ref(false);
188 const isPopupOpen = ref(false); 201 const isPopupOpen = ref(false);
189 const showInvoicePopup = ref(false); 202 const showInvoicePopup = ref(false);
190 const invoiceData = ref({}); 203 const invoiceData = ref({});
...@@ -192,6 +205,7 @@ const invoiceData = ref({}); ...@@ -192,6 +205,7 @@ const invoiceData = ref({});
192 // 弹窗内容 205 // 弹窗内容
193 const delModalContent = ref(''); 206 const delModalContent = ref('');
194 const cancelModalContent = ref(''); 207 const cancelModalContent = ref('');
208 const refundModalContent = ref('');
195 209
196 // 当前操作的订单 210 // 当前操作的订单
197 const currentOrder = ref(null); 211 const currentOrder = ref(null);
...@@ -491,19 +505,23 @@ const confirmCancel = async () => { ...@@ -491,19 +505,23 @@ const confirmCancel = async () => {
491 }; 505 };
492 506
493 const handleRefund = async (item) => { 507 const handleRefund = async (item) => {
494 const { confirm } = await uni.showModal({ 508 currentOrder.value = item
495 title: '提示', 509 refundModalContent.value = `缴费编号为"${item.wfCode}"的订单是否确认退款?`
496 content: `缴费编号为"${item.wfCode}"的订单是否确认退款?` 510 showRefundPopup.value = true
497 }) 511 isPopupOpen.value = true
498 if (!confirm) return 512 }
513
514 const confirmRefund = async () => {
515 if (!currentOrder.value) return
499 try { 516 try {
500 uni.showLoading({ title: '处理中...' }) 517 uni.showLoading({ title: '处理中...' })
501 await api.refundOrder(item.id) 518 await api.refundOrder(currentOrder.value.id)
502 uni.showToast({ title: '操作成功', icon: 'success' }) 519 uni.showToast({ title: '操作成功', icon: 'success' })
503 pageNum.value = 1 520 pageNum.value = 1
504 list.value = [] 521 list.value = []
505 hasMore.value = true 522 hasMore.value = true
506 await initData() 523 await initData()
524 closeRefundPopup()
507 } catch (e) { 525 } catch (e) {
508 uni.showToast({ title: '退款失败', icon: 'none' }) 526 uni.showToast({ title: '退款失败', icon: 'none' })
509 } finally { 527 } finally {
...@@ -518,6 +536,13 @@ const closeCancelPopup = () => { ...@@ -518,6 +536,13 @@ const closeCancelPopup = () => {
518 currentOrder.value = null; 536 currentOrder.value = null;
519 }; 537 };
520 538
539 const closeRefundPopup = () => {
540 showRefundPopup.value = false;
541 isPopupOpen.value = false;
542 refundModalContent.value = '';
543 currentOrder.value = null;
544 };
545
521 // 关闭发票弹窗 546 // 关闭发票弹窗
522 const closeInvoicePopup = () => { 547 const closeInvoicePopup = () => {
523 showInvoicePopup.value = false; 548 showInvoicePopup.value = false;
...@@ -934,7 +959,7 @@ const goToDetail = (item) => { ...@@ -934,7 +959,7 @@ const goToDetail = (item) => {
934 .btn { 959 .btn {
935 width: 140rpx; 960 width: 140rpx;
936 height: 48rpx; 961 height: 48rpx;
937 line-height: 46rpx; 962 line-height: 44rpx;
938 padding: 0; 963 padding: 0;
939 border-radius: 10rpx; 964 border-radius: 10rpx;
940 font-size: 24rpx; 965 font-size: 24rpx;
......
...@@ -62,15 +62,15 @@ ...@@ -62,15 +62,15 @@
62 <view class="summary-row"> 62 <view class="summary-row">
63 <view class="summary-item"> 63 <view class="summary-item">
64 <text class="summary-label">人数合计</text> 64 <text class="summary-label">人数合计</text>
65 <text class="summary-value">{{ item.allCount || 0 }}</text> 65 <text class="summary-value">{{ item.allCount ? item.allCount +'人' : '/' }}</text>
66 </view> 66 </view>
67 <view class="summary-item"> 67 <view class="summary-item">
68 <text class="summary-label">新会员合计</text> 68 <text class="summary-label">新会员合计</text>
69 <text class="summary-value">{{ item.newCount || 0 }}</text> 69 <text class="summary-value">{{ item.newCount ? item.newCount + '人' : '/' }}</text>
70 </view> 70 </view>
71 <view class="summary-item"> 71 <view class="summary-item">
72 <text class="summary-label">年限合计</text> 72 <text class="summary-label">年限合计</text>
73 <text class="summary-value">{{ item.yearCount || 0 }}</text> 73 <text class="summary-value">{{ item.yearCount ? item.yearCount +'年' : '/' }}</text>
74 </view> 74 </view>
75 </view> 75 </view>
76 76
...@@ -592,10 +592,12 @@ onUnmounted(() => { ...@@ -592,10 +592,12 @@ onUnmounted(() => {
592 align-items: center; 592 align-items: center;
593 margin-top: 14rpx; 593 margin-top: 14rpx;
594 padding: 16rpx 0 0; 594 padding: 16rpx 0 0;
595 border-top: 1rpx dashed #f0f0f0; 595 // border-top: 1rpx dashed #f0f0f0;
596 margin-bottom: 10rpx; 596 margin-bottom: 10rpx;
597 padding-bottom: 14rpx; 597 padding-bottom: 14rpx;
598 border-bottom: 1rpx dashed #f0f0f0; 598 // border-bottom: 1rpx dashed #f0f0f0;
599 border: 20rpx;
600 background-color: #f0f0f0;
599 } 601 }
600 602
601 .summary-item { 603 .summary-item {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!