Commit 568db438a734ed3828d71af8cd7a7fd27f42b9e6
1 parent
6c7278ce
完善信息和跳转
Showing
2 changed files
with
45 additions
and
23 deletions
packageA/pages/profile/profile.js
... | ... | @@ -531,10 +531,6 @@ Page({ |
531 | 531 | if(!user) return false; |
532 | 532 | |
533 | 533 | //-- 赋予默认值 -- |
534 | - if(user['idcard']) this.data.id=user['idcard']; | |
535 | - if(user['vipname']) this.data.name=user['vipname']; | |
536 | - if(user['address']) this.data.address=user['address']; | |
537 | - | |
538 | 534 | app.request.get(url1, { |
539 | 535 | success: function(res) { |
540 | 536 | console.log('x-->', res.data.code, res.data.data.reg_type, res.data.data.reg_info); |
... | ... | @@ -567,7 +563,10 @@ Page({ |
567 | 563 | if(res.data.code == 0) { |
568 | 564 | console.log('url3', res.data.data.birthday); |
569 | 565 | let data = res.data.data; |
570 | - | |
566 | + if(data['idcard']) self.data.id=data['idcard']; | |
567 | + if(data['vipname']) self.data.name=data['vipname']; | |
568 | + if(data['address']) self.data.address=data['address']; | |
569 | + | |
571 | 570 | if(data.birthday){ |
572 | 571 | data.birthday= ut.formar_no_full(data.birthday); |
573 | 572 | } | ... | ... |
pages/togoin/togoin.js
... | ... | @@ -183,28 +183,51 @@ Page({ |
183 | 183 | } else { |
184 | 184 | return app.showWarning("授权登入失败!"+e.data.msg); |
185 | 185 | } |
186 | - | |
187 | - | |
186 | + | |
188 | 187 | var need_go=0; |
189 | - var t_user=e.data.data; | |
190 | - | |
188 | + var tuser=e.data.data; | |
191 | 189 | wx.setStorageSync("userinfo",e.data.data); |
192 | 190 | wx.setStorageSync("isAuth", !0), app.globalData.userInfo = e.data.data, app.globalData.userInfo.head_pic = t.getFullUrl(a.globalData.userInfo.head_pic); |
191 | + //获取一下线下的真实资料 | |
192 | + let url3 = '/api/weshop/users/getERPUser/'; | |
193 | + url3 += os.stoid + "/" +tuser.user_id; | |
194 | + getApp().promiseGet(url3,{}).then(res=>{ | |
195 | + | |
196 | + if(res.data.code == 0) { | |
197 | + let t_user = res.data.data; | |
198 | + //如果有需要完善的信息没有完善,就需要跳转 | |
199 | + if (!t_user['vipname'] && th.data.name_need_go) { | |
200 | + need_go = 1; | |
201 | + } | |
202 | + if (!t_user['birthday'] && th.data.birth_need_go) { | |
203 | + need_go = 1; | |
204 | + } | |
205 | + if (!t_user['idcard'] && th.data.idcard_need_go) { | |
206 | + need_go = 1; | |
207 | + } | |
208 | + if (!t_user['address'] && th.data.address_need_go) { | |
209 | + need_go = 1; | |
210 | + } | |
211 | + if (!t_user['pickup_id'] && th.data.pick_need_go) { | |
212 | + need_go = 1; | |
213 | + } | |
214 | + if (!t_user['sex'] && th.data.sex_need_go) { | |
215 | + need_go = 1; | |
216 | + } | |
217 | + if (!t_user['fromuser_id'] && th.data.introducer_need_go) { | |
218 | + need_go = 1; | |
219 | + } | |
220 | + | |
221 | + if (need_go) { | |
222 | + getApp().goto("/packageA/pages/profile/profile"); | |
223 | + } else { | |
224 | + wx.navigateBack({delta: 1}) | |
225 | + } | |
226 | + } | |
227 | + }) | |
228 | + | |
193 | 229 | |
194 | - //如果有需要完善的信息没有完善,就需要跳转 | |
195 | - if(!t_user['vipname'] && th.data.name_need_go){ need_go=1;} | |
196 | - if(!t_user['birthday'] && th.data.birth_need_go){ need_go=1;} | |
197 | - if(!t_user['idcard'] && th.data.idcard_need_go){ need_go=1;} | |
198 | - if(!t_user['address'] && th.data.address_need_go){ need_go=1;} | |
199 | - if(!t_user['pickup_id'] && th.data.pick_need_go){ need_go=1;} | |
200 | - if(!t_user['sex'] && th.data.sex_need_go){ need_go=1;} | |
201 | - if(!t_user['fromuser_id'] && th.data.introducer_need_go){ need_go=1;} | |
202 | - | |
203 | - if(need_go){ | |
204 | - getApp().goto("/packageA/pages/profile/profile"); | |
205 | - }else{ | |
206 | - wx.navigateBack({ delta: 1}) | |
207 | - } | |
230 | + | |
208 | 231 | |
209 | 232 | }, |
210 | 233 | failStatus: function (t) { | ... | ... |