|
|
|
@ -11,10 +11,10 @@ Page({ |
|
|
|
interval: 5000, |
|
|
|
duration: 1000, |
|
|
|
imgUrls: [], |
|
|
|
merchantNo:'', |
|
|
|
merchantNo: '', |
|
|
|
// bannerImage: '/images/activity_banner.png',
|
|
|
|
menu_list:[ |
|
|
|
{ name: '拼团', disabled:false, className:'green_button'}, |
|
|
|
menu_list: [ |
|
|
|
{ name: '拼团', disabled: false, className: 'green_button' }, |
|
|
|
{ name: '秒杀', disabled: true, className: 'gray_button' }, |
|
|
|
{ name: '夺宝', disabled: true, className: 'gray_button' }, |
|
|
|
{ name: '砍价', disabled: true, className: 'gray_button' } |
|
|
|
@ -29,7 +29,7 @@ Page({ |
|
|
|
// typeNum: 10,
|
|
|
|
// addrArray: { id: [440100000, 430426000], name: ['长沙', '深圳', '上海', '长沙', '武汉', '杭州', '北京'] },
|
|
|
|
addrIndex: 0, |
|
|
|
districtName:'', |
|
|
|
districtName: '', |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 城市选择 |
|
|
|
@ -46,33 +46,33 @@ Page({ |
|
|
|
*/ |
|
|
|
onLoad: function (options) { |
|
|
|
let that = this; |
|
|
|
// //获取本地数据
|
|
|
|
// // 获取地址
|
|
|
|
// wx.getStorage({
|
|
|
|
// key: 'districtName',
|
|
|
|
// success: function (res) {
|
|
|
|
// console.log(111111111111111111)
|
|
|
|
// console.log(res.data)
|
|
|
|
// that.setData({
|
|
|
|
// districtName: res.data
|
|
|
|
// })
|
|
|
|
// console.log(222222222222222222)
|
|
|
|
//获取本地数据
|
|
|
|
// 获取地址
|
|
|
|
wx.getStorage({ |
|
|
|
key: 'districtName', |
|
|
|
success: function (res) { |
|
|
|
console.log(111111111111111111) |
|
|
|
console.log(res.data) |
|
|
|
that.setData({ |
|
|
|
districtName: res.data |
|
|
|
}) |
|
|
|
console.log(222222222222222222) |
|
|
|
|
|
|
|
// // that.setData({ userName: res.data });
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// // 商家编号
|
|
|
|
// wx.getStorage({
|
|
|
|
// key: 'merchantNo',
|
|
|
|
// success: function (res) {
|
|
|
|
// console.log(6666666666666666666666)
|
|
|
|
// console.log(res.data)
|
|
|
|
// that.setData({
|
|
|
|
// merchantNo: res.data
|
|
|
|
// })
|
|
|
|
// console.log(888888888888888888888888)
|
|
|
|
// }
|
|
|
|
// });
|
|
|
|
// that.setData({ userName: res.data });
|
|
|
|
} |
|
|
|
}); |
|
|
|
// 商家编号
|
|
|
|
wx.getStorage({ |
|
|
|
key: 'merchantNo', |
|
|
|
success: function (res) { |
|
|
|
console.log(6666666666666666666666) |
|
|
|
console.log(res.data) |
|
|
|
that.setData({ |
|
|
|
merchantNo: res.data |
|
|
|
}) |
|
|
|
console.log(888888888888888888888888) |
|
|
|
} |
|
|
|
}); |
|
|
|
wx.request({ |
|
|
|
url: app.gw.hostUrl + '/mall/wxa/activity/banner', |
|
|
|
method: 'get', |
|
|
|
@ -82,7 +82,7 @@ Page({ |
|
|
|
header: { |
|
|
|
'Content-Type': 'application/x-www-form-urlencoded' |
|
|
|
}, |
|
|
|
success: function (res){ |
|
|
|
success: function (res) { |
|
|
|
var data = res.data; |
|
|
|
var status = data.code; |
|
|
|
if (status == 0) { |
|
|
|
@ -107,16 +107,16 @@ Page({ |
|
|
|
}); |
|
|
|
}, |
|
|
|
}), |
|
|
|
this.getActivityList(); |
|
|
|
this.getActivityList(); |
|
|
|
}, |
|
|
|
|
|
|
|
getActivityList: function(){ |
|
|
|
|
|
|
|
getActivityList: function () { |
|
|
|
let that = this; |
|
|
|
wx.showNavigationBarLoading() //在标题栏中显示加载
|
|
|
|
wx.request({ |
|
|
|
url: app.gw.hostUrl + '/mall/wxa/activity/list', |
|
|
|
method: 'get', |
|
|
|
data: { |
|
|
|
data: { |
|
|
|
merchantNo: that.merchantNo, |
|
|
|
// selectedCityId: that.data.addrArray.id[that.data.addrIndex] == undefined ? 0 : that.data.addrArray.id[that.data.addrIndex],
|
|
|
|
pageNum: that.data.pageNum, |
|
|
|
@ -158,7 +158,7 @@ Page({ |
|
|
|
return; |
|
|
|
} |
|
|
|
}, |
|
|
|
fail:function(res) { |
|
|
|
fail: function (res) { |
|
|
|
wx.showToast({ |
|
|
|
title: '加载数据失败', |
|
|
|
}); |
|
|
|
@ -174,7 +174,7 @@ Page({ |
|
|
|
/** |
|
|
|
* 点击去开团 |
|
|
|
*/ |
|
|
|
openGroup:function(e){ |
|
|
|
openGroup: function (e) { |
|
|
|
console.log('activityNo:' + e.currentTarget.dataset.item); |
|
|
|
wx.navigateTo({ |
|
|
|
url: '../activity_detail/activity_detail?activityNo=' + e.currentTarget.dataset.item, |
|
|
|
@ -184,7 +184,7 @@ Page({ |
|
|
|
* 生命周期函数--监听页面初次渲染完成 |
|
|
|
*/ |
|
|
|
onReady: function () { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -218,14 +218,14 @@ Page({ |
|
|
|
* 生命周期函数--监听页面隐藏 |
|
|
|
*/ |
|
|
|
onHide: function () { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面卸载 |
|
|
|
*/ |
|
|
|
onUnload: function () { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
@ -253,7 +253,7 @@ Page({ |
|
|
|
* 用户点击右上角分享 |
|
|
|
*/ |
|
|
|
onShareAppMessage: function () { |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
getUserInfo: function (e) { |
|
|
|
console.log(e) |
|
|
|
|