diff --git a/app.js b/app.js index 1d69084..3964fe1 100644 --- a/app.js +++ b/app.js @@ -51,7 +51,7 @@ App({ config: null, //门店参数 config2: null, //门店配置 code: null, - user_id: null,//1564704,// 10153869,// 6453964,//5682094,6520044,6520119 qa 4687 6519901 + user_id: null,//5682094,6520044,6520119 qa 4687 6519901 buy_now: null, picklist: null, //门店列表 wuliuprice: null, //物流价格表 @@ -61,6 +61,7 @@ App({ getu: null, //记录会员信息 sessionKey: null,//记录会员信息 openid: null, //记录会员信息 + to_group: null, //参团传递的数据 wxapp_buy_obj: null, //微信小程序购买的Object pk_store: null, //选择的门店 @@ -69,6 +70,7 @@ App({ windowWidth: 0, //整个窗体的宽度 room_id: null, //直播间分享的房间ID room_goods_id: null, //直播间分享的商品ID + }, auth: o, request: a, @@ -669,7 +671,6 @@ App({ //清空登录时候缓存的值 onHide: function () { - if(!this.globalData.no_clear) { this.globalData.is_test = 0; this.globalData.guide_id = null; //导购清空 @@ -688,7 +689,6 @@ App({ }else{ this.globalData.no_clear=0; } - }, clear_word: function (word) { @@ -828,6 +828,14 @@ App({ } }, + //重复函数,统一调用, + pre_img(path){ + this.globalData.no_clear=1; + wx.previewImage({ + //将图片预览出来 + urls: [path] + }); + }, //b是数组,t是wxml元素返回的 pre_img2(b,t){ @@ -836,48 +844,7 @@ App({ current: b[t.currentTarget.dataset.id], urls: b }); - }, - - con_wx(th){ - var url=th.data.sys_switch.weapp_customertype_url; - var id=th.data.sys_switch.weapp_customertype_appid; - this.globalData.no_clear=1; - wx.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: id, - success(res) {} - }) - }, - - con_Service(){ - var th=this; - var oss= this.globalData.setting; - this.getConfig(function(t) { - if (t.store_tel == undefined) { - th.request.get("/api/weshop/store/get/" + oss.stoid, { - isShowLoading: 1, - data: {}, - success: function(rs) { - th.globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - wx.showToast({ - title: "商家未设置电话", - icon: 'none', - duration: 3000 - }) - return false; - } - th.globalData.no_clear=1; - wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, }) - } - }) - } else { - th.globalData.no_clear=1; - wx.makePhoneCall({ phoneNumber: t.store_tel, }) - } - }); } - }); diff --git a/app.wxss b/app.wxss index 779f442..aa2467b 100644 --- a/app.wxss +++ b/app.wxss @@ -743,17 +743,9 @@ background: #ffe3e2; /* 图标字体(ty) */ @font-face { font-family: 'iconfont'; /* Project id 2054717 */ - src: url('//at.alicdn.com/t/font_2054717_qbvqi1zioy.woff2?t=1646731629521') format('woff2'), - url('//at.alicdn.com/t/font_2054717_qbvqi1zioy.woff?t=1646731629521') format('woff'), - url('//at.alicdn.com/t/font_2054717_qbvqi1zioy.ttf?t=1646731629521') format('truetype'); -} - -.icon-kefu1:before { - content: "\e666"; -} - -.icon-dianhua:before { - content: "\e623"; + src: url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.woff2?t=1645781927179') format('woff2'), + url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.woff?t=1645781927179') format('woff'), + url('//at.alicdn.com/t/font_2054717_o34jrbrtxpk.ttf?t=1645781927179') format('truetype'); } .icon-infofill:before { diff --git a/components/diy_scan/diy_scan.js b/components/diy_scan/diy_scan.js index 8abf39e..5072315 100644 --- a/components/diy_scan/diy_scan.js +++ b/components/diy_scan/diy_scan.js @@ -26,6 +26,7 @@ Component({ //-- 扫描成功之后 -- getScancode:function(){ var _this = this; + getApp().globalData.no_clear=1; //-- 允许从相机和相册扫码 -- wx.scanCode({ success: (res) => { diff --git a/components/diy_service/diy_service.js b/components/diy_service/diy_service.js index adc1c34..7d42364 100644 --- a/components/diy_service/diy_service.js +++ b/components/diy_service/diy_service.js @@ -38,35 +38,16 @@ Component({ //---------联系客服------------ contactService: function() { - getApp().getConfig(function(t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function(rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().my_warnning("商家未设置电话", 0, th); - return false; - } - wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, }) - } - }) - } else { - wx.makePhoneCall({ phoneNumber: t.store_tel, }) - } - }); - }, + getApp().con_Service(); + }, //---------联系微信客服------------ con_weixin:function () { - var url=this.data.sys_switch.weapp_customertype_url; - var id=this.data.sys_switch.weapp_customertype_appid; - wx.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: id, - success(res) {} - }) + getApp().con_wx(this); + }, + + click_contact:function () { + getApp().globalData.no_clear=1; } } }) diff --git a/components/diy_service/diy_service.wxml b/components/diy_service/diy_service.wxml index b35487c..ee3983f 100644 --- a/components/diy_service/diy_service.wxml +++ b/components/diy_service/diy_service.wxml @@ -8,7 +8,7 @@ - 联系客服 联系客服 diff --git a/packageA/pages/distribution/card/card.js b/packageA/pages/distribution/card/card.js index b78cbd1..0a8e23a 100644 --- a/packageA/pages/distribution/card/card.js +++ b/packageA/pages/distribution/card/card.js @@ -92,7 +92,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/distribution/commision/commision.js b/packageA/pages/distribution/commision/commision.js index 210ee15..cbfac7a 100644 --- a/packageA/pages/distribution/commision/commision.js +++ b/packageA/pages/distribution/commision/commision.js @@ -149,7 +149,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/distribution/goods/goods.js b/packageA/pages/distribution/goods/goods.js index f6d3451..ea0a47e 100644 --- a/packageA/pages/distribution/goods/goods.js +++ b/packageA/pages/distribution/goods/goods.js @@ -264,7 +264,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/distribution/myteam/myteam.js b/packageA/pages/distribution/myteam/myteam.js index 582a165..d7690a5 100644 --- a/packageA/pages/distribution/myteam/myteam.js +++ b/packageA/pages/distribution/myteam/myteam.js @@ -157,7 +157,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/distribution/order/order.js b/packageA/pages/distribution/order/order.js index 45b8fd4..1b5c28d 100644 --- a/packageA/pages/distribution/order/order.js +++ b/packageA/pages/distribution/order/order.js @@ -141,7 +141,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/distribution/rank/rank.js b/packageA/pages/distribution/rank/rank.js index dd29d33..fa5e954 100644 --- a/packageA/pages/distribution/rank/rank.js +++ b/packageA/pages/distribution/rank/rank.js @@ -151,7 +151,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/distribution/rookie/rookie.js b/packageA/pages/distribution/rookie/rookie.js index b7defcc..200b6ba 100644 --- a/packageA/pages/distribution/rookie/rookie.js +++ b/packageA/pages/distribution/rookie/rookie.js @@ -112,7 +112,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/distribution/shop/shop.js b/packageA/pages/distribution/shop/shop.js index 20860ff..8a6c936 100644 --- a/packageA/pages/distribution/shop/shop.js +++ b/packageA/pages/distribution/shop/shop.js @@ -316,7 +316,7 @@ Page({ * 用户点击右上角分享 *--点击分享事件--分享我的小店 *--*/ - onShareAppMessage: function (t) { + onShareAppMessage: function (t) { getApp().globalData.no_clear=1; var th = this; var title = "我的小店"; diff --git a/packageA/pages/goodsInfo/buy_flash_normal.wxml b/packageA/pages/goodsInfo/buy_flash_normal.wxml deleted file mode 100644 index 638a9da..0000000 --- a/packageA/pages/goodsInfo/buy_flash_normal.wxml +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - {{data.goods_name}} - - {{data.shop_price}} - - - - - - - - - - - - - - - {{def_pick_store.pickup_name}} - - 距离:{{def_pick_store.distance>1000?filters.toFix(def_pick_store.distance/1000,2)+"km":filters.toFix(def_pick_store.distance,0)+"m"}} - - - - - - - - 选择门店 - - - 更多门店 - - (库存不足) - - (库存不足) - - (配送不匹配) - (库存不足) - - - 地址:{{def_pick_store.fulladdress}} - - - - - - - 购买数量 - - - - - + - - - - - - - - 再买{{hui_condition.need}} - ,免{{hui_condition.money}}元 - ,打{{hui_condition.sale}}折 - ,包邮 - ,送{{hui_condition.intValue}}积分 - ,送优惠券 - ,送赠品 - ,送礼包 - ,送专享礼包 - - - - - - - - - 配送不匹配 - - - - - 库存不足 - - - - - - 库存不足 - - - - 库存不足 - - - - 请先选择门店 - - - - 库存不足 - - - - 加入购物车 - 立即购买 - - - - - - - - - - - - - \ No newline at end of file diff --git a/packageA/pages/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js index 9022cbf..055cacc 100644 --- a/packageA/pages/goodsInfo/goodsInfo.js +++ b/packageA/pages/goodsInfo/goodsInfo.js @@ -8,7 +8,6 @@ var t = require("../../../utils/util.js"), oo = s.globalData, o = s.globalData.setting, os = o; - let self = null; //评价加载更多 @@ -51,7 +50,7 @@ Page({ supportPageScroll: !1, address: { address: "", - district: 0, + district: 0 }, shipping: "", shippingCost: 0, @@ -200,17 +199,15 @@ Page({ sales_rules:1, //默认是线上销售 wait_for_user_store:null, - poster:null, //自定义海报 - share_b_img:'', //自定义分享的背景 - showPoster: false, - hui_condition:null, - sto_sele_name_1:'',//分享的门店名称 + poster:null, //自定义海报 + share_b_img:'', //自定义分享的背景 + showPoster: false, + hui_condition:null, + sto_sele_name_1:'',//分享的门店名称 // 秒杀 - prom_st: 0, + prom_st: 1, prom_r_null: 0, - - hiddenCS: true, //控制客服操作菜单显示和控制 }, //------初始化加载---------- @@ -264,10 +261,10 @@ Page({ first_leader=gid_str[1]; } //-- 如果有room_id的获取 -- - if(gid_str.length>2 && gid_str[2]) { + if(gid_str.length>2 && gid_str[2]){ room_id=gid_str[2]; room_user_share=1; - }; + } }; ee.setData({ gid: gid}); @@ -312,7 +309,7 @@ Page({ is_show_gb: 1 }); } - // console.log(e); + console.log(e); var json_d = JSON.parse(e.switch_list); ee.setData({ store_config: e, @@ -321,7 +318,6 @@ Page({ is_newsales_rules: json_d.is_newsales_rules }); ee.init(gid); - //------几人评价------- //n.init(th, "", "comments"); @@ -374,7 +370,7 @@ Page({ //获取用户的默认门店 getApp().get_user_store(function(e) { - if(!e) { + if(!e) { th.data.fir_def_store={}; //赋值空对象 return false; } @@ -435,7 +431,7 @@ Page({ appd.lat=that.data.lat; appd.lon=that.data.lon; - } else { + }else{ if (e) { e.distance = null; that.data.fir_def_store=e; @@ -460,7 +456,7 @@ Page({ setTimeout(()=>{ wx.createSelectorQuery().selectAll(".showArea, .hideArea").boundingClientRect(res => { - + // console.log('node@@@@@@@', res); if(res.length != 0) { this.setData({ showFold: res[0].height < res[1].height, @@ -521,9 +517,7 @@ Page({ if(prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 let prom_id = this.data.options.prom_id; - // 检查活动是否开始 this.check_prom(goods_id, prom_type, prom_id); - } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 getApp().request.promiseGet('/api/weshop/activitylist/getGoodActInfo', { data: { @@ -543,16 +537,20 @@ Page({ let prom_id = result[0].act_id; this.setData({ 'options.prom_type': prom_type, - 'options.prom_id': prom_id, }); - // 检查活动是否开始 this.check_prom(goods_id, prom_type, prom_id); } else if(resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 this.setData({ actList: res.data.data, }); }; - + + // console.log('!!!!!!~~~~~~~~~prom~~~~~~~~~~!!!!!!'); + + // this.setData({ + // prom, + // }); + }; }); }; @@ -671,6 +669,8 @@ Page({ + + i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, { failRollback: !0, @@ -700,7 +700,6 @@ Page({ that.setData({ 'data.goods_name': t.data.data.serviceName, 'data.shop_price': t.data.data.money, - 'data.show_price': t.data.data.show_price, 'data.validDays': t.data.data.validDays, 'data.serviceContent': t.data.data.serviceContent, 'data.image_url': t.data.data.imgUrl, @@ -745,9 +744,6 @@ Page({ }; } }); - - - this.data.enterAddressPage && (this.data.enterAddressPage = !1); this.get_sto(); @@ -819,23 +815,8 @@ Page({ activeCategoryId: 1 }); }, - - //获取redis中的数量 - async getactLen(func) { - var r_num = 0, - prom_type = this.data.prom_type, - prom_id = this.data.prom_id; - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { - 1: 1 - }).then(res => { - var em = res; - if (em.data.code == 0) { - r_num = em.data.data; - } - }) - func(r_num); - }, - + + //------------加入购物车-------------- addCart: function(t) { var th = this; @@ -847,61 +828,10 @@ Page({ open_ind_store: ind }); - if(!th.data.sto_sele_name) { + if(!th.data.sto_sele_name){ getApp().my_warnning('请选择门店', 1, th, 450); return false; } - - - - //000000 - //如果是秒杀的话,要看redis够不够 - // if (this.data.prom_type == 1) { - - // if (this.data.openSpecModal_flash_normal) { - // this.data.is_normal=1; //是普通购买 - // return false; - // } - - - // this.getactLen(function (num) { - // if (num < th.data.goodsInputNum) { - // getApp().my_warnning("活动库存不足!", 0, th); - // return false; - // } else { - // // th.add_cart_func(t); - // } - // }); - // } else { - // // th.add_cart_func(t); - // } - //000000 - - - if(this.data.options.prom_type == 1 && !this.data.prom_act.is_shop_buy) { - var t = th.data.goodsInputNum + 1; - th.data.sele_g.viplimited = th.data.sele_g.buy_limit; - if (th.data.sele_g.viplimited > 0) { - var gd_buy_num = th.data.sele_g.buy_num; - - if (t + gd_buy_num > th.data.sele_g.viplimited) { - wx.showModal({ - title: '超出商品限购', - }); - - let num = th.data.sele_g.viplimited - gd_buy_num; - if (num < 0) num = 0; - th.setData({goodsInputNum: num}); - return false; - } - }; - }; - - - - - - if(action=="buy"){ @@ -920,20 +850,12 @@ Page({ newd['prom_type'] = this.data.prom_type; newd['prom_id'] = this.data.prom_id; newd['prom_price'] = this.data.prom_price; - }; - - if(this.data.prom_act.is_shop_buy) { - newd['prom_type'] = 0; - newd['prom_price'] = this.data.data.shop_price; - }; + } // console.log('newd++++++++', newd); th.buyNow(newd); } else { - - - - + var newd = { service_id: th.data.data.id, service_sn:th.data.data.service_sn, @@ -944,7 +866,7 @@ Page({ store_id:os.stoid, money:th.data.data.shop_price }; - if(getApp().globalData.guide_id) { + if(getApp().globalData.guide_id){ newd['guide_id'] = getApp().globalData.guide_id; newd['guide_type']=0; } @@ -1004,16 +926,14 @@ Page({ } - - }, //----------立即购买----------- buyNow: function(e) { - getApp().globalData.service_now=e; - wx.redirectTo({ - url: "/packageA/pages/cart2_ser/cart2_ser", - }); + getApp().globalData.service_now=e; + wx.redirectTo({ + url: "/packageA/pages/cart2_ser/cart2_ser", + }); }, //----------增加购买数量----------- addCartNum: function(t) { @@ -1030,108 +950,9 @@ Page({ //------检查数量是不是超出限购------ checkCartNum: function(t) { - - var th = this; - - // if(this.data.prom_act.is_shop_buy && this.data.options.prom_type != 1) { - // if(th.data.is_normal) { - - if(t<=0) return false; - th.setData({goodsInputNum:t}); - // } else { - - if(this.data.options.prom_type == 1 && !this.data.openSpecModal_flash_normal) { - - this.get_buy_num(this.data.sele_g, async function () { - th.data.sele_g.viplimited = th.data.sele_g.buy_limit; - - //--判断商品是否超出限购-- - // if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { - if(!th.data.prom_act.is_shop_buy) { - - if (th.data.sele_g.viplimited > 0) { - var gd_buy_num = th.data.sele_g.buy_num; - - if (t + gd_buy_num> th.data.sele_g.viplimited) { - wx.showModal({ - title: '超出商品限购', - }); - - var num = th.data.sele_g.viplimited - gd_buy_num; - if (num < 0) num = 0; - th.setData({goodsInputNum: num}) - return false; - } - } - - }; - - - //如果是普通购买的情况下 - if(th.data.openSpecModal_flash_normal) th.data.is_normal=1; - - //--判断商品是否超出活动限购-- - if (th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0 && !th.data.is_normal) { - if (t + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '超出商品活动限购', - }); - - var num = th.data.prom_buy_limit - th.data.prom_buy_num; - if (num < 0) num = 0; - th.setData({goodsInputNum: num}) - return false; - } - } - - if (th.data.sele_g.prom_type == 1 && !th.data.is_normal) { - var redis_num = 0; - //------判断活动是否抢光----- - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + - os.stoid + "/" + th.data.sele_g.prom_type + "/" + th.data.sele_g.prom_id, { - 1: 1 - }).then(res => { - redis_num = res.data.data; - }); - - if (t > redis_num) { - wx.showModal({ - title: '超出商品活动库存', - }); - th.setData({goodsInputNum: redis_num}) - return false; - } - } - var e = th.data.sele_g.store_count; - var p_type = th.data.prom_type; //&& p_type!=1 && p_type!=4 - if (th.data.sales_rules == 2 && (p_type != 1 && p_type != 4 && p_type != 6 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { - if (!th.data.def_pick_store) { - wx.showModal({title: '请选择门店',}); - return false; - } else { - e = th.data.def_pick_store.CanOutQty; - } - } - if (!e) e = 0; - //库存不足,不增加 - if (e < t) { - wx.showModal({title: '库存不足',}); - if (e < 0) e = 0; - th.setData({goodsInputNum: e}); - return false; - } - t > e || 0 == e ? t = e : t < 1 && (t = 1); - th.setData({goodsInputNum: t}); - // th.is_show_more_buy(); - - }) - - }; - - - - - + if(t<=0) return false; + var th = this; + th.setData({goodsInputNum:t}) }, @@ -1143,6 +964,7 @@ Page({ }, openSpecModel: function(t) { + // console.log('****ttttttt***', t); var th=this; var open_store = t.currentTarget.dataset.ind; this.setData({ @@ -1223,57 +1045,12 @@ Page({ }); } } - }, - //---------联系客服------------ - contactService: function () { - this.getTel() - .then(() => { - if(self.data.store_tel) { - wx.showModal({ - title: '联系客服', - content: '客服热线:' + self.data.store_tel, - confirmText: '拨打', - success(res) { - if(res.confirm) { - wx.makePhoneCall({ - phoneNumber: self.data.store_tel, - }) - }; - }, - }); - }; - }); - }, - // 获取客服电话 - getTel() { - return new Promise((resolve, reject) => { - s.getConfig(function (t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().my_warnning("商家未设置电话", 0, th); - return false; - } - self.setData({ - store_tel: rs.data.data.store_tel, - }); - // s.confirmBox("请联系客服:" + rs.data.data.store_tel); - } - }) - } else { - self.setData({ - store_tel: t.store_tel, - }); - // s.confirmBox("请联系客服:" + t.store_tel); - }; - resolve(); - }); - }); - }, + }, + + //---------联系客服------------ + contactService: function() { + getApp().con_Service(); + }, //-------获取购物车数量---------- requestCardNum: function() { var t = this; @@ -1315,6 +1092,7 @@ Page({ //--点击分享事件--- onShareAppMessage: function(t) { + getApp().globalData.no_clear=1; var th = this; var price = th.data.data.shop_price; @@ -2768,10 +2546,7 @@ Page({ }, previewImage() { - wx.previewImage({ - //将图片预览出来 - urls: [this.data.shareImgPath] - }); + getApp().pre_img(this.data.shareImgPath); }, onShareTimeline() { @@ -2795,13 +2570,7 @@ Page({ //---------联系微信客服------------ con_weixin:function () { - var url=this.data.sys_switch.weapp_customertype_url; - var id=this.data.sys_switch.weapp_customertype_appid; - wx.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: id, - success(res) {} - }) + getApp().con_wx(this) }, //评论的调用 @@ -2998,10 +2767,9 @@ Page({ // b[i] = this.data.iurl + e[i]; // } this.data.show_prew_img = 1; - wx.previewImage({ - current: b[t.currentTarget.dataset.id], - urls: b - }); + //调用预览图片 + getApp().pre_img2(b,t); + }, @@ -3125,45 +2893,38 @@ Page({ }, - //获取redis中的数量 - async getactLen(func) { - var r_num = 0, - prom_type = this.data.prom_type, - prom_id = this.data.prom_id; - await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { - 1: 1 - }).then(res => { - var em = res; - if (em.data.code == 0) { - r_num = em.data.data; - } - }) - func(r_num); - }, - - //--------检查是否活动,活动是否开始,或者是否结束------- async check_prom(gid, prom_type, prom_id) { + console.log('check_prom'); var ee = this, th = ee; var user_id = getApp().globalData.user_id; if (!user_id) user_id = 0; - - if (prom_type == 1 && prom_id == 0) { - // this.setData({ - // prom_type: 0, isshow: 1, - // }); - - // //获取门店 - // this.get_sto(); - // this.get_sku(o.stoid, this.data.data, gid); - // this.check_has_flash(); - // this.data.is_normal = 1; - // this.check_is_youhui(gid, 1); - // return false; - } + // if (prom_type == 3 || prom_type == 0 || prom_type == 5 || prom_type == 7 || prom_type == 9 || prom_type == 10) { + // this.setData({ + // prom_type: 0, isshow: 1, + // }); + // return false; + // } + + + + // if (prom_type == 1 && prom_id == 0) { + // this.setData({ + // prom_type: 0, isshow: 1, + // }); + + // //获取门店 + // this.get_sto(); + // this.get_sku(o.stoid, this.data.data, gid); + // this.check_has_flash(); + // this.data.is_normal = 1; + // this.check_is_youhui(gid, 1); + // return false; + // } + //if (prom_type != 3 && prom_type!=0){ //---判断秒杀---- if (prom_type == 1 && prom_id > 0) { @@ -3172,23 +2933,15 @@ Page({ 1: 1 }).then(res => { var em = res; - if (em.data.code == 0) { - - if (em.data.data <= 0) { - th.setData({ - prom_r_null: 1, - goodsInputNum: res.data.data, - }); - - // th.setData({goodsInputNum: redis_num}) - }; + if (res.data.code == 0) { + // console.log('!!!!!!res!!!!', res); + if (res.data.data <= 0) ee.setData({ + prom_r_null: 1 + }); //拿取价格并且判断时间-- getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { success: function (t) { - th.setData({ - sele_g: t.data.data, - }); - + // console.log('!!!!!!t!!!!', t); if (t.data.code != 0) { ee.get_normal(gid); return false; @@ -3215,6 +2968,7 @@ Page({ var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); ee.setData({ + 'data.shop_price': t.data.data.user_price, prom_price: t.data.data.user_price, prom_type: 1, prom_id: prom_id, @@ -3232,6 +2986,7 @@ Page({ if (endTime1 > newTime) { ee.setData({ prom_time_text: '距秒杀开始还有', + prom_st: 0, }) ee.countDown(endTime1, 0); } else { @@ -3245,60 +3000,60 @@ Page({ } //如果是进行中的话 - if (endTime1 < newTime) { - //-- 获取秒杀活动的多少规格 -- - ee.get_more_flahs(function (list) { - if (list && list.length > 1) { - - var n_item = list[0]; - var ind = list.findIndex(function (ele) { - return ele.goods_id == ee.data.data.goods_id; - }) - if (ind < 0) return false; - if (ind > 0) { - n_item = JSON.parse(JSON.stringify(list[ind])); - list.splice(ind, 1); - list.unshift(n_item); - } - - ee.data.sele_g.viplimited = n_item.viplimited; - ee.data.data.viplimited = n_item.viplimited; - - var gb = 1; - //-- 显示多规格 -- - for (let i in list) { - let item = list[i]; - var gg = ""; - if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = ""; - if (item.goods_color == "null" || item.goods_color == null) item.goods_color = ""; - - if (item.goods_spec != "" && item.goods_color != "") { - gg = item.goods_spec + "/" + item.goods_color; - } else if (item.goods_spec != "" || item.goods_color != "") { - gg = item.goods_spec + item.goods_color; - } else { - gg = "规格" + gb; - gb++; - } - item.gg = gg; - item.prom_id = item.prom_id; - item.prom_type = 1; - } - - ee.setData({ - sku_g: list, - }); - - } - }) - } + // if (endTime1 < newTime) { + // //-- 获取秒杀活动的多少规格 -- + // ee.get_more_flahs(function (list) { + // if (list && list.length > 1) { + + // var n_item = list[0]; + // var ind = list.findIndex(function (ele) { + // return ele.goods_id == ee.data.data.goods_id; + // }) + // if (ind < 0) return false; + // if (ind > 0) { + // n_item = JSON.parse(JSON.stringify(list[ind])); + // list.splice(ind, 1); + // list.unshift(n_item); + // } + + // ee.data.sele_g.viplimited = n_item.viplimited; + // ee.data.data.viplimited = n_item.viplimited; + + // var gb = 1; + // //-- 显示多规格 -- + // for (let i in list) { + // let item = list[i]; + // var gg = ""; + // if (item.goods_spec == "null" || item.goods_spec == null) item.goods_spec = ""; + // if (item.goods_color == "null" || item.goods_color == null) item.goods_color = ""; + + // if (item.goods_spec != "" && item.goods_color != "") { + // gg = item.goods_spec + "/" + item.goods_color; + // } else if (item.goods_spec != "" || item.goods_color != "") { + // gg = item.goods_spec + item.goods_color; + // } else { + // gg = "规格" + gb; + // gb++; + // } + // item.gg = gg; + // item.prom_id = item.prom_id; + // item.prom_type = 1; + // } + + // ee.setData({ + // sku_g: list, + // }); + + // } + // }) + // } } }); } }) } - + }, @@ -3307,706 +3062,58 @@ Page({ let prom_type = e.currentTarget.dataset.promtype; let prom_id = e.currentTarget.dataset.promid; let goods_id = this.data.data.goods_id; - let url = `/packageA/pages/goodsInfo/goodsInfo?goods_id=${goods_id}&prom_type=${prom_type}&prom_id=${prom_id}`;s + let url = `/packageA/pages/goodsInfo/goodsInfo?goods_id=${goods_id}&prom_type=${prom_type}&prom_id=${prom_id}`; + // console.log('url~~~~', url); getApp().goto(url); }, - //获取更多秒杀 - get_more_flahs: async function (func) { - var f_more = false; - var user_id = getApp().globalData.user_id; - if (!user_id) user_id = 0; - - var url = "/api/weshop/goods/listSkuFlash?store_id=" + os.stoid + "&goods_id=" + this.data.data.goods_id + "&user_id=" + user_id; - //获取秒杀的多规格 - await getApp().request.promiseGet(url, {}).then(res => { - if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { - f_more = res.data.data; - } - }) - if (!f_more) { - func(false); - return false; - } - //-- 秒杀的价格要更新 -- - for (let i in f_more) { - - let item = f_more[i]; - f_more[i].prom_id = item.act_id; - f_more[i].prom_type = 1; - if (item.goods_id == this.data.data.goods_id) { - continue; - } - var url = "/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + item.act_id; - await getApp().request.promiseGet(url, {}).then(rs => { - if (rs.data.code == 0) { - f_more[i].price = rs.data.data.user_price; - - } - }) - } - func(f_more); - - }, - - - - - - - //-------------获取购买数量的总函数---------------- - get_buy_num: function (gd, func) { - - var th = this, - user_id = getApp().globalData.user_id; - - - //----获取商品购买数---- - getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { - data: { - store_id: os.stoid, - user_id: user_id, - goods_id: this.data.gid, - }, - success: function (t) { - if (t.data.code == 0) { - var g_buy_num = t.data.data.goodsbuynum; - - // 如果是秒杀的时候 - // if (th.data.prom_type == 0 && gd.prom_type == 1) { - // gd.prom_type = 0; - // } - - //----获取活动购买数---- - getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { - data: { - store_id: os.stoid, - user_id: user_id, - goods_id: th.data.gid, - prom_type: th.data.prom_type, - prom_id: th.data.prom_id - }, - //-----获取----- - success: function (tt) { - if (tt.data.code == 0) { - th.setData({ - prom_buy_num: tt.data.data.goodsbuynum, - }); - "function" == typeof func && func(); - } - } - }); - - - } - }, - }); - }, - - - - - - // 促销 -> 送礼包 -> 查看详情 - viewLbDetails(e) { - let id = e.currentTarget.dataset.id; // 获取礼包id - let url = `/packageA/pages/myGiftDetails/myGiftDetails?btn=0&index=0&id=${id}`; // btn=0 控制跳转到的页面不显示按钮 - // console.log('myurl', url); - getApp().goto(url); - }, - go_more_ladder: function (e) { - var prom_id = e.currentTarget.dataset.id; - getApp().goto("/pages/goods/goodsList/goodsList?ladder_id=" + prom_id); - }, - - getHistoryBuy() { - let _this = this; - let req_data = { - store_id: os.stoid, - goods_id: this.data.gid, - pay_status: 1, - rndid: 1 - }; - getApp().request.promiseGet('/api/weshop/ordergoods/list', { - data: req_data, - }) - .then(res => { - if (t.ajax_ok(res)) { - _this.setData({ - historyBuyInfo: res.data.data.pageData, - }) - } - }) - }, - - - - //-- 秒杀的普通购买 -- - openSpecModel_Nor: function () { - this.data.g_buy_num = new Map(); + //-- 检验商品的活动情况 -- + check_gd_prom_new: function (func) { var th = this; - this.setData({open_ind_store: 5, goodsInputNum: 1});//拼团直接给4 - - this.setData({openSpecModal_flash_normal: 1}); - - - // if (th.data.sku_g_pt) { - // // this.get_sto(1) - // this.setData({openSpecModal_flash_normal: 1}); - // } else { - // th.get_sto(1); - // th.get_sku(o.stoid, th.data.data, th.data.gid, 1, function () { - // th.setData({ - // openSpecModal_flash_normal: 1 - // }); - // }); - // } - // this.check_is_youhui(th.data.gid, 1); - }, - - closeSpecModal_flash_normal: function () { - this.setData({openSpecModal_flash_normal: 0}); - }, - - - //打开客服操作菜单 - openCS() { - // csType/在线客服设置: - // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 - // 1小程序客服、 - // 2企业微信客服 - let csType = this.data.sys_switch.weapp_customertype; - if(csType == 0) { - // 获取电话号码 - this.contactService(); - } else { - this.getTel() - .then(() => { - self.setData({ - hiddenCS: false, - }); - }); - - }; - }, - - //关闭客服操作菜单 - closeCS() { - this.setData({ - hiddenCS: true, - }); - }, - - - - - - - - //-- 加入购物的函数 -- - add_cart_func: function (t) { - var i = getApp().request; - if (oo.user_id == null) { - return s.my_warnning("还未登录!", 0, this); - } + var user_id = getApp().globalData.user_id; + if (!user_id) user_id = 0; - if (!getApp().globalData.userInfo) { - return s.my_warnning("还未登录!", 0, this); + var url = '/api/weshop/activitylist/listGoodActInfo2'; + var req_d = { + "store_id": os.stoid, + "goods_id": this.data.gid, + "user_id": user_id, } - - var e = this, - th = e, - a = 0, - o = this.data.sele_g; - a = o.goods_id; - - //----------添加到购物车时,要判断限购数量,-------- - e.get_buy_num(o, function (ee) { - //---判断商品是否超出限购--- - if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { - if (th.data.goodsInputNum + th.data.g_buy_num.get(th.data.sele_g.goods_id) > th.data.sele_g.viplimited) { - wx.showModal({ - title: '提示', - content: '超出商品限购' - }); - return false; - } - } - //---判断商品是否超出活动限购--- - if ((th.data.prom_buy_num != -1 && th.data.prom_buy_limit > 0) && !th.data.is_normal) { - if (th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit) { - wx.showModal({ - title: '提示', - content: '超出商品活动限购' - }); - return false; - } - } - - if (th.data.goodsInputNum <= 0) return s.my_warnning("商品数量不能为0", 0, th); - if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) - this.setData({ - sto_sele_name: "" - }); - if (th.data.sto_sele_name == "") return s.my_warnning("请选择门店", 0, th); - - //--------------此时操作的数据------------ - var newd = { - goods_id: o.goods_id, - goods_num: th.data.goodsInputNum, - pick_id: th.data.sto_sele_id, - user_id: oo.user_id, - store_id: th.data.stoid, - goods_price: o.shop_price, - member_goods_price: o.shop_price, - goods_name: o.goods_name, - goods_sn: o.goods_sn, - sku: o.sku, - prom_id: th.data.sele_g.prom_id, - prom_type: th.data.sele_g.prom_type, - }; - - //---是不是从收藏夹出来的--- - if (th.data.c_guide_id) { - newd['guide_id'] = th.data.c_guide_id; - newd['guide_type'] = 2; - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 3; - } else { - if (getApp().globalData.guide_id) { - newd['guide_id'] = getApp().globalData.guide_id; - newd['guide_type'] = 0; - if ("add" == t.currentTarget.dataset.action) newd['guide_type'] = 1; - } - } - - //让商品带上房间号 - //让商品带上房间号 - if (th.data.sys_switch.is_skuroom_id == 1) { - if (th.data.data.goods_id == getApp().globalData.room_goods_id) { - newd.room_id = getApp().globalData.room_id; - } - } else { - if (newd.goods_id == getApp().globalData.room_goods_id) newd.room_id = getApp().globalData.room_id; - } - - //如果是积分够,is_integral_normal就要有积分购普通购买字段 - if (o.prom_type == 4) { - newd.is_integral_normal = 1; - } - - //如果有线下取价 - if (o.offline_price) { - newd.offline_price = o.offline_price; - newd.pricing_type = o.pricing_type; - } - - //-----如果是秒杀,团购,积分购,拼团----- - if (th.data.prom_type == 1 || th.data.prom_type == 2) { - - if (th.data.openSpecModal_flash_normal) { - - newd.prom_type = 0; - newd.prom_id = 0; - - //---如果是线下门店销售的时候--- - if (th.data.sales_rules == 2) { - var pick = th.get_pick_from_list(th.data.sto_sele_id) - //---通过接口获取门店的线下库存信息-- - getApp().request.get("/api/weshop/goods/getWareStorages", { - data: { - storageNos: pick.pickup_no, - wareIds: encodeURIComponent(th.data.sele_g.erpwareid), - storeId: os.stoid - }, - success: function (res) { - if (res.data.code == 0) { - if (res.data.data.pageData.length > 0) { - var CanOutQty = res.data.data.pageData[0].CanOutQty; - if (CanOutQty < e.data.goodsInputNum) { - return s.my_warnning("库存不足!", 0, th); - } - //在调一次接口,读取商品的预出库的数量,lock - getApp().request.get("/api/weshop/order/ware/lock/page", { - data: { - store_id: os.stoid, - wareId: th.data.sele_g.goods_id, - storageId: pick.pickup_id, - pageSize: 1000 - }, - success: function (res_data) { - if (res_data.data.code == 0 && res_data.data.data.total > 0) { - - var lock = 0; - for (var i in res_data.data.data.pageData) { - lock += res_data.data.data.pageData[i].outQty; - } - - if (CanOutQty <= lock) { - return s.my_warnning("库存不足!", 0, th); - } - th.add_cart_next(e, t, a, o, newd, CanOutQty - lock); - } else { - th.add_cart_next(e, t, a, o, newd, CanOutQty); - } - } - }) - } else { - return s.my_warnning("库存不足!", 0, th); - } - - } - } - }) - } else { - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 - } - - return false; - } - - - newd.goods_price = th.data.prom_price; - newd.member_goods_price = th.data.prom_price, - newd.prom_type = th.data.prom_type; - newd.prom_id = th.data.prom_id; - - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); - - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 - - } else if (o.prom_type == 7) { - - //判断进行中的活动,是不是要判断线下库存 - th.check_zh_acting(function (ee) { - newd.prom_id = 0; - newd.prom_type = 0; - if (ee && th.data.sele_g.act) { - newd.prom_id = th.data.sele_g.act.id; - newd.prom_type = 7; - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 - return false; - } else { - //---如果是线下门店销售的时候--- - if (th.data.sales_rules == 2) { - var pick = th.get_pick_from_list(th.data.sto_sele_id) - //---通过接口获取门店的线下库存信息-- - getApp().request.get("/api/weshop/goods/getWareStorages", { - data: { - storageNos: pick.pickup_no, - wareIds: encodeURIComponent(th.data.sele_g.erpwareid), - storeId: os.stoid - }, - success: function (res) { - if (res.data.code == 0) { - if (res.data.data.pageData.length > 0) { - var CanOutQty = res.data.data.pageData[0].CanOutQty; - if (CanOutQty < e.data.goodsInputNum) { - return s.my_warnning("库存不足!", 0, th); - } - //在调一次接口,读取商品的预出库的数量,lock - getApp().request.get("/api/weshop/order/ware/lock/page", { - data: { - store_id: os.stoid, - wareId: th.data.sele_g.goods_id, - storageId: pick.pickup_id, - pageSize: 1000 - }, - success: function (res_data) { - if (res_data.data.code == 0 && res_data.data.data.total > 0) { - - var lock = 0; - for (var i in res_data.data.data.pageData) { - lock += res_data.data.data.pageData[i].outQty; - } - - if (CanOutQty <= lock) { - return s.my_warnning("库存不足!", 0, th); - } - th.add_cart_next(e, t, a, o, newd, CanOutQty - lock); - } else { - th.add_cart_next(e, t, a, o, newd, CanOutQty); - } - } - }) - } else { - return s.my_warnning("库存不足!", 0, th); - } - - } - } - }) - } else { - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 - } - } - }) - - } - else if (th.data.prom_type == 0 || th.data.prom_type == 3 || th.data.prom_type == 4 || th.data.prom_type == 5 || th.data.prom_type == 10) { - newd.prom_type = 0; - newd.prom_id = 0; - - if (th.data.prom_type == 10) { - newd.prom_type = th.data.prom_type; - newd.prom_id = th.data.prom_id; - } - - //---如果是线下门店销售的时候--- - if (th.data.sales_rules == 2) { - var pick = th.get_pick_from_list(th.data.sto_sele_id) - //---通过接口获取门店的线下库存信息-- - getApp().request.get("/api/weshop/goods/getWareStorages", { - data: { - storageNos: pick.pickup_no, - wareIds: encodeURIComponent(th.data.sele_g.erpwareid), - storeId: os.stoid - }, - success: function (res) { - if (res.data.code == 0) { - if (res.data.data.pageData.length > 0) { - var CanOutQty = res.data.data.pageData[0].CanOutQty; - if (CanOutQty < e.data.goodsInputNum) { - return s.my_warnning("库存不足!", 0, th); - } - //在调一次接口,读取商品的预出库的数量,lock - getApp().request.get("/api/weshop/order/ware/lock/page", { - data: { - store_id: os.stoid, - wareId: th.data.sele_g.goods_id, - storageId: pick.pickup_id, - pageSize: 1000 - }, - success: function (res_data) { - if (res_data.data.code == 0 && res_data.data.data.total > 0) { - - var lock = 0; - for (var i in res_data.data.data.pageData) { - lock += res_data.data.data.pageData[i].outQty; - } - - if (CanOutQty <= lock) { - return s.my_warnning("库存不足!", 0, th); - } - th.add_cart_next(e, t, a, o, newd, CanOutQty - lock); - } else { - th.add_cart_next(e, t, a, o, newd, CanOutQty); - } - } - }) - } else { - return s.my_warnning("库存不足!", 0, th); - } - - } - } + getApp().request.get(url, { + data: req_d, + success: function (e) { + if (e.data.code == 0 && e.data.data && e.data.data.length > 0) { + var arr = e.data.data; + var arr2 = arr.filter(function (e) { + return e.s_time < ut.gettimestamp(); }) - } else { - if (o.store_count <= 0) return s.my_warnning("库存已为空!", 0, th); - if (o.store_count < e.data.goodsInputNum) return s.my_warnning("库存不足!", 0, th); - th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 - } - } - }) - }, - - //---加入购物车的最后一步--- - add_cart_next(e, t, a, o, newd, CanOutQty) { - var th = this, i = getApp().request; - //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ - if ((o.prom_type != 1 || o.prom_id <= 0) && ((o.prom_type != 6 && o.prom_type != 4 && o.prom_type != 2 ) || th.data.is_normal)) { - var conf = th.data.bconfig; - if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { - var s_list = JSON.parse(conf.switch_list); - var now = ut.gettimestamp(); - - - var str = getApp().globalData.userInfo['card_expiredate'].replace(/-/g, '/'); - var end = new Date(str); - end = Date.parse(end) / 1000; - - //--如果后台有开启等级价的功能,而且会员的等级没有过期的情况下-- - if (parseInt(s_list.rank_switch) == 2 && end > now) { - var card_price = o[getApp().globalData.userInfo['card_field']]; - //如果会员有等级价 - if (getApp().globalData.userInfo['card_field'] != undefined && getApp().globalData.userInfo['card_field'] != null - && getApp().globalData.userInfo['card_field'] != "" && card_price > 0) { - newd.goods_price = card_price; - newd.member_goods_price = card_price; - } - } - } - } - - //if (this.data.data.goods.is_virtual) return this.buyVirtualGoods(d); - if ("add" == t.currentTarget.dataset.action) { - - if (th.data.prom_goods) { - newd.prom_type = 3; - newd.prom_id = th.data.prom_goods[0].prom_id; - } - - //----先看会员在购物车中是否加入了该商品----- - i.get("/api/weshop/cart/page", { - data: { - store_id: e.data.stoid, - user_id: oo.user_id, - goods_id: a, - pick_id: e.data.sto_sele_id, - state: 0 - }, - success: function (re) { - - //-------如果购物车中有相关的数据--------- - if (re.data.data.total > 0) { - - var item = re.data.data.pageData[0]; - - //判断数量,要看下购物车中有没有该商品 - if (CanOutQty) { - if (item.goods_num + th.data.goodsInputNum > CanOutQty) { - return s.my_warnning("库存不足!", 0, th); - } - } else { - if (item.goods_num + th.data.goodsInputNum > o.store_count) { - return s.my_warnning("库存不足!", 0, th); - } - } - - var updata = { - id: item.id, - goods_num: e.data.goodsInputNum + item.goods_num, - goods_price: newd.goods_price, - member_goods_price: newd.goods_price, - store_id: th.data.stoid, - }; - - //---是不是从收藏夹出来的--- - if (th.data.c_guide_id) { - updata['guide_id'] = th.data.c_guide_id; - updata['guide_type'] = 3; //加入购物车之后就变成了3 - } else { - if (getApp().globalData.guide_id) { - updata['guide_id'] = getApp().globalData.guide_id; - updata['guide_type'] = 0; - } - } - - i.put("/api/weshop/cart/update", { - data: updata, - success: function (t) { - getApp().my_warnning('加入购物车成功', 1, th, 450); - var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; - th.setData({ - cartGoodsNum: c_num - }); - th.closeSpecModal(); - } - }); - } else { - - - i.post("/api/weshop/cart/save", { - data: newd, - success: function (t) { - getApp().my_warnning('加入购物车成功', 1, th, 450); - var c_num = th.data.cartGoodsNum + e.data.goodsInputNum; - th.setData({ - cartGoodsNum: c_num - }); - th.closeSpecModal(); - } - }); + //-- 如果只有一个活动的话 -- + if (arr.length == 1) { + th.data.prom_type = arr[0].prom_type; + th.data.prom_id = arr[0].act_id; } - } - }); - - } - else { - - //这一步主要是要让立即购买 走 购物车的逻辑 参与活动 - if (newd.prom_type == 10 || newd.prom_type == 7) { - //----先看会员在购物车中是否加入了该商品,立即购买的----- - getApp().request.get("/api/weshop/cart/page", { - data: { - store_id: e.data.stoid, - user_id: oo.user_id, - state: 1 - }, - success: function (res) { - //-------如果购物车中有相关的数据--------- - if (res.data.code == 0 && res.data.data.total > 0) { - for (let j in res.data.data.pageData) { - let item_j = res.data.data.pageData[j]; - var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; - getApp().request.delete(url, {}); - } - } - newd.state = 1; - getApp().request.post("/api/weshop/cart/save", { - data: newd, - success: function (t) { - th.closeSpecModal(); - getApp().goto("/pages/cart/cart2/cart2?state=1"); - } - }); - } - }) - return false; - } - - if (th.data.prom_goods) { - var prom_d = th.data.prom_goods; - for (var i in prom_d) { - //判断活动有俩种条件,0元 1件 - var condition_t = prom_d[i].prom_type; - switch (condition_t) { - case 0: //按钱 - if (newd.goods_price >= condition_t) { - newd.prom_type = 3; - newd.prom_id = prom_d[i].prom_id; - } - break - case 1://按购买数量 - if (newd.goods_num >= condition_t) { - newd.prom_type = 3; - newd.prom_id = prom_d[i].prom_id; - } - break; + //-- 如果只有一个进行中的活动的话 -- + else if (arr2.length == 1) { + th.data.prom_type = arr2[0].prom_type; + th.data.prom_id = arr2[0].act_id; } } - + //-- 调用回调 -- + func(); } - - newd['pick_name'] = th.data.sto_sele_name; - newd['pick_dis'] = th.data.sto_sele_distr; - th.buyNow(newd); - } + }); }, - - - - - + click_contact:function () { + getApp().globalData.no_clear=1; + } - - - - - }); diff --git a/packageA/pages/goodsInfo/goodsInfo.wxml b/packageA/pages/goodsInfo/goodsInfo.wxml index 64b0378..9684d19 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/goodsInfo/goodsInfo.wxml @@ -101,8 +101,7 @@ - {{filters.toFix(prom_price,2)}} - {{filters.toFix(data.shop_price,2)}} + {{filters.toFix(data.shop_price,2)}} {{data.goods_name}} @@ -507,7 +506,7 @@ - - - - - 客服 @@ -548,45 +542,44 @@ - - - - 加入购物车 - 立即抢购 - + + + + 加入购物车 + 立即抢购 + - - - - - - 单独购买 - 即将开始 - - - 即将开始 - - + + + + 单独购买 + 即将开始 + + + 即将开始 + + - - - - 单独购买 - 已抢光 - - 已抢光 - - - - - 单独购买 - 活动已经结束 - - 活动已经结束 - + - + + 单独购买 + 已抢光 + + 已抢光 + + + + + 单独购买 + 活动已经结束 + + + 活动已经结束 + + + @@ -594,9 +587,15 @@ 加入购物车 立即购买 - + + + + + + + @@ -616,8 +615,7 @@ {{data.goods_name}} - {{prom_price}} - {{data.shop_price}} + {{data.shop_price}} @@ -904,36 +902,3 @@ - - - - - - - - - diff --git a/packageA/pages/goodsInfo/goodsInfo.wxss b/packageA/pages/goodsInfo/goodsInfo.wxss index c365d9a..49b3695 100644 --- a/packageA/pages/goodsInfo/goodsInfo.wxss +++ b/packageA/pages/goodsInfo/goodsInfo.wxss @@ -562,7 +562,7 @@ view.cart-btn-lg { .spec-model { position: fixed; bottom: 0; - z-index: 19; + z-index: 20; background: white; width: 100%; /* padding: 0 30rpx; */ @@ -2968,56 +2968,3 @@ button.custom-service::after{ left: -1000px; top: -1000px; } - - - -/* 联系客服操作菜单 */ -.action { - position: fixed; - bottom: 100rpx; - z-index: 1; - width: 100%; - background-color: white; - border-radius: 20rpx 20rpx 0 0; -} - -.action .icon-guan { - position: absolute; - left: 20rpx !important; - right: auto !important; -} - -.action .iconfont { - color: #ff7295; - margin-right: 10rpx; -} - -.action button { - text-align: left; - line-height: normal; -} - -.action button::after { - border-width: 0; -} - -.action .btn2 { - box-sizing: border-box; - height: 100rpx; - display: flex; - align-items: center; -} - -.mask2 { - display: none; - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: rgba(0,0,0,.5); -} - -.action.active ~ .mask2 { - display: block; -} diff --git a/packageA/pages/goods_share/goods_share.js b/packageA/pages/goods_share/goods_share.js index 6129fd8..6ba5efb 100644 --- a/packageA/pages/goods_share/goods_share.js +++ b/packageA/pages/goods_share/goods_share.js @@ -177,7 +177,8 @@ Page({ /**e * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { + getApp().globalData.no_clear=1; var th = this; var item=this.data.share_good; var price = item.shop_price; @@ -732,10 +733,7 @@ Page({ }) return false; } - wx.previewImage({ - //将图片预览出来 - urls: [that.data.shareImgPath] - }); + getApp().pre_img(that.data.shareImgPath); wx.hideLoading(); } }) diff --git a/packageA/pages/hongBao/hongBao.js b/packageA/pages/hongBao/hongBao.js index 32bd064..6e24e15 100644 --- a/packageA/pages/hongBao/hongBao.js +++ b/packageA/pages/hongBao/hongBao.js @@ -113,7 +113,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/hongBaoDetails/hongBaoDetails.js b/packageA/pages/hongBaoDetails/hongBaoDetails.js index 87de214..f74292d 100644 --- a/packageA/pages/hongBaoDetails/hongBaoDetails.js +++ b/packageA/pages/hongBaoDetails/hongBaoDetails.js @@ -98,7 +98,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/jfbuy/jfbuy.js b/packageA/pages/jfbuy/jfbuy.js index 1e5edd9..95c28fc 100644 --- a/packageA/pages/jfbuy/jfbuy.js +++ b/packageA/pages/jfbuy/jfbuy.js @@ -187,8 +187,8 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { - + onShareAppMessage: function () { + getApp().globalData.no_clear=1; var store_name = getApp().globalData.config ? getApp().globalData.config.store_name:''; var pagePath = this.route; //当前页面url diff --git a/packageA/pages/liveStream/liveStream.js b/packageA/pages/liveStream/liveStream.js index b9ced4c..8197b8f 100644 --- a/packageA/pages/liveStream/liveStream.js +++ b/packageA/pages/liveStream/liveStream.js @@ -348,7 +348,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1; if (res.from === 'button') { // 来自页面内转发按钮 // console.log(res.target) diff --git a/packageA/pages/liveStreamDetails/liveStreamDetails.js b/packageA/pages/liveStreamDetails/liveStreamDetails.js index 371509b..fa0de31 100644 --- a/packageA/pages/liveStreamDetails/liveStreamDetails.js +++ b/packageA/pages/liveStreamDetails/liveStreamDetails.js @@ -605,6 +605,7 @@ drawText: function(ctx, str, leftWidth, initHeight, titleHeight, canvasWidth, un * 用户点击右上角分享 */ onShareAppMessage: function (res) { + getApp().globalData.clear=1; this.setData({ showActionSheet: 'false' }) diff --git a/packageA/pages/live_share/live_share.js b/packageA/pages/live_share/live_share.js index 8e15cf0..6f63798 100644 --- a/packageA/pages/live_share/live_share.js +++ b/packageA/pages/live_share/live_share.js @@ -71,7 +71,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1; var th=this; var id=th.data.hui_active.id; var url='/packageA/pages/liveStreamDetails/liveStreamDetails?id=' + id + '&live=ing'; diff --git a/packageA/pages/myGift/myGift.js b/packageA/pages/myGift/myGift.js index 3ff812b..3df4c3d 100644 --- a/packageA/pages/myGift/myGift.js +++ b/packageA/pages/myGift/myGift.js @@ -147,7 +147,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/myGiftDetails/myGiftDetails.js b/packageA/pages/myGiftDetails/myGiftDetails.js index d432b6b..011d831 100644 --- a/packageA/pages/myGiftDetails/myGiftDetails.js +++ b/packageA/pages/myGiftDetails/myGiftDetails.js @@ -192,7 +192,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/my_service/beauty_deta.js b/packageA/pages/my_service/beauty_deta.js index 671dc78..c89bb33 100644 --- a/packageA/pages/my_service/beauty_deta.js +++ b/packageA/pages/my_service/beauty_deta.js @@ -394,6 +394,7 @@ Page({ previewImage: function(e) { var th = this; var current = e.currentTarget.dataset.src; + getApp().globalData.no_clear=1; wx.previewImage({ current: current, // 当前显示图片的http链接 urls: [th.data.head_img] // 需要预览的图片http链接列表 diff --git a/packageA/pages/my_service2/beauty_deta.js b/packageA/pages/my_service2/beauty_deta.js index 671dc78..c89bb33 100644 --- a/packageA/pages/my_service2/beauty_deta.js +++ b/packageA/pages/my_service2/beauty_deta.js @@ -394,6 +394,7 @@ Page({ previewImage: function(e) { var th = this; var current = e.currentTarget.dataset.src; + getApp().globalData.no_clear=1; wx.previewImage({ current: current, // 当前显示图片的http链接 urls: [th.data.head_img] // 需要预览的图片http链接列表 diff --git a/packageA/pages/parseHtml/parseHtml.js b/packageA/pages/parseHtml/parseHtml.js index 325373f..3983cc9 100644 --- a/packageA/pages/parseHtml/parseHtml.js +++ b/packageA/pages/parseHtml/parseHtml.js @@ -320,7 +320,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageA/pages/profile/profile.js b/packageA/pages/profile/profile.js index 3878500..f84e04e 100644 --- a/packageA/pages/profile/profile.js +++ b/packageA/pages/profile/profile.js @@ -875,6 +875,7 @@ Page({ //--点击分享事件--- onShareAppMessage: function(t) { + getApp().globalData.no_clear=1 return o.share; }, diff --git a/packageA/pages/prom_list/prom_list.js b/packageA/pages/prom_list/prom_list.js index 45d30d6..cd69fbe 100644 --- a/packageA/pages/prom_list/prom_list.js +++ b/packageA/pages/prom_list/prom_list.js @@ -711,6 +711,7 @@ Page({ //--点击分享事件--- onShareAppMessage: function(t) { + getApp().globalData.no_clear=1 var curPage=this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/packageA/pages/quan/quan.js b/packageA/pages/quan/quan.js index 8e36521..ca08b2e 100644 --- a/packageA/pages/quan/quan.js +++ b/packageA/pages/quan/quan.js @@ -73,7 +73,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1; var th=this; var id=th.data.hui_active.id; var url="/packageA/pages/quan_pro/quan_pro?id="+id; diff --git a/packageA/pages/service_share/service_share.js b/packageA/pages/service_share/service_share.js index 9466ff2..d0564c5 100644 --- a/packageA/pages/service_share/service_share.js +++ b/packageA/pages/service_share/service_share.js @@ -141,7 +141,7 @@ Page({ /**e * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1; var th = this; var item=this.data.share_good; var price = item.money; @@ -709,10 +709,7 @@ Page({ }) return false; } - wx.previewImage({ - //将图片预览出来 - urls: [that.data.shareImgPath] - }); + getApp().pre_img(that.data.shareImgPath); wx.hideLoading(); } }) diff --git a/packageA/pages/text/text.js b/packageA/pages/text/text.js deleted file mode 100644 index 079769c..0000000 --- a/packageA/pages/text/text.js +++ /dev/null @@ -1,66 +0,0 @@ -// packageA//pages/text/text.js -Page({ - - /** - * 页面的初始数据 - */ - data: { - - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - - }, - - /** - * 生命周期函数--监听页面初次渲染完成 - */ - onReady: function () { - - }, - - /** - * 生命周期函数--监听页面显示 - */ - onShow: function () { - - }, - - /** - * 生命周期函数--监听页面隐藏 - */ - onHide: function () { - - }, - - /** - * 生命周期函数--监听页面卸载 - */ - onUnload: function () { - - }, - - /** - * 页面相关事件处理函数--监听用户下拉动作 - */ - onPullDownRefresh: function () { - - }, - - /** - * 页面上拉触底事件的处理函数 - */ - onReachBottom: function () { - - }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - } -}) \ No newline at end of file diff --git a/packageA/pages/text/text.json b/packageA/pages/text/text.json deleted file mode 100644 index 8835af0..0000000 --- a/packageA/pages/text/text.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "usingComponents": {} -} \ No newline at end of file diff --git a/packageA/pages/text/text.wxml b/packageA/pages/text/text.wxml deleted file mode 100644 index 5d51b9c..0000000 --- a/packageA/pages/text/text.wxml +++ /dev/null @@ -1,2 +0,0 @@ - -packageA//pages/text/text.wxml diff --git a/packageA/pages/text/text.wxss b/packageA/pages/text/text.wxss deleted file mode 100644 index 1fd4d8f..0000000 --- a/packageA/pages/text/text.wxss +++ /dev/null @@ -1 +0,0 @@ -/* packageA//pages/text/text.wxss */ \ No newline at end of file diff --git a/packageA/pages/user/my_service2/appment_main.js b/packageA/pages/user/my_service2/appment_main.js index 0f3039e..6a4fee5 100644 --- a/packageA/pages/user/my_service2/appment_main.js +++ b/packageA/pages/user/my_service2/appment_main.js @@ -60,7 +60,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 } }) \ No newline at end of file diff --git a/packageB/pages/boxes-details/boxes-details.js b/packageB/pages/boxes-details/boxes-details.js index f3365f7..9513684 100644 --- a/packageB/pages/boxes-details/boxes-details.js +++ b/packageB/pages/boxes-details/boxes-details.js @@ -124,7 +124,7 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function() { - + getApp().globalData.no_clear=1 }, diff --git a/packageB/pages/luckactivity/index/index.js b/packageB/pages/luckactivity/index/index.js index 21676ac..72d8423 100644 --- a/packageB/pages/luckactivity/index/index.js +++ b/packageB/pages/luckactivity/index/index.js @@ -166,7 +166,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageB/pages/user/Change_phone/Change_phone.js b/packageB/pages/user/Change_phone/Change_phone.js index 303f7d0..e94d533 100644 --- a/packageB/pages/user/Change_phone/Change_phone.js +++ b/packageB/pages/user/Change_phone/Change_phone.js @@ -246,6 +246,6 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function() { - + getApp().globalData.no_clear=1 } }) diff --git a/packageB/pages/user/add_comment/add_comment.js b/packageB/pages/user/add_comment/add_comment.js index 3c50fb6..a1c3590 100644 --- a/packageB/pages/user/add_comment/add_comment.js +++ b/packageB/pages/user/add_comment/add_comment.js @@ -220,6 +220,7 @@ Page({ var imgs = this.data.imgs; + getApp().globalData.no_clear=1; wx.chooseImage({ count: 1, // 默认9 sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图,默认二者都有 @@ -259,6 +260,7 @@ Page({ var index = e.currentTarget.dataset.index; //所有图片 var imgs = this.data.imgs; + getApp().globalData.no_clear=1; wx.previewImage({ //当前显示图片 current: imgs[index], diff --git a/packageB/pages/user/binding_info/binding_info.js b/packageB/pages/user/binding_info/binding_info.js index a9d1ed5..69f67d3 100644 --- a/packageB/pages/user/binding_info/binding_info.js +++ b/packageB/pages/user/binding_info/binding_info.js @@ -60,7 +60,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 } }) \ No newline at end of file diff --git a/packageB/pages/user/buyDetails/buyDetails.js b/packageB/pages/user/buyDetails/buyDetails.js index 78ec393..6de7198 100644 --- a/packageB/pages/user/buyDetails/buyDetails.js +++ b/packageB/pages/user/buyDetails/buyDetails.js @@ -106,7 +106,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageB/pages/user/choice_guide/choice_guide.js b/packageB/pages/user/choice_guide/choice_guide.js index bb6b4d3..7b44c52 100644 --- a/packageB/pages/user/choice_guide/choice_guide.js +++ b/packageB/pages/user/choice_guide/choice_guide.js @@ -26,6 +26,7 @@ Page({ //--点击分享事件--- onShareAppMessage: function(t) { + getApp().globalData.no_clear=1 return o.share; }, get_list: function() { diff --git a/packageB/pages/user/comment/comment.js b/packageB/pages/user/comment/comment.js index a7438ba..b7ffaf5 100644 --- a/packageB/pages/user/comment/comment.js +++ b/packageB/pages/user/comment/comment.js @@ -161,6 +161,7 @@ Page({ } else { image = imgArr[index].weapp_img[sindex]; } + getApp().globalData.no_clear=1; wx.previewImage({ current: image, //当前图片地址 diff --git a/packageB/pages/user/view_comment/view_comment.js b/packageB/pages/user/view_comment/view_comment.js index f826ea7..3c2ed6e 100644 --- a/packageB/pages/user/view_comment/view_comment.js +++ b/packageB/pages/user/view_comment/view_comment.js @@ -112,6 +112,7 @@ Page({ var iurl = th.data.iurl; if (image != "") { image = imgArr[0].weapp_img[index]; + getApp().globalData.no_clear=1; wx.previewImage({ current: image, //当前图片地址 @@ -119,6 +120,7 @@ Page({ }) } else { image = imgArr[0].img[index]; + getApp().globalData.no_clear=1; wx.previewImage({ current: iurl + image, //当前图片地址 diff --git a/packageB/pages/video/index.js b/packageB/pages/video/index.js index 82614ac..97f1008 100644 --- a/packageB/pages/video/index.js +++ b/packageB/pages/video/index.js @@ -7,6 +7,7 @@ Page({ }, bindButtonTap: function() { var that = this + getApp().globalData.no_clear=1; wx.chooseVideo({ sourceType: ['album', 'camera'], maxDuration: 60, @@ -34,6 +35,7 @@ Page({ //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1 return { title: "直播视频回放", } diff --git a/packageB/pages/zuhegou/index/index.js b/packageB/pages/zuhegou/index/index.js index 44dbb66..212bfc1 100644 --- a/packageB/pages/zuhegou/index/index.js +++ b/packageB/pages/zuhegou/index/index.js @@ -446,7 +446,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1; var title = this.data.act.name; var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; if (getApp().globalData.user_id) { diff --git a/packageB/pages/zuhegou/list/list.js b/packageB/pages/zuhegou/list/list.js index a9a7bd2..0705750 100644 --- a/packageB/pages/zuhegou/list/list.js +++ b/packageB/pages/zuhegou/list/list.js @@ -198,6 +198,7 @@ Page({ //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1 var curPage=this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/packageB/pages/zuhegou/preindex/index.js b/packageB/pages/zuhegou/preindex/index.js index ee9aacc..b3946ae 100644 --- a/packageB/pages/zuhegou/preindex/index.js +++ b/packageB/pages/zuhegou/preindex/index.js @@ -447,7 +447,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1; var title = this.data.act.name; var url = "/packageB/pages/zuhegou/index/index?id=" + this.data.act.id; if (getApp().globalData.user_id) { diff --git a/packageC/pages/goods/distributionCategoryList/index.js b/packageC/pages/goods/distributionCategoryList/index.js index 29661be..aeab51a 100644 --- a/packageC/pages/goods/distributionCategoryList/index.js +++ b/packageC/pages/goods/distributionCategoryList/index.js @@ -404,6 +404,7 @@ Page({ }, //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1 var url = "pages/goods/categoryList/categoryList"; var userInfo = getApp().globalData.userInfo; @@ -639,9 +640,9 @@ Page({ //扫一扫 getScancode: function () { // 允许从相机和相册扫码 + getApp().globalData.no_clear=1; wx.scanCode({ success: (res) => { - console.log(res); var key_word = res.result; wx.navigateBack({ delta: 1 diff --git a/packageC/pages/goods/goodsList/goodsList.js b/packageC/pages/goods/goodsList/goodsList.js index 9b2df74..743cbcb 100644 --- a/packageC/pages/goods/goodsList/goodsList.js +++ b/packageC/pages/goods/goodsList/goodsList.js @@ -240,6 +240,7 @@ Page({ }, //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1 var curPage = this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/packageC/pages/goods/search/search.js b/packageC/pages/goods/search/search.js index f94fc8b..6c94200 100644 --- a/packageC/pages/goods/search/search.js +++ b/packageC/pages/goods/search/search.js @@ -235,6 +235,7 @@ Page({ //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1 var curPage = this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/packageC/pages/group_list/group_list.js b/packageC/pages/group_list/group_list.js index 14e3197..f39a14d 100644 --- a/packageC/pages/group_list/group_list.js +++ b/packageC/pages/group_list/group_list.js @@ -147,7 +147,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js b/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js index 0c49d3f..6c3aefc 100644 --- a/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js +++ b/packageC/pages/luckyGo/luckyGo_activityList/luckyGo_activityList.js @@ -191,6 +191,7 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function (e) { + getApp().globalData.no_clear=1 var pagePath = this.route; //当前页面url if (pagePath.indexOf('/') != 0) { pagePath = '/' + pagePath; diff --git a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js index 2db8aab..f5bcddd 100644 --- a/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js +++ b/packageC/pages/luckyGo/luckyGo_details/luckyGo_details.js @@ -972,6 +972,7 @@ Page({ //------ 分享配置 -------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1 var pagePath = `packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo?goods_id=${this.data.param.goods_id}&prom_type=9&group_id=${this.data.param.group_id}`; //当前页面url // console.log('pagePath=====xxxxxx>', pagePath); var imgPath = this.data.iurl + this.data.luckyGoInfo.original_img; diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js index 06ea8fd..afa5dd0 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js @@ -19,7 +19,6 @@ var more = function (e) { var utils = require('../../../../utils/util.js'); var regeneratorRuntime = require('../../../../utils/runtime.js'); const { app } = require("../../../../utils/common.js"); -let self = null; Page({ data: { @@ -282,14 +281,11 @@ Page({ surplus: 0, canBuy: false, btnHidden: false, - - hiddenCS: true, //控制客服操作菜单显示和控制 }, //------初始化加载---------- onLoad: function (t) { - self = this; - + // console.log('onload'); if (t && t.group_id) { this.data.group_id = t.group_id; @@ -2252,53 +2248,7 @@ Page({ //---------联系客服------------ contactService: function () { - this.getTel() - .then(() => { - if(self.data.store_tel) { - wx.showModal({ - title: '联系客服', - content: '客服热线:' + self.data.store_tel, - confirmText: '拨打', - success(res) { - if(res.confirm) { - wx.makePhoneCall({ - phoneNumber: self.data.store_tel, - }) - }; - }, - }); - }; - }); - }, - // 获取客服电话 - getTel() { - return new Promise((resolve, reject) => { - s.getConfig(function (t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().my_warnning("商家未设置电话", 0, th); - return false; - } - self.setData({ - store_tel: rs.data.data.store_tel, - }); - // s.confirmBox("请联系客服:" + rs.data.data.store_tel); - } - }) - } else { - self.setData({ - store_tel: t.store_tel, - }); - // s.confirmBox("请联系客服:" + t.store_tel); - }; - resolve(); - }); - }); + getApp().con_Service(); }, //-------获取购物车数量---------- requestCardNum: function () { @@ -6511,36 +6461,7 @@ Page({ click_contact:function () { getApp().globalData.no_clear=1; - }, - - - //打开客服操作菜单 - openCS() { - // csType/在线客服设置: - // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 - // 1小程序客服、 - // 2企业微信客服 - let csType = this.data.sys_switch.weapp_customertype; - if(csType == 0) { - // 获取电话号码 - this.contactService(); - } else { - this.getTel() - .then(() => { - self.setData({ - hiddenCS: false, - }); - }); - - }; - }, - - //关闭客服操作菜单 - closeCS() { - this.setData({ - hiddenCS: true, - }); - }, + } }); diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml index a2f8850..f242e1c 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxml @@ -871,7 +871,7 @@ - - - - - 客服 - + @@ -1652,32 +1647,4 @@ - - - - - - diff --git a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss index 173547f..979fad7 100644 --- a/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss +++ b/packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.wxss @@ -3115,56 +3115,4 @@ button.custom-service::after{ .popup-content { max-height: 600rpx; overflow-y: auto; - } - - - /* 联系客服操作菜单 */ - .action { - position: fixed; - bottom: 100rpx; - z-index: 1; - width: 100%; - background-color: white; - border-radius: 20rpx 20rpx 0 0; - } - - .action .icon-guan { - position: absolute; - left: 20rpx !important; - right: auto !important; - } - - .action .iconfont { - color: #ff7295; - margin-right: 10rpx; - } - - .action button { - text-align: left; - line-height: normal; - } - - .action button::after { - border-width: 0; - } - - .action .btn2 { - box-sizing: border-box; - height: 100rpx; - display: flex; - align-items: center; - } - - .mask2 { - display: none; - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: rgba(0,0,0,.5); - } - - .action.active ~ .mask2 { - display: block; } \ No newline at end of file diff --git a/packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js b/packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js index 78e8384..af2238d 100644 --- a/packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js +++ b/packageC/pages/luckyGo/luckyGo_members/luckyGo_members.js @@ -92,7 +92,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js index 84762b1..c723924 100644 --- a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js +++ b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.js @@ -237,24 +237,7 @@ Page({ }, /*-----联系客户------*/ contactService: function() { - e.getConfig(function(t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().showWarning("商家未设置电话"); - return false; - } - e.confirmBox("请联系客服:" + rs.data.data.store_tel); - } - }) - } else { - e.confirmBox("请联系客服:" + t.store_tel); - } - }); + getApp().con_Service(); }, //--------取消订单--------- @@ -1074,13 +1057,7 @@ Page({ }, con_weixin:function () { - var url=this.data.sys_switch.weapp_customertype_url; - var id=this.data.sys_switch.weapp_customertype_appid; - wx.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: id, - success(res) {} - }) + getApp().con_wx(this); }, //跳转到商品 @@ -1115,6 +1092,11 @@ Page({ // } // }) }, + + + click_contact:function () { + getApp().globalData.no_clear=1; + } diff --git a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml index dc1198b..5d11ee4 100644 --- a/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml +++ b/packageC/pages/luckyGo/luckyGo_order/luckyGo_order.wxml @@ -61,7 +61,7 @@ 查看拼团详情 - + 联系客服 联系客服 diff --git a/packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js b/packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js index e3c1c24..2f6c540 100644 --- a/packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js +++ b/packageC/pages/luckyGo/luckyGo_winners/luckyGo_winners.js @@ -114,7 +114,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageC/pages/presell/cart/cart.js b/packageC/pages/presell/cart/cart.js index 9fdfdd2..64106b5 100644 --- a/packageC/pages/presell/cart/cart.js +++ b/packageC/pages/presell/cart/cart.js @@ -2601,35 +2601,12 @@ Page({ //---------联系客服------------ contactService: function () { - getApp().getConfig(function (t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().my_warnning("商家未设置电话", 0, th); - return false; - } - wx.makePhoneCall({ phoneNumber: rs.data.data.store_tel, }) - } - }) - } else { - wx.makePhoneCall({ phoneNumber: t.store_tel, }) - } - }); + getApp().con_Service(); }, //---------联系微信客服------------ con_weixin: function () { - var url = this.data.sys_switch.weapp_customertype_url; - var id = this.data.sys_switch.weapp_customertype_appid; - wx.openCustomerServiceChat({ - extInfo: { url: url }, - corpId: id, - success(res) { } - }) + getApp().con_wx(this); } diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.js b/packageC/pages/presell/goodsInfo/goodsInfo.js index e260687..987f15d 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.js +++ b/packageC/pages/presell/goodsInfo/goodsInfo.js @@ -16,7 +16,6 @@ var more = function (e) { n = new more.default(); var utils = require('../../../../utils/util.js'); var regeneratorRuntime = require('../../../../utils/runtime.js'); -let self = null; Page({ data: { @@ -249,13 +248,10 @@ Page({ share_hidden: false, pre_arr: null, - - hiddenCS: true, }, //------初始化加载---------- onLoad: function (t) { - self = this; var ee = this, that = ee, th = ee, pre_id = t.pre_id, gid = t.goods_id, @@ -1434,55 +1430,8 @@ Page({ //---------联系客服------------ contactService: function () { - this.getTel() - .then(() => { - if(self.data.store_tel) { - wx.showModal({ - title: '联系客服', - content: '客服热线:' + self.data.store_tel, - confirmText: '拨打', - success(res) { - if(res.confirm) { - wx.makePhoneCall({ - phoneNumber: self.data.store_tel, - }) - }; - }, - }); - }; - }); - }, - // 获取客服电话 - getTel() { - return new Promise((resolve, reject) => { - s.getConfig(function (t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().my_warnning("商家未设置电话", 0, th); - return false; - } - self.setData({ - store_tel: rs.data.data.store_tel, - }); - // s.confirmBox("请联系客服:" + rs.data.data.store_tel); - } - }) - } else { - self.setData({ - store_tel: t.store_tel, - }); - // s.confirmBox("请联系客服:" + t.store_tel); - }; - resolve(); - }); - }); + getApp().con_Service(); }, - //-------获取购物车数量---------- requestCardNum: function () { var t = this; @@ -4050,35 +3999,6 @@ Page({ click_contact:function () { getApp().globalData.no_clear=1; - }, - - - //打开客服操作菜单 - openCS() { - // csType/在线客服设置: - // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 - // 1小程序客服、 - // 2企业微信客服 - let csType = this.data.sys_switch.weapp_customertype; - if(csType == 0) { - // 获取电话号码 - this.contactService(); - } else { - this.getTel() - .then(() => { - self.setData({ - hiddenCS: false, - }); - }); - - }; - }, - - //关闭客服操作菜单 - closeCS() { - this.setData({ - hiddenCS: true, - }); - }, + } }); diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.wxml b/packageC/pages/presell/goodsInfo/goodsInfo.wxml index dbeb456..0caf452 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.wxml +++ b/packageC/pages/presell/goodsInfo/goodsInfo.wxml @@ -495,7 +495,7 @@ - - - - - 客服 - - + @@ -955,33 +949,3 @@ - - - - - - - - diff --git a/packageC/pages/presell/goodsInfo/goodsInfo.wxss b/packageC/pages/presell/goodsInfo/goodsInfo.wxss index 46b4008..bff91ce 100644 --- a/packageC/pages/presell/goodsInfo/goodsInfo.wxss +++ b/packageC/pages/presell/goodsInfo/goodsInfo.wxss @@ -1614,7 +1614,6 @@ left:31rpx;} .icon-share { font-size: 46rpx; color: #d60021; - line-height: 1; } .xc-share-frame{ /* width: 129rpx; @@ -2833,7 +2832,7 @@ button.custom-service::after{ } .icon-close { - font-size: 42rpx; + font-size: 48rpx; } .quan_price{ background-color: #ff4700; color: #fff; padding: 10rpx 25rpx; margin-left: 10rpx; border-radius: 30rpx; @@ -2916,56 +2915,3 @@ button.custom-service::after{ margin-right: 10rpx; } - - -/* 联系客服操作菜单 */ -.action { - position: fixed; - bottom: 100rpx; - z-index: 1; - width: 100%; - background-color: white; - border-radius: 20rpx 20rpx 0 0; -} - -.action .icon-guan { - position: absolute; - left: 20rpx !important; - right: auto !important; -} - -.action .iconfont { - color: #ff7295; - margin-right: 10rpx; -} - -.action button { - text-align: left; - line-height: normal; -} - -.action button::after { - border-width: 0; -} - -.action .btn2 { - box-sizing: border-box; - height: 100rpx; - display: flex; - align-items: center; -} - -.mask2 { - display: none; - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: rgba(0,0,0,.5); -} - -.action.active ~ .mask2 { - display: block; -} - diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.js b/packageC/pages/presell/pregoodsInfo/goodsInfo.js index 412d4c7..d4302b4 100644 --- a/packageC/pages/presell/pregoodsInfo/goodsInfo.js +++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.js @@ -1431,24 +1431,7 @@ Page({ //---------联系客服------------ contactService: function () { - s.getConfig(function (t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().my_warnning("商家未设置电话", 0, th); - return false; - } - s.confirmBox("请联系客服:" + rs.data.data.store_tel); - } - }) - } else { - s.confirmBox("请联系客服:" + t.store_tel); - } - }); + getApp().con_Service(); }, //-------获取购物车数量---------- requestCardNum: function () { @@ -1489,11 +1472,7 @@ Page({ b[i] = this.data.iurl + e[i]; } this.data.show_prew_img = 1; - - wx.previewImage({ - current: b[t.currentTarget.dataset.id], - urls: b - }); + getApp().pre_img2(b,t) }, previewCommentImgs_w: function (t) { @@ -1503,21 +1482,16 @@ Page({ b[i] = this.data.iurl + e[i]; } this.data.show_prew_img = 1; - wx.previewImage({ - current: b[t.currentTarget.dataset.id], - urls: b - }); + getApp().pre_img2(b,t) }, previewGoodsCommentImgs: function (t) { var e = this, a = this.data.data.comment[t.currentTarget.dataset.cidx].img; + getApp().globalData.no_clear=1; a = a.map(function (t) { return e.data.url + t; - }), wx.previewImage({ - current: a[t.currentTarget.dataset.id], - urls: a - }); + }), getApp().pre_img2(a,t); this.data.show_prew_img = 1; }, closePromModal: function () { @@ -1532,7 +1506,7 @@ Page({ }, //--点击分享事件--- - onShareAppMessage: function (t) { + onShareAppMessage: function (t) { getApp().globalData.no_clear=1; var th = this; var price = th.data.pre_arr.presell_price; @@ -3814,10 +3788,7 @@ Page({ previewImage() { this.data.show_prew_img = 1; - wx.previewImage({ - //将图片预览出来 - urls: [this.data.shareImgPath] - }); + getApp().pre_img(this.data.shareImgPath); }, @@ -4014,13 +3985,12 @@ Page({ }, con_weixin:function () { - var url=this.data.sys_switch.weapp_customertype_url; - var id=this.data.sys_switch.weapp_customertype_appid; - wx.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: id, - success(res) {} - }) + getApp().con_wx(this); + }, + + + click_contact:function () { + getApp().globalData.no_clear=1; } }); diff --git a/packageC/pages/presell/pregoodsInfo/goodsInfo.wxml b/packageC/pages/presell/pregoodsInfo/goodsInfo.wxml index 3bb3c54..a80ff81 100644 --- a/packageC/pages/presell/pregoodsInfo/goodsInfo.wxml +++ b/packageC/pages/presell/pregoodsInfo/goodsInfo.wxml @@ -495,7 +495,7 @@ - diff --git a/packageD/pages/AI-test-skin/history_record/history_record.js b/packageD/pages/AI-test-skin/history_record/history_record.js index 598d574..1d1aec6 100644 --- a/packageD/pages/AI-test-skin/history_record/history_record.js +++ b/packageD/pages/AI-test-skin/history_record/history_record.js @@ -344,7 +344,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 } }) \ No newline at end of file diff --git a/packageD/pages/AI-test-skin/history_record/history_record.wxml b/packageD/pages/AI-test-skin/history_record/history_record.wxml index 70fb98e..4fd17de 100644 --- a/packageD/pages/AI-test-skin/history_record/history_record.wxml +++ b/packageD/pages/AI-test-skin/history_record/history_record.wxml @@ -11,7 +11,7 @@ 历史报告 - + {{item.history_time}} @@ -19,7 +19,7 @@ 去查看 - + - 没有更多了 - \ No newline at end of file diff --git a/packageD/pages/AI-test-skin/index/aiskin.js b/packageD/pages/AI-test-skin/index/aiskin.js index 1b36232..7024cbc 100644 --- a/packageD/pages/AI-test-skin/index/aiskin.js +++ b/packageD/pages/AI-test-skin/index/aiskin.js @@ -101,7 +101,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/packageD/pages/AI-test-skin/select_photo/select_photo.js b/packageD/pages/AI-test-skin/select_photo/select_photo.js index bc32fd8..995d321 100644 --- a/packageD/pages/AI-test-skin/select_photo/select_photo.js +++ b/packageD/pages/AI-test-skin/select_photo/select_photo.js @@ -52,6 +52,7 @@ Page({ //-- 重新从相册中选择图片 -- show_pai_pop: function () { var th = this; + getApp().globalData.no_clear=1; //选择和拍照一张图片 wx.chooseImage({ count: 1, @@ -70,6 +71,7 @@ Page({ //选择图片 takePhoto() { var that = this; + getApp().globalData.no_clear=1; wx.chooseImage({ count: 1, sizeType: ['compressed'], diff --git a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js index 6004d73..8dc2547 100644 --- a/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js +++ b/packageD/pages/AI-test-skin/shoot_notice/shoot_notice.js @@ -68,13 +68,14 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, //从相册中选择图片 show_pai_pop: function () { let th = this; + getApp().globalData.no_clear=1; //选择和拍照一张图片 wx.chooseImage({ count: 1, @@ -98,7 +99,7 @@ Page({ //选择图片 takePhoto() { var that = this; - + getApp().globalData.no_clear=1; wx.chooseImage({ count: 1, sizeType: ['compressed'], 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 2f57173..1313c21 100644 --- a/packageD/pages/AI-test-skin/success_result/success_result.js +++ b/packageD/pages/AI-test-skin/success_result/success_result.js @@ -1,7 +1,7 @@ /* * @Author: abson * @Date: 2022-02-16 15:36:47 - * @LastEditTime: 2022-03-10 11:16:23 + * @LastEditTime: 2022-02-28 16:01:07 * @LastEditors: Please set LastEditors * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @FilePath: \MShopWeApp\packageB\pages\AI-test-skin\success_result\success_result.js @@ -63,7 +63,14 @@ Page({ }, onReady: function () { - + //用异步的获取比较准一点 + wx.getSystemInfo({ + success(res) { + console.log(111); + console.log(res.windowWidth); + console.log(res.windowHeight); + } + }) }, /** @@ -76,7 +83,29 @@ Page({ this.init(); //var face_result=getApp().globalData.face_result; //var face_data=face_result.face_list[0]; - this.data.id = options.id; + var id=options.id; + var first_leader = options.first_leader; + + if (id == undefined || id == null || id == "") { + var gid_str = decodeURIComponent(options.scene); + gid_str = gid_str.split("_"); + id=gid_str[0]; + if (gid_str.length > 1) { + first_leader = gid_str[1]; + } + } + + this.data.id=id; + 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; + } + }) + } //用异步的获取比较准一点 wx.getSystemInfo({ @@ -127,6 +156,7 @@ Page({ var eye_data1 = face_data1.landmark150.eye_left_corner_right; var eye_data2 = face_data1.landmark150.eye_left_corner_left; var eye_data3 = face_data1.landmark150.eye_right_corner_right; + var hei1 = Math.abs(eye_data1.x - eye_data2.x); var bili_eye = th.data.face_height * 0.56 / hei1; var eye_top = eye_data1.y - hei1 / 2 @@ -582,7 +612,15 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function () { + getApp().globalData.no_clear=1; + var url="packageD/pages/AI-test-skin/success_result/success_result?id="+this.data.id+"&first_leader="+getApp().globalData.user_id; + + var ob = { + title: "测肤报告", + path: url, + }; + return ob; }, //商品页面跳转 @@ -740,7 +778,7 @@ Page({ } ///二微码 var path3 = setting.url + "/api/wx/open/app/user/getWeAppEwm/" + - setting.stoid + "?sceneValue=" + scene + "&pageValue=pages/goods/goodsInfo/goodsInfo"; + setting.stoid + "?sceneValue=" + scene + "&pageValue=packageD/pages/AI-test-skin/success_result/success_result"; // 读取文件成功则OK-- wx.getImageInfo({ diff --git a/pages/activity/pind_list/pind_list.js b/pages/activity/pind_list/pind_list.js index 05e480a..cab2cae 100644 --- a/pages/activity/pind_list/pind_list.js +++ b/pages/activity/pind_list/pind_list.js @@ -195,6 +195,7 @@ Page({ //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1; var curPage = this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/pages/activity/seckill_list/seckill_list.js b/pages/activity/seckill_list/seckill_list.js index 0c27e38..c979b9c 100644 --- a/pages/activity/seckill_list/seckill_list.js +++ b/pages/activity/seckill_list/seckill_list.js @@ -233,6 +233,7 @@ Page({ //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1; var curPage = this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 1a8bf71..e388ee1 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -2257,6 +2257,8 @@ Page({ var order_prom_txt1 = "formData.order_prom_id"; var order_prom_txt2 = "formData.order_prom_amount"; th.setData({ [order_prom_txt1]: 0, [order_prom_txt2]: 0 }) + + total_m = parseFloat(total_m) + parseFloat(th.data.formData.shipping_price); order_m = parseFloat(order_m) + parseFloat(th.data.formData.shipping_price); var atxt = "formData.total_amount"; diff --git a/pages/cart/cart_wk/cart_wk.js b/pages/cart/cart_wk/cart_wk.js index 3ac786a..2028d93 100644 --- a/pages/cart/cart_wk/cart_wk.js +++ b/pages/cart/cart_wk/cart_wk.js @@ -94,7 +94,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { }, + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, //---------------获取物流--------------- get_wuliu(func) { var th = this, diff --git a/pages/distribution/distribution.js b/pages/distribution/distribution.js index 5dd2c3c..f249f87 100644 --- a/pages/distribution/distribution.js +++ b/pages/distribution/distribution.js @@ -233,7 +233,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/pages/giftpack/mygiftpack/mygiftpack.js b/pages/giftpack/mygiftpack/mygiftpack.js index 8e0d3d7..13ae8ac 100644 --- a/pages/giftpack/mygiftpack/mygiftpack.js +++ b/pages/giftpack/mygiftpack/mygiftpack.js @@ -163,6 +163,7 @@ Page({ //--- 分享设置 -- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1; var curPage = this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index 03a553e..305c0e8 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -627,7 +627,7 @@ Page({ //---------分享配置-------- onShareAppMessage: function (e) { - + getApp().globalData.no_clear=1; var url="pages/goods/categoryList/categoryList"; var userInfo=getApp().globalData.userInfo; //是分销商才带 @@ -799,6 +799,7 @@ Page({ //扫一扫 getScancode:function(){ var _this = this; + getApp().globalData.no_clear=1; // 允许从相机和相册扫码 wx.scanCode({ success: (res) => { diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 6777d3c..ede09bf 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -255,8 +255,6 @@ Page({ share_hidden: false, all_activity_list: null, //所有活动的列表 - hiddenCS: true, //控制客服操作菜单 - }, //------初始化加载---------- @@ -2290,55 +2288,8 @@ Page({ //---------联系客服------------ contactService: function () { - this.getTel() - .then(() => { - if(self.data.store_tel) { - wx.showModal({ - title: '联系客服', - content: '客服热线:' + self.data.store_tel, - confirmText: '拨打', - success(res) { - if(res.confirm) { - wx.makePhoneCall({ - phoneNumber: self.data.store_tel, - }) - }; - }, - }); - }; - }); + getApp().con_Service(); }, - // 获取客服电话 - getTel() { - return new Promise((resolve, reject) => { - s.getConfig(function (t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().my_warnning("商家未设置电话", 0, th); - return false; - } - self.setData({ - store_tel: rs.data.data.store_tel, - }); - // s.confirmBox("请联系客服:" + rs.data.data.store_tel); - } - }) - } else { - self.setData({ - store_tel: t.store_tel, - }); - // s.confirmBox("请联系客服:" + t.store_tel); - }; - resolve(); - }); - }); - }, - //-------获取购物车数量---------- requestCardNum: function () { var t = this; @@ -6659,36 +6610,7 @@ Page({ click_contact:function () { getApp().globalData.no_clear=1; - }, - - - //打开客服操作菜单 - openCS() { - // csType/在线客服设置: - // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 - // 1小程序客服、 - // 2企业微信客服 - let csType = this.data.sys_switch.weapp_customertype; - if(csType == 0) { - // 获取电话号码 - this.contactService(); - } else { - this.getTel() - .then(() => { - self.setData({ - hiddenCS: false, - }); - }); - - }; - }, - - //关闭客服操作菜单 - closeCS() { - this.setData({ - hiddenCS: true, - }); - } + } diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index cd9cd45..b038c3f 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -274,9 +274,8 @@ - - {{data.goods_name}} - + {{data.goods_name}} + 销量:{{prom_act.buy_num+prom_act.virtual}}件 @@ -392,7 +391,6 @@ - {{data.goods_name}} @@ -1012,8 +1010,18 @@ + + + + + + 客服 + - + 客服 @@ -1710,32 +1718,3 @@ - - - - - - - diff --git a/pages/goods/goodsInfo/goodsInfo.wxss b/pages/goods/goodsInfo/goodsInfo.wxss index 307929c..9d08642 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxss +++ b/pages/goods/goodsInfo/goodsInfo.wxss @@ -126,9 +126,7 @@ image { .goods-title { display: flex; - justify-content: space-between; - align-items: center; - vertical-align: middle; + justify-content: space-between; /* overflow: hidden; */ /* height: 108rpx; */ } @@ -4004,54 +4002,3 @@ button.custom-service::after { left: -1000px; top: -1000px; } - - - - -/* 联系客服操作菜单 */ -.action { - position: fixed; - bottom: 100rpx; - z-index: 1; - width: 100%; - background-color: white; - border-radius: 20rpx 20rpx 0 0; -} - -.action .icon-guan { - position: absolute; - left: 20rpx !important; - right: auto !important; -} - -.action .iconfont { - color: #ff7295; - margin-right: 10rpx; -} - -.action button { - text-align: left; - line-height: normal; -} - -.action .btn2 { - box-sizing: border-box; - height: 100rpx; - display: flex; - align-items: center; -} - -.mask2 { - display: none; - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: rgba(0,0,0,.5); -} - -.action.active ~ .mask2 { - display: block; -} - diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index 4fe7bfe..d9c2b91 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -380,6 +380,7 @@ Page({ }, //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1; var curPage=this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/pages/goods/search/search.js b/pages/goods/search/search.js index 1776180..1909d73 100644 --- a/pages/goods/search/search.js +++ b/pages/goods/search/search.js @@ -389,6 +389,7 @@ Page({ //---------分享配置-------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1; var curPage=this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/pages/index/index/index.js b/pages/index/index/index.js index dedb298..7c4b123 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -84,7 +84,6 @@ Page({ full_ad: null, //全屏广告 full_screen: 0, //全屏广告 is_ok_h5:0, //判断要不要显示关注二维码 - }, onLoad: async function (tt) { @@ -223,18 +222,20 @@ Page({ //如果是自定义模板 if (this.data.isTemplate) { //---先获取会员--- - t.getUserFir(function () { - th.is_festival(); - var new_nav = th.data.new_nav; - if (new_nav == "") { - th.is_new(); - } - // sty - setTimeout(function () { - if (getApp().globalData.user_id) getApp().requestCardNum(th); - }, 500) + //t.getUserFir(function () { + if(getApp().globalData.user_id) { + th.is_festival(); + var new_nav = th.data.new_nav; + if (new_nav == "") { + th.is_new(); + } + // sty + setTimeout(function () { + if (getApp().globalData.user_id) getApp().requestCardNum(th); + }, 500) + } - }); + //}); } else { await this.init_fir(); wx.setNavigationBarColor({ @@ -428,29 +429,18 @@ Page({ var th = this; var show = getApp().globalData.isLoad_ad; - setTimeout(function () { - //user没有及时更新 - var userInfo = getApp().globalData.userInfo; - if (!userInfo || !userInfo.user_id) userInfo = null; - //有加载过一次首页,就显示 - if (show || userInfo || getApp().globalData.user_id) { + if(!show){ setTimeout(function () { - full_screen.get_the_full_screen(th); - }, 800) - //动画效果 + full_screen.get_the_full_screen(th); + }, 800); + getApp().globalData.isLoad_ad=1; if (!th.data.f_hidden) { - wx.showLoading({ - title: '加载中..' - }); - setTimeout(function () { - th.setData({ f_hidden: 1 }) - wx.hideLoading(); - }, 960) + setTimeout(function () { + th.setData({ f_hidden: 1 }) + wx.hideLoading(); + }, 960) } - } else { - getApp().globalData.isLoad_ad = 1; - } - }, 1500) + } setTimeout(function () { const query = wx.createSelectorQuery(); @@ -649,19 +639,20 @@ Page({ }); //---先获取会员--- - t.getUserFir(function () { - th.is_festival(); - var new_nav = th.data.new_nav; - if (new_nav == "") { - th.is_new(); - } - - // sty - setTimeout(function () { - if (getApp().globalData.user_id) getApp().requestCardNum(th); - }, 500) + //t.getUserFir(function () { + if(getApp().globalData.user_id) { + th.is_festival(); + var new_nav = th.data.new_nav; + if (new_nav == "") { + th.is_new(); + } - }); + // sty + setTimeout(function () { + if (getApp().globalData.user_id) getApp().requestCardNum(th); + }, 500) + } + //}); setTimeout(function () { var goods_list = th.selectComponent("#goods_list"); //组件的id @@ -743,6 +734,7 @@ Page({ }); }, onShareAppMessage: function (e) { + getApp().globalData.no_clear=1; var url = "/pages/index/index/index"; var userInfo = getApp().globalData.userInfo; //是分销商才带 @@ -938,6 +930,7 @@ Page({ //---扫一扫的函数--- getScancode: function () { var _this = this; + getApp().globalData.no_clear=1; // 允许从相机和相册扫码 wx.scanCode({ success: (res) => { diff --git a/pages/team/team_show/team_show.js b/pages/team/team_show/team_show.js index 0f00042..ccb5cec 100644 --- a/pages/team/team_show/team_show.js +++ b/pages/team/team_show/team_show.js @@ -959,6 +959,7 @@ Page({ //------ 分享配置 -------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1; var curPage=this; var pagePath = curPage.route; //当前页面url if (pagePath.indexOf('/') != 0) { diff --git a/pages/team/team_success/team_success.js b/pages/team/team_success/team_success.js index 0d85179..4ba41e5 100644 --- a/pages/team/team_success/team_success.js +++ b/pages/team/team_success/team_success.js @@ -817,6 +817,7 @@ Page({ //------ 分享配置 -------- onShareAppMessage: function (e) { + getApp().globalData.no_clear=1; var th=this; var scene=this.data.teamgroup.id; var goods_id=this.data.teamlist.goods_id; diff --git a/pages/template/index.js b/pages/template/index.js index 8a3e50c..3cfd960 100644 --- a/pages/template/index.js +++ b/pages/template/index.js @@ -94,7 +94,7 @@ Page({ }, onShareAppMessage: function(e) { - + getApp().globalData.no_clear=1; }, /** diff --git a/pages/user/Detailed/Detailed.js b/pages/user/Detailed/Detailed.js index f87cb44..16cdf46 100644 --- a/pages/user/Detailed/Detailed.js +++ b/pages/user/Detailed/Detailed.js @@ -184,7 +184,7 @@ Page({ saveImageToPhotosAlbum: function () { if (this.data.imagePath != "") { - wx.previewImage({ urls: [this.data.imagePath], }) + getApp().pre_img(this.data.imagePath); return; } @@ -372,9 +372,8 @@ Page({ maskHidden: false, canvasHidden: true }); - wx.previewImage({ - urls: [res.tempFilePath], - }) + + getApp().pre_img(res.tempFilePath); if (!res.tempFilePath) { wx.showModal({ title: '提示', diff --git a/pages/user/address_list/address_list.js b/pages/user/address_list/address_list.js index 9d96d5b..ccd16f0 100644 --- a/pages/user/address_list/address_list.js +++ b/pages/user/address_list/address_list.js @@ -152,8 +152,10 @@ Page({ var th=this; wx.getSetting({ success(res) { - console.log("vres.authSetting['scope.address']:", res.authSetting['scope.address']) + getApp().globalData.no_clear=1; + console.log("vres.authSetting['scope.address']:", res.authSetting['scope.address']); if (res.authSetting['scope.address']) { + getApp().globalData.no_clear=1; wx.chooseAddress({ success(res) { th.save_wx_addr(res); @@ -162,12 +164,13 @@ Page({ } else { if (res.authSetting['scope.address'] == false) { - console.log("222") + getApp().globalData.no_clear=1; wx.openSetting({ success(res) {} }) } else { - + + getApp().globalData.no_clear=1; wx.chooseAddress({ success(res) { th.save_wx_addr(res); @@ -199,5 +202,8 @@ Page({ } }) - } + }, + + + }); \ No newline at end of file diff --git a/pages/user/assistance/assistance.js b/pages/user/assistance/assistance.js index 1d13f42..870dfb8 100644 --- a/pages/user/assistance/assistance.js +++ b/pages/user/assistance/assistance.js @@ -229,6 +229,7 @@ Page({ }, onShareAppMessage(res) { + getApp().globalData.no_clear=1; if (res.from === 'button') { // 来自页面内转发按钮 console.log(res.target) diff --git a/pages/user/assistance/friend_assistance.js b/pages/user/assistance/friend_assistance.js index 6d9d51e..7e5df72 100644 --- a/pages/user/assistance/friend_assistance.js +++ b/pages/user/assistance/friend_assistance.js @@ -171,7 +171,7 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function() { - + getApp().globalData.no_clear=1; }, }) diff --git a/pages/user/assistance/task_assistance.js b/pages/user/assistance/task_assistance.js index 7857e94..aac604a 100644 --- a/pages/user/assistance/task_assistance.js +++ b/pages/user/assistance/task_assistance.js @@ -671,13 +671,14 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, preview: function () { var th = this; var shareImgPath = th.data.shareImgPath; + getApp().globalData.no_clear=1; wx.previewImage({ url: shareImgPath[0], urls: shareImgPath @@ -920,6 +921,7 @@ Page({ preview: function () { var th = this; var shareImgPath = th.data.shareImgPath; + getApp().globalData.no_clear=1; wx.previewImage({ url: shareImgPath[0], urls: shareImgPath diff --git a/pages/user/cardinfo/cardinfo.js b/pages/user/cardinfo/cardinfo.js index 7979aad..cc69cfa 100644 --- a/pages/user/cardinfo/cardinfo.js +++ b/pages/user/cardinfo/cardinfo.js @@ -324,12 +324,11 @@ Page({ */ saveImageToPhotosAlbum: function () { if (this.data.imagePath != "") { - wx.previewImage({ - urls: [this.data.imagePath], - }) + getApp().pre_img(this.data.imagePath); return; } - // if(this.data.is_loading) return false ; + + //if(this.data.is_loading) return false ; this.data.is_loading=1; wx.showLoading({ @@ -607,9 +606,7 @@ Page({ maskHidden: false, canvasHidden: true }); - wx.previewImage({ - urls: [res.tempFilePath], - }) + getApp().pre_img(res.tempFilePath); if (!res.tempFilePath) { wx.showModal({ title: '提示', diff --git a/pages/user/cardinfo/cardinfo.wxml b/pages/user/cardinfo/cardinfo.wxml index 2341d85..bbdb261 100644 --- a/pages/user/cardinfo/cardinfo.wxml +++ b/pages/user/cardinfo/cardinfo.wxml @@ -19,16 +19,16 @@ - 立即续费 + 立即续费 - 卡类变更 + 卡类变更 - 卡类升级 + 卡类升级 - 购卡明细 + 购卡明细 diff --git a/pages/user/deposit/prepaid/msg/msg.js b/pages/user/deposit/prepaid/msg/msg.js index bc9d3ea..6dd0989 100644 --- a/pages/user/deposit/prepaid/msg/msg.js +++ b/pages/user/deposit/prepaid/msg/msg.js @@ -105,7 +105,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 } }) \ No newline at end of file diff --git a/pages/user/index/index.js b/pages/user/index/index.js index a3d072f..cd23628 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -11,7 +11,6 @@ const { qrcode } = require('../../../utils/index.js'); var ut = require("../../../utils/util.js"); -let self = null; Page({ /** @@ -45,7 +44,7 @@ Page({ ad_img:"", add_card_data:'', //等级卡的内容 - hiddenCS: true, + }, goto_nav: function(e) { var th = this; @@ -63,7 +62,6 @@ Page({ */ onLoad: function(options) { var th=this; - self = this; getApp().request.get("/api/weshop/ad/page?pid=401&store_id=" + os.stoid, { data: { enabled: 1 @@ -705,60 +703,8 @@ Page({ //---------联系客服------------ contactService: function() { - this.getTel() - .then(() => { - if(self.data.store_tel) { - wx.showModal({ - title: '联系客服', - content: '客服热线:' + self.data.store_tel, - confirmText: '拨打', - success(res) { - if(res.confirm) { - wx.makePhoneCall({ - phoneNumber: self.data.store_tel, - }) - }; - }, - }); - }; - }); - }, - - // 获取客服热线 - getTel() { - return new Promise((resolve, reject) => { - var self = this; - var s = getApp(); - s.getConfig(function(t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function(rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().showWarning("商家未设置电话"); - return false; - } else { - self.setData({ - store_tel: rs.data.data.store_tel, - }); - // s.confirmBox("客服热线:" + rs.data.data.store_tel); - }; - - } - }) - } else { - self.setData({ - store_tel: t.store_tel, - }); - // s.confirmBox("客服热线:" + t.store_tel); - } - resolve(); - }); - }); - }, - + getApp().con_Service(); + }, go_info: function() { getApp().goto("/pages/user/userinfo/userinfo"); @@ -934,39 +880,6 @@ Page({ this.setData({user_tool:d_list}); }, - - - //打开客服操作菜单 - openCS() { - // csType/在线客服设置: - // 0关闭(如果有设置热线电话,则显示拨打热线电话)、 - // 1小程序客服、 - // 2企业微信客服 - let csType = this.data.sys_switch.weapp_customertype; - if(csType == 0) { - // 获取电话号码 - this.contactService(); - } else { - this.getTel() - .then(() => { - self.setData({ - hiddenCS: false, - }); - }); - - }; - }, - - //关闭客服操作菜单 - closeCS() { - this.setData({ - hiddenCS: true, - }); - }, - - - - click_contact:function () { getApp().globalData.no_clear=1; @@ -976,5 +889,4 @@ Page({ - }) diff --git a/pages/user/index/index.wxml b/pages/user/index/index.wxml index 269b4c5..3b49e96 100644 --- a/pages/user/index/index.wxml +++ b/pages/user/index/index.wxml @@ -261,7 +261,7 @@ - - - - - 联系客服 - + @@ -351,34 +346,4 @@ - - - - - - - - - + \ No newline at end of file diff --git a/pages/user/index/index.wxss b/pages/user/index/index.wxss index 0575e7d..5d208f0 100644 --- a/pages/user/index/index.wxss +++ b/pages/user/index/index.wxss @@ -739,50 +739,4 @@ button::after{ border: 0} .c-5 { color: #555; -} - -.action { - position: fixed; - bottom: 100rpx; - z-index: 1; - width: 100%; - background-color: white; - border-radius: 20rpx 20rpx 0 0; -} - -.action .icon-guan { - position: absolute; - right: 20rpx; -} - -.action .iconfont { - color: #ff7295; - margin-right: 10rpx; -} - -.action button { - text-align: left; - line-height: normal; -} - -.action .btn { - box-sizing: border-box; - height: 100rpx; - display: flex; - align-items: center; -} - -.mask { - display: none; - position: fixed; - left: 0; - right: 0; - top: 0; - bottom: 0; - background-color: rgba(0,0,0,.5); -} - -.action.active ~ .mask { - display: block; -} - +} \ No newline at end of file diff --git a/pages/user/integral/integral.js b/pages/user/integral/integral.js index ab3d4f2..77ee2e7 100644 --- a/pages/user/integral/integral.js +++ b/pages/user/integral/integral.js @@ -350,7 +350,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/pages/user/integral/msg/msg.js b/pages/user/integral/msg/msg.js index 9b67c67..2764231 100644 --- a/pages/user/integral/msg/msg.js +++ b/pages/user/integral/msg/msg.js @@ -104,7 +104,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 } }) \ No newline at end of file diff --git a/pages/user/member/bring/bring.js b/pages/user/member/bring/bring.js index 0b301bb..6b127fe 100644 --- a/pages/user/member/bring/bring.js +++ b/pages/user/member/bring/bring.js @@ -407,6 +407,6 @@ Page({ * 用户点击右上角分享 */ onShareAppMessage: function() { - + getApp().globalData.no_clear=1; } }) \ No newline at end of file diff --git a/pages/user/member/bring/msg/msg.js b/pages/user/member/bring/msg/msg.js index 10bf1bd..07780b1 100644 --- a/pages/user/member/bring/msg/msg.js +++ b/pages/user/member/bring/msg/msg.js @@ -99,7 +99,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 } }) \ No newline at end of file diff --git a/pages/user/member/menber.js b/pages/user/member/menber.js index f02ec40..8eea293 100644 --- a/pages/user/member/menber.js +++ b/pages/user/member/menber.js @@ -154,7 +154,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 } }) \ No newline at end of file diff --git a/pages/user/my_service/beauty_deta.js b/pages/user/my_service/beauty_deta.js index 83ece7b..d49c9c3 100644 --- a/pages/user/my_service/beauty_deta.js +++ b/pages/user/my_service/beauty_deta.js @@ -393,6 +393,7 @@ Page({ previewImage: function (e) { var th = this; var current = e.currentTarget.dataset.src; + getApp().globalData.no_clear=1; wx.previewImage({ current: current, // 当前显示图片的http链接 urls: [th.data.head_img] // 需要预览的图片http链接列表 diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js index 1a91a14..960f5e0 100644 --- a/pages/user/order_detail/order_detail.js +++ b/pages/user/order_detail/order_detail.js @@ -253,24 +253,7 @@ Page({ }, /*-----联系客户------*/ contactService: function() { - e.getConfig(function(t) { - if (t.store_tel == undefined) { - getApp().request.get("/api/weshop/store/get/" + os.stoid, { - isShowLoading: 1, - data: {}, - success: function (rs) { - getApp().globalData.config = rs.data.data; - if (rs.data.data.store_tel == null && rs.data.data.store_tel == undefined) { - getApp().showWarning("商家未设置电话"); - return false; - } - e.confirmBox("请联系客服:" + rs.data.data.store_tel); - } - }) - } else { - e.confirmBox("请联系客服:" + t.store_tel); - } - }); + getApp().con_Service(); }, //--------取消订单--------- @@ -1632,13 +1615,7 @@ Page({ }, con_weixin:function () { - var url=this.data.sys_switch.weapp_customertype_url; - var id=this.data.sys_switch.weapp_customertype_appid; - wx.openCustomerServiceChat({ - extInfo: {url: url}, - corpId: id, - success(res) {} - }) + getApp().con_wx(this); }, //跳转到商品 @@ -1675,6 +1652,12 @@ Page({ getApp().goto(good_url); } }) + }, + + + + click_contact:function () { + getApp().globalData.no_clear=1; } diff --git a/pages/user/order_detail/order_detail.wxml b/pages/user/order_detail/order_detail.wxml index 72ce859..9a97f62 100644 --- a/pages/user/order_detail/order_detail.wxml +++ b/pages/user/order_detail/order_detail.wxml @@ -54,7 +54,7 @@ 查看拼团详情 - + 联系客服 联系客服 @@ -77,7 +77,10 @@ 配送方式 - {{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'自提'}} + + -- + + {{(order.shipping_name!=''&& order.shipping_name!=null) ?order.shipping_name:'自提'}} 买家留言 diff --git a/pages/user/plus/plus.wxml b/pages/user/plus/plus.wxml index afaf81c..b434572 100644 --- a/pages/user/plus/plus.wxml +++ b/pages/user/plus/plus.wxml @@ -23,7 +23,7 @@ {{item.CardName}} 开通会员卡仅{{item.CardFee}}元 - 立即购买 + 立即购买 diff --git a/pages/user/return_goods_info/return_goods_info.js b/pages/user/return_goods_info/return_goods_info.js index 63e4103..4480a49 100644 --- a/pages/user/return_goods_info/return_goods_info.js +++ b/pages/user/return_goods_info/return_goods_info.js @@ -158,6 +158,7 @@ Page({ }, previewImgs: function(e) { var t = this, r = this.data.return_goods.imgs; + getApp().globalData.no_clear=1; r = r.map(function(e) { return t.data.url + e; }), wx.previewImage({ diff --git a/pages/user/user_spsy/user_spsy.js b/pages/user/user_spsy/user_spsy.js index 5ee5215..df3d87f 100644 --- a/pages/user/user_spsy/user_spsy.js +++ b/pages/user/user_spsy/user_spsy.js @@ -116,7 +116,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, diff --git a/pages/user/userinfo/userinfo.js b/pages/user/userinfo/userinfo.js index e2736ee..8cfde67 100644 --- a/pages/user/userinfo/userinfo.js +++ b/pages/user/userinfo/userinfo.js @@ -834,6 +834,7 @@ Page({ changeAvatar: function() { return false; var r = this; + getApp().globalData.no_clear=1; wx.chooseImage({ count: 1, sizeType: ["compressed", "original"], @@ -996,6 +997,7 @@ Page({ //--点击分享事件--- onShareAppMessage: function(t) { + getApp().globalData.no_clear=1; return o.share; }, diff --git a/pages/user/userqy/userqy.js b/pages/user/userqy/userqy.js index 574c301..f0a4579 100644 --- a/pages/user/userqy/userqy.js +++ b/pages/user/userqy/userqy.js @@ -158,7 +158,7 @@ Page({ /** * 用户点击右上角分享 */ - onShareAppMessage: function () { + onShareAppMessage: function () { getApp().globalData.no_clear=1 }, //--新品使用-- diff --git a/pages/user/userqy/userqy.wxml b/pages/user/userqy/userqy.wxml index af7545f..9c8cfd6 100644 --- a/pages/user/userqy/userqy.wxml +++ b/pages/user/userqy/userqy.wxml @@ -32,7 +32,7 @@ {{item.GradeName}} - + [{{item.GradeName}}]365天累计成长值≥{{backClass[index+1].BuyGradeSum }}可升级[{{ backClass[index+1].GradeName}}] @@ -40,21 +40,21 @@ [{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum }}可保级 - 会员将在{{filter.replace_time2(gradeEndDate)}}到期,365天累计成长值≥{{need_money}}可升级[{{ backClass[index+1].GradeName}}][{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum}}可保级 + 会员将在{{filter.replace_time2(gradeEndDate)}}到期,365天累计成长值≥{{need_money}}可升级[{{ backClass[index+1].GradeName}}][{{item.GradeName}}]365天累计成长值≥{{item.BuyGradeSum}}可保级 - + [{{item.GradeName}}]365天累计成长值≥{{backClass[index+1].BuyGradeSum }}可升级[{{ backClass[index+1].GradeName}}] - + 加入会员尽享优惠 - + 距离{{item.GradeName}}还需{{ filter.pInt(item.BuyGradeSum-cz_val)}}成长值 - + 您当前是此会员 diff --git a/utils/selectFiles.js b/utils/selectFiles.js index 09371c9..e868c8a 100644 --- a/utils/selectFiles.js +++ b/utils/selectFiles.js @@ -1,5 +1,6 @@ module.exports = { selectPhotos: function(e, s, o) { + getApp().globalData.no_clear=1; if (void 0 === e[s]) { var c = 5 - e.length; c > 0 && wx.chooseImage({ diff --git a/utils/weapp-icon.wxss b/utils/weapp-icon.wxss index 3f3937b..7d685e4 100644 --- a/utils/weapp-icon.wxss +++ b/utils/weapp-icon.wxss @@ -13,6 +13,13 @@ background: url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20width%3D%27100%25%27%20height%3D%27100%25%27%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20id%3D%22t-icon-gowudai%22%20viewBox%3D%220%200%201024%201024%22%3E%3Cpath%20d%3D%22M150.72-1.06666667l-5.86666667%20169.49333334%20738.13333334%2016.53333333L870.4-1.06666667z%22%20fill%3D%22%23cdcdcd%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M150.72-1.06666667l72.64%2049.38666667-78.50666667%20106.56z%22%20fill%3D%22%23A2A2A2%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M120.64%201025.70666667L69.33333333%20969.49333333h884.37333334l-54.29333334%2056.21333334z%22%20fill%3D%22%23bfbfbf%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M223.36%2047.36l-20.37333333%20113.38666667-103.57333334-8.74666667z%22%20fill%3D%22%23AEADAD%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M870.4-1.06666667l-71.68%2049.38666667%2084.26666667%20108.48z%22%20fill%3D%22%23A2A2A2%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M798.72%2048.32l20.37333333%20112.42666667%20105.49333334-8.74666667z%22%20fill%3D%22%23AEADAD%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M99.41333333%20152h825.17333334L954.66666667%20969.49333333H69.33333333z%22%20fill%3D%22%23dbdbdb%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M718.82666667%20256.10666667H770.13333333v255.68c0%20141.22666667-114.45333333%20255.68-255.68%20255.68S258.66666667%20653.01333333%20258.66666667%20511.78666667V256.10666667h51.30666666v255.68c0%20112.85333333%2091.52%20204.37333333%20204.37333334%20204.37333333s204.37333333-91.52%20204.37333333-204.37333333V256.10666667z%22%20fill%3D%22%23A5A5A5%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M718.82666667%20312.32H770.13333333v149.12c0%20141.22666667-114.45333333%20255.68-255.68%20255.68S258.66666667%20602.66666667%20258.66666667%20461.44V312.32h51.30666666v149.12c0%20112.85333333%2091.52%20204.37333333%20204.37333334%20204.37333333s204.37333333-91.52%20204.37333333-204.37333333V312.32z%22%20fill%3D%22%23FFFFFF%22%20%3E%3C%2Fpath%3E%3C%2Fsvg%3E); } +/* .t-icon-liwu { + background: url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20width%3D%27100%25%27%20height%3D%27100%25%27%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20id%3D%22t-icon-liwu%22%20viewBox%3D%220%200%201024%201024%22%3E%3Cpath%20d%3D%22M85.93%20950.016c0%2024.576%207.126%2031.317%2029.44%2031.317h353.366V511.744H85.931v438.272z%20m469.334%2031.317h353.365c22.358%200%2029.44-6.698%2029.44-31.317V511.744H555.221v469.59zM938.667%20256H725.333c51.499-11.733%20105.899-49.707%20112.598-94.293%207.85-50.859-52.566-127.958-125.654-118.187-87.424%2012.117-151.509%2089.259-196.736%20149.077C470.656%20133.931%20412.16%2065.408%20328.363%2045.483c-81.152-19.2-136.747%2064.938-135.254%20116.992%201.451%2044.245%2052.608%2081.834%20105.558%2093.525H85.333c-26.368%200-42.666%2014.848-42.666%2042.667v170.581l426.666%200.085V256h85.334v213.333l426.666-0.085V298.667c0-27.819-16.341-42.667-42.666-42.667z%20m-687.019-77.824c-14.763-16.427-4.779-38.741%204.48-55.595%2017.024-29.696%2040.747-47.744%2081.152-30.933%2056.32%2023.51%2097.792%2073.216%20131.584%20117.803-71.552%207.893-178.304%2010.965-217.216-31.275z%20m311.296%2030.507c34.816-44.63%2075.221-89.942%20131.157-117.803%2058.582-28.97%20113.024%2049.323%2085.206%2086.912-21.419%2028.544-89.259%2031.232-125.91%2032.853-30.08%201.536-60.501%200.811-90.453-1.962z%22%20fill%3D%22%22%20%3E%3C%2Fpath%3E%3C%2Fsvg%3E); +} + +.t-icon-echarts { + background: url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20width%3D%27100%25%27%20height%3D%27100%25%27%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20id%3D%22t-icon-echarts%22%20viewBox%3D%220%200%201024%201024%22%3E%3Cpath%20d%3D%22M436.59925293%20533.33333333c0-65.04312613%2035.34952507-123.72333775%2088.37381267-153.41693881l-206.44122641-353.49525068c-282.79620057%20159.07286282-376.82593725%20518.22403753-217.75307443%20801.02023808l359.15117471-206.44122642c-11.31184801-22.62369604-23.33068654-52.31729711-23.33068654-87.66682217z%22%20fill%3D%22%23DADADA%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M613.34687829%20356.58570799c65.04312613%200%20123.72333775%2035.34952507%20153.41693879%2088.37381266l253.1025995-147.05402428C890.48715482%2073.78950741%20602.03503025-2.56546674%20377.91904132%20126.81379502l147.05402428%20253.1025995c24.03767705-11.31184801%2059.38720211-23.33068654%2088.37381269-23.33068653z%22%20fill%3D%22%23EBEBEB%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M701.72069095%20686.75027214c-23.33068654%2017.67476253-58.68021163%2023.33068654-88.37381266%2023.33068653-65.04312613%200-123.72333775-35.34952507-153.41693882-88.37381266L201.17141596%20775.12408481c41.00544908%2070.69905013%20100.3926512%20129.37926176%20171.09170135%20171.09170134%20153.41693881%2088.37381268%20335.82048816%2082.71788866%20477.21858844-5.65592402l-147.7610148-253.80958999z%22%20fill%3D%22%23B8B8B8%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M920.18075589%20356.58570799L766.76381708%20444.95952065c12.01883853%2029.69360106%2023.33068654%2058.68021163%2023.33068654%2088.37381268%200%2065.04312613-35.34952507%20123.72333775-88.37381267%20153.41693881l88.37381267%20153.41693881c171.09170134-100.3926512%20229.77191295-312.48980161%20130.08625227-483.58150296z%22%20fill%3D%22%23C7C7C7%22%20%3E%3C%2Fpath%3E%3C%2Fsvg%3E); +} */ .t-icon-sort-up { background: url(data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22utf-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20width%3D%27100%25%27%20height%3D%27100%25%27%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20id%3D%22t-icon-sort-up%22%20viewBox%3D%220%200%201024%201024%22%3E%3Cpath%20d%3D%22M-109.37837037-109.37837037h1242.75674074v1242.75674074H-109.37837037z%22%20fill%3D%22%23FFFFFF%22%20fill-opacity%3D%220%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M242.7360391%20615.56306132h538.5279218a20.71261275%2020.71261275%200%200%201%2016.57008947%2033.14018016l-269.2639609%20359.05313542a20.71261275%2020.71261275%200%200%201-33.14017894%200L226.16594963%20648.70324148A20.71261275%2020.71261275%200%200%201%20242.7360391%20615.56306132z%22%20fill%3D%22%23C7C7C7%22%20%3E%3C%2Fpath%3E%3Cpath%20d%3D%22M528.57008947%2016.2436231l269.2639609%20359.05313542A20.71261275%2020.71261275%200%200%201%20781.2639609%20408.43693868H242.7360391a20.71261275%2020.71261275%200%200%201-16.57008947-33.14018016l269.2639609-359.05313542a20.71261275%2020.71261275%200%200%201%2033.14017894%200z%22%20fill%3D%22%235A5A5A%22%20%3E%3C%2Fpath%3E%3C%2Fsvg%3E); diff --git a/utils/wxParse/wxParse.js b/utils/wxParse/wxParse.js index 8f650c9..c7e1d04 100644 --- a/utils/wxParse/wxParse.js +++ b/utils/wxParse/wxParse.js @@ -16,6 +16,7 @@ function t(e, t, a) { function a(e) { var t = this, a = e.target.dataset.src, i = e.target.dataset.from; t.data.show_prew_img=1; + getApp().globalData.no_clear=1; void 0 !== i && i.length > 0 && wx.previewImage({ current: a, urls: t.data[i].imageUrls,