个人会员缴费
Showing
1 changed file
with
56 additions
and
49 deletions
| 1 | <template> | 1 | <template> |
| 2 | <view class="order-page" :class="{ 'no-scroll': isPopupOpen }"> | 2 | <view :class="{ 'no-scroll': isPopupOpen }" class="order-page"> |
| 3 | <!-- 订单列表 --> | 3 | <!-- 订单列表 --> |
| 4 | <scroll-view | 4 | <scroll-view |
| 5 | scroll-y | 5 | :enhanced="true" |
| 6 | class="order-list-scroll" | ||
| 7 | :enhanced="true" | ||
| 8 | :show-scrollbar="false" | ||
| 9 | :scroll-enabled="!isPopupOpen" | 6 | :scroll-enabled="!isPopupOpen" |
| 7 | :show-scrollbar="false" | ||
| 8 | class="order-list-scroll" | ||
| 9 | scroll-y | ||
| 10 | > | 10 | > |
| 11 | <view class="order-list"> | 11 | <view class="order-list"> |
| 12 | <!-- 有数据才循环 --> | 12 | <!-- 有数据才循环 --> |
| ... | @@ -19,21 +19,22 @@ | ... | @@ -19,21 +19,22 @@ |
| 19 | <!-- 订单头部:日期 + 状态 --> | 19 | <!-- 订单头部:日期 + 状态 --> |
| 20 | <view class="card-header"> | 20 | <view class="card-header"> |
| 21 | <view class="date"> | 21 | <view class="date"> |
| 22 | <image :src="config.baseUrl_api + '/fs/static/calendar@2x.png'" v-if="item.payTime" mode="widthFix" style="width:30rpx;height:30rpx;"/> | 22 | <image v-if="item.payTime" :src="config.baseUrl_api + '/fs/static/calendar@2x.png'" mode="widthFix" |
| 23 | <text class="date-text" v-if="item.payTime">{{ item.payTime }}</text> | 23 | style="width:30rpx;height:30rpx;"/> |
| 24 | <text v-if="item.payTime" class="date-text">{{ item.payTime }}</text> | ||
| 24 | </view> | 25 | </view> |
| 25 | <view | 26 | <view |
| 26 | class="status-tag" | ||
| 27 | :class="{ | 27 | :class="{ |
| 28 | success: item.payStatus == 1, | 28 | success: item.payStatus == 1, |
| 29 | danger: item.payStatus == 2, | 29 | danger: item.payStatus == 2, |
| 30 | pending: item.payStatus == 0 | 30 | pending: item.payStatus == 0 |
| 31 | }" | 31 | }" |
| 32 | class="status-tag" | ||
| 32 | > | 33 | > |
| 33 | {{ getStatusText(item.payStatus) }} | 34 | {{ getStatusText(item.payStatus) }} |
| 34 | </view> | 35 | </view> |
| 35 | </view> | 36 | </view> |
| 36 | 37 | ||
| 37 | <!-- 订单编号、缴费编号 --> | 38 | <!-- 订单编号、缴费编号 --> |
| 38 | <view class="info-row"> | 39 | <view class="info-row"> |
| 39 | <text class="label">订单编号:</text> | 40 | <text class="label">订单编号:</text> |
| ... | @@ -43,9 +44,9 @@ | ... | @@ -43,9 +44,9 @@ |
| 43 | <text class="label">缴费编号:</text> | 44 | <text class="label">缴费编号:</text> |
| 44 | <text class="value">{{ item.wfCode || '——' }}</text> | 45 | <text class="value">{{ item.wfCode || '——' }}</text> |
| 45 | </view> | 46 | </view> |
| 46 | 47 | ||
| 47 | <!-- 核心:个人会员仅展示缴费年限 --> | 48 | <!-- 核心:个人会员仅展示缴费年限 --> |
| 48 | <view class="info-section flex f-j-s" v-if="item.content"> | 49 | <view v-if="item.content" class="info-section flex f-j-s"> |
| 49 | <view class="single-info"> | 50 | <view class="single-info"> |
| 50 | <view class="label">缴费年限:</view> | 51 | <view class="label">缴费年限:</view> |
| 51 | <view class="value">{{ item.content.yearCount || 0 }}</view> | 52 | <view class="value">{{ item.content.yearCount || 0 }}</view> |
| ... | @@ -56,43 +57,43 @@ | ... | @@ -56,43 +57,43 @@ |
| 56 | <view class="value">民生付</view> | 57 | <view class="value">民生付</view> |
| 57 | </view> | 58 | </view> |
| 58 | </view> | 59 | </view> |
| 59 | 60 | ||
| 60 | <!-- 费用合计 --> | 61 | <!-- 费用合计 --> |
| 61 | <view class="total-row"> | 62 | <view class="total-row"> |
| 62 | <text class="label">费用合计:</text> | 63 | <text class="label">费用合计:</text> |
| 63 | <text class="amount">¥{{ (Number(item.price) || 0).toFixed(2) }}</text> | 64 | <text class="amount">¥{{ (Number(item.price) || 0).toFixed(2) }}</text> |
| 64 | </view> | 65 | </view> |
| 65 | 66 | ||
| 66 | <!-- 按钮组:靠右紧凑展示 --> | 67 | <!-- 按钮组:靠右紧凑展示 --> |
| 67 | <view class="btn-group"> | 68 | <view class="btn-group"> |
| 68 | <button class="btn btn-delete" @click="handleDelete(item)">删除</button> | 69 | <!-- <button class="btn btn-delete" @click="handleDelete(item)">删除</button>--> |
| 69 | <!-- 已缴费:申请开票/已开票 --> | 70 | <!-- 已缴费:申请开票/已开票 --> |
| 70 | <template v-if="item.payStatus == 1"> | 71 | <template v-if="item.payStatus == 1"> |
| 71 | <button class="btn btn-invoice" @click="makeInvoiceFN(item)" :disabled="item.invoiceStatus === 1"> | 72 | <button :disabled="item.invoiceStatus === 1" class="btn btn-invoice" @click="makeInvoiceFN(item)"> |
| 72 | {{ item.invoiceStatus === 1 ? '已开票' : '申请开票' }} | 73 | {{ item.invoiceStatus === 1 ? '已开票' : '申请开票' }} |
| 73 | </button> | 74 | </button> |
| 74 | </template> | 75 | </template> |
| 75 | <!-- 未缴费:去缴费 + 取消订单 --> | 76 | <!-- <!– 未缴费:去缴费 + 取消订单 –>--> |
| 76 | <template v-if="item.payStatus == 0"> | 77 | <!-- <template v-if="item.payStatus == 0">--> |
| 77 | <button class="btn btn-cancel" @click="handleCancel(item)">取消订单</button> | 78 | <!-- <button class="btn btn-cancel" @click="handleCancel(item)">取消订单</button>--> |
| 78 | <button class="btn btn-pay" @click="handlePay(item)">去缴费</button> | 79 | <!-- <button class="btn btn-pay" @click="handlePay(item)">去缴费</button>--> |
| 79 | </template> | 80 | <!-- </template>--> |
| 80 | </view> | 81 | </view> |
| 81 | </view> | 82 | </view> |
| 82 | </view> | 83 | </view> |
| 83 | 84 | ||
| 84 | <!-- 空状态 --> | 85 | <!-- 空状态 --> |
| 85 | <view v-else class="empty"> | 86 | <view v-else class="empty"> |
| 86 | <image class="empty-img" mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image> | 87 | <image :src="config.baseUrl_api + '/fs/static/nodata.png'" class="empty-img" mode="aspectFit"></image> |
| 87 | <text class="empty-text">暂无订单记录</text> | 88 | <text class="empty-text">暂无订单记录</text> |
| 88 | </view> | 89 | </view> |
| 89 | 90 | ||
| 90 | <!-- 加载/无更多提示 --> | 91 | <!-- 加载/无更多提示 --> |
| 91 | <view class="loading-tip" v-if="loading">加载中...</view> | 92 | <view v-if="loading" class="loading-tip">加载中...</view> |
| 92 | <view class="no-more" v-if="!loading && !hasMore && list.length">没有更多了</view> | 93 | <view v-if="!loading && !hasMore && list.length" class="no-more">没有更多了</view> |
| 93 | </view> | 94 | </view> |
| 94 | </scroll-view> | 95 | </scroll-view> |
| 95 | 96 | ||
| 96 | <!-- 自定义删除确认弹窗 --> | 97 | <!-- 自定义删除确认弹窗 --> |
| 97 | <view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup"> | 98 | <view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup"> |
| 98 | <view class="custom-modal" @click.stop> | 99 | <view class="custom-modal" @click.stop> |
| ... | @@ -104,7 +105,7 @@ | ... | @@ -104,7 +105,7 @@ |
| 104 | </view> | 105 | </view> |
| 105 | </view> | 106 | </view> |
| 106 | </view> | 107 | </view> |
| 107 | 108 | ||
| 108 | <!-- 自定义取消订单确认弹窗 --> | 109 | <!-- 自定义取消订单确认弹窗 --> |
| 109 | <view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup"> | 110 | <view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup"> |
| 110 | <view class="custom-modal" @click.stop> | 111 | <view class="custom-modal" @click.stop> |
| ... | @@ -120,11 +121,12 @@ | ... | @@ -120,11 +121,12 @@ |
| 120 | </template> | 121 | </template> |
| 121 | 122 | ||
| 122 | <script setup> | 123 | <script setup> |
| 123 | import { ref, reactive, onMounted,computed } from 'vue'; | 124 | import {ref, reactive, onMounted, computed} from 'vue'; |
| 124 | import { onReachBottom } from '@dcloudio/uni-app' | 125 | import {onReachBottom} from '@dcloudio/uni-app' |
| 125 | import { useUserStore } from "../store/modules/user"; | 126 | import {useUserStore} from "../store/modules/user"; |
| 126 | import * as api from '@/common/api.js' | 127 | import * as api from '@/common/api.js' |
| 127 | import config from '@/config.js' | 128 | import config from '@/config.js' |
| 129 | |||
| 128 | const userStore = useUserStore() | 130 | const userStore = useUserStore() |
| 129 | // 数据与分页配置 | 131 | // 数据与分页配置 |
| 130 | const list = ref([]); | 132 | const list = ref([]); |
| ... | @@ -158,12 +160,14 @@ const currentOrder = ref(null); | ... | @@ -158,12 +160,14 @@ const currentOrder = ref(null); |
| 158 | // 页面挂载初始化 | 160 | // 页面挂载初始化 |
| 159 | onMounted(() => { | 161 | onMounted(() => { |
| 160 | // 获取用户信息 | 162 | // 获取用户信息 |
| 161 | if (userInfo.value && userInfo.value.perId) { | 163 | // if (userInfo.value && userInfo.value.perId) { |
| 162 | queryParams.perId = userInfo.value.perId; | 164 | // queryParams.perId = userInfo.value.perId; |
| 163 | initData(); | 165 | // initData(); |
| 164 | } else { | 166 | // } else { |
| 165 | uni.showToast({ title: '获取用户信息失败', icon: 'none' }); | 167 | // uni.showToast({title: '获取用户信息失败', icon: 'none'}); |
| 166 | } | 168 | // } |
| 169 | |||
| 170 | initData(); | ||
| 167 | }); | 171 | }); |
| 168 | 172 | ||
| 169 | // 小程序原生触底加载 | 173 | // 小程序原生触底加载 |
| ... | @@ -215,7 +219,7 @@ const initData = async () => { | ... | @@ -215,7 +219,7 @@ const initData = async () => { |
| 215 | hasMore.value = list.value.length < (res.total || 0); | 219 | hasMore.value = list.value.length < (res.total || 0); |
| 216 | } catch (e) { | 220 | } catch (e) { |
| 217 | console.error('订单加载异常:', e); | 221 | console.error('订单加载异常:', e); |
| 218 | uni.showToast({ title: '加载失败', icon: 'none' }); | 222 | uni.showToast({title: '加载失败', icon: 'none'}); |
| 219 | } finally { | 223 | } finally { |
| 220 | loading.value = false; | 224 | loading.value = false; |
| 221 | } | 225 | } |
| ... | @@ -234,13 +238,13 @@ const confirmDel = async () => { | ... | @@ -234,13 +238,13 @@ const confirmDel = async () => { |
| 234 | if (!currentOrder.value) return; | 238 | if (!currentOrder.value) return; |
| 235 | try { | 239 | try { |
| 236 | await api.deleteOrder(currentOrder.value.id); | 240 | await api.deleteOrder(currentOrder.value.id); |
| 237 | uni.showToast({ title: '删除成功', icon: 'success' }); | 241 | uni.showToast({title: '删除成功', icon: 'success'}); |
| 238 | pageNum.value = 1; | 242 | pageNum.value = 1; |
| 239 | list.value = []; | 243 | list.value = []; |
| 240 | initData(); | 244 | initData(); |
| 241 | closeDelPopup(); | 245 | closeDelPopup(); |
| 242 | } catch (e) { | 246 | } catch (e) { |
| 243 | uni.showToast({ title: '删除失败', icon: 'error' }); | 247 | uni.showToast({title: '删除失败', icon: 'error'}); |
| 244 | } | 248 | } |
| 245 | }; | 249 | }; |
| 246 | 250 | ||
| ... | @@ -255,16 +259,16 @@ const closeDelPopup = () => { | ... | @@ -255,16 +259,16 @@ const closeDelPopup = () => { |
| 255 | const handlePay = async (item) => { | 259 | const handlePay = async (item) => { |
| 256 | if (item.payStatus !== 0) return; | 260 | if (item.payStatus !== 0) return; |
| 257 | try { | 261 | try { |
| 258 | await api.goPay({ id: item.id }); | 262 | await api.goPay({id: item.id}); |
| 259 | uni.navigateTo({ url: `/pages/pay/pay?orderId=${item.id}` }); | 263 | uni.navigateTo({url: `/pages/pay/pay?orderId=${item.id}`}); |
| 260 | } catch (e) { | 264 | } catch (e) { |
| 261 | uni.showToast({ title: '发起支付失败', icon: 'none' }); | 265 | uni.showToast({title: '发起支付失败', icon: 'none'}); |
| 262 | } | 266 | } |
| 263 | }; | 267 | }; |
| 264 | 268 | ||
| 265 | // 申请开票 | 269 | // 申请开票 |
| 266 | const makeInvoiceFN = (item) => { | 270 | const makeInvoiceFN = (item) => { |
| 267 | uni.navigateTo({ url: `/pages/invoice/apply?orderId=${item.id}amount=${item.price}` }); | 271 | uni.navigateTo({url: `/pages/invoice/apply?orderId=${item.id}amount=${item.price}`}); |
| 268 | }; | 272 | }; |
| 269 | 273 | ||
| 270 | // 取消订单 | 274 | // 取消订单 |
| ... | @@ -280,13 +284,13 @@ const confirmCancel = async () => { | ... | @@ -280,13 +284,13 @@ const confirmCancel = async () => { |
| 280 | if (!currentOrder.value) return; | 284 | if (!currentOrder.value) return; |
| 281 | try { | 285 | try { |
| 282 | await api.cancelPay(currentOrder.value.id); | 286 | await api.cancelPay(currentOrder.value.id); |
| 283 | uni.showToast({ title: '取消成功', icon: 'success' }); | 287 | uni.showToast({title: '取消成功', icon: 'success'}); |
| 284 | pageNum.value = 1; | 288 | pageNum.value = 1; |
| 285 | list.value = []; | 289 | list.value = []; |
| 286 | initData(); | 290 | initData(); |
| 287 | closeCancelPopup(); | 291 | closeCancelPopup(); |
| 288 | } catch (e) { | 292 | } catch (e) { |
| 289 | uni.showToast({ title: '取消失败', icon: 'error' }); | 293 | uni.showToast({title: '取消失败', icon: 'error'}); |
| 290 | } | 294 | } |
| 291 | }; | 295 | }; |
| 292 | 296 | ||
| ... | @@ -402,15 +406,18 @@ const closeCancelPopup = () => { | ... | @@ -402,15 +406,18 @@ const closeCancelPopup = () => { |
| 402 | justify-content: space-around; | 406 | justify-content: space-around; |
| 403 | margin: 20rpx 0; | 407 | margin: 20rpx 0; |
| 404 | } | 408 | } |
| 405 | .line{ | 409 | |
| 410 | .line { | ||
| 406 | width: 1rpx; | 411 | width: 1rpx; |
| 407 | height: 90%; | 412 | height: 90%; |
| 408 | background: #eee; | 413 | background: #eee; |
| 409 | } | 414 | } |
| 415 | |||
| 410 | .single-info { | 416 | .single-info { |
| 411 | padding: 16rpx 20rpx; | 417 | padding: 16rpx 20rpx; |
| 412 | border-radius: 8rpx; | 418 | border-radius: 8rpx; |
| 413 | font-size: 26rpx; | 419 | font-size: 26rpx; |
| 420 | |||
| 414 | .label { | 421 | .label { |
| 415 | color: #999; | 422 | color: #999; |
| 416 | text-align: center; | 423 | text-align: center; |
| ... | @@ -590,4 +597,4 @@ const closeCancelPopup = () => { | ... | @@ -590,4 +597,4 @@ const closeCancelPopup = () => { |
| 590 | border: none; | 597 | border: none; |
| 591 | } | 598 | } |
| 592 | } | 599 | } |
| 593 | </style> | ||
| ... | \ No newline at end of file | ... | \ No newline at end of file |
| 600 | </style> | ... | ... |
-
Please register or sign in to post a comment