|
|
@ -18,10 +18,8 @@ Component({ |
|
|
scrollTop: 0, |
|
|
scrollTop: 0, |
|
|
fixed: false, |
|
|
fixed: false, |
|
|
toView: null, |
|
|
toView: null, |
|
|
bannerList: [ |
|
|
|
|
|
'https://pic.downk.cc/item/5fd7606d3ffa7d37b3c4895f.png', |
|
|
|
|
|
'https://pic.downk.cc/item/5fe42c023ffa7d37b3621620.png' |
|
|
|
|
|
], |
|
|
|
|
|
|
|
|
banning: true, |
|
|
|
|
|
bannerList: [], |
|
|
noticeList: [], |
|
|
noticeList: [], |
|
|
iconList: [ |
|
|
iconList: [ |
|
|
{ icon: '/assets/image/ico_trade.png', badge: 0, name: '特价专区' }, |
|
|
{ icon: '/assets/image/ico_trade.png', badge: 0, name: '特价专区' }, |
|
|
@ -54,6 +52,9 @@ Component({ |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
onRestart: function () { |
|
|
onRestart: function () { |
|
|
|
|
|
if(!this.data.noticeList.length){ |
|
|
|
|
|
this.fetchBannerList() |
|
|
|
|
|
} |
|
|
if(!this.data.noticeList.length){ |
|
|
if(!this.data.noticeList.length){ |
|
|
this.fetchNoticeList() |
|
|
this.fetchNoticeList() |
|
|
} |
|
|
} |
|
|
@ -78,12 +79,59 @@ Component({ |
|
|
this.setData({ scrollTop: detail.scrollTop }) |
|
|
this.setData({ scrollTop: detail.scrollTop }) |
|
|
}, |
|
|
}, |
|
|
tapBanner: function(e){ |
|
|
tapBanner: function(e){ |
|
|
if(e.currentTarget.dataset.index == 0){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/ztbvip/index' }) |
|
|
|
|
|
} else if(e.currentTarget.dataset.index == 1){ |
|
|
|
|
|
|
|
|
var item = this.data.bannerList[e.currentTarget.dataset.index] |
|
|
|
|
|
if(item.redirectInfo.targetView == 'showH5'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/html/html/index?link=' + item.redirectInfo.params.id + '?title=' + item.title}) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showImage'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/html/banner/index?src=' + item.redirectInfo.params.id}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if(item.redirectInfo.targetView == 'showBidList'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/goods/ablility/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showProxyList'){ |
|
|
// wx.navigateTo({ url: '/pages/goods/ablility/index' })
|
|
|
// wx.navigateTo({ url: '/pages/goods/ablility/index' })
|
|
|
wx.navigateTo({ url: '/pages/html/banner/index' }) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showQNPrice'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/mall/price-index/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showFactoryPrice'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/article/price-detail/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showFactoryQueue'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/article/queue-detail/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showFactoryQueue'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/article/queue-detail/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showArticleHome'){ |
|
|
|
|
|
// 情报首页
|
|
|
|
|
|
event.emit('EventMessage', { what: 250, desc: 'page-article', index: 0 }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myArticle'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/article/list/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myMessage'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/message/index/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'member'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/ztbvip/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showPurchaseList'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/purchase/ablility/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'showProductList'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/goods/ablility/index?type=1' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'logistics'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/html/logistics/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'contract'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/home/service/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myAddress'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/adress/list/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myBankCard'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/bank/vindex/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'personalBillDetail'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/bank/bill/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myScore'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/html/integral/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myBalance'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/withdrawal/balance/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myProxyList'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/agent/order/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myBidList'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/bidding/index/index' }) |
|
|
|
|
|
} else if(item.redirectInfo.targetView == 'myShop'){ |
|
|
|
|
|
wx.navigateTo({ url: '/pages/shop/index/index' }) |
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
onGridTap: function(e){ |
|
|
onGridTap: function(e){ |
|
|
var index = e.currentTarget.dataset.index |
|
|
var index = e.currentTarget.dataset.index |
|
|
@ -118,6 +166,14 @@ Component({ |
|
|
this.fetchAgentList() |
|
|
this.fetchAgentList() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
fetchBannerList: function(){ |
|
|
|
|
|
// /banner/get/banner-list/{type} 获取banner
|
|
|
|
|
|
request.get('/recycle-service/banner/get/banner-list/1').then(result => { |
|
|
|
|
|
//成功回调
|
|
|
|
|
|
this.setData({ bannerList: result.data }) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
fetchNoticeList: function(){ |
|
|
fetchNoticeList: function(){ |
|
|
if (this.data.loopRequesting) { |
|
|
if (this.data.loopRequesting) { |
|
|
return |
|
|
return |
|
|
|