refactor(after-sales): 删除独立售后页面并整合至订单列表

- 删除 afterSales.vue 独立页面,将售后入口统一至 myOrder 页面
- 修改售后相关页面跳转路径为 /pages/order/myOrder?status=5
- 重构 applySuccess 页面,增加微信订阅消息授权与视觉优化
- 重构预存款明细页面,增加收支筛选与日志解析功能
- 新增 store 端 API 基础地址配置
This commit is contained in:
pikachu1995@126.com
2026-11-02 16:57:29 +08:00
parent 1411f15679
commit e1a48d6d11
34 changed files with 7082 additions and 1361 deletions

View File

@@ -1,154 +1,188 @@
<template>
<div :style="themeStyle" class="wrapper">
<div class="pay-wrapper">
<div class="pay-money">
¥{{unitPrice(Number(payPrice)) }}
</div>
<div class="pay-btns">
<div v-show="!from" @click="checkOrder">查看{{ orderType == "RECHARGE" ? '余额' : '订单' }}</div>
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
</div>
</div>
<div class="pay-box">
<div class="pay-tag-box">
<h2>订单支付成功!</h2>
<div class="pay-item">
<div>
支付方式:
</div>
<div>{{ paymentTypeFilter(paymentMethod) }}</div>
</div>
</div>
</div>
<goodsRecommend />
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import goodsRecommend from '@/components/m-goods-recommend'
<template>
<div :style="themeStyle" class="wrapper">
<div class="pay-wrapper">
<div class="pay-money">
¥{{ unitPrice(Number(payPrice)) }}
</div>
<div class="pay-btns">
<div v-show="!from" @click="checkOrder">查看{{ orderType == "RECHARGE" ? '余额' : '订单' }}</div>
<div @click="navigateTo('/pages/tabbar/home/index', 'switch')">回到首页</div>
</div>
</div>
<div class="pay-box">
<div class="pay-tag-box">
<h2>订单支付成功!</h2>
<div class="pay-item">
<div>
支付方式:
</div>
<div>{{ paymentTypeFilter(paymentMethod) }}</div>
</div>
</div>
</div>
<goodsRecommend />
</div>
</template>
<script setup lang="ts">
import { ref, computed } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import goodsRecommend from '@/components/m-goods-recommend'
import { unitPrice } from '@/utils/filters.js'
import { useStore } from '@/store'
import { getThemeStyle } from '@/utils/theme'
import {
prefetchMpMessageTemplates,
subscribePayMessageThen,
} from '@/js_sdk/lili-pay/wx-pay.js'
const store = useStore()
const themeStyle = computed(() => getThemeStyle(store.state.theme))
const paymentMethod = ref('')
const from = ref('')
const payPrice = ref<number | string>(0)
const orderType = ref('')
onLoad((options) => {
paymentMethod.value = options.paymentMethod || ''
from.value = options.from || ''
payPrice.value = options.payPrice || 0
orderType.value = options.orderType || ''
})
function paymentTypeFilter(val: string) {
switch (val) {
case 'WECHAT':
return '微信'
case 'ALIPAY':
return '支付宝'
case 'WALLET':
return '余额支付'
default:
return ''
}
}
function checkOrder() {
if (orderType.value == 'RECHARGE') {
uni.reLaunch({
url: '/pages/mine/deposit/operation',
})
return
}
uni.reLaunch({
url: '/pages/order/myOrder?status=0',
})
}
function navigateTo(url: string, type?: string) {
if (type === 'switch') {
uni.switchTab({ url })
} else {
uni.redirectTo({ url })
}
}
</script><style scoped lang="scss">
.subscribe {
justify-content: space-between;
align-items: center;
margin: 0 auto 40rpx auto;
padding: 0 20rpx 20rpx;
width: 80%;
}
.pay-btns {
display: flex;
width: 50%;
justify-content: space-between;
margin: 0 auto;
color: #fff;
>div {
padding: 6px 12px;
border: 1px solid #fff;
border-radius: 100px;
}
}
.pay-money {
line-height: 1;
font-size: 50rpx;
color: #fff;
margin-bottom: 100rpx;
}
.pay-item {
font-weight: bold;
margin: 32rpx 0;
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: var(--theme-primary-70, rgba(255, 60, 42, 0.7));
}
.pay-box {
overflow: hidden;
}
.pay-tag-box {
width: 80%;
margin: 80rpx auto 40rpx auto;
padding: 20rpx;
border-radius: 20rpx;
background: var(--theme-primary-20, rgba(255, 60, 42, 0.2));
>h2 {
margin-top: 20rpx;
font-size: 40rpx;
color: $main-color;
}
}
.pay-wrapper {
background-image: linear-gradient(90deg, $main-color, $light-color, $aider-light-color);
height: 480rpx;
position: relative;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.pay-box {
transform: translateY(-100rpx);
width: 100%;
background: #fff;
border-top-right-radius: 100rpx;
}
</style>
const themeStyle = computed(() => getThemeStyle(store.state.theme))
const paymentMethod = ref('')
const from = ref('')
const payPrice = ref<number | string>(0)
const orderType = ref('')
const orderPromotionType = ref('')
onLoad((options) => {
paymentMethod.value = options.paymentMethod || ''
from.value = options.from || ''
payPrice.value = options.payPrice || 0
orderType.value = options.orderType || ''
orderPromotionType.value = options.orderPromotionType || ''
// #ifdef MP-WEIXIN
prefetchMpMessageTemplates()
// #endif
})
function paymentTypeFilter(val: string) {
switch (val) {
case 'WECHAT':
return '微信'
case 'ALIPAY':
return '支付宝'
case 'WALLET':
return '余额支付'
default:
return ''
}
}
function checkOrder() {
if (orderType.value == 'RECHARGE') {
uni.reLaunch({
url: '/pages/mine/deposit/operation',
})
return
}
const doGoOrder = () => {
uni.reLaunch({
url: '/pages/order/myOrder?status=0',
})
}
// #ifdef MP-WEIXIN
subscribePayMessageThen(doGoOrder, {
orderPromotionType: orderPromotionType.value,
})
// #endif
// #ifndef MP-WEIXIN
doGoOrder()
// #endif
}
function navigateTo(url: string, type?: string) {
const doNavigate = () => {
if (type === 'switch') {
uni.switchTab({ url })
} else {
uni.redirectTo({ url })
}
}
if (orderType.value == 'RECHARGE') {
doNavigate()
return
}
// #ifdef MP-WEIXIN
subscribePayMessageThen(doNavigate, {
orderPromotionType: orderPromotionType.value,
})
// #endif
// #ifndef MP-WEIXIN
doNavigate()
// #endif
}
</script>
<style scoped lang="scss">
.subscribe {
justify-content: space-between;
align-items: center;
margin: 0 auto 40rpx auto;
padding: 0 20rpx 20rpx;
width: 80%;
}
.pay-btns {
display: flex;
width: 50%;
justify-content: space-between;
margin: 0 auto;
color: #fff;
>div {
padding: 6px 12px;
border: 1px solid #fff;
border-radius: 100px;
}
}
.pay-money {
line-height: 1;
font-size: 50rpx;
color: #fff;
margin-bottom: 100rpx;
}
.pay-item {
font-weight: bold;
margin: 32rpx 0;
display: flex;
justify-content: space-between;
font-size: 24rpx;
color: var(--theme-primary-70, rgba(255, 60, 42, 0.7));
}
.pay-box {
overflow: hidden;
}
.pay-tag-box {
width: 80%;
margin: 80rpx auto 40rpx auto;
padding: 20rpx;
border-radius: 20rpx;
background: var(--theme-primary-20, rgba(255, 60, 42, 0.2));
>h2 {
margin-top: 20rpx;
font-size: 40rpx;
color: $main-color;
}
}
.pay-wrapper {
background-image: linear-gradient(90deg, $main-color, $light-color, $aider-light-color);
height: 480rpx;
position: relative;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
}
.pay-box {
transform: translateY(-100rpx);
width: 100%;
background: #fff;
border-top-right-radius: 100rpx;
}
</style>