Przeglądaj źródła

feat(tabbar): 更新图标显示逻辑

- 将ScrollDown替换为opcity变量控制图标显示
- 修改条件渲染从ScrollDown改为opcity === 1
zhangtao 1 tydzień temu
rodzic
commit
16db25767a

+ 2 - 2
src/layouts/tabbar.vue

@@ -4,7 +4,7 @@ import icon1 from '@/static/tab/index2.png'
 
 const router = useRouter()
 const route = useRoute()
-const { ScrollDown } = storeToRefs(useSysStore())
+const { opcity } = storeToRefs(useSysStore())
 
 const { activeTabbar, getTabbarItemValue, setTabbarItemActive, tabbarList } = useTabbar()
 
@@ -58,7 +58,7 @@ export default {
             <image src="@/static/tab/index.png" class="h44rpx w44rpx" />
           </template>
           <template v-else-if="index == 0 && active">
-            <image v-if="ScrollDown" :src="icon1" class="h76rpx w76rpx" @click="handleClick" />
+            <image v-if="opcity == 1" :src="icon1" class="h76rpx w76rpx" @click="handleClick" />
             <image v-else :src="icon2" class="h76rpx w76rpx" />
           </template>
           <template v-else-if="index != 0">

+ 63 - 103
src/pages/index/index.vue

@@ -17,12 +17,12 @@ definePage({
 const { show } = useGlobalToast()
 
 const addressStore = useAddressStore()
-const { ScrollDown, statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
+const { statusBarHeight, MenuButtonHeight, opcity } = storeToRefs(useSysStore())
 const { name } = storeToRefs(addressStore)
 const { userInfo } = storeToRefs(useUserStore())
 const { getTotalNum } = storeToRefs(useSmqjhCartStore())
 const { data: goodsList, isLastPage, page, reload, error, loading } = usePagination((pageNum, pageSize) =>
-  Apis.xsb.getSearchProductList({ data: { pageNum, pageSize, salesNum: 'DESC', shopId: 1, channelId: userInfo.value.channelId || 1 } }), {
+  Apis.xsb.getSearchProductList({ data: { pageNum, pageSize, salesNum: 'DESC', shopId: 2, channelId: userInfo.value.channelId || 1 } }), {
   data: resp => resp.data?.list,
   initialData: [],
   initialPage: 1,
@@ -54,15 +54,11 @@ const navList = ref([
 ])
 onMounted(() => {
   addressStore.getLocation()
-  ScrollDown.value = false
+  opcity.value = 0
 })
 onPageScroll((e) => {
-  if (e.scrollTop >= 80) {
-    ScrollDown.value = true
-  }
-  else {
-    ScrollDown.value = false
-  }
+  const calculatedOpacity = e.scrollTop / 100
+  opcity.value = Math.min(1, Math.max(0.1, calculatedOpacity))
 })
 function handleClick(name: string) {
   if (!name) {
@@ -76,20 +72,28 @@ onShareAppMessage(() => {
     title: '市民请集合',
   }
 })
+function handleGo() {
+  show({ msg: '敬请期待 !' })
+}
 </script>
 
 <template>
   <view class="page-class box-border">
     <wd-navbar
-      title=""
-      :custom-style="`background-color:${ScrollDown ? 'var(--them-color)' : 'transparent !important'}`"
-      :bordered="false" :z-index="99" safe-area-inset-top fixed
+      title="" :custom-style="`background-color: rgba(158,214,5,${opcity});`" :bordered="false" :z-index="99"
+      safe-area-inset-top fixed
     >
       <template #left>
-        <image class="h48rpx w202rpx" :src="`${StaticUrl}/logo.png`" />
+        <view class="relative z-10 h48rpx w-full w202rpx opacity-100">
+          <image class="absolute left-0 top-0 h48rpx w202rpx" :src="`${StaticUrl}/logo.png`" />
+        </view>
       </template>
     </wd-navbar>
-    <view class="header-linear h320rpx px24rpx" :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }">
+
+    <view
+      class="header-linear h320rpx px24rpx"
+      :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }"
+    >
       <view class="box-border flex items-center">
         <view class="flex items-center" @click="useAddressStore().getMapAddress()">
           <image :src="`${StaticUrl}/location-black.png`" class="h33.8rpx min-w28.97rpx w28.97rpx" />
@@ -120,7 +124,10 @@ onShareAppMessage(() => {
         >
           <view class="relative h120rpx w120rpx">
             <image :src="item.icon" class="h120rpx w120rpx" />
-            <view v-if="item.title != '星闪豹'" class="linebg absolute left-0 top-0 h-full w-full flex items-center justify-center rounded-32rpx text-24rpx text-white font-semibold">
+            <view
+              v-if="item.title != '星闪豹'"
+              class="linebg absolute left-0 top-0 h-full w-full flex items-center justify-center rounded-32rpx text-24rpx text-white font-semibold"
+            >
               敬请期待
             </view>
           </view>
@@ -129,86 +136,25 @@ onShareAppMessage(() => {
           </view>
         </view>
       </view>
-      <view class="mt20rpx">
-        <view class="w-full flex items-center justify-between">
-          <view class="flex-box-item box-border w344rpx rounded-16rpx p24rpx">
-            <image :src="`${VITE_OSS_BASE_URL}2025/11/118d1846025745a6be878c760b411dcf.png`" class="h32rpx w190rpx" />
-            <view class="flex items-center justify-between">
-              <view class="w136rpx">
-                <image :src="`${VITE_OSS_BASE_URL}2025/11/c74aa846a019446594d2546c013266dd.png`" class="h136rpx w136rpx" />
-                <view class="flex items-center justify-between rounded-16rpx bg-[rgba(255,74,57,0.1)] pr8rpx">
-                  <image :src="`${VITE_OSS_BASE_URL}2025/11/2a75591de19e4ea097558f70a64a26f0.png`" class="h32rpx w48rpx" />
-                  <view class="text-24rpx text-#FF4A39">
-                    ¥18.8
-                  </view>
-                </view>
-              </view>
-              <view class="w136rpx">
-                <image :src="`${VITE_OSS_BASE_URL}2025/11/e00384631c964ba8a106de7c77129ea2.png`" class="h136rpx w136rpx" />
-                <view class="flex items-center justify-between rounded-16rpx bg-[rgba(255,74,57,0.1)] pr8rpx">
-                  <image :src="`${VITE_OSS_BASE_URL}2025/11/2a75591de19e4ea097558f70a64a26f0.png`" class="h32rpx w48rpx" />
-                  <view class="text-24rpx text-#FF4A39">
-                    ¥12.5
-                  </view>
-                </view>
-              </view>
-            </view>
-          </view>
-          <view class="flex-box-item box-border w344rpx rounded-16rpx p24rpx">
-            <image :src="`${VITE_OSS_BASE_URL}2025/11/8b70aeb509d54409a04665304c8f5068.png`" class="h32rpx w110rpx" />
-            <view class="flex items-center justify-between">
-              <view class="w136rpx flex flex-col items-center">
-                <image :src="`${VITE_OSS_BASE_URL}2025/11/e1585c7e7da54d8498e379964cbe1b53.png`" class="h136rpx w136rpx" />
-                <view class="baoyou mt8rpx w100rpx flex items-center justify-center text-24rpx text-white">
-                  ¥9.9
-                </view>
-              </view>
-              <view class="w136rpx flex flex-col items-center">
-                <image :src="`${VITE_OSS_BASE_URL}2025/11/e7c53e3fd6b744eaa0cf41a4fd64b430.png`" class="h136rpx w136rpx" />
-                <view class="baoyou mt8rpx w100rpx flex items-center justify-center text-24rpx text-white">
-                  ¥9.9
-                </view>
-              </view>
-            </view>
-          </view>
+      <view class="mt20rpx w-full flex items-center justify-between" @click="handleGo">
+        <image :src="`${StaticUrl}/smqjh-fl.png`" class="h346rpx w344rpx flex-shrink-0" />
+        <view class="flex flex-1 flex-col items-end justify-center">
+          <image :src="`${StaticUrl}/smqjh-hot-vip.png`" class="h180rpx w344rpx" />
+          <image :src="`${StaticUrl}/smqjh-hot-vip.png`" class="mt14rpx h152rpx w344rpx" />
         </view>
       </view>
       <view class="mt20rpx">
-        <wd-skeleton theme="image" animation="gradient" :loading="loading" :row-col="[[{ height: '568rpx', width: '344rpx' }, { height: '568rpx', width: '344rpx' }], [{ height: '568rpx', width: '344rpx' }, { height: '568rpx', width: '344rpx' }]]">
+        <wd-skeleton
+          theme="image" animation="gradient" :loading="loading"
+          :row-col="[[{ height: '568rpx', width: '344rpx' }, { height: '568rpx', width: '344rpx' }], [{ height: '568rpx', width: '344rpx' }, { height: '568rpx', width: '344rpx' }]]"
+        >
           <view class="flex items-center">
             <scroll-view scroll-y type="custom">
               <grid-view type="masonry" cross-axis-count="2" main-axis-gap="10" cross-axis-gap="10">
-                <view class="flex items-center justify-between">
-                  <view class="rounded-16rpx bg-white px12rpx py20rpx">
-                    <view class="flex items-center rounded-8rpx bg-#FFEEEC text-24rpx font-semibold">
-                      <image :src="`${VITE_OSS_BASE_URL}2025/11/5e2df94dea5e4e4ca5cb1239321930f5.png`" class="h36rpx w36rpx" />
-                      <view class="px4rpx py2rpx text-#FF4A39">
-                        直播低价
-                      </view>
-                    </view>
-                    <view class="mt16rpx flex items-center justify-center">
-                      <image :src="`${VITE_OSS_BASE_URL}2025/11/358c2f46c0ea4e00b98615712ccc142a.png`" class="h116rpx w116rpx" />
-                    </view>
-                    <view class="mt8rpx text-center text-24rpx text-#FF4A39 font-semibold">
-                      ¥35.9
-                    </view>
-                  </view>
-                  <view class="rounded-16rpx bg-white px12rpx py20rpx">
-                    <view class="flex items-center rounded-8rpx bg-#FFEEEC text-24rpx font-semibold">
-                      <image :src="`${VITE_OSS_BASE_URL}2025/11/5e2df94dea5e4e4ca5cb1239321930f5.png`" class="h36rpx w36rpx" />
-                      <view class="px4rpx py2rpx text-#FF4A39">
-                        爆品好价
-                      </view>
-                    </view>
-                    <view class="mt16rpx flex items-center justify-center">
-                      <image :src="`${VITE_OSS_BASE_URL}2025/11/00fc4d8ffba6453685c05ffae06e2d78.png`" class="h116rpx w116rpx" />
-                    </view>
-                    <view class="mt8rpx text-center text-24rpx text-#FF4A39 font-semibold">
-                      ¥25.6
-                    </view>
-                  </view>
-                </view>
-                <view v-for="item in goodsList" :key="item.id" class="relative overflow-hidden rounded-16rpx bg-white pb16rpx">
+                <view
+                  v-for="item in goodsList" :key="item.id"
+                  class="relative overflow-hidden rounded-16rpx bg-white pb16rpx"
+                >
                   <view @click="router.push({ name: 'xsb-goods', params: { id: item.prodId } })">
                     <view class="relative h344rpx">
                       <image :src="item.pic" class="h344rpx w344rpx" />
@@ -226,7 +172,7 @@ onShareAppMessage(() => {
                         <!-- <view class="rounded-8rpx bg-#FF4D3A px12rpx text-24rpx text-white">
                       补贴
                     </view> -->
-                        <view class="ml12rpx text-28rpx font-semibold">
+                        <view class="line-clamp-2 text-28rpx font-semibold">
                           {{ item.prodName }}
                         </view>
                       </view>
@@ -243,14 +189,18 @@ onShareAppMessage(() => {
                       </view>
                     </view>
                   </view>
-                  <view v-if="!item.spuStock" class="absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center bg-[rgba(255,255,255,0.6)]">
-                    <view class="h156rpx w156rpx flex items-center justify-center rounded-full bg-[rgba(0,0,0,.6)] text-28rpx text-white">
+                  <view
+                    v-if="!item.spuStock"
+                    class="absolute left-0 top-0 z-1 h-full w-full flex items-center justify-center bg-[rgba(255,255,255,0.6)]"
+                  >
+                    <view
+                      class="h156rpx w156rpx flex items-center justify-center rounded-full bg-[rgba(0,0,0,.6)] text-28rpx text-white"
+                    >
                       商品已售罄
                     </view>
                   </view>
                 </view>
-
-              <!-- <view class="overflow-hidden rounded-16rpx bg-white pb16rpx">
+                <!-- <view class="overflow-hidden rounded-16rpx bg-white pb16rpx">
                 <view class="relative h344rpx">
                   <image :src="`${VITE_OSS_BASE_URL}2025/11/8177f50dc5f040188dbd40149831273a.png`" class="h344rpx w344rpx" />
                   <view class="absolute bottom-0 left-0 flex items-center text-22rpx">
@@ -410,15 +360,25 @@ onShareAppMessage(() => {
 </template>
 
 <style scoped lang="scss">
-.flex-box-item {
- background: linear-gradient( 180deg, #EBFFB4 0%, #FFFFFF 46%, #FFFFFF 100%);
-}
+.page-class {
+  :deep() {
+    .wd-divider {
+      margin: 0 !important;
+    }
+  }
+
+  .flex-box-item {
+    background: linear-gradient(180deg, #EBFFB4 0%, #FFFFFF 46%, #FFFFFF 100%);
+  }
+
+  .baoyou {
+    background: url('https://zswl-shop.oss-cn-chengdu.aliyuncs.com/2025/11/771b8a09633448d8b62c0004a8928054.png') no-repeat;
+    background-size: contain;
+  }
+
+  .linebg {
+    background: rgba(0, 0, 0, .3);
+  }
 
-.baoyou {
-  background: url('https://zswl-shop.oss-cn-chengdu.aliyuncs.com/2025/11/771b8a09633448d8b62c0004a8928054.png') no-repeat;
-  background-size: contain;
-}
-.linebg{
-  background: rgba(0,0,0,.3);
 }
 </style>

+ 6 - 2
src/store/sys.ts

@@ -1,7 +1,7 @@
 import { defineStore } from 'pinia'
 
 interface SysState {
-  ScrollDown: boolean
+
   /**
    * 状态栏高度
    */
@@ -23,16 +23,20 @@ interface SysState {
    * 支付失败页面返回首页按钮跳转路径
    */
   payFailPath: string
+  /**
+   * 透明度
+   */
+  opcity: number
 
 }
 export const useSysStore = defineStore('system', {
   state: (): SysState => ({
-    ScrollDown: false,
     statusBarHeight: 0,
     MenuButtonHeight: 0,
     paySuccessPath: '',
     payBackIndexPath: '',
     payFailPath: '',
+    opcity: 0,
   }),
   actions: {
     getSystemData() {

+ 3 - 3
src/subPack-xsb/commonTab/components/classfiy.vue

@@ -308,7 +308,7 @@ function handlePay() {
     useGlobalToast().show({ msg: `${shopSkuStock[0].skuName}库存不足` })
     return
   }
-  router.push({ name: 'xsb-confirmOrder', params: { data: JSON.stringify(totalProduct) } })
+  router.push({ name: 'xsb-confirmOrder', params: { data: JSON.stringify(totalProduct.value) } })
 }
 </script>
 
@@ -421,7 +421,7 @@ function handlePay() {
       </scroll-view>
       <view class="content">
         <view class="p20rpx">
-          <image :src="`${StaticUrl}/class.png`" class="h144rpx w-full" />
+          <image :src="`${StaticUrl}/class.png`" class="h144rpx w-full" @click="useGlobalToast().show('敬请期待 !')" />
           <view class="my20rpx flex items-center justify-end rounded-16rpx bg-#F6F6F6 px20rpx py8rpx">
             <view class="mr40rpx text-24rpx">
               销量
@@ -608,7 +608,7 @@ function handlePay() {
       <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 hairline plain block @click="selectGoods = false">
               取消
             </wd-button>
           </view>

+ 54 - 25
src/subPack-xsb/commonTab/components/index.vue

@@ -1,6 +1,6 @@
 <script setup lang="ts">
 import itemGoods from '../../components/goodsItem/index.vue'
-import { StaticUrl, VITE_OSS_BASE_URL } from '@/config'
+import { StaticUrl } from '@/config'
 import router from '@/router'
 
 const props = defineProps<{ error: any, lastPage: boolean, categoryList: Api.xsbCategories[], swiper: Api.xsbAdvertInfo[], hotText: Api.xsbSearchTerm[], recommendText: Api.xsbSearchTerm[], loading: boolean, goodsList: Api.xsbCategoryProductList[] }>()
@@ -8,13 +8,13 @@ const props = defineProps<{ error: any, lastPage: boolean, categoryList: Api.xsb
 const emit = defineEmits(['changeNav', 'scrollBottom'])
 
 const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
-const { topNavActive, leftActive, backTop, SelectShopInfo, ScrollDown } = storeToRefs(useSysXsbStore())
+const { topNavActive, leftActive, backTop, SelectShopInfo, opcity } = storeToRefs(useSysXsbStore())
 const swiperList = computed(() => props.swiper)
 const navActive = ref(0)
 const classfiylist = computed(() => props.categoryList.slice(0, 10))
 const swiperClassList = computed(() => props.categoryList.slice(10, props.categoryList.length))
 const scrollTop = ref()
-
+const currentIndex = ref([0, 1, 2, 3, 4])
 const navList = ref([
   { title: '为你推荐' },
   { title: '疯狂折扣' },
@@ -23,24 +23,17 @@ const navList = ref([
   { title: '预售' },
 ])
 const textArray = ref([
-  '这是一条消息提示信息',
-  '这是第二条消息',
-  '这是第三条消息',
+  '因订单高峰期,配送可能延迟,请提前下单',
 ])
-
 function handleChangeNav(idx: number) {
   navActive.value = idx
 }
 function handleScroll(e: UniHelper.ScrollViewOnScrollEvent) {
-  if (e.detail.scrollTop >= 80) {
-    ScrollDown.value = true
-  }
-  else {
-    ScrollDown.value = false
-  }
+  const calculatedOpacity = e.detail.scrollTop / 100
+  opcity.value = Math.min(1, Math.max(0.1, calculatedOpacity))
 }
 onMounted(() => {
-  ScrollDown.value = false
+  opcity.value = 0
 })
 
 function handleCommonClass(item: Api.xsbCategories) {
@@ -70,13 +63,30 @@ watch(() => backTop.value, () => {
     backTop.value = false
   }
 })
+function handleChangeSwiper(e: UniHelper.SwiperOnChangeEvent) {
+  const current = e.detail.current
+  const total = swiperClassList.value.length
+
+  // 确保最多取到数组末尾,不足5个时从前面补
+  const newIndices = []
+  for (let i = 0; i < 5; i++) {
+    let index = current + i
+    if (index >= total) {
+      // 如果超出范围,从0开始补足
+      index = i
+    }
+    newIndices.push(index)
+  }
+
+  currentIndex.value = newIndices
+}
 </script>
 
 <template>
   <view class="page-xsb">
     <wd-navbar
       title=""
-      :custom-style="`background-color:${ScrollDown ? 'var(--them-color)' : 'transparent !important'}`"
+      :custom-style="`background-color: rgba(158,214,5,${opcity});`"
       :bordered="false" :z-index="99" safe-area-inset-top left-arrow fixed @click-left="router.back()"
     >
       <template #left>
@@ -176,14 +186,20 @@ watch(() => backTop.value, () => {
                   </view>
                 </view>
 
-                <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"
-                    custom-indicator-class="custom-indicator-class" value-key="icon" text-key="name"
-                    image-mode="aspectFit"
-                    @click="handleSwiperClick"
-                  />
+                <view v-if="swiperClassList.length" class="swiper-img swiper mt26rpx">
+                  <swiper class="h125rpx gap-16rpx" display-multiple-items="5" @change="handleChangeSwiper">
+                    <swiper-item v-for="item, idx in swiperClassList" :key="item.id" class="mb20rpx flex flex-col items-center text-center" @click="handleSwiperClick({ index: idx, item })">
+                      <view class="pic-box">
+                        <image class="h72rpx w72rpx" :src="item.icon" />
+                      </view>
+                      <view class="text-24rpx text-#222">
+                        {{ item.name }}
+                      </view>
+                    </swiper-item>
+                  </swiper>
+                  <view class="mt24rpx flex items-center justify-center">
+                    <view v-for="item, idx in swiperClassList" :key="idx" class="mr14rpx transition-all transition-duration-400 ease-in" :class="[currentIndex.includes(idx) ? 'rounded-12rpx w-40rpx h12rpx bg-[var(--them-color)]' : 'w12rpx h12rpx rounded-50% bg-#F0F0F0']" />
+                  </view>
                 </view>
               </wd-skeleton>
             </view>
@@ -198,8 +214,18 @@ watch(() => backTop.value, () => {
             </template>
           </wd-notice-bar>
         </view>
-        <view class="mt20rpx">
-          <image :src="`${VITE_OSS_BASE_URL}2025/12/6671332ceef64985858aa8b548027bd3.png`" class="h236rpx w-full" />
+        <view class="relative mt20rpx box-border" @click="useGlobalToast().show('敬请期待 !')">
+          <image :src="`${StaticUrl}/xsb-index.png`" class="h236rpx w-full" />
+          <view class="absolute left-0 top-0 box-border h-full w-full flex items-end justify-between px16rpx pb16rpx">
+            <image
+              :src="`${StaticUrl}/xsb-index1.png`"
+              class="h148rpx w328rpx"
+            />
+            <image
+              :src="`${StaticUrl}/xsb-index2.png`"
+              class="h148rpx w328rpx"
+            />
+          </view>
         </view>
         <view class="my20rpx">
           <scroll-view scroll-x class="whitespace-nowrap">
@@ -228,7 +254,10 @@ watch(() => backTop.value, () => {
                   <wd-swiper
                     :autoplay="false" :list="[
                       `${StaticUrl}/xsb-swiper1.png`,
+                      `${StaticUrl}/xsb-swiper2.png`,
                     ]" :height="231"
+                    :indicator="{ type: 'dots-bar' }"
+                    @click="useGlobalToast().show('敬请期待 !')"
                   />
                   <view v-for="it in goodsList" :key="it.id">
                     <itemGoods :item-goods="it" />

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

@@ -22,7 +22,7 @@ definePage({
     disableScroll: true,
   },
 })
-const { ScrollDown, backTop, SelectShopInfo } = storeToRefs(useSysXsbStore())
+const { opcity, backTop, SelectShopInfo } = storeToRefs(useSysXsbStore())
 const { userInfo } = storeToRefs(useUserStore())
 const commonCategoryData = ref<Api.xsbCategories[]>([])
 const { data: goodsList, isLastPage, page, error, reload } = usePagination((pageNum, pageSize) =>
@@ -62,7 +62,7 @@ function handleClick() {
   backTop.value = true
 }
 onLoad((options: any) => {
-  ScrollDown.value = false
+  opcity.value = 0
   if (options.name) {
     handleTabbarChange({ value: options.name })
   }
@@ -152,7 +152,7 @@ function handleChange(name: string) {
             <image src="@/static/tab/index.png" class="h44rpx w44rpx" />
           </template>
           <template v-else-if="index == 0 && active">
-            <image v-if="ScrollDown" :src="icon1" class="h74rpx w74rpx" @click="handleClick" />
+            <image v-if="opcity == 1" :src="icon1" class="h74rpx w74rpx" @click="handleClick" />
             <image v-else :src="icon2" class="h74rpx w74rpx" />
           </template>
           <template v-else-if="index != 0">
@@ -192,6 +192,9 @@ function handleChange(name: string) {
         flex: unset !important;
       }
     }
+    .wd-swiper-nav__item--dots-bar.is-active{
+      background-color: var(--them-color) !important;
+    }
   }
 
 }

+ 5 - 1
src/subPack-xsb/goods/index.vue

@@ -90,6 +90,10 @@ 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, '请求')
+  if (!res.data) {
+    useGlobalToast().show('商品异常!')
+    return
+  }
   goodsInfo.value = res.data
   specId.value = res.data.skuList?.[0].skuId
 }
@@ -152,7 +156,7 @@ async function handleAddCart() {
           </view>
         </template>
       </wd-swiper>
-      <view class="header view-0 relative z-3 rounded-t-32rpx px24rpx pt24rpx -mt30rpx">
+      <view class="view-0 header 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">

+ 5 - 3
src/subPack-xsb/orderDetaile/index.vue

@@ -135,7 +135,7 @@ function handleCopy() {
         </view>
       </view>
       <view class="grid grid-cols-5 text-28rpx text-#222">
-        <view class="flex flex-col items-center" @click="handelDel">
+        <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"
@@ -144,13 +144,15 @@ function handleCopy() {
             删除订单
           </view>
         </view>
-        <view class="contact flex flex-col items-center overflow-hidden">
+        <view class="contact relative flex flex-col items-center">
           <image
             :src="`${StaticUrl}/orderDetaile-wx.png`"
             class="h40rpx w40rpx"
           />
           <button open-type="contact" class="zbutton mt40rpx">
-            联系商家
+            <view class="text-28rpx">
+              联系商家
+            </view>
           </button>
         </view>
 

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

@@ -9,15 +9,10 @@ definePage({
     navigationBarTitleText: '选择收获地址',
   },
 })
-const { SelectShopInfo, xsbShopList: shopList } = storeToRefs(useSysXsbStore())
+const { SelectShopInfo, xsbShopList: shopList, selectAddressId } = storeToRefs(useSysXsbStore())
 const { name, Location } = storeToRefs(useAddressStore())
 const { addresses } = storeToRefs(useUserStore())
 
-const selectAddressId = ref()
-onMounted(() => {
-  selectAddressId.value = addresses.value.length ? addresses.value.filter(it => it.defaulted)[0].id : ''
-})
-
 const allShopList = computed(() => {
   return shopList.value?.filter(it => it.shopId !== SelectShopInfo.value?.shopId)
 })
@@ -30,8 +25,7 @@ watch(() => SelectShopInfo.value, () => {
 })
 
 function handelChange(e: { value: number }) {
-  console.log(e.value, selectAddressId.value)
-  const address = addresses.value.find(it => it.id === selectAddressId.value)
+  const address = addresses.value.find(it => it.id === e.value)
   if (!address)
     return
   Location.value.latitude = Number(address.latitude)

+ 9 - 3
src/subPack-xsb/store-xsb/sys.ts

@@ -1,7 +1,7 @@
 import { defineStore } from 'pinia'
 
 interface SysState {
-  ScrollDown: boolean
+  opcity: number
   /**
    * 分类顶部激活id
    */
@@ -24,17 +24,23 @@ interface SysState {
    */
 
   xsbShopList: Api.xsbShopList[]
+  /**
+   * 用户选中我的地址id
+   */
+  selectAddressId: number | undefined
 
 }
 export const useSysXsbStore = defineStore('system-xsb', {
   state: (): SysState => ({
-    ScrollDown: false,
     topNavActive: '',
     leftActive: '',
     searchList: [],
     backTop: false,
     SelectShopInfo: { shopId: 0 },
     xsbShopList: [],
+    opcity: 0,
+
+    selectAddressId: undefined,
   }),
   actions: {
     getTabbarItemValue(name: string) {
@@ -63,7 +69,7 @@ export const useSysXsbStore = defineStore('system-xsb', {
               )
               if (distance < minDistance) {
                 minDistance = distance
-                if (!this.SelectShopInfo) {
+                if (!this.SelectShopInfo.shopId) {
                   this.SelectShopInfo = { ...shop, distance: Number(distance.toFixed(2)) }
                 }
               }