mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-11-13 20:38:51 +08:00
refactor(after-sales): 删除独立售后页面并整合至订单列表
- 删除 afterSales.vue 独立页面,将售后入口统一至 myOrder 页面 - 修改售后相关页面跳转路径为 /pages/order/myOrder?status=5 - 重构 applySuccess 页面,增加微信订阅消息授权与视觉优化 - 重构预存款明细页面,增加收支筛选与日志解析功能 - 新增 store 端 API 基础地址配置
This commit is contained in:
@@ -1,41 +1,114 @@
|
||||
<template>
|
||||
<view :style="themeStyle" class="wap">
|
||||
<view :style="themeStyle" class="withdraw-log-page">
|
||||
<u-navbar
|
||||
title="提现记录"
|
||||
:fixed="true"
|
||||
:placeholder="true"
|
||||
:border="false"
|
||||
:auto-back="true"
|
||||
:auto-back="false"
|
||||
@leftClick="back"
|
||||
></u-navbar>
|
||||
<scroll-view class="scroll-v view-wrapper" enableBackToTop="true" scroll-with-animation scroll-y @scrolltolower="loadMore">
|
||||
<view v-if="records.length != 0" class="view-item" v-for="(item, index) in records" :key="index">
|
||||
<view class="view-item-detail">
|
||||
<view class="-title">{{ withdrawStatusText(item.applyStatus) }}</view>
|
||||
<view class="-number" v-if="item.inspectRemark || item.errorMessage">{{ item.inspectRemark || item.errorMessage }}</view>
|
||||
</view>
|
||||
<view class="view-item-change">
|
||||
<view class="-money">-{{unitPrice(item.applyMoney) }}</view>
|
||||
<view class="-time">{{ item.createTime || item.inspectTime || "" }}</view>
|
||||
<view v-if="item.applyStatus === 'WAIT_USER_CONFIRM'" class="confirm-btn" @click.stop="confirmWechatReceive(item)">确认收款</view>
|
||||
|
||||
<!-- 状态筛选胶囊栏 -->
|
||||
<view class="filter-bar">
|
||||
<view
|
||||
v-for="(tab, idx) in filterTabs"
|
||||
:key="tab.key"
|
||||
class="filter-pill"
|
||||
:class="{ active: activeFilter === idx }"
|
||||
@click="activeFilter = idx"
|
||||
>
|
||||
{{ tab.name }}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 提现记录列表 -->
|
||||
<view class="list-container">
|
||||
<view v-if="filteredRecords.length > 0" class="list-card">
|
||||
<view
|
||||
class="record-card"
|
||||
v-for="(item, index) in filteredRecords"
|
||||
:key="item.id || index"
|
||||
>
|
||||
<!-- 第一行:状态标签 + 标题 | 提现金额 -->
|
||||
<view class="card-row-main">
|
||||
<view class="title-wrap">
|
||||
<text class="status-tag" :class="item.parsed.statusClass">
|
||||
{{ item.parsed.statusText }}
|
||||
</text>
|
||||
<text class="card-title">余额提现</text>
|
||||
</view>
|
||||
<view class="amount-wrap">
|
||||
<text class="amount-symbol">¥</text>
|
||||
<text class="amount-val">{{ unitPrice(item.applyMoney) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 第二行:单号、审核备注或失败原因 -->
|
||||
<view
|
||||
v-if="item.sn || item.inspectRemark || item.errorMessage || item.inspectTime"
|
||||
class="meta-box"
|
||||
>
|
||||
<view v-if="item.sn" class="meta-line">
|
||||
<text class="meta-label">提现单号:</text>
|
||||
<text class="meta-val mono">{{ item.sn }}</text>
|
||||
</view>
|
||||
<view v-if="item.inspectTime" class="meta-line">
|
||||
<text class="meta-label">审核时间:</text>
|
||||
<text class="meta-val">{{ item.inspectTime }}</text>
|
||||
</view>
|
||||
<view v-if="item.inspectRemark || item.errorMessage" class="meta-line">
|
||||
<text class="meta-label">备注说明:</text>
|
||||
<text class="meta-val remark-text">{{ item.inspectRemark || item.errorMessage }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 第三行:申请时间 + 确认收款按钮 -->
|
||||
<view class="card-row-foot">
|
||||
<text class="apply-time">申请时间:{{ item.createTime || item.inspectTime || '-' }}</text>
|
||||
<view
|
||||
v-if="item.applyStatus === 'WAIT_USER_CONFIRM'"
|
||||
class="confirm-btn"
|
||||
@click.stop="confirmWechatReceive(item)"
|
||||
>
|
||||
确认收款
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<u-empty v-if="loaded && records.length == 0" mode="history" text="暂无记录" />
|
||||
</scroll-view>
|
||||
<view v-else-if="loaded" class="empty-box">
|
||||
<u-empty mode="history" text="暂无提现记录" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref, computed } from 'vue'
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import { onShow, onReachBottom } from '@dcloudio/uni-app'
|
||||
import { getWithdrawApplyPage, getWithdrawApplyWechatTransferInfo } from '@/api/members'
|
||||
import { unitPrice } from '@/utils/filters.js'
|
||||
import { useStore } from '@/store'
|
||||
import { getThemeStyle } from '@/utils/theme'
|
||||
import {
|
||||
prefetchMpMessageTemplates,
|
||||
subscribeMpMessageByScenes,
|
||||
} from '@/js_sdk/lili-pay/wx-pay.js'
|
||||
|
||||
const store = useStore()
|
||||
const themeStyle = computed(() => getThemeStyle(store.state.theme))
|
||||
|
||||
const loaded = ref(false)
|
||||
const hasMore = ref(true)
|
||||
const activeFilter = ref(0)
|
||||
const filterTabs = [
|
||||
{ key: 'ALL', name: '全部' },
|
||||
{ key: 'PENDING', name: '处理中' },
|
||||
{ key: 'SUCCESS', name: '已到账' },
|
||||
{ key: 'FAIL', name: '未通过/失败' },
|
||||
]
|
||||
|
||||
const params = ref({
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
@@ -44,40 +117,88 @@ const params = ref({
|
||||
const records = ref<any[]>([])
|
||||
|
||||
onShow(() => {
|
||||
// #ifdef MP-WEIXIN
|
||||
// 预拉取订阅模板,保证点击左上角返回时可同步拉起微信订阅弹窗
|
||||
prefetchMpMessageTemplates()
|
||||
// #endif
|
||||
reloadData()
|
||||
})
|
||||
|
||||
// 左上角返回:提示订阅「提现结果通知」后再返回
|
||||
function back() {
|
||||
const doBack = () => {
|
||||
if (getCurrentPages().length > 1) {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
} else {
|
||||
uni.redirectTo({ url: '/pages/mine/deposit/operation' })
|
||||
}
|
||||
}
|
||||
// #ifdef MP-WEIXIN
|
||||
subscribeMpMessageByScenes(['WALLET_WITHDRAWAL_AUDIT_ERROR'], doBack)
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
doBack()
|
||||
// #endif
|
||||
}
|
||||
|
||||
onReachBottom(() => {
|
||||
if (!hasMore.value) return
|
||||
loadMore()
|
||||
})
|
||||
|
||||
function reloadData() {
|
||||
params.value.pageNumber = 1
|
||||
hasMore.value = true
|
||||
records.value = []
|
||||
loaded.value = false
|
||||
getData()
|
||||
})
|
||||
}
|
||||
|
||||
function withdrawStatusText(applyStatus: string) {
|
||||
function parseWithdrawStatus(applyStatus: string) {
|
||||
switch (applyStatus) {
|
||||
case 'APPLY':
|
||||
return '申请中'
|
||||
return { statusText: '申请中', statusClass: 'tag-pending', group: 'PENDING' }
|
||||
case 'VIA_AUDITING':
|
||||
return '审核通过'
|
||||
return { statusText: '审核通过', statusClass: 'tag-pending', group: 'PENDING' }
|
||||
case 'D_VIA_AUDITING':
|
||||
return '分销提现审核通过'
|
||||
case 'FAIL_AUDITING':
|
||||
return '审核未通过'
|
||||
case 'D_FAIL_AUDITING':
|
||||
return '分销提现审核未通过'
|
||||
return { statusText: '分销审核通过', statusClass: 'tag-pending', group: 'PENDING' }
|
||||
case 'WAIT_USER_CONFIRM':
|
||||
return '等待用户确认'
|
||||
return { statusText: '待确认收款', statusClass: 'tag-action', group: 'PENDING' }
|
||||
case 'SUCCESS':
|
||||
return '提现成功'
|
||||
return { statusText: '提现成功', statusClass: 'tag-success', group: 'SUCCESS' }
|
||||
case 'FAIL_AUDITING':
|
||||
return { statusText: '审核未通过', statusClass: 'tag-fail', group: 'FAIL' }
|
||||
case 'D_FAIL_AUDITING':
|
||||
return { statusText: '分销审核未通过', statusClass: 'tag-fail', group: 'FAIL' }
|
||||
case 'ERROR':
|
||||
return '提现失败'
|
||||
return { statusText: '提现失败', statusClass: 'tag-fail', group: 'FAIL' }
|
||||
default:
|
||||
return applyStatus || ''
|
||||
return { statusText: applyStatus || '处理中', statusClass: 'tag-pending', group: 'PENDING' }
|
||||
}
|
||||
}
|
||||
|
||||
const decoratedRecords = computed(() =>
|
||||
records.value.map((item) => ({
|
||||
...item,
|
||||
parsed: parseWithdrawStatus(item.applyStatus),
|
||||
}))
|
||||
)
|
||||
|
||||
const filteredRecords = computed(() => {
|
||||
const targetKey = filterTabs[activeFilter.value]?.key || 'ALL'
|
||||
if (targetKey === 'ALL') return decoratedRecords.value
|
||||
return decoratedRecords.value.filter((item) => item.parsed.group === targetKey)
|
||||
})
|
||||
|
||||
function getData() {
|
||||
getWithdrawApplyPage(params.value).then((res) => {
|
||||
loaded.value = true
|
||||
if (res.data.success && res.data.result.records.length != 0) {
|
||||
records.value.push(...res.data.result.records)
|
||||
const list = (res.data?.success && res.data?.result?.records) || []
|
||||
if (list.length > 0) {
|
||||
records.value.push(...list)
|
||||
}
|
||||
if (list.length < params.value.pageSize) {
|
||||
hasMore.value = false
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -119,7 +240,8 @@ function confirmWechatReceive(item: any) {
|
||||
|
||||
const openResultToast = (errMsg?: string) => {
|
||||
if (errMsg === 'requestMerchantTransfer:ok') {
|
||||
uni.showToast({ title: '已唤起确认页面', duration: 2000, icon: 'none' })
|
||||
uni.showToast({ title: '已确认收款', duration: 2000, icon: 'none' })
|
||||
setTimeout(() => reloadData(), 800)
|
||||
return
|
||||
}
|
||||
if (errMsg === 'requestMerchantTransfer:cancel') {
|
||||
@@ -175,55 +297,191 @@ function confirmWechatReceive(item: any) {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.view-item {
|
||||
padding: 32rpx;
|
||||
.withdraw-log-page {
|
||||
min-height: 100vh;
|
||||
background: #f5f6fa;
|
||||
padding-bottom: 48rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.filter-bar {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 16rpx;
|
||||
padding: 24rpx 24rpx 8rpx;
|
||||
overflow-x: auto;
|
||||
}
|
||||
.view-item-change {
|
||||
text-align: right;
|
||||
> .-money {
|
||||
font-size: 36rpx;
|
||||
color: $main-color;
|
||||
font-weight: bold;
|
||||
}
|
||||
> .-time {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
}
|
||||
> .confirm-btn {
|
||||
display: inline-block;
|
||||
margin-top: 12rpx;
|
||||
padding: 12rpx 20rpx;
|
||||
font-size: 24rpx;
|
||||
border-radius: 8rpx;
|
||||
|
||||
.filter-pill {
|
||||
flex-shrink: 0;
|
||||
padding: 12rpx 28rpx;
|
||||
border-radius: 999rpx;
|
||||
font-size: 25rpx;
|
||||
color: #666666;
|
||||
background: #ffffff;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.active {
|
||||
background: $main-color;
|
||||
color: #fff;
|
||||
color: #ffffff;
|
||||
font-weight: 600;
|
||||
box-shadow: 0 4rpx 12rpx rgba(229, 50, 56, 0.2);
|
||||
}
|
||||
}
|
||||
.view-item-detail {
|
||||
line-height: 1.75;
|
||||
|
||||
.list-container {
|
||||
padding: 16rpx 24rpx 0;
|
||||
}
|
||||
|
||||
.list-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 18rpx;
|
||||
}
|
||||
|
||||
.record-card {
|
||||
background: #ffffff;
|
||||
border-radius: 20rpx;
|
||||
padding: 28rpx 30rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(17, 30, 79, 0.03);
|
||||
}
|
||||
|
||||
.card-row-main {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.title-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
min-width: 0;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
> .-title {
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.status-tag {
|
||||
flex-shrink: 0;
|
||||
font-size: 21rpx;
|
||||
font-weight: 600;
|
||||
padding: 4rpx 14rpx;
|
||||
border-radius: 8rpx;
|
||||
line-height: 1.35;
|
||||
|
||||
&.tag-pending {
|
||||
color: #ff7d00;
|
||||
background: rgba(255, 125, 0, 0.1);
|
||||
}
|
||||
> .-number {
|
||||
font-size: 22rpx;
|
||||
color: #999;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
|
||||
&.tag-action {
|
||||
color: $main-color;
|
||||
background: rgba(229, 50, 56, 0.1);
|
||||
}
|
||||
|
||||
&.tag-success {
|
||||
color: #00a870;
|
||||
background: rgba(0, 168, 112, 0.1);
|
||||
}
|
||||
|
||||
&.tag-fail {
|
||||
color: #f53f3f;
|
||||
background: rgba(245, 63, 63, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.wap {
|
||||
width: 100%;
|
||||
height: calc(100vh - 44px);
|
||||
.card-title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #1d2129;
|
||||
line-height: 1.35;
|
||||
}
|
||||
|
||||
.scroll-v {
|
||||
height: calc(100vh - 88rpx);
|
||||
.amount-wrap {
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
color: #1d2129;
|
||||
}
|
||||
|
||||
.amount-symbol {
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.amount-val {
|
||||
font-size: 36rpx;
|
||||
font-weight: 700;
|
||||
line-height: 1.2;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.meta-box {
|
||||
margin-top: 16rpx;
|
||||
padding: 14rpx 18rpx;
|
||||
background: #f8f9fb;
|
||||
border-radius: 12rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6rpx;
|
||||
}
|
||||
|
||||
.meta-line {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
font-size: 23rpx;
|
||||
line-height: 1.45;
|
||||
color: #4e5969;
|
||||
}
|
||||
|
||||
.meta-label {
|
||||
flex-shrink: 0;
|
||||
color: #86909c;
|
||||
}
|
||||
|
||||
.meta-val {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
color: #4e5969;
|
||||
word-break: break-all;
|
||||
|
||||
&.mono {
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
}
|
||||
|
||||
&.remark-text {
|
||||
color: #f53f3f;
|
||||
}
|
||||
}
|
||||
|
||||
.card-row-foot {
|
||||
margin-top: 18rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
gap: 16rpx;
|
||||
}
|
||||
|
||||
.apply-time {
|
||||
font-size: 22rpx;
|
||||
color: #999999;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
.confirm-btn {
|
||||
flex-shrink: 0;
|
||||
padding: 10rpx 28rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
border-radius: 999rpx;
|
||||
background: linear-gradient(135deg, $main-color 0%, $light-color 100%);
|
||||
color: #ffffff;
|
||||
box-shadow: 0 4rpx 12rpx rgba(229, 50, 56, 0.22);
|
||||
}
|
||||
|
||||
.empty-box {
|
||||
padding-top: 140rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user