|
@@ -2,99 +2,122 @@ const app = require('../../utils/util.js');
|
|
const tool = require('../../utils/tool.js');
|
|
const tool = require('../../utils/tool.js');
|
|
Page({
|
|
Page({
|
|
data: {
|
|
data: {
|
|
- isInit: false
|
|
|
|
|
|
+ isInit: false,
|
|
|
|
+ loginStatus: false,
|
|
|
|
+ infoStatus: false,
|
|
|
|
+ targetInfoStatus: false
|
|
},
|
|
},
|
|
- // isOk() {
|
|
|
|
- // tool.isLogin().then(result => {
|
|
|
|
|
|
+ isOk() {
|
|
|
|
+ tool.isLogin().then(result => {
|
|
|
|
+ this.setData({
|
|
|
|
+ loginStatus: true
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ // .catch(err => {
|
|
|
|
+ // this.setData({
|
|
|
|
+ // loginStatus: false
|
|
|
|
+ // })
|
|
|
|
+ // });
|
|
|
|
+ tool.isFinishInfo().then(result2 => {
|
|
|
|
+ this.setData({
|
|
|
|
+ infoStatus: true
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ // .catch(err => {
|
|
|
|
+ // this.setData({
|
|
|
|
+ // infoStatus: false
|
|
|
|
+ // })
|
|
|
|
+ // })
|
|
|
|
+ tool.isFinishTargetInfo().then(redult3 => {
|
|
|
|
+ this.setData({
|
|
|
|
+ targetInfoStatus: true
|
|
|
|
+ })
|
|
|
|
+ })
|
|
|
|
+ // .catch(err => {
|
|
// this.setData({
|
|
// this.setData({
|
|
- // loginStatus: true
|
|
|
|
|
|
+ // targetInfoStatus: false
|
|
// })
|
|
// })
|
|
|
|
+ // })
|
|
|
|
+
|
|
|
|
+ },
|
|
|
|
+ baoming() {
|
|
|
|
+ console.log(this.data.loginStatus,'111111')
|
|
|
|
+ console.log(this.data.infoStatus,'22222222222')
|
|
|
|
+ console.log(this.data.targetInfoStatus,'333333333333')
|
|
|
|
+ // tool.isLogin().then(result => {
|
|
// tool.isFinishInfo().then(result2 => {
|
|
// tool.isFinishInfo().then(result2 => {
|
|
- // this.setData({
|
|
|
|
- // infoStatus: true
|
|
|
|
- // })
|
|
|
|
// tool.isFinishTargetInfo().then(redult3 => {
|
|
// tool.isFinishTargetInfo().then(redult3 => {
|
|
- // this.setData({
|
|
|
|
- // targetInfoStatus: true
|
|
|
|
|
|
+ // wx.requestSubscribeMessage({
|
|
|
|
+ // tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
|
|
|
|
+ // success: (res) => {
|
|
|
|
+ // console.log(res,'订阅成功了')
|
|
|
|
+ // wx.request({
|
|
|
|
+ // url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
|
|
|
|
+ // method: "get",
|
|
|
|
+ // success: (res) => {
|
|
|
|
+ // if (res.data.code == 0) {
|
|
|
|
+ // wx.redirectTo({
|
|
|
|
+ // url: '/pages/registrationSuccess/registrationSuccess',
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // },
|
|
|
|
+ // fail: (res1) => {
|
|
|
|
+ // console.log(res1, '订阅失败了')
|
|
|
|
+ // wx.request({
|
|
|
|
+ // url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
|
|
|
|
+ // method: "get",
|
|
|
|
+ // success: (res) => {
|
|
|
|
+ // if (res.data.code == 0) {
|
|
|
|
+ // wx.redirectTo({
|
|
|
|
+ // url: '/pages/registrationSuccess/registrationSuccess',
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
// })
|
|
// })
|
|
// }).catch(err => {
|
|
// }).catch(err => {
|
|
- // this.setData({
|
|
|
|
- // targetInfoStatus: false
|
|
|
|
- // })
|
|
|
|
|
|
+ // wx.showModal({
|
|
|
|
+ // title: '您还未完善择偶信息',
|
|
|
|
+ // showCancel: false,
|
|
|
|
+ // success(res) {
|
|
|
|
+ // if (res.confirm) {
|
|
|
|
+ // wx.redirectTo({
|
|
|
|
+ // url: '/pages/targetInfo/targetInfo',
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
// })
|
|
// })
|
|
// }).catch(err => {
|
|
// }).catch(err => {
|
|
- // this.setData({
|
|
|
|
- // infoStatus: false
|
|
|
|
- // })
|
|
|
|
|
|
+ // wx.showModal({
|
|
|
|
+ // title: '您还未完善个人信息',
|
|
|
|
+ // showCancel: false,
|
|
|
|
+ // success(res) {
|
|
|
|
+ // if (res.confirm) {
|
|
|
|
+ // wx.redirectTo({
|
|
|
|
+ // url: '/pages/personInfo/personInfo',
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
// })
|
|
// })
|
|
// }).catch(err => {
|
|
// }).catch(err => {
|
|
- // this.setData({
|
|
|
|
- // loginStatus: false
|
|
|
|
- // })
|
|
|
|
|
|
+ // wx.showModal({
|
|
|
|
+ // title: '您还未登录',
|
|
|
|
+ // showCancel: false,
|
|
|
|
+ // success(res) {
|
|
|
|
+ // if (res.confirm) {
|
|
|
|
+ // wx.redirectTo({
|
|
|
|
+ // url: '/pages/personal/personal',
|
|
|
|
+ // })
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ // });
|
|
// })
|
|
// })
|
|
- // },
|
|
|
|
- baoming() {
|
|
|
|
- tool.isLogin().then(result => {
|
|
|
|
- tool.isFinishInfo().then(result2 => {
|
|
|
|
- tool.isFinishTargetInfo().then(redult3 => {
|
|
|
|
- wx.requestSubscribeMessage({
|
|
|
|
- tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
|
|
|
|
- success: (res) => {
|
|
|
|
- console.log(res,'订阅成功了')
|
|
|
|
- wx.request({
|
|
|
|
- url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
|
|
|
|
- method: "get",
|
|
|
|
- success: (res) => {
|
|
|
|
- if (res.data.code == 0) {
|
|
|
|
- wx.redirectTo({
|
|
|
|
- url: '/pages/registrationSuccess/registrationSuccess',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
- fail: (res1) => {
|
|
|
|
- console.log(res1, '订阅失败了')
|
|
|
|
- wx.request({
|
|
|
|
- url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
|
|
|
|
- method: "get",
|
|
|
|
- success: (res) => {
|
|
|
|
- if (res.data.code == 0) {
|
|
|
|
- wx.redirectTo({
|
|
|
|
- url: '/pages/registrationSuccess/registrationSuccess',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- }).catch(err => {
|
|
|
|
- wx.showModal({
|
|
|
|
- title: '您还未完善择偶信息',
|
|
|
|
- showCancel: false,
|
|
|
|
- success(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- wx.redirectTo({
|
|
|
|
- url: '/pages/targetInfo/targetInfo',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
- }).catch(err => {
|
|
|
|
- wx.showModal({
|
|
|
|
- title: '您还未完善个人信息',
|
|
|
|
- showCancel: false,
|
|
|
|
- success(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- wx.redirectTo({
|
|
|
|
- url: '/pages/personInfo/personInfo',
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- })
|
|
|
|
- }).catch(err => {
|
|
|
|
|
|
+ if (!this.data.loginStatus) {
|
|
wx.showModal({
|
|
wx.showModal({
|
|
title: '您还未登录',
|
|
title: '您还未登录',
|
|
showCancel: false,
|
|
showCancel: false,
|
|
@@ -106,86 +129,73 @@ Page({
|
|
}
|
|
}
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- })
|
|
|
|
- // if (!this.data.loginStatus) {
|
|
|
|
- // wx.showModal({
|
|
|
|
- // title: '您还未登录',
|
|
|
|
- // showCancel: false,
|
|
|
|
- // success(res) {
|
|
|
|
- // if (res.confirm) {
|
|
|
|
- // wx.redirectTo({
|
|
|
|
- // url: '/pages/personal/personal',
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // return false;
|
|
|
|
- // }
|
|
|
|
- // if (!this.data.infoStatus) {
|
|
|
|
- // wx.showModal({
|
|
|
|
- // title: '您还未完善个人信息',
|
|
|
|
- // showCancel: false,
|
|
|
|
- // success(res) {
|
|
|
|
- // if (res.confirm) {
|
|
|
|
- // wx.redirectTo({
|
|
|
|
- // url: '/pages/personInfo/personInfo',
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // return false;
|
|
|
|
- // }
|
|
|
|
- // if (!this.data.targetInfoStatus) {
|
|
|
|
- // wx.showModal({
|
|
|
|
- // title: '您还未完善择偶信息',
|
|
|
|
- // showCancel: false,
|
|
|
|
- // success(res) {
|
|
|
|
- // if (res.confirm) {
|
|
|
|
- // wx.redirectTo({
|
|
|
|
- // url: '/pages/targetInfo/targetInfo',
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // });
|
|
|
|
- // return false;
|
|
|
|
- // }
|
|
|
|
- // wx.requestSubscribeMessage({
|
|
|
|
- // tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
|
|
|
|
- // success: (res) => {
|
|
|
|
- // wx.request({
|
|
|
|
- // url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
|
|
|
|
- // method: "get",
|
|
|
|
- // success: (res) => {
|
|
|
|
- // if (res.data.code == 0) {
|
|
|
|
- // wx.redirectTo({
|
|
|
|
- // url: '/pages/registrationSuccess/registrationSuccess',
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // },
|
|
|
|
- // fail: (res1) => {
|
|
|
|
- // console.log(res1, '失败了')
|
|
|
|
- // wx.request({
|
|
|
|
- // url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
|
|
|
|
- // method: "get",
|
|
|
|
- // success: (res) => {
|
|
|
|
- // if (res.data.code == 0) {
|
|
|
|
- // wx.redirectTo({
|
|
|
|
- // url: '/pages/registrationSuccess/registrationSuccess',
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
- // }
|
|
|
|
- // })
|
|
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!this.data.infoStatus) {
|
|
|
|
+ wx.showModal({
|
|
|
|
+ title: '您还未完善个人信息',
|
|
|
|
+ showCancel: false,
|
|
|
|
+ success(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ wx.redirectTo({
|
|
|
|
+ url: '/pages/personInfo/personInfo',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ if (!this.data.targetInfoStatus) {
|
|
|
|
+ wx.showModal({
|
|
|
|
+ title: '您还未完善择偶信息',
|
|
|
|
+ showCancel: false,
|
|
|
|
+ success(res) {
|
|
|
|
+ if (res.confirm) {
|
|
|
|
+ wx.redirectTo({
|
|
|
|
+ url: '/pages/targetInfo/targetInfo',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+ wx.requestSubscribeMessage({
|
|
|
|
+ tmplIds: ['YNGZW3voCNtjvTkhi2xbbVinJkjFKcILEG7uFC_xz2Y'],
|
|
|
|
+ success: (res) => {
|
|
|
|
+ wx.request({
|
|
|
|
+ url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
|
|
|
|
+ method: "get",
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
+ wx.redirectTo({
|
|
|
|
+ url: '/pages/registrationSuccess/registrationSuccess',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ fail: (res1) => {
|
|
|
|
+ console.log(res1, '失败了')
|
|
|
|
+ wx.request({
|
|
|
|
+ url: app.globalData.publicUrl + '/wx/actives/' + this.data.openid + '/' + this.data.id + '/enter',
|
|
|
|
+ method: "get",
|
|
|
|
+ success: (res) => {
|
|
|
|
+ if (res.data.code == 0) {
|
|
|
|
+ wx.redirectTo({
|
|
|
|
+ url: '/pages/registrationSuccess/registrationSuccess',
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
},
|
|
},
|
|
async onLoad(options) {
|
|
async onLoad(options) {
|
|
wx.showLoading({
|
|
wx.showLoading({
|
|
title:'加载中',
|
|
title:'加载中',
|
|
mask:true
|
|
mask:true
|
|
});
|
|
});
|
|
- console.log(options)
|
|
|
|
|
|
+ this.isOk();
|
|
tool.openidStatus().then(result => {
|
|
tool.openidStatus().then(result => {
|
|
this.setData({
|
|
this.setData({
|
|
openid: result[0],
|
|
openid: result[0],
|
|
@@ -193,10 +203,9 @@ Page({
|
|
activeOpenid: options.openId,
|
|
activeOpenid: options.openId,
|
|
isInit: true
|
|
isInit: true
|
|
})
|
|
})
|
|
- // this.isOk();
|
|
|
|
this.getActivies(options.id);
|
|
this.getActivies(options.id);
|
|
- wx.hideLoading();
|
|
|
|
})
|
|
})
|
|
|
|
+ wx.hideLoading();
|
|
},
|
|
},
|
|
getActivies(id2) {
|
|
getActivies(id2) {
|
|
wx.request({
|
|
wx.request({
|