[水感应客户端最新]
This commit is contained in:
67
pages/index-老版/index.js
Normal file
67
pages/index-老版/index.js
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 手太欠
|
||||
* 愿这世界都如故事里一样 美好而动人~
|
||||
*/
|
||||
|
||||
Page({
|
||||
data: {
|
||||
payCode : '', // code获取openid
|
||||
openId : '', // openid
|
||||
disabled : false, // 支付按钮
|
||||
payStatus : false, // 支付弹框
|
||||
catchtouchmove: false
|
||||
},
|
||||
|
||||
onLoad(options) {
|
||||
if(options.invite != undefined) {
|
||||
getApp().globalData.inviteText = options.invite
|
||||
}
|
||||
wx.login({
|
||||
success: res => {
|
||||
this.setData({
|
||||
payCode: res.code
|
||||
})
|
||||
// 获取openid
|
||||
this.openInfo()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* openid
|
||||
*/
|
||||
openInfo() {
|
||||
wx.$api.auth.codeOpenid({code: this.data.payCode}).then(res => {
|
||||
this.setData({
|
||||
openId: res.data
|
||||
})
|
||||
}).catch(err => {})
|
||||
},
|
||||
|
||||
/**
|
||||
* 处理未登录时的转跳
|
||||
*/
|
||||
assessGo(){
|
||||
if(wx.getStorageSync("token") != ''){
|
||||
wx.navigateTo({
|
||||
url: '/pages/index/assess/assess?code=' + this.data.openId
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 去登录
|
||||
wx.navigateTo({
|
||||
url: "/pages/login/index?type=indexDemo"
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 微信分享
|
||||
*/
|
||||
onShareAppMessage(){
|
||||
return {
|
||||
title : '水感应',
|
||||
path : "/pages/index/index?invite=" + wx.getStorageSync("invite")
|
||||
}
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user