李战雷 лет назад: 2
Родитель
Сommit
744549ec9d
2 измененных файлов с 75 добавлено и 70 удалено
  1. 2 2
      src/pages/dacang/list/index.vue
  2. 73 68
      src/pages/home/components/navs.vue

+ 2 - 2
src/pages/dacang/list/index.vue

@@ -219,8 +219,8 @@ onPullDownRefresh(() => {
219
 <template>
219
 <template>
220
   <div class="h-screen">
220
   <div class="h-screen">
221
     <DacangHeader :ex-class="headerClass" :tabs="state.tabs" @click:item="handleTabItemClick" />
221
     <DacangHeader :ex-class="headerClass" :tabs="state.tabs" @click:item="handleTabItemClick" />
222
-
223
-    <div class="flex flex-col gap-2 ">
222
+	<!-- gap-2 -->
223
+    <div class="flex flex-col">
224
       <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
224
       <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
225
       <image lazy-load :src="state.banner" mode="widthFix" @click="toHuiyuan" class="w-full h-50"></image>
225
       <image lazy-load :src="state.banner" mode="widthFix" @click="toHuiyuan" class="w-full h-50"></image>
226
       <div>
226
       <div>

+ 73 - 68
src/pages/home/components/navs.vue

@@ -1,80 +1,83 @@
1
 <script lang="ts" setup>
1
 <script lang="ts" setup>
2
-import { getHomeQuickLink } from "~/apis/common";
3
-import { PLATFORM_NAME } from "~/apis/model/common.model";
4
-import { useDacangStore } from "~/stores/dacangStore";
5
-import { CDN_URL, CDM_URL } from "~/config/app";
2
+import { getHomeQuickLink } from '~/apis/common'
3
+import { PLATFORM_NAME } from '~/apis/model/common.model'
4
+import { useDacangStore } from '~/stores/dacangStore'
5
+import { CDM_URL, CDN_URL } from '~/config/app'
6
 
6
 
7
 const navList = ref([{
7
 const navList = ref([{
8
-  image: CDM_URL + '/image/2023-11-20/20231120155257975.png',
8
+  image: `${CDM_URL}/image/2023-11-20/20231120155257975.png`,
9
   title: '精品商城',
9
   title: '精品商城',
10
-  key: 'jingpin'
10
+  key: 'jingpin',
11
 }, {
11
 }, {
12
-  image: CDN_URL + '/static/home-nav/home_xianshimiaosha_220614.png',
12
+  image: `${CDN_URL}/static/home-nav/home_xianshimiaosha_220614.png`,
13
   title: '限时秒杀',
13
   title: '限时秒杀',
14
-  key: 'miaosha'
15
-},{
16
-  image: CDM_URL + '/image/2023-11-30/20231130092625318.png',
17
-  title: '一壶茶',
18
-  key: 'user',
19
-},{
14
+  key: 'miaosha',
15
+}, {
16
+  // image: CDM_URL + '/image/2023-11-30/20231130092625318.png',
17
+  // title: '一壶茶',
18
+  // key: 'user',
19
+  image: `${CDN_URL}/static/home-nav/elderly_zone_220920.png`,
20
+  title: '老年专区',
21
+  key: PLATFORM_NAME.DC,
22
+  categoryId: '571',
23
+}, {
20
   image: '',
24
   image: '',
21
   title: '鼎盛联盟',
25
   title: '鼎盛联盟',
22
   key: 'dingsheng',
26
   key: 'dingsheng',
23
   // https://cdn.bjtdba.com/vod/image/2023-11-30/20231130092553801.png  gc
27
   // https://cdn.bjtdba.com/vod/image/2023-11-30/20231130092553801.png  gc
24
   // https://cdn.bjtdba.com/vod/image/2023-11-30/20231130092625318.png  会员
28
   // https://cdn.bjtdba.com/vod/image/2023-11-30/20231130092625318.png  会员
25
   // categoryId: '149'
29
   // categoryId: '149'
26
-},{
27
-  image: CDN_URL + '/static/home-nav/icon_hmyh_221014.png',
30
+}, {
31
+  image: `${CDN_URL}/static/home-nav/icon_hmyh_221014.png`,
28
   title: '惠民专区',
32
   title: '惠民专区',
29
   key: PLATFORM_NAME.DC,
33
   key: PLATFORM_NAME.DC,
30
   categoryId: '567',
34
   categoryId: '567',
31
-},{
32
-  image: CDN_URL + '/static/home-nav/jingdongshengqian_220920.png',
35
+}, {
36
+  image: `${CDN_URL}/static/home-nav/jingdongshengqian_220920.png`,
33
   title: '京东',
37
   title: '京东',
34
-  key: PLATFORM_NAME.JD
38
+  key: PLATFORM_NAME.JD,
35
 }, {
39
 }, {
36
-  image: CDN_URL + '/static/home-nav/home_taobaoyanglao_220920.png',
40
+  image: `${CDN_URL}/static/home-nav/home_taobaoyanglao_220920.png`,
37
   title: '淘宝',
41
   title: '淘宝',
38
-  key: PLATFORM_NAME.TB
42
+  key: PLATFORM_NAME.TB,
39
 }, {
43
 }, {
40
-  image: CDM_URL + '/image/2023-11-24/20231124150424710.png',
44
+  image: `${CDM_URL}/image/2023-11-24/20231124150424710.png`,
41
   title: '拼多多',
45
   title: '拼多多',
42
-  key: PLATFORM_NAME.PDD
46
+  key: PLATFORM_NAME.PDD,
43
 }, {
47
 }, {
44
-  image: CDN_URL + '/static/home-nav/home_weipinhui_220920.png',
48
+  image: `${CDN_URL}/static/home-nav/home_weipinhui_220920.png`,
45
   title: '唯品会',
49
   title: '唯品会',
46
-  key: PLATFORM_NAME.VIP
50
+  key: PLATFORM_NAME.VIP,
47
 }, {
51
 }, {
48
-  image: CDN_URL + '/static/home-nav/home_suningyigou_220920.png',
52
+  image: `${CDN_URL}/static/home-nav/home_suningyigou_220920.png`,
49
   title: '苏宁易购',
53
   title: '苏宁易购',
50
-  key: PLATFORM_NAME.SU
51
-},{
52
-  image: CDN_URL + '/static/home-nav/douyin_logo_230317.png',
54
+  key: PLATFORM_NAME.SU,
55
+}, {
56
+  image: `${CDN_URL}/static/home-nav/douyin_logo_230317.png`,
53
   title: '抖音',
57
   title: '抖音',
54
-  key: PLATFORM_NAME.DY
58
+  key: PLATFORM_NAME.DY,
55
 }, {
59
 }, {
56
-  image: CDM_URL + '/image/2023-11-30/20231130092553801.png',
60
+  image: `${CDM_URL}/image/2023-11-30/20231130092553801.png`,
57
   title: '工厂直供',
61
   title: '工厂直供',
58
   key: 'gongchang',
62
   key: 'gongchang',
59
-  categoryId: '571'
60
-},
61
-{
63
+  categoryId: '571',
64
+}, {
62
   image: '',
65
   image: '',
63
   title: '滋补养生',
66
   title: '滋补养生',
64
   key: 'zibu',
67
   key: 'zibu',
65
-  categoryId: '430'
68
+  categoryId: '430',
66
 }, {
69
 }, {
67
-  image: CDN_URL + '/static/home-nav/home_jinfentongdui_220615.png',
70
+  image: `${CDN_URL}/static/home-nav/home_jinfentongdui_220615.png`,
68
   title: '积分通兑',
71
   title: '积分通兑',
69
-  key: 'integral'
72
+  key: 'integral',
70
 }, {
73
 }, {
71
-  image: CDN_URL + '/static/home-nav/home_gengduo.png',
74
+  image: `${CDN_URL}/static/home-nav/home_gengduo.png`,
72
   title: '更多',
75
   title: '更多',
73
-  key: 'chuangke'
76
+  key: 'chuangke',
74
 }])
77
 }])
75
 
78
 
76
 onBeforeMount(() => {
79
 onBeforeMount(() => {
77
-  getHomeQuickLink().then(res => {
80
+  getHomeQuickLink().then((res) => {
78
     // console.log('res>>>>>', res);
81
     // console.log('res>>>>>', res);
79
 
82
 
80
     if (res) {
83
     if (res) {
@@ -95,78 +98,77 @@ function handleItemClick(item: any) {
95
       const dacangStore = useDacangStore()
98
       const dacangStore = useDacangStore()
96
       dacangStore.setClassify(item.categoryId)
99
       dacangStore.setClassify(item.categoryId)
97
       uni.switchTab({
100
       uni.switchTab({
98
-        url: '/pages/dacang/list/index'
101
+        url: '/pages/dacang/list/index',
99
       })
102
       })
100
-      break;
103
+      break
101
     }
104
     }
102
     // 会员专区
105
     // 会员专区
103
     case 'user': {
106
     case 'user': {
104
       // uni.navigateTo({
107
       // uni.navigateTo({
105
       //   url: `/pages/vip/index?type=`+item.key
108
       //   url: `/pages/vip/index?type=`+item.key
106
       // })
109
       // })
107
-	  
110
+
108
 	  uni.navigateToMiniProgram({
111
 	  uni.navigateToMiniProgram({
109
 	      appId: 'wx9082e5ac2fdb513f',
112
 	      appId: 'wx9082e5ac2fdb513f',
110
 	      path: 'pages/home/index',
113
 	      path: 'pages/home/index',
111
 	  	  envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
114
 	  	  envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
112
 	      success(res) {
115
 	      success(res) {
113
 	        // 打开成功
116
 	        // 打开成功
114
-	        console.log(res);
117
+	        console.log(res)
115
 	      },
118
 	      },
116
 	      fail: (error) => {
119
 	      fail: (error) => {
117
-	        console.log(error);
118
-	      }
120
+	        console.log(error)
121
+	      },
119
 	    })
122
 	    })
120
-	  
121
-	  
122
-      break;
123
+
124
+      break
123
     }
125
     }
124
     // 秒杀
126
     // 秒杀
125
     case 'miaosha': {
127
     case 'miaosha': {
126
       uni.navigateTo({
128
       uni.navigateTo({
127
-        url: '/pages/miaosha/index?type_show=1'
129
+        url: '/pages/miaosha/index?type_show=1',
128
       })
130
       })
129
-      break;
131
+      break
130
     }
132
     }
131
     case 'zibu': {
133
     case 'zibu': {
132
       // if ()
134
       // if ()
133
       const id = 430
135
       const id = 430
134
       uni.navigateTo({
136
       uni.navigateTo({
135
-        url: `/pages/product/zibuyangsheng?id=${id}`
137
+        url: `/pages/product/zibuyangsheng?id=${id}`,
136
       })
138
       })
137
-      break;
139
+      break
138
     }
140
     }
139
     case 'dingsheng': {
141
     case 'dingsheng': {
140
       uni.navigateTo({
142
       uni.navigateTo({
141
-        url: `/pages/product/dingshenglianmeng?type=` + item.key
143
+        url: `/pages/product/dingshenglianmeng?type=${item.key}`,
142
       })
144
       })
143
-      break;
145
+      break
144
     }
146
     }
145
-    //工厂直供
147
+    // 工厂直供
146
     case 'gongchang': {
148
     case 'gongchang': {
147
       uni.navigateTo({
149
       uni.navigateTo({
148
-        url: `/pages/vip/index?type=`+item.key
150
+        url: `/pages/vip/index?type=${item.key}`,
149
       })
151
       })
150
-      break;
152
+      break
151
     }
153
     }
152
     case 'jingpin': {
154
     case 'jingpin': {
153
       uni.navigateTo({
155
       uni.navigateTo({
154
-        url: `/pages/product/dingshenglianmeng?type=` + item.key
156
+        url: `/pages/product/dingshenglianmeng?type=${item.key}`,
155
       })
157
       })
156
-      break;
158
+      break
157
     }
159
     }
158
     // 积分通兑
160
     // 积分通兑
159
     case 'integral': {
161
     case 'integral': {
160
       uni.navigateTo({
162
       uni.navigateTo({
161
-        url: '/pages/product/integral'
163
+        url: '/pages/product/integral',
162
       })
164
       })
163
-      break;
165
+      break
164
     }
166
     }
165
     case 'chuangke': {
167
     case 'chuangke': {
166
       uni.switchTab({
168
       uni.switchTab({
167
-        url: '/pages/store/nearby/index'
169
+        url: '/pages/store/nearby/index',
168
       })
170
       })
169
-      break;
171
+      break
170
     }
172
     }
171
     case PLATFORM_NAME.JD:
173
     case PLATFORM_NAME.JD:
172
     case PLATFORM_NAME.VIP:
174
     case PLATFORM_NAME.VIP:
@@ -175,20 +177,23 @@ function handleItemClick(item: any) {
175
     case PLATFORM_NAME.TB:
177
     case PLATFORM_NAME.TB:
176
     case PLATFORM_NAME.SU:
178
     case PLATFORM_NAME.SU:
177
       uni.navigateTo({
179
       uni.navigateTo({
178
-        url: `/pages/search/index?platform=${item.key}`
180
+        url: `/pages/search/index?platform=${item.key}`,
179
       })
181
       })
180
-      break;
182
+      break
181
   }
183
   }
182
 }
184
 }
183
 </script>
185
 </script>
186
+
184
 <template>
187
 <template>
185
   <!-- 15宫格 -->
188
   <!-- 15宫格 -->
186
   <div class="">
189
   <div class="">
187
     <div class="rounded bg-white pt-4 pb-2 px-5">
190
     <div class="rounded bg-white pt-4 pb-2 px-5">
188
       <div class="flex justify-around flex-wrap ">
191
       <div class="flex justify-around flex-wrap ">
189
-        <div @tap="handleItemClick(navItem)" class="flex flex-col items-center justify-center gap-y-1 mb-2 flex-[0_0_20%]"
190
-          v-for="(navItem, index) in navList" :key="index">
191
-          <image :src="navItem.image" mode="widthFix" class="w-10 h-10"></image>
192
+        <div
193
+          v-for="(navItem, index) in navList" :key="index"
194
+          class="flex flex-col items-center justify-center gap-y-1 mb-2 flex-[0_0_20%]" @tap="handleItemClick(navItem)"
195
+        >
196
+          <image :src="navItem.image" mode="widthFix" class="w-10 h-10" />
192
           <div class="text-xs">
197
           <div class="text-xs">
193
             {{ navItem.title }}
198
             {{ navItem.title }}
194
           </div>
199
           </div>