From 9992e1cd205c84379777c6728cfe3c7da9a4466a Mon Sep 17 00:00:00 2001 From: chenxuhui Date: Wed, 5 Dec 2018 20:49:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=99=BB=E5=BD=95=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E8=B7=B3=E8=BD=AC=E5=89=8D=E8=8E=B7=E5=8F=96=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=87=AA=E5=B7=B1=E7=9A=84ID?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 1 + pages/login/login.js | 16 ++++++++++++++++ pages/login/login.json | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) 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