ソースを参照

feat: 添加订单列表功能和购物车规格选择

- 新增订单列表页面,实现订单状态筛选和分页加载功能
- 添加商品规格选择组件,支持多规格商品的SKU选择
- 优化购物车页面,增加商品增减和删除功能
- 实现用户登录退出功能和地址选择逻辑
- 修复API类型定义错误和请求方法问题
- 更新开发环境配置和接口定
zhangtao 1 日 前
コミット
c852c480b3

+ 1 - 0
async-import.d.ts

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

+ 5 - 1
src/api/api.type.d.ts

@@ -77,7 +77,7 @@ namespace Api {
     /**
      * 多规格
      */
-    skuList: artSkuVo[]
+    skuList: CartSkuVo[]
     /**
      * 商品库存
      */
@@ -856,6 +856,10 @@ namespace Api {
     [property: string]: any
   }
   interface AppletOrderSkuVo {
+    /**
+     * 邮费
+     */
+    transfee: number
     /**
      * offsetPoints
      */

+ 2 - 2
src/api/apiDefinitions.ts

@@ -45,8 +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}'],
-  'xsb.skuOrderConfirm':['POST', '/smqjh-oms/api/v1/order/skuOrderConfirm'],
+  'xsb.deleteOrder':['DELETE', '/smqjh-oms/api/v1/order/deleteOrder/{ids}'],
+  'xsb.skuOrderConfirm':['GET', '/smqjh-oms/api/v1/order/skuOrderConfirm'],
   'xsb.myShoppingCartCategory':['GET', '/smqjh-oms/app-api/v1/shoppingCart/myShoppingCartCategory'],
   'xsb.delivery':['GET', '/smqjh-system/app-api/v1/delivery'],
 

+ 1 - 1
src/api/globals.d.ts

@@ -290,7 +290,7 @@ declare global {
             orderStatus?: string;
             pageNum?: number;
             pageSize?: number;
-            dvyType: number | string;
+            dvyType?: number | string;
           }
         }
       >(

+ 2 - 2
src/config/index.ts

@@ -13,10 +13,10 @@ const mapEnvVersion = {
    */
   // develop: 'http://192.168.1.166:8080', // 张
   // develop: 'http://192.168.1.101:8080',
-  // develop: 'http://192.168.0.157:8080',
+  develop: 'http://192.168.0.157:8080',
   // develop: 'http://192.168.1.253:8080',
   // develop: 'http://192.168.1.89:8080', // 田
-  develop: 'http://47.109.84.152:8081',
+  // develop: 'http://47.109.84.152:8081',
   /**
    * 体验版
    */

+ 11 - 4
src/pages/cart/index.vue

@@ -15,7 +15,7 @@ definePage({
   },
 })
 const { cartList, isAddingCart } = storeToRefs(useSmqjhCartStore())
-const { smqjhSelectedAddress } = storeToRefs(useUserStore())
+const { smqjhSelectedAddress, token } = storeToRefs(useUserStore())
 const isAll = ref(false)
 const tab = ref(0)
 const selectAddress = ref(false)
@@ -151,6 +151,13 @@ function handelPay() {
     params: { data: JSON.stringify(unref(totalProduct)) },
   })
 }
+function handleSelectAddress() {
+  if (!token.value) {
+    useGlobalToast().show({ msg: '请先登录!' })
+    return
+  }
+  selectAddress.value = true
+}
 </script>
 
 <template>
@@ -160,13 +167,13 @@ function handelPay() {
       safe-area-inset-top fixed
     >
       <template #left>
-        <view class="ml10rpx flex items-center" @click.stop="selectAddress = true">
+        <view class="ml10rpx flex items-center" @click.stop="handleSelectAddress">
           <view class="mr20rpx text-36rpx font-semibold">
             购物车
           </view>
           <image :src="`${StaticUrl}/location-green.png`" class="h33.8rpx w29rpx" />
           <view class="ml10rpx max-w-280rpx truncate text-32rpx text-#222 font-semibold">
-            {{ smqjhSelectedAddress?.city }}
+            {{ smqjhSelectedAddress?.city || '请选择地址' }}
           </view>
         </view>
       </template>
@@ -261,7 +268,7 @@ function handelPay() {
             <view class="mb20rpx mt20rpx text-24rpx">
               你还没有添加商品哦~
             </view>
-            <wd-button plain>
+            <wd-button plain @click="router.pushTab({ name: 'smqjh-home' })">
               去逛逛
             </wd-button>
           </view>

+ 21 - 10
src/pages/login/index.vue

@@ -1,6 +1,7 @@
 <script setup lang="ts">
 import { createGlobalLoadingMiddleware } from '@/api/core/middleware'
 import router from '@/router'
+import { StaticUrl } from '@/config'
 
 definePage({
   name: 'smqjh-login',
@@ -37,7 +38,7 @@ async function handleGetPhone(e: UniHelper.ButtonOnGetphonenumberDetail) {
 
           router.replace({ path: redirectName.value })
         }
-      }, 2000)
+      }, 1000)
     },
   })
 }
@@ -49,20 +50,30 @@ function goBack() {
 </script>
 
 <template>
-  <view class="h80vh px24rpx">
-    <view class="mt300rpx">
-      <wd-button block size="large" open-type="getPhoneNumber" @getphonenumber="handleGetPhone">
-        手机号快捷登录
-      </wd-button>
-      <view class="mt20rpx">
-        <wd-button block size="large" type="info" @click="goBack">
-          暂不登录
+  <view class="header px24rpx">
+    <view class="pt150rpx">
+      <view class="w-full flex items-center justify-center">
+        <image
+          :src="`${StaticUrl}/smqjh-logo.png`"
+          class="h120rpx w120rpx"
+        />
+      </view>
+      <view class="mt50rpx">
+        <wd-button block size="large" open-type="getPhoneNumber" @getphonenumber="handleGetPhone">
+          手机号快捷登录
         </wd-button>
+        <view class="mt40rpx">
+          <wd-button block size="large" type="info" @click="goBack">
+            暂不登录
+          </wd-button>
+        </view>
       </view>
     </view>
   </view>
 </template>
 
 <style scoped>
-
+.header{
+  height: calc(100vh - var(--window-top));
+}
 </style>

+ 25 - 1
src/pages/my/index.vue

@@ -21,6 +21,25 @@ onMounted(() => {
   useUserStore().getUserInfo()
 })
 const { token, userInfo, getUserAvatar } = storeToRefs(useUserStore())
+function handleLoginOut() {
+  useGlobalMessage().confirm({
+    title: '提示',
+    msg: '确定要退出登录吗?',
+    success: async () => {
+      useUserStore().$reset()
+      useSmqjhCartStore().$reset()
+      useAddressStore().$reset()
+      router.replace({ name: 'smqjh-login' })
+    },
+  })
+}
+function handleGo(item: { name: string }) {
+  if (item.name === 'common-afterSalesList') {
+    useGlobalToast().show('此功能暂未开放')
+    return
+  }
+  router.push({ name: item.name })
+}
 </script>
 
 <template>
@@ -80,7 +99,7 @@ const { token, userInfo, getUserAvatar } = storeToRefs(useUserStore())
           </view>
         </template>
         <view class="grid grid-cols-4 gap-4">
-          <view v-for="item in tabList" :key="item.title" class="flex flex-col items-center justify-center" @click="router.push({ name: item.name })">
+          <view v-for="item in tabList" :key="item.title" class="flex flex-col items-center justify-center" @click="handleGo(item)">
             <image :src="item.icon" class="h56rpx w56rpx" />
             <view class="mt20rpx text-24rpx">
               {{ item.title }}
@@ -127,6 +146,11 @@ const { token, userInfo, getUserAvatar } = storeToRefs(useUserStore())
         </wd-cell-group>
       </wd-card>
     </view>
+    <view v-if="token" class="mt80rpx flex items-center justify-center">
+      <wd-button @click="handleLoginOut">
+        退出登录
+      </wd-button>
+    </view>
   </view>
 </template>
 

+ 75 - 33
src/subPack-smqjh/order/index.vue

@@ -1,5 +1,5 @@
 <script setup lang="ts">
-import { handleCommonOrderStatusText, navTabTypeList, orderStatusList } from './order-data'
+import { navTabTypeList, orderStatusList } from './order-data'
 import { StaticUrl } from '@/config'
 import router from '@/router'
 
@@ -10,21 +10,64 @@ definePage({
     navigationBarTitleText: '订单列表',
   },
 })
+const subPackOrder = ref()
+const subPackComfirm = ref()
+
 const navActiveTab = ref(0)
-const orderStatusActive = ref(0)
 const scrollViewId = ref()
+const orderStatusActive = ref('all')
+const { data: orderList, refresh, isLastPage, page, reload } = usePagination((pageNum, pageSize) => Apis.xsb.orderList({ data: {
+  businessType: 'XSB',
+  orderStatus: unref(orderStatusActive),
+  pageNum,
+  pageSize,
+} }), {
+  immediate: true,
+  pageNum: 1,
+  pageSize: 10,
+  initialData: [],
+  data: res => res.data?.list,
+  append: true,
+})
+onMounted(async () => {
+  subPackOrder.value = await AsyncImport('@/subPack-xsb/utils/order-data')
+  subPackComfirm.value = await AsyncImport('@/subPack-xsb/utils/confirm-order')
+})
 function handleChangeTypeNav(value: number) {
   navActiveTab.value = value
   scrollViewId.value = null
   nextTick(() => scrollViewId.value = value)
+  reload()
 }
-function handleChangeStatus(value: number) {
+function handleChangeStatus(value: string) {
   orderStatusActive.value = value
+  reload()
 }
-function handleClick() {
+function handleClick(no: string) {
   console.log(12)
-  router.push({ name: 'xsb-orderDetaile' })
+  router.push({ name: 'xsb-orderDetaile', params: { id: no } })
+}
+onReachBottom(() => {
+  if (!isLastPage.value) {
+    page.value++
+  }
+})
+async function handleCancel(order: Api.xsbOrderList) {
+  await subPackOrder.value.handleCommonCancelOrder(order)
+  refresh()
 }
+async function handlePay(orderNumber: string) {
+  const res = await subPackComfirm.value.handleCommonPayMent(orderNumber)
+  if (res.payType !== 1) {
+    await subPackComfirm.value.getWxCommonPayment(res)
+  }
+  else {
+    refresh()
+  }
+}
+// const confirmOrder = await AsyncImport('@/subPack-xsb/utils/confirm-order')
+// const orderData = await AsyncImport('@/subPack-xsb/utils/order-data')
+// console.log(confirmOrder, orderData, '===========orderData')
 </script>
 
 <template>
@@ -57,25 +100,22 @@ function handleClick() {
         </view>
       </view>
     </view>
-    <view v-for="item in 20" :key="item" class="mt20rpx" @click="handleClick">
-      <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">
-                海马购官方旗舰店
-              </view>
-            </view>
-            <view class="text-24rpx text-#FF4D3A">
-              {{ handleCommonOrderStatusText(item) }}
+    <view class="px24rpx">
+      <view v-for="item in orderList" :key="item.orderNumber" class="mt20rpx rounded-16rpx bg-white p24rpx" @click="handleClick(item.orderNumber as string)">
+        <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="mt24rpx h2rpx w-full bg-#F0F0F0" />
-        </template>
-
+          <view class="text-24rpx text-#FF4D3A">
+            {{ subPackOrder?.handleCommonOrderStatusText(item) }}
+          </view>
+        </view>
+        <view class="my24rpx 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">
@@ -88,41 +128,43 @@ function handleClick() {
             <view class="mt20rpx">
               2025-03-26 11:56:07
             </view>
-          </view>
+          </view> -->
           <view class="box-border h176rpx w-full flex items-center justify-between rounded-16rpx bg-#F9F9F9">
             <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">
-                  <view v-for="item in 20" :key="item" class="mr50rpx">
-                    <image :src="`${StaticUrl}/shu.png`" class="h120rpx w120rpx" />
+                  <view v-for="goods in item.orderItemList" :key="goods.skuId" class="mr50rpx">
+                    <image :src="goods.pic" class="h120rpx w120rpx" />
                   </view>
                 </view>
               </scroll-view>
             </view>
             <view class="box-shadow box-border h-full flex-1 flex-shrink-0 px14rpx py40rpx">
               <view class="text-32rpx text-#FF4D3A font-semibold">
-                ¥13.95
+                ¥{{ item.actualTotal }}
               </view>
               <view class="text-center text-28rpx text-#AAAAAA">
-                共5
+                共{{ item.goodsTotal }}
               </view>
             </view>
           </view>
         </view>
-        <template #footer>
-          <view class="flex items-center justify-end">
-            <wd-button size="small" plain type="info">
+        <view class="my24rpx flex items-center justify-end">
+          <templpate v-if="item.hbOrderStatus === subPackOrder?.OrderStatus.PaddingPay">
+            <wd-button size="small" plain type="info" @click="handleCancel">
               取消订单
             </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>
+          </templpate>
+        </view>
+      </view>
+      <wd-status-tip v-if="!orderList.length" image="content" tip="暂无内容" />
     </view>
+    <view class="h-20rpx" />
   </view>
 </template>
 

+ 5 - 13
src/subPack-smqjh/order/order-data.ts

@@ -7,21 +7,13 @@ export const navTabTypeList = [
 ]
 
 export const orderStatusList = [
-  { name: '全部', value: 0 },
-  { name: '待支付', value: 1 },
-  { name: '进行中', value: 2 },
-  { name: '已完成', value: 3 },
+  { 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

+ 2 - 2
src/subPack-xsb/commonTab/components/cart.vue

@@ -3,6 +3,7 @@ import { StaticUrl } from '@/config'
 import router from '@/router'
 import { useSmqjhCartStore } from '@/store/cart'
 
+const emit = defineEmits(['changeTab'])
 definePage({
   name: 'xsb-cart',
   islogin: false,
@@ -12,7 +13,6 @@ definePage({
     disableScroll: true,
   },
 })
-
 const { cartList, isAddingCart, isCartAllChecked } = storeToRefs(useSmqjhCartStore())
 const totalProduct = ref<Api.shoppingCartOrderConfirm>()
 async function handleChangeAllShop(e: { value: boolean }, shop: Api.myShoppingCart) {
@@ -233,7 +233,7 @@ function handelPay() {
               <view class="mb20rpx mt20rpx text-24rpx">
                 你还没有添加商品哦~
               </view>
-              <wd-button plain>
+              <wd-button plain @click="emit('changeTab')">
                 去逛逛
               </wd-button>
             </view>

+ 140 - 24
src/subPack-xsb/commonTab/components/classfiy.vue

@@ -1,5 +1,6 @@
 <script setup lang="ts">
 import type { LoadMoreState } from 'wot-design-uni/components/wd-loadmore/types'
+import selectSku from '../../components/select-sku/index.vue'
 import { StaticUrl } from '@/config'
 import router from '@/router'
 
@@ -14,6 +15,11 @@ const cartList = ref<Api.xsbCategoriesCartList[]>([])
 const cartIds = computed(() => cartList.value.filter(it => it.isDelete !== '1' && it.shopSkuStocks !== '0').map(it => it.id))
 const showball = ref(false)
 const _this = getCurrentInstance()
+const selectGoods = ref(false)
+// 多规格商品skuid
+const selectSkuId = ref(0)
+const SelectGoodsNum = ref(1)
+const goodsInfo = ref<Api.xsbCategoryProductList | Api.xsbProductDetail | undefined>()
 definePage({
   name: 'xsb-classfiy',
   islogin: false,
@@ -59,10 +65,6 @@ function handleTopNavChange(item: Api.xsbCategoriesChildren) {
   })
   getProductList()
 }
-function handleOpen() {
-  show.value = true
-  console.log(navHeight.value, '打开')
-}
 
 const categories = computed(() => {
   return classfiylist.value.find(it => it.code === topNavActive.value)?.children || []
@@ -104,6 +106,7 @@ async function getProductList() {
   productList.value = res.data
   goodsLoading.value = 'finished'
   isTopLoading.value = false
+  setProductNum()
 }
 
 function handlScrollBottom() {
@@ -126,14 +129,17 @@ function handleSrollTop() {
   }
 }
 async function handleAddCart(event: WechatMiniprogram.TouchEvent, item: Api.xsbCategoryProductList) {
-  console.log(event.detail.x, item)
-  if (showball.value)
-    return
   if (!token.value) {
     useGlobalToast().show('请先登录!')
     return
   }
-
+  if (item.skuList.length > 1) {
+    goodsInfo.value = item
+    selectGoods.value = true
+    return
+  }
+  if (showball.value)
+    return
   basllObj.value.left = event.detail.x
   basllObj.value.top = event.detail.y
   showball.value = true
@@ -141,8 +147,35 @@ async function handleAddCart(event: WechatMiniprogram.TouchEvent, item: Api.xsbC
     showball.value = false
   }, 500)
   await useSmqjhCartStore().addCart(item.skuList[0].skuId, 1, Number(item.shopId), 'XSB')
-  getCartCategorList()
+  await getCartCategorList()
+  setProductNum()
 }
+async function handleSubCart(event: WechatMiniprogram.TouchEvent, item: Api.xsbCategoryProductList) {
+  if (item.num === 1) {
+    useGlobalMessage().confirm({
+      msg: '是否删除该商品?',
+      success: async () => {
+        await useSmqjhCartStore().addCart(item.skuList[0].skuId, -1, Number(item.shopId), 'XSB')
+        await getCartCategorList()
+        setProductNum()
+      },
+    })
+  }
+  else {
+    if (showball.value)
+      return
+    basllObj.value.left = event.detail.x
+    basllObj.value.top = event.detail.y
+    showball.value = true
+    setTimeout(() => {
+      showball.value = false
+    }, 500)
+    await useSmqjhCartStore().addCart(item.skuList[0].skuId, -1, Number(item.shopId), 'XSB')
+    await getCartCategorList()
+    setProductNum()
+  }
+}
+
 onMounted(async () => {
   if (!topNavActive.value || !leftActive.value) {
     topNavActive.value = props.categoryList[0].code || ''
@@ -186,8 +219,10 @@ function handleGo(item: Api.xsbCategoryProductList) {
 }
 
 async function getGoodsPrice() {
-  const res = await useSmqjhCartStore().getCartAddGoodsPrice(cartIds.value.join(','))
-  totalProduct.value = res
+  if (cartIds.value.length) {
+    const res = await useSmqjhCartStore().getCartAddGoodsPrice(cartIds.value.join(','))
+    totalProduct.value = res
+  }
 }
 async function handleSub(item: Api.xsbCategoriesCartList) {
   if (item.num === 1) {
@@ -216,6 +251,50 @@ onUnmounted(() => {
   topNavActive.value = ''
   leftActive.value = ''
 })
+async function handleDelCartGoods(item: Api.xsbCategoriesCartList) {
+  const msg = item.isDelete ? '商品已被商家删除,是否确认删除该门店下的商品?' : '门店商品库存不足,是否删除该门店下的商品?'
+  useGlobalMessage().confirm({
+    title: '提示',
+    msg,
+    success: async () => {
+      uni.showLoading({ mask: true })
+      try {
+        await Apis.common.deleteShoppingCart({
+          pathParams: {
+            ids: String(item.id),
+          },
+        })
+        await getCartCategorList()
+        uni.hideLoading()
+      }
+      catch {
+        uni.hideLoading()
+      }
+    },
+  })
+}
+function setProductNum() {
+  if (!cartList.value.length) {
+    productList.value = productList.value.map((goods) => {
+      goods.num = undefined
+      return goods
+    })
+    return
+  }
+  cartList.value.forEach((it) => {
+    productList.value = productList.value.map((goods) => {
+      if (goods.skuList.length && goods.skuList[0].skuId === it.skuId) {
+        goods.num = it.num
+      }
+      return goods
+    })
+  })
+}
+async function handleSkuAddCart() {
+  await useSmqjhCartStore().addCart(unref(selectSkuId), unref(SelectGoodsNum), Number(goodsInfo.value?.shopId), 'XSB')
+  getGoodsPrice()
+  await getCartCategorList()
+}
 </script>
 
 <template>
@@ -276,7 +355,7 @@ onUnmounted(() => {
       </scroll-view>
       <view
         class="right-nav box-border h144rpx w64rpx flex flex-shrink-0 flex-col items-center justify-center px20rpx text-24rpx font-semibold"
-        @click="handleOpen"
+        @click="show = true"
       >
         展开
         <image :src="`${StaticUrl}/xia.png`" class="mt20rpx h20rpx w20rpx" />
@@ -373,11 +452,30 @@ onUnmounted(() => {
                         {{ item.channelProdPrice }}
                       </text>
                     </view>
-                    <view v-if="item.spuStock" @click.stop="handleAddCart($event, item)">
-                      <image :src="`${StaticUrl}/cart-yes.png`" class="h52rpx w52rpx" />
+                    <view v-if="!item.num">
+                      <view v-if="item.spuStock" @click.stop="handleAddCart($event, item)">
+                        <image :src="`${StaticUrl}/cart-yes.png`" class="h52rpx w52rpx" />
+                      </view>
+                      <view v-else>
+                        <image :src="`${StaticUrl}/cart-no.png`" class="h52rpx w52rpx" />
+                      </view>
                     </view>
                     <view v-else>
-                      <image :src="`${StaticUrl}/cart-no.png`" class="h52rpx w52rpx" />
+                      <view class="flex items-center">
+                        <image
+                          :src="` ${StaticUrl}/sub-cart.png`"
+                          class="h44rpx w44rpx"
+                          @click.stop="handleSubCart($event, item)"
+                        />
+                        <view class="box-border h44rpx w84rpx flex items-center justify-center border border-#F0F0F0 border-solid text-24rpx text-#AAAAAA">
+                          {{ item.num }}
+                        </view>
+                        <image
+                          :src="` ${StaticUrl}/add-cart.png`"
+                          class="h44rpx w44rpx"
+                          @click.stop="handleAddCart($event, item)"
+                        />
+                      </view>
                     </view>
                   </view>
                 </view>
@@ -456,7 +554,7 @@ onUnmounted(() => {
                     ¥{{ item.price }}
                   </view>
                   <!-- <wd-input-number v-model="item.num" disable-input @change="handleChangeNum($event, item)" /> -->
-                  <view class="flex items-center">
+                  <view v-if="item.shopSkuStocks !== '0' && item.isDelete !== '1'" class="flex items-center">
                     <image
                       :src="` ${StaticUrl}/sub-cart.png`"
                       class="h44rpx w44rpx"
@@ -474,14 +572,16 @@ onUnmounted(() => {
                 </view>
               </view>
             </view>
-            <view v-if="item.shopSkuStocks == '0'" class="absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center bg-[rgba(255,255,255,.6)]">
-              <view class="rounded-16rpx bg-[rgba(0,0,0,.5)] p20rpx text-white">
-                商品已售罄
-              </view>
-            </view>
-            <view v-if="item.isDelete == '1'" class="absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center bg-[rgba(255,255,255,.6)]">
-              <view class="rounded-16rpx bg-[rgba(0,0,0,.5)] p20rpx text-white">
-                商品已删除
+            <view v-if="item.shopSkuStocks == '0' || item.isDelete == '1'" class="absolute left-0 top-0 z-1 h-full w-full bg-[rgba(255,255,255,.6)]">
+              <view class="relative w-full flex items-center justify-center">
+                <view class="rounded-16rpx bg-[rgba(0,0,0,.5)] p20rpx text-white">
+                  {{ item.shopSkuStocks == '0' ? '商品已售罄' : '商品已删除' }}
+                </view>
+                <view class="absolute bottom-20rpx right-20rpx">
+                  <wd-button @click="handleDelCartGoods(item)">
+                    删除商品
+                  </wd-button>
+                </view>
               </view>
             </view>
           </view>
@@ -489,6 +589,22 @@ onUnmounted(() => {
         <view class="h320rpx" />
       </view>
     </Zpopup>
+    <selectSku v-model:show="selectGoods" v-model:sku-id="selectSkuId" v-model:select-goods-num="SelectGoodsNum" :goods-info="goodsInfo!">
+      <template #footer>
+        <view class="box-border w-full flex items-center justify-between py20rpx">
+          <view class="w-48%">
+            <wd-button plain hairline block @click="selectGoods = false">
+              取消
+            </wd-button>
+          </view>
+          <view class="w-48%">
+            <wd-button block @click="handleSkuAddCart">
+              加入购物车
+            </wd-button>
+          </view>
+        </view>
+      </template>
+    </selectSku>
     <view v-if="showball" class="ball">
       <image :src="`${StaticUrl}/cart-yes.png`" class="cart-img h52rpx w52rpx" />
     </view>

+ 8 - 1
src/subPack-xsb/commonTab/components/my.vue

@@ -20,6 +20,13 @@ const tabList = ref([
 
 const { token, userInfo, getUserAvatar } = storeToRefs(useUserStore())
 useUserStore().getUserInfo()
+function handleGo(item: { name: string }) {
+  if (item.name === 'common-afterSalesList') {
+    useGlobalToast().show('此功能暂未开放')
+    return
+  }
+  router.push({ name: item.name })
+}
 </script>
 
 <template>
@@ -79,7 +86,7 @@ useUserStore().getUserInfo()
           </view>
         </template>
         <view class="grid grid-cols-4 gap-4">
-          <view v-for="item in tabList" :key="item.title" class="flex flex-col items-center justify-center" @click="router.push({ name: item.name })">
+          <view v-for="item in tabList" :key="item.title" class="flex flex-col items-center justify-center" @click="handleGo(item)">
             <image :src="item.icon" class="h56rpx w56rpx" />
             <view class="mt20rpx text-24rpx">
               {{ item.title }}

+ 6 - 8
src/subPack-xsb/commonTab/index.vue

@@ -70,8 +70,6 @@ onLoad((options: any) => {
 const loading = ref(true)
 async function getCategories() {
   const res = await Apis.xsb.categories({ data: { shopId: unref(SelectShopInfo).shopId, channelId: unref(userInfo).channelId || 1 } })
-  console.log(res, 'dassdad')
-
   commonCategoryData.value = res.data
 
   loading.value = false
@@ -113,9 +111,9 @@ function handleScrollBottom() {
     page.value++
   }
 }
-function handleChange() {
+function handleChange(name: string) {
   tabbarItems.value = tabbarItems.value.map((it) => {
-    if (it.name === 'xsb-classfiy') {
+    if (it.name === name) {
       it.active = true
     }
     else {
@@ -123,7 +121,7 @@ function handleChange() {
     }
     return it
   })
-  tabbarName.value = 'xsb-classfiy'
+  tabbarName.value = name
 }
 </script>
 
@@ -138,15 +136,15 @@ function handleChange() {
       :goods-list="goodsList"
       :last-page="isLastPage"
       :error="error"
-      @change-nav="handleChange"
+      @change-nav="handleChange('xsb-classfiy')"
       @scroll-bottom="handleScrollBottom"
     />
-    <cart v-if="tabbarName == 'xsb-cart'" />
+    <cart v-if="tabbarName == 'xsb-cart'" @change-tab="handleChange('xsb-home')" />
     <classfiy v-if="tabbarName == 'xsb-classfiy'" :category-list="commonCategoryData" :hot-text="hotText" />
     <my v-if="tabbarName == 'xsb-my'" />
     <wd-tabbar
       v-model="tabbarName"
-      placeholder safe-area-inset-bottom fixed :bordered="false"
+      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"

+ 64 - 0
src/subPack-xsb/components/select-sku/index.vue

@@ -0,0 +1,64 @@
+<script setup lang="ts">
+defineProps<{ goodsInfo: Api.xsbCategoryProductList | Api.xsbProductDetail }>()
+const show = defineModel('show', { default: false })
+const skuId = defineModel<number | undefined>('skuId', { default: undefined })
+const SelectGoodsNum = defineModel('selectGoodsNum', { default: 1 })
+</script>
+
+<template>
+  <Zpopup v-model="show">
+    <view v-if="goodsInfo" class="bg-white px24rpx py28rpx">
+      <view class="flex items-center">
+        <image
+          :src="goodsInfo.pic"
+          class="h200rpx w200rpx flex-shrink-0 rounded-16rpx"
+        />
+        <view class="ml20rpx">
+          <view class="flex items-end text-#FF4D3A font-semibold">
+            <view class="text-24rpx">
+              ¥
+            </view>
+            <view class="text-36rpx line-height-[36rpx]">
+              {{ goodsInfo?.channelProdPrice }}
+            </view>
+          </view>
+          <view class="mt20rpx flex items-center">
+            <view class="text-24rpx text-#AAAAAA">
+              已选
+            </view>
+            <view class="ml20rpx text-28rpx font-semibold">
+              {{ goodsInfo.skuList.find((it) => it.skuId === skuId)?.spec }} {{ SelectGoodsNum }}件
+            </view>
+          </view>
+        </view>
+      </view>
+      <view class="my28rpx h2rpx w-full bg-#F0F0F0" />
+      <view class="mb20rpx">
+        <view class="text-28rpx font-semibold">
+          规格
+        </view>
+        <wd-radio-group v-model="skuId" cell shape="button">
+          <wd-radio v-for="item in goodsInfo.skuList" :key="item.skuId" :value="item.skuId">
+            {{ item.spec }}
+          </wd-radio>
+        </wd-radio-group>
+      </view>
+      <view class="flex items-center justify-between">
+        <view class="text-28rpx font-semibold">
+          数量
+        </view>
+        <wd-input-number v-model="SelectGoodsNum" :min="1" />
+      </view>
+      <view class="h200rpx" />
+    </view>
+    <view v-if="$slots" class="ios shadow-fixed fixed bottom-0 left-0 box-border w-full rounded-t-32rpx bg-white px24rpx">
+      <slot name="footer" />
+    </view>
+  </Zpopup>
+</template>
+
+<style scoped>
+.shadow-fixed{
+  box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0,0,0,0.09);
+}
+</style>

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

@@ -16,14 +16,14 @@ const isPay = ref(false)
 const remarks = ref('')
 
 const offsetPoints = computed(() => {
-  const money = (Number(unref(userInfo).freightFee) * 100) + (Number(unref(orderInfo)?.price) * 100)
+  const money = (Number(unref(orderInfo)?.transfee) * 100) + (Number(unref(orderInfo)?.price) * 100)
   if (Number(unref(orderInfo)?.offsetPoints) > money) {
     return money
   }
   return Number(unref(orderInfo)?.offsetPoints)
 })
 const totalMoney = computed(() => {
-  return unref(offsetPoints) > (Number(unref(orderInfo)?.price) * 100) ? '0.00' : (((Number(unref(orderInfo)?.price) * 1000) + (Number(unref(userInfo)?.freightFee) * 1000)) - unref(offsetPoints)) / 1000
+  return unref(offsetPoints) > (Number(unref(orderInfo)?.price) * 100) ? '0.00' : (((Number(unref(orderInfo)?.price) * 1000) + (Number(unref(orderInfo)?.transfee) * 1000)) - unref(offsetPoints)) / 1000
 })
 const deliveryType = ref(1)
 onLoad((options: any) => {
@@ -161,7 +161,7 @@ async function handlePay() {
           快递
         </view>
         <view class="text-#FF4D3A font-semibold">
-          ¥{{ userInfo.freightFee }}
+          ¥{{ orderInfo?.transfee }}
         </view>
       </view>
       <view class="flex items-center justify-between text-28rpx">

+ 11 - 49
src/subPack-xsb/goods/index.vue

@@ -1,4 +1,5 @@
 <script setup lang="ts">
+import selectSku from '../components/select-sku/index.vue'
 import { StaticUrl } from '@/config'
 import router from '@/router'
 
@@ -104,6 +105,11 @@ async function handleConfimOrder() {
       shopId: unref(goodsInfo)?.shopId,
     },
   })
+  router.push({
+    name: 'xsb-confirmOrder',
+    params: { data: JSON.stringify(res.data) },
+  })
+
   console.log(res, '数据')
 }
 async function handleAddCart() {
@@ -133,7 +139,7 @@ async function handleAddCart() {
           </view>
         </template>
       </wd-swiper>
-      <view class="view-0 header relative z-3 rounded-t-32rpx px24rpx pt24rpx -mt30rpx">
+      <view class="header view-0 relative z-3 rounded-t-32rpx px24rpx pt24rpx -mt30rpx">
         <view class="flex items-center justify-between">
           <view class="flex items-end text-#FF4D3A font-semibold">
             <view class="text-24rpx">
@@ -346,52 +352,8 @@ async function handleAddCart() {
           </view>
         </view>
       </view>
-      <Zpopup v-model="selectGoods">
-        <view class="bg-white px24rpx py28rpx">
-          <view class="flex items-center">
-            <image
-              :src="goodsInfo.pic"
-              class="h200rpx w200rpx flex-shrink-0 rounded-16rpx"
-            />
-            <view class="ml20rpx">
-              <view class="flex items-end text-#FF4D3A font-semibold">
-                <view class="text-24rpx">
-                  ¥
-                </view>
-                <view class="text-36rpx line-height-[36rpx]">
-                  {{ goodsInfo?.channelProdPrice }}
-                </view>
-              </view>
-              <view class="mt20rpx flex items-center">
-                <view class="text-24rpx text-#AAAAAA">
-                  已选
-                </view>
-                <view class="ml20rpx text-28rpx font-semibold">
-                  {{ goodsInfo.skuList.find((it) => it.skuId === specId)?.spec }} {{ SelectGoodsNum }}件
-                </view>
-              </view>
-            </view>
-          </view>
-          <view class="my28rpx h2rpx w-full bg-#F0F0F0" />
-          <view class="mb20rpx">
-            <view class="text-28rpx font-semibold">
-              规格
-            </view>
-            <wd-radio-group v-model="specId" cell shape="button">
-              <wd-radio v-for="item in goodsInfo.skuList" :key="item.skuId" :value="item.skuId">
-                {{ item.spec }}
-              </wd-radio>
-            </wd-radio-group>
-          </view>
-          <view class="flex items-center justify-between">
-            <view class="text-28rpx font-semibold">
-              数量
-            </view>
-            <wd-input-number v-model="SelectGoodsNum" />
-          </view>
-          <view class="h200rpx" />
-        </view>
-        <view class="shadow-fixed ios fixed bottom-0 left-0 box-border w-full rounded-t-32rpx bg-white px24rpx">
+      <selectSku v-model:show="selectGoods" v-model:sku-id="specId" v-model:select-goods-num="SelectGoodsNum" :goods-info="goodsInfo">
+        <template #footer>
           <view class="box-border w-full flex items-center justify-between py20rpx">
             <view class="w-48%">
               <wd-button plain hairline block @click="handleAddCart">
@@ -404,8 +366,8 @@ async function handleAddCart() {
               </wd-button>
             </view>
           </view>
-        </view>
-      </Zpopup>
+        </template>
+      </selectSku>
     </template>
   </view>
 </template>

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

@@ -162,11 +162,11 @@ async function handleDel(order: Api.xsbOrderList) {
             <wd-button size="small" plain type="info" @click.stop="handleDel(item)">
               删除订单
             </wd-button>
-            <view class="ml20rpx">
+            <!-- <view class="ml20rpx">
               <wd-button size="small" plain type="error" @click.stop="handleDel(item)">
                 再次购买
               </wd-button>
-            </view>
+            </view> -->
           </template>
         </view>
       </view>

+ 12 - 6
src/subPack-xsb/orderDetaile/index.vue

@@ -29,7 +29,7 @@ function handleCollapse() {
   collapse.value = !collapse.value
 }
 async function handleCancel() {
-  await handleCommonCancelOrder(orderInfo)
+  await handleCommonCancelOrder(orderInfo.value as Api.xsbOrderList)
   getDetail(String(unref(orderInfo)?.orderNumber))
 }
 async function handlePay() {
@@ -53,6 +53,12 @@ async function handleFinish() {
     uni.hideLoading()
   }, 2000)
 }
+function handleCopy() {
+  uni.setClipboardData({
+    data: String(orderInfo.value?.orderNumber),
+    showToast: true,
+  })
+}
 </script>
 
 <template>
@@ -88,7 +94,7 @@ async function handleFinish() {
             </view>
           </view>
         </view>
-        <view class="flex items-center" @click="handleCollapse">
+        <view v-if="orderInfo.hbOrderStatus !== OrderStatus.PaddingPay" class="flex items-center" @click="handleCollapse">
           <view v-if="orderInfo.hbOrderStatus === OrderStatus.OrderAccepted" class="mr10rpx">
             商家拣货中
           </view>
@@ -160,7 +166,7 @@ async function handleFinish() {
             评价晒单
           </view>
         </view> -->
-        <view class="flex flex-col items-center">
+        <!-- <view class="flex flex-col items-center">
           <image
             :src="`${StaticUrl}/orderDetaile-bao.png`"
             class="h40rpx w40rpx"
@@ -168,7 +174,7 @@ async function handleFinish() {
           <view class="mt20rpx">
             再次购买
           </view>
-        </view>
+        </view> -->
       </view>
     </view>
     <view class="mt20rpx rounded-16rpx bg-white p24rpx">
@@ -251,7 +257,7 @@ async function handleFinish() {
       <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 }}
+          总计{{ orderInfo.orderMoney }} 共减 {{ Number(orderInfo.offsetPoints) / 100 }}
         </view>
         <view class="ml20rpx text-28rpx text-#FF4D3A font-semibold">
           {{ [OrderStatus.PaddingPay, OrderStatus.OrderCancel].includes(Number(orderInfo.hbOrderStatus)) ? '需' : '实' }}付款¥{{ orderInfo.actualTotal }}
@@ -271,7 +277,7 @@ async function handleFinish() {
             <text class="text-#222">
               {{ orderInfo?.orderNumber }}
             </text>
-            <view class="ml10rpx">
+            <view class="ml10rpx" @click="handleCopy">
               <wd-icon name="file-copy" size="22px" />
             </view>
           </view>

+ 4 - 2
src/subPack-xsb/utils/order-data.ts

@@ -2,8 +2,8 @@ import { dayjs } from 'wot-design-uni'
 
 export const navTabTypeList = [
   { name: '全部', value: 0 },
-  { name: '配送(外卖)', value: 1 },
-  { name: '快递', value: 2 },
+  { name: '配送(外卖)', value: 3 },
+  { name: '快递', value: 1 },
 ]
 
 export const orderStatusList = [
@@ -89,6 +89,8 @@ export function handleCommonOrderStatusText(order: Api.xsbOrderList): any {
  * @param order
  */
 export function handleCommonCancelOrder(order: Api.xsbOrderList) {
+  console.log(order, '取消顶顶顶')
+
   return new Promise((resolve, reject) => {
     useGlobalMessage().confirm({
       title: '取消订单',