Commit 489da78652b5afa6b07887d4e2eea33bcde9ae2a
1 parent
bd8de6df
如果选择导购,就变成了页面要重新加载, 优化成返回
Showing
2 changed files
with
29 additions
and
10 deletions
packageB/pages/user/choice_guide/choice_guide.js
... | ... | @@ -14,12 +14,19 @@ Page({ |
14 | 14 | show_pop:0, |
15 | 15 | sele_item:null, |
16 | 16 | input_val:null, |
17 | + | |
18 | + is_back:0 | |
17 | 19 | }, |
18 | 20 | //------初始化加载---------- |
19 | - onLoad: function(t) {}, | |
21 | + onLoad: function(t) { | |
22 | + if(t.is_back){ | |
23 | + this.data.is_back=t.is_back | |
24 | + } | |
25 | + | |
26 | + }, | |
20 | 27 | |
21 | 28 | onShow: function() { |
22 | - getApp().check_can_share(); | |
29 | + getApp().check_can_share(); | |
23 | 30 | this.data.ismore=0;this.data.isload=0; |
24 | 31 | this.setData({list:null}); |
25 | 32 | this.get_list(); |
... | ... | @@ -96,7 +103,11 @@ Page({ |
96 | 103 | go_user_info:function () { |
97 | 104 | var item=this.data.sele_item; |
98 | 105 | getApp().globalData.choice_guide=item; |
99 | - getApp().goto("/pages/user/userinfo/userinfo"); | |
106 | + | |
107 | + if( this.data.is_back) | |
108 | + wx.navigateBack({ delta: 1 }) | |
109 | + else | |
110 | + getApp().goto("/pages/user/userinfo/userinfo"); | |
100 | 111 | }, |
101 | 112 | |
102 | 113 | img_err:function (e) { | ... | ... |
pages/user/userinfo/userinfo.js
... | ... | @@ -775,18 +775,26 @@ Page({ |
775 | 775 | onShow: function() { |
776 | 776 | getApp().check_can_share(); |
777 | 777 | var e = this; |
778 | + | |
779 | + //如果有传值进行跳转的话, | |
780 | + var choice_guide=null; | |
781 | + if(getApp().globalData.choice_guide){ | |
782 | + choice_guide=JSON.parse(JSON.stringify(getApp().globalData.choice_guide)); | |
783 | + getApp().globalData.choice_guide=null; | |
784 | + let user=this.data.user; | |
785 | + user.staffName=choice_guide.StaffName; | |
786 | + user.staffId=choice_guide.Id; | |
787 | + user.staffTel=choice_guide.Tel; | |
788 | + return false; | |
789 | + } | |
790 | + | |
778 | 791 | if (this.data.is_zy){ |
779 | 792 | this.data.is_zy=0; |
780 | 793 | return false; |
781 | 794 | } |
782 | 795 | this.wait_for_store_config(); |
783 | 796 | |
784 | - //如果有传值进行跳转的话 | |
785 | - var choice_guide=null; | |
786 | - if(getApp().globalData.choice_guide){ | |
787 | - choice_guide=JSON.parse(JSON.stringify(getApp().globalData.choice_guide)); | |
788 | - getApp().globalData.choice_guide=null; | |
789 | - } | |
797 | + | |
790 | 798 | |
791 | 799 | var req = t; |
792 | 800 | req.get("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + getApp().globalData.user_id, { |
... | ... | @@ -1071,7 +1079,7 @@ Page({ |
1071 | 1079 | this.data.sele_ing=1; |
1072 | 1080 | this.check_click_ok(function(){ |
1073 | 1081 | th.data.is_zy=1; |
1074 | - getApp().goto("/packageB/pages/user/choice_guide/choice_guide"); | |
1082 | + getApp().goto("/packageB/pages/user/choice_guide/choice_guide?is_back=1"); | |
1075 | 1083 | |
1076 | 1084 | },1) |
1077 | 1085 | }, | ... | ... |