...
|
...
|
@@ -200,6 +200,75 @@ Page({ |
|
|
// this.fetchRecommend(force);
|
|
|
},
|
|
|
|
|
|
//请求(男生、女生)猜你喜欢数据
|
|
|
// fetchRecommend: function (force) {
|
|
|
// let currentChannel = this.data.selectedChannel;
|
|
|
// let currentChannelData = this.data.newChannels[currentChannel];
|
|
|
// let recommend = currentChannelData.recommend;
|
|
|
// if (recommend.data && recommend.data.length > 0 && !force) {
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
// let param = {};
|
|
|
// let gender = getGenderCode(currentChannel);
|
|
|
// let yh_channel = getChannelCode(currentChannel);
|
|
|
// let content_code = getRecommandContentCode(currentChannel);
|
|
|
// let rec_pos = getRecPosCode(currentChannel);
|
|
|
// param = {
|
|
|
// content_code,
|
|
|
// gender,
|
|
|
// yh_channel,
|
|
|
// rec_pos,
|
|
|
// };
|
|
|
|
|
|
// let newChannelData = objectAssign(currentChannelData, { recommend: objectAssign(recommend, { isLoading: true, }) });
|
|
|
// let newChannels = this.data.newChannels;
|
|
|
// newChannels[currentChannel] = newChannelData;
|
|
|
|
|
|
// this.setData({
|
|
|
// newChannels: newChannels,
|
|
|
// });
|
|
|
|
|
|
// homeService.getProductlist(param)
|
|
|
// .then(json => {
|
|
|
// if (!json || !json.code || json.code != 200) {
|
|
|
// let currentChannel = this.data.selectedChannel;
|
|
|
// let currentChannelData = this.data.newChannels[currentChannel];
|
|
|
// let newChannelData = objectAssign(currentChannelData, { recommend: objectAssign(recommend, { isLoading: false, error: { code: json.code, message: json.message } }) });
|
|
|
// let newChannels = this.data.newChannels;
|
|
|
// newChannels[currentChannel] = newChannelData;
|
|
|
|
|
|
// this.setData({
|
|
|
// newChannels: newChannels,
|
|
|
// });
|
|
|
// return;
|
|
|
// }
|
|
|
|
|
|
// let data = json.data.product_list;
|
|
|
// data = parseBrandListData(data);
|
|
|
// let currentChannel = this.data.selectedChannel;
|
|
|
// let currentChannelData = this.data.newChannels[currentChannel];
|
|
|
// let newChannelData = objectAssign(currentChannelData, { recommend: objectAssign(recommend, { isLoading: false, data }) });
|
|
|
// let newChannels = this.data.newChannels;
|
|
|
// newChannels[currentChannel] = newChannelData;
|
|
|
|
|
|
// this.setData({
|
|
|
// newChannels: newChannels,
|
|
|
// });
|
|
|
// })
|
|
|
// .catch(error => {
|
|
|
// let currentChannel = this.data.selectedChannel;
|
|
|
// let currentChannelData = this.data.newChannels[currentChannel];
|
|
|
// let newChannelData = objectAssign(currentChannelData, { recommend: objectAssign(recommend, { isLoading: false, error }) });
|
|
|
// let newChannels = this.data.newChannels;
|
|
|
// newChannels[currentChannel] = newChannelData;
|
|
|
|
|
|
// this.setData({
|
|
|
// newChannels: newChannels,
|
|
|
// });
|
|
|
// });
|
|
|
// },
|
|
|
|
|
|
jumpByRuleEvent(event) {
|
|
|
console.log(event.detail);
|
|
|
}
|
...
|
...
|
|