diff --git a/app.js b/app.js
index b0064fb..efe8c1c 100644
--- a/app.js
+++ b/app.js
@@ -51,7 +51,7 @@ App({
config: null, //门店参数
config2: null, //门店配置
code: null,
- user_id:null,//6520390,//6520352
+ user_id:null,//10153869,//6520352,// 10153869,// 6520352,// qa-6519858,//
// user_id:6520314,// qa-6519858,//
// user_id:14148118,// qa-6519858,//
buy_now: null,
@@ -511,60 +511,47 @@ App({
get_user_store: function (func) {
var th = this;
this.getConfig2(function (conf) {
-
- var is_pricing_open_store=0;
- var is_regstores=0;
- var is_guide_storage=0;
- if (conf.switch_list) {
- var t_swi = JSON.parse(conf.switch_list);
- //--购买门店是否默认登记门店--
- is_regstores=t_swi.is_regstores;
- is_pricing_open_store=t_swi.is_pricing_open_store;
- is_guide_storage=t_swi.is_guide_storage;
- }
-
//---空会员的情况---
if (!th.globalData.userInfo) {
- //没有导购门店 和 没有开启默认导购
- if(!th.globalData.guide_pick_id || !is_guide_storage) {
- return func(null);
- }
+ return func(null);
}
if (!th.globalData.pk_store) {
var pick_id = 0;
- //-- 如果有导购的时候,后台有默认门店只能是导购的门店的时候 --
- if(th.globalData.guide_pick_id && is_guide_storage){
- pick_id = th.globalData.guide_pick_id
- }else {
+ var is_pricing_open_store=0;
+ var is_regstores=0;
+ if (conf.switch_list) {
+ var t_swi = JSON.parse(conf.switch_list);
+ //--购买门店是否默认登记门店--
+ is_regstores=t_swi.is_regstores;
+ is_pricing_open_store=t_swi.is_pricing_open_store;
+ }
- //-- 如果是区域价格提现,现在注册门店是默认 --
- if (is_pricing_open_store) {
+ //-- 如果是区域价格提现,现在注册门店是默认 --
+ if(is_pricing_open_store){
- //查找会员的注册的地址
- if (th.globalData.userInfo.pickup_id) {
- pick_id = th.globalData.userInfo.pickup_id;
- th.globalData.is_dj_pk = 1;
- }
- //先找一个会员是否有设置默认的地址
- else if (th.globalData.userInfo.def_pickup_id) {
- pick_id = th.globalData.userInfo.def_pickup_id
- }
+ //查找会员的注册的地址
+ if (th.globalData.userInfo.pickup_id) {
+ pick_id = th.globalData.userInfo.pickup_id;
+ th.globalData.is_dj_pk=1;
+ }
+ //先找一个会员是否有设置默认的地址
+ else if (th.globalData.userInfo.def_pickup_id) {
+ pick_id = th.globalData.userInfo.def_pickup_id
+ }
- } else {
- //先找一个会员是否有设置默认的地址
- if (th.globalData.userInfo.def_pickup_id) {
- pick_id = th.globalData.userInfo.def_pickup_id
- }
- //查找会员的注册的地址
- else if (th.globalData.userInfo.pickup_id && is_regstores) {
- pick_id = th.globalData.userInfo.pickup_id
- }
+ }else{
+ //先找一个会员是否有设置默认的地址
+ if (th.globalData.userInfo.def_pickup_id) {
+ pick_id = th.globalData.userInfo.def_pickup_id
+ }
+ //查找会员的注册的地址
+ else if (th.globalData.userInfo.pickup_id && is_regstores) {
+ pick_id = th.globalData.userInfo.pickup_id
}
}
-
//---如果会员没有设置默认门店,同时也没有再注册的时候选择门店--
if (pick_id == 0) return func(null);
@@ -717,7 +704,6 @@ App({
}
},
-
//清空登录时候缓存的值
onHide: function () {
var th = this;
@@ -739,7 +725,6 @@ App({
th.globalData.dis_buy_obj = null; //等级卡的购买记录
th.globalData.storeFooter = null; //底部的导航
th.globalData.full_screen = null; //全屏
- th.globalData.guide_pick_id = null; //分享导购门店的优化
} else {
th.globalData.no_clear = 0;
}
diff --git a/components/diy_store_select/diy_store_select.js b/components/diy_store_select/diy_store_select.js
index f4d8b61..97a8f04 100644
--- a/components/diy_store_select/diy_store_select.js
+++ b/components/diy_store_select/diy_store_select.js
@@ -54,8 +54,7 @@ Component({
fail: function(res) {
if(res.errCode == 2) {
getApp().confirmBox("请开启GPS定位", null, 25000, !1);
- }
- th.set_fir_store_to_def();
+ }
}
})
diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js
index 982243c..f226fbd 100644
--- a/packageA/pages/goodsInfo/goodsInfo.js
+++ b/packageA/pages/goodsInfo/goodsInfo.js
@@ -231,9 +231,7 @@ Page({
that = ee,
th = ee,
gid = t.goods_id,
- first_leader=t.first_leader,
- room_id = t.room_id,
- room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
+ first_leader=t.first_leader;
//检查测肤
getApp().check_skin_face(t,1,gid);
@@ -261,154 +259,212 @@ Page({
//调用接口判断是不是会员
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
if(res.data.code==0) {
- getApp().globalData.guide_id=res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
+ getApp().globalData.guide_id=res.data.data.id;
}
})
}
-
- //-- 如果有房间号 --
- if (room_id) {
- getApp().globalData.room_id = room_id;
- getApp().globalData.room_goods_id = gid;
- //如果是会员分享过来的要记录
- if (room_user_share)
- getApp().globalData.room_user_share = room_user_share;
-
- if (share_openid) {
- this.get_room_share_guide(share_openid);
- }
- }
-
-
- var c_guide_id=t.c_guide_id;
- if(c_guide_id){
- th.data.c_guide_id=c_guide_id;
- }
+
+ var c_guide_id=t.c_guide_id;
+ if(c_guide_id){
+ th.data.c_guide_id=c_guide_id;
+ }
getApp().getConfig(function(e) {
ee.setData({sto_sele_name_1:e.store_name})
})
- //----获取系统参数-----
- getApp().getConfig2(function (e) {
- ee.setData({
- bconfig: e,
- sales_rules: e.sales_rules,
- });
+ //----获取系统参数-----
+ getApp().getConfig2(function (e) {
+ ee.setData({
+ bconfig: e,
+ sales_rules: e.sales_rules,
+ });
+
+ if (e.categoryset.indexOf("," + 1 + ",") != -1) {
+ ee.setData({
+ is_show_pl: 1
+ });
+ }
+ if (e.categoryset.indexOf("," + 3 + ",") != -1) {
+ ee.setData({
+ is_show_pp: 1
+ });
+ }
+ if (e.categoryset.indexOf("," + 2 + ",") != -1) {
+ ee.setData({
+ is_show_gb: 1
+ });
+ }
+ // console.log(e);
+ var json_d = JSON.parse(e.switch_list);
+ ee.setData({
+ store_config: e,
+ sys_switch: json_d,
+ is_closecoupon: json_d.is_closecoupon,
+ is_newsales_rules: json_d.is_newsales_rules
+ });
+ ee.init(gid);
+
+ //------几人评价-------
+ //n.init(th, "", "comments");
+
+ th.requestCardNum(), wx.pageScrollTo && th.setData({
+ supportPageScroll: !0
+ });
+
+ //计算等级价相关
+ // var swithc_list = e.switch_list;
+ // var sw_arr = JSON.parse(swithc_list);
+ // //---如果后台又开等级卡的开关---
+ // if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
+ // th.setData({ rank_switch: true });
+ // //---回调卡的列表---
+ // th.getPlusCardType(function (ob) {
+ // th.setData({ card_list: ob.card_list });
+ // var ti = setInterval(function () {
+ // var user = getApp().globalData.userInfo;
+ // if (!user) return false;
+ // clearInterval(ti);
+ // if (user.card_field && user['card_expiredate']) {
+ // var str = user['card_expiredate'].replace(/-/g, '/');
+ // var end = new Date(str);
+ // end = Date.parse(end) / 1000;
+ // var now = ut.gettimestamp();
+ // //--- 判断是等级会员,且在有效期范围内 ---
+ // if (user.card_field && now < end) {
+ // var card_name = ob.name_map.get(user.card_field);
+ // //if(card_name.length>6) card_name=card_name.substring(0,6);
+
+ // var is_near_date = 0;
+ // if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天
+ // th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date });
+ // }
+ // }
+ // }, 500)
+ // })
+ // }
+
+ }, 1);
- if (e.categoryset.indexOf("," + 1 + ",") != -1) {
- ee.setData({
- is_show_pl: 1
- });
- }
- if (e.categoryset.indexOf("," + 3 + ",") != -1) {
- ee.setData({
- is_show_pp: 1
- });
- }
- if (e.categoryset.indexOf("," + 2 + ",") != -1) {
- ee.setData({
- is_show_gb: 1
- });
- }
- // console.log(e);
- var json_d = JSON.parse(e.switch_list);
- ee.setData({
- store_config: e,
- sys_switch: json_d,
- is_closecoupon: json_d.is_closecoupon,
- is_newsales_rules: json_d.is_newsales_rules
- });
- ee.init(gid);
+ //获取用户设备信息,屏幕宽度
+ wx.getSystemInfo({
+ success: res => {
+ that.setData({
+ screenWidth: res.screenWidth
+ })
+ }
+ });
+
+ //获取用户的默认门店
+ getApp().get_user_store(function(e) {
+ console.log('get_user_store');
+ console.log("999999999");
- //------几人评价-------
- //n.init(th, "", "comments");
- th.requestCardNum(), wx.pageScrollTo && th.setData({
- supportPageScroll: !0
- });
+ if(!e) {
+ th.data.fir_def_store={}; //赋值空对象
+ return false;
+ }
- //计算等级价相关
- // var swithc_list = e.switch_list;
- // var sw_arr = JSON.parse(swithc_list);
- // //---如果后台又开等级卡的开关---
- // if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
- // th.setData({ rank_switch: true });
- // //---回调卡的列表---
- // th.getPlusCardType(function (ob) {
- // th.setData({ card_list: ob.card_list });
- // var ti = setInterval(function () {
- // var user = getApp().globalData.userInfo;
- // if (!user) return false;
- // clearInterval(ti);
- // if (user.card_field && user['card_expiredate']) {
- // var str = user['card_expiredate'].replace(/-/g, '/');
- // var end = new Date(str);
- // end = Date.parse(end) / 1000;
- // var now = ut.gettimestamp();
- // //--- 判断是等级会员,且在有效期范围内 ---
- // if (user.card_field && now < end) {
- // var card_name = ob.name_map.get(user.card_field);
- // //if(card_name.length>6) card_name=card_name.substring(0,6);
-
- // var is_near_date = 0;
- // if (end - now < 60 * 60 * 30 * 24) is_near_date = 1; //如果小于30天
- // th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list, is_near_date: is_near_date });
- // }
- // }
- // }, 500)
- // })
- // }
-
- }, 1);
-
- //获取用户设备信息,屏幕宽度
- wx.getSystemInfo({
- success: res => {
- that.setData({
- screenWidth: res.screenWidth
- })
- }
- });
+ console.log("000000");
- },
+ if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
- //-- 获取直播的分享人的导购信息 --
- async get_room_share_guide(share_openid) {
+ var ee=JSON.parse(JSON.stringify(e));
- var url = "/api/weshop/users/page";
- var first_leader = 0;
- //调用接口判断是不是会员
- await getApp().request.promiseGet(url, {
- data: {
- stoid: os.stoid,
- weapp_openid: share_openid
- }
- }).then(res => {
- if (ut.ajax_ok(res)) {
- first_leader = res.data.data.pageData[0].user_id;
- getApp().globalData.guide_id = res.data.data.id;
- }
- })
+ console.log(e);
- if (!first_leader) return false;
+ //--定时器推迟一下--
+ setTimeout(function () {
+ if(!th.data.data){
+ return false;
+ }
+ var ser_card=th.data.data;
+ //--如果默认门店不在等级卡的默认们店以内
+ if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(ee.keyid)==-1){
+ ee.is_no_dis=1;
+ }
- getApp().globalData.first_leader = first_leader;
+ var appd=getApp().globalData;
+ var w_time = setInterval(function() {
+ if (that.data.is_get_local_ok == 0) return false;
+ clearInterval(w_time);
+ var distance = null;
+ var e=JSON.parse(JSON.stringify(ee));
+
+ //如果有开启近距离的话,同时距离优不一样了
+ if (that.data.lat != null) {
+ //如果经纬度有变化的话
+ if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
+ that.data.fir_def_store=e;
+ that.setData({
+ def_pick_store: e,
+ sto_sele_name: e.pickup_name,
+ sto_sele_id: e.pickup_id,
+ sto_sele_distr: e.distr_type,
+ sto_sele_keyid:e.keyid,
+ })
+ }else{
+ //要用接口是获取距离,js的计算不准
+ getApp().request.promiseGet("/api/weshop/pickup/list",{
+ data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon, is_pos: 1},
+ }).then(res=>{
+ if(ut.ajax_ok(res)){
+ e=res.data.data.pageData[0];
+ if (e){
+ e.is_no_dis=ee.is_no_dis;
+ appd.pk_store=e;
+ that.data.fir_def_store=e;
+
+ console.log('get_user_store--2');
+ console.log(e);
+
+ that.setData({
+ def_pick_store: e,
+ sto_sele_name: e.pickup_name,
+ sto_sele_id: e.pickup_id,
+ sto_sele_distr: e.distr_type,
+ sto_sele_keyid:e.keyid,
+ })
+ }
- //调用接口判断是不是会员
- await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
+ }
+ })
}
- })
- },
+ //e.distance = distance;
+ appd.lat=that.data.lat;
+ appd.lon=that.data.lon;
+
+ } else {
+ if (e) {
+
+ console.log('get_user_store3---');
+ console.log(e);
+
+ e.distance = null;
+ that.data.fir_def_store=e;
+ that.setData({
+ def_pick_store: e,
+ sto_sele_name: e.pickup_name,
+ sto_sele_id: e.pickup_id,
+ sto_sele_distr: e.distr_type,
+ sto_sele_keyid:e.keyid,
+ })
+ }
+ }
+ }, 500)
+ },1500)
- onReady() {
+ });
+
+
+ },
+
+
+ onReady() {
// 用于控制保障服务折叠图标的显示
setTimeout(() => {
wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => {
@@ -615,150 +671,19 @@ Page({
},
- //检测有没有导购分享的门店
- check_guide(func){
- var first_leader=getApp().globalData.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
-
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
-
//---展示---
// gid 在onload阶段已经保存在this.data中
onShow: function() {
getApp().check_can_share();
- var that=this;var th=this;
+ var that=this;
var ee = this,gid = this.data.gid, i = getApp().request;
this.data.is_timer = 1;
-
- //获取用户的默认门店
- th.check_guide(()=>{
- getApp().get_user_store(function(e) {
- console.log('get_user_store');
- console.log("999999999");
-
-
- if(!e) {
- th.data.fir_def_store={}; //赋值空对象
- return false;
- }
-
- console.log("000000");
-
- if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
-
- var ee=JSON.parse(JSON.stringify(e));
-
-
- console.log(e);
-
- //--定时器推迟一下--
- setTimeout(function () {
- if(!th.data.data){
- return false;
- }
- var ser_card=th.data.data;
- //--如果默认门店不在等级卡的默认们店以内
- if(ser_card.storageId!=null && ser_card.storageId!="" && ser_card.storageId.indexOf(ee.keyid)==-1){
- ee.is_no_dis=1;
- }
-
- var appd=getApp().globalData;
- var w_time = setInterval(function() {
- if (that.data.is_get_local_ok == 0) return false;
- clearInterval(w_time);
- var distance = null;
- var e=JSON.parse(JSON.stringify(ee));
-
- //如果有开启近距离的话,同时距离优不一样了
- if (that.data.lat != null) {
- //如果经纬度有变化的话
- if(e && appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
- that.data.fir_def_store=e;
- that.setData({
- def_pick_store: e,
- sto_sele_name: e.pickup_name,
- sto_sele_id: e.pickup_id,
- sto_sele_distr: e.distr_type,
- sto_sele_keyid:e.keyid,
- })
- }else{
- //要用接口是获取距离,js的计算不准
- getApp().request.promiseGet("/api/weshop/pickup/list",{
- data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon, is_pos: 1},
- }).then(res=>{
- if(ut.ajax_ok(res)){
- e=res.data.data.pageData[0];
- if (e){
- e.is_no_dis=ee.is_no_dis;
- appd.pk_store=e;
- that.data.fir_def_store=e;
-
- console.log('get_user_store--2');
- console.log(e);
-
- that.setData({
- def_pick_store: e,
- sto_sele_name: e.pickup_name,
- sto_sele_id: e.pickup_id,
- sto_sele_distr: e.distr_type,
- sto_sele_keyid:e.keyid,
- })
- }
-
- }
- })
- }
-
- //e.distance = distance;
- appd.lat=that.data.lat;
- appd.lon=that.data.lon;
-
- } else {
- if (e) {
-
-
- console.log('get_user_store3---');
- console.log(e);
-
- e.distance = null;
- that.data.fir_def_store=e;
- that.setData({
- def_pick_store: e,
- sto_sele_name: e.pickup_name,
- sto_sele_id: e.pickup_id,
- sto_sele_distr: e.distr_type,
- sto_sele_keyid:e.keyid,
- })
- }
- }
- }, 500)
- },1500)
-
- });
- })
-
this.wait_for_store_config();
+
+
+
i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, {
failRollback: !0,
@@ -2580,15 +2505,6 @@ Page({
var ind=ee.currentTarget.dataset.ind;
var bconfig = th.data.bconfig;
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
//如果开启了,则不在选择门店
if(this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store){
diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.js b/packageA/pages/liveStreamDetails/liveStreamDetails.js
index 686b656..c5bcc82 100644
--- a/packageA/pages/liveStreamDetails/liveStreamDetails.js
+++ b/packageA/pages/liveStreamDetails/liveStreamDetails.js
@@ -523,8 +523,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un
if(res.data.code==0){
getApp().globalData.guide_id=res.data.data.id;
getApp().globalData.staffId=staffId;
- getApp().globalData.storageId=storageId;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
+ getApp().globalData.storageId=storageId;
}
})
}
diff --git a/packageA/pages/my_service/appment_main.js b/packageA/pages/my_service/appment_main.js
index 0460e93..977611f 100644
--- a/packageA/pages/my_service/appment_main.js
+++ b/packageA/pages/my_service/appment_main.js
@@ -344,16 +344,6 @@ Page({
},
//确认选择门店
choice_store: function() {
-
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
var th = this;
var index = th.data.fir_pick_index;
var store_name = th.data.store_list[index].StorageName;
@@ -585,7 +575,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+a.stoid+"/"+options.firstleader,{}).then(res=>{
if(res.data.code==0){
getApp().globalData.guide_id=res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
getApp().request.promiseGet('/api/weshop/shoppingGuide/geIdStaffInfo', {
data: {
diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js
index 254846a..27e32ca 100644
--- a/packageA/pages/prom_list/prom_list.js
+++ b/packageA/pages/prom_list/prom_list.js
@@ -63,7 +63,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
if(res.data.code==0){
getApp().globalData.guide_id=res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
@@ -90,128 +89,91 @@ Page({
}
});
+ //获取用户的默认门店
+ getApp().get_user_store(function(ee) {
+ if(!ee) {
+ th.data.fir_def_store={}; //赋值空对象
+ return false;
+ }
-
- },
-
- //检测有没有导购分享的门店
- check_guide(func){
- var first_leader=getApp().globalData.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
-
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
-
- //---展示---
- onShow: function() {
-
- getApp().check_can_share();
- var ee=this,th=ee,that=ee;
-
- //先获取一下导购的门店
- this.check_guide(()=> {
- //获取用户的默认门店
- getApp().get_user_store(function (ee) {
- if (!ee) {
- th.data.fir_def_store = {}; //赋值空对象
- return false;
+ if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
+
+ var appd=getApp().globalData;
+ var w_time = setInterval(function() {
+ if (that.data.is_get_local_ok == 0) return false;
+ if (!that.data.data) return false;
+ clearInterval(w_time);
+ var distance = null;
+ var e=JSON.parse(JSON.stringify(ee));
+
+ if(th.data.data) var g_distr_type=th.data.data.distr_type;
+ e.is_no_dis=0;
+ if(e.distr_type!=0 && g_distr_type!=0 && e.distr_type!=g_distr_type ){
+ e.is_no_dis=1;
}
- if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
-
- var appd = getApp().globalData;
- var w_time = setInterval(function () {
- if (that.data.is_get_local_ok == 0) return false;
- if (!that.data.data) return false;
- clearInterval(w_time);
- var distance = null;
- var e = JSON.parse(JSON.stringify(ee));
+ //如果有开启近距离的话,同时距离优不一样了
+ if (that.data.lat != null) {
+ //如果经纬度有变化的话
+ if( appd.lat==that.data.lat && appd.lon==that.data.lon && e.distance>0 ){
+ that.data.fir_def_store=e;
+ that.setData({
+ def_pick_store: e,
+ sto_sele_name: e.pickup_name,
+ sto_sele_id: e.pickup_id,
+ sto_sele_distr: e.distr_type
+ })
+ }else{
+ //要用接口是获取距离,js的计算不准
+ getApp().request.promiseGet("/api/weshop/pickup/list",{
+ data:{store_id:os.stoid,pickup_id:e.pickup_id,lat:th.data.lat,lon: th.data.lon,is_pos: 1},
+ }).then(res=>{
+ if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length){
+ e=res.data.data.pageData[0];
+ if (e){
+ appd.pk_store=e;
+ that.data.fir_def_store=e;
+ that.setData({
+ def_pick_store: e,
+ sto_sele_name: e.pickup_name,
+ sto_sele_id: e.pickup_id,
+ sto_sele_distr: e.distr_type
+ })
+ }
- if (th.data.data) var g_distr_type = th.data.data.distr_type;
- e.is_no_dis = 0;
- if (e.distr_type != 0 && g_distr_type != 0 && e.distr_type != g_distr_type) {
- e.is_no_dis = 1;
+ }
+ })
}
- //如果有开启近距离的话,同时距离优不一样了
- if (that.data.lat != null) {
- //如果经纬度有变化的话
- if (appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
- that.data.fir_def_store = e;
- that.setData({
- def_pick_store: e,
- sto_sele_name: e.pickup_name,
- sto_sele_id: e.pickup_id,
- sto_sele_distr: e.distr_type
- })
- } else {
- //要用接口是获取距离,js的计算不准
- getApp().request.promiseGet("/api/weshop/pickup/list", {
- data: {
- store_id: os.stoid,
- pickup_id: e.pickup_id,
- lat: th.data.lat,
- lon: th.data.lon,
- is_pos: 1
- },
- }).then(res => {
- if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) {
- e = res.data.data.pageData[0];
- if (e) {
- appd.pk_store = e;
- that.data.fir_def_store = e;
- that.setData({
- def_pick_store: e,
- sto_sele_name: e.pickup_name,
- sto_sele_id: e.pickup_id,
- sto_sele_distr: e.distr_type
- })
- }
+ //e.distance = distance;
+ appd.lat=that.data.lat;
+ appd.lon=that.data.lon;
- }
- })
- }
+ }else{
+ if (e) {
+ e.distance = null;
+ that.data.fir_def_store=e;
+ that.setData({
+ def_pick_store: e,
+ sto_sele_name: e.pickup_name,
+ sto_sele_id: e.pickup_id,
+ sto_sele_distr: e.distr_type
+ })
+ }
+ }
- //e.distance = distance;
- appd.lat = that.data.lat;
- appd.lon = that.data.lon;
+ }, 500)
+ });
+
+ },
- } else {
- if (e) {
- e.distance = null;
- that.data.fir_def_store = e;
- that.setData({
- def_pick_store: e,
- sto_sele_name: e.pickup_name,
- sto_sele_id: e.pickup_id,
- sto_sele_distr: e.distr_type
- })
- }
- }
+ //---展示---
+ onShow: function() {
- }, 500)
- });
- })
+ getApp().check_can_share();
- var gid = this.data.gid,i = getApp().request;
+ var ee=this,th=ee,that=ee;
+ var gid = this.data.gid,i = getApp().request;
ee.data.g_buy_num = new Map();
this.wait_for_store_config();
clearTimeout(ot);
@@ -1456,16 +1418,6 @@ Page({
// 选择门店
choice_store: function(ee) {
-
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
var th = this;
var ind=ee.currentTarget.dataset.ind;
var bconfig = th.data.bconfig;
diff --git a/packageA/pages/quan_list/quan_list.js b/packageA/pages/quan_list/quan_list.js
index 4406fb6..304a1dd 100644
--- a/packageA/pages/quan_list/quan_list.js
+++ b/packageA/pages/quan_list/quan_list.js
@@ -24,20 +24,6 @@ Page({
//------初始化加载----------
onLoad: function (t) {
var th = this;
-
- var first_leader=t.first_leader;
- if(first_leader){
- //-- user_id代过来免登录 --
- getApp().globalData.first_leader=first_leader;
- //调用接口判断是不是会员
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
- if(res.data.code==0){
- getApp().globalData.guide_id=res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
- }
- })
- }
-
getApp().getConfig2(function (conf) {
if (conf.couponset) conf.couponset = conf.couponset.replace(/\
{
if(res.data.code==0){
getApp().globalData.guide_id=res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/packageB/pages/zuhegou/index/index.js b/packageB/pages/zuhegou/index/index.js
index d91cd25..bff9738 100644
--- a/packageB/pages/zuhegou/index/index.js
+++ b/packageB/pages/zuhegou/index/index.js
@@ -153,39 +153,11 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
},
- //检测有没有导购分享的门店
- check_guide(func){
- var first_leader=getApp().globalData.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
-
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
-
-
/**
* 生命周期函数--监听页面显示
*/
@@ -287,61 +259,59 @@ Page({
})
})
- th.check_guide(()=>{
- //获取用户的默认门店
- getApp().get_user_store(function (e) {
- if (!e) {
- th.data.fir_def_store = {}; //赋值空对象
- return false;
- }
- if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
-
- var ee = JSON.parse(JSON.stringify(e));
- var appd = getApp().globalData;
- //-- 等待定位系统的开启 --
- th.waitfor2(15, 'is_get_local_ok', function () {
+ //获取用户的默认门店
+ getApp().get_user_store(function (e) {
+ if (!e) {
+ th.data.fir_def_store = {}; //赋值空对象
+ return false;
+ }
+ if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
- if (!th.data.is_get_local_ok) return false;
+ var ee = JSON.parse(JSON.stringify(e));
+ var appd = getApp().globalData;
+ //-- 等待定位系统的开启 --
+ th.waitfor2(15, 'is_get_local_ok', function () {
- var e = JSON.parse(JSON.stringify(ee));
- //如果有开启近距离的话,同时距离优不一样了
- if (that.data.lat != null) {
- //如果经纬度有变化的话
- if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
- that.set_def_storage(e);
- } else {
- //要用接口是获取距离,js的计算不准
- getApp().request.promiseGet("/api/weshop/pickup/list", {
- data: {
- store_id: os.stoid,
- pickup_id: e.pickup_id,
- is_pos: 1,
- lat: th.data.lat,
- lon: th.data.lon
- },
- }).then(res => {
- if (res.data.code == 0) {
- e = res.data.data.pageData[0];
- if (e) {
- e.is_no_dis = ee.is_no_dis;
- appd.pk_store = e;
- that.set_def_storage(e);
- }
+ if (!th.data.is_get_local_ok) return false;
- }
- })
- }
- appd.lat = that.data.lat;
- appd.lon = that.data.lon;
+ var e = JSON.parse(JSON.stringify(ee));
+ //如果有开启近距离的话,同时距离优不一样了
+ if (that.data.lat != null) {
+ //如果经纬度有变化的话
+ if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
+ that.set_def_storage(e);
} else {
- if (e) {
- e.distance = null;
- that.set_def_storage(e);
- }
+ //要用接口是获取距离,js的计算不准
+ getApp().request.promiseGet("/api/weshop/pickup/list", {
+ data: {
+ store_id: os.stoid,
+ pickup_id: e.pickup_id,
+ is_pos: 1,
+ lat: th.data.lat,
+ lon: th.data.lon
+ },
+ }).then(res => {
+ if (res.data.code == 0) {
+ e = res.data.data.pageData[0];
+ if (e) {
+ e.is_no_dis = ee.is_no_dis;
+ appd.pk_store = e;
+ that.set_def_storage(e);
+ }
+
+ }
+ })
}
- })
- });
- })
+ appd.lat = that.data.lat;
+ appd.lon = that.data.lon;
+ } else {
+ if (e) {
+ e.distance = null;
+ that.set_def_storage(e);
+ }
+ }
+ })
+ });
//----获取系统参数-----
getApp().getConfig2(function (e) {
diff --git a/packageB/pages/zuhegou/list/list.js b/packageB/pages/zuhegou/list/list.js
index efdac38..494267c 100644
--- a/packageB/pages/zuhegou/list/list.js
+++ b/packageB/pages/zuhegou/list/list.js
@@ -36,7 +36,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/packageB/pages/zuhegou/preindex/index.js b/packageB/pages/zuhegou/preindex/index.js
index a0731d3..fa0b9da 100644
--- a/packageB/pages/zuhegou/preindex/index.js
+++ b/packageB/pages/zuhegou/preindex/index.js
@@ -150,39 +150,11 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
},
-
- //检测有没有导购分享的门店
- check_guide(func){
- var first_leader=getApp().globalData.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
-
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
-
/**
* 生命周期函数--监听页面显示
*/
@@ -281,63 +253,60 @@ Page({
})
})
- //先获取一下导购的门店
- th.check_guide(()=> {
- //获取用户的默认门店
- getApp().get_user_store(function (e) {
- if (!e) {
- th.data.fir_def_store = {}; //赋值空对象
- return false;
- }
-
- if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
+ //获取用户的默认门店
+ getApp().get_user_store(function (e) {
+ if (!e) {
+ th.data.fir_def_store = {}; //赋值空对象
+ return false;
+ }
- var ee = JSON.parse(JSON.stringify(e));
- var appd = getApp().globalData;
- //-- 等待定位系统的开启 --
- th.waitfor2(15, 'is_get_local_ok', function () {
+ if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
- if (!th.data.is_get_local_ok) return false;
+ var ee = JSON.parse(JSON.stringify(e));
+ var appd = getApp().globalData;
+ //-- 等待定位系统的开启 --
+ th.waitfor2(15, 'is_get_local_ok', function () {
- var e = JSON.parse(JSON.stringify(ee));
- //如果有开启近距离的话,同时距离优不一样了
- if (that.data.lat != null) {
- //如果经纬度有变化的话
- if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
- that.set_def_storage(e);
- } else {
- //要用接口是获取距离,js的计算不准
- getApp().request.promiseGet("/api/weshop/pickup/list", {
- data: {
- store_id: os.stoid,
- pickup_id: e.pickup_id,
- is_pos: 1,
- lat: th.data.lat,
- lon: th.data.lon
- },
- }).then(res => {
- if (res.data.code == 0) {
- e = res.data.data.pageData[0];
- if (e) {
- e.is_no_dis = ee.is_no_dis;
- appd.pk_store = e;
- that.set_def_storage(e);
- }
+ if (!th.data.is_get_local_ok) return false;
- }
- })
- }
- appd.lat = that.data.lat;
- appd.lon = that.data.lon;
+ var e = JSON.parse(JSON.stringify(ee));
+ //如果有开启近距离的话,同时距离优不一样了
+ if (that.data.lat != null) {
+ //如果经纬度有变化的话
+ if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
+ that.set_def_storage(e);
} else {
- if (e) {
- e.distance = null;
- that.set_def_storage(e);
- }
+ //要用接口是获取距离,js的计算不准
+ getApp().request.promiseGet("/api/weshop/pickup/list", {
+ data: {
+ store_id: os.stoid,
+ pickup_id: e.pickup_id,
+ is_pos: 1,
+ lat: th.data.lat,
+ lon: th.data.lon
+ },
+ }).then(res => {
+ if (res.data.code == 0) {
+ e = res.data.data.pageData[0];
+ if (e) {
+ e.is_no_dis = ee.is_no_dis;
+ appd.pk_store = e;
+ that.set_def_storage(e);
+ }
+
+ }
+ })
}
- })
- });
- })
+ appd.lat = that.data.lat;
+ appd.lon = that.data.lon;
+ } else {
+ if (e) {
+ e.distance = null;
+ that.set_def_storage(e);
+ }
+ }
+ })
+ });
//----获取系统参数-----
getApp().getConfig2(function (e) {
diff --git a/packageC/pages/goods/goodsList/goodsList.js b/packageC/pages/goods/goodsList/goodsList.js
index e7dbf14..76b6de1 100644
--- a/packageC/pages/goods/goodsList/goodsList.js
+++ b/packageC/pages/goods/goodsList/goodsList.js
@@ -38,7 +38,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/packageC/pages/goods/search/search.js b/packageC/pages/goods/search/search.js
index 21160ec..f843a16 100644
--- a/packageC/pages/goods/search/search.js
+++ b/packageC/pages/goods/search/search.js
@@ -46,7 +46,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/packageC/pages/group_list/group_list.js b/packageC/pages/group_list/group_list.js
index 7ee5141..c68e601 100644
--- a/packageC/pages/group_list/group_list.js
+++ b/packageC/pages/group_list/group_list.js
@@ -26,6 +26,7 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
+<<<<<<< HEAD
self = this;
//群id
@@ -45,6 +46,9 @@ Page({
}
})
}
+=======
+ self = this;
+>>>>>>> parent of 0a8ba509... 分享的时候,要取导购的门店的优化
app.isLogin().then(function(data) {//进入页面前已经授权登录成功
self.setData({
@@ -171,6 +175,7 @@ Page({
/**
* 用户点击右上角分享
*/
+<<<<<<< HEAD
onShareAppMessage: function () {
getApp().globalData.no_clear=1;
var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:'';
@@ -231,6 +236,9 @@ Page({
},
+=======
+ onShareAppMessage: function () { getApp().globalData.no_clear=1; },
+>>>>>>> parent of 0a8ba509... 分享的时候,要取导购的门店的优化
/**
diff --git a/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js b/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
index c90b7be..f83be64 100644
--- a/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
+++ b/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js
@@ -23,12 +23,11 @@ Page({
if(first_leader) {
app.globalData.first_leader = first_leader;
//调用接口判断是不是会员
- app.request.promiseGet("/api/weshop/shoppingGuide/get/" + app.globalData.setting.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
- }
- })
+ // app.request.promiseGet("/api/weshop/shoppingGuide/get/" + app.globalData.setting.stoid + "/" + first_leader, {}).then(res => {
+ // if (res.data.code == 0) {
+ // getApp().globalData.guide_id = res.data.data.id;
+ // }
+ // })
};
app.isLogin().then(function(data) {
diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
index a8f25c2..d2663e5 100644
--- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
+++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
@@ -283,8 +283,7 @@ Page({
canBuy: false,
btnHidden: false,
- hiddenCS: true,
- is_get_guide:0,
+ hiddenCS: true,
},
//------初始化加载----------
@@ -310,8 +309,6 @@ Page({
prom_type = t.prom_type,
prom_id = t.group_id; //活动ID
- var share_openid = t.share_openid;
-
if (prom_type) {
// this.data.prom_type = prom_type;
// this.data.prom_id = prom_id;
@@ -400,7 +397,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
@@ -412,10 +408,6 @@ Page({
//如果是会员分享过来的要记录
if (room_user_share)
getApp().globalData.room_user_share = room_user_share;
-
- if (share_openid) {
- this.get_room_share_guide(share_openid);
- }
}
var c_guide_id = t.c_guide_id;
@@ -514,7 +506,64 @@ Page({
}
});
+ //获取用户的默认门店
+ getApp().get_user_store(function (e) {
+ if (!e) {
+ th.data.fir_def_store = {}; //赋值空对象
+ return false;
+ }
+
+ if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
+ var ee = JSON.parse(JSON.stringify(e));
+ //--定时器推迟一下--
+ setTimeout(function () {
+ if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
+ //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
+ if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
+ ee.is_no_dis = 1;
+ }
+
+ var appd = getApp().globalData;
+ var w_time = setInterval(function () {
+ if (that.data.is_get_local_ok == 0) return false;
+ clearInterval(w_time);
+ var distance = null;
+ var e = JSON.parse(JSON.stringify(ee));
+
+ //如果有开启近距离的话,同时距离优不一样了
+ if (that.data.lat != null) {
+ //如果经纬度有变化的话
+ if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
+ that.set_def_storage(e);
+ } else {
+ //要用接口是获取距离,js的计算不准
+ getApp().request.promiseGet("/api/weshop/pickup/list", {
+ data: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon, is_pos: 1 },
+ }).then(res => {
+ if (res.data.code == 0) {
+ e = res.data.data.pageData[0];
+ if (e) {
+ e.is_no_dis = ee.is_no_dis;
+ appd.pk_store = e;
+ that.set_def_storage(e);
+ }
+
+ }
+ })
+ }
+ //e.distance = distance;
+ appd.lat = that.data.lat;
+ appd.lon = that.data.lon;
+ } else {
+ if (e) {
+ e.distance = null;
+ that.set_def_storage(e);
+ }
+ }
+ }, 500)
+ }, 700)
+ });
//更新点击量
//noinspection JSUnresolvedFunction
@@ -536,39 +585,6 @@ Page({
}
},
- //-- 获取直播的分享人的导购信息 --
- async get_room_share_guide(share_openid) {
-
- var url = "/api/weshop/users/page";
- var first_leader = 0;
-
- //调用接口判断是不是会员
- await getApp().request.promiseGet(url, {
- data: {
- stoid: os.stoid,
- weapp_openid: share_openid
- }
- }).then(res => {
- if (ut.ajax_ok(res)) {
- first_leader = res.data.data.pageData[0].user_id;
- getApp().globalData.guide_id = res.data.data.id;
- }
- })
-
- if (!first_leader) return false;
-
- getApp().globalData.first_leader = first_leader;
-
- //调用接口判断是不是会员
- await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
- }
- })
-
- },
-
//--- 设置一下默认库存的数量 ----
set_def_storage(ee) {
@@ -789,6 +805,15 @@ Page({
})
+
+
+
+
+
+
+
+
+
ee.setData({
gallery: gallery,
is_collect: is_collect,
@@ -802,99 +827,10 @@ Page({
},
- //检测有没有导购分享的门店
- check_guide(func){
- var first_leader=getApp().globalData.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
-
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
-
-
- get_user_sto(){
- var th=this;var that=this;
- //获取用户的默认门店
- getApp().get_user_store(function (e) {
- if (!e) {
- th.data.fir_def_store = {}; //赋值空对象
- return false;
- }
-
- if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
- var ee = JSON.parse(JSON.stringify(e));
- //--定时器推迟一下--
- setTimeout(function () {
- if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
- //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
- if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
- ee.is_no_dis = 1;
- }
-
- var appd = getApp().globalData;
- var w_time = setInterval(function () {
- if (that.data.is_get_local_ok == 0) return false;
- clearInterval(w_time);
- var distance = null;
- var e = JSON.parse(JSON.stringify(ee));
-
- //如果有开启近距离的话,同时距离优不一样了
- if (that.data.lat != null) {
- //如果经纬度有变化的话
- if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
- that.set_def_storage(e);
- } else {
- //要用接口是获取距离,js的计算不准
- getApp().request.promiseGet("/api/weshop/pickup/list", {
- data: { store_id: os.stoid, pickup_id: e.pickup_id, lat: th.data.lat, lon: th.data.lon, is_pos: 1 },
- }).then(res => {
- if (res.data.code == 0) {
- e = res.data.data.pageData[0];
- if (e) {
- e.is_no_dis = ee.is_no_dis;
- appd.pk_store = e;
- that.set_def_storage(e);
- }
-
- }
- })
- }
- //e.distance = distance;
- appd.lat = that.data.lat;
- appd.lon = that.data.lon;
-
- } else {
- if (e) {
- e.distance = null;
- that.set_def_storage(e);
- }
- }
- }, 500)
- }, 700)
- });
- },
-
//---展示---
onShow: async function () {
- getApp().check_can_share();
+ getApp().check_can_share();
// console.log('onshow');
var goods_list = null, th = this, that = this;
var show_prew_img = this.data.show_prew_img
@@ -903,16 +839,6 @@ Page({
return false;
}
- if (this.data.show_video) {
- this.data.show_video = 0;
- return false;
- }
-
- //先获取一下导购的门店
- th.check_guide(()=> {
- th.get_user_sto();
- })
-
// 判断活动是否暂停
//获取单个活动成团信息
await getApp().request.promiseGet('/api/weshop/prom/luckyActivity/page', {
@@ -5547,16 +5473,6 @@ Page({
// 选择门店
choice_store: function (ee) {
-
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
var th = this;
var ind = ee.currentTarget.dataset.ind;
var bconfig = th.data.bconfig;
@@ -6266,14 +6182,6 @@ Page({
getApp().pre_img(this.data.sele_g.original_img);
},
- screenChange: function (e) {
- let fullScreen = e.detail.fullScreen //值true为进入全屏,false为退出全屏
- if (fullScreen) { //退出全屏
- getApp().globalData.no_clear = 1;
- this.data.show_video = 1;
- }
- },
-
is_show_more_buy: function () {
var prom_goods = this.data.prom_goods;
var per_price = this.data.sele_g.shop_price
diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
index 196893a..5dbbfe7 100644
--- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
+++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml
@@ -47,7 +47,7 @@
-
+
diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js
index 4378e30..ca083a1 100644
--- a/packageC/pages/presell/goodsInfo/goodsInfo.js
+++ b/packageC/pages/presell/goodsInfo/goodsInfo.js
@@ -267,9 +267,6 @@ Page({
first_leader = t.first_leader,
room_id = t.room_id,
room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
-
- var share_openid = t.share_openid;
-
//检查测肤
getApp().check_skin_face(t, 0, gid);
//群id
@@ -335,7 +332,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
@@ -347,11 +343,6 @@ Page({
//如果是会员分享过来的要记录
if (room_user_share)
getApp().globalData.room_user_share = room_user_share;
-
- if (share_openid) {
- this.get_room_share_guide(share_openid);
- }
-
}
var c_guide_id = t.c_guide_id;
@@ -452,38 +443,6 @@ Page({
})
},
- async get_room_share_guide(share_openid) {
-
- var url = "/api/weshop/users/page";
- var first_leader = 0;
-
- //调用接口判断是不是会员
- await getApp().request.promiseGet(url, {
- data: {
- stoid: os.stoid,
- weapp_openid: share_openid
- }
- }).then(res => {
- if (ut.ajax_ok(res)) {
- first_leader = res.data.data.pageData[0].user_id;
- getApp().globalData.guide_id = res.data.data.id;
- }
- })
-
- if (!first_leader) return false;
-
- getApp().globalData.first_leader = first_leader;
-
- //调用接口判断是不是会员
- await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
- }
- })
-
- },
-
//--- 设置一下默认库存的数量 ----
set_def_storage(ee) {
var that = this, th = this;
@@ -668,32 +627,6 @@ Page({
},
- //检验导购门店
- check_guide(func){
- var first_leader=getApp().globalData.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
-
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
-
//---展示---
onShow: function () {
getApp().check_can_share();
@@ -774,70 +707,68 @@ Page({
ee.data.sele_g_id = t.data.data.goods_id;
ee.data.sele_g = t.data.data;
- //检测一下分享导购的门店
- ee.check_guide(() => {
- //获取用户的默认门店
- getApp().get_user_store(function (e) {
- if (!e) {
- th.data.fir_def_store = {}; //赋值空对象
- return false;
- }
- if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
+ //获取用户的默认门店
+ getApp().get_user_store(function (e) {
+ if (!e) {
+ th.data.fir_def_store = {}; //赋值空对象
+ return false;
+ }
+ if (getApp().globalData.is_dj_pk) th.setData({ has_def: 1 })
- var ee = JSON.parse(JSON.stringify(e));
+ var ee = JSON.parse(JSON.stringify(e));
- if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
- //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
- if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
- ee.is_no_dis = 1;
- }
+ if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
+ //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
+ if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
+ ee.is_no_dis = 1;
+ }
- var appd = getApp().globalData;
- var w_time = setInterval(function () {
- if (that.data.is_get_local_ok == 0) return false;
- clearInterval(w_time);
- var e = JSON.parse(JSON.stringify(ee));
+ var appd = getApp().globalData;
+ var w_time = setInterval(function () {
+ if (that.data.is_get_local_ok == 0) return false;
+ clearInterval(w_time);
+ var e = JSON.parse(JSON.stringify(ee));
- //如果有开启近距离的话,同时距离优不一样了
- if (that.data.lat != null) {
- //如果经纬度有变化的话
- if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
- that.set_def_storage(e);
-
- } else {
- //要用接口是获取距离,js的计算不准
- getApp().request.promiseGet("/api/weshop/pickup/list", {
- data: {
- store_id: os.stoid,
- pickup_id: e.pickup_id,
- is_pos: 1,
- lat: th.data.lat,
- lon: th.data.lon
- },
- }).then(res => {
- if (res.data.code == 0) {
- e = res.data.data.pageData[0];
- if (e) {
- e.is_no_dis = ee.is_no_dis;
- appd.pk_store = e;
- that.set_def_storage(e);
- }
+ //如果有开启近距离的话,同时距离优不一样了
+ if (that.data.lat != null) {
+ //如果经纬度有变化的话
+ if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
+ that.set_def_storage(e);
+ } else {
+ //要用接口是获取距离,js的计算不准
+ getApp().request.promiseGet("/api/weshop/pickup/list", {
+ data: {
+ store_id: os.stoid,
+ pickup_id: e.pickup_id,
+ is_pos: 1,
+ lat: th.data.lat,
+ lon: th.data.lon
+ },
+ }).then(res => {
+ if (res.data.code == 0) {
+ e = res.data.data.pageData[0];
+ if (e) {
+ e.is_no_dis = ee.is_no_dis;
+ appd.pk_store = e;
+ that.set_def_storage(e);
}
- })
- }
- appd.lat = that.data.lat;
- appd.lon = that.data.lon;
- } else {
- if (e) {
- e.distance = null;
- that.set_def_storage(e);
- }
+ }
+ })
}
- }, 500)
- });
- })
+ appd.lat = that.data.lat;
+ appd.lon = that.data.lon;
+
+ } else {
+ if (e) {
+ e.distance = null;
+ that.set_def_storage(e);
+ }
+ }
+ }, 500)
+ });
+
t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
@@ -3633,16 +3564,6 @@ Page({
},
// 选择门店
choice_store: function (ee) {
-
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
var th = this;
var ind = ee.currentTarget.dataset.ind;
var bconfig = th.data.bconfig;
diff --git a/packageC/pages/presell/list/list.js b/packageC/pages/presell/list/list.js
index 70fdceb..1924c4f 100644
--- a/packageC/pages/presell/list/list.js
+++ b/packageC/pages/presell/list/list.js
@@ -30,7 +30,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js
index 109d39e..f2978e8 100644
--- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js
+++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js
@@ -263,7 +263,6 @@ Page({
room_id = t.room_id,
room_user_share = t.room_user_share; //如果是会员分享带有room_id的话,那么接下来会员分享就不传room_id
- var share_openid = t.share_openid;
//-- 自定义海报 --
getApp().request.promiseGet("/api/weshop/goods/poster/page", {
data: { store_id: os.stoid, type: 1, is_use: 1 }
@@ -317,14 +316,11 @@ Page({
if (first_leader) {
console.log("log---".first_leader);
getApp().globalData.first_leader = first_leader;
-
//调用接口判断是不是会员
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
-
})
}
@@ -335,10 +331,6 @@ Page({
//如果是会员分享过来的要记录
if (room_user_share)
getApp().globalData.room_user_share = room_user_share;
-
- if (share_openid) {
- this.get_room_share_guide(share_openid);
- }
}
var c_guide_id = t.c_guide_id;
@@ -437,38 +429,6 @@ Page({
})
},
- async get_room_share_guide(share_openid) {
-
- var url = "/api/weshop/users/page";
- var first_leader = 0;
-
- //调用接口判断是不是会员
- await getApp().request.promiseGet(url, {
- data: {
- stoid: os.stoid,
- weapp_openid: share_openid
- }
- }).then(res => {
- if (ut.ajax_ok(res)) {
- first_leader = res.data.data.pageData[0].user_id;
- getApp().globalData.guide_id = res.data.data.id;
- }
- })
-
- if (!first_leader) return false;
-
- getApp().globalData.first_leader = first_leader;
-
- //调用接口判断是不是会员
- await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
- }
- })
-
- },
-
//--- 设置一下默认库存的数量 ----
set_def_storage(ee) {
@@ -646,30 +606,6 @@ Page({
},
- check_guide(func){
- var first_leader=getApp().globalData.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
-
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
//---展示---
onShow: function () {
@@ -751,71 +687,70 @@ Page({
ee.data.sele_g_id=t.data.data.goods_id;
ee.data.sele_g=t.data.data;
- //检测一下分享导购的门店
- ee.check_guide(() => {
- //获取用户的默认门店
- getApp().get_user_store(function (e) {
- if (!e) {
- th.data.fir_def_store = {}; //赋值空对象
- return false;
- }
+ //获取用户的默认门店
+ getApp().get_user_store(function (e) {
+ if (!e) {
+ th.data.fir_def_store = {}; //赋值空对象
+ return false;
+ }
- if (getApp().globalData.is_dj_pk) th.setData({has_def: 1})
+ if(getApp().globalData.is_dj_pk) th.setData({has_def:1})
- var ee = JSON.parse(JSON.stringify(e));
+ var ee = JSON.parse(JSON.stringify(e));
- if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
- //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
- if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
- ee.is_no_dis = 1;
- }
+ if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
+ //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
+ if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
+ ee.is_no_dis = 1;
+ }
- var appd = getApp().globalData;
- var w_time = setInterval(function () {
- if (that.data.is_get_local_ok == 0) return false;
- clearInterval(w_time);
- var e = JSON.parse(JSON.stringify(ee));
-
- //如果有开启近距离的话,同时距离优不一样了
- if (that.data.lat != null) {
- //如果经纬度有变化的话
- if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
- that.set_def_storage(e);
-
- } else {
- //要用接口是获取距离,js的计算不准
- getApp().request.promiseGet("/api/weshop/pickup/list", {
- data: {
- store_id: os.stoid,
- pickup_id: e.pickup_id,
- is_pos: 1,
- lat: th.data.lat,
- lon: th.data.lon
- },
- }).then(res => {
- if (res.data.code == 0) {
- e = res.data.data.pageData[0];
- if (e) {
- e.is_no_dis = ee.is_no_dis;
- appd.pk_store = e;
- that.set_def_storage(e);
- }
+ var appd = getApp().globalData;
+ var w_time = setInterval(function () {
+ if (that.data.is_get_local_ok == 0) return false;
+ clearInterval(w_time);
+ var e = JSON.parse(JSON.stringify(ee));
- }
- })
- }
- appd.lat = that.data.lat;
- appd.lon = that.data.lon;
+ //如果有开启近距离的话,同时距离优不一样了
+ if (that.data.lat != null) {
+ //如果经纬度有变化的话
+ if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
+ that.set_def_storage(e);
} else {
- if (e) {
- e.distance = null;
- that.set_def_storage(e);
- }
+ //要用接口是获取距离,js的计算不准
+ getApp().request.promiseGet("/api/weshop/pickup/list", {
+ data: {
+ store_id: os.stoid,
+ pickup_id: e.pickup_id,
+ is_pos: 1,
+ lat: th.data.lat,
+ lon: th.data.lon
+ },
+ }).then(res => {
+ if (res.data.code == 0) {
+ e = res.data.data.pageData[0];
+ if (e) {
+ e.is_no_dis = ee.is_no_dis;
+ appd.pk_store = e;
+ that.set_def_storage(e);
+ }
+
+ }
+ })
}
- }, 500)
- });
- })
+ appd.lat = that.data.lat;
+ appd.lon = that.data.lon;
+
+ } else {
+ if (e) {
+ e.distance = null;
+ that.set_def_storage(e);
+ }
+ }
+ }, 500)
+ });
+
+
t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss');
@@ -3273,16 +3208,6 @@ Page({
},
// 选择门店
choice_store: function (ee) {
-
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
var th = this;
var ind = ee.currentTarget.dataset.ind;
var bconfig = th.data.bconfig;
diff --git a/packageD/pages/AI-test-skin/success_result/success_result.js b/packageD/pages/AI-test-skin/success_result/success_result.js
index 6ab6db3..4d839e4 100644
--- a/packageD/pages/AI-test-skin/success_result/success_result.js
+++ b/packageD/pages/AI-test-skin/success_result/success_result.js
@@ -107,7 +107,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + setting.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/packageE/pages/togoin/togoin.js b/packageE/pages/togoin/togoin.js
index ce5910b..f9999dd 100644
--- a/packageE/pages/togoin/togoin.js
+++ b/packageE/pages/togoin/togoin.js
@@ -134,7 +134,6 @@ Page({
app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
@@ -298,7 +297,6 @@ Page({
app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
@@ -369,7 +367,6 @@ Page({
app.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + e.data.data.user_id, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
diff --git a/pages/activity/pind_list/pind_list.js b/pages/activity/pind_list/pind_list.js
index 257f307..569d88f 100644
--- a/pages/activity/pind_list/pind_list.js
+++ b/pages/activity/pind_list/pind_list.js
@@ -50,7 +50,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js
index fecefef..155c310 100644
--- a/pages/activity/seckill_list/seckill_list.js
+++ b/pages/activity/seckill_list/seckill_list.js
@@ -58,7 +58,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
@@ -250,7 +249,7 @@ Page({
//---------分享配置--------
onShareAppMessage: function (e) {
- getApp().globalData.no_clear=1;
+ getApp().globalData.no_clear=1;
var curPage = this;
var pagePath = curPage.route; //当前页面url
if (pagePath.indexOf('/') != 0) {
diff --git a/pages/giftpack/buygiftpack/giftpackbuy.js b/pages/giftpack/buygiftpack/giftpackbuy.js
index ae13af1..040bc72 100644
--- a/pages/giftpack/buygiftpack/giftpackbuy.js
+++ b/pages/giftpack/buygiftpack/giftpackbuy.js
@@ -64,9 +64,7 @@ Page({
default_store: {}, //创建添加默认门店地址的对象
store:0,
- openSpecModal:0,
-
- is_get_guide:0,
+ openSpecModal:0
},
onLoad: function (options) {
@@ -98,8 +96,6 @@ Page({
//-- 获取分享人的ID --
var first_leader = options.first_leader || getApp().globalData.first_leader;
if (first_leader) {
-
- this.data.is_get_guide=1;
this.setData({
first_leader,
})
@@ -108,16 +104,10 @@ Page({
//调用接口判断是不是会员
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
- getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
+ getApp().globalData.guide_id = res.data.data.id;
}
-
- com.wait_for_store_config(th);
- com.set_user_mo_store(th,os);
-
})
}
-
getApp().request.promiseGet("/api/weshop/ad/page?pid=902&store_id=" + os.stoid, {
data: {
enabled: 1
@@ -148,12 +138,8 @@ Page({
getApp().goto('/packageE/pages/togoin/togoin');
return false;
}
-
- if(!th.data.is_get_guide) {
- com.wait_for_store_config(th);
- com.set_user_mo_store(th, os);
- }
- th.data.is_get_guide=0;
+ com.wait_for_store_config(th);
+ com.set_user_mo_store(th,os);
})
this.init();
@@ -382,15 +368,6 @@ Page({
},
// 选择门店
choice_store: function (ee) {
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
var th = this;
var ind = ee.currentTarget.dataset.ind;
var bconfig = th.data.bconfig;
diff --git a/pages/giftpack/giftpacklist/giftpacklist.js b/pages/giftpack/giftpacklist/giftpacklist.js
index 4338b56..53ac4f3 100644
--- a/pages/giftpack/giftpacklist/giftpacklist.js
+++ b/pages/giftpack/giftpacklist/giftpacklist.js
@@ -144,7 +144,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
@@ -339,31 +338,6 @@ Page({
});
},
-
- check_guide(func){
- var first_leader=this.data.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
-
GetBuyGiftList: function () {
var _this2 = this;
var th = this.data;
@@ -419,16 +393,14 @@ Page({
//需不需要门店,不需要门店返回
if (!sele_g.is_pickup) return false;
- //-- 检测一下有没有门店 --
- _this2.check_guide(function (){
- com.wait_for_store_config(_this2);
- com.set_user_mo_store(_this2, os, function () {
- if (sele_g.pickup_list && _this2.data.def_pick_store) {
- com.check_def_pk(_this2);
- }
- });
- com.get_sto(_this2, os);
- })
+ com.wait_for_store_config(_this2);
+ com.set_user_mo_store(_this2, os, function () {
+ if (sele_g.pickup_list && _this2.data.def_pick_store) {
+ com.check_def_pk(_this2);
+ }
+ });
+ com.get_sto(_this2, os);
+
} else {
getApp().my_warnning(res.data.msg, 0, _this2);
@@ -681,16 +653,6 @@ Page({
},
// 选择门店
choice_store: function (ee) {
-
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
var th = this;
var ind = ee.currentTarget.dataset.ind;
var bconfig = th.data.bconfig;
diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js
index 3ff1ea1..1b080ea 100644
--- a/pages/giftpack/mygiftpack/mygiftpack.js
+++ b/pages/giftpack/mygiftpack/mygiftpack.js
@@ -55,7 +55,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js
index 0ce8086..0f144a8 100644
--- a/pages/goods/goodsInfo/goodsInfo.js
+++ b/pages/goods/goodsInfo/goodsInfo.js
@@ -382,14 +382,11 @@ Page({
if (first_leader) {
console.log("gd onload--3");
console.log("log---" + first_leader);
-
getApp().globalData.first_leader = first_leader;
//调用接口判断是不是会员
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
-
}
})
@@ -500,6 +497,74 @@ Page({
}
});
+ //获取用户的默认门店
+ getApp().get_user_store(function (e) {
+ if (!e) {
+ th.data.fir_def_store = {}; //赋值空对象
+ return false;
+ }
+ if (getApp().globalData.is_dj_pk) th.setData({
+ has_def: 1
+ });
+
+ var ee = JSON.parse(JSON.stringify(e));
+ //--定时器推迟一下--
+ setTimeout(function () {
+ if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
+ //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
+ if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
+ ee.is_no_dis = 1;
+ }
+
+ var appd = getApp().globalData;
+ var w_time = setInterval(function () {
+ if (that.data.is_get_local_ok == 0) return false;
+ clearInterval(w_time);
+ var distance = null;
+ var e = JSON.parse(JSON.stringify(ee));
+
+ //如果有开启近距离的话,同时距离优不一样了
+ if (that.data.lat != null) {
+ //如果经纬度有变化的话
+ if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
+ that.set_def_storage(e);
+ } else {
+ //要用接口是获取距离,js的计算不准
+ getApp().request.promiseGet("/api/weshop/pickup/list", {
+ data: {
+ store_id: os.stoid,
+ pickup_id: e.pickup_id,
+ lat: th.data.lat,
+ lon: th.data.lon,
+ isstop: 0,
+ is_pos: 1
+ },
+ }).then(res => {
+ if (res.data.code == 0) {
+ e = res.data.data.pageData[0];
+ if (e) {
+ e.is_no_dis = ee.is_no_dis;
+ appd.pk_store = e;
+ that.set_def_storage(e);
+ }
+
+ }
+ })
+ }
+ //e.distance = distance;
+ appd.lat = that.data.lat;
+ appd.lon = that.data.lon;
+
+ } else {
+ if (e) {
+ e.distance = null;
+ that.set_def_storage(e);
+ }
+ }
+ }, 500)
+ }, 700)
+ });
+
//更新点击量
//noinspection JSUnresolvedFunction
getApp().request.put("/api/weshop/goods/updateClick", {
@@ -540,7 +605,6 @@ Page({
await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
@@ -798,102 +862,6 @@ Page({
},
- check_guide(func){
- var first_leader=getApp().globalData.first_leader;
- if(!first_leader){
- func();
- return false;
- }
- if(this.data.is_geted_guide_pick){
- func();
- return false;
- }
-
- if(getApp().globalData.guide_pick_id){
- func();
- return false;
- }
- var th=this;
- getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
- if (res.data.code == 0) {
- getApp().globalData.guide_pick_id= res.data.data.pickup_id;
- }
- th.data.is_geted_guide_pick=1;
- func();
- })
- },
-
- get_user_store(){
- var th=this; var that=this;
- //--获取用户的默认门店
- getApp().get_user_store(function (e) {
- if (!e) {
- th.data.fir_def_store = {}; //赋值空对象
- return false;
- }
- if (getApp().globalData.is_dj_pk) th.setData({
- has_def: 1
- });
-
- var ee = JSON.parse(JSON.stringify(e));
- //--定时器推迟一下--
- setTimeout(function () {
- if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type;
- //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对--
- if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) {
- ee.is_no_dis = 1;
- }
-
- var appd = getApp().globalData;
- var w_time = setInterval(function () {
- if (that.data.is_get_local_ok == 0) return false;
- clearInterval(w_time);
- var distance = null;
- var e = JSON.parse(JSON.stringify(ee));
-
- //如果有开启近距离的话,同时距离优不一样了
- if (that.data.lat != null) {
- //如果经纬度有变化的话
- if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) {
- that.set_def_storage(e);
- } else {
- //要用接口是获取距离,js的计算不准
- getApp().request.promiseGet("/api/weshop/pickup/list", {
- data: {
- store_id: os.stoid,
- pickup_id: e.pickup_id,
- lat: th.data.lat,
- lon: th.data.lon,
- isstop: 0,
- is_pos: 1
- },
- }).then(res => {
- if (res.data.code == 0) {
- e = res.data.data.pageData[0];
- if (e) {
- e.is_no_dis = ee.is_no_dis;
- appd.pk_store = e;
- that.set_def_storage(e);
- }
-
- }
- })
- }
- //e.distance = distance;
- appd.lat = that.data.lat;
- appd.lon = that.data.lon;
-
- } else {
- if (e) {
- e.distance = null;
- that.set_def_storage(e);
- }
- }
- }, 500)
- }, 700)
- });
- },
-
//---展示---
onShow: function () {
@@ -913,11 +881,6 @@ Page({
return false;
}
- //先获取一下导购的门店
- th.check_guide(()=>{
- th.get_user_store();
- })
-
//优惠券要实时更新
getApp().getConfig2(function (e) {
var json_d = JSON.parse(e.switch_list);
@@ -1196,9 +1159,6 @@ Page({
-
-
-
},
onReady() {
@@ -6652,15 +6612,6 @@ Page({
var ind = ee.currentTarget.dataset.ind;
var bconfig = th.data.bconfig;
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
-
//如果开启了,则不在选择门店
if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js
index dbe1a0e..dc63abb 100644
--- a/pages/goods/goodsList/goodsList.js
+++ b/pages/goods/goodsList/goodsList.js
@@ -55,7 +55,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
if(res.data.code==0){
getApp().globalData.guide_id=res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
if(!getApp().globalData.user_id){
diff --git a/pages/goods/search/search.js b/pages/goods/search/search.js
index 4edb05c..1cac2a1 100644
--- a/pages/goods/search/search.js
+++ b/pages/goods/search/search.js
@@ -80,7 +80,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/pages/index/index/index.js b/pages/index/index/index.js
index 80be721..1cc2631 100644
--- a/pages/index/index/index.js
+++ b/pages/index/index/index.js
@@ -196,7 +196,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
@@ -270,17 +269,18 @@ Page({
}).then(res => {
if (ut.ajax_ok(res)) {
first_leader=res.data.data.pageData[0].user_id;
- // getApp().globalData.guide_id = res.data.data.id;
+ getApp().globalData.guide_id = res.data.data.id;
}
})
+
if(!first_leader) return false;
getApp().globalData.first_leader = first_leader;
+
//调用接口判断是不是会员
await getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
diff --git a/pages/team/team_show/team_show.js b/pages/team/team_show/team_show.js
index 52d85ec..e817ea0 100644
--- a/pages/team/team_show/team_show.js
+++ b/pages/team/team_show/team_show.js
@@ -126,7 +126,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+os.stoid+"/"+first_leader,{}).then(res=>{
if(res.data.code==0){
getApp().globalData.guide_id=res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
@@ -608,7 +607,7 @@ Page({
});
//-- 获取用户的默认门店 --
- getApp().get_user_store(function(ee) {
+ getApp().get_user_store(function(ee) {
if(!ee) {
th.data.fir_def_store={}; //赋值空对象
return false;
@@ -625,14 +624,14 @@ Page({
//return false;
ee.is_no_dis=1;
}
-
+
var appd=getApp().globalData;
var w_time = setInterval(function() {
if (that.data.is_get_local_ok == 0) return false;
clearInterval(w_time);
var distance = null;
var e=JSON.parse(JSON.stringify(ee));
-
+
//如果有开启近距离的话,同时距离优不一样了
if (that.data.lat != null) {
//如果经纬度有变化的话
@@ -661,15 +660,15 @@ Page({
sto_sele_distr: e.distr_type
})
}
-
+
}
})
}
-
+
//e.distance = distance;
appd.lat=that.data.lat;
appd.lon=that.data.lon;
-
+
}else{
if (e) {
e.distance = null;
@@ -682,11 +681,11 @@ Page({
})
}
}
-
+
}, 500)
- },1000)
+ },1000)
});
-
+
//获取下redis长度,如果团已经弄完,或者拼单已经卖完
//设置值
ee.setData({
@@ -1009,15 +1008,6 @@ Page({
//-- 选择门店。此时的门店选择与门店有关系 --
choice_store: function(ee) {
-
- //--先判断会员状态--
- var user_info = getApp().globalData.userInfo;
- if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
- wx.navigateTo({
- url: '/packageE/pages/togoin/togoin',
- })
- return false;
- }
var th = this;
var bconfig = th.data.bconfig;
diff --git a/pages/template/index.js b/pages/template/index.js
index dc190c7..11800b3 100644
--- a/pages/template/index.js
+++ b/pages/template/index.js
@@ -30,7 +30,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}
diff --git a/pages/user/index/index.js b/pages/user/index/index.js
index b7027c5..1603aff 100644
--- a/pages/user/index/index.js
+++ b/pages/user/index/index.js
@@ -95,7 +95,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
diff --git a/pages/user/plus/plus.js b/pages/user/plus/plus.js
index 7a11fcc..455fce3 100644
--- a/pages/user/plus/plus.js
+++ b/pages/user/plus/plus.js
@@ -81,7 +81,6 @@ Page({
getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + fir_leader, {}).then(res => {
if (res.data.code == 0) {
getApp().globalData.guide_id = res.data.data.id;
- getApp().globalData.guide_pick_id= res.data.data.pickup_id
}
})
}