Browse Source

添加登录成功跳转前获取用户自己的ID

master
chenxuhui 7 years ago
parent
commit
9992e1cd20
3 changed files with 18 additions and 1 deletions
  1. +1
    -0
      app.js
  2. +16
    -0
      pages/login/login.js
  3. +1
    -1
      pages/login/login.json

+ 1
- 0
app.js View File

@ -19,6 +19,7 @@ App({
phoneNum: "",
openID: "",
appID: "wx0b897783b2588147",
userID:"",
// Phone: "",
// OpenId: "",


+ 16
- 0
pages/login/login.js View File

@ -12,6 +12,8 @@ var bindPath = "/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/Bind";
var getBindCustomer = '/MainSystem/B3WeChatMiniProgram/Rpcs/CommonRpc/GetBindCustomer';
var getCookie = '/MainSystem/MainSystem/Auth/WeixinLogin';
var getCustomerList = '/MainSystem/B3WeChatMiniProgram/Rpcs/CustomerRpc/GetList';
var getCurrentID ="/MainSystem/B3MiniProgramRpc/XuRpcs/Customer/AccountRpc/GetCurrentCustomerID"
/**
* 获取绑定客户ID及用户电话 参数1appID 2openID
* 返回值globalCustomerIDWeixinUser_Phone
@ -54,6 +56,8 @@ function IsBindWeixinMP(phone) {
let params = [phone];
network.requestLoading(method, params, function (res) {
// res.result = false;
setCurrentCustomerID();
if (res.result == true) {
wx.switchTab({
url: '/pages/homePage/homePage',
@ -67,6 +71,18 @@ function IsBindWeixinMP(phone) {
}
})
}
// 跳转前获取客户自己的ID 存储后在创建订单时 基本信息带出使用
function setCurrentCustomerID (){
let method = getCurrentID;
let params = [];
network.transfer_request(method, params, function (res) {
// res.result = false;
app.globalData.userID = res.result;
console.log(res.result);
})
}
// 获取cookie值 参数1、appID 2、openID
function WeixinLogin(successtion) {
let method = getCookie;


+ 1
- 1
pages/login/login.json View File

@ -1,5 +1,5 @@
{
"navigationBarBackgroundColor": "white",
"navigationBarTextStyle": "black",
"navigationBarTitleText": "客户易"
"navigationBarTitleText": "客户易"
}

Loading…
Cancel
Save