首页推荐商品列表添加 — review by 黄敬囿
Showing
9 changed files
with
120 additions
and
167 deletions
1 | <swiper class="banner" indicator-dots="true" autoplay="true" | 1 | <swiper class="banner" indicator-dots="true" autoplay="true" |
2 | interval="3500" circular="true" indicator-color='rgba(255,255,255,0.2)' | 2 | interval="3500" circular="true" indicator-color='rgba(255,255,255,0.2)' |
3 | indicator-active-color="rgba(255,255,255,1)"> | 3 | indicator-active-color="rgba(255,255,255,1)"> |
4 | - <block wx:for="{{ data.data }}" wx:key="{{index}}"> | 4 | + <block tt:for="{{ data.data }}" tt:key="{{index}}"> |
5 | <swiper-item> | 5 | <swiper-item> |
6 | <image src="{{item.src}}" class="new-focus-img" | 6 | <image src="{{item.src}}" class="new-focus-img" |
7 | mode="aspectFill "data-url="{{item.url}}" | 7 | mode="aspectFill "data-url="{{item.url}}" |
1 | <!-- 首页潮流品牌 --> | 1 | <!-- 首页潮流品牌 --> |
2 | <view class='horImgContainer'> | 2 | <view class='horImgContainer'> |
3 | <scroll-view class='horImgScrollView' scroll-x="true"> | 3 | <scroll-view class='horImgScrollView' scroll-x="true"> |
4 | - <block wx:for="{{ data.data }}" wx:key="{{index}}"> | 4 | + <block tt:for="{{ data.data }}" tt:key="{{index}}"> |
5 | <view class="hor-Item" style="margin-left:{{index==0?'16rpx':'0'}}" | 5 | <view class="hor-Item" style="margin-left:{{index==0?'16rpx':'0'}}" |
6 | bindtap="jumpByRule" data-jump_rule="{{item.url}}" | 6 | bindtap="jumpByRule" data-jump_rule="{{item.url}}" |
7 | data-brand-id="{{item.id}}" data-brand-name="{{item.name}}" | 7 | data-brand-id="{{item.id}}" data-brand-name="{{item.name}}" |
1 | <!-- 首页潮流品牌 --> | 1 | <!-- 首页潮流品牌 --> |
2 | <scroll-view class="hor-product-container" scroll-x="true"> | 2 | <scroll-view class="hor-product-container" scroll-x="true"> |
3 | - <block wx:for="{{ data.list }}" wx:key="{{index}}" | ||
4 | - wx:for-item="item"> | 3 | + <block tt:for="{{ data.list }}" tt:key="{{index}}" |
4 | + tt:for-item="item"> | ||
5 | <view class="group-product-item" | 5 | <view class="group-product-item" |
6 | bindtap="productItemTapped" | 6 | bindtap="productItemTapped" |
7 | data-skn="{{item.productSkn}}" | 7 | data-skn="{{item.productSkn}}" |
1 | <!-- 热门品类 --> | 1 | <!-- 热门品类 --> |
2 | <view class="catgoryContainer"> | 2 | <view class="catgoryContainer"> |
3 | - <block wx:for="{{data.data}}" wx:key="{{index}}"> | 3 | + <block tt:for="{{data.data}}" tt:key="{{index}}"> |
4 | <view class="category" bindtap="jumpByRule" | 4 | <view class="category" bindtap="jumpByRule" |
5 | style="width: {{itemWidth}}px;border-right:{{index % 4 == 3 ? '0px' : '1px #dddddd solid;'}}" | 5 | style="width: {{itemWidth}}px;border-right:{{index % 4 == 3 ? '0px' : '1px #dddddd solid;'}}" |
6 | data-jump_rule="{{item.url}}" data-url="{{item.url}}" | 6 | data-jump_rule="{{item.url}}" data-url="{{item.url}}" |
1 | 1 | ||
2 | <!-- 首页最新活动 --> | 2 | <!-- 首页最新活动 --> |
3 | <view class="activityContainer"> | 3 | <view class="activityContainer"> |
4 | - <block wx:for="{{activityList}}" wx:key="{{index}}"> | 4 | + <block tt:for="{{activityList}}" tt:key="{{index}}"> |
5 | <view class="activity" bindtap="jumpByRule" | 5 | <view class="activity" bindtap="jumpByRule" |
6 | data-jump_rule="{{item.url}}" data-url="{{item.url}}" | 6 | data-jump_rule="{{item.url}}" data-url="{{item.url}}" |
7 | data-index="{{index}}"data-f_id="{{f_id}}" | 7 | data-index="{{index}}"data-f_id="{{f_id}}" |
1 | 1 | ||
2 | import { getChannelCode, getGenderCode, getRecPosCode, getRecommandContentCode, getResourceCode,getHomeContentCode} from '../../utils/home'; | 2 | import { getChannelCode, getGenderCode, getRecPosCode, getRecommandContentCode, getResourceCode,getHomeContentCode} from '../../utils/home'; |
3 | import homeService from './indexService.js' | 3 | import homeService from './indexService.js' |
4 | +import { parseProductListData } from '../../utils/productListUtil'; | ||
4 | 5 | ||
5 | //获取应用实例 | 6 | //获取应用实例 |
6 | let app = getApp() | 7 | let app = getApp() |
@@ -36,69 +37,6 @@ Page({ | @@ -36,69 +37,6 @@ Page({ | ||
36 | }, | 37 | }, |
37 | } | 38 | } |
38 | }, | 39 | }, |
39 | - | ||
40 | - 'bannerList': [ | ||
41 | - {'src': 'http://img10.static.yhbimg.com/yhb-img01/2018/11/21/13/01028381b6f5db69fdbebba95f3aade7bc.jpg'}, | ||
42 | - {'src': 'http://img10.static.yhbimg.com/yhb-img01/2018/11/16/09/0159de652b1e164b2166e7665a0c329e4d.jpg'}, | ||
43 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/14/17/01e5af09eaec1c1d1e1c920586e8127489.jpg'} | ||
44 | - ], | ||
45 | - 'categoryList': [ | ||
46 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
47 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
48 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
49 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
50 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
51 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
52 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
53 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
54 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
55 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
56 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'}, | ||
57 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/11/19/10/016b55c411c314f020b943e3cd663299a7.jpg'} | ||
58 | - ], | ||
59 | - 'brandList':[ | ||
60 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/07/10/13/01f3619775fe5f22467ef884b614b1ec3e.jpg'}, | ||
61 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/07/10/13/01f3619775fe5f22467ef884b614b1ec3e.jpg'}, | ||
62 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/07/10/13/01f3619775fe5f22467ef884b614b1ec3e.jpg'}, | ||
63 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/07/10/13/01f3619775fe5f22467ef884b614b1ec3e.jpg'}, | ||
64 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/07/10/13/01f3619775fe5f22467ef884b614b1ec3e.jpg'}, | ||
65 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/07/10/13/01f3619775fe5f22467ef884b614b1ec3e.jpg'}, | ||
66 | - {'src': 'http://img11.static.yhbimg.com/yhb-img01/2018/07/10/13/01f3619775fe5f22467ef884b614b1ec3e.jpg'} | ||
67 | - ], | ||
68 | - 'activityList': [ | ||
69 | - {'src': 'http://img13.static.yhbimg.com/article/2018/11/21/18/02a7e5be8e9c6e85492fa61d1cb57f913c.jpg'}, | ||
70 | - {'src': 'http://img13.static.yhbimg.com/article/2018/11/21/18/02a7e5be8e9c6e85492fa61d1cb57f913c.jpg'}, | ||
71 | - {'src': 'http://img13.static.yhbimg.com/article/2018/11/21/18/02a7e5be8e9c6e85492fa61d1cb57f913c.jpg'}, | ||
72 | - {'src': 'http://img13.static.yhbimg.com/article/2018/11/21/18/02a7e5be8e9c6e85492fa61d1cb57f913c.jpg'} | ||
73 | - ], | ||
74 | - 'productList': [ | ||
75 | - { | ||
76 | - 'src': 'http://img13.static.yhbimg.com/goodsimg/2017/09/27/13/02dac922f0856fcb6d9912865243cff2f6.jpg', | ||
77 | - 'title': 'THETHING', | ||
78 | - 'price': '¥1200.00' | ||
79 | - },{ | ||
80 | - 'src': 'http://img13.static.yhbimg.com/goodsimg/2017/09/27/13/02dac922f0856fcb6d9912865243cff2f6.jpg', | ||
81 | - 'title': 'THETHING羽绒服羽绒服羽绒服', | ||
82 | - 'price': '¥1200.00' | ||
83 | - },{ | ||
84 | - 'src': 'http://img13.static.yhbimg.com/goodsimg/2017/09/27/13/02dac922f0856fcb6d9912865243cff2f6.jpg', | ||
85 | - 'title': 'Red Charcoal', | ||
86 | - 'price': '¥1109.00' | ||
87 | - },{ | ||
88 | - 'src': 'http://img10.static.yhbimg.com/goodsimg/2018/10/25/11/01ac8f33d0272b233c7e303424d342ff65.jpg', | ||
89 | - 'title': 'Red Charcoal', | ||
90 | - 'price': '¥1109.00' | ||
91 | - },{ | ||
92 | - 'src': 'http://img10.static.yhbimg.com/goodsimg/2018/10/25/11/01ac8f33d0272b233c7e303424d342ff65.jpg', | ||
93 | - 'title': 'Red Charcoal', | ||
94 | - 'price': '¥1109.00' | ||
95 | - },{ | ||
96 | - 'src': 'http://img13.static.yhbimg.com/goodsimg/2017/09/27/13/02dac922f0856fcb6d9912865243cff2f6.jpg', | ||
97 | - 'title': 'THETHING', | ||
98 | - 'price': '¥1200.00' | ||
99 | - } | ||
100 | - ], | ||
101 | - 'singleImage': 'http://img10.static.yhbimg.com/yhb-img01/2018/06/20/13/01b8a424ad754cf867b0bbe8d66e833300.jpg' | ||
102 | }, | 40 | }, |
103 | onLoad: function () { | 41 | onLoad: function () { |
104 | this.fetchNewHomeData(); | 42 | this.fetchNewHomeData(); |
@@ -193,81 +131,88 @@ Page({ | @@ -193,81 +131,88 @@ Page({ | ||
193 | homelist: currentData.data, | 131 | homelist: currentData.data, |
194 | }) | 132 | }) |
195 | } | 133 | } |
196 | - console.log('===================================='); | 134 | + console.log('==============楼层数据==============='); |
197 | console.log(currentData.data); | 135 | console.log(currentData.data); |
198 | console.log('===================================='); | 136 | console.log('===================================='); |
199 | 137 | ||
200 | - // this.fetchRecommend(force); | 138 | + this.fetchRecommend(force); |
201 | }, | 139 | }, |
202 | 140 | ||
203 | //请求(男生、女生)猜你喜欢数据 | 141 | //请求(男生、女生)猜你喜欢数据 |
204 | - // fetchRecommend: function (force) { | ||
205 | - // let currentChannel = this.data.selectedChannel; | ||
206 | - // let currentChannelData = this.data.newChannels[currentChannel]; | ||
207 | - // let recommend = currentChannelData.recommend; | ||
208 | - // if (recommend.data && recommend.data.length > 0 && !force) { | ||
209 | - // return; | ||
210 | - // } | 142 | + fetchRecommend: function (force) { |
143 | + let currentChannel = this.data.selectedChannel; | ||
144 | + let currentChannelData = this.data.newChannels[currentChannel]; | ||
145 | + let recommend = currentChannelData.recommend; | ||
146 | + if (recommend.data && recommend.data.length > 0 && !force) { | ||
147 | + return; | ||
148 | + } | ||
211 | 149 | ||
212 | - // let param = {}; | ||
213 | - // let gender = getGenderCode(currentChannel); | ||
214 | - // let yh_channel = getChannelCode(currentChannel); | ||
215 | - // let content_code = getRecommandContentCode(currentChannel); | ||
216 | - // let rec_pos = getRecPosCode(currentChannel); | ||
217 | - // param = { | ||
218 | - // content_code, | ||
219 | - // gender, | ||
220 | - // yh_channel, | ||
221 | - // rec_pos, | ||
222 | - // }; | 150 | + let param = {}; |
151 | + let gender = getGenderCode(currentChannel); | ||
152 | + let yh_channel = getChannelCode(currentChannel); | ||
153 | + let content_code = getRecommandContentCode(currentChannel); | ||
154 | + let rec_pos = getRecPosCode(currentChannel); | ||
155 | + param = { | ||
156 | + content_code, | ||
157 | + gender, | ||
158 | + yh_channel, | ||
159 | + rec_pos, | ||
160 | + }; | ||
223 | 161 | ||
224 | - // let newChannelData = objectAssign(currentChannelData, { recommend: objectAssign(recommend, { isLoading: true, }) }); | ||
225 | - // let newChannels = this.data.newChannels; | ||
226 | - // newChannels[currentChannel] = newChannelData; | 162 | + let newChannelData = Object.assign(currentChannelData, { recommend: Object.assign(recommend, { isLoading: true, }) }); |
163 | + let newChannels = this.data.newChannels; | ||
164 | + newChannels[currentChannel] = newChannelData; | ||
227 | 165 | ||
228 | - // this.setData({ | ||
229 | - // newChannels: newChannels, | ||
230 | - // }); | 166 | + this.setData({ |
167 | + newChannels: newChannels, | ||
168 | + }); | ||
231 | 169 | ||
232 | - // homeService.getProductlist(param) | ||
233 | - // .then(json => { | ||
234 | - // if (!json || !json.code || json.code != 200) { | ||
235 | - // let currentChannel = this.data.selectedChannel; | ||
236 | - // let currentChannelData = this.data.newChannels[currentChannel]; | ||
237 | - // let newChannelData = objectAssign(currentChannelData, { recommend: objectAssign(recommend, { isLoading: false, error: { code: json.code, message: json.message } }) }); | ||
238 | - // let newChannels = this.data.newChannels; | ||
239 | - // newChannels[currentChannel] = newChannelData; | 170 | + homeService.getProductlist(param) |
171 | + .then(json => { | ||
172 | + console.log('==============商品数据==============='); | ||
173 | + console.log(json); | ||
174 | + console.log('===================================='); | ||
175 | + if (!json || !json.code || json.code != 200) { | ||
176 | + let currentChannel = this.data.selectedChannel; | ||
177 | + let currentChannelData = this.data.newChannels[currentChannel]; | ||
178 | + let newChannelData = Object.assign(currentChannelData, { recommend: Object.assign(recommend, { isLoading: false, error: { code: json.code, message: json.message } }) }); | ||
179 | + let newChannels = this.data.newChannels; | ||
180 | + newChannels[currentChannel] = newChannelData; | ||
240 | 181 | ||
241 | - // this.setData({ | ||
242 | - // newChannels: newChannels, | ||
243 | - // }); | ||
244 | - // return; | ||
245 | - // } | 182 | + this.setData({ |
183 | + newChannels: newChannels, | ||
184 | + }); | ||
185 | + return; | ||
186 | + } | ||
246 | 187 | ||
247 | - // let data = json.data.product_list; | ||
248 | - // data = parseBrandListData(data); | ||
249 | - // let currentChannel = this.data.selectedChannel; | ||
250 | - // let currentChannelData = this.data.newChannels[currentChannel]; | ||
251 | - // let newChannelData = objectAssign(currentChannelData, { recommend: objectAssign(recommend, { isLoading: false, data }) }); | ||
252 | - // let newChannels = this.data.newChannels; | ||
253 | - // newChannels[currentChannel] = newChannelData; | 188 | + let data = json.data.product_list; |
189 | + data = parseProductListData(data); | ||
190 | + let currentChannel = this.data.selectedChannel; | ||
191 | + let currentChannelData = this.data.newChannels[currentChannel]; | ||
192 | + let newChannelData = Object.assign(currentChannelData, { recommend: Object.assign(recommend, { isLoading: false, data }) }); | ||
193 | + let newChannels = this.data.newChannels; | ||
194 | + newChannels[currentChannel] = newChannelData; | ||
254 | 195 | ||
255 | - // this.setData({ | ||
256 | - // newChannels: newChannels, | ||
257 | - // }); | ||
258 | - // }) | ||
259 | - // .catch(error => { | ||
260 | - // let currentChannel = this.data.selectedChannel; | ||
261 | - // let currentChannelData = this.data.newChannels[currentChannel]; | ||
262 | - // let newChannelData = objectAssign(currentChannelData, { recommend: objectAssign(recommend, { isLoading: false, error }) }); | ||
263 | - // let newChannels = this.data.newChannels; | ||
264 | - // newChannels[currentChannel] = newChannelData; | 196 | + this.setData({ |
197 | + newChannels: newChannels, | ||
198 | + }); | ||
265 | 199 | ||
266 | - // this.setData({ | ||
267 | - // newChannels: newChannels, | ||
268 | - // }); | ||
269 | - // }); | ||
270 | - // }, | 200 | + console.log('===================================='); |
201 | + console.log(newChannels); | ||
202 | + console.log('===================================='); | ||
203 | + }) | ||
204 | + .catch(error => { | ||
205 | + let currentChannel = this.data.selectedChannel; | ||
206 | + let currentChannelData = this.data.newChannels[currentChannel]; | ||
207 | + let newChannelData = Object.assign(currentChannelData, { recommend: Object.assign(recommend, { isLoading: false, error }) }); | ||
208 | + let newChannels = this.data.newChannels; | ||
209 | + newChannels[currentChannel] = newChannelData; | ||
210 | + | ||
211 | + this.setData({ | ||
212 | + newChannels: newChannels, | ||
213 | + }); | ||
214 | + }); | ||
215 | + }, | ||
271 | 216 | ||
272 | jumpByRuleEvent(event) { | 217 | jumpByRuleEvent(event) { |
273 | console.log(event.detail); | 218 | console.log(event.detail); |
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | "home-brand": "../../components/home/home-brand/home-brand", | 5 | "home-brand": "../../components/home/home-brand/home-brand", |
6 | "home-new-activity": "../../components/home/home-new-activity/home-new-activity", | 6 | "home-new-activity": "../../components/home/home-new-activity/home-new-activity", |
7 | "home-single-image": "../../components/home/home-single-image/home-single-image", | 7 | "home-single-image": "../../components/home/home-single-image/home-single-image", |
8 | - "home-hor-product-list": "../../components/home/home-hor-product-list/home-hor-product-list" | 8 | + "home-hor-product-list": "../../components/home/home-hor-product-list/home-hor-product-list", |
9 | + "productCell": "../../components/productList/productCell" | ||
9 | } | 10 | } |
10 | } | 11 | } |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | style="border-bottom:{{no_line?'0.5rpx solid #ffffff':'0.5rpx solid #e0e0e0'}}"> | 3 | style="border-bottom:{{no_line?'0.5rpx solid #ffffff':'0.5rpx solid #e0e0e0'}}"> |
4 | <view class='titleLine'></view> | 4 | <view class='titleLine'></view> |
5 | <view class='titleDesc'>{{desc}}</view> | 5 | <view class='titleDesc'>{{desc}}</view> |
6 | - <view class='titleMore' wx:if='{{more_url?true:false}}' data-jump_rule="{{more_url}}" bindtap="jumpByRule"> | 6 | + <view class='titleMore' tt:if='{{more_url?true:false}}' data-jump_rule="{{more_url}}" bindtap="jumpByRule"> |
7 | <image class="titleMoreIm" src="../../images/more_ic@2x.png" ></image> | 7 | <image class="titleMoreIm" src="../../images/more_ic@2x.png" ></image> |
8 | </view> | 8 | </view> |
9 | </view> | 9 | </view> |
@@ -24,10 +24,10 @@ | @@ -24,10 +24,10 @@ | ||
24 | <image bindtap='selectChannel' class="channelIcon" src='../../images/ceb-ic@2x.png'></image> | 24 | <image bindtap='selectChannel' class="channelIcon" src='../../images/ceb-ic@2x.png'></image> |
25 | </view> | 25 | </view> |
26 | <image class='newTopImg' src='../../images/home-top-bg2@2x.png'></image> | 26 | <image class='newTopImg' src='../../images/home-top-bg2@2x.png'></image> |
27 | - <image wx:if='{{channelSelect}}' class='channelBg' src='../../images/channel-bg@2x.png'></image> | 27 | + <image tt:if='{{channelSelect}}' class='channelBg' src='../../images/channel-bg@2x.png'></image> |
28 | <form bindsubmit='formSubmitFromSwitchGender' report-submit='true'> | 28 | <form bindsubmit='formSubmitFromSwitchGender' report-submit='true'> |
29 | 29 | ||
30 | - <view class='channelContainer' wx:if='{{channelSelect}}'> | 30 | + <view class='channelContainer' tt:if='{{channelSelect}}'> |
31 | 31 | ||
32 | <view class='channelItem' data-type="boy" bindtap="channelSelected"> | 32 | <view class='channelItem' data-type="boy" bindtap="channelSelected"> |
33 | <view class='indicator' style="background-color:{{selectedChannel=='boy' ? 'white':'transparent'}}"></view> | 33 | <view class='indicator' style="background-color:{{selectedChannel=='boy' ? 'white':'transparent'}}"></view> |
@@ -52,66 +52,66 @@ | @@ -52,66 +52,66 @@ | ||
52 | 52 | ||
53 | <scroll-view scroll-y="true" class="mainContainer"> | 53 | <scroll-view scroll-y="true" class="mainContainer"> |
54 | 54 | ||
55 | - <block wx:for='{{homelist}}' wx:key='{{index}}'> | 55 | + <block tt:for='{{homelist}}' tt:key='{{index}}'> |
56 | 56 | ||
57 | - <block wx:if="{{item.template_name=='focus' || item.template_name=='newFocus'}}"> | 57 | + <block tt:if="{{item.template_name=='focus' || item.template_name=='newFocus'}}"> |
58 | <home-banner data="{{data:item.data,f_id:item.template_id,f_index:index,f_name:item.template_name}}" bindjumpByRule="jumpByRuleEvent"></home-banner> | 58 | <home-banner data="{{data:item.data,f_id:item.template_id,f_index:index,f_name:item.template_name}}" bindjumpByRule="jumpByRuleEvent"></home-banner> |
59 | </block> | 59 | </block> |
60 | 60 | ||
61 | - <!-- <block wx:if="{{item.template_name == 'image_list' && item.data.list.length == 4}}"> | 61 | + <!-- <block tt:if="{{item.template_name == 'image_list' && item.data.list.length == 4}}"> |
62 | <template is='fourImage' data="{{data:item.data,f_id:item.template_id,f_index:index,f_name:item.template_name}}"/> | 62 | <template is='fourImage' data="{{data:item.data,f_id:item.template_id,f_index:index,f_name:item.template_name}}"/> |
63 | </block> --> | 63 | </block> --> |
64 | 64 | ||
65 | - <!-- <block wx:if="{{item.template_name == 'twoPicture'}}"> | ||
66 | - <block wx:if="{{item.title}}"> | 65 | + <!-- <block tt:if="{{item.template_name == 'twoPicture'}}"> |
66 | + <block tt:if="{{item.title}}"> | ||
67 | <template is='tipTitle' data="{{desc:item.title,more_url:item.moreUrl,no_line:false}}"/> | 67 | <template is='tipTitle' data="{{desc:item.title,more_url:item.moreUrl,no_line:false}}"/> |
68 | </block> | 68 | </block> |
69 | <template is='twoImage' data="{{data:item.data,f_id:item.template_id,f_index:index,f_name:item.template_name,ratio:item.ratio,title:item.title}}"/> | 69 | <template is='twoImage' data="{{data:item.data,f_id:item.template_id,f_index:index,f_name:item.template_name,ratio:item.ratio,title:item.title}}"/> |
70 | </block> --> | 70 | </block> --> |
71 | 71 | ||
72 | - <block wx:elif="{{item.template_name=='newSingleImage'}}"> | ||
73 | - <block wx:if="{{item.title}}"> | 72 | + <block tt:elif="{{item.template_name=='newSingleImage'}}"> |
73 | + <block tt:if="{{item.title}}"> | ||
74 | <template is='tipTitle' data="{{desc:item.title}}"/> | 74 | <template is='tipTitle' data="{{desc:item.title}}"/> |
75 | </block> | 75 | </block> |
76 | <home-single-image item="{{data:item,f_id:item.template_id,f_index:index,f_name:item.template_name}}" bindjumpByRule="jumpByRuleEvent"></home-single-image> | 76 | <home-single-image item="{{data:item,f_id:item.template_id,f_index:index,f_name:item.template_name}}" bindjumpByRule="jumpByRuleEvent"></home-single-image> |
77 | </block> | 77 | </block> |
78 | 78 | ||
79 | - <!-- <block wx:elif="{{item.template_name=='sv_new_user_floor'}}"> | 79 | + <!-- <block tt:elif="{{item.template_name=='sv_new_user_floor'}}"> |
80 | <template is='newCustomerBanner' data="{{newCustomer: newCustomer, data:item.data.banner_image}}" /> | 80 | <template is='newCustomerBanner' data="{{newCustomer: newCustomer, data:item.data.banner_image}}" /> |
81 | </block> --> | 81 | </block> --> |
82 | 82 | ||
83 | - <block wx:elif="{{item.template_name=='new_recommend_content_five'}}"> | ||
84 | - <block wx:if="{{item.title}}"> | ||
85 | - <template is='tipTitle' data="{{desc:item.title,more_url:item.moreUrl,no_line:true}}"/> | ||
86 | - </block> | ||
87 | - <home-hot-category data="{{data:item.list,f_id:item.template_id,f_index:index,f_name:item.template_name}}" bindjumpByRule="jumpByRuleEvent"></home-hot-category> | 83 | + <block tt:elif="{{item.template_name=='new_recommend_content_five'}}"> |
84 | + <block tt:if="{{item.title}}"> | ||
85 | + <template is='tipTitle' data="{{desc:item.title,more_url:item.moreUrl,no_line:true}}"/> | ||
88 | </block> | 86 | </block> |
87 | + <home-hot-category data="{{data:item.list,f_id:item.template_id,f_index:index,f_name:item.template_name}}" bindjumpByRule="jumpByRuleEvent"></home-hot-category> | ||
88 | + </block> | ||
89 | 89 | ||
90 | 90 | ||
91 | - <block wx:elif="{{item.template_name=='3:4ImageListFloor'}}"> | ||
92 | - <block wx:if="{{item.title}}"> | 91 | + <block tt:elif="{{item.template_name=='3:4ImageListFloor'}}"> |
92 | + <block tt:if="{{item.title}}"> | ||
93 | <template is='tipTitle' data="{{desc:item.title}}"/> | 93 | <template is='tipTitle' data="{{desc:item.title}}"/> |
94 | </block> | 94 | </block> |
95 | <home-brand data="{{data:item.list,title:item.title,f_id:item.template_id,f_index:index,f_name:item.template_name}}" bindjumpByRule="jumpByRuleEvent"></home-brand> | 95 | <home-brand data="{{data:item.list,title:item.title,f_id:item.template_id,f_index:index,f_name:item.template_name}}" bindjumpByRule="jumpByRuleEvent"></home-brand> |
96 | - <view wx:if="{{!item.title}}" style='width:100%;height:16rpx;background-color:white'/><!--兼容空白 后期需优化调整--> | 96 | + <view tt:if="{{!item.title}}" style='width:100%;height:16rpx;background-color:white'/><!--兼容空白 后期需优化调整--> |
97 | </block> | 97 | </block> |
98 | 98 | ||
99 | - <block wx:elif="{{item.template_name=='newProductListFloor'}}"> | 99 | + <block tt:elif="{{item.template_name=='newProductListFloor'}}"> |
100 | <home-hor-product-list data="{{item.data}}" bindjumpByRule="jumpByRuleEvent"></home-hor-product-list> | 100 | <home-hor-product-list data="{{item.data}}" bindjumpByRule="jumpByRuleEvent"></home-hor-product-list> |
101 | </block> | 101 | </block> |
102 | 102 | ||
103 | <!--拼团购商品列表--> | 103 | <!--拼团购商品列表--> |
104 | - <!-- <block wx:elif="{{item.template_name=='collageBuyPrdList'}}"> | 104 | + <!-- <block tt:elif="{{item.template_name=='collageBuyPrdList'}}"> |
105 | 105 | ||
106 | </block> --> | 106 | </block> --> |
107 | 107 | ||
108 | - <block wx:elif="{{item.template_name=='popularListFloor'}}"> | 108 | + <block tt:elif="{{item.template_name=='popularListFloor'}}"> |
109 | <home-hor-product-list data="{{item.data}}" bindjumpByRule="jumpByRuleEvent"></home-hor-product-list> | 109 | <home-hor-product-list data="{{item.data}}" bindjumpByRule="jumpByRuleEvent"></home-hor-product-list> |
110 | </block> | 110 | </block> |
111 | 111 | ||
112 | - <!-- <block wx:elif="{{item.template_name=='popularListFloor'}}"> | 112 | + <!-- <block tt:elif="{{item.template_name=='popularListFloor'}}"> |
113 | <scroll-view class="activity-container-footer" scroll-x="true"> | 113 | <scroll-view class="activity-container-footer" scroll-x="true"> |
114 | - <block wx:for="{{item.data.list}}" wx:key="{{index}}" wx:for-item="item"> | 114 | + <block tt:for="{{item.data.list}}" tt:key="{{index}}" tt:for-item="item"> |
115 | <view class="activity-item" bindtap="activityItemTapped" data-skn="{{item.product_skn}}" | 115 | <view class="activity-item" bindtap="activityItemTapped" data-skn="{{item.product_skn}}" |
116 | data-f_id="{{item.template_id}}" data-f_index='{{item.index}}' data-f_inindex='{{index}}' data-f_name='newProductListFloor'> | 116 | data-f_id="{{item.template_id}}" data-f_index='{{item.index}}' data-f_inindex='{{index}}' data-f_name='newProductListFloor'> |
117 | <image src="{{item.default_images}}" class="activity-item-img"></image> | 117 | <image src="{{item.default_images}}" class="activity-item-img"></image> |
@@ -121,21 +121,22 @@ | @@ -121,21 +121,22 @@ | ||
121 | </scroll-view> | 121 | </scroll-view> |
122 | </block> --> | 122 | </block> --> |
123 | 123 | ||
124 | - <!-- <template is='tipTitle' data="{{desc:'热门品类', no_line: 'true'}}"/> | ||
125 | - <home-hot-category category-list="{{categoryList}}" | ||
126 | - bindjumpByRule="jumpByRuleEvent"></home-hot-category> | ||
127 | - | ||
128 | - <template is='tipTitle' data="{{desc:'潮流品牌'}}"/> | ||
129 | - <home-brand brand-list="{{brandList}}" bindjumpByRule="jumpByRuleEvent"></home-brand> | ||
130 | - <home-brand brand-list="{{brandList}}" bindjumpByRule="jumpByRuleEvent"></home-brand> | 124 | + |
131 | 125 | ||
132 | - <template is='tipTitle' data="{{desc:'最新活动'}}"/> | 126 | + <!-- <template is='tipTitle' data="{{desc:'最新活动'}}"/> |
133 | <home-new-activity activity-list="{{activityList}}" | 127 | <home-new-activity activity-list="{{activityList}}" |
134 | - bindjumpByRule="jumpByRuleEvent"></home-new-activity> | 128 | + bindjumpByRule="jumpByRuleEvent"></home-new-activity> --> |
135 | 129 | ||
136 | - <template is='tipTitle' data="{{desc:'精彩活动'}}"/> | ||
137 | - <home-single-image data="{{src:singleImage}}" bindjumpByRule="jumpByRuleEvent"></home-single-image> | ||
138 | - <home-hor-product-list product-list="{{productList}}" bindjumpByRule="jumpByRuleEvent"></home-hor-product-list> --> | 130 | + </block> |
131 | + | ||
132 | + <!-- 商品推荐 --> | ||
133 | + <block tt:elif="{{newChannels[selectedChannel]['recommend']['data']}}"> | ||
134 | + <template is='tipTitle' data="{{desc:'猜你喜欢'}}"/> | ||
135 | + <view class="product-list"> | ||
136 | + <block tt:for="{{newChannels[selectedChannel]['recommend']['data']}}" tt:for-item="product" tt:key="{{index}}"> | ||
137 | + <productCell id="productCell" item="{{product}}"/> | ||
138 | + </block> | ||
139 | + </view> | ||
139 | </block> | 140 | </block> |
140 | 141 | ||
141 | </scroll-view> | 142 | </scroll-view> |
-
Please register or login to post a comment