a3ab5d87 by lttnew

去支付

1 parent 10c86415
...@@ -1702,14 +1702,16 @@ export function goPay(params) { ...@@ -1702,14 +1702,16 @@ export function goPay(params) {
1702 1702
1703 1703
1704 // 再次支付 1704 // 再次支付
1705 export function payForOrder(params) { 1705 export function payForOrder(params) {
1706 let url = `/common/order/payForOrder/${params.id}` 1706 let url = `/common/order/payForOrder/${params.id}`
1707 const queryParams = [] 1707 const queryParams = []
1708 if (params.id) queryParams.push(`id=${params.id}`) 1708 if (params.id) queryParams.push(`id=${encodeURIComponent(params.id)}`)
1709 if (params.payType) queryParams.push(`payType=${params.payType}`) 1709 if (params.payType) queryParams.push(`payType=${encodeURIComponent(params.payType)}`)
1710 if (queryParams.length > 0) { 1710 if (params.contactPerson) queryParams.push(`contactPerson=${encodeURIComponent(params.contactPerson)}`)
1711 url += '?' + queryParams.join('&') 1711 if (params.contactTel) queryParams.push(`contactTel=${encodeURIComponent(params.contactTel)}`)
1712 } 1712 if (queryParams.length > 0) {
1713 url += '?' + queryParams.join('&')
1714 }
1713 return request({ 1715 return request({
1714 url, 1716 url,
1715 method: 'post', 1717 method: 'post',
......
1 // dev 1 // dev
2 const baseUrl_api = 'http://192.168.1.134:8787' 2 const baseUrl_api = 'http://192.168.1.222: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'
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
17 v-model="queryParams.wfCode" 17 v-model="queryParams.wfCode"
18 :input-border="false" 18 :input-border="false"
19 class="search-input" 19 class="search-input"
20 placeholder="输入订单编号/名称/单位/日期" 20 placeholder="输入缴费编号查询"
21 placeholderStyle="font-size:28rpx;color:#999" 21 placeholderStyle="font-size:28rpx;color:#999"
22 prefixIcon="search" 22 prefixIcon="search"
23 @blur="handelSearch" 23 @blur="handelSearch"
...@@ -229,31 +229,15 @@ ...@@ -229,31 +229,15 @@
229 </view> 229 </view>
230 </view> 230 </view>
231 </view> 231 </view>
232
233 <!-- 缴费方式 -->
234 <!-- <view class="pay-way-row">
235 <text class="pay-way-label">缴费方式:</text>
236 <text class="pay-way-value">{{ item.payType == '3' ? '对公转账' : '民生付' }}</text>
237 </view> -->
238
239 <!-- 按钮组:靠右展示 -->
240 <view class="btn-group"> 232 <view class="btn-group">
241 <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> 233
242 <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2 &&item.price>0"> 234 <button :class="{ disabled: isPayDisabled(item) }" :disabled="isPayDisabled(item)" class="btn btn-pay" @click.stop="handlePay(item)">支付</button>
243 <button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice" 235 <button :class="{ disabled: isCancelDisabled(item) }" :disabled="isCancelDisabled(item)" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button>
244 @click.stop="makeInvoiceFN(item)"> 236 <template v-if="!hasInvoice(item)">
245 申请开票 237 <button :class="{ disabled: isInvoiceDisabled(item) }" :disabled="isInvoiceDisabled(item)" class="btn btn-view-invoice" @click.stop="makeInvoiceFN(item)">申请开票</button>
246 </button>
247 </template>
248 <!-- 已申请票据:查看票据 -->
249 <template v-if="item.invoiceStatus == 1">
250 <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看票据</button>
251 </template> 238 </template>
252 <!-- 未缴费:去缴费 + 取消订单 --> 239 <template v-else>
253 <template v-if="item.payStatus == 0"> 240 <button class="btn btn-invoice" @click.stop="viewInvoice(item)">查看发票</button>
254 <!-- 支付按钮:仅 auditStatus==='0' && payStatus==='0' 时可点 -->
255 <button :disabled="!(item.auditStatus == '0' && item.payStatus == 0)" class="btn btn-pay" @click.stop="handlePay(item)">去支付</button>
256 <button :disabled="item.payStatus != 0" class="btn btn-cancel" @click.stop="handleCancel(item)">取消订单</button>
257 </template> 241 </template>
258 </view> 242 </view>
259 </view> 243 </view>
...@@ -542,6 +526,46 @@ const filterType = (row) => { ...@@ -542,6 +526,46 @@ const filterType = (row) => {
542 if (row == 4) return '越位考试办理' 526 if (row == 4) return '越位考试办理'
543 } 527 }
544 528
529 const getRowType = (item) => String(item?.type ?? currentTab.value)
530
531 const isPersonalOrder = (item) => getRowType(item) === '0'
532
533 const isGroupOrder = (item) => getRowType(item) === '1'
534
535 const isPayDisabled = (item) => {
536 if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9'
537 if (String(item?.payStatus) !== '0') return true
538 return String(item?.auditStatus) !== '0'
539 }
540
541 const isCancelDisabled = (item) => {
542 if (isPersonalOrder(item)) return String(item?.auditStatus) !== '9'
543 if (String(item?.payStatus) !== '0') return true
544 return false
545 }
546
547 const hasInvoice = (item) => String(item?.invoiceStatus) === '1'
548
549 const isInvoiceDisabled = (item) => {
550 if (hasInvoice(item)) return true
551 if (isPersonalOrder(item)) return String(item?.auditStatus) !== '2'
552 return String(item?.payStatus) !== '1' || String(item?.auditStatus) !== '2' || Number(item?.price || 0) <= 0
553 }
554
555 const encodeQueryValue = (value) => encodeURIComponent(value || '')
556
557 const getPayName = (item) => {
558 return item?.orderName || item?.content?.orderName || item?.payDeptName || item?.payMemName || item?.content?.payDeptName || item?.content?.payMemName || item?.memberName || item?.content?.memberName || ''
559 }
560
561 const getAssoName = (item) => {
562 return item?.assoName || item?.associateName || item?.associationName || item?.aname || item?.parentName || item?.content?.assoName || item?.content?.associateName || item?.content?.associationName || item?.content?.aname || item?.content?.parentName || ''
563 }
564
565 const buildPayInfoQuery = (item) => {
566 return `payName=${encodeQueryValue(getPayName(item))}&assoName=${encodeQueryValue(getAssoName(item))}`
567 }
568
545 569
546 // 数据请求核心方法 570 // 数据请求核心方法
547 const initData = async () => { 571 const initData = async () => {
...@@ -617,7 +641,7 @@ const confirmDel = async () => { ...@@ -617,7 +641,7 @@ const confirmDel = async () => {
617 641
618 const goToDetail = (item) => { 642 const goToDetail = (item) => {
619 const form = encodeURIComponent(JSON.stringify(item)) 643 const form = encodeURIComponent(JSON.stringify(item))
620 switch (currentTab.value) { 644 switch (getRowType(item)) {
621 case '1': 645 case '1':
622 uni.navigateTo({url: `/group/groupOrderDetail?form=${form}`}); 646 uni.navigateTo({url: `/group/groupOrderDetail?form=${form}`});
623 break; 647 break;
...@@ -641,13 +665,27 @@ const closeDelPopup = () => { ...@@ -641,13 +665,27 @@ const closeDelPopup = () => {
641 currentOrder.value = null; 665 currentOrder.value = null;
642 }; 666 };
643 667
644 // 去缴费 - 跳转到单位会员支付页面 668 // 去支付:个人会员订单走 payOrder,再次支付携带 common/order 的 id;单位会员订单走 goPay。
645 const handlePay = async (item) => { 669 const handlePay = async (item) => {
646 if (item.payStatus !== 0) return; 670 if (isPayDisabled(item)) return;
647 // 跳转到单位会员支付页面 671 const payInfoQuery = buildPayInfoQuery(item)
648 uni.navigateTo({ 672
649 url: `/myCenter/goPay?orderId=${item.id}&renewYear=${item.content?.yearCount || 1}` 673 if (isPersonalOrder(item)) {
650 }); 674 const rangeId = item.sourceId || item.rangId || ''
675 uni.navigateTo({
676 url: `/myCenter/payOrder?orderId=${item.id}&rangeId=${rangeId}&${payInfoQuery}`
677 });
678 return;
679 }
680
681 if (isGroupOrder(item)) {
682 uni.navigateTo({
683 url: `/myCenter/goPay?orderId=${item.id}&renewYear=${item.content?.yearCount || 1}&${payInfoQuery}`
684 });
685 return;
686 }
687
688 uni.navigateTo({url: `/pages/rank/applyDetail?examId=${item.sourceId || item.id}&type=${getRowType(item)}`});
651 }; 689 };
652 690
653 // 申请开票 691 // 申请开票
...@@ -715,7 +753,7 @@ const closeInvoiceWebview = () => { ...@@ -715,7 +753,7 @@ const closeInvoiceWebview = () => {
715 // 取消订单 753 // 取消订单
716 const handleCancel = (item) => { 754 const handleCancel = (item) => {
717 currentOrder.value = item; 755 currentOrder.value = item;
718 cancelModalContent.value = `是否确认取消订单编号为"${item.tradeNo}"的订单?`; 756 cancelModalContent.value = `是否确认取消缴费编号为"${item.wfCode}"的订单?`;
719 showCancelPopup.value = true; 757 showCancelPopup.value = true;
720 isPopupOpen.value = true; 758 isPopupOpen.value = true;
721 }; 759 };
...@@ -1204,9 +1242,13 @@ const onTabSwitch = (index, url) => { ...@@ -1204,9 +1242,13 @@ const onTabSwitch = (index, url) => {
1204 //border: none; 1242 //border: none;
1205 border: 1rpx solid #c30d23; 1243 border: 1rpx solid #c30d23;
1206 } 1244 }
1207 1245
1208 &:disabled { 1246 &.disabled,
1209 opacity: 0.6; 1247 &[disabled] {
1248 background: #f5f5f5 !important;
1249 color: #b8b8b8 !important;
1250 border: 1rpx solid #e1e1e1 !important;
1251 opacity: 1;
1210 pointer-events: none; 1252 pointer-events: none;
1211 } 1253 }
1212 } 1254 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!