Ver Fonte

feat(subPack-xsb): 重构星闪豹 tabBar 结构并优化页面路径

- 将原有独立的 home、cart、classfiy、my 页面整合进 commonTab 组件结构
- 移除旧的 xsbTabbar 全局组件,改为在 commonTab 内部统一管理 tabbar 逻辑
- 更新页面路由配置,重命名相关页面路径和名称
- 增加 xsbTabbarName 配置项用于控制 tabBar 显示页面范围
- 调整商品列表页样式细节及间距单位
- 删除已废弃的 useXsbTabbarStore 并清理自动导入声明
- 新增 showXsbTabbar 状态控制 tabBar 显隐
- 完成新主页 index.vue 的基础布局与功能实现
- 合并部分子包内订单相关文件路径
zhangtao há 1 semana atrás
pai
commit
bc60e82b2a

+ 4 - 0
async-component.d.ts

@@ -10,3 +10,7 @@ declare module '@/subPack-smqjh/components/selectAddress/index.vue?async' {
   const component: typeof import('@/subPack-smqjh/components/selectAddress/index.vue')
   export = component
 }
+declare module '@/subPack-xsb/components/xsbTabbar/index.vue?async' {
+  const component: typeof import('@/subPack-xsb/components/xsbTabbar/index.vue')
+  export = component
+}

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

@@ -691,7 +691,6 @@ declare module 'vue' {
     readonly useWindowScroll: UnwrapRef<typeof import('@vueuse/core')['useWindowScroll']>
     readonly useWindowSize: UnwrapRef<typeof import('@vueuse/core')['useWindowSize']>
     readonly useXsbTabbar: UnwrapRef<typeof import('./composables/useXsbTabbar')['useXsbTabbar']>
-    readonly useXsbTabbarStore: UnwrapRef<typeof import('./subPack-xsb/store-xsb/tabbar')['useXsbTabbarStore']>
     readonly watch: UnwrapRef<typeof import('vue')['watch']>
     readonly watchArray: UnwrapRef<typeof import('@vueuse/core')['watchArray']>
     readonly watchAtMost: UnwrapRef<typeof import('@vueuse/core')['watchAtMost']>

+ 0 - 71
src/composables/useXsbTabbar.ts

@@ -1,71 +0,0 @@
-import icon3 from '@/static/tab/cart1.png'
-import icon4 from '@/static/tab/cart2.png'
-import class1 from '@/static/tab/class-tab0.png'
-import class2 from '@/static/tab/class-tab1.png'
-import icon5 from '@/static/tab/my1.png'
-import icon6 from '@/static/tab/my2.png'
-
-export interface TabbarItem {
-  name: string
-  value: number | null
-  active: boolean
-  title: string
-  icon2: string
-  icon1: string
-}
-
-const tabbarItems = ref<TabbarItem[]>([
-  { name: 'xsb-home', value: null, active: true, title: '首页', icon1: '', icon2: '' },
-  { name: 'xsb-classfiy', value: null, active: false, title: '分类', icon1: class1, icon2: class2 },
-  { name: 'xsb-cart', value: null, active: false, title: '购物车', icon1: icon3, icon2: icon4 },
-  { name: 'xsb-my', value: null, active: false, title: '我的', icon1: icon5, icon2: icon6 },
-])
-
-export function useXsbTabbar() {
-  const route = useRoute()
-  const tabbarList = computed(() => tabbarItems.value)
-
-  const activeTabbar = computed(() => {
-    const item = tabbarItems.value.find(item => item.active)
-    return item || tabbarItems.value[0]
-  })
-
-  const getTabbarItemValue = (name: string) => {
-    const item = tabbarItems.value.find(item => item.name === name)
-    return item && item.value ? item.value : null
-  }
-
-  const setTabbarItem = (name: string, value: number) => {
-    const tabbarItem = tabbarItems.value.find(item => item.name === name)
-    if (tabbarItem) {
-      tabbarItem.value = value
-    }
-  }
-
-  const setTabbarItemActive = (name: string) => {
-    tabbarItems.value.forEach((item) => {
-      if (item.name === name) {
-        item.active = true
-      }
-      else {
-        item.active = false
-      }
-    })
-  }
-  watch(
-    () => route.name,
-    (newRouteName) => {
-      if (newRouteName) {
-        setTabbarItemActive(newRouteName as string)
-      }
-    },
-    { immediate: true },
-  )
-  return {
-    tabbarList,
-    activeTabbar,
-    getTabbarItemValue,
-    setTabbarItem,
-    setTabbarItemActive,
-  }
-}

+ 11 - 0
src/config/index.ts

@@ -50,3 +50,14 @@ export const BASE_URL
  */
 
 export const StaticUrl = mapEnvStaticVersion[uni.getAccountInfoSync().miniProgram.envVersion]
+
+/**
+ * 是否存在这些页面,存在则显示tabbar
+ * 防止tabbar闪烁
+ */
+export const xsbTabbarName = [
+  'xsb-home',
+  'xsb-classfiy',
+  'xsb-my',
+  'xsb-cart',
+]

+ 1 - 0
src/layouts/default.vue

@@ -1,4 +1,5 @@
 <script lang="ts" setup>
+
 </script>
 
 <script lang="ts">

+ 2 - 2
src/layouts/tabbar.vue

@@ -58,8 +58,8 @@ 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="h74rpx w74rpx" @click="handleClick" />
-            <image v-else :src="icon2" class="h74rpx w74rpx" />
+            <image v-if="ScrollDown" :src="icon1" class="h76rpx w76rpx" @click="handleClick" />
+            <image v-else :src="icon2" class="h76rpx w76rpx" />
           </template>
           <template v-else-if="index != 0">
             <image v-if="active" :src="item.icon2" class="h44rpx w44rpx" />

+ 5 - 39
src/pages.json

@@ -100,24 +100,14 @@
       "root": "subPack-xsb",
       "pages": [
         {
-          "path": "cart/index",
+          "path": "commonTab/index",
           "type": "page",
-          "name": "xsb-cart",
+          "name": "xsb-homeTabbar",
           "islogin": false,
           "style": {
             "navigationStyle": "custom",
-            "navigationBarTitleText": "星闪豹购物车",
-            "disableScroll": true
-          }
-        },
-        {
-          "path": "classfiy/index",
-          "type": "page",
-          "name": "xsb-classfiy",
-          "islogin": false,
-          "style": {
-            "navigationStyle": "custom",
-            "navigationBarTitleText": "星闪豹分类",
+            "navigationBarTitleText": "星闪豹首页",
+            "backgroundColorBottom": "#fff",
             "disableScroll": true
           }
         },
@@ -132,31 +122,7 @@
           }
         },
         {
-          "path": "home/index",
-          "type": "page",
-          "name": "xsb-home",
-          "islogin": false,
-          "style": {
-            "navigationStyle": "custom",
-            "backgroundColor": "#9ED605",
-            "backgroundColorTop": "#9ED605",
-            "navigationBarTitleText": "星闪豹首页",
-            "backgroundColorBottom": "#fff"
-          }
-        },
-        {
-          "path": "my/index",
-          "type": "page",
-          "name": "xsb-my",
-          "islogin": false,
-          "style": {
-            "navigationStyle": "custom",
-            "navigationBarTitleText": "星闪豹我的",
-            "disableScroll": true
-          }
-        },
-        {
-          "path": "my/order/index",
+          "path": "order/index",
           "type": "page",
           "name": "xsb-order",
           "islogin": true,

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

@@ -18,7 +18,7 @@ const addressStore = useAddressStore()
 const { ScrollDown, statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
 const { name } = storeToRefs(addressStore)
 const navList = ref([
-  { icon: `${VITE_OSS_BASE_URL}2025/11/4dabcf9b8d794d3c99aa6b49be34f205.png`, title: '星闪豹', name: 'xsb-home' },
+  { icon: `${VITE_OSS_BASE_URL}2025/11/4dabcf9b8d794d3c99aa6b49be34f205.png`, title: '星闪豹', name: 'xsb-homeTabbar' },
   { icon: `${VITE_OSS_BASE_URL}2025/11/40cb38e287234a83885d68f30c9c39bc.png`, title: '充电' },
   { icon: `${VITE_OSS_BASE_URL}2025/11/9981d979739b4ae6b4eec941b7d2c9b0.png`, title: '电影演出' },
   { icon: `${VITE_OSS_BASE_URL}2025/11/f2b15ec1048e4b5689fe1ba26f6058e1.png`, title: '视频权益' },

+ 5 - 0
src/store/sys.ts

@@ -10,12 +10,17 @@ interface SysState {
    * 胶囊按钮高度
    */
   MenuButtonHeight: number
+  /**
+   * 是否显示tabbar
+   */
+  showXsbTabbar: boolean
 }
 export const useSysStore = defineStore('system', {
   state: (): SysState => ({
     ScrollDown: false,
     statusBarHeight: 0,
     MenuButtonHeight: 0,
+    showXsbTabbar: false,
   }),
   actions: {
     getSystemData() {

+ 2 - 2
src/subPack-smqjh/goodsList/index.vue

@@ -63,7 +63,7 @@ function handleSortList(id: number) {
         </view>
       </template>
     </wd-navbar>
-    <view class="sticky left-0 top-0 z-9 box-border h400rpx bg-#F4FFD1 py20rpx" :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }">
+    <view class="sticky left-0 top-0 z-9 box-border h400rpx bg-#F4FFD1 pt20rpx" :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }">
       <scroll-view scroll-x class="scrollx box-border w-full flex-shrink-0 whitespace-nowrap pl24rpx">
         <view class="flex items-end pb10rpx">
           <view v-for="item, idx in classfiylist" :key="idx" class="mr24rpx flex flex-col items-center justify-center" @click="handleTopNavChange(idx)">
@@ -118,7 +118,7 @@ function handleSortList(id: number) {
                 :src="`${StaticUrl}/shu.png`"
                 class="h132rpx w132rpx flex-shrink-0 rounded-32rpx"
               />
-              <view class="mt16rpx max-w-132rpx truncate">
+              <view class="mt16rpx max-w-132rpx truncate text-24rpx">
                 番茄鸡蛋4545
               </view>
             </view>

+ 3 - 5
src/subPack-xsb/cart/index.vue → src/subPack-xsb/commonTab/components/cart.vue

@@ -1,6 +1,5 @@
 <script setup lang="ts">
 import { StaticUrl } from '@/config'
-import xsbTabbar from '@/subPack-xsb/components/xsbTabbar/index.vue'
 
 definePage({
   name: 'xsb-cart',
@@ -120,15 +119,14 @@ const selectCatrt = ref()
         </view>
       </view>
     </view>
-    <xsbTabbar />
   </view>
 </template>
 
 <style scoped lang="scss">
 .content {
-  height: calc(100vh - var(--window-top) - 420rpx);
-  height: calc(100vh - var(--window-top) - constant(safe-area-inset-bottom) - 420rpx);
-  height: calc(100vh - var(--window-top) - env(safe-area-inset-bottom) - 420rpx);
+  height: calc(100vh - var(--window-top) - 400rpx);
+  height: calc(100vh - var(--window-top) - constant(safe-area-inset-bottom) - 400rpx);
+  height: calc(100vh - var(--window-top) - env(safe-area-inset-bottom) - 400rpx);
 }
 .fixedShadow{
     box-shadow: 0rpx -6rpx 12rpx 2rpx rgba(0,0,0,0.05);

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

@@ -1,6 +1,5 @@
 <script setup lang="ts">
 import { StaticUrl } from '@/config'
-import xsbTabbar from '@/subPack-xsb/components/xsbTabbar/index.vue'
 
 const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
 const classfiylist = ref([
@@ -242,7 +241,6 @@ function onScroll(e) {
         </scroll-view>
       </view>
     </view>
-    <xsbTabbar />
   </view>
 </template>
 

+ 232 - 0
src/subPack-xsb/commonTab/components/index.vue

@@ -0,0 +1,232 @@
+<script setup lang="ts">
+import { StaticUrl, VITE_OSS_BASE_URL } from '@/config'
+import router from '@/router'
+
+const { ScrollDown } = storeToRefs(useSysXsbStore())
+
+const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
+const { name } = storeToRefs(useAddressStore())
+
+const current = ref(0)
+const swiperList = ref([
+  'https://wot-ui.cn/assets/redpanda.jpg',
+  'https://wot-ui.cn/assets/capybara.jpg',
+  'https://wot-ui.cn/assets/panda.jpg',
+  'https://wot-ui.cn/assets/moon.jpg',
+  'https://wot-ui.cn/assets/meng.jpg',
+])
+const navActive = ref(0)
+const classfiylist = ref([
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
+])
+const swiperClassList = ref([
+  { title: '露营季', icon: `${StaticUrl}/zhi.png` },
+  { title: '方便菜', icon: `${StaticUrl}/zhi.png` },
+  { title: '日用清洁', icon: `${StaticUrl}/zhi.png` },
+  { title: '个护美妆', icon: `${StaticUrl}/zhi.png` },
+  { title: '轻食沙拉', icon: `${StaticUrl}/zhi.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/zhi.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/zhi.png` },
+  { title: '蔬菜豆品', icon: `${StaticUrl}/zhi.png` },
+])
+const navList = ref([
+  { title: '为你推荐' },
+  { title: '疯狂折扣' },
+  { title: '' },
+  { title: '地道特产' },
+  { 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
+  }
+}
+function handleCommonName(name: string) {
+  router.push({ name })
+}
+</script>
+
+<template>
+  <view class="page-xsb">
+    <wd-navbar
+      title=""
+      :custom-style="`background-color:${ScrollDown ? 'var(--them-color)' : 'transparent !important'}`"
+      :bordered="false" :z-index="99" safe-area-inset-top left-arrow fixed @click-left="router.back()"
+    >
+      <template #left>
+        <view class="h-full flex items-center">
+          <wd-icon name="arrow-left" size="22px" color="#fff" />
+          <view class="ml10rpx flex items-center" @click.stop="router.push({ name: 'common-selectAddress' })">
+            <image :src="`${StaticUrl}/location.png`" class="h33.8rpx w29rpx" />
+            <view class="ml10rpx max-w-280rpx truncate text-32rpx text-white">
+              {{ name }}
+            </view>
+          </view>
+        </view>
+      </template>
+    </wd-navbar>
+    <scroll-view scroll-y class="content" @scroll="handleScroll">
+      <view
+        class="header-linear h320rpx px24rpx"
+        :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }"
+      >
+        <view class="h60rpx w-full flex items-center justify-between rounded-40rpx bg-white pr6rpx">
+          <view class="flex items-center pb14rpx pl24rpx pt16rpx">
+            <wd-icon name="search" size="14" color="#ccc" />
+            <view class="search ml12rpx h-full w-full overflow-hidden">
+              <wd-notice-bar :text="['霸王茶姬', '牛奶', '洗衣机']" custom-class="notice-bar" color="#ccc" background-color="#fff" direction="vertical" />
+            </view>
+          </view>
+          <view
+            class="h50rpx w96rpx flex items-center justify-center rounded-26rpx bg-[var(--them-color)] text-24rpx text-white font-semibold"
+          >
+            搜索
+          </view>
+        </view>
+        <scroll-view scroll-x class="mb20rpx mt20rpx h44rpx whitespace-nowrap">
+          <view class="h-full flex items-center">
+            <view v-for="item in 10" :key="item" class="mr32rpx h-full flex items-center justify-center rounded-22rpx bg-[rgba(255,255,255,.5)] px16rpx text-24rpx">
+              {{ item }}苹果
+            </view>
+          </view>
+        </scroll-view>
+      </view>
+      <view class="px24rpx -mt180rpx">
+        <wd-swiper v-model:current="current" :autoplay="false" :list="swiperList" :height="138" :indicator="false" />
+        <view class="mt20rpx">
+          <wd-card title="" custom-class="card-zt">
+            <view class="px24rpx pt24rpx">
+              <view class="grid grid-cols-5 gap-x-38rpx gap-y-24rpx">
+                <view v-for="item, index in classfiylist" :key="index">
+                  <image
+                    :src="item.icon"
+                    class="h100rpx w100rpx"
+                  />
+                  <view class="mt12rpx text-24rpx text-#222">
+                    {{ item.title }}
+                  </view>
+                </view>
+              </view>
+            </view>
+            <view 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="title"
+                image-mode="aspectFit"
+              />
+            </view>
+          </wd-card>
+        </view>
+        <view class="mt20rpx">
+          <wd-notice-bar direction="vertical" :text="textArray" :delay="3" color="#222222" background-color="#fff">
+            <template #prefix>
+              <view class="mr20rpx">
+                <wd-icon name="sound" size="22px" color="var(--them-color)" />
+              </view>
+            </template>
+          </wd-notice-bar>
+        </view>
+        <view class="mt20rpx">
+          <image
+            :src="`${VITE_OSS_BASE_URL}2025/12/6671332ceef64985858aa8b548027bd3.png`"
+            class="h236rpx w-full"
+          />
+        </view>
+        <scroll-view scroll-x class="mb20rpx mt20rpx whitespace-nowrap">
+          <view class="flex items-center">
+            <view v-for="item, idx in navList" :key="idx" class="relative mr44rpx" @click="handleChangeNav(idx)">
+              <image
+                v-show="idx == 2"
+                :src="`${StaticUrl}/chaozhi.png`"
+                class="relative z-2 h-29.06rpx w-105.34rpx"
+              />
+              <text v-show="idx != 2" class="relative z-2 text-32rpx" :class="[navActive == idx ? 'text-36rpx font-semibold' : '']">
+                {{ item.title }}
+              </text>
+              <view v-show="navActive == idx" class="nav-line absolute bottom-0rpx left-50% z-1 h18rpx w80rpx rounded-10rpx -translate-x-50%" />
+            </view>
+          </view>
+        </scroll-view>
+        <view class="mt20rpx">
+          <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">
+                <wd-swiper v-model:current="current" :autoplay="false" :list="swiperList" :height="231" />
+                <view v-for="it in 20" :key="it" class="overflow-hidden rounded-16rpx bg-white pb16rpx" @click="handleCommonName('xsb-goods')">
+                  <view class="relative h344rpx">
+                    <image :src="`${VITE_OSS_BASE_URL}2025/11/9d42892888304abf85487deea0271f62.png`" class="h344rpx w344rpx" />
+                  </view>
+                  <view class="mt20rpx px20rpx">
+                    <view class="text-left text-28rpx font-semibold">
+                      <view v-for="i in 2" :key="i" class="mr5px inline-block">
+                        <wd-tag type="primary">
+                          新品{{ i }}
+                        </wd-tag>
+                      </view>
+                      海湾高盐特大白虾200g
+                    </view>
+                    <view class="mt12rpx text-22rpx text-#AAAAAA">
+                      已售5999
+                    </view>
+
+                    <view class="mt10rpx flex items-center justify-between">
+                      <view>
+                        <view class="mt20rpx flex items-end text-#FF4D3A font-semibold">
+                          <view class="text-24rpx">
+                            ¥
+                          </view>
+                          <view class="text-36rpx line-height-[36rpx]">
+                            1.395
+                          </view>
+                        </view>
+                      </view>
+                      <image
+                        :src="`${StaticUrl}/cart-yes.png`"
+                        class="h52rpx w52rpx"
+                      />
+                    </view>
+                  </view>
+                </view>
+              </grid-view>
+            </scroll-view>
+          </view>
+        </view>
+      </view>
+      <view class="h100rpx" />
+    </scroll-view>
+  </view>
+</template>
+
+<style scoped lang="scss">
+.content{
+  height: calc(100vh - var(--window-top) - 80rpx);
+}
+</style>

+ 0 - 2
src/subPack-xsb/my/index.vue → src/subPack-xsb/commonTab/components/my.vue

@@ -1,7 +1,6 @@
 <script setup lang="ts">
 import { StaticUrl } from '@/config'
 import router from '@/router'
-import xsbTabbar from '@/subPack-xsb/components/xsbTabbar/index.vue'
 
 definePage({
   name: 'xsb-my',
@@ -95,7 +94,6 @@ const tabList = ref([
         </wd-cell-group>
       </wd-card>
     </view>
-    <xsbTabbar />
   </view>
 </template>
 

+ 94 - 0
src/subPack-xsb/commonTab/index.vue

@@ -0,0 +1,94 @@
+<script setup lang="ts">
+import indexHome from './components/index.vue'
+import cart from './components/cart.vue'
+import classfiy from './components/classfiy.vue'
+import my from './components/my.vue'
+import icon2 from '@/static/tab/index1.png'
+import icon1 from '@/static/tab/index2.png'
+import icon3 from '@/static/tab/cart1.png'
+import icon4 from '@/static/tab/cart2.png'
+import class1 from '@/static/tab/class-tab0.png'
+import class2 from '@/static/tab/class-tab1.png'
+import icon5 from '@/static/tab/my1.png'
+import icon6 from '@/static/tab/my2.png'
+
+definePage({
+  name: 'xsb-homeTabbar',
+  islogin: false,
+  style: {
+    navigationStyle: 'custom',
+    navigationBarTitleText: '星闪豹首页',
+    backgroundColorBottom: '#fff',
+    disableScroll: true,
+  },
+})
+const { ScrollDown } = storeToRefs(useSysXsbStore())
+const tabbarItems = ref([
+  { name: 'xsb-home', value: null, active: true, title: '首页', icon1: '', icon2: '' },
+  { name: 'xsb-classfiy', value: null, active: false, title: '分类', icon1: class1, icon2: class2 },
+  { name: 'xsb-cart', value: null, active: false, title: '购物车', icon1: icon3, icon2: icon4 },
+  { name: 'xsb-my', value: null, active: false, title: '我的', icon1: icon5, icon2: icon6 },
+])
+const tabbarName = ref('xsb-home')
+function handleTabbarChange({ value }: { value: string }) {
+  setTabbarItemActive(value)
+  tabbarName.value = value
+}
+function setTabbarItemActive(name: string) {
+  tabbarItems.value.forEach((item) => {
+    if (item.name === name) {
+      item.active = true
+    }
+    else {
+      item.active = false
+    }
+  })
+}
+function handleClick() {
+  uni.pageScrollTo({
+    duration: 50,
+    scrollTop: 0,
+  })
+}
+onLoad(() => {
+  ScrollDown.value = false
+})
+</script>
+
+<template>
+  <view class="page-xsb">
+    <indexHome v-if="tabbarName == 'xsb-home'" />
+    <cart v-if="tabbarName == 'xsb-cart'" />
+    <classfiy v-if="tabbarName == 'xsb-classfiy'" />
+    <my v-if="tabbarName == 'xsb-my'" />
+    <wd-tabbar
+      :model-value="tabbarName" safe-area-inset-bottom placeholder fixed :bordered="false"
+      custom-class="custom-tab" :custom-style="`box-shadow:${tabbarName == 'xsb-cart' ? '' : ' 0rpx -6rpx 12rpx 2rpx rgba(0, 0, 0, 0.09)'}`"
+      @change="handleTabbarChange"
+    >
+      <wd-tabbar-item
+        v-for="(item, index) in tabbarItems" :key="index" :name="item.name"
+        :value="useSysXsbStore().getTabbarItemValue(item.name)" :title="index == 0 && item.active ? '' : item.title"
+        @change="handleTabbarChange"
+      >
+        <template #icon="{ active }">
+          <template v-if="index == 0 && !active">
+            <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-else :src="icon2" class="h74rpx w74rpx" />
+          </template>
+          <template v-else-if="index != 0">
+            <image v-if="active" :src="item.icon2" class="h44rpx w44rpx" />
+            <image v-else :src="item.icon1" class="h44rpx w44rpx" />
+          </template>
+        </template>
+      </wd-tabbar-item>
+    </wd-tabbar>
+  </view>
+</template>
+
+<style scoped>
+
+</style>

+ 0 - 63
src/subPack-xsb/components/xsbTabbar/index.vue

@@ -1,63 +0,0 @@
-<script setup lang="ts">
-import router from '@/router'
-import icon2 from '@/static/tab/index1.png'
-import icon1 from '@/static/tab/index2.png'
-
-const route = useRoute()
-const { ScrollDown } = storeToRefs(useSysXsbStore())
-
-const { activeTabbar, getTabbarItemValue, setTabbarItemActive, tabbarList } = useXsbTabbar()
-function handleTabbarChange({ value }: { value: string }) {
-  setTabbarItemActive(value)
-  router.push({ name: value })
-}
-
-onMounted(() => {
-  // #ifdef APP-PLUS
-  uni.hideTabBar()
-  // #endif
-  nextTick(() => {
-    if (route.name && route.name !== activeTabbar.value.name) {
-      setTabbarItemActive(route.name)
-    }
-  })
-})
-function handleClick() {
-  uni.pageScrollTo({
-    duration: 50,
-    scrollTop: 0,
-  })
-}
-</script>
-
-<template>
-  <wd-tabbar
-    :model-value="activeTabbar.name" safe-area-inset-bottom placeholder fixed :bordered="false"
-    custom-class="custom-tab" :custom-style="`box-shadow:${activeTabbar.name == 'xsb-cart' ? '' : ' 0rpx -6rpx 12rpx 2rpx rgba(0, 0, 0, 0.09)'}`"
-    @change="handleTabbarChange"
-  >
-    <wd-tabbar-item
-      v-for="(item, index) in tabbarList" :key="index" :name="item.name"
-      :value="getTabbarItemValue(item.name)" :title="index == 0 && item.active ? '' : item.title"
-      @change="handleTabbarChange"
-    >
-      <template #icon="{ active }">
-        <template v-if="index == 0 && !active">
-          <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-else :src="icon2" class="h74rpx w74rpx" />
-        </template>
-        <template v-else-if="index != 0">
-          <image v-if="active" :src="item.icon2" class="h44rpx w44rpx" />
-          <image v-else :src="item.icon1" class="h44rpx w44rpx" />
-        </template>
-      </template>
-    </wd-tabbar-item>
-  </wd-tabbar>
-</template>
-
-<style scoped>
-
-</style>

+ 0 - 238
src/subPack-xsb/home/index.vue

@@ -1,238 +0,0 @@
-<script setup lang="ts">
-import { StaticUrl, VITE_OSS_BASE_URL } from '@/config'
-import router from '@/router'
-import xsbTabbar from '@/subPack-xsb/components/xsbTabbar/index.vue'
-
-const { ScrollDown } = storeToRefs(useSysXsbStore())
-definePage({
-  name: 'xsb-home',
-  islogin: false,
-  style: {
-    navigationStyle: 'custom',
-    backgroundColor: '#9ED605',
-    backgroundColorTop: '#9ED605',
-    navigationBarTitleText: '星闪豹首页',
-    backgroundColorBottom: '#fff',
-  },
-})
-const { statusBarHeight, MenuButtonHeight } = storeToRefs(useSysStore())
-const { name } = storeToRefs(useAddressStore())
-const current = ref(0)
-const swiperList = ref([
-  'https://wot-ui.cn/assets/redpanda.jpg',
-  'https://wot-ui.cn/assets/capybara.jpg',
-  'https://wot-ui.cn/assets/panda.jpg',
-  'https://wot-ui.cn/assets/moon.jpg',
-  'https://wot-ui.cn/assets/meng.jpg',
-])
-const navActive = ref(0)
-const classfiylist = ref([
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/shu.png` },
-])
-const swiperClassList = ref([
-  { title: '露营季', icon: `${StaticUrl}/zhi.png` },
-  { title: '方便菜', icon: `${StaticUrl}/zhi.png` },
-  { title: '日用清洁', icon: `${StaticUrl}/zhi.png` },
-  { title: '个护美妆', icon: `${StaticUrl}/zhi.png` },
-  { title: '轻食沙拉', icon: `${StaticUrl}/zhi.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/zhi.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/zhi.png` },
-  { title: '蔬菜豆品', icon: `${StaticUrl}/zhi.png` },
-])
-const navList = ref([
-  { title: '为你推荐' },
-  { title: '疯狂折扣' },
-  { title: '' },
-  { title: '地道特产' },
-  { title: '预售' },
-])
-const textArray = ref([
-  '这是一条消息提示信息',
-  '这是第二条消息',
-  '这是第三条消息',
-])
-
-function handleChangeNav(idx: number) {
-  navActive.value = idx
-}
-onPageScroll((e) => {
-  if (e.scrollTop >= 80) {
-    ScrollDown.value = true
-  }
-  else {
-    ScrollDown.value = false
-  }
-})
-function handleCommonName(name: string) {
-  router.push({ name })
-}
-</script>
-
-<template>
-  <view class="page-xsb">
-    <wd-navbar
-      title=""
-      :custom-style="`background-color:${ScrollDown ? 'var(--them-color)' : 'transparent !important'}`"
-      :bordered="false" :z-index="99" safe-area-inset-top left-arrow fixed @click-left="router.replaceAll({ name: 'smqjh-home' })"
-    >
-      <template #left>
-        <view class="h-full flex items-center">
-          <wd-icon name="arrow-left" size="22px" color="#fff" />
-          <view class="ml10rpx flex items-center" @click.stop="router.push({ name: 'common-selectAddress' })">
-            <image :src="`${StaticUrl}/location.png`" class="h33.8rpx w29rpx" />
-            <view class="ml10rpx max-w-280rpx truncate text-32rpx text-white">
-              {{ name }}
-            </view>
-          </view>
-        </view>
-      </template>
-    </wd-navbar>
-    <view
-      class="header-linear h320rpx px24rpx"
-      :style="{ paddingTop: `${(Number(statusBarHeight) || 44) + MenuButtonHeight + 12}px` }"
-    >
-      <view class="h60rpx w-full flex items-center justify-between rounded-40rpx bg-white pr6rpx">
-        <view class="flex items-center pb14rpx pl24rpx pt16rpx">
-          <wd-icon name="search" size="14" color="#ccc" />
-          <view class="search ml12rpx h-full w-full overflow-hidden">
-            <wd-notice-bar :text="['霸王茶姬', '牛奶', '洗衣机']" custom-class="notice-bar" color="#ccc" background-color="#fff" direction="vertical" />
-          </view>
-        </view>
-        <view
-          class="h50rpx w96rpx flex items-center justify-center rounded-26rpx bg-[var(--them-color)] text-24rpx text-white font-semibold"
-        >
-          搜索
-        </view>
-      </view>
-      <scroll-view scroll-x class="mb20rpx mt20rpx h44rpx whitespace-nowrap">
-        <view class="h-full flex items-center">
-          <view v-for="item in 10" :key="item" class="mr32rpx h-full flex items-center justify-center rounded-22rpx bg-[rgba(255,255,255,.5)] px16rpx text-24rpx">
-            {{ item }}苹果
-          </view>
-        </view>
-      </scroll-view>
-    </view>
-    <view class="px24rpx -mt180rpx">
-      <wd-swiper v-model:current="current" :autoplay="false" :list="swiperList" :height="138" :indicator="false" />
-      <view class="mt20rpx">
-        <wd-card title="" custom-class="card-zt">
-          <view class="px24rpx pt24rpx">
-            <view class="grid grid-cols-5 gap-x-38rpx gap-y-24rpx">
-              <view v-for="item, index in classfiylist" :key="index">
-                <image
-                  :src="item.icon"
-                  class="h100rpx w100rpx"
-                />
-                <view class="mt12rpx text-24rpx text-#222">
-                  {{ item.title }}
-                </view>
-              </view>
-            </view>
-          </view>
-          <view 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="title"
-              image-mode="aspectFit"
-            />
-          </view>
-        </wd-card>
-      </view>
-      <view class="mt20rpx">
-        <wd-notice-bar direction="vertical" :text="textArray" :delay="3" color="#222222" background-color="#fff">
-          <template #prefix>
-            <view class="mr20rpx">
-              <wd-icon name="sound" size="22px" color="var(--them-color)" />
-            </view>
-          </template>
-        </wd-notice-bar>
-      </view>
-      <view class="mt20rpx">
-        <image
-          :src="`${VITE_OSS_BASE_URL}2025/12/6671332ceef64985858aa8b548027bd3.png`"
-          class="h236rpx w-full"
-        />
-      </view>
-      <scroll-view scroll-x class="mb20rpx mt20rpx whitespace-nowrap">
-        <view class="flex items-center">
-          <view v-for="item, idx in navList" :key="idx" class="relative mr44rpx" @click="handleChangeNav(idx)">
-            <image
-              v-show="idx == 2"
-              :src="`${StaticUrl}/chaozhi.png`"
-              class="relative z-2 h-29.06rpx w-105.34rpx"
-            />
-            <text v-show="idx != 2" class="relative z-2 text-32rpx" :class="[navActive == idx ? 'text-36rpx font-semibold' : '']">
-              {{ item.title }}
-            </text>
-            <view v-show="navActive == idx" class="nav-line absolute bottom-0rpx left-50% z-1 h18rpx w80rpx rounded-10rpx -translate-x-50%" />
-          </view>
-        </view>
-      </scroll-view>
-      <view class="mt20rpx">
-        <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">
-              <wd-swiper v-model:current="current" :autoplay="false" :list="swiperList" :height="231" />
-              <view v-for="it in 20" :key="it" class="overflow-hidden rounded-16rpx bg-white pb16rpx" @click="handleCommonName('xsb-goods')">
-                <view class="relative h344rpx">
-                  <image :src="`${VITE_OSS_BASE_URL}2025/11/9d42892888304abf85487deea0271f62.png`" class="h344rpx w344rpx" />
-                </view>
-                <view class="mt20rpx px20rpx">
-                  <view class="text-left text-28rpx font-semibold">
-                    <view v-for="i in 2" :key="i" class="mr5px inline-block">
-                      <wd-tag type="primary">
-                        新品{{ i }}
-                      </wd-tag>
-                    </view>
-                    海湾高盐特大白虾200g
-                  </view>
-                  <view class="mt12rpx text-22rpx text-#AAAAAA">
-                    已售5999
-                  </view>
-
-                  <view class="mt10rpx flex items-center justify-between">
-                    <view>
-                      <view class="mt20rpx flex items-end text-#FF4D3A font-semibold">
-                        <view class="text-24rpx">
-                          ¥
-                        </view>
-                        <view class="text-36rpx line-height-[36rpx]">
-                          1.395
-                        </view>
-                      </view>
-                    </view>
-                    <image
-                      :src="`${StaticUrl}/cart-yes.png`"
-                      class="h52rpx w52rpx"
-                    />
-                  </view>
-                </view>
-              </view>
-            </grid-view>
-          </scroll-view>
-        </view>
-      </view>
-    </view>
-    <xsbTabbar />
-  </view>
-</template>
-
-<style scoped lang="scss">
-
-</style>

+ 0 - 0
src/subPack-xsb/my/order/index.vue → src/subPack-xsb/order/index.vue


+ 0 - 0
src/subPack-xsb/my/order/order-data.ts → src/subPack-xsb/order/order-data.ts


+ 5 - 0
src/subPack-xsb/store-xsb/sys.ts

@@ -8,5 +8,10 @@ export const useSysXsbStore = defineStore('system-xsb', {
     ScrollDown: false,
   }),
   actions: {
+    getTabbarItemValue(name: string) {
+      console.log(name)
+
+      return 0
+    },
   },
 })

+ 0 - 11
src/subPack-xsb/store-xsb/tabbar.ts

@@ -1,11 +0,0 @@
-import { defineStore } from 'pinia'
-
-interface XsbTabbarState {
-
-}
-export const useXsbTabbarStore = defineStore('XsbTabbarStore', {
-  state: (): XsbTabbarState => ({
-  }),
-  actions: {
-  },
-})

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

@@ -9,12 +9,9 @@ type _LocationUrl =
   "/pages/classfiy/index" |
   "/pages/login/index" |
   "/pages/my/index" |
-  "/subPack-xsb/cart/index" |
-  "/subPack-xsb/classfiy/index" |
+  "/subPack-xsb/commonTab/index" |
   "/subPack-xsb/goods/index" |
-  "/subPack-xsb/home/index" |
-  "/subPack-xsb/my/index" |
-  "/subPack-xsb/my/order/index" |
+  "/subPack-xsb/order/index" |
   "/subPack-common/address/index" |
   "/subPack-common/afterSales/index" |
   "/subPack-common/afterSalesDetail/index" |