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,12 +14,19 @@ Page({ | ||
14 | show_pop:0, | 14 | show_pop:0, |
15 | sele_item:null, | 15 | sele_item:null, |
16 | input_val:null, | 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 | onShow: function() { | 28 | onShow: function() { |
22 | - getApp().check_can_share(); | 29 | + getApp().check_can_share(); |
23 | this.data.ismore=0;this.data.isload=0; | 30 | this.data.ismore=0;this.data.isload=0; |
24 | this.setData({list:null}); | 31 | this.setData({list:null}); |
25 | this.get_list(); | 32 | this.get_list(); |
@@ -96,7 +103,11 @@ Page({ | @@ -96,7 +103,11 @@ Page({ | ||
96 | go_user_info:function () { | 103 | go_user_info:function () { |
97 | var item=this.data.sele_item; | 104 | var item=this.data.sele_item; |
98 | getApp().globalData.choice_guide=item; | 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 | img_err:function (e) { | 113 | img_err:function (e) { |
pages/user/userinfo/userinfo.js
@@ -775,18 +775,26 @@ Page({ | @@ -775,18 +775,26 @@ Page({ | ||
775 | onShow: function() { | 775 | onShow: function() { |
776 | getApp().check_can_share(); | 776 | getApp().check_can_share(); |
777 | var e = this; | 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 | if (this.data.is_zy){ | 791 | if (this.data.is_zy){ |
779 | this.data.is_zy=0; | 792 | this.data.is_zy=0; |
780 | return false; | 793 | return false; |
781 | } | 794 | } |
782 | this.wait_for_store_config(); | 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 | var req = t; | 799 | var req = t; |
792 | req.get("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + getApp().globalData.user_id, { | 800 | req.get("/api/weshop/users/getAndUpdateUser/" + r.stoid + "/" + getApp().globalData.user_id, { |
@@ -1071,7 +1079,7 @@ Page({ | @@ -1071,7 +1079,7 @@ Page({ | ||
1071 | this.data.sele_ing=1; | 1079 | this.data.sele_ing=1; |
1072 | this.check_click_ok(function(){ | 1080 | this.check_click_ok(function(){ |
1073 | th.data.is_zy=1; | 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 | },1) | 1084 | },1) |
1077 | }, | 1085 | }, |