mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-11-13 12:28:50 +08:00
refactor(after-sales): 删除独立售后页面并整合至订单列表
- 删除 afterSales.vue 独立页面,将售后入口统一至 myOrder 页面 - 修改售后相关页面跳转路径为 /pages/order/myOrder?status=5 - 重构 applySuccess 页面,增加微信订阅消息授权与视觉优化 - 重构预存款明细页面,增加收支筛选与日志解析功能 - 新增 store 端 API 基础地址配置
This commit is contained in:
@@ -38,6 +38,8 @@
|
||||
<view class="btn-view u-flex u-row-between">
|
||||
<view class="description">{{ afterSaleTypeText(order.serviceType) }}</view>
|
||||
<view class="goods-btn flex flex-a-c">
|
||||
<view class="cancel-btn" v-if="order.serviceStatus === 'APPLY'" @click="onCancelAfterSale(order)">取消售后</view>
|
||||
<view class="pay-btn" v-if="order.serviceStatus === 'PASS' && order.serviceType !== 'RETURN_MONEY'" @click="onAfterSaleExpress(order)">提交物流</view>
|
||||
<view class="pay-btn" @click="openOrder(order)">售后详情</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -131,6 +133,8 @@
|
||||
<u-toast ref="uToast" />
|
||||
<u-modal :confirm-color="lightColor" v-model:show="rogShow" :show-cancel-button="true" :content="'是否确认收货?'"
|
||||
@confirm="confirmRog"></u-modal>
|
||||
<u-modal :confirm-color="lightColor" v-model:show="cancelAfterSaleShow" :show-cancel-button="true" content="确认取消售后?"
|
||||
@confirm="confirmCancelAfterSale"></u-modal>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -141,7 +145,8 @@ import { useStore } from '@/store'
|
||||
import { getThemeStyle } from '@/utils/theme'
|
||||
import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue'
|
||||
import { getOrderList, cancelOrder, confirmReceipt } from '@/api/order.js'
|
||||
import { getClearReason, getAfterSaleList } from '@/api/after-sale.js'
|
||||
import { getClearReason, getAfterSaleList, cancelAfterSale } from '@/api/after-sale.js'
|
||||
import storage from '@/utils/storage'
|
||||
import LiLiWXPay from '@/js_sdk/lili-pay/wx-pay.js'
|
||||
import {
|
||||
unitPrice,
|
||||
@@ -200,6 +205,8 @@ const orderSn = ref('')
|
||||
const reason = ref('')
|
||||
const cancelList = ref<any[]>([])
|
||||
const rogShow = ref(false)
|
||||
const cancelAfterSaleShow = ref(false)
|
||||
const pendingAfterSaleSn = ref('')
|
||||
|
||||
function hideLoadingIfNeeded() {
|
||||
if (store.state.isShowToast) uni.hideLoading()
|
||||
@@ -418,6 +425,30 @@ function openOrder(order: any) {
|
||||
navigateToOrderDetail(order.sn)
|
||||
}
|
||||
|
||||
function onCancelAfterSale(order: any) {
|
||||
pendingAfterSaleSn.value = order?.serviceSn || order?.sn || ''
|
||||
cancelAfterSaleShow.value = true
|
||||
}
|
||||
|
||||
async function confirmCancelAfterSale() {
|
||||
if (!pendingAfterSaleSn.value) return
|
||||
uni.showLoading({ title: '加载中' })
|
||||
const res = await cancelAfterSale(pendingAfterSaleSn.value)
|
||||
hideLoadingIfNeeded()
|
||||
if (res?.data?.success) {
|
||||
uni.showToast({ title: '取消成功!', duration: 2000, icon: 'none' })
|
||||
initData(tabCurrentIndex.value)
|
||||
}
|
||||
}
|
||||
|
||||
function onAfterSaleExpress(order: any) {
|
||||
const sku = (order?.orderItems && order.orderItems[0]) || {}
|
||||
storage.setAfterSaleData({ ...order, ...sku, storeName: order.storeName })
|
||||
uni.navigateTo({
|
||||
url: `./afterSales/afterSalesDetailExpress?serviceSn=${order.serviceSn || order.sn}`,
|
||||
})
|
||||
}
|
||||
|
||||
function changeTab(e: any) {
|
||||
// H5 的 swiper change 把下标放在 detail.current。
|
||||
// 读 target.current 会得到 undefined,选中态被清掉,列表就停在「全部」。
|
||||
|
||||
Reference in New Issue
Block a user