فهرست منبع

✨ feat(product): 添加热卖商品页面

陈雪 1 ماه پیش
والد
کامیت
cea1a6efcc
4فایلهای تغییر یافته به همراه51 افزوده شده و 1 حذف شده
  1. 8 0
      src/pages.json
  2. 35 0
      src/pages/index/hot-sell.vue
  3. 7 1
      src/pages/index/index.vue
  4. 1 0
      src/types/uni-pages.d.ts

+ 8 - 0
src/pages.json

@@ -98,6 +98,14 @@
       }
     },
     {
+      "path": "pages/index/hot-sell",
+      "type": "page",
+      "layout": "default",
+      "style": {
+        "navigationBarTitleText": "%home.hotSelling%"
+      }
+    },
+    {
       "path": "pages/person/person",
       "type": "page",
       "layout": "tabbar",

+ 35 - 0
src/pages/index/hot-sell.vue

@@ -0,0 +1,35 @@
+<route lang="json5">
+{
+  layout: 'default',
+  style: {
+    navigationBarTitleText: '%home.hotSelling%',
+  },
+}
+</route>
+
+<template>
+  <view class="hot-selling">
+    <HotTags v-bind:current-tag="currentTag"></HotTags>
+    <ProductList></ProductList>
+  </view>
+</template>
+
+<script lang="ts" setup>
+  import HotTags from '@/components/hot-tags/hot-tags.vue'
+  import ProductList from '@/components/product-list/product-list.vue'
+
+  const currentTag = ref(0)
+
+  //
+</script>
+
+<style lang="scss" scoped>
+  .hot-selling {
+    box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+    align-items: flex-start;
+    justify-content: center;
+    padding: 24rpx 0 44rpx 32rpx;
+  }
+</style>

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

@@ -58,7 +58,7 @@
       <view class="selling-title">
         <view class="selling-title-text">{{ t('home.hotSelling') }}</view>
         <view class="selling-see-all">
-          <view class="selling-see-all-text">{{ t('home.seeAll') }}</view>
+          <view class="selling-see-all-text" @click="gotoHotSelling">{{ t('home.seeAll') }}</view>
           <image class="w-9rpx" src="@/static/images/right.svg" mode="widthFix"></image>
         </view>
       </view>
@@ -85,6 +85,12 @@
   const current = ref(0)
   const currentTag = ref(0)
 
+  const gotoHotSelling = () => {
+    uni.navigateTo({
+      url: '/pages/index/hot-sell',
+    })
+  }
+
   const swiperList = ref([
     'https://t.xiaoyaotravel.com/image/TourImComplait/messageContent/696b679508664bb4bceb6cc6b06d0cdc.png',
     'https://registry.npmmirror.com/wot-design-uni-assets/*/files/redpanda.jpg',

+ 1 - 0
src/types/uni-pages.d.ts

@@ -9,6 +9,7 @@ interface NavigateToOptions {
        "/pages/cart/cart" |
        "/pages/category/category" |
        "/pages/community/community" |
+       "/pages/index/hot-sell" |
        "/pages/person/person" |
        "/pages/user/login";
 }