浏览代码

feat(api): 添加购物车分类接口和配送接口定义

- 添加 xsbCategoriesCartList 接口类型定义
- 添加 myShoppingCartCategory 和 delivery 接口定义
- 更新 xsbCategoryProductList 类型定义,添加 skuList 字段和 id 类型调整

feat(cart): 优化购物车多店铺商品选择逻辑

- 移除多店铺商品同时选中的限制
- 添加星闪豹购物车全选按钮状态管理
- 优化全选逻辑和价格计算

fix(cart): 修复购物车页面商品选择问题

- 修复多个店铺商品同时选中的验证逻辑
- 修复价格计算时的商品ID获取逻辑
- 添加支付前的商品选择验证

feat(api): 更新开发环境配置地址

- 修改 develop 环境地址为新的测试服务器
- 更新 trial 环境地址配置

fix(address): 修复地址详情数据获取问题

- 修复地址详情接口返回数据结构处理

feat(home): 优化首页数据加载逻辑

- 添加 onShow 生命周期重新获取购物车数据
- 优化首页标签栏购物车数量更新

feat(category): 添加分类页购物车功能

- 添加分类页购物车列表显示
- 实现购物车增减商品功能
- 添加商品售罄和删除状态显示

fix(order): 修复订单确认页配送费计算

- 修复配送费计算精度问题
- 添加配送类型获取和显示
- 更新订单生成时的渠道ID使用

fix(search): 修复搜索页商品跳转参数问题

- 修复商品详情跳转时ID参数类型转换

fix(selectAddress): 修复地址选择页面问题

- 修复默认地址选择逻辑
- 更新门店选择逻辑
zhangtao 3 天之前
父节点
当前提交
98bb2cfee6

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

@@ -74,6 +74,10 @@ namespace Api {
     children: xsbCategoriesChildren[]
   }
   interface xsbCategoryProductList {
+    /**
+     * 多规格
+     */
+    skuList: artSkuVo[]
     /**
      * 商品库存
      */
@@ -86,7 +90,7 @@ namespace Api {
      * 渠道对应商品售价
      */
     channelProdPrice?: number
-    id: string
+    id: number
     /**
      * 商品主图
      */
@@ -107,6 +111,7 @@ namespace Api {
      * 规格
      */
     spec?: string
+
     [property: string]: any
   }
   interface xsbProductDetail {
@@ -972,5 +977,62 @@ namespace Api {
     visible?: number
     [property: string]: any
   }
+  interface xsbCategoriesCartList {
+    /**
+     * 业务类型
+     */
+    businessType?: string
+    /**
+     * channelId
+     */
+    channelId?: number
+    createTime?: string
+    /**
+     * 主键
+     */
+    id: number
+    /**
+     * 0 正常 1 已被删除
+     */
+    isDelete?: string
+    /**
+     * 会员id
+     */
+    memberId?: number
+    /**
+     * 数量
+     */
+    num: number
+    /**
+     * pic
+     */
+    pic?: string
+    /**
+     * price
+     */
+    price?: number
+    /**
+     * 门店
+     */
+    shopId: number
+    /**
+     * 门店库存
+     */
+    shopSkuStocks?: string
+    /**
+     * sku_id
+     */
+    skuId: number
+    /**
+     * 门店
+     */
+    skuName?: string
+    /**
+     * spec
+     */
+    spec?: string
+    updateTime?: string
+    [property: string]: any
+  }
 
 }

+ 2 - 0
src/api/apiDefinitions.ts

@@ -47,6 +47,8 @@ export default {
   '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.myShoppingCartCategory':['GET', '/smqjh-oms/app-api/v1/shoppingCart/myShoppingCartCategory'],
+  'xsb.delivery':['GET', '/smqjh-system/app-api/v1/delivery'],
 
   'common.myShoppingCart':['GET', '/smqjh-oms/app-api/v1/shoppingCart/myShoppingCart'],
   'common.addShoppingCart':['POST', '/smqjh-oms/app-api/v1/shoppingCart/addShoppingCart'],

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

@@ -335,6 +335,28 @@ declare global {
       >(
         config: Config
       ): Alova2Method<apiResData<Api.AppletOrderSkuVo>, 'xsb.skuOrderConfirm', Config>;
+      myShoppingCartCategory<
+        Config extends Alova2MethodConfig<apiResData<Api.xsbCategoriesCartList[]>> & {
+          data: {
+            channelId?: number;
+            shopId?: number;
+            businessType?: string;
+          }
+        }
+      >(
+        config: Config
+      ): Alova2Method<apiResData<Api.xsbCategoriesCartList[]>, 'xsb.myShoppingCartCategory', Config>;
+      delivery<
+        Config extends Alova2MethodConfig<apiResData<Api.xsbShoppingCartList[]>> & {
+          data: {
+            memberId?: number;
+            shopId?: number;
+            addressId?: number;
+          }
+        }
+      >(
+        config: Config
+      ): Alova2Method<apiResData<{deliveryType:number}>, 'xsb.delivery', Config>;
     }
     common: {
       myShoppingCart<

+ 4 - 4
src/config/index.ts

@@ -13,16 +13,16 @@ 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',
   /**
    * 体验版
    */
   // trial: "http://192.168.1.166:8080/jeecg-boot",
-  trial: 'http://192.168.0.157:8080',
-  // trial: 'http://47.109.84.152:8081',
+  // trial: 'http://192.168.0.157:8080',
+  trial: 'http://47.109.84.152:8081',
   /**
    * 正式版
    */

+ 24 - 19
src/pages/cart/index.vue

@@ -31,12 +31,6 @@ const navList = ref([
 ])
 const totalProduct = ref<Api.shoppingCartOrderConfirm>()
 async function handleChangeAllShop(e: { value: boolean }, shop: Api.myShoppingCart) {
-  const shopData = cartList.value.filter(it => it.AllShopGoods)
-  if (shopData.length > 1) {
-    shop.AllShopGoods = false
-    useGlobalToast().show('不能同时选中两个店铺的商品')
-    return
-  }
   if (e.value) {
     shop.allGoods = shop.skuList.filter(it => it.shopSkuStocks !== '0' && it.isDelete !== '1').map(it => Number(it.id))
   }
@@ -48,23 +42,31 @@ async function handleChangeAllShop(e: { value: boolean }, shop: Api.myShoppingCa
 watch(() => cartList.value, async () => {
   const ids = cartList.value.filter(it => it.allGoods.length)
   if (ids.length) {
-    const id = ids[0].allGoods.join(',')
+    const shopIds = ids.map(it => it.allGoods).flat()
+    const id = shopIds.join(',')
     const res = await useSmqjhCartStore().getCartAddGoodsPrice(id)
     totalProduct.value = res
   }
+  if (ids.length === cartList.value.length) {
+    const goodsindex = ids.filter(it => it.allGoods.length === it.skuList.length)
+    if (goodsindex.length === cartList.value.length) {
+      isAll.value = true
+    }
+    else {
+      isAll.value = false
+    }
+  }
+  else {
+    isAll.value = false
+  }
 }, {
   deep: true,
 })
+onMounted(() => {
+  totalProduct.value = undefined
+})
 
 async function handleChangShopGoods(e: { value: number[] }, shop: Api.myShoppingCart) {
-  const shopData = cartList.value.filter(it => it.allGoods.length)
-  if (shopData.length > 1) {
-    shop.AllShopGoods = false
-    shop.allGoods = []
-    useGlobalToast().show('不能同时选中两个店铺的商品')
-    return
-  }
-
   if (e.value.length === shop.skuList.length) {
     shop.AllShopGoods = true
   }
@@ -75,10 +77,6 @@ async function handleChangShopGoods(e: { value: number[] }, shop: Api.myShopping
 }
 function handleAllShopGoods(e: { value: boolean }) {
   if (e.value) {
-    if (cartList.value.length > 1) {
-      useGlobalToast().show('多个店铺不能同时选中')
-      return
-    }
     cartList.value = cartList.value.map((it) => {
       return {
         ...it,
@@ -95,6 +93,7 @@ function handleAllShopGoods(e: { value: boolean }) {
         allGoods: [],
       }
     })
+    totalProduct.value = undefined
   }
 }
 async function handleDel() {
@@ -141,6 +140,12 @@ function handelPay() {
     useGlobalToast().show({ msg: '请选择商品' })
     return
   }
+  const list = cartList.value.filter(it => it.allGoods.length)
+  if (list.length > 1) {
+    useGlobalToast().show({ msg: '不能同时选中两个店铺的商品' })
+    return
+  }
+
   router.push({
     name: 'xsb-confirmOrder',
     params: { data: JSON.stringify(unref(totalProduct)) },

+ 5 - 1
src/pages/index/index.vue

@@ -19,7 +19,11 @@ const addressStore = useAddressStore()
 const { ScrollDown, statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
 const { name } = storeToRefs(addressStore)
 const { getTotalNum } = storeToRefs(useSmqjhCartStore())
-useTabbar().setTabbarItem('smqjh-cart', getTotalNum.value)
+
+onShow(() => {
+  useSmqjhCartStore().getCartList('XSB')
+  useTabbar().setTabbarItem('smqjh-cart', getTotalNum.value)
+})
 const navList = ref([
   { icon: `${VITE_OSS_BASE_URL}2025/11/4dabcf9b8d794d3c99aa6b49be34f205.png`, title: '星闪豹', name: 'xsb-homeTabbar' },
   { icon: `${VITE_OSS_BASE_URL}2025/11/40cb38e287234a83885d68f30c9c39bc.png`, title: '充电', name: '' },

+ 6 - 0
src/store/cart.ts

@@ -7,11 +7,16 @@ interface cartState {
    * 是否正在加入购物车
    */
   isAddingCart: boolean
+  /**
+   * 星闪豹购物车全选按钮状态
+   */
+  isCartAllChecked: boolean
 }
 export const useSmqjhCartStore = defineStore('smqjh-cart', {
   state: (): cartState => ({
     cartList: [],
     isAddingCart: false,
+    isCartAllChecked: false,
   }),
   getters: {
     /**
@@ -81,6 +86,7 @@ export const useSmqjhCartStore = defineStore('smqjh-cart', {
           allGoods: [],
         }
       })
+      this.isCartAllChecked = false
     },
     /**
      *

+ 1 - 1
src/subPack-common/editAddress/index.vue

@@ -44,7 +44,7 @@ function handleSelectAddress() {
 }
 async function getData() {
   const res = await Apis.sys.addressesDetail({ pathParams: { addressId: Number(route.query?.id) } })
-  modelForm.value = res
+  modelForm.value = res.data
 }
 onMounted(() => {
   if (route.query?.type === '2') {

+ 37 - 23
src/subPack-xsb/commonTab/components/cart.vue

@@ -13,16 +13,9 @@ definePage({
   },
 })
 
-const { cartList, isAddingCart } = storeToRefs(useSmqjhCartStore())
+const { cartList, isAddingCart, isCartAllChecked } = storeToRefs(useSmqjhCartStore())
 const totalProduct = ref<Api.shoppingCartOrderConfirm>()
-const isAll = ref(false)
 async function handleChangeAllShop(e: { value: boolean }, shop: Api.myShoppingCart) {
-  const shopData = cartList.value.filter(it => it.AllShopGoods)
-  if (shopData.length > 1) {
-    shop.AllShopGoods = false
-    useGlobalToast().show('不能同时选中两个店铺的商品')
-    return
-  }
   if (e.value) {
     shop.allGoods = shop.skuList.filter(it => it.shopSkuStocks !== '0' && it.isDelete !== '1').map(it => Number(it.id))
   }
@@ -33,24 +26,40 @@ async function handleChangeAllShop(e: { value: boolean }, shop: Api.myShoppingCa
 }
 watch(() => cartList.value, async () => {
   const ids = cartList.value.filter(it => it.allGoods.length)
+  console.log(ids, '测试')
+
   if (ids.length) {
-    const id = ids[0].allGoods.join(',')
+    const shopIds = ids.map(it => it.allGoods).flat()
+    const id = shopIds.join(',')
     const res = await useSmqjhCartStore().getCartAddGoodsPrice(id)
     totalProduct.value = res
   }
+  if (ids.length === cartList.value.length) {
+    const goodsindex = ids.filter(it => it.allGoods.length === it.skuList.length)
+    if (goodsindex.length === cartList.value.length) {
+      isCartAllChecked.value = true
+    }
+    else {
+      isCartAllChecked.value = false
+    }
+  }
+  else {
+    isCartAllChecked.value = false
+  }
 }, {
   deep: true,
 })
-
-async function handleChangShopGoods(e: { value: number[] }, shop: Api.myShoppingCart) {
-  const shopData = cartList.value.filter(it => it.allGoods.length)
-  if (shopData.length > 1) {
-    shop.AllShopGoods = false
-    shop.allGoods = []
-    useGlobalToast().show('不能同时选中两个店铺的商品')
-    return
+onMounted(async () => {
+  if (isCartAllChecked.value) {
+    const ids = cartList.value.filter(it => it.allGoods.length)
+    if (ids.length) {
+      const id = ids[0].allGoods.join(',')
+      const res = await useSmqjhCartStore().getCartAddGoodsPrice(id)
+      totalProduct.value = res
+    }
   }
-
+})
+async function handleChangShopGoods(e: { value: number[] }, shop: Api.myShoppingCart) {
   if (e.value.length === shop.skuList.length) {
     shop.AllShopGoods = true
   }
@@ -61,10 +70,6 @@ async function handleChangShopGoods(e: { value: number[] }, shop: Api.myShopping
 }
 function handleAllShopGoods(e: { value: boolean }) {
   if (e.value) {
-    if (cartList.value.length > 1) {
-      useGlobalToast().show('多个店铺不能同时选中')
-      return
-    }
     cartList.value = cartList.value.map((it) => {
       return {
         ...it,
@@ -81,6 +86,7 @@ function handleAllShopGoods(e: { value: boolean }) {
         allGoods: [],
       }
     })
+    totalProduct.value = undefined
   }
 }
 async function handleDel() {
@@ -99,6 +105,7 @@ async function handleDel() {
   }
 }
 async function handleSub(item: Api.CartSkuVo) {
+  totalProduct.value = undefined
   if (unref(isAddingCart)) {
     useGlobalToast().show({ msg: '移除商品中,请稍后' })
     return
@@ -116,6 +123,7 @@ async function handleSub(item: Api.CartSkuVo) {
   }
 }
 async function handleAdd(item: Api.CartSkuVo) {
+  totalProduct.value = undefined
   if (unref(isAddingCart)) {
     useGlobalToast().show({ msg: '添加商品中,请稍后' })
     return
@@ -127,6 +135,12 @@ function handelPay() {
     useGlobalToast().show({ msg: '请选择商品' })
     return
   }
+  const list = cartList.value.filter(it => it.allGoods.length)
+  if (list.length > 1) {
+    useGlobalToast().show({ msg: '不能同时选中两个店铺的商品' })
+    return
+  }
+
   router.push({
     name: 'xsb-confirmOrder',
     params: { data: JSON.stringify(unref(totalProduct)) },
@@ -236,7 +250,7 @@ function handelPay() {
             class="h100rpx w100rpx"
           />
           <view class="ml16rpx flex items-center">
-            <wd-checkbox v-model="isAll" size="large" @change="handleAllShopGoods">
+            <wd-checkbox v-model="isCartAllChecked" size="large" @change="handleAllShopGoods">
               全选
             </wd-checkbox>
             <view class="ml10rpx text-24rpx text-#FF4A39" @click="handleDel">

+ 132 - 22
src/subPack-xsb/commonTab/components/classfiy.vue

@@ -6,12 +6,14 @@ import router from '@/router'
 const props = defineProps<{ categoryList: Api.xsbCategories[], hotText: Api.xsbSearchTerm[] }>()
 const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
 const { topNavActive, leftActive, SelectShopInfo } = storeToRefs(useSysXsbStore())
-const { cartList } = storeToRefs(useSmqjhCartStore())
-const { userInfo } = storeToRefs(useUserStore())
+const { userInfo, token } = storeToRefs(useUserStore())
 const classfiylist = computed(() => props.categoryList)
 const sortClassBtn = ref(1)
 const show = ref(false)
+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()
 definePage({
   name: 'xsb-classfiy',
   islogin: false,
@@ -26,8 +28,8 @@ const cartPopup = ref(false)
 const basllObj = ref({
   left: 0,
   top: 0,
-  x: 0,
-  y: 0,
+  x: -402,
+  y: 773,
 })
 const x = computed(() => `${basllObj.value.x}px`)
 const y = computed(() => `${basllObj.value.y}px`)
@@ -68,7 +70,25 @@ const categories = computed(() => {
 const categoriesId = computed(() => {
   return categories.value.find(it => it.code === leftActive.value)?.id
 })
-
+async function getCartCategorList() {
+  return new Promise((resolve, reject) => {
+    Apis.xsb.myShoppingCartCategory({
+      data: {
+        businessType: 'XSB',
+        channelId: unref(userInfo).channelTopId,
+        shopId: unref(SelectShopInfo).shopId,
+      },
+    }).then((res) => {
+      cartList.value = res.data
+      if (cartList.value.length) {
+        getGoodsPrice()
+      }
+      resolve(res)
+    }).catch((err) => {
+      reject(err)
+    })
+  })
+}
 function handleChange({ value }: { value: string }) {
   leftActive.value = value
   getProductList()
@@ -109,14 +129,19 @@ async function handleAddCart(event: WechatMiniprogram.TouchEvent, item: Api.xsbC
   console.log(event.detail.x, item)
   if (showball.value)
     return
+  if (!token.value) {
+    useGlobalToast().show('请先登录!')
+    return
+  }
 
-  await useSmqjhCartStore().addCart(item.skuId, 1, Number(item.shopId), 'XSB')
   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')
+  getCartCategorList()
 }
 onMounted(async () => {
   topNavActive.value = props.categoryList[0].code || ''
@@ -130,26 +155,56 @@ onMounted(async () => {
       topScrollView.value = topNavActive.value
     })
   }
-
-  if (cartList.value.length) {
-    const query = uni.createSelectorQuery().in(getCurrentInstance())
-    query.select('.cart-box').boundingClientRect()
-    query.exec((res) => {
-      basllObj.value.y = res[0].top
-      uni.getSystemInfo().then((info) => {
-        basllObj.value.x = -(info.screenWidth - res[0].left - 15)
-      })
-    })
-    const ids = cartList.value.map(it => it.skuList.map(its => its.id)).flat()
-    totalProduct.value = await useSmqjhCartStore().getCartAddGoodsPrice(ids.join(','))
+  if (token.value) {
+    await getCartCategorList()
+    if (cartList.value.length) {
+      getCartBox()
+    }
   }
 })
+
+function getCartBox() {
+  const query = uni.createSelectorQuery().in(_this)
+  query.select('.cart-box').boundingClientRect()
+  query.exec((res) => {
+    basllObj.value.y = res[0].top
+    uni.getSystemInfo().then((info) => {
+      basllObj.value.x = -(info.screenWidth - res[0].left - 15)
+      console.log(basllObj.value.x, basllObj.value.y)
+    })
+  })
+}
 function handleGo(item: Api.xsbCategoryProductList) {
-  if (item.id) {
+  if (!item.prodId) {
     useGlobalToast().show('后端数据异常!')
     return
   }
-  router.push({ name: 'xsb-goods', params: { id: String(item.id) } })
+  router.push({ name: 'xsb-goods', params: { id: String(item.prodId) } })
+}
+
+async function getGoodsPrice() {
+  const res = await useSmqjhCartStore().getCartAddGoodsPrice(cartIds.value.join(','))
+  totalProduct.value = res
+}
+async function handleSub(item: Api.xsbCategoriesCartList) {
+  if (item.num === 1) {
+    useGlobalMessage().confirm({
+      msg: '是否删除该商品?',
+      success: async () => {
+        await useSmqjhCartStore().addCart(item.skuId, -1, item.shopId, 'XSB')
+      },
+    })
+  }
+  else {
+    await useSmqjhCartStore().addCart(item.skuId, -1, item.shopId, 'XSB')
+    getGoodsPrice()
+    await getCartCategorList()
+  }
+}
+async function handleAdd(item: Api.xsbCategoriesCartList) {
+  await useSmqjhCartStore().addCart(item.skuId, 1, item.shopId, 'XSB')
+  getGoodsPrice()
+  await getCartCategorList()
 }
 </script>
 
@@ -363,10 +418,65 @@ function handleGo(item: Api.xsbCategoryProductList) {
       </view>
     </view>
     <Zpopup v-model="cartPopup">
-      <view class="ios h800rpx">
+      <view class="ios h800rpx overflow-y-scroll">
         <view class="p24rpx">
-          1212
+          <view
+            v-for="item in cartList" :key="item.id" class="relative mt20rpx box-border flex items-center overflow-hidden rounded-16rpx bg-white p24rpx"
+          >
+            <view class="flex flex-1">
+              <image
+                :src="item.pic"
+                class="h206rpx w200rpx flex-shrink-0"
+                @click.stop="router.push({ name: 'xsb-goods', params: { id: String(item.skuId) } })"
+              />
+              <view class="ml20rpx flex-1">
+                <view class="text-left text-28rpx font-semibold">
+                  <!-- <view v-for="i in 2" :key="i" class="mr5px inline-block">
+                        <wd-tag type="danger">
+                          惊喜回馈
+                        </wd-tag>
+                      </view> -->
+                  {{ item.skuName }}
+                </view>
+                <view class="mt14rpx text-24rpx text-#AAAAAA">
+                  规格:{{ item.spec }}
+                </view>
+                <view class="mt14rpx flex items-center justify-between">
+                  <view class="text-36rpx text-#FF4A39 font-semibold">
+                    ¥{{ item.price }}
+                  </view>
+                  <!-- <wd-input-number v-model="item.num" disable-input @change="handleChangeNum($event, item)" /> -->
+                  <view class="flex items-center">
+                    <image
+                      :src="` ${StaticUrl}/sub-cart.png`"
+                      class="h44rpx w44rpx"
+                      @click.stop="handleSub(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="handleAdd(item)"
+                    />
+                  </view>
+                </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>
+            </view>
+          </view>
         </view>
+        <view class="h320rpx" />
       </view>
     </Zpopup>
     <view v-if="showball" class="ball">

+ 1 - 1
src/subPack-xsb/commonTab/components/index.vue

@@ -174,7 +174,7 @@ watch(() => backTop.value, () => {
                   </view>
                 </view>
 
-                <view class="swiper-img swiper pb20rpx">
+                <view v-if="swiperClassList.length" class="swiper-img swiper pb20rpx">
                   <wd-swiper
                     :list="swiperClassList" :indicator="{ type: 'dots-bar' }" height="80"
                     :display-multiple-items="5" :autoplay="false" :loop="false"

+ 1 - 1
src/subPack-xsb/components/goodsItem/index.vue

@@ -7,7 +7,7 @@ defineProps<{ itemGoods: Api.xsbCategoryProductList }>()
 
 <template>
   <view class="relative overflow-hidden rounded-16rpx bg-white pb16rpx">
-    <view @click="router.push({ name: 'xsb-goods', params: { id: itemGoods.id } })">
+    <view @click="router.push({ name: 'xsb-goods', params: { id: itemGoods.prodId } })">
       <view class="relative h344rpx">
         <image
           :src="itemGoods.pic"

+ 25 - 4
src/subPack-xsb/confirmOrder/index.vue

@@ -10,6 +10,7 @@ definePage({
   },
 })
 const { selectedAddress, userInfo } = storeToRefs(useUserStore())
+const { SelectShopInfo } = storeToRefs(useSysXsbStore())
 const orderInfo = ref<Api.shoppingCartOrderConfirm>()
 const isPay = ref(false)
 const remarks = ref('')
@@ -22,15 +23,30 @@ const offsetPoints = computed(() => {
   return Number(unref(orderInfo)?.offsetPoints)
 })
 const totalMoney = computed(() => {
-  return unref(offsetPoints) > (Number(unref(orderInfo)?.price) * 100) ? '0.00' : ((Number(unref(orderInfo)?.price) * 100) - unref(offsetPoints) + (Number(unref(userInfo)?.freightFee)) * 100) / 100
+  return unref(offsetPoints) > (Number(unref(orderInfo)?.price) * 100) ? '0.00' : (((Number(unref(orderInfo)?.price) * 1000) + (Number(unref(userInfo)?.freightFee) * 1000)) - unref(offsetPoints)) / 1000
 })
+const deliveryType = ref(1)
 onLoad((options: any) => {
   console.log(options.data)
   orderInfo.value = JSON.parse(options.data)
 })
 onShow(() => {
   useUserStore().getuserAddresslist()
+  getDevryList()
 })
+
+async function getDevryList() {
+  const res = await Apis.xsb.delivery({
+    data: {
+      memberId: userInfo.value.id,
+      shopId: SelectShopInfo.value.shopId,
+      addressId: selectedAddress.value?.id,
+    },
+  })
+  deliveryType.value = res.data.deliveryType
+  console.log(res)
+}
+
 async function handlePay() {
   if (!orderInfo.value) {
     useGlobalToast().show({ msg: '网络异常!请联系客服' })
@@ -45,7 +61,7 @@ async function handlePay() {
       }
     })
 
-    const orderNumber = await getOrderPayMent('XSB', 1, Number(orderInfo.value?.skuList[0].shopId), orderItemList, unref(remarks))
+    const orderNumber = await getOrderPayMent('XSB', deliveryType.value, Number(orderInfo.value?.skuList[0].shopId), orderItemList, unref(remarks))
     const res = await handleCommonPayMent(orderNumber)
     if (res.payType !== 1) {
       await getWxCommonPayment(res)
@@ -98,7 +114,7 @@ async function handlePay() {
 
     <view class="rounded-16rpx bg-white p24rpx">
       <view class="flex items-center text-28rpx font-semibold">
-        市民请集合官方旗舰店
+        {{ orderInfo?.shopName }}
       </view>
       <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
       <CollapsePanel :line-height="150">
@@ -136,7 +152,12 @@ async function handlePay() {
         </view>
       </view>
       <view class="mb28rpx flex items-center justify-between text-28rpx">
-        <view>配送费(即时配送)</view>
+        <view v-if="deliveryType == 3">
+          配送费(即时配送)
+        </view>
+        <view v-if="deliveryType == 1">
+          快递
+        </view>
         <view class="text-#FF4D3A font-semibold">
           ¥{{ userInfo.freightFee }}
         </view>

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

@@ -111,7 +111,7 @@ async function handleDel(order: Api.xsbOrderList) {
             </text>
           </view>
         </view>
-        <view class="mt24rpx h2rpx w-full bg-#F0F0F0" />
+        <view class="my24rpx h2rpx w-full bg-#F0F0F0" />
         <view>
           <!-- <view class="mb20rpx box-border rounded-16rpx bg-#F9F9F9 p24rpx">
             <view class="flex items-center">

+ 1 - 1
src/subPack-xsb/search/index.vue

@@ -150,7 +150,7 @@ function handleSearchText(text: string) {
       </view>
     </view>
     <view v-if="isSearch" class="px24rpx pt20rpx">
-      <view v-for="item in data" :key="item.id" class="mb20rpx box-border flex items-center justify-between rounded-16rpx bg-white p24rpx" @click="router.push({ name: 'xsb-goods', params: { id: item.id } })">
+      <view v-for="item in data" :key="item.id" class="mb20rpx box-border flex items-center justify-between rounded-16rpx bg-white p24rpx" @click="router.push({ name: 'xsb-goods', params: { id: String(item.id) } })">
         <image
           :src="item.pic"
           class="h200rpx w200rpx flex-shrink-0 rounded-16rpx"

+ 6 - 2
src/subPack-xsb/selectAddress/index.vue

@@ -15,7 +15,7 @@ const { addresses } = storeToRefs(useUserStore())
 
 const selectAddressId = ref()
 onMounted(() => {
-  selectAddressId.value = addresses.value.filter(it => it.defaulted)[0].id
+  selectAddressId.value = addresses.value.length ? addresses.value.filter(it => it.defaulted)[0].id : ''
 })
 
 const allShopList = computed(() => {
@@ -44,7 +44,8 @@ function handelChange() {
       )
       if (distance < minDistance) {
         minDistance = distance
-        SelectShopInfo.value = { ...shop, distance: Number(distance.toFixed(2)) }
+        handleClick({ ...shop, distance: Number(distance.toFixed(2)) })
+        // SelectShopInfo.value = { ...shop, distance: Number(distance.toFixed(2)) }
       }
     }
   }
@@ -124,6 +125,9 @@ function handelChange() {
       .wd-radio {
         text-align: left !important;
       }
+      .wd-radio__shape{
+        flex-shrink: 0;
+      }
     }
   }
 }

+ 1 - 1
src/subPack-xsb/utils/confirm-order.ts

@@ -37,7 +37,7 @@ export function getOrderPayMent(businessType: string, dvyType: number, shopId: n
     }
     Apis.common.addOrder({
       data: {
-        channelId: unref(userInfo).channelId,
+        channelId: Number(unref(userInfo).channelTopId),
         businessType,
         addressId: selectedAddress.value.id,
         dvyType,