浏览代码

feat(api): 添加删除订单接口定义和类型声明

- 添加 xsb.deleteOrder 接口定义
- 更新 API 类型声明以支持删除订单功能
- 修复错误处理逻辑,使用响应数据中的错误信息

feat(order): 添加订单删除和取消功能

- 实现订单取消和删除功能
- 添加订单状态文本处理逻辑
- 更新订单列表页面交互逻辑

feat(ui): 添加支付失败页面和倒计时组件

- 新增支付失败页面用于处理支付异常情况
- 集成倒计时组件用于待支付订单状态显示
- 优化订单详情页面导航配置

refactor(store): 优化用户信息获取逻辑

- 调整用户信息获取时机,在登录后获取地址信息
- 移除重复的地址获取调用

feat(commonTab): 优化分类组件初始化逻辑

- 修复分类组件默认选中逻辑
- 优化组件挂载时的初始化行为

refactor(order): 重构订单数据处理逻辑

- 将订单相关工具函数移至统一工具文件
- 删除冗余的订单数据处理文件
- 更新组件导入路径

fix(goods): 修复商品详情数据获取

- 修复商品详情接口返回数据结构处理

feat(pagination): 优化分页组件功能

- 添加追加数据模式支持
- 优化页面刷新和重新加载逻辑
zhangtao 3 天之前
父节点
当前提交
62103f3de5

+ 1 - 0
async-import.d.ts

@@ -5,6 +5,7 @@
 export {}
 
 interface ModuleMap {
+  '@/subPack-xsb/utils/order-data': typeof import('@/subPack-xsb/utils/order-data')
   [path: string]: any
 }
 

+ 2 - 0
src/api/apiDefinitions.ts

@@ -45,6 +45,8 @@ export default {
   'xsb.orderList':['GET', '/smqjh-oms/api/v1/order/orderList'],
   'xsb.orderInfo':['GET', '/smqjh-oms/api/v1/order/orderInfo'],
   'xsb.cancelOrder':['GET', '/smqjh-oms/api/v1/order/cancelOrder'],
+  'xsb.deleteOrder':['GET', '/smqjh-oms/api/v1/order/deleteOrder/{ids}'],
+
   'common.myShoppingCart':['GET', '/smqjh-oms/app-api/v1/shoppingCart/myShoppingCart'],
   'common.addShoppingCart':['POST', '/smqjh-oms/app-api/v1/shoppingCart/addShoppingCart'],
   'common.deleteShoppingCart':['DELETE', '/smqjh-oms/app-api/v1/shoppingCart/{ids}'],

+ 2 - 1
src/api/core/handlers.ts

@@ -48,7 +48,8 @@ export async function handleAlovaResponse(
 
   // Handle HTTP error status codes
   if (statusCode >= 400) {
-    globalToast.error(`服务器异常!请稍后再试: ${statusCode}`)
+    const datas = data as ApiResponse
+    globalToast.error(datas.msg as string)
     throw new ApiError(`Request failed with status: ${statusCode}`, statusCode, data)
   }
 

+ 9 - 0
src/api/globals.d.ts

@@ -314,6 +314,15 @@ declare global {
       >(
         config: Config
       ): Alova2Method<any, 'xsb.cancelOrder', Config>;
+      deleteOrder<
+        Config extends Alova2MethodConfig<any> & {
+          pathParams: {
+            ids: string;
+          }
+        }
+      >(
+        config: Config
+      ): Alova2Method<any, 'xsb.deleteOrder', Config>;
     }
     common: {
       myShoppingCart<

+ 11 - 0
src/auto-imports.d.ts

@@ -9,6 +9,7 @@ declare global {
   const Apis: typeof import('./api/index')['Apis']
   const CommonUtil: typeof import('wot-design-uni')['CommonUtil']
   const EffectScope: typeof import('vue')['EffectScope']
+  const OrderStatus: typeof import('./subPack-xsb/utils/order-data')['OrderStatus']
   const acceptHMRUpdate: typeof import('pinia')['acceptHMRUpdate']
   const alovaInstance: typeof import('./api/index')['alovaInstance']
   const api: typeof import('./api/index')['default']
@@ -47,7 +48,13 @@ declare global {
   const getCurrentInstance: typeof import('vue')['getCurrentInstance']
   const getCurrentPath: typeof import('./utils/index')['getCurrentPath']
   const getCurrentScope: typeof import('vue')['getCurrentScope']
+  const getOrderPayMent: typeof import('./subPack-xsb/utils/confirm-order')['getOrderPayMent']
+  const getWxCommonPayment: typeof import('./subPack-xsb/utils/confirm-order')['getWxCommonPayment']
   const h: typeof import('vue')['h']
+  const handleCommonCancelOrder: typeof import('./subPack-xsb/utils/order-data')['handleCommonCancelOrder']
+  const handleCommonDeleteOrder: typeof import('./subPack-xsb/utils/order-data')['handleCommonDeleteOrder']
+  const handleCommonOrderStatusText: typeof import('./subPack-xsb/utils/order-data')['handleCommonOrderStatusText']
+  const handleCommonPayMent: typeof import('./subPack-xsb/utils/confirm-order')['handleCommonPayMent']
   const ignorableWatch: typeof import('@vueuse/core')['ignorableWatch']
   const inject: typeof import('vue')['inject']
   const injectLocal: typeof import('@vueuse/core')['injectLocal']
@@ -65,6 +72,7 @@ declare global {
   const markRaw: typeof import('vue')['markRaw']
   const mountApis: typeof import('./api/createApis')['mountApis']
   const navCommonMiniProgram: typeof import('./utils/index')['navCommonMiniProgram']
+  const navTabTypeList: typeof import('./subPack-xsb/utils/order-data')['navTabTypeList']
   const nextTick: typeof import('vue')['nextTick']
   const onActivated: typeof import('vue')['onActivated']
   const onAddToFavorites: typeof import('@dcloudio/uni-app')['onAddToFavorites']
@@ -108,7 +116,10 @@ declare global {
   const onUnmounted: typeof import('vue')['onUnmounted']
   const onUpdated: typeof import('vue')['onUpdated']
   const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
+  const orderStatusList: typeof import('./subPack-xsb/utils/order-data')['orderStatusList']
   const pausableWatch: typeof import('@vueuse/core')['pausableWatch']
+  const payError: typeof import('./subPack-xsb/utils/confirm-order')['payError']
+  const paySuccess: typeof import('./subPack-xsb/utils/confirm-order')['paySuccess']
   const persistPlugin: typeof import('./store/persist')['persistPlugin']
   const provide: typeof import('vue')['provide']
   const provideLocal: typeof import('@vueuse/core')['provideLocal']

+ 1 - 0
src/components.d.ts

@@ -20,6 +20,7 @@ declare module 'vue' {
     WdCheckbox: typeof import('wot-design-uni/components/wd-checkbox/wd-checkbox.vue')['default']
     WdCheckboxGroup: typeof import('wot-design-uni/components/wd-checkbox-group/wd-checkbox-group.vue')['default']
     WdConfigProvider: typeof import('wot-design-uni/components/wd-config-provider/wd-config-provider.vue')['default']
+    WdCountDown: typeof import('wot-design-uni/components/wd-count-down/wd-count-down.vue')['default']
     WdDivider: typeof import('wot-design-uni/components/wd-divider/wd-divider.vue')['default']
     WdIcon: typeof import('wot-design-uni/components/wd-icon/wd-icon.vue')['default']
     WdInput: typeof import('wot-design-uni/components/wd-input/wd-input.vue')['default']

+ 14 - 3
src/pages.json

@@ -139,6 +139,15 @@
             "navigationBarTitleText": "订单列表"
           }
         },
+        {
+          "path": "orderDetaile/index",
+          "type": "page",
+          "name": "xsb-orderDetaile",
+          "islogin": true,
+          "style": {
+            "navigationBarTitleText": "订单详情"
+          }
+        },
         {
           "path": "search/index",
           "type": "page",
@@ -228,12 +237,14 @@
           }
         },
         {
-          "path": "orderDetaile/index",
+          "path": "payError/index",
           "type": "page",
-          "name": "common-orderDetaile",
+          "name": "common-payError",
           "islogin": true,
           "style": {
-            "navigationBarTitleText": "订单详情"
+            "navigationBarTitleText": "支付失败",
+            "navigationStyle": "custom",
+            "disableScroll": true
           }
         },
         {

+ 2 - 2
src/store/user.ts

@@ -46,6 +46,8 @@ export const useUserStore = defineStore('user', {
       if (this.token) {
         const { data } = await api.sys.userInfo({})
         this.userInfo = data
+        await this.getuserAddresslist()
+        this.getSelectedAddress()
       }
     },
     async updataUserInfo(data: Api.userInfo) {
@@ -54,8 +56,6 @@ export const useUserStore = defineStore('user', {
       uni.hideLoading()
       useGlobalToast().show({ msg: '修改成功' })
       this.getUserInfo()
-      this.getuserAddresslist()
-      this.getSelectedAddress()
     },
     /**
      * 获取用户收货地址列表

+ 0 - 274
src/subPack-common/orderDetaile/index.vue

@@ -1,274 +0,0 @@
-<script setup lang="ts">
-import { StaticUrl } from '@/config'
-import router from '@/router'
-
-definePage({
-  name: 'common-orderDetaile',
-  islogin: true,
-  style: {
-    navigationBarTitleText: '订单详情',
-  },
-})
-const collapse = ref(false)
-const orderInfo = ref<Api.xsbOrderList>()
-onLoad((options: any) => {
-  getDetail(options.id)
-})
-async function getDetail(id: string) {
-  const { data } = await Apis.xsb.orderInfo({
-    data: {
-      orderNo: id,
-    },
-  })
-  orderInfo.value = data
-}
-
-function handleCollapse() {
-  collapse.value = !collapse.value
-}
-</script>
-
-<template>
-  <view class="page-xsb">
-    <view class="px24rpx pt20rpx">
-      <view class="text-36rpx font-semibold">
-        <view>
-          <view>
-            请在 <text class="text-#FF4D3A">
-              14分59秒
-            </text> 内支付
-          </view>
-          <view class="mt20rpx text-28rpx text-#AAAAAA">
-            现在支付:预计10:40-10:55送达
-          </view>
-          <view class="btn mt20rpx flex items-center justify-between">
-            <view class="info-btn mr20rpx w226rpx">
-              <wd-button type="info">
-                取消订单1
-              </wd-button>
-            </view>
-            <view class="ml20rpx flex-1">
-              <wd-button>
-                立即支付¥119
-              </wd-button>
-            </view>
-          </view>
-        </view>
-        <view class="flex items-center" @click="handleCollapse">
-          <view class="mr10rpx">
-            待商家接单
-          </view>
-          <view :class="[collapse ? 'rotate-90' : '']">
-            <wd-icon name="arrow-right" size="22px" />
-          </view>
-        </view>
-      </view>
-    </view>
-    <view class="mt20rpx">
-      <wd-card>
-        <view class="grid grid-cols-5 py24rpx text-28rpx text-#222">
-          <view class="flex flex-col items-center">
-            <image
-              :src="`${StaticUrl}/orderDetaile-del.png`"
-              class="h40rpx w40rpx"
-            />
-            <view class="mt20rpx">
-              删除订单
-            </view>
-          </view>
-          <view class="flex flex-col items-center">
-            <image
-              :src="`${StaticUrl}/orderDetaile-wx.png`"
-              class="h40rpx w40rpx"
-            />
-            <view class="mt20rpx">
-              联系商家
-            </view>
-          </view>
-          <view class="flex flex-col items-center" @click="router.push({ name: 'common-afterSales' })">
-            <image
-              :src="`${StaticUrl}/orderDetaile-shou.png`"
-              class="h40rpx w40rpx"
-            />
-            <view class="mt20rpx">
-              申请售后
-            </view>
-          </view>
-          <view class="flex flex-col items-center" @click="router.push({ name: 'common-revalue' })">
-            <image
-              :src="`${StaticUrl}/orderDetaile-pj.png`"
-              class="h40rpx w40rpx"
-            />
-            <view class="mt20rpx">
-              评价晒单
-            </view>
-          </view>
-          <view class="flex flex-col items-center">
-            <image
-              :src="`${StaticUrl}/orderDetaile-bao.png`"
-              class="h40rpx w40rpx"
-            />
-            <view class="mt20rpx">
-              再次购买
-            </view>
-          </view>
-        </view>
-      </wd-card>
-    </view>
-    <view class="mt20rpx">
-      <wd-card>
-        <view class="py28rpx">
-          <view class="flex items-center">
-            <image
-              :src="`${StaticUrl}/orderDetaile-user.png`"
-              class="mr20rpx h40rpx w40rpx"
-            />
-            <view class="text-32rpx text-#222 font-semibold">
-              {{ orderInfo?.consigneeName }} {{ orderInfo?.consigneeMobile }}
-            </view>
-          </view>
-          <view class="mt20rpx text-28rpx text-#AAAAAA">
-            {{ orderInfo?.consigneeAddress }}
-          </view>
-        </view>
-      </wd-card>
-    </view>
-    <view class="mt20rpx">
-      <wd-card>
-        <template #title>
-          <view class="flex items-center">
-            <image
-              :src="`${StaticUrl}/order-icon.png`"
-              class="h36rpx w36rpx"
-            />
-            <view class="ml20rpx text-32rpx font-semibold">
-              {{ orderInfo?.shopName }}
-            </view>
-          </view>
-          <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
-        </template>
-        <CollapsePanel :line-height="150">
-          <view v-for="item in orderInfo?.orderItemList" :key="item.skuId" class="mb20rpx w-full flex items-center">
-            <view class="mr20rpx w120rpx flex-shrink-0">
-              <image
-                :src="item.pic"
-                class="h120rpx w120rpx"
-              />
-            </view>
-            <view class="flex-1">
-              <view class="w-full flex items-center justify-between font-semibold">
-                <view class="text-28rpx">
-                  {{ item.skuName }}
-                </view>
-                <view class="text-32rpx text-#FF4D3A">
-                  ¥{{ item.price }}
-                </view>
-              </view>
-              <view class="text-24rpx text-#AAAAAA">
-                规格:{{ item.spec }}
-              </view>
-              <view class="text-24rpx text-#AAAAAA">
-                ×{{ item.prodCount }}
-              </view>
-            </view>
-          </view>
-        </CollapsePanel>
-
-        <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
-        <view class="mt24rpx flex items-center justify-between">
-          <view class="text-28rpx">
-            商品金额
-          </view>
-          <view class="text-#FF4A39 font-semibold">
-            ¥{{ orderInfo?.total }}
-          </view>
-        </view>
-        <view class="mt24rpx flex items-center justify-between">
-          <view class="text-28rpx">
-            配送费(即时配送)
-          </view>
-          <view class="text-#FF4A39 font-semibold">
-            ¥{{ orderInfo?.freightAmount }}
-          </view>
-        </view>
-        <view class="mt24rpx flex items-center justify-between">
-          <view class="text-28rpx">
-            积分
-          </view>
-          <view class="text-#FF4A39 font-semibold">
-            -¥{{ Number(orderInfo?.offsetPoints) / 100 }}
-          </view>
-        </view>
-        <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
-        <template #footer>
-          <view class="flex items-center justify-end">
-            <view class="text-28rpx">
-              总计233.5 共减2.5
-            </view>
-            <view class="ml20rpx text-28rpx text-#FF4D3A font-semibold">
-              需付款¥54.00
-            </view>
-          </view>
-        </template>
-      </wd-card>
-    </view>
-    <view class="mt20rpx">
-      <wd-card title="订单信息">
-        <view class="pb20rpx">
-          <view class="mb28rpx flex items-center justify-between">
-            <view class="text-28rpx text-#AAAAAA">
-              订单编号
-            </view>
-            <view class="flex items-center">
-              <text class="text-#222">
-                {{ orderInfo?.orderNumber }}
-              </text>
-              <view class="ml10rpx">
-                <wd-icon name="file-copy" size="22px" />
-              </view>
-            </view>
-          </view>
-          <view class="mb28rpx flex items-center justify-between">
-            <view class="text-28rpx text-#AAAAAA">
-              支付方式
-            </view>
-            <view class="text-#222">
-              微信支付
-            </view>
-          </view>
-          <view class="mb28rpx flex items-center justify-between">
-            <view class="text-28rpx text-#AAAAAA">
-              下单时间
-            </view>
-            <view class="text-#222">
-              {{ orderInfo?.createTime }}
-            </view>
-          </view>
-          <view class="mb28rpx flex items-center justify-between">
-            <view class="text-28rpx text-#AAAAAA">
-              备注信息
-            </view>
-            <view class="text-#222">
-              {{ orderInfo?.remarks || '无' }}
-            </view>
-          </view>
-        </view>
-      </wd-card>
-    </view>
-    <view class="h30rpx" />
-  </view>
-</template>
-
-<style scoped lang="scss">
-.page-xsb {
-  :deep(){
-    .info-btn .wd-button{
-      background: #fff !important;
-      color: #aaa !important;
-    }
-    .btn .wd-button{
-      width: 100% !important;
-    }
-  }
-}
-</style>

+ 73 - 0
src/subPack-common/payError/index.vue

@@ -0,0 +1,73 @@
+<script setup lang="ts">
+import router from '@/router'
+import { StaticUrl } from '@/config'
+
+definePage({
+  name: 'common-payError',
+  islogin: true,
+  style: {
+    navigationBarTitleText: '支付失败',
+    navigationStyle: 'custom',
+    disableScroll: true,
+  },
+})
+const { paySuccessPath, payBackIndexPath } = storeToRefs(useSysStore())
+
+function handleBackIndex() {
+  const pages = getCurrentPages()
+  const targetPageIndex = pages.findIndex(page => page.route === unref(payBackIndexPath))
+
+  if (targetPageIndex !== -1) {
+    const delta = pages.length - targetPageIndex - 1
+    router.back({ delta, animationType: 'fade-out' })
+  }
+  else {
+    // 如果未找到目标页面,则跳转到首页
+    router.back({ delta: pages.length, animationType: 'fade-out' })
+  }
+}
+</script>
+
+<template>
+  <view class="pages">
+    <wd-navbar
+      title="支付成功" custom-style="background-color:transparent !important" :bordered="false" :z-index="99"
+
+      safe-area-inset-top left-arrow fixed
+      @click-left="router.back()"
+    />
+    <view class="header-line h406rpx" />
+    <view class="-mt200rpx">
+      <view class="flex flex-col items-center">
+        <image
+          :src="`${StaticUrl}/pay-error.png`"
+          class="h200rpx w200rpx"
+        />
+        <view class="mt20rpx text-32rpx font-semibold">
+          支付失败
+        </view>
+        <view class="mt60rpx flex items-center">
+          <wd-button
+            type="info" block size="large" @click=" router.push({ name: paySuccessPath })"
+          >
+            <text class="text-32rpx font-semibold">
+              查看订单
+            </text>
+          </wd-button>
+          <view class="mx20rpx" />
+          <wd-button block size="large" @click="handleBackIndex">
+            <text class="text-32rpx font-semibold">
+              返回首页
+            </text>
+          </wd-button>
+        </view>
+      </view>
+    </view>
+  </view>
+</template>
+
+<style scoped>
+.header-line{
+  background: linear-gradient( 179deg, rgba(190,255,13,0.4) 0%, rgba(220,255,125,0.2) 49%, rgba(158,214,5,0) 100%);
+}
+</style>

+ 1 - 1
src/subPack-smqjh/order/index.vue

@@ -23,7 +23,7 @@ function handleChangeStatus(value: number) {
 }
 function handleClick() {
   console.log(12)
-  router.push({ name: 'common-orderDetaile' })
+  router.push({ name: 'xsb-orderDetaile' })
 }
 </script>
 

+ 2 - 0
src/subPack-xsb/commonTab/components/classfiy.vue

@@ -116,6 +116,8 @@ function handleAddCart(event: WechatMiniprogram.TouchEvent, item: Api.xsbCategor
   }, 500)
 }
 onMounted(async () => {
+  topNavActive.value = props.categoryList[0].code || ''
+  leftActive.value = props.categoryList[0].children[0].code || ''
   if (leftActive.value) {
     handleChange({ value: leftActive.value })
   }

+ 15 - 10
src/subPack-xsb/commonTab/index.vue

@@ -22,7 +22,7 @@ definePage({
     disableScroll: true,
   },
 })
-const { ScrollDown, topNavActive, leftActive, backTop, SelectShopInfo } = storeToRefs(useSysXsbStore())
+const { ScrollDown, backTop, SelectShopInfo } = storeToRefs(useSysXsbStore())
 const { userInfo } = storeToRefs(useUserStore())
 const commonCategoryData = ref<Api.xsbCategories[]>([])
 const { data: goodsList, isLastPage, page, error, refresh } = usePagination((pageNum, pageSize) =>
@@ -73,8 +73,7 @@ async function getCategories() {
   console.log(res, 'dassdad')
 
   commonCategoryData.value = res.data
-  topNavActive.value = res.data[0].code
-  leftActive.value = res.data[0].children[0].code
+
   loading.value = false
 }
 async function getCurrentImg() {
@@ -87,16 +86,22 @@ async function getSearchData(type: number) {
 }
 
 onMounted(async () => {
-
-})
-onShow(async () => {
   await useSysXsbStore().getAllShopList()
-  getCurrentImg()
-  getCategories()
   hotText.value = await getSearchData(2)
   recommendText.value = await getSearchData(3)
+  getCurrentImg()
   refresh()
-  useXsbCartStore().getCartList()
+  getCategories()
+})
+
+watch(() => SelectShopInfo.value.shopId, () => {
+  refresh()
+  getCategories()
+})
+onShow(() => {
+  setTimeout(() => {
+    useXsbCartStore().getCartList()
+  }, 2000)
 })
 onShareAppMessage(() => {
   return {
@@ -132,7 +137,7 @@ function handleScrollBottom() {
     <classfiy v-if="tabbarName == 'xsb-classfiy'" :category-list="commonCategoryData" :hot-text="hotText" />
     <my v-if="tabbarName == 'xsb-my'" />
     <wd-tabbar
-      :model-value="tabbarName" placeholder safe-area-inset-bottom fixed :bordered="false"
+      :model-value="tabbarName" safe-area-inset-bottom placeholder fixed :bordered="false"
       custom-class="custom-tab"
       :custom-style="`box-shadow:${tabbarName == 'xsb-cart' || tabbarName == 'xsb-classfiy' ? '' : ' 0rpx -6rpx 12rpx 2rpx rgba(0, 0, 0, 0.09)'}`"
       :z-index="99999"

+ 3 - 1
src/subPack-xsb/confirmOrder/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { getOrderPayMent, getWxCommonPayment, handleCommonPayMent, paySuccess } from '.'
+import { getOrderPayMent, getWxCommonPayment, handleCommonPayMent, payError, paySuccess } from '../utils/confirm-order'
 import router from '@/router'
 
 definePage({
@@ -49,6 +49,7 @@ async function handlePay() {
     const res = await handleCommonPayMent(orderNumber)
     if (res.payType !== 1) {
       await getWxCommonPayment(res)
+      paySuccess()
     }
     else {
       paySuccess()
@@ -56,6 +57,7 @@ async function handlePay() {
     isPay.value = false
   }
   catch {
+    payError()
     isPay.value = false
   }
   // router.replace({ name: 'common-paySuccess' })

+ 2 - 2
src/subPack-xsb/goods/index.vue

@@ -88,8 +88,8 @@ function handleGoCurren(id: number) {
 async function getGoodsDetaile() {
   const res = await Apis.xsb.getProductDetail({ data: { id: goodsId.value, shopId: Number(SelectShopInfo.value?.shopId), channelId: userInfo.value.channelId || 1 } })
   console.log(res, '请求')
-  goodsInfo.value = res
-  specId.value = res.skuList?.[0].skuId
+  goodsInfo.value = res.data
+  specId.value = res.data.skuList?.[0].skuId
 }
 function handleConfimOrder() {
   if (Number(unref(goodsInfo)?.spuStock) < unref(SelectGoodsNum)) {

+ 68 - 33
src/subPack-xsb/order/index.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
-import { navTabTypeList, orderStatusList } from './order-data'
+import { getWxCommonPayment, handleCommonPayMent } from '../utils/confirm-order'
+import { OrderStatus, handleCommonCancelOrder, handleCommonDeleteOrder, handleCommonOrderStatusText, navTabTypeList, orderStatusList } from '../utils/order-data'
 import { StaticUrl } from '@/config'
 import router from '@/router'
 
@@ -14,7 +15,7 @@ definePage({
 const navActiveTab = ref(0)
 const orderStatusActive = ref('all') // 我的订单 all-全部 paddingPay-待支付 ing-进行中 completed-已完成 cancel-已取消
 
-const { data: orderList, refresh, isLastPage, page } = usePagination((pageNum, pageSize) => Apis.xsb.orderList({ data: {
+const { data: orderList, refresh, isLastPage, page, reload } = usePagination((pageNum, pageSize) => Apis.xsb.orderList({ data: {
   businessType: 'XSB',
   orderStatus: unref(orderStatusActive),
   pageNum,
@@ -26,26 +27,41 @@ const { data: orderList, refresh, isLastPage, page } = usePagination((pageNum, p
   pageSize: 10,
   initialData: [],
   data: res => res.data?.list,
+  append: true,
 })
 function handleChangeTypeNav(value: number) {
-  orderList.value = []
-
   navActiveTab.value = value
-  refresh()
+  reload()
 }
 function handleChangeStatus(value: string) {
-  orderList.value = []
   orderStatusActive.value = value
-  refresh()
+  reload()
 }
 function handleClick(item: Api.xsbOrderList) {
-  router.push({ name: 'common-orderDetaile', params: { id: String(item.orderNumber) } })
+  router.push({ name: 'xsb-orderDetaile', params: { id: String(item.orderNumber) } })
 }
 onReachBottom(() => {
   if (!isLastPage.value) {
     page.value++
   }
 })
+async function handlePay(orderNumber: string) {
+  const res = await handleCommonPayMent(orderNumber)
+  if (res.payType !== 1) {
+    await getWxCommonPayment(res)
+  }
+  else {
+    refresh()
+  }
+}
+async function handleCancel(order: Api.xsbOrderList) {
+  await handleCommonCancelOrder(order)
+  refresh()
+}
+async function handleDel(order: Api.xsbOrderList) {
+  await handleCommonDeleteOrder(order)
+  refresh()
+}
 </script>
 
 <template>
@@ -75,25 +91,29 @@ onReachBottom(() => {
         </view>
       </view>
     </view>
-    <view v-for="item in orderList" :key="item.shopId" class="mt20rpx" @click="handleClick(item)">
-      <wd-card>
-        <template #title>
-          <view class="flex items-center justify-between">
-            <view class="flex items-center">
-              <image :src="`${StaticUrl}/order-icon.png`" class="h36rpx w36rpx" />
-              <view class="ml20rpx text-32rpx font-semibold">
-                {{ item.shopName }}
-              </view>
-            </view>
-            <view class="text-24rpx text-#FF4D3A">
-              <!-- {{ handleCommonOrderStatusText(item) }} -->
+    <view class="px24rpx">
+      <view v-for="item in orderList" :key="item.shopId" class="mt20rpx rounded-16rpx bg-white p24rpx">
+        <view class="w-full flex items-center justify-between">
+          <view class="flex items-center">
+            <image :src="`${StaticUrl}/order-icon.png`" class="h36rpx w36rpx" />
+            <view class="ml20rpx text-32rpx font-semibold">
+              {{ item.shopName }}
             </view>
           </view>
-          <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
-        </template>
-
+          <view class="text-24rpx text-#FF4D3A">
+            <template v-if="item.hbOrderStatus === OrderStatus.PaddingPay">
+              <view class="flex items-center">
+                待支付( 还剩 <wd-count-down :time="handleCommonOrderStatusText(item)" @finish="refresh" /> )
+              </view>
+            </template>
+            <text v-else>
+              {{ handleCommonOrderStatusText(item) }}
+            </text>
+          </view>
+        </view>
+        <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
         <view>
-          <view class="mb20rpx box-border rounded-16rpx bg-#F9F9F9 p24rpx">
+          <!-- <view class="mb20rpx box-border rounded-16rpx bg-#F9F9F9 p24rpx">
             <view class="flex items-center">
               <image :src="`${StaticUrl}/order-car.png`" class="h36rpx w36rpx" />
               <view class="ml20rpx text-28rpx text-#222 font-semibold">
@@ -106,8 +126,8 @@ onReachBottom(() => {
             <view class="mt20rpx">
               2025-03-26 11:56:07
             </view>
-          </view>
-          <view class="box-border h176rpx w-full flex items-center justify-between rounded-16rpx bg-#F9F9F9">
+          </view> -->
+          <view class="box-border h176rpx w-full flex items-center justify-between rounded-16rpx bg-#F9F9F9" @click="handleClick(item)">
             <view class="box-border h-full w480rpx py28rpx pl20rpx">
               <scroll-view scroll-x class="h-full w-full whitespace-nowrap">
                 <view class="flex items-center">
@@ -127,19 +147,29 @@ onReachBottom(() => {
             </view>
           </view>
         </view>
-        <template #footer>
-          <view class="flex items-center justify-end">
-            <wd-button size="small" plain type="info">
+        <view class="mt24rpx flex items-center justify-end">
+          <template v-if="item.hbOrderStatus === OrderStatus.PaddingPay">
+            <wd-button size="small" plain type="info" @click.stop="handleCancel(item)">
               取消订单
             </wd-button>
             <view class="ml20rpx">
-              <wd-button size="small" plain type="error">
+              <wd-button size="small" plain type="error" @click.stop="handlePay(item.orderNumber as string)">
                 付款
               </wd-button>
             </view>
-          </view>
-        </template>
-      </wd-card>
+          </template>
+          <template v-if="item.hbOrderStatus === OrderStatus.OrderCancel">
+            <wd-button size="small" plain type="info" @click.stop="handleDel(item)">
+              删除订单
+            </wd-button>
+            <view class="ml20rpx">
+              <wd-button size="small" plain type="error" @click.stop="handleDel(item)">
+                再次购买
+              </wd-button>
+            </view>
+          </template>
+        </view>
+      </view>
     </view>
     <wd-status-tip v-if="!orderList.length" image="content" tip="暂无内容" />
     <view class="h-20rpx" />
@@ -152,6 +182,11 @@ onReachBottom(() => {
     .wd-button.is-plain.is-error {
       color: #FF4D3A !important;
     }
+    .wd-count-down{
+      color: #FF4D3A ;
+      font-size: 700 !important;
+      line-height: unset !important;
+    }
   }
 
   .box-shadow {

+ 0 - 40
src/subPack-xsb/order/order-data.ts

@@ -1,40 +0,0 @@
-export const navTabTypeList = [
-  { name: '全部', value: 0 },
-  { name: '配送(外卖)', value: 1 },
-  { name: '快递', value: 2 },
-]
-
-export const orderStatusList = [
-  { name: '全部', value: 'all' },
-  { name: '待支付', value: 'paddingPay' },
-  { name: '进行中', value: 'ing' },
-  { name: '已完成', value: 'completed' },
-  { name: '已取消', value: 'cancel' },
-]
-
-/**
- * 订单状态文字统一处理
- * @param order
- *
- */
-export function handleCommonOrderStatusText(order: any) {
-  return order
-}
-
-/**
- * 统一待支付状态支付按钮逻辑处理
- * @param order
- */
-
-export function handleCommonOrderPay(order: any) {
-  return order
-}
-
-/**
- *  统一取消订单逻辑处理
- * @param order
- */
-
-export function handleCommonCancelOrder(order: any) {
-  return order
-}

+ 325 - 0
src/subPack-xsb/orderDetaile/index.vue

@@ -0,0 +1,325 @@
+<script setup lang="ts">
+import { OrderStatus, handleCommonCancelOrder, handleCommonDeleteOrder, handleCommonOrderStatusText } from '../utils/order-data'
+import { StaticUrl } from '@/config'
+import router from '@/router'
+import { getWxCommonPayment, handleCommonPayMent } from '@/subPack-xsb/utils/confirm-order'
+
+definePage({
+  name: 'xsb-orderDetaile',
+  islogin: true,
+  style: {
+    navigationBarTitleText: '订单详情',
+  },
+})
+const collapse = ref(false)
+const orderInfo = ref<Api.xsbOrderList>()
+onLoad((options: any) => {
+  getDetail(options.id)
+})
+async function getDetail(id: string) {
+  const { data } = await Apis.xsb.orderInfo({
+    data: {
+      orderNo: id,
+    },
+  })
+  orderInfo.value = data
+}
+
+function handleCollapse() {
+  collapse.value = !collapse.value
+}
+async function handleCancel() {
+  await handleCommonCancelOrder(orderInfo)
+  getDetail(String(unref(orderInfo)?.orderNumber))
+}
+async function handlePay() {
+  const res = await handleCommonPayMent(String(unref(orderInfo)?.orderNumber))
+  if (res.payType !== 1) {
+    await getWxCommonPayment(res)
+    getDetail(String(unref(orderInfo)?.orderNumber))
+  }
+  else {
+    getDetail(String(unref(orderInfo)?.orderNumber))
+  }
+}
+async function handelDel() {
+  await handleCommonDeleteOrder(unref(orderInfo) as Api.xsbOrderList)
+  router.back()
+}
+async function handleFinish() {
+  uni.showLoading({ mask: true })
+  setTimeout(async () => {
+    await getDetail(String(unref(orderInfo)?.orderNumber))
+    uni.hideLoading()
+  }, 2000)
+}
+</script>
+
+<template>
+  <view v-if="orderInfo" class="page-xsb px24rpx">
+    <view class="pt20rpx">
+      <view class="text-36rpx font-semibold">
+        <view v-if="orderInfo.hbOrderStatus === OrderStatus.PaddingPay">
+          <view class="flex items-center">
+            请在
+            <wd-count-down format="mm:ss" :time="handleCommonOrderStatusText(orderInfo)" @finish="handleFinish">
+              <template #default="{ current }">
+                <view class="flex items-center">
+                  <view> {{ current.minutes }} 分</view>
+                  <view> {{ current.seconds }} 秒</view>
+                </view>
+              </template>
+            </wd-count-down>
+            内支付
+          </view>
+          <view class="mt20rpx text-28rpx text-#AAAAAA">
+            现在支付:预计10:40-10:55送达
+          </view>
+          <view class="btn mt20rpx flex items-center justify-between">
+            <view class="info-btn mr20rpx w226rpx">
+              <wd-button type="info" @click="handleCancel">
+                取消订单
+              </wd-button>
+            </view>
+            <view class="ml20rpx flex-1">
+              <wd-button @click="handlePay">
+                立即支付¥{{ orderInfo.actualTotal }}
+              </wd-button>
+            </view>
+          </view>
+        </view>
+        <view class="flex items-center" @click="handleCollapse">
+          <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderAccepted" class="mr10rpx">
+            商家拣货中
+          </view>
+          <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderWaitDelivery" class="mr10rpx">
+            订单待配送
+          </view>
+          <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderDelivering" class="mr10rpx">
+            订单待配送中
+          </view>
+          <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderCancelAudit" class="mr10rpx">
+            订单取消审核
+          </view>
+          <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderCancel" class="mr10rpx">
+            订单取消
+          </view>
+          <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderArrived" class="mr10rpx">
+            订单已送达
+          </view>
+          <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderArrived" class="mr10rpx">
+            订单已完成
+          </view>
+          <view :class="[collapse ? 'rotate-90' : '']">
+            <wd-icon name="arrow-right" size="22px" />
+          </view>
+        </view>
+        <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderCancel" class="mt20rpx text-28rpx text-#AAAAAA">
+          取消原因:{{ orderInfo.cancelReason }}
+        </view>
+      </view>
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white p24rpx">
+      <view class="grid grid-cols-5 text-28rpx text-#222">
+        <view v-if="[OrderStatus.OrderCancel, OrderStatus.OrderCompleted].includes(Number(orderInfo.hbOrderStatus)) " class="flex flex-col items-center" @click="handelDel">
+          <image
+            :src="`${StaticUrl}/orderDetaile-del.png`"
+            class="h40rpx w40rpx"
+          />
+          <view class="mt20rpx">
+            删除订单
+          </view>
+        </view>
+        <view class="flex flex-col items-center overflow-hidden">
+          <image
+            :src="`${StaticUrl}/orderDetaile-wx.png`"
+            class="h40rpx w40rpx"
+          />
+          <wd-button class="zbutton" open-type="contact" type="text">
+            <view class="mt15rpx text-28rpx text-#222">
+              联系商家
+            </view>
+          </wd-button>
+        </view>
+
+        <!-- <view class="flex flex-col items-center" @click="router.push({ name: 'common-afterSales' })">
+          <image
+            :src="`${StaticUrl}/orderDetaile-shou.png`"
+            class="h40rpx w40rpx"
+          />
+          <view class="mt20rpx">
+            申请售后
+          </view>
+        </view> -->
+        <!-- <view class="flex flex-col items-center" @click="router.push({ name: 'common-revalue' })">
+          <image
+            :src="`${StaticUrl}/orderDetaile-pj.png`"
+            class="h40rpx w40rpx"
+          />
+          <view class="mt20rpx">
+            评价晒单
+          </view>
+        </view> -->
+        <view class="flex flex-col items-center">
+          <image
+            :src="`${StaticUrl}/orderDetaile-bao.png`"
+            class="h40rpx w40rpx"
+          />
+          <view class="mt20rpx">
+            再次购买
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white p24rpx">
+      <view class="flex items-center">
+        <image
+          :src="`${StaticUrl}/orderDetaile-user.png`"
+          class="mr20rpx h40rpx w40rpx"
+        />
+        <view class="text-32rpx text-#222 font-semibold">
+          {{ orderInfo?.consigneeName }} {{ orderInfo?.consigneeMobile }}
+        </view>
+      </view>
+      <view class="mt20rpx text-28rpx text-#AAAAAA">
+        {{ orderInfo?.consigneeAddress }}
+      </view>
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white p24rpx">
+      <view class="flex items-center">
+        <image
+          :src="`${StaticUrl}/order-icon.png`"
+          class="h36rpx w36rpx"
+        />
+        <view class="ml20rpx text-32rpx font-semibold">
+          {{ orderInfo?.shopName }}
+        </view>
+      </view>
+      <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
+      <CollapsePanel :line-height="150">
+        <view v-for="item in orderInfo?.orderItemList" :key="item.skuId" class="mb20rpx w-full flex items-center">
+          <view class="mr20rpx w120rpx flex-shrink-0">
+            <image
+              :src="item.pic"
+              class="h120rpx w120rpx"
+            />
+          </view>
+          <view class="flex-1">
+            <view class="w-full flex items-center justify-between font-semibold">
+              <view class="text-28rpx">
+                {{ item.skuName }}
+              </view>
+              <view class="text-32rpx text-#FF4D3A">
+                ¥{{ item.price }}
+              </view>
+            </view>
+            <view class="text-24rpx text-#AAAAAA">
+              规格:{{ item.spec }}
+            </view>
+            <view class="text-24rpx text-#AAAAAA">
+              ×{{ item.prodCount }}
+            </view>
+          </view>
+        </view>
+      </CollapsePanel>
+
+      <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
+      <view class="mt24rpx flex items-center justify-between">
+        <view class="text-28rpx">
+          商品金额
+        </view>
+        <view class="text-#FF4A39 font-semibold">
+          ¥{{ orderInfo?.total }}
+        </view>
+      </view>
+      <view class="mt24rpx flex items-center justify-between">
+        <view class="text-28rpx">
+          配送费(即时配送)
+        </view>
+        <view class="text-#FF4A39 font-semibold">
+          ¥{{ orderInfo?.freightAmount }}
+        </view>
+      </view>
+      <view class="mt24rpx flex items-center justify-between">
+        <view class="text-28rpx">
+          积分
+        </view>
+        <view class="text-#FF4A39 font-semibold">
+          -¥{{ Number(orderInfo?.offsetPoints) / 100 }}
+        </view>
+      </view>
+      <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
+      <view class="flex items-center justify-end">
+        <view class="text-28rpx">
+          总计{{ orderInfo.actualTotal }} 共减 {{ Number(orderInfo.offsetPoints) / 100 }}
+        </view>
+        <view class="ml20rpx text-28rpx text-#FF4D3A font-semibold">
+          {{ [OrderStatus.PaddingPay, OrderStatus.OrderCancel].includes(Number(orderInfo.hbOrderStatus)) ? '需' : '实' }}付款¥{{ orderInfo.actualTotal }}
+        </view>
+      </view>
+    </view>
+    <view class="mt20rpx rounded-16rpx bg-white p24rpx">
+      <view class="mb24rpx text-28rpx font-semibold">
+        订单信息
+      </view>
+      <view class="pb20rpx">
+        <view class="mb28rpx flex items-center justify-between">
+          <view class="text-28rpx text-#AAAAAA">
+            订单编号
+          </view>
+          <view class="flex items-center">
+            <text class="text-#222">
+              {{ orderInfo?.orderNumber }}
+            </text>
+            <view class="ml10rpx">
+              <wd-icon name="file-copy" size="22px" />
+            </view>
+          </view>
+        </view>
+        <view class="mb28rpx flex items-center justify-between">
+          <view class="text-28rpx text-#AAAAAA">
+            支付方式
+          </view>
+          <view class="text-#222">
+            微信支付
+          </view>
+        </view>
+        <view class="mb28rpx flex items-center justify-between">
+          <view class="text-28rpx text-#AAAAAA">
+            下单时间
+          </view>
+          <view class="text-#222">
+            {{ orderInfo?.createTime }}
+          </view>
+        </view>
+        <view class="mb28rpx flex items-center justify-between">
+          <view class="text-28rpx text-#AAAAAA">
+            备注信息
+          </view>
+          <view class="text-#222">
+            {{ orderInfo?.remarks || '无' }}
+          </view>
+        </view>
+      </view>
+    </view>
+    <view class="h30rpx" />
+  </view>
+</template>
+
+<style scoped lang="scss">
+.page-xsb {
+  :deep(){
+    .info-btn .wd-button{
+      background: #fff !important;
+      color: #aaa !important;
+    }
+    .btn .wd-button{
+      width: 100% !important;
+    }
+    .wd-count-down{
+      color: #FF4D3A  !important;
+      font-size: 36rpx !important;
+    }
+  }
+}
+</style>

+ 0 - 4
src/subPack-xsb/selectAddress/index.vue

@@ -18,10 +18,6 @@ const allShopList = computed(() => {
   return shopList.value?.filter(it => it.shopId !== SelectShopInfo.value?.shopId)
 })
 
-onMounted(() => {
-  useSysXsbStore().getAllShopList()
-})
-
 function handleClick(item: Api.xsbShopList) {
   SelectShopInfo.value = item
   router.back()

+ 4 - 2
src/subPack-xsb/store-xsb/sys.ts

@@ -45,6 +45,10 @@ export const useSysXsbStore = defineStore('system-xsb', {
     },
     async getAllShopList() {
       return new Promise((resolve, reject) => {
+        if (this.xsbShopList.length) {
+          resolve(1)
+          return
+        }
         Apis.xsb.shopList({}).then((res) => {
           this.xsbShopList = res.data
           const { Location } = storeToRefs(useAddressStore())
@@ -71,10 +75,8 @@ export const useSysXsbStore = defineStore('system-xsb', {
                 Number(shop.shopLat),
                 Number(shop.shopLng),
               )
-
               if (distance < minDistance) {
                 minDistance = distance
-                // nearbyAddress.value = { ...shop, distance: Number(distance.toFixed(2)) }
                 this.SelectShopInfo = { ...shop, distance: Number(distance.toFixed(2)) }
               }
             }

+ 10 - 3
src/subPack-xsb/confirmOrder/index.ts → src/subPack-xsb/utils/confirm-order.ts

@@ -56,8 +56,6 @@ export function getOrderPayMent(businessType: string, dvyType: number, shopId: n
  */
 
 export function getWxCommonPayment(orderPay: wxpay) {
-  console.log(orderPay, 'orderInfo')
-
   uni.showLoading({ mask: true })
   return new Promise((resolve, reject) => {
     const orderInfo = {
@@ -73,7 +71,6 @@ export function getWxCommonPayment(orderPay: wxpay) {
       orderInfo,
       ...orderInfo,
       success(res) {
-        paySuccess()
         resolve(res)
       },
       fail(e) {
@@ -98,3 +95,13 @@ export function paySuccess() {
   payBackIndexPath.value = 'subPack-xsb/commonTab/index'
   router.replace({ name: 'common-paySuccess' })
 }
+/**
+ * 星闪豹
+ * 支付成功统一跳转
+ */
+export function payError() {
+  const { paySuccessPath, payBackIndexPath } = storeToRefs(useSysStore())
+  paySuccessPath.value = 'xsb-order'
+  payBackIndexPath.value = 'subPack-xsb/commonTab/index'
+  router.replace({ name: 'common-payError' })
+}

+ 132 - 0
src/subPack-xsb/utils/order-data.ts

@@ -0,0 +1,132 @@
+import { dayjs } from 'wot-design-uni'
+
+export const navTabTypeList = [
+  { name: '全部', value: 0 },
+  { name: '配送(外卖)', value: 1 },
+  { name: '快递', value: 2 },
+]
+
+export const orderStatusList = [
+  { name: '全部', value: 'all' },
+  { name: '待支付', value: 'paddingPay' },
+  { name: '进行中', value: 'ing' },
+  { name: '已完成', value: 'completed' },
+  { name: '已取消', value: 'cancel' },
+]
+export enum OrderStatus {
+  /**
+   * 待支付
+   */
+  PaddingPay = 0,
+  /**
+   * 订单已接单
+   */
+  OrderAccepted = 20,
+  /**
+   * 订单待配送
+   */
+  OrderWaitDelivery = 30,
+  /**
+   * 订单配送中
+   */
+  OrderDelivering = 40,
+  /**
+   * 订单取消审核
+   */
+  OrderCancelAudit = 50,
+  /**
+   * 订单取消
+   */
+  OrderCancel = 60,
+  /**
+   * 订单已送达
+   */
+  OrderArrived = 70,
+  /**
+   * 订单完成
+   */
+  OrderCompleted = 80,
+}
+
+/**
+ * 订单状态文字统一处理
+ * @param order
+ *
+ */
+export function handleCommonOrderStatusText(order: Api.xsbOrderList): any {
+  if (order.hbOrderStatus === OrderStatus.PaddingPay) {
+    const endTime = dayjs(order.createTime).add(15, 'minutes')
+    const remaining = dayjs(endTime).valueOf() - dayjs().valueOf()
+    return Math.max(0, remaining) // 确保不会返回负数
+  }
+
+  if (order.hbOrderStatus === OrderStatus.OrderAccepted) {
+    return '订单已接单'
+  }
+  if (order.hbOrderStatus === OrderStatus.OrderWaitDelivery) {
+    return '订单待配送'
+  }
+  if (order.hbOrderStatus === OrderStatus.OrderDelivering) {
+    return '订单配送中'
+  }
+  if (order.hbOrderStatus === OrderStatus.OrderCancelAudit) {
+    return '订单取消审核'
+  }
+  if (order.hbOrderStatus === OrderStatus.OrderCancel) {
+    return '订单取消'
+  }
+  if (order.hbOrderStatus === OrderStatus.OrderArrived) {
+    return '订单已送达'
+  }
+  if (order.hbOrderStatus === OrderStatus.OrderCompleted) {
+    return '订单完成'
+  }
+  return '未知订单状态'
+}
+
+/**
+ *  统一取消订单逻辑处理
+ * @param order
+ */
+export function handleCommonCancelOrder(order: Api.xsbOrderList) {
+  return new Promise((resolve, reject) => {
+    useGlobalMessage().confirm({
+      title: '取消订单',
+      msg: '确定要取消订单吗?',
+      success: async () => {
+        uni.showLoading({ mask: true })
+        Apis.xsb.cancelOrder({
+          data: {
+            orderNo: String(order.orderNumber),
+          },
+        }).then(res => resolve(res)).catch(err => reject(err)).finally(() => uni.hideLoading())
+      },
+      fail: async (err) => {
+        reject(err)
+      },
+    })
+  })
+}
+
+/**
+ * 统一删除订单
+ */
+export function handleCommonDeleteOrder(order: Api.xsbOrderList) {
+  return new Promise((resolve, reject) => {
+    useGlobalMessage().confirm({
+      title: '删除订单',
+      msg: '确定要删除该订单吗?',
+      success: async () => {
+        uni.showLoading({ mask: true })
+        Apis.xsb.deleteOrder({
+          pathParams: {
+            ids: String(order.orderId),
+          },
+        }).then(res => resolve(res)).catch(err => reject(err)).finally(() => uni.hideLoading())
+      },
+      fail: async (err) => {
+        reject(err)
+      },
+    })
+  })
+}

+ 2 - 1
src/uni-pages.d.ts

@@ -13,6 +13,7 @@ type _LocationUrl =
   "/subPack-xsb/confirmOrder/index" |
   "/subPack-xsb/goods/index" |
   "/subPack-xsb/order/index" |
+  "/subPack-xsb/orderDetaile/index" |
   "/subPack-xsb/search/index" |
   "/subPack-xsb/selectAddress/index" |
   "/subPack-common/addressList/index" |
@@ -22,7 +23,7 @@ type _LocationUrl =
   "/subPack-common/editAddress/index" |
   "/subPack-common/integral/index" |
   "/subPack-common/nickName/index" |
-  "/subPack-common/orderDetaile/index" |
+  "/subPack-common/payError/index" |
   "/subPack-common/paySuccess/index" |
   "/subPack-common/revalue/index" |
   "/subPack-common/revalueSuccess/index" |