Authored by 李奇

view-title公共组件添加

  1 +Component({
  2 + properties: {
  3 + title: {
  4 + type: String,
  5 + value: '默认标题'
  6 + },
  7 + height: {
  8 + type: String,
  9 + value: 100,
  10 + observer: '_setHeight'
  11 + }
  12 + },
  13 + data: {
  14 + style: ''
  15 + },
  16 + methods: {
  17 + _setHeight: function(val) {
  18 + this.setData({
  19 + style: `height: ${val}rpx;line-height: ${val}rpx;`
  20 + });
  21 + }
  22 + }
  23 +});
  1 +{
  2 + "component": true
  3 +}
  1 +<view class="view-title" style="{{style}}">
  2 + <span class="title-text">{{title}}</span>
  3 +</view>
  4 +
  1 +
  2 +.view-title {
  3 + font-size: 0;
  4 + height: 88rpx;
  5 + line-height: 88rpx;
  6 + text-align: center;
  7 +}
  8 +
  9 +.view-title .title-text {
  10 + position: relative;
  11 + font-family: PingFang-SC-Semibold;
  12 + font-size: 28rpx;
  13 + color: #222;
  14 + letter-spacing: -0.34px;
  15 +}
  16 +
  17 +.view-title .title-text:before {
  18 + content: '';
  19 + position: absolute;
  20 + top: 50%;
  21 + left: -40rpx;
  22 + display: inline-block;
  23 + margin-top: -2rpx;
  24 + height: 4rpx;
  25 + width: 20rpx;
  26 + background-color: #222;
  27 +}
  28 +
  29 +.view-title .title-text:after {
  30 + content: '';
  31 + position: absolute;
  32 + top: 50%;
  33 + right: -40rpx;
  34 + margin-top: -2rpx;
  35 + display: inline-block;
  36 + height: 4rpx;
  37 + width: 20rpx;
  38 + background-color: #222;
  39 +}
  1 +Component({
  2 + properties: {
  3 + floorData: {
  4 + type: Object,
  5 + value: {}
  6 + }
  7 + }
  8 +});
  1 +<view class="product-list-filter">
  2 + <ul class="filter-items">
  3 + <li class="item">默认</li>
  4 + <li class="item">新品</li>
  5 + <li class="item">人气</li>
  6 + <li class="item">价格</li>
  7 + <li class="item">筛选</li>
  8 + </ul>
  9 +</view>
  1 +.resource-single-image {
  2 + font-size: 0;
  3 +}
  4 +
  5 +.resource-single-image .single-image {
  6 + width: 100%;
  7 +}
@@ -2,8 +2,10 @@ @@ -2,8 +2,10 @@
2 "navigationBarTitleText": "红人小店", 2 "navigationBarTitleText": "红人小店",
3 "enablePullDownRefresh": true, 3 "enablePullDownRefresh": true,
4 "usingComponents": { 4 "usingComponents": {
5 - "resources": "/components/resources/resources",  
6 - "copyright": "/components/copyright/copyright",  
7 - "quickNavigation": "/pages/quickNavigation/quickNavigation" 5 + "resources": "/components/resources/resources",
  6 + "copyright": "/components/copyright/copyright",
  7 + "view-title": "/components/layout/view-title/view-title",
  8 + "quickNavigation": "/pages/quickNavigation/quickNavigation",
  9 + "product-list-filter": "/components/product-list-filter/product-list-filter"
8 } 10 }
9 } 11 }
1 <view class="container"> 1 <view class="container">
2 - <resources content-code="{{resource.home.top}}"></resources>  
3 - <view class='newtop'> 2 + <view class='top-search'>
4 <view class="search-section" bindtap="toSearch"> 3 <view class="search-section" bindtap="toSearch">
5 <view class="tip"> 4 <view class="tip">
6 <span class="tip-text">潮流单品搜一下<image class="image-icon" src="./images/search@2x.png"></image> 5 <span class="tip-text">潮流单品搜一下<image class="image-icon" src="./images/search@2x.png"></image>
@@ -8,9 +7,12 @@ @@ -8,9 +7,12 @@
8 </view> 7 </view>
9 </view> 8 </view>
10 </view> 9 </view>
11 - <view> 10 + <resources content-code="{{resource.home.top}}"></resources>
  11 + <view class="recommend-product">
  12 + <view-title title="推荐商品" height="88"></view-title>
  13 + <product-list-filter></product-list-filter>
  14 + <div class="prd-list"></div>
12 </view> 15 </view>
13 - <view class='container_mask' bindtap='hiddenChannel' wx:if='{{channelSelect}}'></view>  
14 <view> 16 <view>
15 <copyright></copyright> 17 <copyright></copyright>
16 </view> 18 </view>
@@ -5,323 +5,13 @@ @@ -5,323 +5,13 @@
5 background-color: white; 5 background-color: white;
6 display: flex; 6 display: flex;
7 flex-direction: column; 7 flex-direction: column;
  8 + padding-top: 110rpx;
8 } 9 }
9 .scrollview{ 10 .scrollview{
10 background-color:white; 11 background-color:white;
11 } 12 }
12 13
13 -.top {  
14 - display: flex;  
15 - flex-direction: column;  
16 - justify-content: center;  
17 - align-items: center;  
18 - background-color: #3c3d3e;  
19 - padding-top: 30rpx;  
20 -}  
21 -  
22 -.topIcon {  
23 - width: 240rpx;  
24 - height: 135rpx;  
25 -}  
26 -  
27 -.serach {  
28 - margin-top: 30rpx;  
29 - margin-left: 35rpx;  
30 - margin-right: 35rpx;  
31 - margin-bottom: 30rpx;  
32 - background-color: white;  
33 - border-radius: 35rpx;  
34 - height: 70rpx;  
35 - display: flex;  
36 - justify-content: center;  
37 - align-items: center;  
38 - width: 90%;  
39 -}  
40 -  
41 -.serachIcon {  
42 - width: 30rpx;  
43 - height: 30rpx;  
44 - margin-left: 20rpx;  
45 -}  
46 -  
47 -.serach_view_show {  
48 - display: block;  
49 - color: #b0b0b0;  
50 - font-size: 30rpx;  
51 - font-family: PingFang SC;  
52 - padding-left: 10rpx;  
53 - font-weight: 500;  
54 - line-height: 2.57;  
55 - letter-spacing: 1.1px;  
56 - text-align: left;  
57 -}  
58 -  
59 -.navigator {  
60 - background-color:white;  
61 - width:100%;  
62 - height:88rpx;  
63 - display:flex;  
64 - flex-direction:row;  
65 - justify-content: center;  
66 -}  
67 -  
68 -.default {  
69 - line-height:88rpx;  
70 - text-align:center;  
71 - flex:1;  
72 - color:#b0b0b0;  
73 - font-size:30rpx;  
74 - width: 25%;  
75 -}  
76 -  
77 -.navText {  
78 - padding-left: 10rpx;  
79 - padding-right: 10rpx;  
80 - padding-bottom: 18rpx;  
81 - color:#b0b0b0;  
82 - font-family: PingFang SC;  
83 -}  
84 -  
85 -.navTextSelected {  
86 - font-size:36rpx;  
87 - font-weight:bold;  
88 - color:#444444;  
89 - border-bottom: 4rpx solid;  
90 -}  
91 -  
92 -.sectionContainer {  
93 - position: relative;  
94 - display: flex;  
95 - align-items: center;  
96 - align-content: center;  
97 - justify-content: center;  
98 -}  
99 -  
100 -.sectionLine {  
101 - background-color: #e0e0e0;  
102 - height: 3rpx;  
103 - width: 120rpx;  
104 - margin-left: 20rpx;  
105 - margin-right: 20rpx;  
106 -}  
107 -  
108 -.sectionTitle {  
109 - line-height: 80rpx;  
110 - color: #444444;  
111 - text-align: center;  
112 - vertical-align: center;  
113 - font-family: PingFang SC;  
114 - font-size: 32rpx;  
115 - font-weight: bold;  
116 -}  
117 -  
118 -.moreButtonContainer {  
119 - position: absolute;  
120 - right: 0rpx;  
121 - width: 100rpx;  
122 - height: 88rpx;  
123 - display: flex;  
124 - justify-content: center;  
125 - align-items: center;  
126 -}  
127 -  
128 -.moreButton {  
129 - width: 44rpx;  
130 - height: 8rpx;  
131 -}  
132 -  
133 -.brandContainer {  
134 - background-color: white;  
135 - width: 100%;  
136 - height: 250rpx;  
137 - white-space: nowrap;  
138 - padding-left: 8rpx;  
139 -}  
140 -  
141 -.brandItem {  
142 - display: inline-block;  
143 - margin: 16rpx 8rpx 16rpx 8rpx;  
144 -}  
145 -  
146 -::-webkit-scrollbar {  
147 - width: 0;  
148 - height: 0;  
149 - color: transparent;  
150 -}  
151 -  
152 -.brand {  
153 - white-space: wrap;  
154 - height: 220rpx;  
155 - width: 220rpx;  
156 -}  
157 -  
158 -.brandImage {  
159 - width: 220rpx;  
160 - height: 220rpx;  
161 - border-radius: 10rpx;  
162 -}  
163 -  
164 -.catgoryContainer {  
165 - display: flex;  
166 - flex-direction: row;  
167 - flex-wrap: wrap;  
168 - background-color: white;  
169 - border-top: 1rpx solid #dddddd;  
170 -}  
171 -  
172 -.category {  
173 - display: flex;  
174 - flex-direction: column;  
175 - align-items: center;  
176 - border-bottom: 1rpx solid #dddddd;  
177 -}  
178 -  
179 -.categoryTitle {  
180 - margin-top: 15rpx;  
181 - margin-bottom: 15rpx;  
182 - line-height: 22rpx;  
183 - font-family: PingFang SC;  
184 - font-size: 22rpx;  
185 - color: rgb(68, 68, 68);  
186 -}  
187 -  
188 -.categoryImage {  
189 - width: 100%;  
190 -}  
191 -  
192 -.newArrivalContainer {  
193 - display: flex;  
194 - flex-direction: row;  
195 - flex-wrap: wrap;  
196 - background-color: white;  
197 -}  
198 -  
199 -.likeContainer {  
200 - display: flex;  
201 - flex-direction: row;  
202 - flex-wrap: wrap;  
203 - background-color: white;  
204 -}  
205 -  
206 -.like {  
207 - display: flex;  
208 - flex-direction: column;  
209 - align-items: center;  
210 - margin: 20rpx;  
211 -}  
212 -  
213 -.activities {  
214 - background-color: white;  
215 -}  
216 -  
217 -.activity-container {  
218 -  
219 -}  
220 -  
221 -.activity-container-header {  
222 - width: 100%;  
223 - height: 324rpx;  
224 -}  
225 -  
226 -.activity-banner {  
227 - width: 100%;  
228 - height: 100%;  
229 -}  
230 -  
231 -.activity-container-footer {  
232 - white-space: nowrap;  
233 - background-color: white;  
234 -}  
235 -  
236 -.activity-item {  
237 - width: 186rpx;  
238 - height: 296rpx;  
239 - display: inline-block;  
240 - margin-top: 30rpx;  
241 - margin-left: 32rpx;  
242 -}  
243 -  
244 -.activity-item:last-child {  
245 - margin-right: 32rpx;  
246 -}  
247 -  
248 -.activity-item-img {  
249 - width: 100%;  
250 - height: 77%;  
251 -}  
252 -  
253 -.activity-item-price {  
254 - width: 100%;  
255 - height: 23%;  
256 - text-align: center;  
257 - line-height: 50rpx;  
258 - color:#444444;  
259 - font-size: 24rpx;  
260 - font-family: PingFang SC;  
261 - overflow: hidden;  
262 - text-overflow:ellipsis;  
263 - white-space: nowrap;  
264 -}  
265 -  
266 -.activities-footer {  
267 - height: 100rpx;  
268 - width: 100%;  
269 - line-height: 100rpx;  
270 - text-align: center;  
271 - font-family: PingFang SC;  
272 - font-size: 30rpx;  
273 - border-top: solid 1rpx gainsboro;  
274 -}  
275 -.new-focus-img{  
276 - width: 100%;  
277 - height: 100%;  
278 -}  
279 -.swiper-status{  
280 - width: 750rpx;  
281 - height:500rpx;  
282 -  
283 -}  
284 -.titleContainer{  
285 - background-color: white;  
286 - display: flex;  
287 - flex-direction: row;  
288 - height: 80rpx;  
289 - align-items:center;  
290 -}  
291 -.titleLine{  
292 - width: 4rpx;  
293 - height: 30rpx;  
294 - background-color: #444444;  
295 - margin-left: 20rpx;  
296 -}  
297 -.titleDesc{  
298 - flex: 1;  
299 - text-align: left;  
300 - color: #444444;  
301 - font-family: PingFang SC;  
302 - font-size:30rpx;  
303 - margin-left: 16rpx;  
304 - font-weight: 600;  
305 -}  
306 -.titleMore{  
307 - width: 48rpx;  
308 - height: 38rpx;  
309 - display: flex;  
310 - margin-right: 30rpx;  
311 - align-items: center;  
312 - justify-content: center;  
313 -}  
314 -  
315 -.titleMoreIm{  
316 - width: 44rpx;  
317 - height: 8rpx;  
318 -}  
319 -  
320 -.view-splite {  
321 - height:20rpx;  
322 -}  
323 -  
324 -.newtop{ 14 +.top-search {
325 position: fixed; 15 position: fixed;
326 top: 0; 16 top: 0;
327 left: 0; 17 left: 0;
@@ -365,75 +55,3 @@ @@ -365,75 +55,3 @@
365 left: -40rpx; 55 left: -40rpx;
366 } 56 }
367 57
368 -.newsearch {  
369 - height: 70rpx;  
370 - width: 615rpx;  
371 - margin-left: 30rpx;  
372 - background-color: #ffffff;  
373 - display: flex;  
374 - flex-direction: row;  
375 - align-items: center;  
376 - border-radius: 10rpx;  
377 - top: 0rpx;  
378 - left: 0rpx  
379 -}  
380 -  
381 -.channelContainer {  
382 - width: 100%;  
383 - top: 96rpx;  
384 - position: fixed;  
385 - display: flex;  
386 - flex-direction: column;  
387 - height: wrap;  
388 - z-index: 1000;  
389 -}  
390 -  
391 -.channelItem {  
392 - height: 100rpx;  
393 - width: 750rpx;  
394 - display: flex;  
395 - justify-content: center;  
396 - flex-direction: row;  
397 - align-items: center;  
398 -}  
399 -  
400 -.channelBg {  
401 - position: fixed;  
402 - height: 201rpx;  
403 - width: 750rpx;  
404 - top: 96rpx;  
405 - z-index: 999;  
406 -}  
407 -  
408 -.indicator {  
409 - width: 10rpx;  
410 - height: 10rpx;  
411 - background-color: white;  
412 -}  
413 -  
414 -.channelText {  
415 - font-family: PingFang-SC;  
416 - font-size: 40rpx;  
417 - font-weight: 600;  
418 - text-align: left;  
419 - color: #ffffff;  
420 - margin-left: 20rpx;  
421 -}  
422 -  
423 -.channelIcon {  
424 - width: 48rpx;  
425 - height: 38rpx;  
426 - margin-left: 30rpx;  
427 - margin-right: 30rpx  
428 -}  
429 -  
430 -.container_mask {  
431 - position: fixed;  
432 - top: 96;  
433 - z-index: 555;  
434 - width: 100%;  
435 - height: 100%;  
436 - background: #333;  
437 - filter: alpha(opacity=0);  
438 - opacity: 0.0;  
439 -}