|
@@ -12,7 +12,9 @@ Page({
|
|
userInfo: {},
|
|
userInfo: {},
|
|
list: [], //活动列表
|
|
list: [], //活动列表
|
|
BASEIMGURL: app.globalData.BASEIMGURL,
|
|
BASEIMGURL: app.globalData.BASEIMGURL,
|
|
- loading: true
|
|
|
|
|
|
+ BASEIMGURL1: app.globalData.BASEIMGURL1,
|
|
|
|
+ loading: true,
|
|
|
|
+ hideGetInfo: true
|
|
// hasUserInfo: false,
|
|
// hasUserInfo: false,
|
|
// canIUse: wx.canIUse('button.open-type.getUserInfo')
|
|
// canIUse: wx.canIUse('button.open-type.getUserInfo')
|
|
},
|
|
},
|
|
@@ -40,7 +42,7 @@ Page({
|
|
this.setData({
|
|
this.setData({
|
|
BASEIMGURL: app.globalData.BASEIMGURL,
|
|
BASEIMGURL: app.globalData.BASEIMGURL,
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
},
|
|
},
|
|
userInfoHandler(e) {
|
|
userInfoHandler(e) {
|
|
console.log(e)
|
|
console.log(e)
|
|
@@ -86,10 +88,10 @@ Page({
|
|
add(e) {
|
|
add(e) {
|
|
let actid = e.currentTarget.dataset.actid;
|
|
let actid = e.currentTarget.dataset.actid;
|
|
//判断是否过期
|
|
//判断是否过期
|
|
- let currentAct = this.data.list.filter(v=>{
|
|
|
|
|
|
+ let currentAct = this.data.list.filter(v => {
|
|
return v.id == actid;
|
|
return v.id == actid;
|
|
})
|
|
})
|
|
- if(currentAct[0].isoverdue){
|
|
|
|
|
|
+ if (currentAct[0].isoverdue) {
|
|
return wx.showToast({
|
|
return wx.showToast({
|
|
title: '活动时间已截止,您可以参加其它活动哦~',
|
|
title: '活动时间已截止,您可以参加其它活动哦~',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -123,15 +125,14 @@ Page({
|
|
that.setData({
|
|
that.setData({
|
|
userInfo: {
|
|
userInfo: {
|
|
...this.data.userInfo,
|
|
...this.data.userInfo,
|
|
- 'phone': res.data.phone
|
|
|
|
- }
|
|
|
|
|
|
+ 'phone': res.data.phone,
|
|
|
|
+ },
|
|
|
|
+ hideGetInfo: true
|
|
});
|
|
});
|
|
- //参加活动
|
|
|
|
- that.add(e);
|
|
|
|
- // wx.showToast({
|
|
|
|
- // title: '参加成功!',
|
|
|
|
- // icon: 'none'
|
|
|
|
- // })
|
|
|
|
|
|
+ //跳转到我的页面
|
|
|
|
+ wx.switchTab({
|
|
|
|
+ url: '/pages/my/index',
|
|
|
|
+ })
|
|
} else {
|
|
} else {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '请授权您的手机号!',
|
|
title: '请授权您的手机号!',
|
|
@@ -151,25 +152,25 @@ Page({
|
|
let myDate = new Date();
|
|
let myDate = new Date();
|
|
let now = myDate.valueOf();
|
|
let now = myDate.valueOf();
|
|
let time = new Date(v.endtime).valueOf();
|
|
let time = new Date(v.endtime).valueOf();
|
|
- if(app.globalData.systemInfo.platform == 'ios'){
|
|
|
|
|
|
+ if (app.globalData.systemInfo.platform == 'ios') {
|
|
let _date = v.endtime.replace(/\.|\-/g, '/');
|
|
let _date = v.endtime.replace(/\.|\-/g, '/');
|
|
time = new Date(_date).valueOf();
|
|
time = new Date(_date).valueOf();
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (now > time) {
|
|
if (now > time) {
|
|
v.isoverdue = true;
|
|
v.isoverdue = true;
|
|
} else {
|
|
} else {
|
|
v.isoverdue = false;
|
|
v.isoverdue = false;
|
|
}
|
|
}
|
|
|
|
|
|
- v.starttime = v.starttime.substr(0,16);
|
|
|
|
|
|
+ v.starttime = v.starttime.substr(0, 16);
|
|
v.shareMember = 0;
|
|
v.shareMember = 0;
|
|
if (v.images) {
|
|
if (v.images) {
|
|
try {
|
|
try {
|
|
-
|
|
|
|
|
|
+
|
|
v.imgList = JSON.parse(v.images)
|
|
v.imgList = JSON.parse(v.images)
|
|
} catch (error) {
|
|
} catch (error) {
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (v.members) {
|
|
if (v.members) {
|
|
@@ -203,7 +204,7 @@ Page({
|
|
success: function (res) { //成功后的回调
|
|
success: function (res) { //成功后的回调
|
|
let newList = that.data.list;
|
|
let newList = that.data.list;
|
|
res.result.elements.map(v => {
|
|
res.result.elements.map(v => {
|
|
- newList.map(j => {
|
|
|
|
|
|
+ newList.map(j => {
|
|
if (v.to.lat == j.latitude && v.to.lng == j.longitude) {
|
|
if (v.to.lat == j.latitude && v.to.lng == j.longitude) {
|
|
j.distance = v.distance;
|
|
j.distance = v.distance;
|
|
}
|
|
}
|
|
@@ -242,9 +243,23 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
onShow() {
|
|
onShow() {
|
|
-
|
|
|
|
|
|
+ if (typeof this.getTabBar === 'function' && this.getTabBar()) {
|
|
|
|
+ this.getTabBar().setData({
|
|
|
|
+ selected: 0
|
|
|
|
+ });
|
|
|
|
+ }
|
|
},
|
|
},
|
|
onShareAppMessage() {
|
|
onShareAppMessage() {
|
|
return app.onShareAppMessage();
|
|
return app.onShareAppMessage();
|
|
},
|
|
},
|
|
|
|
+ closeTap() {
|
|
|
|
+ this.setData({
|
|
|
|
+ hideGetInfo: true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ onUnload() {
|
|
|
|
+ this.setData({
|
|
|
|
+ hideGetInfo: true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
})
|
|
})
|