Commit 47ef39561e7fade419ae3b142c3f61ec7481c874
1 parent
13918a1f
商品分类
Showing
4 changed files
with
228 additions
and
13 deletions
app.wxss
pages/goods/categoryList/categoryList.js
... | ... | @@ -28,11 +28,12 @@ Page({ |
28 | 28 | is_country:1, |
29 | 29 | //品牌的控制属性 |
30 | 30 | is_brand:1, |
31 | - name: [{ names: "洗护用品" }, { names: "天天护理" }, { names: "个人洗护" }, { names: "轻奢" }, { names: "路虎" }, { names: "身体护理" }, { names: "品牌" }, { names: "面部护理" }], | |
31 | + name: [{ names: "洗护用品" }, { names: "天天护理" }, { names: "共顺利" },{ names: "个人洗护" }, { names: "轻奢" }, { names: "路虎" }, { names: "身体护理" }, { names: "品牌" }, { names: "面部护理" }], | |
32 | 32 | //选择分类的控制属性 |
33 | 33 | select_classify_on:223, |
34 | 34 | index:223, |
35 | 35 | classify_name:"国家",//项目类型 |
36 | + brand_list:null,//品牌列表 | |
36 | 37 | }, |
37 | 38 | onLoad: function(tt) { |
38 | 39 | const res = wx.getSystemInfoSync(), |
... | ... | @@ -65,7 +66,12 @@ Page({ |
65 | 66 | } |
66 | 67 | this.setData({ |
67 | 68 | lettersPosition: temp |
68 | - }) | |
69 | + }); | |
70 | + console.log(this.data.is_used_share,"是什么东西啊"); | |
71 | + if (this.data.is_used_share==0){ | |
72 | + console.log("有进来m"); | |
73 | + this.get_nation(); | |
74 | + } | |
69 | 75 | |
70 | 76 | |
71 | 77 | }, |
... | ... | @@ -264,6 +270,7 @@ Page({ |
264 | 270 | }, |
265 | 271 | success: function (e) { |
266 | 272 | var dda = e.data.data.pageData; |
273 | + | |
267 | 274 | s.setData({ nationlist:dda}) |
268 | 275 | } |
269 | 276 | }); |
... | ... | @@ -294,6 +301,8 @@ Page({ |
294 | 301 | success: function (e) { |
295 | 302 | var arr=new Array(); |
296 | 303 | var dda = e.data.data.pageData; |
304 | + console.log("商品数据",dda); | |
305 | + s.setData({brand_list:dda}); | |
297 | 306 | for (var i = 0; i < dda.length; i++) { |
298 | 307 | |
299 | 308 | dda[i].logo = oo.imghost+dda[i].logo; |
... | ... | @@ -353,8 +362,23 @@ Page({ |
353 | 362 | // 新的版本分类 |
354 | 363 | click_classify:function(e){ |
355 | 364 | var indexs=e.currentTarget.dataset.index; |
365 | + var name = e.currentTarget.dataset.name; | |
356 | 366 | console.log("获取当前下标",indexs); |
357 | - this.setData({ select_classify_on: indexs, index: indexs}); | |
358 | - } | |
367 | + this.setData({ select_classify_on: indexs, index: indexs, classify_name:name}); | |
368 | + if (indexs==220){ | |
369 | + this.get_brand(); | |
370 | + } | |
371 | + | |
372 | + }, | |
373 | +// 图片失败 | |
374 | + bind_bnerr_xc: function (e) { | |
375 | + var _errImg = e.target.dataset.errorimg; | |
376 | + var _errurl = e.target.dataset.url; | |
377 | + | |
378 | + var _errObj = {}; | |
379 | + _errObj[_errImg] = "/miniapp/images/default_g_img.gif"; | |
380 | + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | |
381 | + | |
382 | + }, | |
359 | 383 | |
360 | 384 | }); |
361 | 385 | \ No newline at end of file | ... | ... |
pages/goods/categoryList/categoryList.wxml
... | ... | @@ -128,19 +128,117 @@ |
128 | 128 | <text>品</text><text>牌</text> |
129 | 129 | </view> |
130 | 130 | <block wx:for="{{name}}" wx:for-item="ittm"wx:for-index="index"> |
131 | - <view bindtap="click_classify" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs32 t-c {{ittm.names.length==2? 'world_sn':''}} {{select_classify_on==index&&ittm.names.length==2?'text-indent':''}}"data-index="{{index}}"data-name="{{ittm.names}}"> | |
132 | - {{ittm.names}} | |
131 | + <view bindtap="click_classify" class="{{select_classify_on==index?'select_classify width80':''}} share_type fs32 t-c {{ittm.names.length==2? 'world_sn':''}} {{select_classify_on==index&&ittm.names.length==2?'text-indent':''}} {{select_classify_on==index&&ittm.names.length==3?'text3':''}}"data-index="{{index}}"data-name="{{ittm.names}}"> | |
132 | + <view class="{{ittm.names.length==3?'flex-center-around':'flex-space-between'}}" wx:if="{{ittm.names.length<4}}"> | |
133 | + <view wx:for="{{ittm.names}}" wx:for-item="names"wx:for-index="index"> | |
134 | + <view> | |
135 | + {{names}} | |
136 | + </view> | |
137 | + </view> | |
138 | + | |
139 | + </view> | |
140 | + <view wx:else> | |
141 | + {{ittm.names}} | |
142 | + </view> | |
133 | 143 | </view> |
134 | 144 | </block> |
135 | 145 | |
136 | 146 | </view> |
137 | 147 | |
138 | 148 | </view> |
149 | + | |
150 | + | |
151 | + | |
152 | + | |
139 | 153 | <!-- 分类项目的内容 --> |
140 | 154 | <view class="classify_content"> |
141 | -<view class="classify_name fs32">{{classify_name}}</view> | |
142 | -<view class="flex classify_content-frame"> | |
155 | +<view class="classify_name fs32 flex-space-between"> | |
156 | +<view>{{classify_name}}</view> | |
157 | +<view class="flex select_more"> | |
158 | + <view class="red-co fs32">选择更多</view> | |
159 | + <view class="bg_right width_height"></view> | |
160 | +</view> | |
161 | + | |
143 | 162 | </view> |
163 | +<!-- 国家的样式 --> | |
164 | +<block wx:if="{{select_classify_on==223}}"> | |
165 | + <view class="flex classify_content-frame" > | |
166 | + <view bindtap="go_nation" class="country_img-frame rel outer_location"wx:for="{{nationlist}}" wx:for-item="bitem" wx:for-index="pidx" data-nid="{{bitem.id}}" > | |
167 | + <image class="country_img" src="{{iurl}}{{bitem.logo}}"></image> | |
168 | + <view class='nation_box abs box'> | |
169 | + <view class='nt_1 t-c line-height'> | |
170 | + <text class="nt_1_t height fs24">{{bitem.name}}</text> | |
171 | + </view> | |
172 | + <view class='nt_2 t-c line-height fs24'>enname</view> | |
173 | + </view> | |
174 | + </view> | |
175 | +</view> | |
176 | +</block> | |
177 | +<!-- 品牌 --> | |
178 | +<block wx:if="{{select_classify_on==220}}"> | |
179 | +<view class="classify_content-frame flex flex-wrap"> | |
180 | + | |
181 | + <block wx:for="{{groups}}" wx:for-item="brand_list" wx:for-index="pidx"> | |
182 | + <view class="brand_img_frame "wx:for="{{brand_list.array}}"wx:for-item="user" wx:for-index="idx" bindtap="go_brand" data-bid="{{user.id}}" > | |
183 | + | |
184 | + <view class="brand_img t-c"> | |
185 | + <image class="brand_img"src="{{user.logo}}"data-errorimg="brand_list[{{pidx}}].array[{{idx}}].logo" binderror="bind_bnerr"></image> | |
186 | + <view class="brand_img_name fs24">{{user.name}}</view> | |
187 | + </view> | |
188 | + </view> | |
189 | +</block> | |
190 | +</view> | |
191 | +</block> | |
192 | +<!-- 商品 --> | |
193 | +<block wx:if="{{select_classify_on!=220&&select_classify_on!=223}}"> | |
194 | +<view class="classify_content-frame flex flex-wrap"> | |
195 | + <view class="brand_img_frame t-c"> | |
196 | + <image class="brand_img"src="../../../images/1.png"></image> | |
197 | + <view class="brand_img_name fs24">你好呃呃</view> | |
198 | + </view> | |
199 | + | |
200 | + <view class="brand_img_frame t-c"> | |
201 | + <image class="brand_img"src="../../../images/2.png"></image> | |
202 | + <view class="brand_img_name fs24">你好</view> | |
203 | + </view> | |
204 | + | |
205 | + <view class="brand_img_frame t-c"> | |
206 | + <image class="brand_img"src="../../../images/3.png"></image> | |
207 | + <view class="brand_img_name fs24">你好</view> | |
208 | + </view> | |
209 | + | |
210 | + <view class="brand_img_frame t-c"> | |
211 | + <image class="brand_img"src="../../../images/4.png"></image> | |
212 | + <view class="brand_img_name fs24">你好</view> | |
213 | + </view> | |
214 | + | |
215 | + <view class="brand_img_frame t-c"> | |
216 | + <image class="brand_img"src="../../../images/5.png"></image> | |
217 | + <view class="brand_img_name fs24">你好</view> | |
218 | + </view> | |
219 | + | |
220 | + <view class="brand_img_frame t-c"> | |
221 | + <image class="brand_img"src="../../../images/6.png"></image> | |
222 | + <view class="brand_img_name fs24">你好品牌</view> | |
223 | + </view> | |
224 | + | |
225 | + <view class="brand_img_frame t-c"> | |
226 | + <image class="brand_img"src="../../../images/7.png"></image> | |
227 | + <view class="brand_img_name fs24">你好慢慢</view> | |
228 | + </view> | |
229 | + | |
230 | + <view class="brand_img_frame t-c"> | |
231 | + <image class="brand_img"src="../../../images/8.png"></image> | |
232 | + <view class="brand_img_name fs24">你好</view> | |
233 | + </view> | |
234 | + | |
235 | + <view class="brand_img_frame t-c"> | |
236 | + <image class="brand_img"src="../../../images/9.png"></image> | |
237 | + <view class="brand_img_name fs24">你好匿名</view> | |
238 | + </view> | |
239 | + | |
240 | +</view> | |
241 | +</block> | |
144 | 242 | </view> |
145 | 243 | |
146 | 244 | ... | ... |
pages/goods/categoryList/categoryList.wxss
... | ... | @@ -10,6 +10,7 @@ page{height: 100%; background: #fff;} |
10 | 10 | flex-flow: row; |
11 | 11 | justify-content: center; |
12 | 12 | margin-left: 15%; |
13 | + | |
13 | 14 | } |
14 | 15 | .swiper-tab-item{ |
15 | 16 | width: 30%; |
... | ... | @@ -172,11 +173,14 @@ swiper{ |
172 | 173 | .share-height{ |
173 | 174 | line-height: 20rpx; |
174 | 175 | margin-right: 15rpx; |
176 | +margin-top: 8rpx; | |
175 | 177 | |
176 | 178 | } |
177 | 179 | .scanning_black-img{ |
178 | 180 | width:50rpx; |
179 | 181 | height: 45rpx; |
182 | + margin-bottom: 5rpx; | |
183 | + | |
180 | 184 | } |
181 | 185 | .search-img.left{ |
182 | 186 | margin-left: 35rpx; |
... | ... | @@ -219,12 +223,12 @@ margin-top: 35rpx; |
219 | 223 | white-space: nowrap; |
220 | 224 | overflow: hidden; |
221 | 225 | width: 50%; |
222 | -letter-spacing: 60rpx; | |
226 | +/* letter-spacing: 60rpx; */ | |
223 | 227 | margin: auto; |
224 | 228 | margin-top: 35rpx; |
225 | 229 | } |
226 | 230 | .select_classify{ |
227 | - background: #ffe3e2; | |
231 | + background: #d60021; | |
228 | 232 | border-radius: 30rpx; |
229 | 233 | color: #fff; |
230 | 234 | height: 48rpx; |
... | ... | @@ -234,8 +238,11 @@ line-height: 45rpx; |
234 | 238 | .select_classify.width80{ |
235 | 239 | width: 74.5%; |
236 | 240 | } |
237 | - .text-indent{ | |
238 | - text-indent: 31rpx; | |
241 | + .select_classify.width80.text-indent{ | |
242 | + text-indent: 38rpx; | |
243 | + padding-right: 20px; | |
244 | +width: 60%; | |
245 | + | |
239 | 246 | } |
240 | 247 | .classify_name{ |
241 | 248 | width: 90%; |
... | ... | @@ -244,6 +251,7 @@ line-height: 45rpx; |
244 | 251 | border-bottom: 1rpx solid #eee; |
245 | 252 | line-height: 85rpx; |
246 | 253 | font-weight: 600; |
254 | + | |
247 | 255 | |
248 | 256 | } |
249 | 257 | .classify_content{ |
... | ... | @@ -252,8 +260,90 @@ line-height: 45rpx; |
252 | 260 | } |
253 | 261 | .classify_content-frame{ |
254 | 262 | width: 90%; |
255 | - height: 90%; | |
256 | 263 | margin: auto; |
257 | 264 | flex-wrap:wrap; |
258 | 265 | justify-content:space-between; |
266 | + height: 90%; | |
267 | + overflow-y:scroll; | |
268 | + overflow: hidden scroll; | |
269 | + | |
270 | + } | |
271 | + .country_img-frame{ | |
272 | + width: 48%; | |
273 | + height: 140rpx; | |
274 | + | |
275 | + } | |
276 | + .country_img{ | |
277 | + width: 100%; | |
278 | + height: 100%; | |
279 | + } | |
280 | + .outer_location{ | |
281 | + top:0rpx; | |
282 | + left: 0rpx; | |
283 | + margin-top: 20rpx; | |
284 | + | |
285 | + } | |
286 | + .nation_box.box{ | |
287 | + top: 16%; | |
288 | +width:80%; | |
289 | +height:70%; | |
290 | +left: 70.5%; | |
291 | + | |
292 | + } | |
293 | + .nt_1.line-height{ | |
294 | + line-height: 65rpx; | |
295 | + height: 72rpx; | |
296 | +margin-top: -5rpx; | |
297 | + | |
298 | + } | |
299 | + .nt_1_t.height{ | |
300 | + height: 54rpx; | |
301 | + } | |
302 | + .nt_1.height{ | |
303 | + height: 56rpx; | |
304 | +line-height: 65rpx; | |
305 | + } | |
306 | + .nt_2.line-height{ | |
307 | + height: 0rpx; | |
308 | + line-height: 0rpx; | |
309 | + | |
310 | + } | |
311 | + .nt_1_t.fs24{ | |
312 | + font-size: 24rpx; | |
313 | + } | |
314 | + .nt_2.fs24{ | |
315 | + font-size: 24rpx; | |
316 | + } | |
317 | + .brand_img_frame{ | |
318 | + width: 30%; | |
319 | + height: 220rpx; | |
320 | + margin-top: 18rpx; | |
321 | + | |
322 | + } | |
323 | + | |
324 | + .brand_img{ | |
325 | + width:100%; | |
326 | + height: 70%; | |
327 | + margin-bottom: 10rpx | |
328 | + } | |
329 | + .brand_img-name{ | |
330 | + width: 100%; | |
331 | + height: 20%; | |
332 | + } | |
333 | + .select_classify.width80.text3{ | |
334 | +padding-right: 20rpx; | |
335 | +padding-left: 20rpx; | |
336 | +width: 62%; | |
337 | + | |
338 | + } | |
339 | + .width_height{ | |
340 | + width: 18rpx; | |
341 | + height: 18rpx; | |
342 | + } | |
343 | + .select_more{ | |
344 | +line-height: 38rpx; | |
345 | +height: 35rpx; | |
346 | +margin-top: 23rpx; | |
347 | + | |
348 | + | |
259 | 349 | } |
260 | 350 | \ No newline at end of file | ... | ... |