Commit d896e39fc067edcd363f9ab8d170c4c9de20de25

Authored by yvan.ni
1 parent 54919013

地址的问题优化

... ... @@ -51,7 +51,7 @@ App({
51 51 config: null, //门店参数
52 52 config2: null, //门店配置
53 53 code: null,
54   - user_id: null,//1564704,// 10153869,// 6453964,//5682094,6520044,6520119 qa 4687 6519901
  54 + user_id: null,//5682094,6520044,6520119 qa 4687 6519901
55 55 buy_now: null,
56 56 picklist: null, //门店列表
57 57 wuliuprice: null, //物流价格表
... ... @@ -671,21 +671,24 @@ App({
671 671  
672 672 //清空登录时候缓存的值
673 673 onHide: function () {
674   - this.globalData.is_test = 0;
675   - this.globalData.guide_id = null; //导购清空
676   - this.globalData.first_leader = null; //分享的会员清空
677   - this.globalData.wuliu = null; //关闭要把物流清空
678   - this.globalData.room_id = null; //关闭要把房间号关闭
679   - this.globalData.room_goods_id = null; //关闭要把物流清空
680   - this.globalData.config2 = null; //清除config2的缓存
681   - this.globalData.config = null; //清除config的缓存
682   - this.globalData.gr_index = 0; //商品分组的序列
683   - this.globalData.pk_store = null;
684   - this.globalData.wxapp_buy_obj = null;
685   - this.globalData.dis_buy_obj = null; //等级卡的购买记录
686   - this.globalData.storeFooter = null; //底部的导航
687   - this.globalData.full_screen = null; //全屏
688   -
  674 + if(!this.globalData.no_clear) {
  675 + this.globalData.is_test = 0;
  676 + this.globalData.guide_id = null; //导购清空
  677 + this.globalData.first_leader = null; //分享的会员清空
  678 + this.globalData.wuliu = null; //关闭要把物流清空
  679 + this.globalData.room_id = null; //关闭要把房间号关闭
  680 + this.globalData.room_goods_id = null; //关闭要把物流清空
  681 + this.globalData.config2 = null; //清除config2的缓存
  682 + this.globalData.config = null; //清除config的缓存
  683 + this.globalData.gr_index = 0; //商品分组的序列
  684 + this.globalData.pk_store = null;
  685 + this.globalData.wxapp_buy_obj = null;
  686 + this.globalData.dis_buy_obj = null; //等级卡的购买记录
  687 + this.globalData.storeFooter = null; //底部的导航
  688 + this.globalData.full_screen = null; //全屏
  689 + }else{
  690 + this.globalData.no_clear=0;
  691 + }
689 692 },
690 693  
691 694 clear_word: function (word) {
... ... @@ -825,9 +828,23 @@ App({
825 828 }
826 829 },
827 830  
  831 + //重复函数,统一调用,
  832 + pre_img(path){
  833 + this.globalData.no_clear=1;
  834 + wx.previewImage({
  835 + //将图片预览出来
  836 + urls: [path]
  837 + });
  838 + },
828 839  
829   -
830   -
  840 + //b是数组,t是wxml元素返回的
  841 + pre_img2(b,t){
  842 + this.globalData.no_clear=1;
  843 + wx.previewImage({
  844 + current: b[t.currentTarget.dataset.id],
  845 + urls: b
  846 + });
  847 + }
831 848  
832 849  
833 850 });
... ...
pages/user/address_list/address_list.js
... ... @@ -152,8 +152,10 @@ Page({
152 152 var th=this;
153 153 wx.getSetting({
154 154 success(res) {
155   - console.log("vres.authSetting['scope.address']:", res.authSetting['scope.address'])
  155 + getApp().globalData.no_clear=1;
  156 + console.log("vres.authSetting['scope.address']:", res.authSetting['scope.address']);
156 157 if (res.authSetting['scope.address']) {
  158 + getApp().globalData.no_clear=1;
157 159 wx.chooseAddress({
158 160 success(res) {
159 161 th.save_wx_addr(res);
... ... @@ -162,12 +164,13 @@ Page({
162 164  
163 165 } else {
164 166 if (res.authSetting['scope.address'] == false) {
165   - console.log("222")
  167 + getApp().globalData.no_clear=1;
166 168 wx.openSetting({
167 169 success(res) {}
168 170 })
169 171 } else {
170   -
  172 +
  173 + getApp().globalData.no_clear=1;
171 174 wx.chooseAddress({
172 175 success(res) {
173 176 th.save_wx_addr(res);
... ... @@ -199,5 +202,8 @@ Page({
199 202 }
200 203 })
201 204  
202   - }
  205 + },
  206 +
  207 +
  208 +
203 209 });
204 210 \ No newline at end of file
... ...