|
|
|
@ -45,7 +45,7 @@ Page({ |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad: function (options) { |
|
|
|
let that = this; |
|
|
|
var that = this; |
|
|
|
//获取本地数据
|
|
|
|
// 获取地址
|
|
|
|
wx.getStorage({ |
|
|
|
@ -62,54 +62,57 @@ Page({ |
|
|
|
success: function (res) { |
|
|
|
that.setData({ |
|
|
|
merchantNo: res.data |
|
|
|
}), |
|
|
|
that.getActivityList(res.data); |
|
|
|
wx.request({ |
|
|
|
url: app.gw.hostUrl + '/mall/wxa/activity/banner', |
|
|
|
method: 'get', |
|
|
|
data: { |
|
|
|
merchantNo: res.data |
|
|
|
}, |
|
|
|
header: { |
|
|
|
'Content-Type': 'application/x-www-form-urlencoded' |
|
|
|
}, |
|
|
|
success: function (res) { |
|
|
|
var data = res.data; |
|
|
|
var status = data.code; |
|
|
|
if (status == 0) { |
|
|
|
var data = res.data; |
|
|
|
var status = data.code; |
|
|
|
// console.log(res);
|
|
|
|
that.setData({ |
|
|
|
imgUrls: data.response |
|
|
|
}) |
|
|
|
} else { |
|
|
|
wx.showToast({ |
|
|
|
title: data.msg, |
|
|
|
icon: 'none', |
|
|
|
duration: 3000 |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: function (res) { |
|
|
|
wx.showToast({ |
|
|
|
title: '加载数据失败', |
|
|
|
}); |
|
|
|
}, |
|
|
|
}) |
|
|
|
} |
|
|
|
}); |
|
|
|
wx.request({ |
|
|
|
url: app.gw.hostUrl + '/mall/wxa/activity/banner', |
|
|
|
method: 'get', |
|
|
|
data: { |
|
|
|
merchantNo: that.merchantNo |
|
|
|
}, |
|
|
|
header: { |
|
|
|
'Content-Type': 'application/x-www-form-urlencoded' |
|
|
|
}, |
|
|
|
success: function (res) { |
|
|
|
var data = res.data; |
|
|
|
var status = data.code; |
|
|
|
if (status == 0) { |
|
|
|
var data = res.data; |
|
|
|
var status = data.code; |
|
|
|
// console.log(res);
|
|
|
|
that.setData({ |
|
|
|
imgUrls: data.response |
|
|
|
}) |
|
|
|
} else { |
|
|
|
wx.showToast({ |
|
|
|
title: data.msg, |
|
|
|
icon: 'none', |
|
|
|
duration: 3000 |
|
|
|
}); |
|
|
|
return; |
|
|
|
} |
|
|
|
}, |
|
|
|
fail: function (res) { |
|
|
|
wx.showToast({ |
|
|
|
title: '加载数据失败', |
|
|
|
}); |
|
|
|
}, |
|
|
|
}), |
|
|
|
this.getActivityList(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
getActivityList: function () { |
|
|
|
getActivityList: function ( merchantNo) { |
|
|
|
let that = this; |
|
|
|
wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
|
|
wx.request({ |
|
|
|
url: app.gw.hostUrl + '/mall/wxa/activity/list', |
|
|
|
method: 'get', |
|
|
|
data: { |
|
|
|
merchantNo: that.merchantNo, |
|
|
|
merchantNo: merchantNo, |
|
|
|
// selectedCityId: that.data.addrArray.id[that.data.addrIndex] == undefined ? 0 : that.data.addrArray.id[that.data.addrIndex],
|
|
|
|
pageNum: that.data.pageNum, |
|
|
|
pageSize: that.data.pageSize |
|
|
|
|