|
|
@ -18,6 +18,7 @@ function GetBindCustomer(that) { |
|
|
app.globalData.phoneNum = res.result.WeixinUser_Phone; |
|
|
app.globalData.phoneNum = res.result.WeixinUser_Phone; |
|
|
// 获取cookie值
|
|
|
// 获取cookie值
|
|
|
WeixinLogin(function (res) { |
|
|
WeixinLogin(function (res) { |
|
|
|
|
|
setCurrentCustomerID(); |
|
|
wx.switchTab({ |
|
|
wx.switchTab({ |
|
|
url: '/pages/homePage/homePage', |
|
|
url: '/pages/homePage/homePage', |
|
|
}) |
|
|
}) |
|
|
@ -37,7 +38,7 @@ function setCurrentCustomerID (){ |
|
|
|
|
|
|
|
|
// 获取cookie值 参数1、appID 2、openID
|
|
|
// 获取cookie值 参数1、appID 2、openID
|
|
|
function WeixinLogin(successtion) { |
|
|
function WeixinLogin(successtion) { |
|
|
let method = getCookie; |
|
|
|
|
|
|
|
|
let method = '/MainSystem/B3MiniProgramRpc/Rpcs/CommonRpc/WeixinLogin'; |
|
|
let params = [app.globalData.appID, app.globalData.openID]; |
|
|
let params = [app.globalData.appID, app.globalData.openID]; |
|
|
network.transfer_request(method, params, function (res) { |
|
|
network.transfer_request(method, params, function (res) { |
|
|
app.globalData.cookie = res.result; |
|
|
app.globalData.cookie = res.result; |
|
|
@ -62,9 +63,10 @@ function XuBindByPhone(that) { |
|
|
"HeadImgUrl": userInfos.avatarUrl, |
|
|
"HeadImgUrl": userInfos.avatarUrl, |
|
|
"UnionId": "", |
|
|
"UnionId": "", |
|
|
}]; |
|
|
}]; |
|
|
network.newRequestLoading(method2, params2, function (res) { |
|
|
|
|
|
|
|
|
network.transfer_request(method2, params2, function (res) { |
|
|
if (res.result != null) { |
|
|
if (res.result != null) { |
|
|
WeixinLogin(function () { |
|
|
WeixinLogin(function () { |
|
|
|
|
|
setCurrentCustomerID(); |
|
|
wx.switchTab({ |
|
|
wx.switchTab({ |
|
|
url: '/pages/homePage/homePage', |
|
|
url: '/pages/homePage/homePage', |
|
|
}) |
|
|
}) |
|
|
@ -78,7 +80,6 @@ Page({ |
|
|
code: "", |
|
|
code: "", |
|
|
userName: "", |
|
|
userName: "", |
|
|
psw: "", |
|
|
psw: "", |
|
|
index: 0, |
|
|
|
|
|
phoneNum: "", |
|
|
phoneNum: "", |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -123,6 +124,24 @@ Page({ |
|
|
var that = this; |
|
|
var that = this; |
|
|
if (e.detail.userInfo != null) { |
|
|
if (e.detail.userInfo != null) { |
|
|
app.globalData.userInfo = e.detail.userInfo |
|
|
app.globalData.userInfo = e.detail.userInfo |
|
|
|
|
|
if (this.data.code == "") { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '请输入企业编码', |
|
|
|
|
|
}) |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
if (this.data.userName == "") { |
|
|
|
|
|
wx.showToast({ |
|
|
|
|
|
title: '请输入用户名', |
|
|
|
|
|
}) |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
// if (this.data.psw == "") {
|
|
|
|
|
|
// wx.showToast({
|
|
|
|
|
|
// title: '请输入密码',
|
|
|
|
|
|
// })
|
|
|
|
|
|
// return false;
|
|
|
|
|
|
// }
|
|
|
if (this.data.phoneNum == "") { |
|
|
if (this.data.phoneNum == "") { |
|
|
wx.showToast({ |
|
|
wx.showToast({ |
|
|
title: '请输入手机号码', |
|
|
title: '请输入手机号码', |
|
|
@ -149,7 +168,7 @@ Page({ |
|
|
"HeadImgUrl": userInfos.avatarUrl, |
|
|
"HeadImgUrl": userInfos.avatarUrl, |
|
|
"UnionId": "" |
|
|
"UnionId": "" |
|
|
}]; |
|
|
}]; |
|
|
network.transfer_request(method, params, function (res) { |
|
|
|
|
|
|
|
|
network.requestLoading(method, params, function (res) { |
|
|
if (res.result != null) { |
|
|
if (res.result != null) { |
|
|
app.globalData.globalCustomerID = res.result; |
|
|
app.globalData.globalCustomerID = res.result; |
|
|
XuBindByPhone(that); |
|
|
XuBindByPhone(that); |
|
|
|