|
@@ -10,6 +10,9 @@ Page({
|
|
isPage: '',
|
|
isPage: '',
|
|
isId: '',
|
|
isId: '',
|
|
imageUrl: app.globalData.imageUrl,
|
|
imageUrl: app.globalData.imageUrl,
|
|
|
|
+ isShow: true,
|
|
|
|
+ testName: '',
|
|
|
|
+ testPwd: ''
|
|
},
|
|
},
|
|
|
|
|
|
update: function () {
|
|
update: function () {
|
|
@@ -36,19 +39,6 @@ Page({
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
|
|
- updateManager.onUpdateReady(function () {
|
|
|
|
- wx.showModal({
|
|
|
|
- title: '更新提示',
|
|
|
|
- content: '新版本已经准备好,是否重启应用?',
|
|
|
|
- success(res) {
|
|
|
|
- if (res.confirm) {
|
|
|
|
- // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
|
|
|
|
- updateManager.applyUpdate()
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- })
|
|
|
|
- })
|
|
|
|
-
|
|
|
|
updateManager.onUpdateFailed(function () {
|
|
updateManager.onUpdateFailed(function () {
|
|
// 新版本下载失败
|
|
// 新版本下载失败
|
|
wx.showModal({
|
|
wx.showModal({
|
|
@@ -93,8 +83,11 @@ Page({
|
|
wx.setStorageSync('isShow', false)
|
|
wx.setStorageSync('isShow', false)
|
|
} else {
|
|
} else {
|
|
wx.setStorageSync('isShow', true)
|
|
wx.setStorageSync('isShow', true)
|
|
- this.getOpenId()
|
|
|
|
}
|
|
}
|
|
|
|
+ this.getOpenId()
|
|
|
|
+ this.setData({
|
|
|
|
+ isShow: res.version == app.globalData.ver
|
|
|
|
+ })
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
@@ -114,19 +107,22 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
fail: res => {
|
|
fail: res => {
|
|
- wx.hideLoading({
|
|
|
|
- success: (res) => {
|
|
|
|
- wx.showToast({
|
|
|
|
- title: '提示',
|
|
|
|
- icon: 'none',
|
|
|
|
- content: '连接失败,请重试'
|
|
|
|
- })
|
|
|
|
- },
|
|
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '提示',
|
|
|
|
+ icon: 'none',
|
|
|
|
+ content: '连接失败,请重试'
|
|
})
|
|
})
|
|
}
|
|
}
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ loginBtn:function(){
|
|
|
|
+ wx.showLoading({
|
|
|
|
+ title: '正在登陆',
|
|
|
|
+ mask: true
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
//授权手机号
|
|
//授权手机号
|
|
getPhoneNumber: function (e) {
|
|
getPhoneNumber: function (e) {
|
|
const that = this;
|
|
const that = this;
|
|
@@ -143,8 +139,11 @@ Page({
|
|
}
|
|
}
|
|
).then(rs => {
|
|
).then(rs => {
|
|
if (rs.success > 0) {
|
|
if (rs.success > 0) {
|
|
- wx.setStorageSync('phone', rs.data.phoneNumber);
|
|
|
|
- // wx.setStorageSync('phone', '13871019618')
|
|
|
|
|
|
+ if(that.data.isShow){
|
|
|
|
+ wx.setStorageSync('phone', rs.data.phoneNumber);
|
|
|
|
+ } else {
|
|
|
|
+ wx.setStorageSync('phone', '13293333334');
|
|
|
|
+ }
|
|
this.autoLogin();
|
|
this.autoLogin();
|
|
} else {
|
|
} else {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
@@ -159,13 +158,48 @@ Page({
|
|
})
|
|
})
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ getName:function(e){
|
|
|
|
+ this.setData({
|
|
|
|
+ testName : e.detail.value
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ getPwd:function(e){
|
|
|
|
+ this.setData({
|
|
|
|
+ testPwd : e.detail.value
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ testLogin:function(){
|
|
|
|
+ if(this.data.testName != '13293333334'){
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '账号错误',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ } else if(this.data.testPwd != '333334') {
|
|
|
|
+ wx.showToast({
|
|
|
|
+ title: '密码错误',
|
|
|
|
+ icon: 'none'
|
|
|
|
+ })
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ wx.setStorageSync('phone', '13293333334')
|
|
|
|
+ this.autoLogin()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+
|
|
autoLogin: function () {
|
|
autoLogin: function () {
|
|
|
|
+ var openId = ''
|
|
|
|
+ if(this.data.isShow){
|
|
|
|
+ openId = wx.getStorageSync('openId')
|
|
|
|
+ } else {
|
|
|
|
+ openId ='o9b5O5J24HLeDEJtZ2BfGXd8z6J4'
|
|
|
|
+ }
|
|
util.doPost(
|
|
util.doPost(
|
|
'autoLogin', {
|
|
'autoLogin', {
|
|
- openId: wx.getStorageSync('openId'),
|
|
|
|
|
|
+ openId ,
|
|
}
|
|
}
|
|
).then(rs => {
|
|
).then(rs => {
|
|
- wx.hideLoading()
|
|
|
|
if (rs.success > 0) {
|
|
if (rs.success > 0) {
|
|
wx.setStorageSync('sso-token', rs.data.token);
|
|
wx.setStorageSync('sso-token', rs.data.token);
|
|
wx.showToast({
|
|
wx.showToast({
|