Commit b45d9a0be1a85fa935ed75f4c43ded82731724f2
1 parent
b3cc350b
Revert "1"
This reverts commit 13c7b4c8d1139acd5ab8eb51ccde1dcbd939edf6.
Showing
1 changed file
with
48 additions
and
7 deletions
packageE/pages/qy/contactMe/contactMe.js
| ... | ... | @@ -78,7 +78,7 @@ Page({ |
| 78 | 78 | }, |
| 79 | 79 | }, |
| 80 | 80 | onLoad: function (tt) { |
| 81 | - // tt.scene="0_0_16" | |
| 81 | + // tt.scene="0_0_22" | |
| 82 | 82 | if (tt && tt.scene) { |
| 83 | 83 | var first_leader_str = decodeURIComponent(tt.scene); |
| 84 | 84 | var f_arr = first_leader_str.split("_"); |
| ... | ... | @@ -158,14 +158,17 @@ Page({ |
| 158 | 158 | openuserid, |
| 159 | 159 | skip_verify |
| 160 | 160 | }) |
| 161 | + // if (this.data.phone) { | |
| 162 | + // this.getqy() | |
| 163 | + // } | |
| 161 | 164 | } |
| 162 | 165 | }) |
| 163 | 166 | }, |
| 164 | 167 | async getqy(){ |
| 165 | - wx.showLoading({ | |
| 166 | - title: '加载中', | |
| 167 | - mask:true | |
| 168 | - }) | |
| 168 | + // wx.showLoading({ | |
| 169 | + // title: '加载中', | |
| 170 | + // mask:true | |
| 171 | + // }) | |
| 169 | 172 | let openuserid=this.data.openuserid |
| 170 | 173 | let skip_verify=this.data.skip_verify ? true : false |
| 171 | 174 | let res = await getApp().request.promisePost(`/apib/weshop/admin/qyWeChat/qyWeChatCorpInfo/postAdminQyApi?accdb=${this.data.store.erpid}&url=externalcontact/add_contact_way`, { |
| ... | ... | @@ -195,6 +198,7 @@ Page({ |
| 195 | 198 | this.setData({ |
| 196 | 199 | qr_code:res.data.qr_code |
| 197 | 200 | }) |
| 201 | + this.saveqy(res.data.config_id,res.data.qr_code) | |
| 198 | 202 | }else{ |
| 199 | 203 | let errcode=res.data.errcode |
| 200 | 204 | let msg=errcode |
| ... | ... | @@ -243,19 +247,56 @@ Page({ |
| 243 | 247 | this.setData({ |
| 244 | 248 | phone:resdata.phoneNumber |
| 245 | 249 | }) |
| 246 | - this.getqy() | |
| 250 | + this.befgetqy() | |
| 247 | 251 | // getApp().globalData.zc_dd = dd; |
| 248 | 252 | // wx.redirectTo({ |
| 249 | 253 | // url: "/packageA/pages/profile/profile?is_back=1" |
| 250 | 254 | // }) |
| 251 | 255 | } |
| 252 | 256 | }) |
| 253 | - | |
| 254 | 257 | // var sessionKey = getApp().globalData.sessionKey; |
| 255 | 258 | // var openid = getApp().globalData.openid; |
| 256 | 259 | // var r = getApp().globalData.getu; |
| 257 | 260 | // this.save_the_data(r, e, sessionKey, openid) |
| 258 | 261 | }, |
| 262 | + async befgetqy(){ | |
| 263 | + wx.showLoading({ | |
| 264 | + title: '加载中', | |
| 265 | + mask:true | |
| 266 | + }) | |
| 267 | + let openuserid=this.data.openuserid | |
| 268 | + let res = await getApp().request.promiseGet(`/api/weshop/qyWeChat/qywxConfigList/getMobileInfo/${getApp().globalData.setting.stoid}/${openuserid}/${this.data.phone}`, { data: {} }) | |
| 269 | + console.log('获取数据库表'); | |
| 270 | + console.log(res); | |
| 271 | + if (res.data && res.data.code==0) { | |
| 272 | + this.setData({ | |
| 273 | + qr_code:res.data.data.qrcode | |
| 274 | + }) | |
| 275 | + wx.hideLoading() | |
| 276 | + }else{ | |
| 277 | + this.getqy() | |
| 278 | + } | |
| 279 | + | |
| 280 | + }, | |
| 281 | + async saveqy(config_id,qrcode){ | |
| 282 | + let openuserid=this.data.openuserid | |
| 283 | + let mobile=this.data.phone | |
| 284 | + let addtime=((Date.now())/1000).toFixed(0) | |
| 285 | + let req_data = { | |
| 286 | + store_id: getApp().globalData.setting.stoid, | |
| 287 | + openuserid, | |
| 288 | + config_id, | |
| 289 | + qrcode, | |
| 290 | + mobile, | |
| 291 | + addtime | |
| 292 | + } | |
| 293 | + let res = await getApp().request.promisePost(`/api/weshop/qyWeChat/qywxConfigList/save`, { | |
| 294 | + data: req_data, | |
| 295 | + // is_json: 1 | |
| 296 | + }) | |
| 297 | + // wx.hideLoading() | |
| 298 | + }, | |
| 299 | + | |
| 259 | 300 | |
| 260 | 301 | |
| 261 | 302 | //-- 会员授权 -- | ... | ... |