li.shaoyi 1 gadu atpakaļ
vecāks
revīzija
6988577842

+ 24 - 0
src/packages/tss/router/index.ts

@@ -321,6 +321,30 @@ const routes: Array<RouteRecordRaw> = [
           ignoreAuth: true,
         },
       },
+      {
+        path: "benefits",
+        name: "rules-benefits",
+        component: () => import("../views/rules/benefits/index.vue"),
+        meta: {
+          ignoreAuth: true,
+        },
+      },
+      {
+        path: "malls",
+        name: "rules-malls",
+        component: () => import("../views/rules/malls/index.vue"),
+        meta: {
+          ignoreAuth: true,
+        },
+      },
+      {
+        path: "logistics",
+        name: "rules-logistics",
+        component: () => import("../views/rules/logistics/index.vue"),
+        meta: {
+          ignoreAuth: true,
+        },
+      },
     ]
   },
   ...pageRoutes

+ 0 - 27
src/packages/tss/views/home/main/components/benefits/Index.vue

@@ -1,27 +0,0 @@
-<!-- 首页 - 新人福利 -->
-<template>
-    <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
-       <app-view class="g-form">
-           <template #header>
-               <app-navbar title="新人福利" @back="closed" />
-           </template>
-       </app-view>
-    </app-modal>
-   
-</template>
-
-<script lang="ts" setup>
-import { shallowRef } from 'vue'
-import AppModal from '@/components/base/modal/index.vue'
-
-const showModal = shallowRef(true)
-// 是否刷新父组件数据
-const refresh = shallowRef(false)
-
-// 关闭弹窗
-const closed = (isRefresh = false) => {
-   refresh.value = isRefresh
-   showModal.value = false
-}
-
-</script>

+ 0 - 27
src/packages/tss/views/home/main/components/logistics/Index.vue

@@ -1,27 +0,0 @@
-<!-- 首页 - 物流服务 -->
-<template>
-    <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
-       <app-view class="g-form">
-           <template #header>
-               <app-navbar title="物流服务 " @back="closed" />
-           </template>
-       </app-view>
-    </app-modal>
-   
-</template>
-
-<script lang="ts" setup>
-import { shallowRef } from 'vue'
-import AppModal from '@/components/base/modal/index.vue'
-
-const showModal = shallowRef(true)
-// 是否刷新父组件数据
-const refresh = shallowRef(false)
-
-// 关闭弹窗
-const closed = (isRefresh = false) => {
-   refresh.value = isRefresh
-   showModal.value = false
-}
-
-</script>

+ 0 - 27
src/packages/tss/views/home/main/components/malls/Index.vue

@@ -1,27 +0,0 @@
-<!-- 首页 - 了解商城 -->
-<template>
-     <app-modal direction="right-top" height="100%" width="100%" v-model:show="showModal" :refresh="refresh">
-        <app-view class="g-form">
-            <template #header>
-                <app-navbar title="了解商城" @back="closed" />
-            </template>
-        </app-view>
-     </app-modal>
-    
-</template>
-
-<script lang="ts" setup>
-import { shallowRef } from 'vue'
-import AppModal from '@/components/base/modal/index.vue'
-
-const showModal = shallowRef(true)
-// 是否刷新父组件数据
-const refresh = shallowRef(false)
-
-// 关闭弹窗
-const closed = (isRefresh = false) => {
-    refresh.value = isRefresh
-    showModal.value = false
-}
-
-</script>

+ 1 - 0
src/packages/tss/views/home/main/index.less

@@ -40,6 +40,7 @@
     }
 
     &__container {
+        min-height: 100%;
         background-repeat: no-repeat;
         background-size: 100% auto;
         background-position: center -54px;

+ 44 - 26
src/packages/tss/views/home/main/index.vue

@@ -5,14 +5,12 @@
         <div class="searchbar">
           <Search shape="round" background="transparent" :placeholder="$t('tss.tips1')"
             @click="$router.push({ name: 'search' })" />
-          <Icon name="bullhorn-o" :dot="noticeStore.unreadList.length > 0" />
+          <Icon name="bullhorn-o" :dot="noticeStore.unreadList.length > 0"
+            @click="$router.push({ name: 'notice-list' })" />
         </div>
       </app-statusbar>
     </template>
-    <PullRefresh class="home-main__container" v-model="refreshing" @refresh="onRefresh"
-      :pulling-text="$t('common.pulling-text')" :loosing-text="$t('common.loosing-text')"
-      :loading-text="$t('common.loading-text')" :success-text="$t('common.success-text')"
-      :style="{ backgroundImage: `url(${getFileUrl(topBanners)})` }">
+    <div class="home-main__container" :style="{ backgroundImage: `url(${getFileUrl(topBanners)})` }">
       <app-block class="home-main__notice">
         <h4 @click="$router.push({ name: 'notice-list' })">
           <span>{{ $t('routes.notice') }}</span>
@@ -21,13 +19,13 @@
       </app-block>
       <app-block class="home-main__iconbar">
         <ul>
-          <li @click="openComponent('benefits')">
+          <li @click="$router.push({ name: 'rules-benefits' })">
             <span>新人福利</span>
           </li>
-          <li @click="openComponent('malls')">
+          <li @click="$router.push({ name: 'rules-malls' })">
             <span>了解商城</span>
           </li>
-          <li @click="openComponent('logistics')">
+          <li @click="$router.push({ name: 'rules-logistics' })">
             <span>物流服务</span>
           </li>
         </ul>
@@ -48,23 +46,24 @@
         </CellGroup>
       </app-block>
       <ProductList :data-list="goodsCollectionStore.collections" />
-      <component ref="componentRef" :is="componentMap.get(componentId)" @closed="closeComponent" v-if="componentId" />
-    </PullRefresh>
+    </div>
   </app-view>
 </template>
 
 <script lang="ts" setup>
-import { shallowRef, onMounted, defineAsyncComponent } from 'vue'
-import { Cell, CellGroup, PullRefresh, Search, Icon } from 'vant'
+import { shallowRef, onMounted, onActivated } from 'vue'
+import { Cell, CellGroup, Search, Icon } from 'vant'
 import { getFileUrl } from '@/filters'
 import { queryImageConfigs } from '@/services/api/common'
 import { queryNewTitles } from '@/services/api/news'
-import { useNoticeStore, useGoodsCollectionStore } from '@/stores'
-import { useComponent } from '@/hooks/component'
+import { queryTouristGoods, queryTouristQuoteDay } from '@/services/api/goods'
+import { useLoginStore, useNoticeStore, useGoodsCollectionStore, useFuturesStore } from '@/stores'
 import ProductList from '../../product/list/components/waterfall-list/index.vue'
 
+const loginStore = useLoginStore()
 const noticeStore = useNoticeStore()
 const goodsCollectionStore = useGoodsCollectionStore()
+const futuresStore = useFuturesStore()
 
 const refreshing = shallowRef(false) // 是否处于加载中状态
 const topBanners = shallowRef(''); // 背景图片
@@ -84,11 +83,6 @@ const onRefresh = () => {
       }
     })
   }
-}
-
-onMounted(() => {
-  onRefresh()
-
   // 市场资讯
   queryNewTitles({
     data: {
@@ -100,16 +94,40 @@ onMounted(() => {
   }).finally(() => {
     refreshing.value = false
   })
-})
+}
 
-const componentMap = new Map<string, unknown>([
-    ['benefits', defineAsyncComponent(() => import('./components/benefits/Index.vue'))],   // 新人福利
-    ['malls', defineAsyncComponent(() => import('./components/malls/Index.vue'))],   // 了解商城
-    ['logistics', defineAsyncComponent(() => import('./components/logistics/Index.vue'))],   //  物流服务
-])
+onMounted(() => {
+  onRefresh()
 
-const { componentRef, componentId, openComponent, closeComponent } = useComponent()
+  if (!loginStore.token) {
+    // 获取游客商品列表
+    queryTouristGoods({
+      data: {
+        trademodes: '53',
+        marketids: '53201'
+      }
+    }).then((res) => {
+      if (res.data.length) {
+        futuresStore.goodsList = res.data
+        const goodsCodes = res.data.map((e) => e.goodscode)
+
+        // 获取游客商品盘面
+        queryTouristQuoteDay({
+          data: {
+            goodsCodes: goodsCodes.join(',')
+          }
+        }).then((res) => {
+          goodsCodes.forEach((goodscode) => {
+            const item = res.data.find((e) => e.goodscode === goodscode)
+            futuresStore.updateQuotation(item ?? { goodscode })
+          })
+        })
+      }
+    })
+  }
 
+  onActivated(() => onRefresh())
+})
 </script>
 
 <style lang="less">

+ 11 - 0
src/packages/tss/views/rules/benefits/index.vue

@@ -0,0 +1,11 @@
+<!-- 首页 - 新人福利 -->
+<template>
+    <app-view>
+        <template #header>
+            <app-navbar title="新人福利" />
+        </template>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+</script>

+ 11 - 0
src/packages/tss/views/rules/logistics/index.vue

@@ -0,0 +1,11 @@
+<!-- 首页 - 物流服务 -->
+<template>
+    <app-view>
+        <template #header>
+            <app-navbar title="物流服务" />
+        </template>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+</script>

+ 11 - 0
src/packages/tss/views/rules/malls/index.vue

@@ -0,0 +1,11 @@
+<!-- 首页 - 了解商城 -->
+<template>
+    <app-view>
+        <template #header>
+            <app-navbar title="了解商城" />
+        </template>
+    </app-view>
+</template>
+
+<script lang="ts" setup>
+</script>