diff --git a/app.js b/app.js index 6e2352a..7bd998f 100644 --- a/app.js +++ b/app.js @@ -19,6 +19,7 @@ App({ phoneNum: "", openID: "", appID: "wx0b897783b2588147", + userID:"", // Phone: "", // OpenId: "", diff --git a/pages/login/login.js b/pages/login/login.js index 4bef424..5aec694 100644 --- a/pages/login/login.js +++ b/pages/login/login.js @@ -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及用户电话 参数1、appID 2、openID * 返回值globalCustomerID,WeixinUser_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; diff --git a/pages/login/login.json b/pages/login/login.json index 7806624..e15ed1b 100644 --- a/pages/login/login.json +++ b/pages/login/login.json @@ -1,5 +1,5 @@ { "navigationBarBackgroundColor": "white", "navigationBarTextStyle": "black", - "navigationBarTitleText": "禽客户易" + "navigationBarTitleText": "畜客户易" } \ No newline at end of file