李战雷 лет назад: 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 219
 <template>
220 220
   <div class="h-screen">
221 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 224
       <CXBBackTop :Scroll_X="Scroll_X" :isCss="1" />
225 225
       <image lazy-load :src="state.banner" mode="widthFix" @click="toHuiyuan" class="w-full h-50"></image>
226 226
       <div>

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

@@ -1,80 +1,83 @@
1 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 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 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 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 24
   image: '',
21 25
   title: '鼎盛联盟',
22 26
   key: 'dingsheng',
23 27
   // https://cdn.bjtdba.com/vod/image/2023-11-30/20231130092553801.png  gc
24 28
   // https://cdn.bjtdba.com/vod/image/2023-11-30/20231130092625318.png  会员
25 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 32
   title: '惠民专区',
29 33
   key: PLATFORM_NAME.DC,
30 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 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 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 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 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 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 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 61
   title: '工厂直供',
58 62
   key: 'gongchang',
59
-  categoryId: '571'
60
-},
61
-{
63
+  categoryId: '571',
64
+}, {
62 65
   image: '',
63 66
   title: '滋补养生',
64 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 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 75
   title: '更多',
73
-  key: 'chuangke'
76
+  key: 'chuangke',
74 77
 }])
75 78
 
76 79
 onBeforeMount(() => {
77
-  getHomeQuickLink().then(res => {
80
+  getHomeQuickLink().then((res) => {
78 81
     // console.log('res>>>>>', res);
79 82
 
80 83
     if (res) {
@@ -95,78 +98,77 @@ function handleItemClick(item: any) {
95 98
       const dacangStore = useDacangStore()
96 99
       dacangStore.setClassify(item.categoryId)
97 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 106
     case 'user': {
104 107
       // uni.navigateTo({
105 108
       //   url: `/pages/vip/index?type=`+item.key
106 109
       // })
107
-	  
110
+
108 111
 	  uni.navigateToMiniProgram({
109 112
 	      appId: 'wx9082e5ac2fdb513f',
110 113
 	      path: 'pages/home/index',
111 114
 	  	  envVersion: 'release', // develop(开发版),trial(体验版),release(正式版)
112 115
 	      success(res) {
113 116
 	        // 打开成功
114
-	        console.log(res);
117
+	        console.log(res)
115 118
 	      },
116 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 127
     case 'miaosha': {
126 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 133
     case 'zibu': {
132 134
       // if ()
133 135
       const id = 430
134 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 141
     case 'dingsheng': {
140 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 148
     case 'gongchang': {
147 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 154
     case 'jingpin': {
153 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 161
     case 'integral': {
160 162
       uni.navigateTo({
161
-        url: '/pages/product/integral'
163
+        url: '/pages/product/integral',
162 164
       })
163
-      break;
165
+      break
164 166
     }
165 167
     case 'chuangke': {
166 168
       uni.switchTab({
167
-        url: '/pages/store/nearby/index'
169
+        url: '/pages/store/nearby/index',
168 170
       })
169
-      break;
171
+      break
170 172
     }
171 173
     case PLATFORM_NAME.JD:
172 174
     case PLATFORM_NAME.VIP:
@@ -175,20 +177,23 @@ function handleItemClick(item: any) {
175 177
     case PLATFORM_NAME.TB:
176 178
     case PLATFORM_NAME.SU:
177 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 185
 </script>
186
+
184 187
 <template>
185 188
   <!-- 15宫格 -->
186 189
   <div class="">
187 190
     <div class="rounded bg-white pt-4 pb-2 px-5">
188 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 197
           <div class="text-xs">
193 198
             {{ navItem.title }}
194 199
           </div>