Commit b21a4e07c2c1b5db993b75951e364e0b6d62b563
1 parent
096e4995
商品分类
Showing
3 changed files
with
145 additions
and
15 deletions
pages/goods/categoryList/categoryList.js
@@ -22,7 +22,16 @@ Page({ | @@ -22,7 +22,16 @@ Page({ | ||
22 | // 导航字母 | 22 | // 导航字母 |
23 | letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', | 23 | letters: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', |
24 | 'U', 'V', 'W', 'X', 'Y', 'Z'], | 24 | 'U', 'V', 'W', 'X', 'Y', 'Z'], |
25 | - | 25 | + //控制新旧分类版本 |
26 | + is_used_share:0, | ||
27 | + //国家的控制属性 | ||
28 | + is_country:1, | ||
29 | + //品牌的控制属性 | ||
30 | + is_brand:1, | ||
31 | + name: [{ names: "洗护用品" }, { names: "天天护理" }, { names: "个人洗护" }, { names: "轻奢" }, { names: "路虎" }, { names: "身体护理" }, { names: "品牌" }, { names: "面部护理" }], | ||
32 | + //选择分类的控制属性 | ||
33 | + select_classify_on:223, | ||
34 | + index:223, | ||
26 | }, | 35 | }, |
27 | onLoad: function(tt) { | 36 | onLoad: function(tt) { |
28 | const res = wx.getSystemInfoSync(), | 37 | const res = wx.getSystemInfoSync(), |
@@ -339,7 +348,12 @@ Page({ | @@ -339,7 +348,12 @@ Page({ | ||
339 | _errObj[_errImg] = "/public/images/category.png"; | 348 | _errObj[_errImg] = "/public/images/category.png"; |
340 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; | 349 | this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ; |
341 | 350 | ||
342 | - } | ||
343 | - | 351 | + }, |
352 | + // 新的版本分类 | ||
353 | + click_classify:function(e){ | ||
354 | + var indexs=e.currentTarget.dataset.index; | ||
355 | + console.log("获取当前下标",indexs); | ||
356 | + this.setData({ select_classify_on: indexs, index: indexs}); | ||
357 | + } | ||
344 | 358 | ||
345 | }); | 359 | }); |
346 | \ No newline at end of file | 360 | \ No newline at end of file |
pages/goods/categoryList/categoryList.wxml
1 | - | 1 | +<block wx:if="{{is_used_share}}"> |
2 | <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> | 2 | <view class='top_view' wx:if="{{is_show_pl || is_show_gb || is_show_pp }}"> |
3 | <view class="swiper-tab" > | 3 | <view class="swiper-tab" > |
4 | <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}" | 4 | <view wx:if="{{is_show_pl}}" class="swiper-tab-item {{currentTab==0?'active':''}}" |
@@ -10,11 +10,8 @@ | @@ -10,11 +10,8 @@ | ||
10 | </view> | 10 | </view> |
11 | </view> | 11 | </view> |
12 | 12 | ||
13 | -<view class="search-box flex-center" bindtap="goseach"> | ||
14 | - <view class="share-height t-c"> | ||
15 | - <image class="share-black-img"src="../../../images/share_black.png"></image> | ||
16 | - <view class="fs24">分享</view> | ||
17 | - </view> | 13 | +<view class="search-box " bindtap="goseach"> |
14 | + | ||
18 | <view class="search-inner"> | 15 | <view class="search-inner"> |
19 | <view class="search-img"> | 16 | <view class="search-img"> |
20 | <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | 17 | <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> |
@@ -101,3 +98,47 @@ | @@ -101,3 +98,47 @@ | ||
101 | <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> | 98 | <navigator class="lookat" openType="switchTab" url="/pages/index/index/index"> 去逛逛 </navigator> |
102 | </view> | 99 | </view> |
103 | </block> | 100 | </block> |
101 | +</block> | ||
102 | +<block wx:else> | ||
103 | +<!-- 新版分类头部 --> | ||
104 | +<view class="xc-search-box flex-center white_b" bindtap="goseach"> | ||
105 | + <view class="share-height t-c"> | ||
106 | + <image class="scanning_black-img"src="../../../images/scanning_black.png"></image> | ||
107 | + <view class="fs24"> | ||
108 | + 扫一扫 | ||
109 | + </view> | ||
110 | + </view> | ||
111 | + <view class="xc-search-inner "> | ||
112 | + <view class="search-img left"> | ||
113 | + <image class="wh100" src="{{iurl}}/miniapp/images/search.png"></image> | ||
114 | + </view> | ||
115 | + <input bindfocus="goseach" class="search-cont" placeholder="搜索你想要的生活" type="text"></input> | ||
116 | + </view> | ||
117 | +</view> | ||
118 | + | ||
119 | +<!-- 分类项目内容 --> | ||
120 | +<view class="flex project_height"> | ||
121 | +<!-- 分类项目的类型 --> | ||
122 | +<view class="project_type"> | ||
123 | + <view class="project_type-frame"> | ||
124 | + <view bindtap="click_classify" class="share_type fs32 flex-space-between xc-letter-spacing {{select_classify_on==223?'select_classify':''}}"data-index="223" wx:if="{{is_country}}"> | ||
125 | + <text>国</text><text>家</text> | ||
126 | + </view> | ||
127 | + <view bindtap="click_classify" class="{{select_classify_on==220?'select_classify':''}} share_type fs32 flex-space-between xc-letter-spacing" wx:if="{{is_brand}}"data-index="220"> | ||
128 | + <text>品</text><text>牌</text> | ||
129 | + </view> | ||
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}}"> | ||
132 | + {{ittm.names}} | ||
133 | + </view> | ||
134 | + </block> | ||
135 | + | ||
136 | + </view> | ||
137 | + | ||
138 | +</view> | ||
139 | +<!-- 分类项目的内容 --> | ||
140 | +<view class=""></view> | ||
141 | + | ||
142 | +</view> | ||
143 | + | ||
144 | +</block> | ||
104 | \ No newline at end of file | 145 | \ No newline at end of file |
pages/goods/categoryList/categoryList.wxss
@@ -46,12 +46,12 @@ swiper{ | @@ -46,12 +46,12 @@ swiper{ | ||
46 | display: flex; | 46 | display: flex; |
47 | align-items: center; | 47 | align-items: center; |
48 | margin: 0rpx 30rpx; | 48 | margin: 0rpx 30rpx; |
49 | - width: 600rpx; | 49 | + width: 675rpx; |
50 | height: 58rpx; | 50 | height: 58rpx; |
51 | border-radius: 29rpx; | 51 | border-radius: 29rpx; |
52 | background-color: #fff; | 52 | background-color: #fff; |
53 | position: relative; | 53 | position: relative; |
54 | - | 54 | + top: 15rpx; |
55 | } | 55 | } |
56 | 56 | ||
57 | .search-img { | 57 | .search-img { |
@@ -153,12 +153,87 @@ swiper{ | @@ -153,12 +153,87 @@ swiper{ | ||
153 | } | 153 | } |
154 | .fenlei-list{z-index: -1;} | 154 | .fenlei-list{z-index: -1;} |
155 | 155 | ||
156 | + | ||
157 | + | ||
158 | + | ||
159 | + | ||
160 | +/* 商品分类新的版本 */ | ||
156 | /* 分享样式*/ | 161 | /* 分享样式*/ |
162 | +.xc-search-box { | ||
163 | + width: 100%; | ||
164 | + height: 120rpx; | ||
165 | + z-index: 10; | ||
166 | + background: #fff; | ||
167 | + border-top: 4rpx solid #eee; | ||
168 | + border-bottom: 1rpx solid #eee; | ||
169 | + | ||
170 | +} | ||
171 | + | ||
157 | .share-height{ | 172 | .share-height{ |
158 | - line-height: 30rpx; | 173 | + line-height: 20rpx; |
174 | +margin-right: 15rpx; | ||
159 | 175 | ||
160 | } | 176 | } |
161 | -.share-black-img{ | 177 | +.scanning_black-img{ |
162 | width:50rpx; | 178 | width:50rpx; |
163 | - height: 40rpx; | ||
164 | -} | ||
165 | \ No newline at end of file | 179 | \ No newline at end of file |
180 | + height: 45rpx; | ||
181 | +} | ||
182 | +.search-img.left{ | ||
183 | + margin-left: 35rpx; | ||
184 | +} | ||
185 | + | ||
186 | +.xc-search-inner { | ||
187 | + display: flex; | ||
188 | + align-items: center; | ||
189 | + | ||
190 | + width: 600rpx; | ||
191 | + height: 58rpx; | ||
192 | + border-radius: 29rpx; | ||
193 | + background-color: #f2f2f2; | ||
194 | +} | ||
195 | +.project_height{ | ||
196 | + height: 90%; | ||
197 | + | ||
198 | +} | ||
199 | +.project_type{ | ||
200 | + width: 33%; | ||
201 | + height: 100%; | ||
202 | + border-right: 1rpx solid #eee; | ||
203 | +} | ||
204 | +.share_type{ | ||
205 | + margin: auto; | ||
206 | + width: 60%; | ||
207 | + margin-top: 35rpx; | ||
208 | + | ||
209 | +} | ||
210 | +.xc-letter-spacing{ | ||
211 | +padding-left: 29rpx; | ||
212 | +padding-right: 29rpx; | ||
213 | +width: 52%; | ||
214 | +margin: auto; | ||
215 | +margin-top: 35rpx; | ||
216 | + | ||
217 | + | ||
218 | +} | ||
219 | +.world_sn{ | ||
220 | +white-space: nowrap; | ||
221 | +overflow: hidden; | ||
222 | +width: 50%; | ||
223 | +letter-spacing: 60rpx; | ||
224 | +margin: auto; | ||
225 | +margin-top: 35rpx; | ||
226 | +} | ||
227 | +.select_classify{ | ||
228 | + background: #ffe3e2; | ||
229 | +border-radius: 30rpx; | ||
230 | +color: #fff; | ||
231 | +height: 48rpx; | ||
232 | +line-height: 45rpx; | ||
233 | + | ||
234 | +} | ||
235 | +.select_classify.width80{ | ||
236 | + width: 74.5%; | ||
237 | +} | ||
238 | + .text-indent{ | ||
239 | + text-indent: 31rpx; | ||
240 | + } | ||
166 | \ No newline at end of file | 241 | \ No newline at end of file |