更新
This commit is contained in:
@@ -15,15 +15,26 @@ Page({
|
||||
content : '', //内容简介
|
||||
noticeShow : '', //公告开关
|
||||
infoItems : [], //卡券专区
|
||||
id : '',
|
||||
areaname : '',
|
||||
latitude : '',
|
||||
userlng : ''
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad (options) {
|
||||
this.indexNav(options.id)
|
||||
},
|
||||
this.setData({
|
||||
id : options.id,
|
||||
areaname : options.areaname,
|
||||
latitude : options.latitude,
|
||||
userlng : options.userlng
|
||||
})
|
||||
|
||||
this.indexNav(options.id,options.areaname,options.latitude,options.userlng)
|
||||
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
@@ -34,8 +45,8 @@ Page({
|
||||
/**
|
||||
* 卡权益分类
|
||||
*/
|
||||
indexNav(id) {
|
||||
wx.$api.index.classify(id).then(res=>{
|
||||
indexNav(id, areaname,latitude,userlng) {
|
||||
wx.$api.index.classify(id, areaname,latitude,userlng).then(res=>{
|
||||
this.setData({
|
||||
noticeData : res.data.notice,
|
||||
infoData : res.data.info,
|
||||
|
||||
@@ -146,12 +146,15 @@ Page({
|
||||
* 处理未登录时的转跳
|
||||
*/
|
||||
userNav(e){
|
||||
let user_lng = this.data.longitude, //经度
|
||||
user_lat = this.data.latitude, //纬度
|
||||
area_name = this.data.address.area//城市名称
|
||||
let id = e.currentTarget.dataset.id
|
||||
wx.getStorage({
|
||||
key : 'token',
|
||||
success:res=>{
|
||||
wx.navigateTo({
|
||||
url: '/pages/classify/classify?id=' + id
|
||||
url: '/pages/classify/classify?id=' + id + '&userlng=' + user_lng + '&latitude=' + user_lat + '&areaname=' + area_name
|
||||
})
|
||||
},
|
||||
fail: (err) => {
|
||||
|
||||
Reference in New Issue
Block a user