Commit 0777421c597815d7689ad0ea48fb0a13111a6787

Authored by 前端开发-罗建龙
1 parent ccb71f34

企业微信扫码导购联系我优化

packageE/pages/qy/contactMe/contactMe.js
... ... @@ -171,7 +171,7 @@ Page({
171 171 // })
172 172 let openuserid = this.data.openuserid
173 173 let skip_verify = this.data.skip_verify ? true : false
174   - let res = await getApp().request.promisePost(`/apib/weshop/admin/qyWeChat/qyWeChatCorpInfo/postAdminQyApi?accdb=${this.data.store.erpid}&url=externalcontact/add_contact_way`, {
  174 + let res = await getApp().request.promisePost(`/apib/weshop/admin/qyWeChat/qyWeChatCorpInfo/postAdminQyApi?accdb=${this.data.store.erpid}&url=externalcontact/add_contact_way&qyid=4`, {
175 175 data: {
176 176 // accdb: getApp().globalData.config.erpid,
177 177 // ApiName: 'api.pos.shop.advancesum.seek',
... ... @@ -232,66 +232,77 @@ Page({
232 232 return app.my_warnning("登录需要授权手机号码!", 0, this);
233 233 return false;
234 234 }
  235 + let that =this;
  236 + let req_data = {
  237 + js_code:e.code,
  238 + store_id:getApp().globalData.setting.stoid,
  239 + }
  240 + getApp().request.promiseGet('/api/weshop/users/getCodeMobile',{data:req_data}).then(res=>{
235 241  
236   - var that =this;
237   - app.request.get("/api/weshop/manager/managerConfig/get", {
238   - data: {
239   - storeId: getApp().globalData.setting.stoid
240   - },
241   - success: function (res2) {
242   - if (res2.data.code == 0) {
243   - var sessionKey = getApp().globalData.sessionKey;
244   - if (res2.data.data.is_newphone == 1) {
245   -
246   - var req_data = {
247   - sessionKey: sessionKey,
248   - code: e.code,
249   - isNewPhone: 1,
250   - store_id: getApp().globalData.setting.stoid,
251   - }
252   - }else{
253   - var req_data = {
254   - sessionKey: sessionKey,
255   - encryptedData: e.encryptedData,
256   - iv: e.iv,
257   - store_id: getApp().globalData.setting.stoid,
258   - }
259   - }
260   -
261   -
262   - //-- 获取一下手机 --/api/weshop/users/getCodeMobile?store_id=1&js_code=b8451556dd98b2eebec5aa6775625bce192a68fc1a4b15b0c6bf3ed046f90da4
263   - getApp().request.promiseGet("/api/weshop/users/getmobile", { data: req_data }).then(res => {
264   - // console.log('手机号码');
265   - // console.log(res);
266   - if (res.data.code == 0) {
267   - let resdata = res.data.data;
268   - that.setData({
269   - phone: resdata
270   - })
271   - that.befgetqy()
272   - // getApp().globalData.zc_dd = dd;
273   - // wx.redirectTo({
274   - // url: "/packageA/pages/profile/profile?is_back=1"
275   - // })
276   - }
  242 + if (res.data.code==0) {
  243 + this.setData({
  244 + phone:res.data.data
277 245 })
278   - // var sessionKey = getApp().globalData.sessionKey;
279   - // var openid = getApp().globalData.openid;
280   - // var r = getApp().globalData.getu;
281   - // this.save_the_data(r, e, sessionKey, openid)
282   -
283   -
284   - } else {
  246 + this.befgetqy()
  247 + }else {
285 248 return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
286 249 }
287 250 },
288   - failStatus: function (t) {
289   - return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
290   - },
291   - fail: function (t) {
292   - return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
293   - }
294   - });
  251 + );
  252 +
  253 + // app.request.get("/api/weshop/manager/managerConfig/get", {
  254 + // data: {
  255 + // storeId: getApp().globalData.setting.stoid
  256 + // },
  257 + // success: function (res2) {
  258 + // if (res2.data.code == 0) {
  259 + // var sessionKey = getApp().globalData.sessionKey;
  260 + // if (res2.data.data.is_newphone == 1) {
  261 +
  262 + // var req_data = {
  263 + // sessionKey: sessionKey,
  264 + // code: e.code,
  265 + // isNewPhone: 1,
  266 + // store_id: getApp().globalData.setting.stoid,
  267 + // }
  268 + // }else{
  269 + // var req_data = {
  270 + // sessionKey: sessionKey,
  271 + // encryptedData: e.encryptedData,
  272 + // iv: e.iv,
  273 + // store_id: getApp().globalData.setting.stoid,
  274 + // }
  275 + // }
  276 +
  277 + // debugger
  278 + // //-- 获取一下手机 --/api/weshop/users/getCodeMobile?store_id=1&js_code=b8451556dd98b2eebec5aa6775625bce192a68fc1a4b15b0c6bf3ed046f90da4
  279 + // getApp().request.promiseGet("/api/weshop/users/getmobile", { data: req_data }).then(res => {
  280 + // debugger
  281 + // if (res.data.code == 0) {
  282 + // let resdata = res.data.data;
  283 + // that.setData({
  284 + // phone: resdata
  285 + // })
  286 + // that.befgetqy()
  287 + // }
  288 + // })
  289 + // // var sessionKey = getApp().globalData.sessionKey;
  290 + // // var openid = getApp().globalData.openid;
  291 + // // var r = getApp().globalData.getu;
  292 + // // this.save_the_data(r, e, sessionKey, openid)
  293 +
  294 +
  295 + // } else {
  296 + // return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
  297 + // }
  298 + // },
  299 + // failStatus: function (t) {
  300 + // return app.my_warnning("授权登入失败,请稍后再试!", 0, that);
  301 + // },
  302 + // fail: function (t) {
  303 + // return i.clearAuth(), i.alertLoginErrorAndGoHome(), !1;
  304 + // }
  305 + // });
295 306  
296 307 },
297 308 async befgetqy() {
... ...