去支付
Showing
5 changed files
with
424 additions
and
158 deletions
| ... | @@ -1705,8 +1705,10 @@ export function goPay(params) { | ... | @@ -1705,8 +1705,10 @@ export function goPay(params) { |
| 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 (params.contactPerson) queryParams.push(`contactPerson=${encodeURIComponent(params.contactPerson)}`) | ||
| 1711 | if (params.contactTel) queryParams.push(`contactTel=${encodeURIComponent(params.contactTel)}`) | ||
| 1710 | if (queryParams.length > 0) { | 1712 | if (queryParams.length > 0) { |
| 1711 | url += '?' + queryParams.join('&') | 1713 | url += '?' + queryParams.join('&') |
| 1712 | } | 1714 | } | ... | ... |
| 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' | ... | ... |
| 1 | <template> | 1 | <template> |
| 2 | <view class="pay-order-container"> | 2 | <view class="pay-order-container"> |
| 3 | <!-- 页面头部 --> | ||
| 4 | <view class="page-header"> | ||
| 5 | <text class="title">确认并支付</text> | ||
| 6 | </view> | ||
| 7 | 3 | ||
| 8 | <!-- 订单核心信息 --> | 4 | <!-- 订单核心信息 --> |
| 9 | <view class="order-info"> | 5 | <view class="order-info"> |
| 10 | <view class="info-item"> | 6 | <view class="info-item"> |
| 7 | <text class="label">缴费单位:</text> | ||
| 8 | <text class="value normal">{{ displayPayName }}</text> | ||
| 9 | </view> | ||
| 10 | <view class="info-item"> | ||
| 11 | <text class="label">所属协会:</text> | ||
| 12 | <text class="value normal">{{ displayAssoName }}</text> | ||
| 13 | </view> | ||
| 14 | <view class="info-item"> | ||
| 11 | <text class="label">人数合计:</text> | 15 | <text class="label">人数合计:</text> |
| 12 | <text class="value red">{{ formData.all ?? 0 }}人</text> | 16 | <text class="value red">{{ formData.all ?? 0 }}人</text> |
| 13 | </view> | 17 | </view> |
| ... | @@ -30,13 +34,13 @@ | ... | @@ -30,13 +34,13 @@ |
| 30 | <view class="section-title">选择支付方式</view> | 34 | <view class="section-title">选择支付方式</view> |
| 31 | <view class="payment-methods"> | 35 | <view class="payment-methods"> |
| 32 | <radio-group @change="handlePayTypeChange"> | 36 | <radio-group @change="handlePayTypeChange"> |
| 33 | <label :class="{ selected: payType === '1' }" class="payment-item"> | 37 | <label :class="{ selected: payType === '0' }" class="payment-item"> |
| 34 | <radio :checked="payType =='0'" value="0"/> | 38 | <radio :checked="payType =='0'" value="0"/> |
| 35 | <image :src="config.baseUrl_api + '/fs/static/min.png'" class="icon ml10" mode="widthFix"></image> | 39 | <image :src="config.baseUrl_api + '/fs/static/min.png'" class="icon ml10" mode="widthFix"></image> |
| 36 | <text class="pay-name ml10">民生付</text> | 40 | <text class="pay-name ml10">民生付</text> |
| 37 | </label> | 41 | </label> |
| 38 | <label :class="{ selected: payType === '3' }" class="payment-item"> | 42 | <label :class="{ selected: payType === '3' }" class="payment-item"> |
| 39 | <radio :checked="payType === '3'" value="1"/> | 43 | <radio :checked="payType === '3'" value="3"/> |
| 40 | <image :src="config.baseUrl_api + '/fs/static/min.png'" class="icon ml10" mode="widthFix"></image> | 44 | <image :src="config.baseUrl_api + '/fs/static/min.png'" class="icon ml10" mode="widthFix"></image> |
| 41 | <text class="pay-name ml10">对公转账</text> | 45 | <text class="pay-name ml10">对公转账</text> |
| 42 | </label> | 46 | </label> |
| ... | @@ -65,6 +69,7 @@ | ... | @@ -65,6 +69,7 @@ |
| 65 | 69 | ||
| 66 | <script setup> | 70 | <script setup> |
| 67 | import { | 71 | import { |
| 72 | computed, | ||
| 68 | ref | 73 | ref |
| 69 | } from 'vue' | 74 | } from 'vue' |
| 70 | import { | 75 | import { |
| ... | @@ -77,32 +82,118 @@ import {minShengPay} from "@/common/pay"; | ... | @@ -77,32 +82,118 @@ import {minShengPay} from "@/common/pay"; |
| 77 | // 核心数据 | 82 | // 核心数据 |
| 78 | const formData = ref({}) // 订单统计数据 | 83 | const formData = ref({}) // 订单统计数据 |
| 79 | const rangeId = ref('') // 核心业务ID | 84 | const rangeId = ref('') // 核心业务ID |
| 85 | const orderId = ref('') // common/order 订单ID,用于订单列表再次支付 | ||
| 86 | const payName = ref('') | ||
| 87 | const assoName = ref('') | ||
| 80 | const payType = ref('0') // 支付方式(默认0=民生付) | 88 | const payType = ref('0') // 支付方式(默认0=民生付) |
| 81 | const payLoading = ref(false) // 支付按钮加载状态 | 89 | const payLoading = ref(false) // 支付按钮加载状态 |
| 82 | const form = ref({ | 90 | const form = ref({ |
| 83 | contactPerson: '', | 91 | contactPerson: '', |
| 84 | contactTel: '' | 92 | contactTel: '' |
| 85 | }) | 93 | }) |
| 94 | const app = getApp() | ||
| 95 | const memberInfo = app.globalData?.memberInfo || {} | ||
| 96 | const deptInfo = app.globalData?.dept || app.globalData?.userInfo?.dept || {} | ||
| 97 | |||
| 98 | const pickFirst = (...values) => { | ||
| 99 | const value = values.find(item => item !== undefined && item !== null && String(item).trim() !== '') | ||
| 100 | return value ? String(value) : '' | ||
| 101 | } | ||
| 102 | |||
| 103 | const displayPayName = computed(() => { | ||
| 104 | return pickFirst( | ||
| 105 | memberInfo.name, | ||
| 106 | memberInfo.deptName, | ||
| 107 | deptInfo.deptName, | ||
| 108 | formData.value.orderName, | ||
| 109 | formData.value.payDeptName, | ||
| 110 | formData.value.payMemName, | ||
| 111 | formData.value.memberName, | ||
| 112 | payName.value, | ||
| 113 | formData.value.memName | ||
| 114 | ) || '-' | ||
| 115 | }) | ||
| 116 | |||
| 117 | const displayAssoName = computed(() => { | ||
| 118 | return pickFirst( | ||
| 119 | deptInfo.aname, | ||
| 120 | deptInfo.associateName, | ||
| 121 | memberInfo.aname, | ||
| 122 | memberInfo.associateName, | ||
| 123 | memberInfo.assoName, | ||
| 124 | formData.value.assoName, | ||
| 125 | formData.value.associateName, | ||
| 126 | formData.value.associationName, | ||
| 127 | formData.value.aname, | ||
| 128 | formData.value.parentName, | ||
| 129 | assoName.value | ||
| 130 | ) || '-' | ||
| 131 | }) | ||
| 86 | 132 | ||
| 87 | // 页面加载接收参数 | 133 | // 页面加载接收参数 |
| 88 | onLoad(async (options) => { | 134 | onLoad(async (options) => { |
| 89 | console.log('订单ID:', options.rangeId) | 135 | console.log('缴费范围ID:', options.rangeId, '订单ID:', options.orderId) |
| 136 | payName.value = decodeURIComponent(options.payName || '') | ||
| 137 | assoName.value = decodeURIComponent(options.assoName || '') | ||
| 138 | if (options.orderId) { | ||
| 139 | orderId.value = options.orderId | ||
| 140 | } | ||
| 90 | if (options.rangeId) { | 141 | if (options.rangeId) { |
| 91 | rangeId.value = options.rangeId | 142 | rangeId.value = options.rangeId |
| 92 | await getCount() | 143 | await getCount() |
| 93 | } | 144 | } |
| 145 | if (options.orderId) { | ||
| 146 | await getOrderDetail() | ||
| 147 | } | ||
| 94 | }) | 148 | }) |
| 95 | 149 | ||
| 96 | async function getCount() { | 150 | async function getCount() { |
| 97 | try { | 151 | try { |
| 98 | const res = await api.getNewCountByRangeId(rangeId.value) | 152 | const res = await api.getNewCountByRangeId(rangeId.value) |
| 99 | formData.value = res.data || { | 153 | formData.value = { |
| 154 | ...formData.value, | ||
| 155 | ...(res.data || { | ||
| 156 | all: 0, | ||
| 157 | new: 0, | ||
| 158 | old: 0 | ||
| 159 | }) | ||
| 160 | } | ||
| 161 | } catch (e) { | ||
| 162 | formData.value = { | ||
| 163 | ...formData.value, | ||
| 100 | all: 0, | 164 | all: 0, |
| 101 | new: 0, | 165 | new: 0, |
| 102 | old: 0 | 166 | old: 0 |
| 103 | } | 167 | } |
| 168 | } | ||
| 169 | } | ||
| 170 | |||
| 171 | async function getOrderDetail() { | ||
| 172 | try { | ||
| 173 | const res = await api.orderDetail(orderId.value) | ||
| 174 | const data = res.data || {} | ||
| 175 | let content = {} | ||
| 176 | if (data.content) { | ||
| 177 | try { | ||
| 178 | content = typeof data.content === 'string' ? JSON.parse(data.content) : data.content | ||
| 179 | } catch (e) { | ||
| 180 | content = {} | ||
| 181 | } | ||
| 182 | } | ||
| 183 | formData.value = { | ||
| 184 | ...formData.value, | ||
| 185 | ...data, | ||
| 186 | ...content, | ||
| 187 | all: content.allPersonCount ?? data.allCount ?? data.all ?? 0, | ||
| 188 | new: content.newPersonCount ?? data.newCount ?? data.new ?? 0, | ||
| 189 | old: content.renewPersonCount ?? data.oldCount ?? data.old ?? 0, | ||
| 190 | price: data.price ?? content.price ?? 0 | ||
| 191 | } | ||
| 192 | payName.value = pickFirst(data.orderName, content.orderName, data.payDeptName, data.payMemName, content.payDeptName, content.payMemName, data.memberName, content.memberName, payName.value) | ||
| 193 | assoName.value = pickFirst(data.assoName, data.associateName, data.associationName, data.aname, data.parentName, content.assoName, content.associateName, content.associationName, content.aname, content.parentName, assoName.value) | ||
| 104 | } catch (e) { | 194 | } catch (e) { |
| 105 | formData.value = { | 195 | formData.value = { |
| 196 | ...formData.value, | ||
| 106 | all: 0, | 197 | all: 0, |
| 107 | new: 0, | 198 | new: 0, |
| 108 | old: 0 | 199 | old: 0 |
| ... | @@ -112,7 +203,7 @@ async function getCount() { | ... | @@ -112,7 +203,7 @@ async function getCount() { |
| 112 | 203 | ||
| 113 | // 支付方式切换 | 204 | // 支付方式切换 |
| 114 | function handlePayTypeChange(e) { | 205 | function handlePayTypeChange(e) { |
| 115 | payType.value = e.detail.value == '0' ? '0' : '3' | 206 | payType.value = e.detail.value |
| 116 | console.log('支付方式:', payType.value) | 207 | console.log('支付方式:', payType.value) |
| 117 | if (payType.value === '3') { | 208 | if (payType.value === '3') { |
| 118 | form.value.contactPerson = '' | 209 | form.value.contactPerson = '' |
| ... | @@ -123,7 +214,7 @@ function handlePayTypeChange(e) { | ... | @@ -123,7 +214,7 @@ function handlePayTypeChange(e) { |
| 123 | // 立即支付核心逻辑 | 214 | // 立即支付核心逻辑 |
| 124 | async function handlePay() { | 215 | async function handlePay() { |
| 125 | // 基础校验 | 216 | // 基础校验 |
| 126 | if (!rangeId.value || rangeId.value === '-1') { | 217 | if ((!rangeId.value && !orderId.value) || rangeId.value === '-1') { |
| 127 | return uni.showToast({ | 218 | return uni.showToast({ |
| 128 | title: '订单ID异常', | 219 | title: '订单ID异常', |
| 129 | icon: 'none' | 220 | icon: 'none' |
| ... | @@ -153,7 +244,7 @@ async function handlePay() { | ... | @@ -153,7 +244,7 @@ async function handlePay() { |
| 153 | 244 | ||
| 154 | // 构建请求参数 | 245 | // 构建请求参数 |
| 155 | const params = { | 246 | const params = { |
| 156 | id: rangeId.value, | 247 | id: orderId.value || rangeId.value, |
| 157 | payType: payType.value | 248 | payType: payType.value |
| 158 | } | 249 | } |
| 159 | if (payType.value === '3') { | 250 | if (payType.value === '3') { |
| ... | @@ -161,7 +252,7 @@ async function handlePay() { | ... | @@ -161,7 +252,7 @@ async function handlePay() { |
| 161 | params.contactTel = form.value.contactTel | 252 | params.contactTel = form.value.contactTel |
| 162 | } | 253 | } |
| 163 | 254 | ||
| 164 | const res = await api.goPay(params) | 255 | const res = orderId.value ? await api.payForOrder(params) : await api.goPay(params) |
| 165 | const resData = res.data | 256 | const resData = res.data |
| 166 | 257 | ||
| 167 | // 对公转账 - 跳转转账信息页面 | 258 | // 对公转账 - 跳转转账信息页面 |
| ... | @@ -230,6 +321,8 @@ async function handlePay() { | ... | @@ -230,6 +321,8 @@ async function handlePay() { |
| 230 | // 订单信息区域 | 321 | // 订单信息区域 |
| 231 | .order-info { | 322 | .order-info { |
| 232 | margin-bottom: 60rpx; | 323 | margin-bottom: 60rpx; |
| 324 | border-top: 1px solid #f5f5f5; | ||
| 325 | border-bottom: 1px solid #f5f5f5; | ||
| 233 | 326 | ||
| 234 | .info-item { | 327 | .info-item { |
| 235 | display: flex; | 328 | display: flex; |
| ... | @@ -241,11 +334,19 @@ async function handlePay() { | ... | @@ -241,11 +334,19 @@ async function handlePay() { |
| 241 | 334 | ||
| 242 | .label { | 335 | .label { |
| 243 | color: #666; | 336 | color: #666; |
| 337 | flex-shrink: 0; | ||
| 244 | } | 338 | } |
| 245 | 339 | ||
| 246 | .value { | 340 | .value { |
| 247 | font-weight: 600; | 341 | font-weight: 600; |
| 248 | font-size: 34rpx; | 342 | font-size: 34rpx; |
| 343 | text-align: right; | ||
| 344 | word-break: break-all; | ||
| 345 | } | ||
| 346 | |||
| 347 | .normal { | ||
| 348 | color: #111; | ||
| 349 | font-size: 30rpx; | ||
| 249 | } | 350 | } |
| 250 | 351 | ||
| 251 | .red { | 352 | .red { | ... | ... |
| ... | @@ -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) |
| 672 | |||
| 673 | if (isPersonalOrder(item)) { | ||
| 674 | const rangeId = item.sourceId || item.rangId || '' | ||
| 648 | uni.navigateTo({ | 675 | uni.navigateTo({ |
| 649 | url: `/myCenter/goPay?orderId=${item.id}&renewYear=${item.content?.yearCount || 1}` | 676 | url: `/myCenter/payOrder?orderId=${item.id}&rangeId=${rangeId}&${payInfoQuery}` |
| 650 | }); | 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 | }; |
| ... | @@ -1205,8 +1243,12 @@ const onTabSwitch = (index, url) => { | ... | @@ -1205,8 +1243,12 @@ const onTabSwitch = (index, url) => { |
| 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 | } | ... | ... |
| ... | @@ -11,8 +11,8 @@ | ... | @@ -11,8 +11,8 @@ |
| 11 | placeholderStyle="font-size:30rpx;color:#999" | 11 | placeholderStyle="font-size:30rpx;color:#999" |
| 12 | :input-border="false" | 12 | :input-border="false" |
| 13 | prefixIcon="search" | 13 | prefixIcon="search" |
| 14 | v-model="queryParams.memName" | 14 | v-model="queryParams.wfCode" |
| 15 | placeholder="搜索缴费名称" | 15 | placeholder="搜索缴费编号" |
| 16 | @blur="getList" | 16 | @blur="getList" |
| 17 | @clear="getList"> | 17 | @clear="getList"> |
| 18 | </uni-easyinput> | 18 | </uni-easyinput> |
| ... | @@ -37,55 +37,64 @@ | ... | @@ -37,55 +37,64 @@ |
| 37 | <view class="scroll-content"> | 37 | <view class="scroll-content"> |
| 38 | <!-- 会员缴费列表 --> | 38 | <!-- 会员缴费列表 --> |
| 39 | <view class="list-container" v-if="list.length > 0"> | 39 | <view class="list-container" v-if="list.length > 0"> |
| 40 | <view class="list-item" v-for="(item, index) in list" :key="index" @click="goDetail(item)"> | 40 | <view class="order-card-new" v-for="(item, index) in list" :key="index" @click="goDetail(item)"> |
| 41 | <view class="item-header"> | 41 | <view class="card-header"> |
| 42 | <view class="left-info"> | 42 | <view class="date"> |
| 43 | <text class="mem-name">{{ item.memName }}</text> | 43 | <view class="data-header"> |
| 44 | <text class="wf-code" v-if="item.wfCode">{{ item.wfCode }}</text> | 44 | <text class="member-label">{{ item.memName }}·</text> |
| 45 | <text class="value">{{ item.wfCode || '——' }}</text> | ||
| 45 | </view> | 46 | </view> |
| 46 | <view class="status-badge" :class="getStatusClass(item.auditStatus)"> | ||
| 47 | {{ getStatusText(item.auditStatus) }} | ||
| 48 | </view> | 47 | </view> |
| 48 | <view class="price"> | ||
| 49 | <view :class="getStatusClass(item.auditStatus)">{{ getStatusText(item.auditStatus) }}</view> | ||
| 50 | </view> | ||
| 51 | </view> | ||
| 52 | |||
| 53 | <view class="member-time"> | ||
| 54 | <view class="label"> | ||
| 55 | <!-- <text class="star">★</text> | ||
| 56 | {{ item.memName || '——' }} --> | ||
| 57 | <view v-if="item.commitTime" class="pay-name">提交时间:{{ formatDate(item.commitTime) }}</view> | ||
| 49 | </view> | 58 | </view> |
| 50 | 59 | ||
| 51 | <view class="stats-row"> | ||
| 52 | <view class="stat-item"> | ||
| 53 | <text class="stat-label">人数合计</text> | ||
| 54 | <text class="stat-value">{{ item.allCount || '/' }}</text> | ||
| 55 | </view> | 60 | </view> |
| 56 | <view class="stat-item"> | 61 | |
| 57 | <text class="stat-label">新会员合计</text> | 62 | <view class="summary-row"> |
| 58 | <text class="stat-value">{{ item.newCount || '/' }}</text> | 63 | <view class="summary-item"> |
| 64 | <text class="summary-label">人数合计</text> | ||
| 65 | <text class="summary-value">{{ item.allCount || 0 }}人</text> | ||
| 59 | </view> | 66 | </view> |
| 60 | <view class="stat-item"> | 67 | <view class="summary-item"> |
| 61 | <text class="stat-label">年限合计</text> | 68 | <text class="summary-label">新会员合计</text> |
| 62 | <text class="stat-value">{{ item.yearCount || '/' }}</text> | 69 | <text class="summary-value">{{ item.newCount || 0 }}人</text> |
| 63 | </view> | 70 | </view> |
| 71 | <view class="summary-item"> | ||
| 72 | <text class="summary-label">年限合计</text> | ||
| 73 | <text class="summary-value">{{ item.yearCount || 0 }}年</text> | ||
| 64 | </view> | 74 | </view> |
| 65 | |||
| 66 | <view class="submit-time" v-if="item.commitTime"> | ||
| 67 | <uni-icons type="calendar-filled" size="16" color="#AD181F"></uni-icons> | ||
| 68 | <text class="time-text">{{ item.commitTime }} 提交</text> | ||
| 69 | </view> | 75 | </view> |
| 70 | 76 | ||
| 71 | <view class="action-buttons"> | 77 | <view class="btn-group"> |
| 72 | <button | 78 | <button |
| 73 | class="action-btn delete-btn" | 79 | class="btn btn-cancel" |
| 80 | :class="{ disabled: item.auditStatus == 1 || item.auditStatus == 9 }" | ||
| 74 | @click.stop="handleDel(item)" | 81 | @click.stop="handleDel(item)" |
| 75 | :disabled="item.auditStatus == 1 || item.auditStatus == 9"> | 82 | :disabled="item.auditStatus == 1 || item.auditStatus == 9"> |
| 76 | 删除 | 83 | 删除 |
| 77 | </button> | 84 | </button> |
| 78 | <button | 85 | <button |
| 79 | class="action-btn edit-btn" | 86 | class="btn btn-info" |
| 87 | :class="{ disabled: item.auditStatus != 0 }" | ||
| 80 | @click.stop="handleUpdate(item)" | 88 | @click.stop="handleUpdate(item)" |
| 81 | :disabled="item.auditStatus != 0"> | 89 | :disabled="item.auditStatus != 0"> |
| 82 | 编辑 | 90 | 编辑 |
| 83 | </button> | 91 | </button> |
| 84 | <button | 92 | <button |
| 85 | class="action-btn submit-btn" | 93 | class="btn btn-pay" |
| 94 | :class="{ disabled: isMainActionDisabled(item) }" | ||
| 86 | @click.stop="commitFN(item)" | 95 | @click.stop="commitFN(item)" |
| 87 | :disabled="item.auditStatus != 0&&item.auditStatus != 9"> | 96 | :disabled="isMainActionDisabled(item)"> |
| 88 | 提交审核 | 97 | {{ getMainActionText(item) }} |
| 89 | </button> | 98 | </button> |
| 90 | </view> | 99 | </view> |
| 91 | </view> | 100 | </view> |
| ... | @@ -269,9 +278,45 @@ function handleDel(row) { | ... | @@ -269,9 +278,45 @@ function handleDel(row) { |
| 269 | }) | 278 | }) |
| 270 | } | 279 | } |
| 271 | 280 | ||
| 281 | function getMainActionText(row) { | ||
| 282 | return String(row.auditStatus) === '0' ? '提交审核' : '支付' | ||
| 283 | } | ||
| 284 | |||
| 285 | function isMainActionDisabled(row) { | ||
| 286 | const auditStatus = String(row.auditStatus) | ||
| 287 | return auditStatus === '0' ? false : auditStatus !== '9' | ||
| 288 | } | ||
| 289 | |||
| 290 | function buildPayOrderUrl(row) { | ||
| 291 | const params = [ | ||
| 292 | `rangeId=${encodeURIComponent(row.rangId || '')}`, | ||
| 293 | `payName=${encodeURIComponent(row.memName || '')}`, | ||
| 294 | `assoName=${encodeURIComponent(row.associateName || row.assoName || row.associationName || '')}` | ||
| 295 | ] | ||
| 296 | if (row.orderId) { | ||
| 297 | params.push(`orderId=${encodeURIComponent(row.orderId)}`) | ||
| 298 | } | ||
| 299 | return `/myCenter/payOrder?${params.join('&')}` | ||
| 300 | } | ||
| 301 | |||
| 302 | function formatDate(value) { | ||
| 303 | if (!value) return '——' | ||
| 304 | const text = String(value) | ||
| 305 | const dateText = text.includes('T') ? text.split('T')[0] : text.slice(0, 10) | ||
| 306 | return dateText || '——' | ||
| 307 | } | ||
| 308 | |||
| 272 | function commitFN(row) { | 309 | function commitFN(row) { |
| 310 | if (String(row.auditStatus) !== '0') { | ||
| 311 | openModal('是否确认去支付', () => { | ||
| 312 | uni.navigateTo({ | ||
| 313 | url: buildPayOrderUrl(row) | ||
| 314 | }) | ||
| 315 | }) | ||
| 316 | return | ||
| 317 | } | ||
| 273 | uni.navigateTo({ | 318 | uni.navigateTo({ |
| 274 | url: `/myCenter/payOrder?rangeId=${row.rangId}` | 319 | url: buildPayOrderUrl(row) |
| 275 | }) | 320 | }) |
| 276 | } | 321 | } |
| 277 | 322 | ||
| ... | @@ -289,9 +334,10 @@ function getStatusText(status) { | ... | @@ -289,9 +334,10 @@ function getStatusText(status) { |
| 289 | 1: '审核中', | 334 | 1: '审核中', |
| 290 | 2: '审核通过', | 335 | 2: '审核通过', |
| 291 | 3: '审核拒绝', | 336 | 3: '审核拒绝', |
| 292 | 9: '缴费中' | 337 | 4: '已取消', |
| 338 | 9: '待支付' | ||
| 293 | } | 339 | } |
| 294 | return statusMap[status] || '' | 340 | return statusMap[String(status)] || '' |
| 295 | } | 341 | } |
| 296 | 342 | ||
| 297 | function getStatusClass(status) { | 343 | function getStatusClass(status) { |
| ... | @@ -423,125 +469,200 @@ onUnmounted(() => { | ... | @@ -423,125 +469,200 @@ onUnmounted(() => { |
| 423 | 469 | ||
| 424 | /* 列表 */ | 470 | /* 列表 */ |
| 425 | .list-container { | 471 | .list-container { |
| 426 | padding: 0 30rpx; | 472 | padding: 0 24rpx; |
| 427 | } | 473 | } |
| 428 | .list-item { | 474 | |
| 429 | background: #ffffff; | 475 | .order-card-new { |
| 430 | border-radius: 24rpx; | 476 | background: #fff; |
| 431 | padding: 36rpx 32rpx; | 477 | margin-bottom: 22rpx; |
| 432 | margin-bottom: 24rpx; | 478 | padding: 22rpx 18rpx 18rpx; |
| 433 | box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.05); | 479 | box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04); |
| 480 | border-radius: 18rpx; | ||
| 481 | display: flex; | ||
| 482 | flex-direction: column; | ||
| 434 | } | 483 | } |
| 435 | 484 | ||
| 436 | .item-header { | 485 | .card-header { |
| 437 | display: flex; | 486 | display: flex; |
| 438 | justify-content: space-between; | 487 | justify-content: space-between; |
| 439 | align-items: center; | 488 | align-items: center; |
| 440 | margin-bottom: 30rpx; | 489 | padding-bottom: 10rpx; |
| 441 | 490 | ||
| 442 | .left-info { | 491 | .date { |
| 492 | width: 100%; | ||
| 443 | display: flex; | 493 | display: flex; |
| 444 | align-items: center; | 494 | align-items: center; |
| 445 | flex:1; | 495 | justify-content: space-between; |
| 446 | flex-wrap: wrap; | 496 | gap: 8rpx; |
| 497 | font-size: 26rpx; | ||
| 447 | } | 498 | } |
| 448 | 499 | ||
| 449 | .mem-name { | 500 | .data-header { |
| 450 | font-size:34rpx; | 501 | display: flex; |
| 451 | font-weight:600; | 502 | min-width: 0; |
| 452 | color:#1a1a1a; | ||
| 453 | margin-right:16rpx; | ||
| 454 | } | 503 | } |
| 455 | 504 | ||
| 456 | .wf-code { | 505 | .member-label { |
| 457 | font-size:24rpx; | 506 | color: #c30d23; |
| 458 | color:#666; | 507 | font-size: 28rpx; |
| 459 | background:#f0f8fb; | 508 | font-weight: bold; |
| 460 | padding:6rpx 12rpx; | 509 | flex-shrink: 0; |
| 461 | border-radius: 16rpx; | ||
| 462 | } | 510 | } |
| 463 | 511 | ||
| 464 | .status-badge { | 512 | .value { |
| 465 | font-size:24rpx; | 513 | color: #000; |
| 466 | padding:8rpx 16rpx; | 514 | font-size: 27rpx; |
| 467 | border-radius: 20rpx; | 515 | font-weight: bold; |
| 516 | max-width: 460rpx; | ||
| 517 | overflow: hidden; | ||
| 518 | white-space: nowrap; | ||
| 519 | text-overflow: ellipsis; | ||
| 468 | } | 520 | } |
| 469 | } | 521 | } |
| 470 | 522 | ||
| 471 | .status-pending { background:#f5f5f5; color:#888; } | 523 | .status-tag { |
| 472 | .status-processing { background:#e8e8ff; color:#1890ff; } | 524 | font-size: 24rpx; |
| 473 | .status-success { background:#f0fff4; color:#52c41a; } | 525 | flex-shrink: 0; |
| 474 | .status-rejected { background:#fff2f2; color:#ff4d4f; } | 526 | } |
| 475 | .status-withdrawn { background:#fffbe6; color:#faad14; } | 527 | |
| 476 | .status-default { background:#f5f5f5; color:#999; } | 528 | .status-pending { color:#888; } |
| 529 | .status-processing { color:#1890ff; } | ||
| 530 | .status-success { color:#52c41a; } | ||
| 531 | .status-rejected { color:#ff4d4f; } | ||
| 532 | .status-withdrawn { color:#faad14; } | ||
| 533 | .status-default { color:#999; } | ||
| 477 | 534 | ||
| 478 | .stats-row { | 535 | .member-time { |
| 536 | width: 100%; | ||
| 479 | display: flex; | 537 | display: flex; |
| 480 | justify-content: space-between; | 538 | justify-content: space-between; |
| 481 | padding-bottom: 24rpx; | 539 | padding-bottom: 4rpx; |
| 482 | 540 | ||
| 483 | .stat-item { | 541 | .label { |
| 484 | display: flex; | 542 | max-width: 480rpx; |
| 485 | flex-direction: column; | 543 | color: #555; |
| 486 | align-items: center; | 544 | font-size: 26rpx; |
| 487 | flex:1; | 545 | font-weight: 700; |
| 546 | line-height: 1.4; | ||
| 488 | 547 | ||
| 489 | .stat-label { | 548 | .star { |
| 490 | font-size:24rpx; | 549 | color: #777; |
| 491 | color:#999; | 550 | font-size: 26rpx; |
| 492 | margin-bottom:10rpx; | ||
| 493 | } | 551 | } |
| 494 | .stat-value { | 552 | |
| 495 | font-size:32rpx; | 553 | .pay-name { |
| 496 | // font-weight:700; | 554 | margin-top: 8rpx; |
| 497 | color:#333; | 555 | color: #999; |
| 556 | font-size: 24rpx; | ||
| 557 | font-weight: 500; | ||
| 498 | } | 558 | } |
| 499 | } | 559 | } |
| 560 | |||
| 500 | } | 561 | } |
| 501 | 562 | ||
| 502 | .submit-time { | 563 | .price { |
| 564 | min-width: 130rpx; | ||
| 565 | font-size: 26rpx; | ||
| 566 | font-weight: 500; | ||
| 567 | text-align: right; | ||
| 568 | |||
| 569 | .person { | ||
| 570 | font-size: 24rpx; | ||
| 571 | color: #999; | ||
| 572 | text-align: right; | ||
| 573 | } | ||
| 574 | } | ||
| 575 | .summary-row { | ||
| 503 | display: flex; | 576 | display: flex; |
| 504 | align-items: center; | 577 | align-items: center; |
| 505 | padding-bottom: 20rpx; | 578 | margin-top: 14rpx; |
| 579 | padding: 16rpx 0 0; | ||
| 580 | border-top: 1rpx dashed #f0f0f0; | ||
| 581 | margin-bottom: 10rpx; | ||
| 582 | padding-bottom: 14rpx; | ||
| 583 | border-bottom: 1rpx dashed #f0f0f0; | ||
| 584 | } | ||
| 506 | 585 | ||
| 507 | .time-text { | 586 | .summary-item { |
| 508 | font-size:24rpx; | 587 | flex: 1; |
| 509 | color:#666; | 588 | text-align: center; |
| 510 | margin-left:20rpx; | ||
| 511 | } | ||
| 512 | } | 589 | } |
| 513 | 590 | ||
| 514 | .action-buttons { | 591 | .summary-label { |
| 592 | display: block; | ||
| 593 | color: #999; | ||
| 594 | font-size: 23rpx; | ||
| 595 | } | ||
| 596 | |||
| 597 | .summary-value { | ||
| 598 | display: block; | ||
| 599 | margin-top: 6rpx; | ||
| 600 | color: #333; | ||
| 601 | font-size: 25rpx; | ||
| 602 | font-weight: 600; | ||
| 603 | } | ||
| 604 | |||
| 605 | .btn-group { | ||
| 515 | display: flex; | 606 | display: flex; |
| 607 | justify-content: flex-end; | ||
| 608 | align-items: center; | ||
| 609 | gap: 16rpx; | ||
| 610 | width: 100%; | ||
| 611 | margin-top: 16rpx; | ||
| 612 | flex-wrap: wrap; | ||
| 516 | 613 | ||
| 517 | .action-btn { | 614 | .btn { |
| 518 | flex:1; | 615 | width: 108rpx; |
| 519 | height:60rpx; | 616 | height: 48rpx; |
| 520 | line-height:60rpx; | 617 | line-height: 48rpx; |
| 521 | font-size:26rpx; | 618 | padding: 0; |
| 522 | border-radius:40rpx; | 619 | border-radius: 10rpx; |
| 523 | margin:0 8rpx; | 620 | font-size: 24rpx; |
| 524 | border:none; | 621 | white-space: nowrap; |
| 525 | font-weight: 500; | 622 | font-weight: bold; |
| 623 | border: none; | ||
| 624 | background: transparent; | ||
| 625 | text-align: center; | ||
| 626 | margin: 0; | ||
| 627 | |||
| 628 | &::after { | ||
| 629 | border: none; | ||
| 630 | display: none; | ||
| 631 | } | ||
| 632 | |||
| 633 | &.btn-cancel { | ||
| 634 | width: 108rpx; | ||
| 635 | flex: 0 0 108rpx; | ||
| 636 | max-width: 108rpx; | ||
| 637 | background: #fff; | ||
| 638 | color: #666; | ||
| 639 | border: 1rpx solid #ccc; | ||
| 526 | } | 640 | } |
| 527 | 641 | ||
| 528 | .delete-btn { | 642 | &.btn-info { |
| 529 | background:#fff2f2; | 643 | flex: 0 0 108rpx; |
| 530 | color:#ff4d4f; | 644 | max-width: 108rpx; |
| 645 | color: #444; | ||
| 646 | border: 1rpx solid #d7d7d7; | ||
| 647 | background: #fff; | ||
| 531 | } | 648 | } |
| 532 | .edit-btn { | 649 | |
| 533 | background:#e8f4ff; | 650 | &.btn-pay { |
| 534 | color:#1890ff; | 651 | flex: 0 0 108rpx; |
| 652 | max-width: 108rpx; | ||
| 653 | color: #c30d23; | ||
| 654 | border: 1rpx solid #c30d23; | ||
| 655 | } | ||
| 656 | |||
| 657 | &.disabled, | ||
| 658 | &[disabled] { | ||
| 659 | background: #f5f5f5 !important; | ||
| 660 | color: #b8b8b8 !important; | ||
| 661 | border: 1rpx solid #e1e1e1 !important; | ||
| 662 | opacity: 1; | ||
| 663 | pointer-events: none; | ||
| 535 | } | 664 | } |
| 536 | .submit-btn { | ||
| 537 | background:#fffbe6; | ||
| 538 | color:#faad14; | ||
| 539 | } | 665 | } |
| 540 | } | ||
| 541 | .action-btn[disabled] { | ||
| 542 | background: #f0f0f0 !important; | ||
| 543 | color: #ccc !important; | ||
| 544 | opacity: 0.6 !important; | ||
| 545 | } | 666 | } |
| 546 | /* 空状态 */ | 667 | /* 空状态 */ |
| 547 | 668 | ... | ... |
-
Please register or sign in to post a comment