diff --git a/app.js b/app.js index 1764628..cc84722 100644 --- a/app.js +++ b/app.js @@ -291,6 +291,31 @@ App({ }, + //获取订阅消息模板id + async get_template_id(id){ + if (!id) { return ''} + let os = this.globalData.setting; + let res = await this.promiseGet("/api/wx/weappSendlist/page", { + data: { + store_id: os.stoid, + typeids: id + } + }) + let resdata = res.data.data.pageData + if (res.data.code == 0 && resdata.length > 0) { + let template_id = [] + // let template_id = res.data.data.pageData[0].template_id; + try { + resdata.map(item=>{ + template_id.push(item.template_id) + }) + } catch (error) {} + return template_id + }else{ + return [] + } + }, + //---初始化第三方---- initExt: function () { var tt = t; diff --git a/app.json b/app.json index ee72692..d6fb2a7 100644 --- a/app.json +++ b/app.json @@ -6,13 +6,13 @@ "pages/cart/cart4/cart4", "pages/goods/goodsInfo/goodsInfo", "pages/goods/goodsList/goodsList", - "pages/goods/search/search", + "pages/order/refund_order/refund_order", "pages/payment/payment/payment", "pages/user/index/index", "pages/user/order_list/order_list", "pages/user/order_detail/order_detail", - "pages/user/userinfo/userinfo", + "pages/user/coupon/coupon", "pages/user/checkcoupon/checkcoupon", @@ -23,16 +23,16 @@ "pages/user/userqy/userqy", "pages/user/user_spsy/user_spsy", - "pages/payment/pay_success/pay_success", + "pages/user/plus/plus", - "pages/user/my_service/appment_main", + "pages/user/my_service/i_service", - "pages/user/my_service/cosmetology_list", + "pages/user/my_service/hist_service", "pages/user/my_service/tment_details", "pages/user/my_service/tment_eval", - "pages/user/my_service/tment_order_list", - "pages/user/my_service/beauty_deta", + + "pages/giftpack/birthdaygift/birthdaygift", "pages/giftpack/evaluategift/evaluategift", "pages/giftpack/newvipgift/newvipgift", @@ -243,7 +243,14 @@ "pages/store/index", "pages/user/express/express", "pages/team/team_success/team_success", - "pages/plus_agreement/plus_agreement" + "pages/plus_agreement/plus_agreement", + "pages/goods/search/search", + "pages/payment/pay_success/pay_success", + "pages/user/userinfo/userinfo", + "pages/user/my_service/appment_main", + "pages/user/my_service/cosmetology_list", + "pages/user/my_service/beauty_deta", + "pages/user/my_service/tment_order_list" ] } ], diff --git a/components/add_purchase/add_purchase.js b/components/add_purchase/add_purchase.js new file mode 100644 index 0000000..8f9f8b2 --- /dev/null +++ b/components/add_purchase/add_purchase.js @@ -0,0 +1,5186 @@ +// components/add_purchase/add_purchase.js +var s = getApp(), + ut = require("../../utils/util"), + i = s.request, + rq = i, + oo = s.globalData, + o = s.globalData.setting, + os = o; +let self = null; +var wxlog = require("../../utils/wxlog.js"); +var w_time = null; +var timer_get = null; +var t_time = null; +Component({ + /** + * 组件的属性列表 + */ + properties: { + + }, + lifetimes: { + attached: function () { + // this.clearTime() + self = this + // 在组件实例进入页面节点树时执行 + let ee = this, that = ee, th = ee; + //先获取一下导购的门店 + th.check_guide(() => { + th.get_user_store(); + }) + //----获取系统参数----- + getApp().getConfig2(function (e) { + ee.setData({ + bconfig: e, + sales_rules: e.sales_rules, + }); + th.wait_for_store_config(); + if (e.categoryset.indexOf("," + 1 + ",") != -1) { + ee.setData({ + is_show_pl: 1 + }); + } + if (e.categoryset.indexOf("," + 3 + ",") != -1) { + ee.setData({ + is_show_pp: 1 + }); + } + if (e.categoryset.indexOf("," + 2 + ",") != -1) { + ee.setData({ + is_show_gb: 1 + }); + } + console.log('获取系统参数'); + console.log(e); + var json_d = JSON.parse(e.switch_list); + ee.setData({ + store_config: e, + sys_switch: json_d, + is_closecoupon: json_d.is_closecoupon, + is_newsales_rules: json_d.is_newsales_rules, + is_retail_price: json_d.is_retail_price || 0, + appoint_pick_keyid: json_d.appoint_pick_keyid, + // goods_bottomconent:e.goods_bottomconent + }); + + //判断商品详情要有东西 + // if (e && e.goods_bottomconent) { + // //商品详情广告---- + // a.wxParse("goodInfo_ad", "html", ut.format_content(e.goods_bottomconent), ee, 6); + // common.wxParseAddFullImageUrl(ee, "goodInfo_ad"); + // //------- + // } + + //------几人评价------- + //n.init(th, "", "comments"); + + // th.requestCardNum(), + wx.pageScrollTo && th.setData({ + supportPageScroll: !0 + }); + + //计算等级价相关 + var swithc_list = e.switch_list; + var sw_arr = JSON.parse(swithc_list); + console.log('plus-111') + //---如果后台又开等级卡的开关--- + ut.get_plus_name_price(sw_arr, th); + + }, 1); + } + }, + /** + * 组件的初始数据 + */ + data: { + add_cart_show: false, //是否显示 + iurl: getApp().globalData.setting.imghost, + prom_price: null, + sele_g: null, + gid: '', + prom_type: '', + prom_id: '', + goodsInputNum: 1, + def_pick_store: null, // 默认的门店 + openSpecModal_ind: 1, + goods_type: 0, + iscart: 0, //是否从购物车过来的 + cx_prom_group: [], //促销活动,用于显示和判断默认要用什么促销活动 + //门店相关 + ismend: 0, + only_pk: null, + stoid: o.stoid, + is_get_local_ok: 0, //获取坐标是否完成 + def_pickpu_list: null, + more_store: 0, //选择门店 + sort_store: 0, //门店分类 + choice_sort_store: 0, //选择分类门店 + sec_pick_index: 0, //第二级门店选择ID + fir_pick_index: 0, //第一级门店选择ID + all_pick_list: null, //所有的门店先记录起来 + fir_def_store: null, //客户默认的门店的 + keyword: '', //门店搜索 + is_no_new: 1, + }, + + /** + * 组件的方法列表 + */ + methods: { + closeSpecModal() { + this.clearTime() + this.setData({ + add_cart_show: false + }) + + this.triggerEvent('hide_add_purchase', {}) + }, + clearTime() { + if (timer_get) { + clearInterval(timer_get); + } + if (w_time) { + clearInterval(w_time); + } + if (t_time) { + clearInterval(t_time); + } + + }, + previewImage(e) { + // this.data.show_prew_img = 1; + getApp().pre_img(this.data.sele_g.original_img); + }, + init(gid, prom_type, prom_id, goods_type = 0, iscart = 0, cartid = 0) { + // this.clearTime() + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.showModal({ + title: '提示', + content: '你还没有登录', + confirmText: '去登录', + success(res) { + + if (res.confirm) { + wx.navigateTo({ + url: '/packageE/pages/togoin/togoin', + }) + } else if (res.cancel) { + console.log('用户点击取消') + } + } + }) + return false; + } + + + if (!gid) { + wx.showToast({ + title: '商品信息不对', + icon: 'none' + }) + return + } + this.setData({ + gid, + prom_id, + prom_type, + goods_type, + add_cart_show: true, + goodsInputNum: 1, + iscart, + cartid + }) + if (goods_type == 1) { + this.get_ser_info() + } else { + this.get_goods_info() + } + + }, + //获取服务详情 + get_ser_info() { + let i = getApp().request; + let gid = this.data.gid + let ee = this; + let that = this + let th = this; + i.get("/api/weshop/serviceCard/get/" + o.stoid + "/" + ee.data.gid, { + failRollback: !0, + success: function (t) { + if (t.data.code == 0) { + // console.log('GET pic and video'); + if (t.data.data.listServiceItem) { + that.setData({ + listServiceItem: t.data.data.listServiceItem, + }); + }; + that.setData({ + 'sele_g.goods_name': t.data.data.serviceName, + 'sele_g.shop_price': t.data.data.money, + 'sele_g.show_price': t.data.data.show_price, + 'sele_g.validDays': t.data.data.validDays, + 'sele_g.serviceContent': t.data.data.serviceContent, + 'sele_g.image_url': t.data.data.imgUrl, + 'sele_g.original_img': that.data.iurl + t.data.data.imgUrl, + 'sele_g.goods_id': t.data.data.id, + 'sele_g.id': t.data.data.id, + 'sele_g.sales_sum': t.data.data.sales_sum, + 'sele_g.storageId': t.data.data.storageId, + 'sele_g.service_sn': t.data.data.serviceSn, + 'sele_g.listServiceVideos': t.data.data.listServiceVideos, + + '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, + 'data.original_img': that.data.iurl + t.data.data.imgUrl, + 'data.goods_id': t.data.data.id, + 'data.id': t.data.data.id, + 'data.sales_sum': t.data.data.sales_sum, + 'data.storageId': t.data.data.storageId, + 'data.service_sn': t.data.data.serviceSn, + 'data.listServiceVideos': t.data.data.listServiceVideos, + }); + + // that.getTaohe(); + // ----> 秒杀 + let prom_type = th.data.prom_type; + + let goods_id = th.data.goods_id; + if (!goods_id) goods_id = th.data.sele_g.goods_id; + + if (prom_type) { // 进入商品详情页地址传参有带goods_id、prom_type、prom_id参数, 即从秒杀入口进入 + let prom_id = th.data.prom_id; + // 检查活动是否开始 + th.ser_check_prom(goods_id, prom_type, prom_id); + + } else { // 从非秒杀入口进入,地址不带prom_type、prom_id参数 + getApp().request.promiseGet('/api/weshop/activitylist/listGoodActInfo2', { + data: { + store_id: os.stoid, + goods_id: goods_id, + goods_type: 1, + user_id: oo.user_id, + } + }).then(res => { + if (res.data.code == 0) { + let result = res.data.data; + let resLength = result.length; + if (resLength == 1) { // 如果数组长度为1,则直接显示当前活动 + let goods_id = th.data.gid; + let prom_type = result[0].prom_type; + let prom_id = result[0].act_id; + th.setData({ + prom_type: prom_type, + prom_id: prom_id, + }); + // 检查活动是否开始 + th.ser_check_prom(goods_id, prom_type, prom_id); + } else if (resLength > 1) { //如果数组长度大于1,表示当前商品参加多个活动,以列表形式显示多活动 + th.setData({ + actList: res.data.data, + }); + }; + + } else { + th.setData({ + actList: res.data.data, + }); + } + }); + }; + + // console.log('0xxxxx999999', t.data.data); + //-----商品详情--- + //if(!t.data.data.serviceContent) t.data.data.serviceContent=" "; + //a.wxParse("content", "html", ut.format_content(t.data.data.serviceContent), ee, 6); + //e.wxParseAddFullImageUrl(ee, "content"); + // getApp().deal_iframe(a,e,'content',t.data.data.serviceContent,ee); + + //获取重表 + getApp().promiseGet("/api/weshop/serviceItem/list", { + data: { store_id: o.stoid, service_id: t.data.data.id } + }).then(res => { + if (res.data.code == 0) { + var list = res.data.data; + that.setData({ service_list: list }) + } + }) + + } else { + wx.showModal({ + title: t.data.msg, + showCancel: !1, + complete: function () { + wx.navigateBack(); + } + }); + }; + } + }); + + }, + get_normal(gid) { + this.setData({ + prom_type: 0, + isshow: 1, + }); + if (this.data.goods_type != 1) { + + this.get_sku(os.stoid, this.data.data, gid); + } + + this.get_sto(); + if (!this.data.data.whsle_id) + this.check_is_youhui(gid); + this.data.is_normal = 1; + }, + //获取商品详情 + get_goods_info() { + + let i = getApp().request; + let gid = this.data.gid + let ee = this; + i.get("/api/weshop/goods/get/" + getApp().globalData.setting.stoid + "/" + this.data.gid, { + failRollback: !0, + success: (t) => { + console.log(t); + // t.data.data.prom_type=0 + if (t.data.code == 0) { + // if (t.data.data && t.data.data.prom_type == 4) { + // if (ee.data.prom_type4 == 1) { + // t.data.data.prom_type = 0 + // } + // } + if (t.data.data.is_on_sale != 1) { + wx.showToast({ + title: '商品已经下架', + icon: 'none', + duration: 2000 + }) + return + } + // ee.init(gid); + var timestamp = Date.parse(new Date()); + timestamp = timestamp / 1000; + if (t.data.data.on_time > timestamp) { + wx.showToast({ + title: '商品还未上架', + icon: 'none', + duration: 2000 + }) + return + } + + if (t.data.data.down_time > 0) { + if (t.data.data.down_time < timestamp) { + wx.showToast({ + title: '商品已经到期下架', + icon: 'none', + duration: 2000 + }) + return + } + } + + // let p_type = parseInt(this.data.prom_type ? ee.data.prom_type : 0); + + + + //-- 把商品的赋值,同时给活动赋值 -- + ee.data.fir_goods = JSON.parse(JSON.stringify(t.data.data)); + + t.data.data.on_time = ut.formatTime(t.data.data.on_time, 'yyyy-MM-dd hh:mm:ss'); + + let cur_price = t.data.data.shop_price; + if (getApp().globalData.userInfo && getApp().globalData.userInfo.card_field) { + let cfile = getApp().globalData.userInfo.card_field; + if (t.data.data[cfile]) { + cur_price = t.data.data[cfile]; + } + } + let txt = (cur_price / t.data.data.market_price * 10).toFixed(2).toString(); + txt = parseFloat(txt); + + t.data.data['disc'] = txt; + + if (t.data.data.original_img.indexOf(o.imghost) == -1) + t.data.data.original_img = o.imghost + t.data.data.original_img; + + + t.data.data.prom_type = ee.data.prom_type; + t.data.data.prom_id = ee.data.prom_id; + + //只有是普通商品的时候,才要给商品赋值指定门店 + if ([1, 2, 4, 6, 8, 9].indexOf(parseInt(ee.data.prom_type)) < 0 && t.data.data.pick_up_lists && t.data.data.pick_up_lists.length) { + t.data.data.pickup_ids = t.data.data.pick_up_lists; + } + //} + ee.setData({ + data: t.data.data, + sele_g: t.data.data, + userInfo: getApp().globalData.userInfo + }); + + //一件代发商品不去计算优惠 + if (!ee.data.fir_goods.whsle_id && ee.data.prom_type != 1 && ee.data.prom_type != 4 && ee.data.prom_type != 6 && ee.data.prom_type != 2) { + ee.check_is_youhui(ee.data.gid); + } + + + //获取统一条形码,普通商品和优惠促销的商品 + if (ee.data.data.prom_type == 0 || ee.data.data.prom_type == 3 || ee.data.data.prom_type == 5 || ee.data.data.prom_type == 7 || ee.data.data.prom_type == 9 || ee.data.data.prom_type == 10) { + ee.get_sto(); + ee.get_sku(o.stoid, t.data.data, gid); + ee.check_has_flash(); + + } else { + var gg = "", + item = t.data.data; + + 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 = "规格1"; + } + t.data.data.gg = gg; + var uu = []; + uu.push(t.data.data); + + ee.setData({ + sku_g: uu, + }); + } + ee.data.g_buy_num = new Map(); + + //-- 增加相同的活动 -- + ee.check_prom(gid, ee.data.data.prom_type, ee.data.data.prom_id); + } else { + wx.showModal({ + title: t.data.msg, + showCancel: !1, + }); + } + } + }); + }, + //----------装载同一条形码的商品---------- + async get_sku(stoid, gd, g_id, is_normal, func) { + console.log('get_sku'); + var tt = this, + arrdata = null; + var now = ut.gettimestamp(); + await getApp().request.promiseGet("/api/weshop/goods/page", { + data: { + store_id: o.stoid, + sku: gd.sku, + more_spec: gd.more_spec, + isonsale: 1, + is_on_sale: 1, + pageSize: 500, + orderField: 'gg_ordid,goods_spec,sort', + isnewwhere: 1, + js_pickup_id: 0 + } + }).then(res => { + var e = res; + if (e.data.code == 0) arrdata = e.data.data.pageData; + }) + if (!arrdata) return false; + + // if(arrdata[0]){ + // tt.setData({ + // new_share_imgurl:arrdata[0].share_imgurl + // }) + // } + + var arrsku = new Array(); + var gitem = null; + var gb = 1, + gg = ""; + for (var i = 0; i < arrdata.length; i++) { + var goodsinfo = arrdata[i], + prom = null; + + if (goodsinfo.goods_id != g_id) { + + + //要判断一下商品的活动是不是多活动,确定一下商品的prom_type + var url = '/api/weshop/activitylist/listGoodActInfo2New'; + var req_d = { + "store_id": os.stoid, + "goods_id": goodsinfo.goods_id, + "user_id": getApp().globalData.user_id, + } + var ck_res = await getApp().request.promiseGet("/api/weshop/activitylist/listGoodActInfo2New", { data: req_d }); + if (ck_res.data.code == 0 && ck_res.data.data && ck_res.data.data.length > 0) { + var arr = ck_res.data.data; + //-- 预热也要计算 -- + var arr2 = arr.filter(function (e) { + return e.s_time < ut.gettimestamp() || (e.warm_uptime && e.warm_uptime < ut.gettimestamp()) + }) + + if (arr2.length == 1) { + goodsinfo.prom_type = arr2[0].prom_type; + goodsinfo.prom_id = arr2[0].act_id; + } + } + + switch (goodsinfo.prom_type) { + case 1: + + if (goodsinfo.prom_id) { + await getApp().request.promiseGet("/api/ms/flash_sale/get/" + os.stoid + "/" + goodsinfo.prom_id, {}).then(res => { + if (res.data.code == 0) prom = res.data.data; + }) + } + + + break; + case 6: + await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + goodsinfo.prom_id, {}).then(res => { + console.log(res); + if (res.data.code == 0) prom = res.data.data; + }) + + break; + case 2: + await getApp().request.promiseGet("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, {}).then(res => { + if (res.data.code == 0) prom = res.data.data; + }) + break; + case 4: + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, {}).then(res => { + if (res.data.code == 0) prom = res.data.data; + }) + break + //预售和幸运购不参与 + case 8: + case 9: + continue; + } + + } else { + + //只有是普通商品的时候,才要给商品赋值指定门店 + if ([1, 2, 4, 6, 8, 9].indexOf(parseInt(this.data.prom_type)) < 0 || is_normal) { + //如果商品有设置分组 + if (goodsinfo.pick_group_ids) { + goodsinfo.pickup_ids = goodsinfo.pick_up_lists; + } + } + + } + //---如果有活动,不算在一起--- + if (prom) { + if ([1, 2, 4, 6].indexOf(parseInt(goodsinfo.prom_type)) > -1) { + console.log(prom); + if (prom.is_end == 0 && prom.end_time > now && (prom.start_time < now || (prom.show_time && prom.show_time < now))) continue; + } else { + continue; + } + } + var item = arrdata[i], gg = ""; + + if (goodsinfo.goods_id != g_id) { + //-- 如果商品有设置分组 -- + if (item.pick_group_ids) { + item.pickup_ids = item.pick_up_lists; + } + } + + + 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; + + if (item.spec_img) + item.original_img = os.imghost + item.spec_img; + else + item.original_img = os.imghost + item.original_img; + + + if (item.goods_id == g_id) { + gitem = item; + } else { + arrsku.push(item); + } + } + + //-----------排列在最前面------------- + arrsku.splice(0, 0, gitem); + + if (is_normal == 1) { + tt.setData({ + sku_g_pt: arrsku, + sele_g: gitem + }); + func(); + } else { + tt.setData({ + sku_g: arrsku, + sele_g: gitem + }); + } + }, + + //-- 判断是否有秒杀 -- + check_has_flash: function (gid) { + var th = this; + var url = "/api/weshop/activitylist/getGoodActInfo"; + var user_id = getApp().globalData.user_id; + if (!user_id) user_id = 0; + + if (!gid) gid = this.data.data.goods_id + + var req_data = { + store_id: os.stoid, + goodsidlist: gid, + is_detail: 1, + user_id: user_id, + timetype: 0 + }; + //获取秒杀的多规格 + getApp().request.promiseGet(url, { + data: req_data + }).then(async function (res) { + if (res.data.code == 0 && res.data.data && res.data.data.length) { + var arr_data = res.data.data; + var new_arr = []; + for (let i in arr_data) { + let item = arr_data[i]; + //找不到活动要剔除 + if (!item.act_name) continue; + + if ([1, 2, 4, 6, 8, 9].indexOf(item.prom_type) == -1) continue; + new_arr.push(item); + } + + // if (new_arr.length == 1) { + // th.data.prom_id = new_arr[0].act_id; + // th.data.prom_type = new_arr[0].prom_type; + // } + + th.setData({ + more_flash: new_arr + }); + } + }) + }, + + + //--------检查是否活动,活动是否开始,或者是否结束------- + 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 == 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 == 2) { + //-------判断团购活动是否抢光--------- + 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) { + if (em.data.data <= 0) ee.setData({ + prom_r_null: 1 + }); + //拿取价格并且判断时间-- + getApp().request.get("/api/weshop/goods/groupBuy/getActInfo/" + os.stoid + "/" + gid + "/" + prom_id, { + success: function (t) { + if (t.data.code != 0) { + ee.get_normal(gid); + return false; + } + //----已经结束----- + if (t.data.data.is_end == 1) { + ee.get_normal(gid); + return false; + } + //----已经过期----- + var now = ut.gettimestamp(); + if (t.data.data.end_time < now || t.data.data.start_time > now) { + ee.get_normal(gid); + return false; + } + + /*-- 还没有开始预热的也不显示 --*/ + if (t.data.data.show_time > now) { + ee.get_normal(gid); + return false; + } + + var t_gd = ee.data.data; + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss"); + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); + + ee.setData({ + prom_price: t.data.data.price, + prom_type: 2, + prom_id: prom_id, + prom_buy_limit: t.data.data.buy_limit, + prom_act: t.data.data, + prom_end_time: prom_end_time, + prom_start_time: prom_start_time, + isshow: 1, + }); + + ee.get_sto(); + var newTime = ut.gettimestamp(); + var endTime2 = t.data.data.end_time; + var endTime1 = t.data.data.start_time; + if (endTime1 > newTime) { + ee.setData({ + prom_time_text: '距团购开始还有' + }) + // ee.countDown(endTime1, 0); + } else { + if (endTime2 > newTime) { + ee.setData({ + prom_time_text: '距团购结束还有', + prom_st: 1 + }) + // ee.countDown(endTime2); + } + } + + } + }); + } + }) + } + + 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; + if (!this.data.data.whsle_id) this.check_is_youhui(gid, 1); + return false; + } + + //if (prom_type != 3 && prom_type!=0){ + //---判断秒杀---- + if (prom_type == 1 && prom_id > 0) { + //-------判断活动是否抢光--------- + 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) { + + if (em.data.data <= 0) ee.setData({ + prom_r_null: 1, pro_null: 1 + }); + //拿取价格并且判断时间-- + getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { + success: function (t) { + if (t.data.code != 0) { + ee.get_normal(gid); + return false; + } + ee.setData({ + is_share_text: t.data.data.is_share_text + }) + //----已经结束----- + if (t.data.data.is_end == 1) { + ee.get_normal(gid); + return false; + } + //----已经过期----- + var now = ut.gettimestamp(); + if (t.data.data.end_time < now) { + ee.get_normal(gid); + return false; + } + /*-- 还没有开始预热的也不显示 --*/ + if (t.data.data.show_time > now) { + ee.get_normal(gid); + return false; + } + + var t_gd = ee.data.data; + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss"); + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); + + ee.setData({ + prom_price: t.data.data.user_price, + prom_type: 1, + prom_id: prom_id, + prom_buy_limit: t.data.data.buy_limit, + prom_act: t.data.data, + prom_end_time: prom_end_time, + prom_start_time: prom_start_time, + isshow: 1, + }); + + ee.get_sto(); + var newTime = ut.gettimestamp(); + var endTime2 = t.data.data.end_time; + var endTime1 = t.data.data.start_time; + if (endTime1 > newTime) { + ee.setData({ + prom_time_text: '距秒杀开始还有' + }) + // ee.countDown(endTime1, 0); + } else { + if (endTime2 > newTime) { + ee.setData({ + prom_time_text: '距秒杀结束还有', + prom_st: 1 + }) + // ee.countDown(endTime2); + } + } + + //如果是进行中的话 + 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; + + ee.data.sele_g.prom_type = 1; + ee.data.sele_g.prom_id = n_item.act_id; + + 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, + is_more_flash: 1 + }); + + } + }) + } + + } + }); + } + }) + } + + if (prom_type == 4) { + //th.setData({is_integral_normal:1}); + var rdata = { + store_id: o.stoid, + stype: 1, + stypeup: 1, + goods_id: gid, + timetype: 2, + user_id: getApp().globalData.user_id, + } + + var integrals = 0; + var get_datas = { + user_id: getApp().globalData.user_id, + store_id: o.stoid, + }; + await getApp().request.promiseGet("/api/weshop/users/getAllPoints", { + data: get_datas + }).then(res => { + if (res.data.code == 0) { + integrals = res.data.data?.Integral ? res.data.data?.Integral : 0; + } + }) + + //获取一下积分活动 + await getApp().request.promiseGet("/api/weshop/integralbuy/pageIntegralBuyGoodsList", { + data: rdata + }).then(res => { + //调用接口有数据的时候 + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { + var inte_data = res.data.data.pageData[0]; + var can_integral = (parseFloat(integrals) >= parseFloat(inte_data.integral)); + let times = new Date().getTime() + inte_data.show_time_off = "" + let atimes = inte_data.start_time * 1000 + + if (atimes > times) { + inte_data.show_time_off = ut.formatTime(inte_data.start_time) + } + + ee.setData({ + prom_price: parseFloat(inte_data.addmoney), + prom_integral: parseFloat(inte_data.integral), + prom_type: 4, + prom_id: inte_data.id, + prom_buy_limit: inte_data.limitvipqty, + prom_act: inte_data, + isshow: 1, + can_integral: can_integral, + is_shopbuy: parseInt(inte_data.is_shopbuy ? inte_data.is_shopbuy : 0) + }); + ee.get_sto(); + + } else { + ee.get_normal(gid); + return false; + } + }) + + } + + //---判断拼单---- + if (prom_type == 6) { + + th.setData({ + user_order_pt_state: 0 + }); + + //-------判断活动是否抢光--------- + await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { + 1: 1 + }).then(res => { + var em = res; + var flag = null; + if (em.data.code == 0) { + if (em.data.data <= 0) ee.setData({ + prom_r_null: 1 + }); + //-- 拿取价格并且判断时间,同时判断会员身份 -- + getApp().request.get("/api/weshop/teamlist/getUser/" + os.stoid + "/" + prom_id + "/" + getApp().globalData.user_id, { + success: async function (t) { + if (t.data.code != 0) { + ee.get_normal(gid); + return false; + } + //----已经结束----- + if (t.data.data.is_end == 1) { + ee.get_normal(gid); + return false; + } + //----已经过期----- + var now = ut.gettimestamp(); + if (t.data.data.end_time < now) { + ee.get_normal(gid); + return false; + } + + /*-- 还没有开始预热的也不显示 --*/ + if (t.data.data.show_time > now) { + ee.get_normal(gid); + return false; + } + + /*-- 判断拼单是否启用 --*/ + if (!t.data.data.is_show) { + console.log('没启用'); + wx.setNavigationBarTitle({ + title: '系统提示', + }); + wx.showToast({ + title: '此商品暂时没有拼单活动', + icon: 'none', + success() { + setTimeout(() => { + wx.navigateBack() + }, 2000) + } + }); + return false + } + + + //-------查看自己是不是有买过该团的商品,并还为支付,或者在进行中------- + await getApp().request.promiseGet("/api/weshop/order/page", { + data: { + pt_prom_id: prom_id, + user_id: oo.user_id, + store_id: os.stoid, + pageSize: 1, + page: 1 + } + }).then(e => { + if (e.data.code == 0 && e.data.data.pageData.length > 0) { + var odr = e.data.data.pageData[0]; + th.data.buy_order = odr; + if (odr.pt_status == 0 && odr.order_status == 1) { + th.setData({ + user_order_pt_state: 1 + }); + } + if (odr.pt_status == 1 && odr.order_status == 1) { + if (odr.is_zsorder == 4) { + getApp().request.promiseGet("/api/weshop/teamgroup/page/", { + data: { + store_id: os.stoid, + team_id: odr.pt_prom_id, + listno: odr.pt_listno + } + }).then(res => { + var now = ut.gettimestamp(); + if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length > 0) { + var tgr = res.data.data.pageData[0]; + //如果团的时间已经到了 + if (now >= tgr.kt_end_time) { + th.update_jiti(tgr.id); + } else { + th.setData({ + user_order_pt_state: 2 + }); + } + } + }) + + } else { + th.setData({ + user_order_pt_state: 2 + }); + } + } + + if (odr.pt_status == 2 && odr.is_zsorder == 4) { + th.setData({ + user_order_pt_state: 3, + }); + th.data.wk_order_id = odr.order_id; + } + } + }) + + //----------查看阶梯团------------ + if (t.data.data.ct_rylist != "null" && t.data.data.ct_rylist != "" && t.data.data.ct_rylist != null && t.data.data.ct_rylist != undefined) { + t.data.data.ct_rylist = JSON.parse(t.data.data.ct_rylist); + var max_num = 0; + t.data.data.ct_rylist.forEach(function (val, ind) { + if (parseInt(val.rynum) > max_num) max_num = parseInt(val.rynum); + }) + t.data.data.max_ct_num = max_num; + } + + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss"); + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); + ee.setData({ + prom_price: t.data.data.price, + prom_type: 6, + prom_id: prom_id, + prom_buy_limit: t.data.data.buy_limit, + prom_act: t.data.data, + prom_end_time: prom_end_time, + prom_start_time: prom_start_time, + isshow: 1, + }); + + ee.get_sto(); + + var newTime = now; + var endTime2 = t.data.data.end_time; + var endTime1 = t.data.data.start_time; + + if (endTime1 > newTime) { + ee.setData({ + prom_time_text: '距拼单开始还剩:' + }) + // ee.countDown(endTime1, 0); + } else { + if (endTime2 > newTime) { + ee.setData({ + prom_time_text: '距拼单结束还剩:', + prom_st: 1 + }) + // ee.countDown(endTime2); + } + } + //-------查看有多少人在开这个团------- + // th.get_team_group(prom_id); + } + }); + } + }) + } + }, + + + //--------服务卡检查是否活动,活动是否开始,或者是否结束------- + async ser_check_prom(gid, prom_type, prom_id) { + 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 + }); + + //获取门店 + 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 == 1 && prom_id > 0) { + //-------判断活动是否抢光--------- + 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) { + + if (em.data.data <= 0) { + th.setData({ + prom_r_null: 1, + goodsInputNum: res.data.data, + }); + + // th.setData({goodsInputNum: redis_num}) + }; + //拿取价格并且判断时间-- + getApp().request.get("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + prom_id, { + success: function (t) { + let sele_g_new = t.data.data + let sele_g = th.data.sele_g + if (sele_g_new && sele_g_new.original_img && !sele_g.original_img) { + sele_g.original_img=sele_g_new.original_img + } + th.setData({ + sele_g + }); + + if (t.data.code != 0) { + ee.get_normal(gid); + return false; + } + //----已经结束----- + if (t.data.data.is_end == 1) { + ee.get_normal(gid); + return false; + } + //----已经过期----- + var now = ut.gettimestamp(); + if (t.data.data.end_time < now) { + ee.get_normal(gid); + return false; + } + /*-- 还没有开始预热的也不显示 --*/ + if (t.data.data.show_time > now) { + ee.get_normal(gid); + return false; + } + + var t_gd = ee.data.data; + var prom_end_time = ut.formatTime(t.data.data.end_time, "yyyy-MM-dd hh:mm:ss"); + var prom_start_time = ut.formatTime(t.data.data.start_time, "yyyy-MM-dd hh:mm:ss"); + + ee.setData({ + prom_price: t.data.data.user_price, + prom_type: 1, + prom_id: prom_id, + prom_buy_limit: t.data.data.buy_limit, + prom_act: t.data.data, + prom_end_time: prom_end_time, + prom_start_time: prom_start_time, + }); + + ee.get_sto(); + var newTime = ut.gettimestamp(); + var endTime2 = t.data.data.end_time; + var endTime1 = t.data.data.start_time; + if (endTime1 > newTime) { + ee.setData({ + prom_time_text: '距秒杀开始还有', + prom_st: 0, + }) + // ee.countDown(endTime1, 0); + } else { + if (endTime2 > newTime) { + ee.setData({ + prom_time_text: '距秒杀结束还有', + prom_st: 1 + }) + // ee.countDown(endTime2); + } + } + + //如果是进行中的话 + if (endTime1 < newTime) { + //-- 获取秒杀活动的多少规格 -- + ee.get_more_flash(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, + }); + + } + }) + } + + } + }); + } + }) + } + + }, + //获取更多秒杀 + get_more_flash: 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.gid + "&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.sele_g.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_sto(e, func, item) { + + var th = this, + that = this; + var is_normal = e; + + if (e == 1) { + th.setData({ + is_normal: 1 + }) + } else { + th.setData({ + is_normal: 0 + }) + } + + timer_get = setInterval(function () { + + if (th.data.is_get_local_ok == 0) return false; + if (!th.data.fir_def_store) return false; + + var dd = null, + i = getApp().request; + if (!th.data.sele_g) return false; + + var g_distr_type = th.data.sele_g.distr_type; + if ( g_distr_type && g_distr_type != 0) { + dd = { + store_id: o.stoid, + distr_type: g_distr_type, + isstop: 0, + is_pos: 1, + pageSize: 2000 + } + } else { + dd = { + store_id: o.stoid, + isstop: 0, + is_pos: 1, + pageSize: 2000 + } + } + //如果有距离的话 + if (th.data.lat != null) { + dd.lat = th.data.lat; + dd.lon = th.data.lon; + } + + clearInterval(timer_get); + + //如果会员是有默认的门店话 + if (!th.data.def_pick_store && th.data.fir_def_store && Object.keys(th.data.fir_def_store).length > 0) { + th.setData({ + def_pick_store: th.data.fir_def_store + }); + } + wx.showLoading({ + title: '加载中.' + }); + //----------获取门店---------------- + getApp().request.promiseGet("/api/weshop/pickup/list", { + data: dd, + }).then(res => { + var e = res; + + if (e.data.code == 0 && e.data.data && e.data.data.pageData && e.data.data.pageData.length > 0) { + + var pickup_ids = th.data.sele_g.pickup_ids; + //不是单独购买的时候,要清空商品pickup_ids + + var py = parseFloat(th.data.prom_type + ''); + if (!is_normal && py > 0 && [3, 5, 7, 10].indexOf(py) < 0) { + pickup_ids = null; + } + //-- 把秒杀的指定对象带入 -- + if (item) { + if (item.is_pickup && item.pick_up_lists) { + pickup_ids = item.pick_up_lists + } else { + pickup_ids = null; + } + + } else if (!is_normal && [1, 2, 6].indexOf(py) > -1 && th.data.prom_act.pick_up_lists) { //指定门店判断, 不是普通购买的时候,秒杀的时候,秒杀有指定门店 + pickup_ids = th.data.prom_act.pick_up_lists + } + + //-- 如果有指定门店的时候 -- + if (pickup_ids) { + + var ok_arr = []; + for (let i in e.data.data.pageData) { + let ite = e.data.data.pageData[i]; + //-- 查找一下门店有没有在 -- + var idx = pickup_ids.findIndex(function (e) { + return e.pickup_id == ite.pickup_id; + }) + if (idx > -1) { + ok_arr.push(ite) + } + } + + //判断会员的默认的门店是不是匹配指定的门店 + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') { + //-- 查找一下门店有没有在 -- + var idx1 = pickup_ids.findIndex(function (e) { + return e.pickup_id == th.data.def_pick_store.pickup_id; + }) + + if (idx1 < 0) { + //如果是秒杀的指定门店,就要设置秒杀的 + if (!is_normal && [1, 2, 6].indexOf(py) > -1) { + th.data.def_pick_store.is_no_dis_act = 1; + } else { + th.data.def_pick_store.is_no_dis_nor = 1; + } + } else { + th.data.def_pick_store.is_no_dis_nor = 0; + th.data.def_pick_store.is_no_dis_act = 0; + } + + that.setData({ + def_pick_store: th.data.def_pick_store + }) + + } + e.data.data.pageData = ok_arr; //数组重新赋值 + e.data.data.total = ok_arr.length; //数组的长度 + } + else { + //-- 多规格指定门店优化 -- + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') { + + th.data.def_pick_store.is_no_dis_nor = 0; + th.data.def_pick_store.is_no_dis_act = 0; + that.setData({ + def_pick_store: th.data.def_pick_store + }) + } + } + + //过滤后门店数量还是要大于0 + if (e.data.data.pageData.length > 0) { + + var his_cate_num = 0; + for (let i in e.data.data.pageData) { + let item = e.data.data.pageData[i]; + if (item.category_id > 0) { + his_cate_num = 1; + } + if (getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2) { + e.data.data.pageData[i].CanOutQty = 100000; + } + } + + e.his_cate_num = his_cate_num; + + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}' && + getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2) { + th.setData({ + 'def_pick_store.CanOutQty': 100000 + }) + } + + //如果有开启距离的功能,没有设置默认门店,要用最近的门店作为默认门店 + if (dd.lat && (!th.data.def_pick_store || JSON.stringify(th.data.def_pick_store) == '{}') && th.data.bconfig && th.data.bconfig.is_sort_storage) { + th.setData({ + def_pick_store: e.data.data.pageData[0], + sto_sele_name: e.data.data.pageData[0].pickup_name, + sto_sele_id: e.data.data.pageData[0].pickup_id, + sto_sele_distr: e.data.data.pageData[0].distr_type + }); + th.data.fir_def_store = e.data.data.pageData[0]; + } + + //-- 如果有默认选择门店的时候,要把默认门店放在第一位,修改不要配送方式的判断 -- + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') { + for (var k = 0; k < e.data.data.pageData.length; k++) { + if (e.data.data.pageData[k].pickup_id == th.data.def_pick_store.pickup_id) { + e.data.data.pageData.splice(k, 1); //删除 + break; + } + } + e.data.data.pageData.splice(0, 0, th.data.def_pick_store); //添加 + } + + + th.setData({ + all_pick_list: e.data.data.pageData + }); + + //--获取线下库存,而且不是新的门店规则, 同时是普通购买的时候,或者同时不能是活动,秒杀,拼团,积分购-- + if (!getApp().is_virtual(th.data.sele_g) && th.data.sales_rules >= 2 && !th.data.is_newsales_rules + && !th.data.sele_g.whsle_id && ([1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) == -1 || is_normal == 1)) { + setTimeout(function () { + th.deal_pickup_dline(e); + }, 800) + } else { + setTimeout(function () { + th.deal_pickup(e); //--普通门店排版-- + }, 800) + } + if (func) func(); + } else { + + if (func) func(); + th.setData({ sp_seleing: 0 }) + wx.hideLoading(); + } + } else { + if (func) func(); + th.setData({ sp_seleing: 0 }) + wx.hideLoading(); + } + }, err => { + ut.m_toast('网络繁忙,请稍后重试'); + if (func) func(); + th.setData({ sp_seleing: 0 }) + wx.hideLoading(); + }) + }, 200) + + }, + + //------------处理门店--------------- + deal_pickup(e) { + + var th = this; + if (!th.data.sele_g) { + wx.hideLoading(); + return false + } + + var g_distr_type = th.data.sele_g.distr_type; + wx.hideLoading() + + + /*--- 判断初始的用户的默认门店要不要弄进去 ---*/ + var fid = -1; + if (th.data.fir_def_store) { + var fid = e.data.data.pageData.findIndex((e) => { + return e.pickup_id == th.data.fir_def_store.pickup_id; + }) + } + //--如果找到默认门店,同时也应该判断配送方式对不对-- + if (th.data.fir_def_store && th.data.fir_def_store.pickup_id && fid < 0 && + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { + th.data.fir_def_store.CanOutQty = 0; + //--当选择的门店是客户默认的门店的时候-- + if (th.data.def_pick_store && th.data.fir_def_store.pickup_id == th.data.def_pick_store.pickup_id) { + th.setData({ + def_pick_store: th.data.fir_def_store + }); + e.data.data.pageData.unshift(th.data.def_pick_store); + } else { + e.data.data.pageData.splice(1, 0, th.data.fir_def_store); + } + } + + + + //单总量超出10个的时候,同时门店有分类 + if (e.data.data.total > 10 && e.his_cate_num) { + getApp().request.get("/api/weshop/storagecategory/page", { + data: { + store_id: o.stoid, + pageSize: 1000, + orderField: "sort", + orderType: 'asc', + }, + success: function (ee) { + if (ee.data.code == 0) { + var check_all_cate = 0; + if (ee.data.data && ee.data.data.pageData && ee.data.data.pageData.length > 0) { + for (let i in ee.data.data.pageData) { + let item = ee.data.data.pageData[i]; + if (item.is_show == 1) { + check_all_cate = 1; + break + } + } + } + if (check_all_cate) { + var sto_cate = ee.data.data.pageData; + var sto_arr = e.data.data.pageData; + var newarr = new Array(); + var qita = new Array(); + + var is_del_pk = 0; + //----要进行门店分组-------- + for (var i = 0; i < sto_arr.length; i++) { + //找一下这个门店有没有在分类数组内 + var find2 = 0, + find2name = "", + sort = 0; + is_del_pk = 0; + for (var m = 0; m < sto_cate.length; m++) { + if (sto_arr[i].category_id == sto_cate[m].cat_id) { + if (sto_cate[m].is_show != 1) { + is_del_pk = 1; + sto_arr.splice(i, 1); + i--; + } else { + find2 = sto_cate[m].cat_id; + find2name = sto_cate[m].cat_name; + sort = sto_cate[m].sort; + is_del_pk = 0; + } + break; + } + } + if (is_del_pk) continue; + + if (newarr.length > 0) { + var find = 0; + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 + if (find2 != 0) { + for (var ii = 0; ii < newarr.length; ii++) { + if (sto_arr[i].category_id == newarr[ii].cat_id) { + newarr[ii].s_arr.push(sto_arr[i]); + find = 1; + break; + } + } + if (find == 0) { + var arr0 = new Array(); + arr0.push(sto_arr[i]); + var item = { + cat_id: find2, + name: find2name, + sort: sort, + s_arr: arr0 + }; + newarr.push(item); + } + } else { + qita.push(sto_arr[i]); + } + } else { + //如果有找到,那门店就在这个分组内,否则,分类就要排在其他 + if (find2 != 0) { + var arr0 = new Array(); + arr0.push(sto_arr[i]); + var item = { + cat_id: find2, + name: find2name, + sort: sort, + s_arr: arr0 + }; + newarr.push(item); + } else { + qita.push(sto_arr[i]); + } + } + } + + var def_arr = new Array(); + //-- 开始就看10个门店 -- + for (var k = 0; k < 10; k++) { + if (k == sto_arr.length) break; + def_arr.push(sto_arr[k]); + } + + th.setData({ + def_pickpu_list: def_arr, + pickpu_list: ee.data.data.pageData + }); + + + //门店分类要排序下 + function compare(property) { + return function (a, b) { + var value1 = a[property]; + var value2 = b[property]; + return value1 - value2; + } + } + + if (newarr.length > 0) + newarr.sort(compare("sort")); + + + //----安排其他的分类----- + if (qita.length > 0) { + var item = { + cat_id: -1, + name: "其他", + s_arr: qita + }; + newarr.push(item); + } + + var sd = { + all_sto: newarr, + is_show_sto_cat: 1 + } + if (!sto_arr || sto_arr.length <= 10) { + sd.is_show_sto_cat = -1; + sd.only_pk = sto_arr; + } + th.setData(sd); + + } else { + th.setData({ + is_show_sto_cat: -1, + only_pk: e.data.data.pageData + }); + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ + if (!th.data.def_pick_store) { + th.setData({ + def_pick_store: e.data.data.pageData[0], + sto_sele_name: e.data.data.pageData[0].pickup_name, + sto_sele_id: e.data.data.pageData[0].pickup_id, + sto_sele_distr: e.data.data.pageData[0].distr_type + }) + } + } + } else { + th.setData({ + is_show_sto_cat: -1, + only_pk: e.data.data.pageData + }); + //-----如果没有默认门店,要取第一个门店作为默认店.此时没有门店分类的情况------ + if (!th.data.def_pick_store) { + th.setData({ + def_pick_store: e.data.data.pageData[0], + sto_sele_name: e.data.data.pageData[0].pickup_name, + sto_sele_id: e.data.data.pageData[0].pickup_id, + sto_sele_distr: e.data.data.pageData[0].distr_type + }) + } + + } + } + }); + } else { + + th.setData({ + is_show_sto_cat: 0, + only_pk: e.data.data.pageData + }); + //-----如果没有默认门店,要取第一个门店作为默认店------ + if (!th.data.def_pick_store && th.data.bconfig && th.data.bconfig.is_sort_storage) { + th.setData({ + def_pick_store: e.data.data.pageData[0], + sto_sele_name: e.data.data.pageData[0].pickup_name, + sto_sele_id: e.data.data.pageData[0].pickup_id, + sto_sele_distr: e.data.data.pageData[0].distr_type + }) + } + } + }, + + //------------处理线下门店库存-------- + deal_pickup_dline(e) { + var pkno = [], + th = this; + if (!th.data.sele_g) { + wx.hideLoading(); + return false; + } + + if (this.data.def_pick_store) { + pkno.push(this.data.def_pick_store.pickup_no); + } + for (var i in e.data.data.pageData) { + var item = e.data.data.pageData[i]; + if (pkno.indexOf(item.pickup_no) < 0) + pkno.push(item.pickup_no); + } + pkno.sort(); + var pkno_str = pkno.join(","); + var o_plist = e.data.data.pageData; + var new_list = []; + var is_find_def_store = 0; + + + var g_distr_type = th.data.sele_g.distr_type; + var lock = []; + + var lock_rq = { + store_id: os.stoid, + wareId: th.data.sele_g.goods_id, + pageSize: 1000 + }; + + if (th.data.sales_rules == 3) { + lock_rq.appoint_pick_keyid = th.data.appoint_pick_keyid; + } + + //先读取门店的lock,采用链式写法,少用await + getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { + data: lock_rq + }).then(res => { + if (res.data.code == 0 && res.data.data.total > 0) { + lock = res.data.data.pageData + } + var sto_rq = { + wareIds: encodeURIComponent(th.data.sele_g.erpwareid), + storeId: os.stoid, + pageSize: 2000 + } + + if (th.data.sales_rules == 3) { + sto_rq.storageIds = th.data.appoint_pick_keyid; + } else { + sto_rq.storageNos = pkno_str; + } + + + //---通过接口获取门店的线下库存信息-- + return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { + data: sto_rq + }) + }).then(res => { + + wx.hideLoading(); + if (res.data.code == 0) { + + if (res.data.data.pageData && res.data.data.pageData.length > 0) { + + var def_pick_store = th.data.def_pick_store; + var plist = res.data.data.pageData; + + if (th.data.sales_rules == 3) { + var lock_num = 0; + var Qty = 0; + //-- 计算锁住的库存 -- + for (var i in lock) lock_num += lock[i].outQty; + Qty = plist[0].CanOutQty - lock_num; + + if (Qty > 0) { + for (var kk in o_plist) { + o_plist[kk].CanOutQty = Qty; + new_list.push(o_plist[kk]); + } + if (th.data.fir_def_store && + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || (th.data.def_pick_store && th.data.def_pick_store.distr_type == g_distr_type))) { + th.data.fir_def_store.Qty = Qty; + if (def_pick_store && def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) + th.setData({ + def_pick_store: th.data.fir_def_store + }) + is_find_def_store = 1; + } + + if (def_pick_store) { + //-- 如果库存为0就要重新赋值 -- + def_pick_store.CanOutQty = Qty; + th.setData({ + def_pick_store + }) + } + + + } else { + th.setData({ + all_sto: null, + only_pk: null, + def_pickpu_list: null + }); + return false; + } + + } else { + + + //以原来的数组为外循环,保证距离的顺序 + for (var kk in o_plist) { + for (var ii in plist) { + //线下的门店小心 + var n_item = plist[ii]; + if (n_item.StorageNo == o_plist[kk].pickup_no) { + + //拿到锁库的数量 + var lock_num = th.find_lock_num(o_plist[kk].pickup_id, lock); + //可出库数大于预出库库存的数量,可以判断为有库存 + if (n_item.CanOutQty > lock_num) { + o_plist[kk].CanOutQty = n_item.CanOutQty - lock_num; + new_list.push(o_plist[kk]); + + var ck_store = th.data.fir_def_store; + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') { + ck_store = th.data.def_pick_store; + } + + + //--如果找到默认门店,同时也应该判断配送方式对不对-- + if (th.data.fir_def_store && n_item.StorageNo == th.data.fir_def_store.pickup_no && (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { + th.data.fir_def_store.CanOutQty = n_item.CanOutQty - lock_num; + if (def_pick_store && def_pick_store.pickup_id == th.data.fir_def_store.pickup_id) + th.setData({ + def_pick_store: th.data.fir_def_store + }) + is_find_def_store = 1; + } + + //-- 如果库存为0就要重新赋值 -- + if (def_pick_store && n_item.StorageNo == def_pick_store.pickup_no) { + def_pick_store.CanOutQty = o_plist[kk].CanOutQty; + th.setData({ def_pick_store }) + } + + } + break; + } + } + } + + } + + + + //数据组装下 + var em = {}; + em.data = {}; + em.data.data = {}; + em.data.data.total = new_list.length; + em.data.data.pageData = new_list; + em.his_cate_num = e.his_cate_num; + + + var fid = -1; + if (th.data.fir_def_store) { + var fid = em.data.data.pageData.findIndex((e) => { + return e.pickup_id == th.data.fir_def_store.pickup_id; + }) + } + //--如果找到默认门店,同时也应该判断配送方式对不对-- + if (th.data.fir_def_store && th.data.fir_def_store.pickup_id && fid < 0 && + (g_distr_type == 0 || th.data.fir_def_store.distr_type == 0 || th.data.def_pick_store.distr_type == g_distr_type)) { + th.data.fir_def_store.CanOutQty = 0; + //--当选择的门店是客户默认的门店的时候-- + if (th.data.def_pick_store && th.data.fir_def_store.pickup_id == th.data.def_pick_store.pickup_id) { + th.setData({ + def_pick_store: th.data.fir_def_store + }); + em.data.data.pageData.unshift(th.data.def_pick_store); + } else { + em.data.data.pageData.splice(1, 0, th.data.fir_def_store); + } + } + + for (let j = 0; j < em.data.data.pageData.length; j++) { + var iu = em.data.data.pageData[j]; + if (iu.CanOutQty <= 0) iu.is_no_qyt = 1; + + } + + //---把数组组装进去--- + th.deal_pickup(em); + + } else { + + th.setData({ + all_sto: null, + only_pk: null, + def_pickpu_list: null + }) + } + + } else { + + th.setData({ + all_sto: null, + only_pk: null, + def_pickpu_list: null + }) + } + }) + }, + + //------------加入购物车-------------- + addCart: function (t) { + //如果是切换规格的时候,让商品不能提交到确认订单的页面,否则活动会出错,金额也不对 + if (this.data.sp_seleing) { + return false; + } + + var th = this; + var ind = t.currentTarget.dataset.openSpecModal_ind; + if (!ind) ind = t.currentTarget.dataset.openspecmodal_ind; + th.setData({ + open_ind_store: ind + }); + + + if ("add" == t.currentTarget.dataset.action && getApp().is_sp_hao()) { + wx.showToast({ + title: "视频号商品不允许加入购物车", + icon: 'none', + duration: 2000 + }); + return false; + } + + if (th.data.adding) return false; + th.data.adding = 1; + + wx.showLoading({ + mask: true + }) + + + + //如果是秒杀的话,要看redis够不够 + if (this.data.prom_type == 1 || this.data.prom_type == 2) { + + if (this.data.openSpecModal_flash_normal) { + this.data.is_normal = 1; //是普通购买 + th.add_cart_func(t); + return false; + } + + + this.getactLen(function (num) { + if (num < th.data.goodsInputNum) { + wx.hideLoading(); + th.data.adding = 0; + // getApp().my_warnning("活动库存不足!", 0, th); + wx.showToast({ + title: '活动库存不足!', + icon: 'none', + }); + return false; + } else { + th.add_cart_func(t); + } + }); + } else { + th.add_cart_func(t); + } + }, + + //------------加入购物车-------------- + addCartSer: async function (t) { + var th = this; + var ind = t.currentTarget.dataset.openSpecModal_ind; + var action = t.currentTarget.dataset.action; + + + + if (getApp().is_sp_hao() && action == 'add') { + wx.showToast({ + title: "视频号商品不允许加入购物车", + icon: 'none', + duration: 2000 + }); + return false; + } + + + if (this.data.goodsInputNum == 0) { + getApp().my_warnning('请输入购买数量', 1, th, 450); + return false; + } + + + + if (!ind) ind = t.currentTarget.dataset.openspecmodal_ind; + + th.setData({ + open_ind_store: ind + }); + + if (!th.data.sto_sele_name) { + getApp().my_warnning('请选择门店', 1, th, 450); + return false; + }; + + // 库存 + var redisNums = 0; + // 限购数 + var limitNum = 0; + // 已购买数量 + var boughtNum = 0; + + var is_ok = 1; + + // 秒杀活动 + if (this.data.prom_type == 1) { + // 如果是秒杀活动下的单独购买,is_normal为1 + if (this.data.openSpecModal_flash_normal) this.data.is_normal = 1; + + if (!this.data.is_normal) {// 秒杀购买 + + // 获取redis当前可以购买的数量 + // 如果数量为0,设置和显示已抢光 + // 否则,进一步判断是否超出限购或超出库存 + await this.getactLenser().then(async function (res) { + redisNums = res; + let curNum = th.data.goodsInputNum; + // res: redis可购买数量 + console.log('当前可以购买的数量:', res); + if (res <= 0) { + // 可购买数量<=0, 设置和显示已抢光 + th.setData({ + prom_r_null: 1, + }); + // wx.showModal({ + // title: '超出活动库存', + // }); + getApp().my_warnning('超出活动库存', 0, self); + is_ok = 0; + return false; + } else { + // 可购买数量>0 + // 计算自己还可以购买的数量 + // 自己还可购买的数量c = 每人活动限购数量a - 自己已经购买的数量b + // 如果限购数量a>redis可购买数量d,当增加数量t>d, 提示超出库存 + // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购 + let actInfo = th.data.sele_g; + await th.get_buy_num2().then(function (data) { + let limited = actInfo.buy_limit == 0 ? 100000 : actInfo.buy_limit; // 限购数量a + let promcardbuynum = data.data.data.promcardbuynum; + let buyedNum = promcardbuynum; // 自己已经购买的数量b + let canBuyNum = limited - buyedNum; // 自己还可购买的数量c + limitNum = limited; + boughtNum = buyedNum; + + if (canBuyNum <= 0) { + canBuyNum = 0; + }; + + if (canBuyNum > res) { + if (curNum > res) { // t当前增减的数量 + // wx.showModal({ + // title: '超出活动库存', + // }); + getApp().my_warnning('超出活动库存', 0, self); + th.setData({ + goodsInputNum: res || 1 + }); + is_ok = 0; + return false; + }; + }; + + if (canBuyNum <= res) { + if (curNum > canBuyNum) { + // wx.showModal({ + // title: '超出限购数量', + // }); + getApp().my_warnning('超出限购数量', 0, self); + th.setData({ + goodsInputNum: canBuyNum || 1, + }); + is_ok = 0; + return false; + } + } + }) + + } + }) + + } + } + + + if (!is_ok) return false; + + + + if (action == "buy") { + //--------------此时操作的数据------------ + var newd = { + id: th.data.data.id, + goods_num: th.data.goodsInputNum, + pick_id: th.data.sto_sele_id, + keyid: th.data.sto_sele_keyid, + }; + newd['pick_name'] = th.data.sto_sele_name; + newd['guide_id'] = getApp().globalData.guide_id; + newd['guide_type'] = 0; + + if (getApp().globalData.groupchat_id) { + newd['groupchat_id'] = getApp().globalData.groupchat_id; + } + if (this.data.prom_type && this.data.prom_type == 1) { + 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_type == 1 && this.data.openSpecModal_flash_normal) { + 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, + service_name: th.data.data.goods_name, + goods_num: th.data.goodsInputNum, + pick_id: th.data.sto_sele_id, + user_id: oo.user_id, + store_id: os.stoid, + money: th.data.data.shop_price, + }; + if (getApp().globalData.guide_id) { + newd['guide_id'] = getApp().globalData.guide_id; + newd['guide_type'] = 0; + }; + if (getApp().globalData.groupchat_id) { + newd['groupchat_id'] = getApp().globalData.groupchat_id; + } + // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价 + if (th.data.prom_type == 1) { + newd['prom_type'] = th.data.prom_type; + newd['prom_id'] = th.data.prom_id; + if (th.data.openSpecModal_flash_normal) { + newd['money'] = th.data.data.shop_price; + newd['is_pd_normal'] = 1; + } else { + newd['money'] = th.data.prom_price; + }; + }; + + + //----先看会员在购物车中是否加入了该商品----- + getApp().request.get("/api/weshop/cartService/page", { + data: { + store_id: os.stoid, + user_id: oo.user_id, + service_id: th.data.data.id, + }, + success: function (re) { + //-------如果购物车中有相关的数据--------- + if (re.data.data.total > 0) { + var item = null; + // 多门店问题 + var cartGoodsNum = 0; + const tmpObj = re.data.data.pageData; + for (let i = 0; i < tmpObj.length; i++) { + if (th.data.sto_sele_id != tmpObj[i].pick_id) { + cartGoodsNum += parseInt(tmpObj[i].goods_num); + } else { + item = tmpObj[i]; + } + } + // 当前门店同类商品还没加入到购物车 但是有其他门店的同类商品 + if (th.data.prom_type == 1 && !th.data.is_normal && !item) { + + // 秒杀购物车购买 修正数量 + var snum = limitNum - boughtNum; + if (snum <= 0) { + // wx.showModal({ + // title: '超出限购数量', + // }); + getApp().my_warnning('超出限购数量', 0, self); + return false; + } + + var cSnum = snum - cartGoodsNum <= 0 ? 0 : snum - cartGoodsNum; + var cRedisNums = redisNums - cartGoodsNum <= 0 ? 0 : redisNums - cartGoodsNum; + + if (newd['goods_num'] >= redisNums) { + if (redisNums > snum) { + newd['goods_num'] = cSnum; + } else { + newd['goods_num'] = cRedisNums; + } + } else { + if (newd['goods_num'] > snum) newd['goods_num'] = cSnum; + } + + if (newd['goods_num'] <= 0) { + getApp().my_warnning('加入购物车成功', 1, th, 450); + th.closeSpecModal(); + return false; + } + getApp().request.post("/api/weshop/cartService/save", { + data: newd, + 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(); + } + }); + return false; + } + + // 以下为当前门店同类商品已经加入到购物车 + var totalNum = th.data.goodsInputNum + item.goods_num; + + // 秒杀购物车购买 修正数量 + if (th.data.prom_type == 1 && !th.data.is_normal) { + var snum = limitNum - boughtNum; + if (snum <= 0) { + // wx.showModal({ + // title: '超出限购数量', + // }); + getApp().my_warnning('超出限购数量', 0, self); + return false; + } + if (totalNum >= redisNums) { + if (redisNums > snum) { + totalNum = snum - cartGoodsNum; + } else { + totalNum = redisNums - cartGoodsNum; + } + } else { + if (totalNum > snum) + totalNum = snum - cartGoodsNum; + } + } + + var updata = { + id: item.id, + goods_num: totalNum, + money: th.data.data.shop_price, + store_id: os.stoid, + }; + + // 秒杀:单独购买的情况下,加入购物车显示的是零售价,否则显示秒杀活动价 + if (th.data.prom_type == 1) { + // updata['prom_type'] = th.data.options.prom_type; + // updata['prom_id'] = th.data.options.prom_id; + if (th.data.openSpecModal_flash_normal) { + updata['money'] = th.data.data.shop_price; + updata['is_pd_normal'] = 1; + } else { + updata['money'] = th.data.prom_price; + }; + }; + + if (getApp().globalData.guide_id) { + updata['guide_id'] = getApp().globalData.guide_id; + updata['guide_type'] = 1; + } + if (getApp().globalData.groupchat_id) { + updata['groupchat_id'] = getApp().globalData.groupchat_id; + } + getApp().request.put("/api/weshop/cartService/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 { + getApp().request.post("/api/weshop/cartService/save", { + data: newd, + 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(); + } + }); + } + } + }); + + }; + + + + + + + + }, + get_buy_num2: async function () { + // var map = this.data.g_buy_num, + var th = this, + user_id = getApp().globalData.user_id; + // if (user_id == null) { + // // map.set(gd.goods_id, 0); + // th.setData({ + // // g_buy_num: map, + // prom_buy_num: 0, + // }); + // "function" == typeof func && func(); + // return false; + // } + + + //----获取商品购买数---- + + //----获取活动购买数---- + return await getApp().request.promiseGet("/api/weshop/rechargeServicelist/getUserBuyGoodsNum", { + data: { + store_id: os.stoid, + user_id: user_id, + card_id: th.data.gid, + prom_type: th.data.prom_type, + prom_id: th.data.prom_id + }, + //-----获取----- + success: function (tt) { + if (tt.data.code == 0) { + // map.set(gd.goods_id, g_buy_num); + th.setData({ + // g_buy_num: map, + promcardbuynum: tt.data.data.promcardbuynum, + cardbuynum: tt.data.data.cardbuynum, + }); + } + } + }); + + + }, + + //-- 加入购物的函数 -- + add_cart_func: function (t) { + var i = getApp().request; + if (oo.user_id == null) { + wx.hideLoading(); + th.data.adding = 0; + return s.my_warnning("还未登录!", 0, this); + } + + if (!getApp().globalData.userInfo) { + wx.hideLoading(); + th.data.adding = 0; + return s.my_warnning("还未登录!", 0, this); + } + + 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.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '超出商品限购', + icon: 'none', + }); + // s.my_warnning('超出商品限购', 0, th); + 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.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '超出商品活动限购', + icon: 'none', + }); + // s.my_warnning('超出商品活动限购', 0, th); + return false; + } + } + + if (th.data.goodsInputNum <= 0) { + wx.hideLoading(); + th.data.adding = 0; + return s.my_warnning("商品数量不能为0", 0, th); + } + if (th.data.sto_sele_name == null || th.data.sto_sele_name == undefined) + th.setData({ + sto_sele_name: "" + }); + if (th.data.sto_sele_name == "") { + wx.hideLoading(); + th.data.adding = 0; + 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.sele_g.whsle_id) { + newd.prom_type = 0; + newd.prom_id = 0; + } + + //---是不是从收藏夹出来的--- + 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 (getApp().globalData.groupchat_id) { + newd['groupchat_id'] = getApp().globalData.groupchat_id; + } + //让商品带上房间号 + //让商品带上房间号 + if (!th.data.sys_switch.is_skuroom_id && 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 (th.data.openSpecModal_inte_normal == 1 && th.data.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; + newd.is_pd_normal = 1; + //---如果是线下门店销售的时候--- + if (th.data.sales_rules >= 2) { + var pick = th.get_pick_from_list(th.data.sto_sele_id) + //---通过接口获取门店的线下库存信息-- + th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { + if (CanOutQty) { + if (CanOutQty < e.data.goodsInputNum) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + } + + th.add_cart_next(e, t, a, o, newd, CanOutQty); + } else { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + } + }) + + + } else { + if (o.store_count <= 0) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存已为空!', + icon: 'none' + }); + return false; + } + if (o.store_count < e.data.goodsInputNum) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + // 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) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存已为空!', + icon: 'none', + }); + return false; + } + if (o.store_count < e.data.goodsInputNum) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + } + 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) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存已为空!', + // icon: 'none', + // }); + // return false; + // }; + // if (o.store_count < e.data.goodsInputNum) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存不足!', + // icon: 'none', + // }); + // return false; + // //return s.my_warnning("库存不足!", 0, th); + // }; + // th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 + // return false; + // } else { + // //---如果是线下门店销售的时候--- + // if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2) { + // var pick = th.get_pick_from_list(th.data.sto_sele_id) + // + // th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { + // if (CanOutQty) { + // + // if (CanOutQty < e.data.goodsInputNum) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存不足!', + // icon: 'none', + // }); + // return false; + // } + // + // th.add_cart_next(e, t, a, o, newd, CanOutQty); + // } else { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存不足!', + // icon: 'none', + // }); + // return false; + // } + // }) + // + // } else { + // if (o.store_count <= 0) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存已为空!', + // icon: 'none', + // }); + // return false; + // //return s.my_warnning("库存已为空!", 0, th); + // }; + // if (o.store_count < e.data.goodsInputNum) { + // wx.hideLoading(); + // th.data.adding=0; + // wx.showToast({ + // title: '库存不足!', + // icon: 'none', + // }); + // return false; + // //return s.my_warnning("库存不足!", 0, th); + // }; + // th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 + // } + // } + // }) + // } + //要包含积分购的普通购买0 3,5,7,10, is_integral_normal积分普通购买字段 + else if ([0, 3, 5, 7, 10].indexOf(th.data.prom_type) > -1 || newd.is_integral_normal) { + newd.prom_type = 0; + newd.prom_id = 0; + + //---如果是线下门店销售的时候--- + if (th.data.sales_rules >= 2 && !th.data.sele_g.whsle_id) { + var pick = th.get_pick_from_list(th.data.sto_sele_id) + //---通过接口获取门店的线下库存信息-- + th.check_CanOutQty(th.data.sele_g, pick, function (CanOutQty) { + if (CanOutQty) { + + if (CanOutQty < e.data.goodsInputNum) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + } + + th.add_cart_next(e, t, a, o, newd, CanOutQty); + } else { + wx.hideLoading(); + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + } + }) + + } else { + if (o.store_count <= 0) { + wx.hideLoading(); + wx.showToast({ + title: '库存已为空!', + icon: 'none', + }); + return false; + //return s.my_warnning("库存已为空!", 0, th); + }; + if (o.store_count < e.data.goodsInputNum) { + wx.hideLoading(); + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + //return s.my_warnning("库存不足!", 0, th); + } + th.add_cart_next(e, t, a, o, newd); //加入购物车下一步 + } + } + + + + }) + }, + + //---加入购物车的最后一步--- + add_cart_next(e, t, a, o, newd, CanOutQty) { + + + if (getApp().globalData.groupchat_id) { + newd.groupchat_id = getApp().globalData.groupchat_id + } + var th = this, + i = getApp().request; + //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ + if ((o.prom_type != 6 && o.prom_type != 4 && o.prom_type != 2 && o.prom_type != 1) || 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 ([3, 5, 7, 10].indexOf(newd.prom_type) > -1) { + newd.prom_type = 0; + newd.prom_id = 0; + } + + wxlog.info(getApp().globalData.user_id + '-加入购物车:' + JSON.stringify(newd)); + // + // //如果有搭配购的时候的时候 + // if(th.data.collocationGoods && newd.prom_type==0){ + // newd.prom_type = 5; + // newd.prom_id = th.data.collocationGoods.id; + // } + // + // //如果有搭配购的时候的时候 + // if(th.data.zh_act && (!th.data.zh_act.zh_num || th.data.zh_act.zh_buy_num>th.data.zh_act.zh_num ) && newd.prom_type==0){ + // newd.prom_type = 7; + // newd.prom_id = th.data.zh_act.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, + prom_type: newd.prom_type, + prom_id: newd.prom_id, + state: 0, + }, + success: function (re) { + + //-- 判断活动是不是一样 -- + var item = null; + //-------如果购物车中有相关的数据--------- + if (re.data.data.total > 0) { + for (var j = 0; j < re.data.data.pageData.length; j++) { + if (!th.check_is_like(re.data.data.pageData[j], newd, 1)) continue; + item = re.data.data.pageData[j]; + break; + } + + if (!item) { + for (var j = 0; j < re.data.data.pageData.length; j++) { + if (!th.check_is_like(re.data.data.pageData[j], newd)) continue; + item = re.data.data.pageData[j]; + break; + } + } + + } + + if (item) { + item = re.data.data.pageData[0]; + //判断数量,要看下购物车中有没有该商品 + if (CanOutQty) { + if (item.goods_num + th.data.goodsInputNum > CanOutQty) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + // return s.my_warnning("库存不足!", 0, th); + } + } else { + if (item.goods_num + th.data.goodsInputNum > o.store_count) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '库存不足!', + icon: 'none', + }); + return false; + //return s.my_warnning("库存不足!", 0, th); + } + + //秒杀有限购的时候,同时不是普通购买 + if (item.goods_num + th.data.goodsInputNum + th.data.prom_buy_num > th.data.prom_buy_limit && th.data.prom_buy_limit > 0 && !newd.is_pd_normal && (th.data.prom_type == 1 || th.data.prom_type == 2)) { + wx.hideLoading(); + th.data.adding = 0; + wx.showToast({ + title: '此商品已在购物车,去购物车结算!', + icon: 'none', + }); + return false; + //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, + prom_id: newd.prom_id, //把活动id带上去(用于购物车失效变成有效商品) + prom_type: newd.prom_type + }; + + if (newd.is_pd_normal) { + updata.is_pd_normal = 1 + } + + //---是不是从收藏夹出来的--- + 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; + } + } + if (getApp().globalData.groupchat_id) { + updata['groupchat_id'] = getApp().globalData.groupchat_id; + } + + getApp().request.put("/api/weshop/cart/update", { + data: updata, + success: function (t) { + wx.hideLoading(); + th.data.adding = 0; + getApp().my_warnning('加入购物车成功', 1, th, 450); + var c_num = th.data.cartGoodsNum + th.data.goodsInputNum; + th.setData({ + cartGoodsNum: c_num + }); + th.closeSpecModal(); + } + }); + } else { + getApp().request.post("/api/weshop/cart/save", { + data: newd, + success: function (t) { + wx.hideLoading(); + th.data.adding = 0; + getApp().my_warnning('加入购物车成功', 1, th, 450); + var c_num = th.data.cartGoodsNum + e.data.goodsInputNum; + th.setData({ + cartGoodsNum: c_num + }); + th.closeSpecModal(); + } + }); + } + } + }); + + } else { + + newd['pick_name'] = th.data.sto_sele_name; + newd['pick_dis'] = th.data.sto_sele_distr; + th.buyNow(newd); + + } + }, + + //-------------获取购买数量的总函数---------------- + get_buy_num: function (gd, func) { + var map = this.data.g_buy_num, + th = this, + user_id = getApp().globalData.user_id; + if (user_id == null) { + map.set(gd.goods_id, 0); + th.setData({ + g_buy_num: map, + prom_buy_num: 0, + }); + "function" == typeof func && func(); + return false; + } + + if (map.has(gd.goods_id)) { + "function" == typeof func && func(); + } else { + //----获取商品购买数---- + getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { + data: { + store_id: os.stoid, + user_id: user_id, + goods_id: gd.goods_id, isnew: 1 + }, + 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; + } + //如果全场优惠,商品做了秒杀 + if (th.data.prom_type == 3 && gd.prom_type == 1) { + gd.prom_type = 0; + } + //如果全场阶梯优惠,商品做了秒杀 + if (th.data.prom_type == 10 && gd.prom_type == 1) { + gd.prom_type = 0; + } + + + if (!th.data.is_normal && (gd.prom_type == 1 || gd.prom_type == 2 || gd.prom_type == 4 || gd.prom_type == 6)) { + //----获取活动购买数---- + getApp().request.get("/api/weshop/ordergoods/getUserBuyGoodsNum", { + data: { + store_id: os.stoid, + user_id: user_id, + goods_id: gd.goods_id, + prom_type: gd.prom_type, + prom_id: gd.prom_id, isnew: 1 + }, + //-----获取----- + success: function (tt) { + if (tt.data.code == 0) { + map.set(gd.goods_id, g_buy_num); + th.setData({ + g_buy_num: map, + prom_buy_num: tt.data.data.promgoodsbuynum, + }); + "function" == typeof func && func(); + } + } + }); + } else { + map.set(gd.goods_id, g_buy_num); + th.setData({ + g_buy_num: map + }); + "function" == typeof func && func(); + } + } + } + }); + } + }, + //--- 获取卡类列表 --- + getPlusCardType: function (func) { + var storid = os.stoid; + var th = this; + var user = getApp().globalData.userInfo; + if (!user) return false; + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => { + var plusCard = res.data.data; + var arr = [1219, 2089, 3031]; + var new_arr = new Array(); + var card_name_map = new Map(); + + var list = []; + for (var i = 0; i < plusCard.length; i++) { + if ((!user || user.card_field == null || user.card_field == "") && plusCard[i].IsStopBuy == true) continue; + var name = "card" + plusCard[i].CorrPrice.toLowerCase(); + card_name_map.set(name, plusCard[i].CardName); + list.push(plusCard[i]); + } + + var ob = { + "card_list": list, + "name_map": card_name_map + }; + func(ob); + }) + }, + + + //----------增加购买数量----------- + addCartNum: function (t) { + var add_num = 1; + var p_type = parseInt(this.data.prom_type) + if ([1, 2, 4, 6, 8, 9].indexOf(p_type) == -1 || this.data.openSpecModal_inte_normal == 1 || this.data.is_normal == 1) { + add_num = getApp().get_limit_qty(this.data.sele_g, this.data.is_act, 1); + } + + this.checkCartNum(this.data.goodsInputNum + add_num); + }, + //------检查数量是不是超出限购------ + checkCartNum: function (t) { + var th = this; + + var mo_num = getApp().get_limit_qty(th.data.sele_g, th.data.is_act); + var steep = getApp().get_limit_qty(th.data.sele_g, th.data.is_act, 1); + this.get_buy_num(this.data.sele_g, async function () { + + var is_show_bs = 0; + var l_num = -1; + + //--判断商品是否超出限购-- + if (th.data.g_buy_num != null && th.data.sele_g.viplimited > 0) { + + var gd_buy_num = th.data.g_buy_num.get(th.data.sele_g.goods_id); + + if (t + gd_buy_num > th.data.sele_g.viplimited) { + wx.showToast({ + title: '超出商品限购', + icon: 'none', + }); + + is_show_bs = 1; + + // s.my_warnning('超出商品限购', 0, th); + l_num = th.data.sele_g.viplimited - gd_buy_num; + if (l_num < 0) l_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.showToast({ + title: '超出商品活动限购', + icon: 'none', + }); + // s.my_warnning('超出商品活动限购', 0, th); + 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.sele_g.prom_type == 2 || th.data.sele_g.prom_type == 6) && !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.showToast({ + title: '超出商品活动库存', + icon: 'none', + }); + // s.my_warnning('超出商品活动库存', 0, th); + th.setData({ + goodsInputNum: redis_num + }) + return false; + } + } + var e = th.data.sele_g.store_count; + var p_type = parseInt(th.data.prom_type + ''); //&& p_type!=1 && p_type!=4 + if (!th.data.sele_g.whsle_id && th.data.sales_rules >= 2 && + ([1, 2, 4, 6, 8, 9].indexOf(p_type) == -1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1)) { + + //-- 如果是虚拟商品,默认给最大值 -- + if (getApp().is_virtual(th.data.sele_g)) { + e = 100000; + } else { + if (!th.data.def_pick_store) { + wx.showToast({ + title: '请选择门店', + icon: 'none', + }); + // wx.showModal({title: '请选择门店',}); + return false; + } else { + e = th.data.def_pick_store.CanOutQty; + } + } + } + + //-- 限购数量也要进行计算一下 -- + if (l_num > -1) { + if (e > l_num) e = l_num; + } + + //--- 促销活动也不控制起订量, 这里很重要的一个控制,起订量的 ---- + if ([0, 3, 5, 7, 10].indexOf(p_type) > -1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1) { + if (t < mo_num) { + t = mo_num; + if (!is_show_bs) { + wx.showToast({ + title: '购买数未达到起订量', + icon: 'none', + }); + } + is_show_bs = 1; + } + if (t > mo_num && (t - mo_num) % steep != 0) { + + if (!is_show_bs) { + wx.showToast({ + title: '购买数必须是起订量的倍数', + icon: 'none', + }); + } + + t = mo_num + parseInt((t - mo_num) / steep) * steep + steep; + is_show_bs = 1; + } + } + + if (!e) e = 0; + //库存不足,不增加 + if (e < t) { + if (!is_show_bs) { + wx.showToast({ + title: '库存不足', + icon: 'none', + }); + } + + // wx.showModal({title: '库存不足',}); + if (e < 0) e = 0; + + //只有普通商品才有起购数 + if ([1, 2, 4, 6, 8, 9].indexOf(p_type) == -1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1) { + if (e < mo_num) e = mo_num; + if (e > mo_num && (e - mo_num) % steep != 0) { + e = mo_num + parseInt((e - mo_num) / steep) * steep; + } + } + th.setData({ + goodsInputNum: e + }); + return false; + } + + //var steep=getApp().get_limit_qty(th.data.sele_g,0,1); + t > e || 0 == e ? t = e : t < 1 && (t = 1); + + + //只有普通商品才有起购数 + if ([1, 2, 4, 6, 8, 9].indexOf(p_type) == -1 || th.data.openSpecModal_inte_normal == 1 || th.data.is_normal == 1) { + if (t < mo_num) t = mo_num; + } + + + th.setData({ + goodsInputNum: t + }); + th.is_show_more_buy(); + + }) + }, + is_show_more_buy: async function () { + var prom_goods = this.data.prom_goods; + if (!prom_goods) return false; + //如果系统默认的顺序不是以优惠促销为默认第一位的时候 + if (this.check_prom_custom(1) !== 3) { + return false; + } + + if (!this.data.sele_g) return false; + + var per_price = this.data.sele_g.shop_price + if (this.data.card_field && this.data.sele_g[this.data.card_field] > 0) { + per_price = this.data.sele_g[this.data.card_field]; + } + + var all_price = per_price * this.data.goodsInputNum; + var con = null; + for (var i in prom_goods) { + var item = prom_goods[i]; + if (item.prom_type == 1) { + if (item.condition > this.data.goodsInputNum) { + con = item; + con.need = (item.condition - this.data.goodsInputNum).toFixed(2) + "件"; + break; + } + } else { + if (parseFloat(item.condition) > parseFloat(parseFloat(all_price).toFixed(2))) { + con = item; + con.need = (item.condition - all_price).toFixed(2) + "元"; + break; + } + } + } + //获取用户参与优惠促销的次数 + //if(con && con.prom_id){ + //await this.getUserBuyPromNum_pre(con.prom_id); + //} + this.setData({ + hui_condition: con + }); + + }, + + //----------减少购买数量----------- + subCartNum: function (t) { + var add_num = 1; + var p_type = parseInt(this.data.prom_type) + if ([1, 2, 4, 6, 8, 9].indexOf(p_type) == -1 || this.data.openSpecModal_inte_normal == 1 || this.data.is_normal == 1) { + add_num = getApp().get_limit_qty(this.data.sele_g, this.data.is_act, 1); + var mo_num = getApp().get_limit_qty(this.data.sele_g, this.data.is_act); + if (this.data.goodsInputNum - add_num < mo_num) { + wx.showToast({ + title: '购买数量不能小于起订量', + icon: 'none', + }); + return false; + } + } + this.checkCartNum(this.data.goodsInputNum - add_num); + }, + //----------输入框输入购买数量----------- + inputCartNum: function (t) { + this.checkCartNum(Number(t.detail.value)); + }, + //统一一下获取线下库存的函数 + async check_CanOutQty(goodsinfo, item, func) { + + var sales_rules = this.data.sales_rules; + //如果默认是商品 + if (getApp().is_virtual(goodsinfo)) { + return func(100000); + } + + var lock_rq = { + store_id: os.stoid, + wareId: goodsinfo.goods_id, + pageSize: 1000 + }; + + if (sales_rules == 2) { + lock_rq.storageId = item.pickup_id + } else { + lock_rq.appoint_pick_keyid = encodeURIComponent(this.data.appoint_pick_keyid) + } + + var lock = 0; + var CanOutQty = 0; + var plist = null; + //先读取门店的lock + await getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { + data: lock_rq + }).then(res => { + if (res.data.code == 0 && res.data.data.total > 0) { + for (var i in res.data.data.pageData) + lock += res.data.data.pageData[i].outQty; + } + }) + + var sto_req = { + wareIds: encodeURIComponent(goodsinfo.erpwareid), + storeId: os.stoid + } + if (sales_rules == 2) { + sto_req.storageNos = item.pickup_no + } else { + sto_req.storageIds = encodeURIComponent(this.data.appoint_pick_keyid) + } + + + + //读取线下的门店库存 + await getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { + data: sto_req + }).then(res => { + if (res.data.code == 0 && res.data.data.total > 0) { + plist = res.data.data.pageData[0]; + } + }) + + if (plist && plist.CanOutQty - lock > 0) { + CanOutQty = plist.CanOutQty - lock; + } + + if (func) func(CanOutQty); + + }, + //获取更多秒杀 + 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; + + 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 && rs.data.data) { + f_more[i].price = rs.data.data.user_price; + f_more[i].is_pickup = rs.data.data.is_pickup; + f_more[i].pick_up_lists = rs.data.data.pick_up_lists; + } + }) + } + func(f_more); + + }, + //获取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); + }, + //获取redis中的数量 + async getactLenser() { + let prom_type = this.data.prom_type; + let prom_id = this.data.prom_id; + return await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/" + prom_type + "/" + prom_id, { + 1: 1 + }).then(res => { + if (res.data.code == 0) { + // 当前可以购买的数量 + let r_num = res.data.data; + return r_num; + }; + }) + }, + + //因为在购物车 普通商品和 优惠促销,搭配购,组合购 阶梯购是一样的 + check_is_like(e, newd, idx) { + if (e.prom_type == newd.prom_type) return true; + if (!idx) { + if (e.prom_type == 0) { + if ([3, 5, 7, 10].indexOf(newd.prom_type) > -1) return true; + } + if (newd.prom_type == 0) { + if ([3, 5, 7, 10].indexOf(e.prom_type) > -1) return true; + } + } + return false; + }, + //----------增加购买数量----------- + addCartNumser: function (t) { + this.checkCartNumser(this.data.goodsInputNum + 1); + }, + //----------减少购买数量----------- + subCartNumser: function (t) { + this.checkCartNumser(this.data.goodsInputNum - 1); + }, + //----------输入框输入购买数量----------- + inputCartNumser: function (t) { + this.checkCartNumser(Number(t.detail.value)); + }, + + //------检查数量是不是超出限购------ + checkCartNumser: async function (t) { + var th = this; + + if (!th.data.def_pick_store) { + wx.showModal({ title: '请选择门店', }); + return false; + }; + + // 非秒杀活动 + if (this.data.prom_type != 1) { + this.setData({ + goodsInputNum: t, + }); + }; + + // 秒杀活动 + if (this.data.prom_type == 1) { + // 如果是秒杀活动下的单独购买,is_normal为1 + if (this.data.openSpecModal_flash_normal) this.data.is_normal = 1; + + if (this.data.is_normal) {// 单独购买 + this.setData({ + goodsInputNum: t, + }); + } else {// 秒杀购买 + + // 获取redis当前可以购买的数量 + // 如果数量为0,设置和显示已抢光 + // 否则,进一步判断是否超出限购或超出库存 + await this.getactLenser().then(async function (res) { + // res: redis可购买数量 + // console.log('当前可以购买的数量:', res); + if (res <= 0) { + // 可购买数量<=0, 设置和显示已抢光 + th.setData({ + prom_r_null: 1, + }); + } else { + // 可购买数量>0 + // 计算自己还可以购买的数量 + // 自己还可购买的数量c = 每人活动限购数量a - 自己已经购买的数量b + // 如果限购数量a>redis可购买数量d,当增加数量t>d, 提示超出库存 + // 如果限购数量a<=redis可购买数量d, 当增加数量t>a,提示超出限购 + let actInfo = th.data.sele_g; + await th.get_buy_num2().then(function (data) { + let limited = actInfo.buy_limit == 0 ? 100000 : actInfo.buy_limit; // 限购数量a + let promcardbuynum = data.data.data.promcardbuynum; + let buyedNum = promcardbuynum; // 自己已经购买的数量b + let canBuyNum = limited - buyedNum; // 自己还可购买的数量c + + if (canBuyNum <= 0) { + canBuyNum = 0; + }; + + if (limited > res) { + if (t > res) { // t当前增减的数量 + // wx.showModal({ + // title: '超出活动库存', + // }); + getApp().my_warnning('超出活动库存', 0, self); + th.setData({ + goodsInputNum: res || 1, + }); + return false; + }; + }; + + if (limited <= res) { + if (t > canBuyNum) { + // wx.showModal({ + // title: '超出限购数量', + // }); + getApp().my_warnning('超出限购数量', 0, self); + th.setData({ + goodsInputNum: canBuyNum || 1, + }); + return false; + }; + }; + + th.setData({ + goodsInputNum: t, + }); + }); + }; + }); + + } + + + }; + + + + + + + + + + + + // var e = th.data.sele_g.goods_num; + // 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; + // } + // } + + + // th.setData({goodsInputNum: t}); + + // }); + + + }, + //-----------选择属性的按钮事件---------- + sele_spec: function (e) { + + //如果只有一个规格直接结束 + if ((this.data.sku_g && this.data.sku_g.length==1) || (this.data.sku_g_pt && this.data.sku_g_pt.length==1)) { + return + } + if (this.data.sp_seleing) { + return false; + } + + this.setData({ sp_seleing: 1 }) + + var that = this; + var th = this; + + //在切换规格的时候,指定门店不匹配的状态要清理 + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') { + th.data.def_pick_store.is_no_dis_nor = 0; + that.setData({ + def_pick_store: th.data.def_pick_store + }) + } + + //切换完商品后,海报图片都要跟换 + this.data.share_goods_img = null; + + var gid = e.currentTarget.dataset.gid; + var nor = e.currentTarget.dataset.nor; + var user_id = getApp().globalData.user_id; + + var sku_g = this.data.sku_g; + if (nor || (gid != this.data.base_nor_goods_id && this.data.base_nor)) { + sku_g = this.data.sku_g_pt; + if (nor) this.data.base_nor = nor; + } + + //要把不匹配还原 + if (th.data.def_pick_store && JSON.stringify(th.data.def_pick_store) != '{}') { + th.data.def_pick_store.is_no_dis = 0; + th.data.def_pick_store.is_no_dis_nor = 0; + th.setData({ def_pick_store: th.data.def_pick_store }) + } + + //普通商品多规格的时候,商品切换 + if (this.data.base_nor_prom_type) this.data.base_nor_prom_type = parseInt(this.data.base_nor_prom_type); + if ([1, 2, 4, 6, 8, 9].indexOf(this.data.base_nor_prom_type) == -1) { + + this.setData({ + prom_goods: null, + jieti_prom: null, + order_prom: null, + zh_act: null, + more_flash: null, + }) + } + + //拼团在点击回来的时候,还是只能是立即购买,不能有购物车的情况 + if (this.data.base_nor_prom_type == 6 && parseInt(gid + '') == parseInt(this.data.base_nor_goods_id + '')) { + this.setData({ + openSpecModal_pt: 1, + openSpecModal: 0, + sku_g: this.data.sku_g_pt, + is_normal: 1 + }) + nor = 1; + } + + + //that.data.change=1; + var item = null; + for (var i in sku_g) { + if (sku_g[i].goods_id == gid) { + item = sku_g[i]; + if (item.original_img.indexOf(that.data.iurl) == -1) { + item.original_img = that.data.iurl + item.original_img; + } + break + } + } + console.log(item, 2000); + var cur_price = item.shop_price; + if (getApp().globalData.userInfo && getApp().globalData.userInfo.card_field) { + var cfile = getApp().globalData.userInfo.card_field; + console.log('cfile', cfile); + if (item[cfile]) { + cur_price = item[cfile]; + } + } + var txt = (cur_price / item.market_price * 10).toFixed(2).toString(); + txt = parseFloat(txt); + item['disc'] = txt; + if (item) this.setData({ + sele_g: item, + gid: gid, + data: item, + }); + + + if (nor) { + that.set_sele_g(sku_g) + that.get_sto(1, () => { + that.sele_spec_next(that, item, gid, nor); + }); + } + else that.get_sto(null, () => { + that.sele_spec_next(that, item, gid, nor); + }, item); + + }, + //-- 选择规格下一步 -- + sele_spec_next(that, item, gid, nor) { + let th = this; + if (!item.whsle_id && ([1, 2, 4, 6].indexOf(item.prom_type) == -1 || this.data.is_normal == 1)) + that.check_is_youhui(gid, that.data.is_normal, 1); + + //默认门店要拿下门店库存 + if (that.data.sales_rules >= 2 && that.data.def_pick_store && !that.data.sele_g.whsle_id && [1, 2, 4, 6].indexOf(item.prom_type) == -1) { + var lock = 0, + plist = null; + + that.check_CanOutQty(that.data.sele_g, that.data.def_pick_store, function (CanOutQty) { + that.data.def_pick_store.CanOutQty = CanOutQty; + //--给门店赋值线下库存-- + that.setData({ + def_pick_store: that.data.def_pick_store + }); + }) + + } + that.sele_spec_chech_activity(nor); + + //如果是秒杀,拼团等互动,就不重新算界面 + if ([1, 2, 4, 6, 8, 9].indexOf(this.data.base_nor_prom_type) > -1) { + return false; + } + + that.check_has_flash(gid); + var url = '/api/weshop/activitylist/listGoodActInfo2New'; + var req_d = { + "store_id": os.stoid, + "goods_id": that.data.gid, + "user_id": getApp().globalData.user_id, + } + getApp().request.get(url, { + data: req_d, + success: function (e) { + if (e.data.code != 0 || !e.data.data || e.data.data.length <= 0) return false; + var arr = e.data.data; + if (!arr || !arr.length) { + return false; + } + var arr3 = arr.filter(function (e) { + return e.s_time < ut.gettimestamp() && e.prom_type == 7; + }) + + //-- 组合购要在面前计算 --,计算完之后,再来计算check_is_youhui -- + if (arr3 && arr3.length > 0) { + //获取活动信息 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + + arr3[0].act_id + "/" + getApp().globalData.user_id; + getApp().request.get(url, { + success: function (e) { + if (e.data.code == 0 && e.data.data) { + if (ut.gettimestamp() < e.data.data.start_time) { + return false; + } + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) { + //-- 获取商品列表 -- + th.setData({ + zh_act: e.data.data + }); + th.getUserBuyPromNum(e.data.data.id) + } + } + if (!item.whsle_id) that.check_is_youhui(gid, that.data.is_normal); + } + }); + } else { + if (!item.whsle_id) that.check_is_youhui(gid, that.data.is_normal); + } + + } + }) + }, + //选择了不同的规格的时候要判断是不是有活动正在进行中 + async sele_spec_chech_activity(nor) { + //---如果是活动的时候--- + var prom = null, goodsinfo = this.data.sele_g, th = this; + + //如果是普通购买的时候,要返回原先 + if (goodsinfo.goods_id == this.data.base_nor_goods_id) { + goodsinfo.prom_type = this.data.base_nor_prom_type; + goodsinfo.prom_id = this.data.base_nor_prom_id; + + this.setData({ + prom_type: this.data.base_nor_prom_type, + prom_id: this.data.base_nor_prom_id, + }) + } + + var user_id = getApp().globalData.user_id; + if (!user_id) user_id = 0; + if (goodsinfo.prom_type == 1) { + await getApp().request.promiseGet("/api/ms/flash_sale/getNew/" + os.stoid + "/" + user_id + "/" + goodsinfo.prom_id, {}).then(res => { + if (res.data.code == 0 && res.data.data) { + prom = res.data.data; + prom.price = prom.user_price; + this.setData({ + is_share_text: prom.is_share_text + }) + } + }) + } + if (goodsinfo.prom_type == 6) { + await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + goodsinfo.prom_id, {}).then(res => { + if (res.data.code == 0) { + prom = res.data.data; + + + //----------查看阶梯团------------ + if (prom.ct_rylist != "null" && prom.ct_rylist != "" && prom.ct_rylist != null && prom.ct_rylist != undefined) { + prom.ct_rylist = JSON.parse(prom.ct_rylist); + var max_num = 0; + prom.ct_rylist.forEach(function (val, ind) { + if (parseInt(val.rynum) > max_num) max_num = parseInt(val.rynum); + }) + prom.max_ct_num = max_num; + } + + } + }) + } + + if (goodsinfo.prom_type == 4) { + await getApp().request.promiseGet("/api/weshop/integralbuy/getActInfo/" + os.stoid + "/" + goodsinfo.goods_id + "/" + goodsinfo.prom_id, {}).then(res => { + if (res.data.code == 0) { + prom = res.data.data; + } + }) + + if (prom) { + let times = new Date().getTime() + prom.show_time_off = "" + let atimes = prom.start_time * 1000 + + if (atimes > times) { + prom.show_time_off = ut.formatTime(prom.start_time) + } + } + + } + console.log('活动详情------------'); + console.log(prom); + //----------如果有活动,并且在进行中,就不计算线下库存--------------- + var now = ut.gettimestamp(); + if (prom) { + + var t1 = prom.start_time; + var prom_st = 1; + if (prom.show_time) { + t1 = prom.show_time; + if (prom.start_time > now) prom_st = 0; + } + if (prom.is_end == 0 && prom.end_time > now && t1 < now) { + th.setData({ + prom_type: goodsinfo.prom_type, + prom_price: prom.price, + prom_buy_limit: prom.buy_limit ? prom.buy_limit : (prom.limitvipqty ? prom.limitvipqty : 0), + prom_end_time: prom.end_time, + prom_start_time: prom.start_time, + prom_st: prom_st, + prom_act: prom, + prom_id: prom.id, + sp_seleing: 0 + }) + + var pro_null = null; + if (goodsinfo.prom_type == 1) { + var rs = await getApp().request.promiseGet("/api/weshop/activitylist/getActLen/" + os.stoid + "/1/" + prom.id, {}); + if (rs && rs.data.code == 0 && rs.data.data <= 0) { + pro_null = 1; + } + } + th.setData({ pro_null }); + + + //却换图片 + th.init(goodsinfo.goods_id); + var newTime = ut.gettimestamp(); + var endTime2 = prom.end_time; + var endTime1 = prom.start_time; + + this.data.is_timer = 0; + + setTimeout(function () { + th.data.is_timer = 1; + if (endTime1 > newTime) { + th.setData({ + prom_time_text: '距秒杀开始还有' + }) + // th.countDown(endTime1, 0); + } else { + if (endTime2 > newTime) { + th.setData({ + prom_time_text: '距秒杀结束还有', + prom_st: 1 + }) + // th.countDown(endTime2); + } + } + + }, 1000) + + return false; + } + } + + if (nor) { + th.setData({ sp_seleing: 0 }) + return false; + } + + //---设置普通商品--- + th.setData({ + prom_type: 0, + prom_price: null, + prom_buy_limit: null, + prom_end_time: null, + prom_start_time: null, + prom_st: null, + sp_seleing: 0 + }) + + }, + //---检查有没有优惠活动--- is_nor的普通购买的时候,is_spec是切换规格的时候 + check_is_youhui: async function (gid, is_nor, is_spec) { + var th = this; + var user_id = getApp().globalData.user_id; + if (!user_id) user_id = 0; + + //普通购买的时候,重新算一下组合购有没有 + if (is_nor || is_spec) { + + + th.setData({ + cx_prom_group: [] + }) + + var arr3 = null; + var url = '/api/weshop/activitylist/listGoodActInfo2New'; + var req_d = { + "store_id": os.stoid, + "goods_id": gid, + "user_id": user_id, + } + await getApp().request.promiseGet(url, { + data: req_d, + }).then(e => { + if (e.data.code == 0 && e.data.data && e.data.data.length > 0) { + var arr = e.data.data; + if (arr.length) { + arr3 = arr.filter(function (e) { + return e.s_time < ut.gettimestamp() && e.prom_type == 7; + }) + } + } + }) + + if (arr3 && arr3.length > 0) { + //获取活动信息 + var url = "/api/weshop/prom/zhbuy/get/" + os.stoid + "/" + arr3[0].act_id + "/" + getApp().globalData.user_id; + await getApp().request.promiseGet(url, { + + }).then(e => { + if (e.data.code == 0 && e.data.data) { + if (ut.gettimestamp() < e.data.data.start_time) { + return false; + } + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) { + //-- 获取商品列表 -- + + if (is_spec) { + th.setData({ + zh_act: e.data.data + }) + } else { + th.data.zh_act = e.data.data; + } + + th.getUserBuyPromNum(e.data.data.id) + } + } + }) + } + } + + var r_data = null; + + + //-- 如果有组合购的时候 -- + if (th.data.zh_act) { + var show_time = ut.formatTime(th.data.zh_act.start_time) + "至" + ut.formatTime(th.data.zh_act.end_time); + //-- 开始组装数据 -- + th.add_cx_prom_group({ + id: th.data.zh_act.id, + title: th.data.zh_act.name, + show_time: show_time, + prom_type: 7 + }); + } + + //调用接口判断订单优惠, + await getApp().request.promiseGet("/api/weshop/goods/getGoodsPromListNew1/" + os.stoid + "/" + gid + "/0" + "/" + user_id, {}).then(async res => { + if (res.data.code == 0 && res.data.data) { + r_data = res.data.data; + var max = 0, + min = 0; + + //如果是搭配购的时候 + if (r_data.collocationList) { + for (var i in r_data.collocationList) { + if (max == 0) max = r_data.collocationList[i].price; + if (min == 0) min = r_data.collocationList[i].price; + + if (max < parseFloat(r_data.collocationList[i].price)) max = r_data.collocationList[i].price; + if (min > parseFloat(r_data.collocationList[i].price)) min = r_data.collocationList[i].price; + } + r_data.collocationPromList.max = (max + th.data.data.shop_price).toFixed(2); + r_data.collocationPromList.min = (min + th.data.data.shop_price).toFixed(2); + var show_price = '¥' + r_data.collocationPromList.max + '-' + r_data.collocationPromList.min; + var show_time = ut.formatTime(r_data.collocationPromList.start_time) + "至" + ut.formatTime(r_data.collocationPromList.end_time); + + //-- 开始组装数据 -- + th.add_cx_prom_group({ + id: r_data.collocationPromList.id, + title: r_data.collocationPromList.title, + show_price: show_price, + show_time: show_time, + prom_type: 5, + main_gid: gid + }); + } + + + + //优惠促销的时候 + if (r_data.promGoodsLists) { + + var fir_act = r_data.promGoodsLists[0]; + var is_yh_out_limit = 0; + + + //-- 计算一下限购,满足限购数才显示 -- + if (fir_act.limit_num) { + await this.getUserBuyPromNum_pre(fir_act.prom_id); + if (th.data.user_pre_buynum >= fir_act.limit_num) { + is_yh_out_limit = 1; + } + } + + //如果是有限购的时候 + if (fir_act.gd_limit_num > 0 && !is_yh_out_limit) { + var lrs = { + store_id: os.stoid, + user_id: user_id, + goods_id: gid, + prom_type: 3, + prom_id: fir_act.prom_id, isnew: 1 + }; + var gd_limit_rs = await getApp().promiseGet('/api/weshop/ordergoods/getUserBuyGoodsNum', { data: lrs }); + var pro_by_num = 0; + if (gd_limit_rs && gd_limit_rs.data.code == 0) { + pro_by_num = gd_limit_rs.data.data.promgoodsbuynum + } + if (pro_by_num >= fir_act.gd_limit_num) { + is_yh_out_limit = 1; + } + } + //-- 如果超出限购,就不显示了 -- + if (!is_yh_out_limit) { + var more_arr = ut.format_yh_act(fir_act); + + var limit = '每人' + (fir_act.limit_num ? '限参与' + fir_act.limit_num + '次' : '参与不限次'); + if (fir_act.gd_limit_num > 0) { + limit += ",限购" + fir_act.gd_limit_num + "件"; + } + + //-- 开始组装数据 -- + th.add_cx_prom_group({ + id: fir_act.prom_id, + condition: fir_act.condition + (fir_act.prom_type == 1 ? '件' : '元'), + limit: limit, + gd_limit_num: fir_act.gd_limit_num > 0 ? fir_act.gd_limit_num : 0, + more: more_arr, + prom_type: 3, + promGoodsListsDtos: r_data.promGoodsLists, + is_yh_out_limit: is_yh_out_limit + }); + } + + } + + //普通购买不在界面显示 + if (is_nor) { + th.data.collocationGoods = r_data.collocationPromList; + th.data.prom_goods = r_data.promGoodsLists; + } else { + th.setData({ + order_prom: r_data.promOrder, + collocationGoods: r_data.collocationPromList, + prom_goods: r_data.promGoodsLists, + }) + } + + + } + }) + + + //-- 如果有阶梯购的时候 -- + if (r_data && r_data.ladderLists) { + var act_id = r_data.ladderLists[0].form_id; + //-- 判断会员能不能参与阶梯促销 -- + await getApp().request.promiseGet("/api/weshop/prom/ladderForm/getNew/" + os.stoid + "/" + user_id + "/" + act_id, {}).then(res => { + if (res.data.code == 0 && res.data.data) { + var prom_content = ""; + //暂定优惠促销还不能重叠 + // if (res.data.data.good_object == 0 && (r_data.promGoodsLists || th.data.zh_act)) { + // return false; + // } + // if (res.data.data.good_object == 1) { + // r_data.promGoodsLists = null; + // } + + for (let jj in r_data.ladderLists) { + if (r_data.ladderLists[jj].discount == 10) { + prom_content += "第" + (parseInt(jj) + 1) + "件原价,"; + } else { + prom_content += "第" + (parseInt(jj) + 1) + "件" + r_data.ladderLists[jj].discount + "折,"; + } + } + prom_content = ut.sub_last(prom_content); + th.data.prom_type = 10; + th.data.prom_id = act_id; + th.setData({ + jieti_prom: prom_content, + ladder_act_id: act_id + }) + + //-- 组装一下阶梯促销 -- + var s_time = res.data.data.start_time; + var e_time = res.data.data.end_time; + th.add_cx_prom_group({ + id: act_id, + title: prom_content, + show_time: ut.formatTime(s_time) + "至" + ut.formatTime(e_time), + prom_type: 10 + }); + + } + }) + } + + th.is_show_more_buy(); + + //-- 如果有促销活动也算是有参与活动,参与活动的也统一不进行计算起订的数量 -- + this.data.is_act = 0; + if (this.data.zh_act || this.data.prom_goods || this.data.jieti_prom || this.data.collocationGoods) { + this.data.is_act = 1; + } + + console.log("11111111-gd"); + console.log(th.data.sele_g); + + //-- 更新默认购买的数量 --- + var mo_num = getApp().get_limit_qty(th.data.sele_g, this.data.is_act); + this.setData({ + goodsInputNum: mo_num + }) + this.setData({ + mo_num: mo_num + }) + }, + //获取促销活动的组合 + add_cx_prom_group(data) { + var th = this; + getApp().getConfig2(function (e) { + //需要读者系统顺序 + var json_d = JSON.parse(e.switch_list); + var auto_promote_sale = json_d.auto_promote_sale; + if (auto_promote_sale) { + var auto_promote_sale = auto_promote_sale.split(','); + var fd = auto_promote_sale.indexOf(data.prom_type + ''); + data.sort = fd; + } else { + data.sort = data.prom_type; + } + + var fdix = th.data.cx_prom_group.findIndex(function (em) { + return em.prom_type == data.prom_type + }) + + if (fdix > -1) { + th.data.cx_prom_group.splice(fdix, 1); + } + + th.data.cx_prom_group.push(data); + + //-- 排序一下 -- + function comp(a, b) { + return a.sort - b.sort; //升序 + } + var ppdata = th.data.cx_prom_group; + //使用sort排序 + ppdata.sort(comp); + + th.setData({ + cx_prom_group: ppdata + }) + + }) + }, + find_lock_num(pick_id, lock) { + var lock_num = 0; + if (!lock) return 0; + if (lock.length < 0) return 0; + for (var i in lock) { + if (pick_id == lock[i].pickupId) { + lock_num += lock[i].outQty; + } + } + return lock_num; + }, + //--- 获取默认的促销活动的默认活动 --- + check_prom_custom(ind) { + if (ind) { + if (!this.data.cx_prom_group.length) return 0; + } else { + if (!this.data.cx_prom_group.length) return { + prom_type: 0, + id: 0 + }; + } + + var prom = null; + prom = JSON.parse(JSON.stringify(this.data.cx_prom_group[0])); + + //-- 要判断有没有超出限购 -- + if (prom.prom_type == 3 && prom.is_yh_out_limit) { + if (this.data.cx_prom_group.length > 1) { + prom = this.data.cx_prom_group[1]; + } else { + prom.prom_type = 0; + prom.id = 0; + } + } + + if (ind) { + return prom.prom_type; + } + return prom; + }, + // 选择门店 + choice_store: function (ee) { + var th = this; + var ind = ee.currentTarget.dataset.ind; + var bconfig = th.data.bconfig; + this.setData({ + keyword: '' + }) + //--先判断会员状态-- + var user_info = getApp().globalData.userInfo; + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) { + wx.navigateTo({ + url: '/packageE/pages/togoin/togoin', + }) + return false; + } + + + //如果开启了,则不在选择门店 + if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) { + return false; + } + + if (!th.data.only_pk && !th.data.def_pickpu_list && !th.data.change) { + // getApp().confirmBox("门店库存不足", null, 25000, !1); + wx.showToast({ + title: '门店库存不足', + icon: 'none', + }); + return false; + } + th.data.change = 0; + + if (th.data.only_pk && !th.data.only_pk.length) { + // getApp().confirmBox("门店库存不足", null, 25000, !1); + wx.showToast({ + title: '门店库存不足', + icon: 'none', + }); + return false; + } + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) { + // getApp().confirmBox("门店库存不足", null, 25000, !1); + wx.showToast({ + title: '门店库存不足', + icon: 'none', + }); + return false; + } + + //如果开启了,则不在选择门店 + if (th.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) { + return false; + } + + + + if (bconfig && bconfig.is_sort_storage) { + wx.getLocation({ + type: 'gcj02', + success: function (res) { + + th.data.lat = res.latitude; + th.data.lon = res.longitude; + th.data.is_get_local_ok = 1; + th.setData({ + is_gps: 1 + }); + //th.onShow(); + th.get_sto(th.data.is_normal); + }, + fail: function (res) { + + + + //th.onShow(); + th.data.is_get_local_ok = 1; + th.get_sto(th.data.is_normal); + if (res.errCode == 2) { + th.setData({ + is_gps: 0 + }); + if (th.data.is_gps == 0) { + getApp().confirmBox("请开启GPS定位", null, 25000, !1); + } + } else { + th.setData({ + is_gps: "3" + }); + } + + } + }) + } else { + th.data.is_get_local_ok = 1; + th.get_sto(th.data.is_normal); + } + + if (ind != undefined && ind != null) { + this.setData({ + open_ind_store: ind, + store: 1, + openSpecModal: !1, + openSpecModal_pt: !1, + openSpecModal_flash_normal: !1, + }) + } else { + this.setData({ + store: 1, + openSpecModal: !1, + openSpecModal_pt: !1, + openSpecModal_flash_normal: !1 + + }) + } + }, + + //关闭选择门店 + close_popup: function (e) { + var th = this; + this.setData({ + store: 0, + choice_sort_store: 0, + sort_store: 0, + fir_pick_index: 0, + sec_pick_index: 0 + }) + + var openindstore = this.data.open_ind_store; + if (openindstore == 1) { + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, + }); + } else if (openindstore == 2) { + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, + }); + } else if (openindstore == 4) { //4就是拼团 + th.setData({ + openSpecModal_pt: 1, //打开拼团购买界面 + store: 0, //关闭门店 + choice_sort_store: 0, //关闭门店2级 + sort_store: 0, //关闭门店2级 + }); + } else { + th.setData({ + store: 0, + choice_sort_store: 0, + sort_store: 0 + }) + } + + + }, + choose_for_store_fir: function (e) { + var index_c = e.currentTarget.dataset.ind; + var th = this; + th.setData({ + fir_pick_index: index_c + }) + + }, + //选择更多门店 + more_store: function () { + this.setData({ + sort_store: 1 + }); + }, + check_guide(func) { + var first_leader = getApp().globalData.first_leader; + if (!first_leader) { + func(); + return false; + } + if (this.data.is_geted_guide_pick) { + func(); + return false; + } + + if (getApp().globalData.guide_pick_id) { + func(); + return false; + } + var th = this; + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => { + if (res.data.code == 0) { + getApp().globalData.guide_pick_id = res.data.data.pickup_id; + } + th.data.is_geted_guide_pick = 1; + func(); + }) + }, + + //确定def_pick为选择的门店 + sure_pick: function (e) { + var th = this; + var item = null; + var openindstore = parseInt(th.data.open_ind_store); + + if (th.data.choice_sort_store == 0) { + var index = th.data.fir_pick_index; + if (th.data.is_show_sto_cat == 1) { + item = th.data.def_pickpu_list[index]; + } else { + item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候 + } + + } else { + var index = th.data.sec_pick_index; + item = th.data.sec_sto.s_arr[index]; + } + + if (!item) return false; + + if (item.is_no_dis_nor || (item.is_no_dis_act && !th.data.is_normal)) { + wx.showToast({ + title: "该门店不可售,请选择其他门店", + icon: 'none', + duration: 2000 + }); + return false; + } + + + if (!th.data.sele_g) return false; + //判断门店的配送方式是不是匹配 + var g_distr_type = th.data.sele_g.distr_type; + if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { + wx.showToast({ + title: "门店配送方式不匹配,请选择其他门店", + icon: 'none', + duration: 2000 + }); + return false; + } + + //--回调函数的用法-- + th.check_the_pick(item, function () { + th.setData({ + def_pick_store: item, + sto_sele_name: item.pickup_name, + sto_sele_id: item.pickup_id, + sto_sele_distr: item.distr_type, + store: 0, + choice_sort_store: 0, + fir_pick_index: 0 + }); + + switch (openindstore) { + case 1: + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, + }); + break; + case 2: + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, + }); + break; + case 4: + th.setData({ + openSpecModal_pt: 1, //打开拼团购买界面 + store: 0, //关闭门店 + choice_sort_store: 0, //关闭门店2级 + sort_store: 0, //关闭门店2级 + }); + break; + case 5: + th.setData({ + openSpecModal_flash_normal: 1, //打开拼团购买界面 + store: 0, //关闭门店 + choice_sort_store: 0, //关闭门店2级 + sort_store: 0, //关闭门店2级 + }); + break; + default: + th.setData({ + store: 0, + choice_sort_store: 0, + sort_store: 0 + }) + break + } + + //如果商品没有其他活动,要取一下线下价格 + th.get_off_price(); + }) + }, + //---点击二级之后的选择--- + choose_for_store: function (e) { + var index_c = e.currentTarget.dataset.ind; + var th = this; + th.setData({ + sec_pick_index: index_c, + fir_pick_index: index_c + }) + + }, + //把选择的门店设置成默认的门店def_pick + set_def_pick: function (e) { + var th = this; + var item = null; + if (th.data.choice_sort_store == 0) { + var index = th.data.fir_pick_index; + if (th.data.is_show_sto_cat == 1) { + item = th.data.def_pickpu_list[index]; + } else { + item = th.data.only_pk ? th.data.only_pk[index] : null; //当没有门店分类的时候 + } + } else { + var index = th.data.sec_pick_index; + item = th.data.sec_sto.s_arr[index]; + } + + if (!item) return false; + + //判断门店的配送方式是不是匹配 + var g_distr_type = th.data.sele_g.distr_type; + if (item.distr_type != 0 && g_distr_type != 0 && item.distr_type != g_distr_type) { + wx.showToast({ + title: "门店配送方式不匹配", + icon: 'none', + duration: 2000 + }); + return false; + } + + //先设置之前,要判断是不是有库存 + th.check_the_pick(item, function () { + var store_id = o.stoid; + var user_id = getApp().globalData.user_id; + var def_pickup_id = item.pickup_id; + + getApp().request.put('/api/weshop/users/update', { + data: { + user_id: user_id, + def_pickup_id: def_pickup_id + }, + success: function (res) { + if (res.data.code == 0) { + if (th.data.choice_sort_store == 0) th.setData({ + fir_pick_index: 0 + }); + getApp().globalData.pk_store = item; + } else { + //s.showWarning("设置默认门店地址失败", null, 500, !1); + getApp().my_warnning("设置默认门店地址失败", 0, th) + } + + } + }); + + th.setData({ + def_pick_store: item, + sto_sele_name: item.pickup_name, + sto_sele_id: item.pickup_id, + sto_sele_distr: item.distr_type, + store: 0, + choice_sort_store: 0 + }); + + var openindstore = th.data.open_ind_store; + if (openindstore == 1) { + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, + store: 0, + choice_sort_store: 0, + sort_store: 0, + }); + } else if (openindstore == 2) { + th.setData({ + openSpecModal: !0, + openSpecModal_ind: openindstore, + store: 0, + choice_sort_store: 0, + sort_store: 0, + }); + } else if (openindstore == 4) { //4就是拼团 + th.setData({ + openSpecModal_pt: 1, //打开拼团购买界面 + store: 0, //关闭门店 + choice_sort_store: 0, //关闭门店2级 + sort_store: 0, //关闭门店2级 + }); + } else { + th.setData({ + store: 0, + choice_sort_store: 0, + sort_store: 0, + }) + } + + //如果商品没有其他活动,要取一下线下价格 + th.get_off_price(); + + }) + }, + + + get_user_store() { + + var th = this; + var that = this; + //--获取用户的默认门店 + getApp().get_user_store(function (e) { + if (!e) { + th.data.fir_def_store = {}; //赋值空对象 + return false; + } + if (getApp().globalData.is_dj_pk) th.setData({ + has_def: 1 + }); + + var ee = JSON.parse(JSON.stringify(e)); + + //--定时器推迟一下-- + var appd = getApp().globalData; + w_time = setInterval(function () { + if (that.data.is_get_local_ok == 0) return false; + if (!that.data.sele_g) return false; + if (th.data.fir_goods) var g_distr_type = th.data.fir_goods.distr_type; + //--如果默认门店的配送方式不对,就不能被选择,这里不控制,如果不一样,就说明配送方式不对-- + if (ee.distr_type != 0 && g_distr_type != 0 && ee.distr_type != g_distr_type) { + ee.is_no_dis = 1; + } + + //-- 如果有指定门店的时候,pickup_ids是经过判断是不是普通商品后才会有的 -- + if (th.data.sele_g && th.data.sele_g.pickup_ids && th.data.prom_type == 0) { + var idx = th.data.sele_g.pickup_ids.findIndex(function (e) { + return e.pickup_id == ee.pickup_id; + }) + if (idx < 0) { + ee.is_no_dis_nor = 1; + } + } + + clearInterval(w_time); + var distance = null; + var e = JSON.parse(JSON.stringify(ee)); + + //如果有开启近距离的话,同时距离优不一样了 + if (that.data.lat != null) { + //如果经纬度有变化的话 + if (e && appd.lat == that.data.lat && appd.lon == that.data.lon && e.distance > 0) { + that.set_def_storage(e); + } else { + //要用接口是获取距离,js的计算不准 + getApp().request.promiseGet("/api/weshop/pickup/list", { + data: { + store_id: os.stoid, + pickup_id: e.pickup_id, + lat: th.data.lat, + lon: th.data.lon, + isstop: 0, + is_pos: 1 + }, + }).then(res => { + if (res.data.code == 0) { + e = res.data.data.pageData[0]; + if (e) { + e.is_no_dis = ee.is_no_dis; + appd.pk_store = e; + that.set_def_storage(e); + } + + } + }) + } + //e.distance = distance; + appd.lat = that.data.lat; + appd.lon = that.data.lon; + + } else { + if (e) { + e.distance = null; + that.set_def_storage(e); + } + } + }, 200) + + }); + }, + //如果开启线下库存,已经急速库存才会使用 + check_the_pick(item, func) { + var th = this; + var goodsinfo = th.data.sele_g; + var erpwareid = goodsinfo.erpwareid; + var plist = null; + var lock = 0; + + //---如果是活动的时候,同时不是普通购买--- + if (getApp().is_virtual(th.data.sele_g) || th.data.sele_g.whsle_id || ([1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) > -1 && !th.data.is_normal)) { + func(); + return false; + } + + if (this.data.sales_rules == 1) { + func(); + } else { + // if (plist && plist.CanOutQty - lock > 0) { + // item.CanOutQty = plist.CanOutQty - lock; + // func(); + // return false; + // } + this.check_CanOutQty(goodsinfo, item, function (CanOutQty) { + + // let str = item.pickup_name + '库存不足!'; + if (!CanOutQty) { + wx.showToast({ + title: item.pickup_name + '库存不足!', + icon: 'none', + }); + return false; + } + item.CanOutQty = CanOutQty; + func(); + + }); + + } + }, + //----获取线下价格------- + get_off_price() { + var th = this; + //没有开启就返回 + if (!th.data.is_open_offline) return false; + //先看下购买的功能有没有到期 + getApp().request.promiseGet("/store/storemoduleendtime/page?store_id=" + os.stoid + "&type=6", {}).then(res => { + //未购买 + if (res.data.code != 0 || !res.data.data || !res.data.data.pageData || !res.data.data.pageData.length) { + return false; + } else { + //已经过期 + var item = res.data.data.pageData[0]; + if (item.end_time < ut.gettimestamp()) { + return false; + } + } + + + var cur_goods = this.data.sele_g; + var cur_price = cur_goods.shop_price; + if (th.data.card_field && cur_goods[th.data.card_field] > 0) { + cur_price = cur_goods[th.data.card_field]; + } + + var user_info = getApp().globalData.userInfo; + //获取一下接口,判断是不是有线下接口,必须是普通商品,全局优惠活动也是不行 + if (cur_goods.prom_type == 0 && !this.data.prom_goods) { + cur_goods.offline_price = null; + //如果没有门店,不用计算线下价格 + var def_pick_store = this.data.def_pick_store; + if (!def_pick_store) return false; + getApp().request.get("/api/weshop/goods/listWarePrice", { + data: { + VIPId: encodeURIComponent(user_info.erpvipid), + store_id: os.stoid, + PickupId: def_pick_store.pickup_id, + WareIds: encodeURIComponent(cur_goods.erpwareid) + }, + success: function (res) { + if (res.data.code == 0 && res.data.data && res.data.data.length > 0) { + var datalist = res.data.data; + if (datalist[0].WarePrice < cur_price) { + cur_goods.offline_price = datalist[0].WarePrice; //存储线下活动的价格 + cur_goods.pricing_type = datalist[0].PriceType; //存储线下活动的类型 + } + } + th.setData({ + sele_g: cur_goods + }); + } + + }) + } + + }) + + + }, + //--- 设置一下默认库存的数量 ---- + set_def_storage(ee) { + var that = this, + th = this; + getApp().getConfig2(function (e) { + var sales_rules = e.sales_rules; + if (sales_rules >= 2 && [1, 2, 4, 6, 8, 9].indexOf(th.data.prom_type) == -1 && !th.data.sele_g.whsle_id) { + getApp().waitfor2(that, "wait_for_user_store", "fir_goods", function () { + var lock = 0, + plist = null; + var gd = that.data.fir_goods; + //先读取门店的lock,采用链式写法,少用await + // getApp().request.promiseGet("/api/weshop/order/ware/lock/page", { + // data: { + // store_id: os.stoid, + // wareId: that.data.fir_goods.goods_id, + // storageId: ee.pickup_id, + // pageSize: 1000 + // } + // }).then(res => { + // if (res.data.code == 0 && res.data.data.total > 0) { + // for (var i in res.data.data.pageData) + // lock += res.data.data.pageData[i].outQty + // } + // //---通过接口获取门店的线下库存信息-- + // return getApp().request.promiseGet("/api/weshop/goods/getWareStorages", { + // data: { + // storageNos: ee.pickup_no, + // wareIds: encodeURIComponent(th.data.data.erpwareid), + // storeId: os.stoid + // } + // }) + // }).then(res => { + // if (res.data.code == 0 && res.data.data.total > 0) { + // plist = res.data.data.pageData[0]; + // } else { + // wx.showToast({ + // title: '库存不足,请更换其他门店', + // icon: 'none', + // }); + // } + // + // if (plist && plist.CanOutQty - lock > 0) { + // ee.CanOutQty = plist.CanOutQty - lock; + // } else { + // ee.CanOutQty = 0; + // } + // //--给门店赋值线下库存-- + // that.data.fir_def_store = ee; + // that.setData({ + // def_pick_store: ee, + // sto_sele_name: ee.pickup_name, + // sto_sele_id: ee.pickup_id, + // sto_sele_distr: ee.distr_type + // }) + // }) + //最新的获取线下门店库存 + th.check_CanOutQty(gd, ee, function (CanOutQty) { + ee.CanOutQty = CanOutQty; + //--给门店赋值线下库存-- + that.data.fir_def_store = ee; + that.setData({ + def_pick_store: ee, + sto_sele_name: ee.pickup_name, + sto_sele_id: ee.pickup_id, + sto_sele_distr: ee.distr_type + }) + }) + + + }) + } else { + that.data.fir_def_store = ee; + that.setData({ + def_pick_store: ee, + sto_sele_name: ee.pickup_name, + sto_sele_id: ee.pickup_id, + sto_sele_distr: ee.distr_type + }) + } + }) + + }, + wait_for_store_config: function () { + var th = this; + //----获取系统参数----- + getApp().getConfig2(function (e) { + th.setData({ + bconfig: e, + }); + }) + t_time = setInterval(function () { + + + if (th.data.bconfig == null) false; + var e = th.data.bconfig; + if (e && e.is_sort_storage) { + + + wx.getLocation({ + type: 'gcj02', + success: function (res) { + th.data.lat = res.latitude; + th.data.lon = res.longitude; + th.data.is_get_local_ok = 1; + }, + fail: function (res) { + if (res.errCode == 2) { + th.setData({ + is_gps: 0 + }); + if (th.data.is_gps == 0) { + getApp().confirmBox("请开启GPS定位", null, 10000, !1); + } + + } else { + th.setData({ + is_gps: "3" + }); + } + + th.data.is_get_local_ok = 1; + } + }) + } else { + th.data.is_get_local_ok = 1; + } + clearInterval(t_time); + }, 500) + }, + //获取搜索门店输入的值 + input_store: function (e) { + this.setData({ + keyword: e.detail.value + }) + }, + //搜索门店 + searchfn() { + let choice_sort_store = this.data.choice_sort_store + if (choice_sort_store == 0) { //全局搜索 + let all_pick_list = this.data.all_pick_list + let def_pickpu_list = this.data.def_pickpu_list + let keyword = this.data.keyword + if (keyword) { + let arr = all_pick_list.filter(item => { + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + } else { + return false + } + }) + if (arr && arr.length > 0) { + if (this.data.is_show_sto_cat == 1) { + this.setData({ + def_pickpu_list: arr + }) + } else { + this.setData({ + only_pk: arr + }) + } + } else { + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + } else { + if (this.data.is_show_sto_cat == 1) { + this.setData({ + def_pickpu_list: all_pick_list.slice(0, 10) + }) + } else { + this.setData({ + only_pk: all_pick_list + }) + } + + } + } else { //分类下搜索 + let sec_i = this.data.sec_i + let all_sto = this.data.all_sto + let old_all_sto = this.data.old_all_sto + if (!old_all_sto) { + this.setData({ + old_all_sto: JSON.parse(JSON.stringify(all_sto)) + }) + } + let sec_sto = this.data.sec_sto + let sec_arr = this.data.old_all_sto[sec_i].s_arr + let keyword = this.data.keyword + let text = 'sec_sto.s_arr' + if (keyword) { + let arr = sec_arr.filter(item => { + let i = item.pickup_name.indexOf(keyword) + if (i > -1) { + return true + } else { + return false + } + }) + if (arr && arr.length > 0) { + this.setData({ + [text]: arr + }) + } else { + wx.showToast({ + title: '没有搜索到门店', + icon: 'none', + duration: 2000 + }) + } + } else { + if (this.data.old_all_sto) { + this.setData({ + [text]: this.data.old_all_sto[sec_i].s_arr + }) + } else { + this.setData({ + [text]: all_sto[sec_i].s_arr + }) + } + } + + + } + }, + //---选择分类门店--- + choice_sort_store: function (e) { + var index = e.currentTarget.dataset.index; + var region_name = e.currentTarget.dataset.region; + var item = this.data.all_sto[index]; + this.setData({ + region_name: region_name, + sort_store: 0, + choice_sort_store: 1, + sec_sto: item, + sec_i: index, + sec_pick_index: 0 + }); + }, + // 返回按钮 + returns: function () { + this.setData({ + sort_store: 0, + choice_sort_store: 0 + }); + }, + pop_err_img: function (e) { + var txt = e.currentTarget.dataset.errorimg; + var ob = {}; + ob[txt] = this.data.iurl + "/miniapp/images/default_g_img.gif"; + this.setData(ob); + }, + async getUserBuyPromNum(prom_id,is_zh) { + var userInfo = getApp().globalData.userInfo; + var url = `/api/weshop/ordergoods/getUserBuyPromNum?store_id=${os.stoid}&user_id=${userInfo.user_id}&prom_type=7&prom_id=${prom_id}`; + let res = await getApp().request.promiseGet(url, { + data: {} + }); + let userbuynum = 0 + if (res.data.code == 0 && res.data.data) { + userbuynum = res.data.data.userbuynum + } + this.setData({ + userbuynum + }) + if(is_zh) this.data.user_zh_buy_num=userbuynum; + // return userbuynum + }, + + + } +}) diff --git a/components/add_purchase/add_purchase.json b/components/add_purchase/add_purchase.json new file mode 100644 index 0000000..ca30cd2 --- /dev/null +++ b/components/add_purchase/add_purchase.json @@ -0,0 +1,6 @@ +{ + "component": true, + "usingComponents": { + "warn": "/components/long_warn/long_warn" + } +} \ No newline at end of file diff --git a/components/add_purchase/add_purchase.wxml b/components/add_purchase/add_purchase.wxml new file mode 100644 index 0000000..8467242 --- /dev/null +++ b/components/add_purchase/add_purchase.wxml @@ -0,0 +1,430 @@ + + + + + + + + + + + {{sele_g.goods_name}} + + + + + {{sele_g[card_field]}} + {{sele_g.shop_price}} + + {{prom_price}} + + + + 券后¥ + {{sele_g.offline_price}} + + + + + + 已售:{{sele_g.sales_sum}} + + + + + + + 可售:{{def_pick_store.CanOutQty}} + + 可售:0 + + + + + + 可售:{{sele_g.store_count}} + + + + + + + 已售:{{prom_act.buy_num+prom_act.virtual}} + + 已售:{{prom_act.buy_num}} + 可售:{{(prom_act.is_virtual_count && prom_act.virtual) ? (prom_act.goods_num - prom_act.buy_num - prom_act.virtual) : (prom_act.goods_num-prom_act.buy_num)}} + + + + + + 已售:{{prom_act.buy_num+prom_act.virtualNum}} + + 已售:{{prom_act.buy_num}} + 可售:{{prom_act.goods_num-prom_act.buy_num}} + + + + + + + {{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}}积分 + ,送优惠券 + ,送赠品 + ,送礼包 + ,送专享礼包 + ,送每月礼包 + + + + + + + 配送不匹配 + + + 该店不可售 + + + 该店不可售 + + + 该店不可售 + + + + + + 库存不足 + + + + + + 库存不足 + + + + + + 库存不足 + + + + + + 请先选择门店 + + + + + + + + + + 库存不足 + + + + + 加入购物车 + + + {{sele_g.offline_price?"券后购买":"立即购买"}} + + + + + + + + + 已抢光 + + + + + 库存不足 + + + + + 加入购物车 + + + {{sele_g.offline_price?"券后购买":"立即购买"}} + + + + + + + + + + + + + + + + + + + + + + + {{choice_sort_store==0?'附近的门店':region_name}} + + + + + + {{choice_sort_store==0?'更多门店':'返回'}} + + + + + + + + 搜索 + + + + + + + + + + + + + Г + + + + + + + + {{item.pickup_name}} + (库存不足) + (配送不匹配) + (该店不可售) + (该店不可售) + (该店不可售) + + + + + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+'km':filters.toFix(item.distance,0)+"m"}} + + + + 地址:{{item.fulladdress}} + + + + + + + + + + Г + + + + + + + + {{item.pickup_name}} + (配送不匹配) + (该店不可售) + (该店不可售) + (该店不可售) + (库存不足) + + + + + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} + + + + 地址:{{item.fulladdress}} + + + + + + + + + + + + Г + + + + + + + + {{item.pickup_name}} + (库存不足) + + + + + 距离:{{item.distance>1000?filters.toFix(item.distance/1000,2)+"km":filters.toFix(item.distance,0)+"m"}} + + + + 地址:{{item.fulladdress}} + + + + + + + + + + 确定 + + + 设为默认 + + + + + + + 门店分类选择 + + + + + + 返回 + + + + + + + {{item.name}} + + + + + + + + + + + + \ No newline at end of file diff --git a/components/add_purchase/add_purchase.wxss b/components/add_purchase/add_purchase.wxss new file mode 100644 index 0000000..bfd3246 --- /dev/null +++ b/components/add_purchase/add_purchase.wxss @@ -0,0 +1,4146 @@ +@import "../../utils/wxParse/wxParse.wxss"; + + +.cover-layer { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 11; + background: rgba(0,0,0,0.4); + width: 100%; + height: 100%; +} +.container { + margin-bottom: 100rpx; + overflow: hidden; + padding-top: 80rpx; +} + +image { + vertical-align: top; +} +.rules { + position: fixed; + background-color: rgba(0,0,0,.2); + color: white; + top: 22rpx; + right: 0; + z-index: 100; + font-size: 26rpx; + padding: 0 20rpx; + z-index: 99999; + border-radius: 20rpx 0 0 20rpx; +} + +.rule-pop-container { + position: fixed; + left: 0; + bottom: 0; + width: 100%; + background-color: white; + z-index: 99999; + border-radius: 16rpx 16rpx 0 0; + padding: 0 40rpx; + box-sizing: border-box; + font-size: 28rpx; + color: #444; +} + +.pop-title { + padding: 20rpx 0; + text-align: center; + font-size: 32rpx; + position: relative; +} +.icon-guan { + position: absolute; + right: 0; + font-size: 26rpx; + top: 50%; + transform: translateY(-50%); + color: #ccc; +} +.btn { + color: white; + padding: 20rpx 0; + text-align: center; + border-radius: 40rpx; + background: -webkit-linear-gradient(left,#ff5000,#ff2000) no-repeat; +} + +.goods-detail { + overflow: hidden +} +.popup-content { + max-height: 600rpx; + overflow-y: auto; +} + +.type-navbar { + display: flex; + justify-content: center; + width: 100%; + position: fixed; + top: 0; + z-index: 999; + /* height: 80rpx; */ + /* margin-bottom: 20rpx; */ + background-color: #fff; + border-top: 2rpx solid #ebedf0; + /* border-bottom: 1rpx #fafafa solid; */ +} + +.type-box { + width: 25%; + box-sizing: border-box; + font-size: 32rpx; + line-height: 76rpx; + padding: 0 20rpx; + text-align: center; + display: inline-block; + overflow: hidden; +} + +.type-navbar-item { + /* border-bottom: 4rpx solid #fff; */ + display: flex; + justify-content: center; + width: 100%; + font-size: 26rpx; +} + +.type-item-on { + color: #F95D74; + font-weight: bold; + /* border-bottom: 4rpx solid #F95D74; */ + position: relative; + font-size: 30rpx; +} + +.type-item-on:after { + content: ''; + position: absolute; + width: 50%; + height: 4rpx; + background-color: #F95D74; + left: 0; + right: 0; + bottom: 0; + margin: 0 auto; +} + +.swiper_box { + width: 100%; + height: 750rpx; +} + +.goods-title { + display: flex; + justify-content: space-between; + align-items: center; + vertical-align: middle; + /* overflow: hidden; */ + /* height: 108rpx; */ +} + +.goods-name { + /* width: 560rpx; */ + /* line-height: 46rpx; */ + font-size: 32rpx; + font-weight: bold; + color: #333; + /* margin-top: 30rpx; + margin-bottom:30rpx; */ + flex: 1; + text-align: justify; + margin: 10rpx 0 20rpx; +} + +.goods-collect { + width: 112rpx; + padding-top: 30rpx; +} + +.collect-img { + width: 50rpx; + height: 44rpx; + margin: 0 auto; + overflow: hidden; +} + +.collect-des { + text-align: center; + font-size: 24rpx; + color: #333; +} + +.goods-price { + font-size: 60rpx; + /* padding: 20rpx 34rpx; */ + /* padding:0rpx 34rpx; */ + /* line-height: 60rpx; */ + color: #999; + padding: 20rpx; + /* margin-top: 46rpx; */ + /* margin-top:26rpx; + padding-bottom:20rpx; */ +} + +.prom-info { + margin: 10rpx 0; + color: #f23030; +} + +.prom-info>.prom-type { + color: white; + background-color: #f23030; + margin-right: 14rpx; + padding: 2rpx 8rpx; + border-radius: 4rpx; +} + +.market-price { + /* display: flex; + margin-left: -5rpx; */ +} + +.market-price .yuan { + /* top:24rpx; */ + font-size: 30rpx +} + +.market-price>view>text { + text-decoration: line-through; +} + +.market-price>.yj { + color: #999999; + font-size: 24rpx; + /* margin-left: 16rpx;position: relative;top:30rpx; */ + display: inline-block; +} + +.goods-price>.tm { + color: #999999; + font-size: 26rpx; + margin-top: 10rpx; +} + +.goods-num { + display: flex; + font-size: 24rpx; + justify-content: space-between; +} + +.goods-detail .twen { + background: #fff; + height: 60rpx; + line-height: 60rpx; + font-size: 30rpx; + padding-left: 30rpx; + display: flex; +} + +.goods-detail .twen .img { + width: 32rpx; + height: 32rpx; + margin-left: 200rpx; + background: #fff +} + +.goods-detail .twen image.img { + vertical-align: auto; +} + + +.logistics-item { + display: flex; + justify-content: space-between; + align-items: center; + height: 90rpx; + /*border-bottom: 1px solid #f5f5f5;*/ + font-size: 32rpx; + color: #666; +} + +.logistics-item .small { + color: #999; + font-size: 24rpx; +} + +.item-title { + width: 180rpx; +} + +.item-mes { + color: #333; + width: 420rpx; + height: 90rpx; + line-height: 90rpx; +} + +.item-img { + width: 32rpx; + height: 32rpx; +} + +.prom-item { + color: #f23030; + border: 1px solid #f23030; + border-radius: 18rpx; + line-height: 40rpx; + height: 40rpx; + padding: 2rpx 8rpx; +} + +.guarantee { + justify-content: space-around; +} + +.ico-item { + width: 32rpx; + height: 32rpx; + margin-right: 10rpx; +} + +.guarantee>view { + display: flex; + align-items: center; + height: 32rpx; + color: #666; +} + +.user-comment { + margin: 10rpx 0; + font-size: 28rpx; +} + +.good-comment, +.comment-num { + display: flex; +} + +.recommend { + background-color: #fff; + border-bottom: 1px solid #ddd; + padding-bottom: 20rpx; +} + +.recommend-title { + height: 70rpx; + line-height: 70rpx; + font-size: 28rpx; + padding: 0 30rpx; +} + +.recommend-ul { + display: flex; + justify-content: flex-start; +} + +.recommend-ul .li { + width: 25%; + box-sizing: border-box; + text-align: center; + font-size: 28rpx; + color: #333; +} + +.li-img { + width: 120rpx; + height: 120rpx; + margin: 0 auto; +} + +.li-title { + height: 58rpx; + line-height: 30rpx; + margin: 10rpx 0; +} + +.comment-item { + background-color: #fff; + font-size: 28rpx; +} + +.comment-title { + display: flex; + justify-content: space-between; + align-items: center; + height: 102rpx; + margin: 0 30rpx; + color: #333; + border-bottom: 1px solid #eee; +} + +.user-name { + display: flex; + align-items: center; +} + +.user-pic { + width: 54rpx; + height: 54rpx; + margin-right: 10rpx; + border-radius: 50%; + overflow: hidden; +} + +.stars { + float: left; + display: flex; + height: 42rpx; + line-height: 42rpx; + margin: 15rpx 0; + width: 200rpx; +} + +.star { + width: 26rpx; + height: 26rpx; + margin-right: 5rpx; +} + +.state-spec { + margin: 15rpx 0; + float: right; + font-size: 24rpx; + color: #666; + width: 460rpx; + text-align: right; +} + +.comment-cont { + padding: 0 30rpx 30rpx; + border-bottom: 1px solid #eee; +} + +.comment-mes { + line-height: 42rpx; +} + +.img-ul { + display: flex; + flex-wrap: wrap; +} + +.img-li { + width: 150rpx; + height: 150rpx; + margin-top: 8rpx; + margin-right: 10rpx; +} + +.comment-btn { + height: 60rpx; + padding: 20rpx 30rpx; +} + +.comment-btn .btn { + display: flex; + justify-content: center; + align-items: center; + height: 60rpx; + width: 45%; + border: 1px solid #eee; +} + +.comment-btn .btn-img { + width: 30rpx; + height: 28rpx; + margin: 0 10rpx; +} + +.reply-ul { + margin-top: 20rpx; +} + +.reply-li { + color: #aaa; +} + +.join-cart { + position: fixed; + left: 0; + bottom: 0; + display: flex; + width: 100%; + height: 100rpx; + background-color: #fff; + z-index: 9; + border-top: 4rpx solid #eee; + +} + +.join-cart>view { + width: 29%; +} + +.join-cart>.new_split { + width: 13%; + text-align: center; + padding: 0; + margin: 0; +} + +.cart-ico { + font-size: 24rpx; + color: #333; +} + +.shopping-cart { + position: relative; +} + +.cs-img { + width: 45rpx; + height: 40rpx; + margin-top: 15rpx; +} + +.sc-img { + width: 42rpx; + height: 40rpx; + margin-top: 15rpx; +} + +.cart-num { + position: absolute; + left: 50%; + top: 1rpx; + width: 40rpx; + height: 40rpx; + line-height: 40rpx; + text-align: center; + border-radius: 50%; + color: #fff; + background-color: rgba(217, 81, 99, 0.9); +} + +.cart-btn { + font-size: 28rpx; + color: #fff; + line-height: 70rpx; + margin-top: 16rpx; + text-align: center; + + +} + +.join-btn { + background-color: #ffb03f; + height: 70rpx; + border-radius: 55rpx 0rpx 0rpx 55rpx; + margin-top: 16rpx; + + +} + +view.cart-btn-lg { + width: 50%; +} + +.buy-btn { + background-color: #f23030; + height: 70rpx; + border-radius: 0 56rpx 55rpx 0; + +} + +.buy-btn-all { + background-color: #f23030; + height: 70rpx; + border-radius: 56rpx; +} + + +.toTop { + position: fixed; + z-index: 3; + right: 20rpx; + bottom: 160rpx; + width: 68rpx; + height: 68rpx; + border: 1px solid #ddd; + border-radius: 50%; + overflow: hidden; + cursor: pointer; +} + +.comment-more { + height: 56rpx; + line-height: 56rpx; + font-size: 26rpx; + color: #999; + text-align: center; + background-color: #eee; +} + +.goods-more { + background-color: #fff; +} + +.goods-norms { + background-color: #fff; +} + +.type-navbar2 { + display: flex; + height: 72rpx; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; +} + +.type-box2 { + width: 50%; + font-size: 26rpx; + line-height: 72rpx; + text-align: center; + overflow: hidden; +} + +.type-item2-on { + color: #f23030; +} + +.parameter { + padding: 40rpx 0; +} + +.table { + width: 698rpx; + margin: 0 auto; + border: 1px solid #ddd; + border-bottom: none; +} + +.tb { + width: 100%; + min-height: 69rpx; + line-height: 69rpx; + border-bottom: 1px solid #ddd; + font-size: 28rpx; + text-align: center; + color: #333; +} + +.th-thitle { + font-weight: bold; + background-color: #f5fafe; +} + +.td-cont { + display: flex; +} + +.td-title { + width: 259rpx; + background-color: #f5fafe; + border-right: 1px solid #ddd; +} + +.td-text { + width: 439rpx; +} + +.goods-comment { + background-color: #fff; +} + +.type-navbar3 { + display: flex; + height: 88rpx; + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + padding: 10rpx 0; +} + +.type-box3 { + width: 20%; + font-size: 30rpx; + line-height: 44rpx; + text-align: center; + overflow: hidden; +} + +.type-item3-on { + color: #f23030; +} + +.spec-model { + position: fixed; + bottom: 0; + z-index: 200000000; + background: white; + width: 100%; + /* padding: 0 30rpx; */ + font-size: 32rpx; + box-sizing: border-box; + border-radius: 20rpx 20rpx 0 0; + /* height: 72%; */ +} + +.spec-model .pding { + padding: 0 20rpx; +} + +.spec-goods { + padding: 30rpx 0 20rpx; + /* float: left; */ + width: 100%; + /* border-bottom:2rpx solid #eee; */ +} + +.spec-img { + float: left; + height: 186rpx; + width: 186rpx; + border: 4rpx solid #eee +} + +.spec-goods-info { + float: left; + padding: 0 25rpx; + width: 400rpx; +} + +.spec-goods-name { + font-size: 30rpx; + line-height: 35rpx; + height: 70rpx; + margin: 15rpx 20rpx 25rpx 0; + overflow: hidden; + text-overflow: ellipsis; + color: #333; +} + +.spec-goods-price { + color: #d60021; + font-size: 33rpx; + font-weight: bold; + /* display: flex; */ +} + +.spec-goods-stock { + margin-top: 3rpx; + font-size: 24rpx; + color: #999999; + margin-right: 15rpx; +} + +.spec-name { + clear: both; + padding: 20rpx 0; + font-size: 30rpx; + color: #333; +} + + +.spec-name+view{ + flex-wrap: wrap; +} + +.quhuo { + font-size: 30rpx; + color: #000 +} + +.b_num { + display: flex; + font-size: 30rpx; + color: #333; + justify-content: space-between; + align-items: center; + padding: 20rpx 0; +} + +.count { + /* position: fixed; */ + display: flex; + height: 50rpx; + /* border: 1rpx solid #000; */ + font-size: 28rpx; + right: 30rpx; +} + + +.count>view, +.count>input { + width: 60rpx; + height: 50rpx; + line-height: 50rpx; + text-align: center; +} + +.spec_bt { + background: fff; + color: #333; + margin-left: 10rpx; + padding: 4rpx 15rpx 4rpx; + display: inline-block; + border-radius: 30rpx; + font-size: 24rpx; + border: 1rpx solid #ccc; + margin: 10rpx; + height: 40rpx; + line-height: 40rpx; +} + +.spec_bt.act { + background: #d60021; + color: #fff; + border: 1rpx solid #d60021; +} + +.sub, +.add, +.count>input { + /* border-right: 1px solid #000; */ + background-color: #f8f8f8; + border-radius: 8rpx; +} + +.sub.active { + /* background-color: #ddd; */ + color: #ccc; +} + +.count>input { + margin: 0 10rpx; +} + +.add { + /* background-color: #f8f8f8; */ + /* border-left: 1px solid #000; */ +} + +.spec-btn { + color: black; + background-color: white; + padding: 10rpx 10rpx; + font-size: 26rpx; + line-height: 28rpx; + float: left; + border: 1rpx solid #dedede; + margin: 4rpx 10rpx 4rpx 0; + border-radius: 4rpx; +} + +.spec-btn-click { + color: white; + background-color: #f23030; + border: 1rpx solid #f23030; +} + +.spec-cart-btns { + /* width: 92%; */ + line-height: 70rpx; + /* margin: 0rpx auto; + margin-top: 160rpx; */ + /* border-radius: 20rpx; */ + /* position: fixed; */ + /* bottom: 50rpx; */ + /* left: 4%; */ + padding: 20rpx; +} + +.spec-cart-btn { + + width: 100%; + font-size: 30rpx; + text-align: center; + color: white; + border-radius: 40rpx; +} + +.spec-cart-btn.w40 { + width: 46%; +} + +.spec-add-cart { + background-color: #ffb03f; +} + +.spec-buy { + background-color: #f23030; + /* margin-left: 34rpx; */ +} + +.spec-cart-disable { + background: #bbbbbb; +} + +.spec-cart-btn-lg { + width: 614rpx; +} + +.prom-model { + position: fixed; + bottom: 0; + z-index: 20; + background: white; + width: 100%; + padding: 0 30rpx 30rpx; + font-size: 32rpx; + box-sizing: border-box; + overflow-x: hidden; +} + +.prom-model .prom-title { + text-align: center; + margin: 30rpx 0; +} + +.prom-model .logistics-item { + border: 0; +} + +.prom-model .item-mes { + width: 500rpx; +} + +.integral-btn { + width: 100%; + padding: 0rpx; + margin: 0rpx; +} + +.clear { + clear: both; +} + +.sto_v .title, +.sto_v .stitle { + border-top: 1rpx solid #dedede; + border-bottom: 1rpx solid #dedede; + height: 78rpx; + line-height: 78rpx; +} + +.sto_v .title .tubiao, +.sto_v .stitle .tubiao { + width: 32rpx; + height: 32rpx; + margin-top: 23rpx; +} + +.itemlists .item { + border-bottom: 1rpx solid #dedede; + height: 72rpx; + line-height: 72rpx; + font-size: 28rpx; + margin: 0 10rpx; +} + +.cshu { + margin-bottom: 30rpx; + margin-top: 20rpx; +} + +.cshu view { + color: #999; + font-size: 30rpx; + margin-left: 26rpx; +} + + +/*---活动特殊显示---*/ +.prom_show { + height: 120rpx; + display: flex; +} + +.prom_show .secondkill-img { + width: 100%; + height: 100%; +} + +.prom_show .spike-img { + width: 283rpx; + height: 57rpx; + top: 35rpx; + left: 31rpx; +} + +.prom_show .stop { + color: #d81731; + top: 17rpx; + right: 65rpx; + font-weight: 600; +} + +.prom_show .start { + color: #009ae2; + top: 17rpx; + right: 65rpx; + font-weight: 600; +} + +.prom_show .timeac { + font-size: 32rpx; + height: 120rpx; + color: #333; +} + +.prom_show .timeac.left { + width: 66%; + color: #fff; + background: #f23030; +} + +.prom_show .timeac.right { + width: 34%; + background-color: #d7d7d7; + text-align: center +} + +.prom_show .secview .day { + padding-right: 10rpx; +} + +.prom_show .secview .time-val { + width: 36rpx; + height: 36rpx; + border-radius: 7rpx; + line-height: 36rpx; +} + +.prom_show .secview .time { + margin-right: 10rpx; + margin-left: 10rpx; +} + + +.prom_show .timeac.left view { + margin-left: 20rpx +} + +.prom_show .timeac.left view.firview { + margin-top: 10rpx +} + +.prom_show .timeac.left view .tr_line { + text-decoration: line-through; + font-size: 28rpx; +} + +.prom_show .timeac.left view .bprice { + font-size: 50rpx; +} + +.prom_show .timeac.right view.firview { + margin-top: 12rpx; + margin-bottom: 10rpx +} + +.prom_show .timeac.right view.secview { + display: flex; + text-align: center; + justify-content: center; + flex-direction: row; +} + +.prom_show .timeac.right view .tui-conutdown-box { + /* background: #6b6b6b; */ + width: auto; + /* min-width: 45rpx; */ + height: 45rpx; + color: #c4182e; + font-size: 27rpx; + text-align: center; + line-height: 46rpx; +} + +.huise { + background: gray +} + +.lanse { + background: #0199e2 +} + + +/*------拼单------*/ +.pt_view { + text-align: center; + width: 100%; + height: 100rpx; + line-height: 100rpx; + font-size: 26rpx +} + +.pt_view .secondkill-img { + width: 100%; + height: 100%; +} + +.pt_fir { + background: #fff; + /* margin-bottom: 10rpx; */ +} + +.pt_fir .pt_fir_title { + display: flex; + align-items: center; + /* margin-left: 10rpx; margin-top: 20rpx; */ + font-size: 28rpx; + position: relative; +} + +.pt_fir .pt_fir_title .kt_type { + color: #fff; + background: #e9030d; + width: 100rpx; + line-height: 40rpx; + border-radius: 6rpx; + margin: 0 10rpx; + height: 40rpx; + font-size: 24rpx; + text-align: center; +} + +.pt_fir .pt_fir_title .price { + color: #e9030d; + font-size: 26rpx; +} + +.pt_fir .pt_fir_title .bigw { + font-size: 36rpx; +} + +.pt_fir .pt_fir_title .tprice { + text-decoration: line-through; + color: #949494 +} + +.pt_fir .pt_fir_title .tprice.ml50 { + margin-left: 50rpx +} + +.pt_fir .pt_fir_title .js { + padding: 0 15rpx; + height: 40rpx; + background: #e9030d; + text-align: center; + border-radius: 8rpx; + color: #fff; + margin-left: 10rpx; +} + +.pt_fir .pt_fir_title .tuannum { + color: #e9030d; + position: absolute; + right: 20rpx; + font-size: 26rpx; +} + +.pding { + padding-top: 20rpx; + padding-left: 20rpx; + height: 81%; + padding-right: 20rpx; + font-size: 26rpx; + color: #ea120f +} + +.pdres { + margin-left: 10rpx; + color: #8f8f94 +} + +.ptgz { + position: relative; + font-size: 30rpx; + padding-left: 20rpx; + margin-top: 10rpx; + overflow: hidden +} + +.shuxian { + width: 6rpx; + height: 28rpx; + background: #ea120f; + display: inline-block; + top: 5rpx; + position: relative; + margin-right: 5rpx +} + +.ptgz_an { + position: absolute; + top: 5rpx; + right: 6rpx +} + +.ptgz_an .arrow-two { + width: 18rpx; + height: 18rpx; + border-color: #da0b31; + margin-top: 30rpx; +} + +.pt_fir.se { + height: auto; + margin-bottom: 10rpx +} + +.t_gz { + padding: 10rpx 20rpx; + font-size: 28rpx +} + +.pt_fir.se1 { + height: auto; + margin: 0 +} + +.pt_fir.se2 { + height: auto; + margin: 0; + /* border-top:6rpx solid #eeeeee;border-bottom:2rpx solid #eeeeee; */ +} + +.pt_hb { + height: 78rpx; + line-height: 75rpx; + position: relative; + font-size: 32rpx; + overflow: hidden; + width: 695rpx; + margin-left: 28rpx; + border-bottom: 1rpx solid #E5E5E5 +} + +.ptgz_an.xq { + font-size: 32rpx; + color: #d40024 +} + +.wf { + display: flex; + padding: 20rpx 0; +} + +.wf .item { + width: 24.5%; + text-align: center; + font-size: 26rpx; + color: #666 +} + +.wf .item .item_txy { + position: relative; + width: 60rpx; + height: 60rpx; + background: #ea120f; + border-radius: 50%; + left: 50%; + margin-left: -30rpx; + border: 3px #dfdfdf solid; + text-align: center; + line-height: 60rpx; + color: #fff; + margin-bottom: 10rpx; +} + +.wf .item .item_txy.hs { + background: #cbcbcb; +} + +.po { + margin-bottom: 20rpx; +} + +.cart-btn.line-h { + line-height: 26rpx; +} + +.cart-btn .fir-v { + margin-top: 10rpx; +} + +.hyt { + padding: 0 20rpx; + font-size: 30rpx; + display: flex; + align-items: center; + margin-top: 10rpx; +} + +.hyt .r_f { + color: #e9120f; + font-size: 26rpx; + position: relative; + top: 3rpx +} + +.hyt .byj { + color: #e9120f; + font-size: 32rpx; + position: relative; + top: 5rpx +} + +.pt_fir .pt_fir_title.no-mar-b { + margin-bottom: 0; + padding-bottom: 10rpx; + margin-left: 20rpx +} + +.pt_fir .pt_fir_title.boder-1 { + border-bottom: 1rpx #e7e7e7 solid +} + +.jie_price { + /* padding: 10rpx 30rpx; */ +} + +.jie_price_title { + font-size: 30rpx; + color: #a26270; + margin-bottom: 10rpx +} + +.price_list { + display: flex; + width: 100%; +} + +.price_item { + width: 25%; + font-size: 28rpx; + color: #4c336c +} + +.pt_fir.se2 .zzk-1 { + /* margin-top: 23rpx; */ + font-size: 30rpx; + position: relative; + /* margin-bottom: 30rpx; */ + border-left: 4rpx solid red; + /* margin-left:14rpx; */ + height: 30rpx; + line-height: 30rpx; + /* padding-left:5rpx; */ +} + +.ckgd { + /* position: absolute;top:0;right:57rpx; */ + color: #d70025; + font-size: 26rpx; +} + +.ckgd .arrow-one { + width: 14rpx; + height: 14rpx; + border-color: #da0b31; + /* margin-top:5rpx; */ + margin: auto; +} + +.bview { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); +} + +.juzhong { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; +} + +.juzhong .xq { + padding: 0 20rpx; + background: #fff; + font-size: 30rpx; + padding-bottom: 20rpx; +} + +.juzhong .xq .title { + text-align: center; + margin: 20rpx 0; + position: relative; + height: 50rpx; +} + +.juzhong .xq .hs1 { + font-size: 28rpx; + color: #ab8f9e +} + +.juzhong .xq .title .close { + position: absolute; + top: 0; + right: 0; + width: 45rpx; + height: 45rpx; +} + +.pt_qd { + /* margin-top: 40rpx; height: auto; */ + padding: 20rpx; +} + +.spec-cart-btn.w100 { + width: 95%; + margin-left: 0; + height: 75rpx; + line-height: 75rpx; + margin: auto; +} + +.sto_v { + color: #333; +} + +.ellipsis { + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + + +/*---多少人参加团--*/ +.group { + padding-top: 20rpx; + padding-bottom: 20rpx; + width: 100%; + /* min-height: 92rpx; */ + border-bottom: 2rpx solid #ebedf0; + +} + +.group .group-list { + display: flex; + align-items: center; + justify-content: space-around; + /* height: 90rpx; */ + /* padding: 0 130rpx 0 100rpx; */ + /* width: 470rpx; + + position: absolute; */ +} + +.group .group-list .gtou { + width: 70rpx; + height: 70rpx; + /* float: left; + position: relative; + top: 6rpx; + left: -96rpx; */ +} + +.group .group-list .gtou image { + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: #f0f0f0; +} + +.group .group-list .gdn { + width: 140rpx; + text-align: center; + /* float: left; */ + font-size: 26rpx; + /* padding-left: 20rpx; */ + /* line-height: 48rpx; + height: 48rpx; + width: 168rpx; + position: relative; + left: -80rpx; + top:20rpx; */ + font-weight: bold; +} + +.group .group-list .ghaicha { + /* width:300rpx; */ + font-size: 27rpx; + /* margin-left:180rpx; + top:13rpx; + left:-3rpx; */ + font-weight: bold; + + +} + +.group .group-list .ghaicha .gred { + /* height: 48rpx; + width: 300rpx; */ +} + +.gsj { + float: left; + color: #8f8f94; +} + +.group .group-list .cjt { + height: 42rpx; + width: 137rpx; + /* position: absolute; + right: 4rpx; + top:25rpx; */ + line-height: 42rpx; + font-size: 24rpx; + color: #fff; + border: 2rpx solid #d60024; + background-color: #d60024; + border-radius: 25rpx; + +} + +.gbody { + background-color: white; +} + +.t_show { + /* overflow: hidden; */ + display: flex; + /* width: 300rpx; */ + color: #292929; + /* line-height: 36rpx; */ + font-size: 26rpx; +} + +.join-cart>view.set_width { + width: 58%; +} + +/*秒杀样式zwp*/ +#zwpMs { + width: 31%; + color: #fff; + background: url(https://mshopimg.yolipai.net/miniapp/images/user/bgred.png) no-repeat; + background-size: 100% 60px; +} + + +/*--------- 修改后的样式 -----------*/ +.elli { + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; +} + +.one_elli { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; +} + +.tuwen_title { + /* height: 86rpx; */ + background-color: #eeeeee; + /* margin-bottom: 32rpx; */ + position: relative; + display: flex; + justify-content: center; + align-items: center; + padding: 20rpx; +} + +.tuwen_title .g_line { + width: 496rpx; + height: 1rpx; + border-bottom: #ababab 1rpx solid; +} + +.tuwen_title .center_s { + width: 124rpx; + position: absolute; + height: 34rpx; + background-color: #eeeeee; + font-size: 32rpx; + display: flex; + overflow: hidden; + justify-content: center; + align-items: center; +} + +.tuwen_title .center_s image { + width: 34rpx; + height: 26rpx; + margin-right: 10rpx +} + +.t_g_info { + /* margin: 0 34rpx;margin-bottom: 20rpx; */ + display: flex; + align-items: center; + padding: 20rpx; +} + +.red_shu { + width: 10rpx; + height: 36rpx; + background-color: #da0035; + margin-right: 8rpx; +} + +.tb-l { + /* line-height: 96rpx; */ +} + +.table_s { + border: #e4e4e4 1rpx solid; + box-sizing: border-box; + font-size: 26rpx; +} + +.tb_item { + display: flex; + /* height: 96rpx; */ + border-bottom: 1rpx solid #e4e4e4 +} + +.item_left { + width: 210rpx; + height: 100%; + box-sizing: border-box; + text-align: center; + padding: 20rpx; + background: #f9f9f9; + border-right: 2rpx solid #e4e4e4 +} + +.item_left text { + /* margin-left: 44rpx; */ +} + +.item_right { + flex: 1; + height: 100%; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; + padding: 20rpx; +} + +.item_right text { + /* margin-left: 66rpx; */ +} + +.table_s .tb-l:last-child { + border-bottom: none; +} + +.bzfu_img { + width: 164rpx; + height: 34rpx; + /* margin-right: 18rpx; margin-left: 12rpx */ +} + +.bz_view { + /* height:100rpx; padding: 0 34rpx 0 13rpx; */ + color: #333; + font-size: 28rpx; + padding: 20rpx 20rpx 20rpx 10rpx; + /* border-bottom: 3rpx solid #eee; */ + /* border-top: 3rpx solid #eee; */ +} + +.bz_view view { + width: 520rpx; + word-break: break-all; + /* max-height: 70rpx; */ + /* overflow: hidden; */ +} + +.bb_view { + display: flex; + align-items: center; + justify-content: space-between; + padding: 20rpx; + color: #333; + font-size: 30rpx; + /* height: 104rpx; line-height: 104rpx; overflow: hidden; padding-right:26rpx */ +} + +.red_bb { + color: #d70026; + /* min-width:158rpx;width: auto; */ +} + +.bg_jj { + width: 14rpx; + height: 14rpx; + border-top: 2rpx solid #d70026; + border-right: 2rpx solid #d70026; + transform: rotateZ(45deg); + display: inline-block; + margin-bottom: 3rpx; +} + +.bg_jj.down { + transform: rotateZ(135deg); +} + +.bg_jj.up { + transform: rotateZ(-45deg); + margin-top: 6rpx; +} + +.bz-content { + padding: 0 0 0 20rpx; +} + + + + +/* 顶部边框 */ +.topframe { + width: 100%; + height: 172rpx; + flex-direction: row; + justify-content: space-between; + border-bottom: 6rpx solid #eeeeee; + overflow: hidden; +} + +/* 评价人边框*/ +.topframe .topframe-top { + display: flex; + margin-top: 40rpx; + margin-bottom: 36rpx; + color: #7d7d7d; + padding-left: 20rpx; + font-size: 32rpx; +} + +/*评价人数量*/ +.topframe .topframe-top .topframe-top-val { + margin-left: 15rpx; + +} + +.topframe-top-content { + display: flex; + width: 36%; +} + +/* 好评 */ +.topframe-praise { + width: 61%; + text-align: right; + color: #dc4355; + font-size: 28rpx; +} + +/* 按钮列表 */ +.buttem-list { + width: 100%; + display: flex; + font-size: 20rpx; + overflow: hidden; +} + +.buttem-list .item { + min-width: 17%; + font-size: 24rpx; + border-radius: 20rpx; + background: #ffe3e2; + height: 38rpx; + text-align: center; + line-height: 38rpx; + margin-left: 20rpx; + justify-content: center; +} + +.buttem-list .item.red { + color: #fff; + background: #d60022; +} + +/* 用户评价 */ +.middle { + width: 95%; + margin: 0 auto; +} + +.middle-img-frame { + height: 65rpx; + display: flex; + margin-top: 32rpx; + +} + +/* 评价的用户图片 */ +.middle-img { + width: 60rpx; + height: 60rpx; + border-radius: 50%; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; + margin-right: 15rpx; +} + +/* 评价的用户边框 */ +.middle-user-frame { + height: 65rpx; + overflow: hidden; +} + +.middle-user { + height: 25; + font-size: 28rpx; +} + +/* 评价图片 */ +.middle-img-two { + width: 115rpx; + height: 25rpx; + text-align: center; + margin-bottom: 20rpx; + margin-left: 5rpx; +} + +.xc-pirces { + margin-top: 14rpx; +} + +/* 评价文字 */ +.middle-font { + font-size: 30rpx; + +} + +.iddle-goods-img { + width: 100%; + display: flex; + margin-top: 22rpx; +} + +/* 商品图片 */ +.goods-img { + width: 156rpx; + height: 156rpx; + margin-left: 22rpx; + height: 100%; +} + +.parameter-frame { + margin-top: 14rxp; + margin-bottom: 14rpx; + width: 50%; + height: 30rpx; +} + +.z_parameter { + width: 98%; + height: 45rpx; + display: flex; + line-height: 45rpx; + margin-top: 20rpx; + margin-bottom: 14rpx; + justify-content: space-between; +} + +.parameter-font { + font-size: 26rpx; + +} + +/* 规格 */ +.parameter-state { + width: 100rpx; + font-size: 24rpx; + color: #c4c4c4; +} + +.parameter-dian { + display: flex; + width: 94rpx; + height: 33rpx; + font-size: 20rpx; + border-radius: 20rpx; + line-height: 33rpx; + padding-left: 25rpx; + border: 4rpx solid #eeeeee; + +} + +/* 点赞图片 */ +.parameter-img { + width: 27rpx; + height: 27rpx; + margin-top: 3rpx; +} + +.parameter-val { + margin-left: 25rpx; + font-size: 26rpx; + color: #999; +} + +/* 回复 */ +.reply { + width: 95%; + height: 120rpx; + padding-top: 14rpx; + border-top: 3rpx solid #eeeeee; + margin: 0 auto; + +} + +.shop-reply { + height: 30rpx; + color: #d60022; + font-size: 24rpx; + overflow: hidden; +} + +.shop-font { + width: 94%; + font-size: 24rpx; + padding-top: 10rpx; + +} + +.line_bulge { + width: 17rpx; + height: 17rpx; + border-top: 1rpx solid #eeeeee; + border-left: 1rpx solid #eeeeee; + transform: rotate(45deg); + position: absolute; + top: -12rpx; + left: 50rpx; + background: #fff; +} + + +.xc_comment { + display: flex; + justify-content: space-around; + width: 100%; + box-sizing: border-box; + padding: 10rpx 20rpx; + /* height: 42rpx; + padding-left: 34rpx; */ + color: #333; + +} + +.xc_comment-have-pictures { + width: 153rpx; + /* height: 42rpx; */ + line-height: 42rpx; + text-align: center; + background: #ffe3e2; + color: 28rpx; + border-radius: 21rpx; + font-size: 24rpx; +} + +.xc_comment-discuss { + width: 152rpx; + height: 42rpx; + line-height: 42rpx; + text-align: center; + background: #ffe3e2; + color: 28rpx; + border-radius: 20rpx; + font-size: 24rpx; + margin-left: 28rpx +} + +.xc_comment-detail { + display: flex; + /* margin-top: 40rpx; */ + /* width: 524rpx; */ + /* margin-left: 34rpx; */ + border-radius: 24rpx; + border: 2rpx solid #ebedf0; + margin-left: 20rpx; + box-sizing: border-box; + /* overflow: hidden; */ +} + +.xc_user-img { + border-radius: 50%; + margin: auto 0; +} + +.xc_comment-user { + display: flex; + /* margin-top: 22rpx; + margin-left: 22rpx; */ +} + +.xc_user { + width: 170rpx; + height: 60rpx; + margin-left: 6rpx; + overflow: hidden; +} + +.xc_user-name { + /* height: 25rpx; */ +} + +.xc_comment-img { + width: 22rpx; + height: 22rpx; + /* margin-top: 14rpx; */ + margin-right: 5rpx +} + +.xc_comment-font { + /* height: 75rpx; */ + /* margin-left: 22rpx; */ + white-space: normal; + overflow: hidden; + /* margin-top: 8rpx; + line-height: 38rpx; */ + +} + +.xc_comment-val { + /* width: 88%; + height: 30rpx; + margin-left: 22rpx; + display: flex; + margin-top: 15rpx; + margin-bottom:15rpx; */ +} + +.xc_comment-time { + /* height: 30rpx; */ + font-size: 22rpx; + color: #a5a5a5; + overflow: hidden; +} + +.xc_goods-img { + width: 180rpx; + height: 180rpx; +} + +.xc_comment-left { + display: inline-block; + width: 312rpx; + padding: 20rpx; +} + +.xc_goods-img-frame { + border-radius: 0 22rpx 22rpx 0; + overflow: hidden; + /* display:inline-block; */ + /* width: 40%; + height: 90%; + text-align: center; + padding-top: 30rpx; + vertical-align: top; */ +} + +.xc_imgs { + width: 50rpx; + height: 50rpx; + border-radius: 50%; + margin-right: 5rpx; +} + +.pj_word_size { + font-size: 28rpx +} + +.pj_scroll { + /* white-space: nowrap; */ + /* height: 324rpx; */ + /* margin-bottom: 50rpx; */ + display: flex; + align-items: center; + padding: 20rpx 0; + /* box-sizing: border-box; */ + /* box-shadow: 0 8px 12px #e7e9eb; */ +} + + +/*领券*/ +.three-level-word { + font-size: 25rpx; +} + +.four-level-word { + font-size: 23rpx; +} + +.cx-frame { + /* border-top:3rpx solid #eee; */ + /* width:99%; + height: 95rpx; + line-height: 95rpx; + padding-left:24rpx; */ + padding: 20rpx; +} + +.cx-frame .cx-sizs { + /* width: 68rpx; */ + /* height: 100%; */ + /* line-height: 100rpx; */ + /* overflow: hidden; */ + /* margin-left: 10rpx; */ +} + +.xc-coupon-fram { + position: relative; + margin-right: 16rpx; + /* width:200rpx; */ + /* padding-top:30rpx; */ + +} + +.xc-coupon-fram .xc-coupon { + /* width:175rpx ; + height: 40rpx; + line-height: 40rpx; */ + background-color: #d60021; + /* margin:0 auto; */ + color: #fff; + padding: 6rpx 20rpx; + +} + +.xc-coupon-fram .xc-circular { + width: 16rpx; + height: 16rpx; + background-color: white; + position: absolute; + top: 50%; + /* left: -10rpx; */ + transform: translateY(-50%); +} + +.xc-coupon-fram .xc-one { + left: -8rpx; +} + +.xc-coupon-fram .xc-two { + right: -8rpx; +} + +.cx-obtain-coupon { + /* width: 65rpx; + height: 100%; + padding-left:15rpx; */ + color: #d70025; + display: flex; + align-items: center; + /* position: absolute; + right: 5rpx; */ +} + +/* 自定义弹出窗口 */ +.cx-popup { + width: 100%; + background: #fff; + z-index: 35; + border-top-left-radius: 25rpx; + border-top-right-radius: 25rpx; + position: fixed; + bottom: 0; +} + +.cx-popup .top { + /* width: 90%; + height:85rpx; */ + font-size: 32rpx; + padding: 20rpx 0; + border-bottom: 2rpx solid #ebedf0; + /* padding-top: 50rpx; + font-weight:600; */ + +} + +.cx-popup .top-frame { + /* width: 100%; + display: flex; + justify-content: center; + overflow: hidden; */ +} + +.xc-valid-coupon { + width: 90%; + height: 40rpx; + padding-top: 24rpx; + overflow: hidden; +} + +.xc-frame { + position: relative; +} + +.xc-coupon-frame { + width: 100%; + max-height: 560rpx; + overflow: auto; + +} + +.xc-coupon-frame .rel:not(:first-child) { + margin-top: 20rpx; +} + +.xc-coupon-frame .coupon { + width: 100%; + height: 168rpx; + border-radius: 25rpx; + border: 2rpx solid #ffdcdc; + overflow: hidden; + /* margin-top:16rpx; */ + box-sizing: border-box; + +} + +/* .xc-coupon-frame .coupon ~ .coupon { + margin-top:16rpx; +} */ +.xc-coupon-left { + width: 216rpx; + /* height: 100%; */ + background-color: #ffeeef; + border-right: 4rpx dashed #ffdbd9; + overflow: hidden; + /* line-height: 100%; */ + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + flex-shrink: 0; +} + +.xc-money { + color: #f30026; + text-align: center; +} + +.xc-rmb { + /* width:44rpx; + padding-top:7rpx; */ +} + +.xc-money-frame { + /* margin-left:35rpx; + margin-top:48rpx; */ + +} + +.xc-spacing { + letter-spacing: 4rpx; +} + +.xc-circular-one { + position: absolute; + top: -15rpx; + left: 205rpx; + width: 30rpx; + height: 30rpx; + background: #fff; + overflow: hidden; +} + +.xc-circular-two { + position: absolute; + bottom: -15rpx; + /* top:150rpx; */ + left: 205rpx; + width: 30rpx; + height: 30rpx; + background: #fff; +} + +.xc-detail-coupon { + /* margin-left: 22rpx; + overflow: hidden; + padding-top: 43rpx; */ + /* display: flex; + align-items: center; */ +} + +.xc-coupon-right { + /* width: 455rpx; + height: 100%; */ + background: #fffaf9; + padding: 20rpx; + box-sizing: border-box; + width: 100%; + justify-content: space-between; + align-items: center; +} + +.xc-below { + margin-top: 20rpx; + +} + +.xc-get { + + width: 140rpx; + /* height: 48rpx; */ + color: #fff; + text-align: center; + border-radius: 27rpx; + line-height: 54rpx; + /* margin-left:20rpx; */ +} + +.background { + background: #f40028; +} + +/*--不可使用--*/ +.background.nouse { + background: gainsboro; +} + +.xc-background { + background: #b9b9b9; +} + + +.cx-confirm { + width: 100%; + padding: 20rpx; + box-sizing: border-box; + /* height: 160rpx; */ + +} + +.cx-confirm .confirm { + /* width: 372rpx; + height: 60rpx; */ + background-color: #f40026; + color: #fff; + border-radius: 10rpx; + line-height: 80rpx; + font-size: 28rpx; + +} + +.up { + animation: up .7s; +} + +.down { + animation: down 1s; +} + +@keyframes up { + 0% { + transform: translateY(550rpx); + } + + 100% { + transform: translateY(0); + } +} + +@keyframes down { + 0% { + transform: translateY(0); + } + + 100% { + transform: translateY(550rpx); + } +} + + +/* 分享 */ +.icon-share { + font-size: 42rpx; + color: #d60021; + line-height: 1; +} + +.xc-share-frame { + /* width: 129rpx; + height: 48rpx; + border-top-left-radius: 18rpx; + border-bottom-left-radius: 18rpx; */ + /* background: #d60021; */ + /* position:absolute; + left:622rpx; + top:-37rpx; + line-height:50rpx; + margin-top:52rpx; */ +} + +.xc-share-frame-jieti { + width: 129rpx; + height: 48rpx; + border-top-left-radius: 18rpx; + border-bottom-left-radius: 18rpx; + background: #d60021; + line-height: 50rpx; +} + +.xc-share-frame .share-font, +.xc-share-frame-jieti .share-font { + font-size: 32rpx; + color: #fff; + margin-left: 10rpx; + +} + + +.xc-share-frame .share-frame, +.xc-share-frame-jieti .share-frame { + width: 30rpx; + height: 30rpx; + margin-top: 9rpx; + margin-left: 10rpx; + +} + +.xc-share { + width: 90%; + height: 800rpx; + background: #fff; + z-index: 35; +} + +.img-frame { + position: absolute; + top: 175rpx; + left: 100rpx; + z-index: 55; + overflow: hidden; + +} + +.img-frame .img { + width: 100rpx; + height: 100rpx; + +} + +.xc-share .top { + height: 85rpx; + width: 100%; + border-bottom: 4rpx dashed #f5f5f5; + overflow: hidden; + +} + +.xc-share .name { + font-size: 25rpx; + margin-left: 180rpx; + color: #000; + +} + +.xc-share .recommend { + width: 110rpx; + height: 12rpx; + color: #fff; + background: #d60021; + font-size: 20rpx; + border-radius: 25rpx; + margin-left: 10rpx; + line-height: 37rpx; +} + +.xc-left-circle { + width: 40rpx; + height: 25rpx; + position: absolute; + top: 280rpx; + left: 29rpx; + z-index: 55; + background: #727272; + border-radius: 50rpx 50rpx 0 0; + transform: rotate(90deg); + +} + +.xc-right-circle { + width: 40rpx; + height: 25rpx; + position: absolute; + top: 280rpx; + left: 683rpx; + z-index: 55; + background: #727272; + border-radius: 50rpx 50rpx 0 0; + transform: rotate(270deg); + +} + +.xc-circle-frame { + width: 25rpx; + height: 40rpx; + overflow: hidden; +} + +.xc-goods-name { + width: 95%; + font-size: 35rpx; + padding-left: 75rpx; + height: 50rpx; + padding-top: 10rpx; + color: #000; + +} + +.xc-good-img { + width: 100%; + height: 381rpx; + margin-top: 5rpx; + +} + +.xc-good-img .img { + width: 90%; + height: 381rpx; +} + +.xc-ensure-frame { + width: 90%; + height: 60rpx; + border-bottom: 2rpx solid #d8d6d7; +} + +.xc-ensure { + width: 30%; + height: 60rpx; + line-height: 60rpx; +} + +xc-ensure-div { + width: 100%; + height: 60rpx; +} + +.xc-ensure .word { + font-size: 25rpx; + color: #d30025; + margin-left: 9rpx; + +} + +.xc-ensure .img { + width: 25rpx; + height: 25rpx; + margin-top: 18rpx; + +} + +.xc-bottmon { + width: 100%; +} + +.xc-bottmon .xc-left { + width: 55%; + margin-top: 30rpx; + padding-left: 20rpx; + +} + +.xc-left .xc-top { + font-size: 25rpx; + height: 40rpx; + line-height: 40rpx; + color: #000; +} + +.xc-left .xc-middle { + font-size: 25rpx; + color: #b2b2b2; + height: 30rpx; + line-height: 30rpx; +} + +.xc-left .xc-buttem { + font-size: 25rpx; + height: 100rpx; + line-height: 100rpx; + color: #000; +} + +.xc-ensure-right { + width: 30%; +} + +.xc-qrcode { + width: 120rpx; + height: 120rpx; + margin-top: 43rpx; + margin-left: 80rpx; + +} + +.xc-close { + width: 50rpx; + height: 50rpx; + border-radius: 50%; + border: 3rpx solid #fff; + text-align: center; + line-height: 41rpx; + font-size: 50rpx; + color: #fff; + font-weight: lighter; + font-family: MingLiU; + transform: rotate(270deg); + overflow: auto; + margin-top: 6rpx; + margin-bottom: 1rpx; + +} + +.xc-close-frame { + position: absolute; + margin-top: 30rpx; + width: 90%; + display: flex; + justify-content: center; + overflow: auto; + +} + +.xc-guanbi { + width: 100%; + height: 80rpx; + overflow: hidden; +} + + +/* 自定义弹出窗口 */ +.cx-popup { + width: 100%; + background: #fff; + z-index: 35; + border-top-left-radius: 10rpx; + border-top-right-radius: 10rpx; + position: fixed; + bottom: 0; +} + +.xc-top-content { + width: 88%; + height: 85rpx; + padding-top: 50rpx; + font-size: 36rpx; +} + + +.xc-valid-coupon { + width: 90%; + height: 40rpx; + padding-top: 24rpx; + overflow: hidden; +} + +.xc-frame { + /* width: 100%; + margin-top:20rpx; */ + padding: 20rpx; +} + +.xc-frame .list-frame { + width: 90%; + height: 100%; + overflow-y: scroll; + + margin-top: 20rpx; + +} + +.xc-close-frame { + margin-top: 30rpx; + width: 15%; + display: flex; +} + +.xc-close { + width: 70rpx; + height: 70rpx; + border-radius: 50%; + border: 5rpx solid #a5a5a7; + text-align: center; + line-height: 55rpx; + font-size: 80rpx; + color: #a5a5a7; + font-family: "微软正黑体"; + margin-top: 8rpx; + +} + +.xc-money { + color: #ff0013; +} + +.xc-money-frame { + /* margin-left:35rpx; */ + +} + +.xc-coupon-effect { + width: 99%; + height: 128rpx; + border-bottom: 3rpx solid #ddd; + + +} + +.xc-goods-coupon { + width: 80%; + height: 100%; + +} + +.xc-title { + width: 50%; + margin-left: 222rpx; + +} + +.xc-coupon-money { + color: #c91e31; + font-size: 35rpx; + margin-top: 20rpx; + +} + +.xc-coupon-time { + height: 50rpx; + font-size: 27rpx; + color: #a4a4a4; +} + +.xc-coupon-time .time { + margin-left: 15rpx; + font-size: 27rpx; +} + +.xc-coupon-selection { + width: 99%; + height: 100%; + + +} + +.xc-confirm { + width: 90%; + height: 75rpx; + margin: 0 auto; + background: #c41830; + color: #fff; + border-radius: 10rpx; + font-size: 30rpx; + margin-top: 50rpx; +} + +.xc-not-Selection { + width: 60rpx; + height: 60rpx; + background: #eeeeee; +} + +/*---------------视频图片---------------*/ +.xc-imageCount { + width: 95rpx; + height: 50rpx; + background-color: rgba(0, 0, 0, 0.3); + border-radius: 40rpx; + line-height: 50rpx; + color: #fff; + text-align: center; + font-size: 26rpx; + position: absolute; + + right: 23rpx; + bottom: 21rpx; +} + + +/* 视频图片的边框 */ +.xc-videos-picture { + width: 100%; + height: 750rpx; +} + +/* 视频 */ +.xc-videos { + width: 100%; + height: 544rpx; + + +} + +/* 点击视频或图片 */ +.xc-video-picture { + + bottom: 20rpx; + left: 0rpx; + display: flex; + align-items: center; + justify-content: center; + width: 45%; + height: 60rpx; + margin-left: 215rpx; + +} + +.xc-video-button:before { + content: ""; + position: absolute; + left: 48%; + top: 40%; + width: 0; + height: 0; + margin-left: -36rpx; + margin-top: -10rpx; + border-width: 13rpx; + border-style: dashed; + border-color: transparent transparent transparent #fff; + font-size: 0; + line-height: 0; + z-index: 2; + -webkit-backface-visibility: hidden; +} + +.xc-video-buttons:before { + content: ""; + position: absolute; + left: 50%; + top: 41%; + width: 0; + height: 0; + margin-left: -36rpx; + margin-top: -10rpx; + border-width: 13rpx; + border-style: dashed; + border-color: transparent transparent transparent #000; + font-size: 0; + line-height: 0; + z-index: 2; + -webkit-backface-visibility: hidden; +} + +.xc-video { + /* width:100rpx; */ + /* height: 50rpx; + line-height: 50rpx; */ + text-align: center; + /* margin-left:-30rpx; */ + + +} + +/* 图片 */ +.xc-picture { + color: #000; + background: #dcdcdc; + width: 94rpx; + height: 45rpx; + font-size: 25rpx; + border-radius: 25rpx; + font-family: 'SimHei', Arial; + text-align: center; + line-height: 45rpx; + margin-left: 53rpx +} + +/* 点击视频 */ +.xc-video-button { + position: relative; + color: #000; + background: #dcdcdc; + width: 85rpx; + height: 45rpx; + line-height: 45rpx; + font-size: 30rpx; + border-radius: 25rpx; + font-family: 'SimHei', Arial; + padding-left: 11rpx; +} + + +.xc-sn { + color: #fff; + background: #c7161e; + border-color: transparent transparent transparent #fff; +} + +/* 图片 */ +.xc-pictures { + width: 100%; + height: 529rpx; + +} + +/*视频封面的图片 */ +.xc-picturess { + position: relative; + width: 100%; + height: 529rpx; +} + +/* 播放 */ +.xc-play { + width: 130rpx; + height: 130rpx; + position: absolute; + top: 207rpx; + left: 309rpx; +} + +.xc-video-buttons { + position: relative; + color: #000; + background: #dcdcdc; + width: 85rpx; + height: 45rpx; + line-height: 45rpx; + font-size: 30rpx; + border-radius: 25rpx; + font-family: 'SimHei', Arial; + padding-left: 11rpx; +} + + +.wsize { + font-size: 32rpx +} + +.five-level-word { + font-size: 24rpx; +} + + +/*-- 推荐商品 --*/ +.xc-goods { + height: auto; + background: #f2f2f2; + padding: 0 20rpx; + margin-top: -25rpx; + padding-bottom: 20rpx +} + +.xc-goods-recommend { + border-radius: 20rpx; + width: 345rpx; + height: 450rpx; + margin-top: 25rpx; + display: inline-block; + +} + +.xc-goods-recommend.ml { + margin-left: 22rpx +} + +.xc-goods-recommend .xc-goods-imgs { + width: 100%; + height: 325rpx; + border-radius: 20rpx 20rpx 0 0; +} + +.xc-goods-bottom { + width: 345rpx; + height: 134rpx; + background: #fff; + border-radius: 0 0 20rpx 20rpx; + bottom: -8rpx; + left: 0rpx; +} + +.xc-goods-bottom .monry-frame { + width: 283rpx; + height: 52rpx; + padding-left: 24rpx; + +} + +.xc-good-explain { + width: 283rpx; + height: 60rpx; + word-break: normal; + margin-left: 30rpx; + font-size: 26rpx; + line-height: 30rpx; + margin-top: 5rpx; +} + +.money-color-val { + color: #c6172f; +} + +.rmb-symbol { + line-height: 81rpx; + height: 53rpx; + font-size: 28rpx; +} + +.xc-original-price { + color: #c0c0c0; +} + +/* 文字中间加线条 */ +.word-lines { + text-decoration: line-through; + line-height: 90rpx; + margin-left: 10rpx; + font-size: 20rpx; +} + +.xc-linellae-frame { + width: 100%; + height: 70rpx; + background: #f2f2f2; +} + +.xc-linellae-frame .xc-linellae { + width: 386rpx; + height: 1rpx; + border-bottom: 1rpx solid #ebedf0; +} + +.xc-recommend-frame { + background: #f2f2f2; + width: 97rpx; + height: 100%; + padding-left: 10rpx; +} + +.xc-recommend-frame .xc-recommend { + width: 35rpx; + height: 27rpx; +} + +.xc-recommend-frame .xc-recommend-word { + width: 58rpx; + font-size: 24rpx; + color: #a9a9a9; + margin-left: 5rpx; + margin-bottom: 5rpx; + margin-top: 1rpx; + +} + +.xc-price-frame { + color: #ec0022; + align-items: baseline; + /* height:44rpx; */ +} + +.xc-price-frame .sign { + margin-top: 19rpx; + margin-left: -4px; +} + +.xc-val-price { + margin-left: 24rpx; + color: #ec0022; + padding-top: 13rpx; +} + +.xc-val-price .save { + border-radius: 10rpx; + margin-top: 5rpx; + background: #fed2d9; + min-width: 230rpx; + height: 40rpx; + line-height: 40rpx; + width: auto; + padding-left: 12rpx; + padding-right: 12rpx; + +} + +.xc-unit-price { + margin-top: 25rpx; + padding-left: -4rpx; + +} + +.xc-explain { + color: #292929; + width: 542rpx; + margin: 10rpx 0 20rpx; + width: 100%; + font-weight: bold; +} + +.xc-item { + width: 16%; + font-size: 26rpx; + color: #666; + margin-right: 5rpx; +} + +.xc-item .yuan { + width: 38rpx; + height: 38rpx; + line-height: 38rpx; + border: 1rpx solid #f3f1f2; + margin-left: 33rpx; + +} + +.xc-item .word { + width: 104rpx; + margin-top: 16rpx; + color: #363636; + font-weight: 600; + +} + +.xc-item .circle-color { + background: #d60024; + color: #fff; +} + +.xc-item .circle-color1 { + background: #fefefe; + color: #666666; +} + +.link { + height: 6rpx; + width: 180rpx; + top: 54rpx; + left: 32px; +} + +.link1 { + height: 6rpx; + width: 166rpx; + top: 54rpx; + left: 264rpx; +} + +.link2 { + height: 6rpx; + width: 157rpx; + top: 54rpx; + right: 87rpx; +} + +.link-color-red { + background: #d60024; +} + +.link-color { + background: #e5e5e5; +} + +.xc-qt-price { + top: -15rpx; + left: 25rpx; + color: #fff; +} + +.xc-qt-price .xc-qtunit-price { + /*margin-left: 6rpx;*/ + /*margin-top: -4rpx;*/ +} + +.xc-nanber { + top: -25rpx; + left: 289rpx; + +} + +.xc-qtsign { + margin-top: 5rpx; + +} + +.xc-people-img { + height: 36rpx; + width: 36rpx; + background: #fff; + border-radius: 7rpx; + +} + +.xc-people-img .imgs { + width: 28rpx; + height: 28rpx; + margin-top: 4rpx; + +} + +.xc-people-val { + + height: 32rpx; + border-top: 1rpx solid #fff; + border-bottom: 1rpx solid #fff; + border-right: 1rpx solid #fff; + border-radius: 0 7rpx 7rpx 0; + line-height: 32rpx; + margin-left: -6rpx; + padding: 0 12rpx; +} + +.word-color { + color: #d70024; +} + +.word-color-lan { + color: #0393e1; +} + +.pt_view .hy-stop { + top: -23rpx; + right: 56rpx; +} + +.xc-time-val { + width: 36rpx; + height: 36rpx; + border-radius: 7rpx; + line-height: 36rpx; +} + +.xc-time { + margin-right: 10rpx; + margin-left: 10rpx; + margin-top: -32rpx; +} + +.xc-goods-explain { + width: 100%; + /* padding-left:30rpx; + margin-left:-9rpx; + height: 150rpx */ +} + +.xc-partner-frame { + border-bottom: 2rpx solid #eee; + width: 100%; + padding: 20rpx; + /* height:56rpx; */ + box-sizing: border-box; +} + +.xc-person-number { + width: 120rpx; + color: #999999; + padding-left: 8rpx; + text-align: left +} + +.xc-miaosha-time { + right: 17rpx; + top: 55rpx; +} + +.pd_top1 { + padding-top: 10rpx +} + +.s_ms_bth { + margin-top: 85rpx +} + + +.no_pj_list { + text-align: center; + width: 100%; + color: #999; + margin: 30rpx 0; + display: inline-block; + font-size: 28rpx +} + +/* 门店地址 */ +.xc-address_frame { + /* border-top:1rpx solid #eee; */ + width: 100%; + height: auto; + padding: 20rpx; + box-sizing: border-box; +} + +.on_height { + height: 90rpx; +} + +.sn_height { + /* min-height: 170rpx; height: auto;padding: 10rpx 0; */ +} + +.xc-address_frame .address_frame { + width: 100%; + /* padding-left: 10rpx; +margin: auto; */ + +} + +.shop_name {} + +.stores-img { + width: 28rpx; + height: 28rpx; + margin-right: 10rpx; +} + +.shop_name { + margin-right: 10rpx; +} +.shop_name.max{ + max-width:370rpx; flex-shrink: 0; +} + + +.address { + /* width: 100%; + margin-top: 5rpx; + margin-bottom: 5rpx; */ +} + +.distance { + padding-left: 20rpx; + padding-right: 20rpx; + background: #eee; + border-radius: 20rpx; + /* margin-right: 5rpx; */ + color: #999; + height: 38rpx; + line-height: 38rpx; + position: relative; + top: 5rpx; + +} + +/* 选择门店的弹窗 */ +.mongolia-layer { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + z-index: 22; + background: rgba(0, 0, 0, 0.4); + width: 100%; + height: 91.9%; + +} + +.popup-frame { + position: fixed; + z-index: 30000000000000; + background: white; + width: 100%; + border-radius: 20rpx 20rpx 0 0; + height: auto; + bottom: 0; +} + +.popup-top { + border-bottom: 1rpx solid #eee; + height: 155rpx; + width: 95%; + margin: auto; + line-height: 155rpx; + +} + +.bg_rights { + border-top: 2rpx solid; + border-right: 2rpx solid; + transform: rotate(45deg); + display: inline-block; + width: 15rpx; + height: 15rpx; + border-color: #da0b31; +} + +.modal-closes { + position: absolute; + right: 30rpx; + top: -15rpx; + height: 25rpx; + +} + +.choose_more { + margin-top: 40rpx; + margin-right: 20rpx; + +} + +.choose_mores { + margin-top: 30rpx; + margin-right: 15rpx; + +} + +.store-list { + width: 95%; + min-height: 700rpx; + overflow-y: scroll; + margin: auto; + max-height: 700rpx; +} + +.store-list .store_choose { + width: 100%; + height: 120rpx; + line-height: 125rpx; + border-bottom: 1rpx solid #eee; + padding: 10rpx 0; +} + +.store-list .store_choose .store { + width: 100%; + margin: auto; + line-height: 37rpx; + padding-left: 20rpx; + +} + +.xc-hook { + width: 35rpx; + height: 35rpx; + transform: rotate(-145deg); + line-height: 37rpx; + text-align: center; +} + +.xc-hooks { + width: 30rpx; + height: 30rpx; + border: 1rpx solid #999; +} + +.address-frame { + width: 93%; + margin-left: 7rpx; + +} + +.nearby_store { + margin-left: 17rpx; +} + +.address_name { + margin-right: 10rpx; + width: 360rpx; + +} + +.address-val { + height: 38rpx; + line-height: 38rpx; + +} + +.store-bottom { + width: 85%; + margin: auto; + height: 90rpx; +} + +.determine { + width: 260rpx; + height: 55rpx; + border-radius: 50rpx; + line-height: 55rpx; +} + +.default { + width: 260rpx; + height: 55rpx; + border: 3rpx solid #c8c8c8; + border-radius: 50rpx; + line-height: 55rpx; +} + +.store-bottom-frame { + width: 95%; + margin: auto; + +} + +/* 门店分类列表 */ +.sort_store_list { + max-height: 700rpx; + min-height: 700rpx; + overflow: hidden; + overflow-y: scroll; + width: 95%; + margin: auto; +} + +.sort_store_list .sort-store-frame { + width: 100%; + height: 100rpx; + line-height: 100rpx; + border-bottom: 1rpx solid #eee; + +} + +.sort_store_list .sort-store-frame .sort-store { + width: 94.5%; + margin: auto; +} + +.black_rights-frame { + width: 50%; +} + +.black_rights-frame .black_rights { + border-top: 3rpx solid; + border-right: 3rpx solid; + transform: rotate(45deg); + display: inline-block; + width: 20rpx; + height: 20rpx; +} + +.xc-val-money { + height: 55rpx; +} + +.xc-distance-bottom { + margin-bottom: 40rpx; +} + +.xc-distance-top { + margin-top: 10rpx; +} + +.xc-width { + width: 100%; +} + +.right-arrow { + width: 15rpx; + height: 15rpx; + border-top: 2rpx solid #d70026; + border-right: 2rpx solid #d70026; + transform: rotate(45deg); + display: inline-block; + margin-bottom: 3rpx; +} + +.xc-goods-attribute { + border-bottom: 1px solid #eee; + padding-bottom: 20rpx; + /* margin-bottom:40rpx; */ +} + +.xc-val-fream { + width: 105rpx; +} + +.is_stock { + width: 58%; + height: 70rpx; + border-radius: 55rpx; +} + +.select_store_height { + height: 50rpx; +} + +.butttem5 { + margin-bottom: 5rpx; +} + +.no_pj_list { + text-align: center; + width: 100%; + color: #999; + margin-top: 30rpx; + display: inline-block; + font-size: 28rpx +} + + +.join-cart>view.no_store { + width: 58%; + background-color: #adadad; +} + +.s_btn { + margin-top: 25rpx; +} + +/* 美妆价的样式 */ +.beauty-makeup-frame { + /* width: 101.5%; + margin: auto; */ + height: 120rpx; + border-radius: 15rpx; + margin-top: 10px; + +} + +.beauty-makeup-frame .left { + width: 80%; + height: 100%; + background: #f7f7f7; + border-radius: 20rpx 0rpx 0rpx 20rpx; + /* padding: 0 10rpx; */ +} + +.card-frame { + margin-top: 0rpx; + /* padding-right: 23rpx; + margin-right: 15rpx; */ +} + +.advert-card { + margin-top: 0rpx !important; + +} + +.beauty-makeup-frame .right { + width: 20%; + height: 100%; + background: #f3efe3; + border-radius: 0rpx 20rpx 20rpx 0rpx; +} + +.grade-card-frame { + + /* height:45rpx ; */ + background: #3c300a; + border-radius: 20rpx; + /* margin-top: 10px; + margin-left: 7rpx; */ + justify-content: center; + padding: 4rpx 12rpx; +} + +.grade-card-frame .img { + width: 24rpx; + height: 24rpx; + margin-top: 2px; + +} + +.grade-card-frame .card-name { + margin-left: 8rpx; + /* max-width: 120rpx; */ + max-width: 165rpx; +} + +.card-effect { + /* margin-left: 15rpx; */ +} + +.at_once_carde { + width: 65rpx; + height: 75rpx; + line-height: 38rpx; +} + +.bg_right { + width: 18rpx; + height: 18rpx; + border-top: 2rpx solid #333; + border-right: 2rpx solid #333; + transform: rotate(45deg); + display: inline-block; + margin-bottom: 3rpx; + +} + +.carde_frame { + height: 50rpx; + /* line-height: 18rpx */ +} + +button.custom-service { + line-height: normal; + border: 0; +} + +button.custom-service::after { + border: 0; +} + +.no_store,.c-red22 { + color: #d60021; + font-size: 26rpx; +} + + +.cx_show_view { + width: 580rpx; + /* line-height: 30rpx; margin-bottom: 6rpx; */ +} + +.cx_show_view .word { + width: 400rpx +} + +.prom_condition { + color: #f23030; + /* width: 180rpx; */ + /* height: 30rpx; */ + /* font-size: 20rpx; */ + /* padding-top: 0.01rpx; */ + /* display: flex; + justify-content: center; + align-items: center; */ + border: 2rpx solid #f23030; + border-radius: 6rpx; + /* margin-right: 10rpx; */ + /* margin-left: 10rpx; */ + font-size: 24rpx; + padding-right: 6rpx; + /* padding: 0 10rpx; */ +} + +.hui_img { + width: 44rpx; + height: 44rpx; + margin-right: 8rpx +} + +.order_hui { + color: #444; + width: 420rpx +} + +.order_hui view { + height: 34rpx; + line-height: 34rpx; +} + +.dp_img { + width: 240rpx; + height: 240rpx; + margin: 0 40rpx +} + +.dp_cx_view { + border-bottom: 0.02rpx solid #eee; + padding-bottom: 40rpx +} + +.act_content { + margin-top: 40rpx +} + +.act_content view { + margin-bottom: 12rpx +} + +.color_b { + color: #ff9c00 +} + +.poster-container { + box-sizing: border-box; + position: fixed; + width: 610rpx; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + /* width: calc(100% - 210rpx); */ + z-index: 1000; +} + +.mask { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 999; + background-color: rgba(0, 0, 0, .6); +} + +.poster-wrapper { + width: 100%; +} + +.poster { + box-sizing: border-box; + width: 100%; + height: 980rpx; + border-radius: 16rpx; + /* box-shadow: 0 8px 12px #666; */ + position: relative; + z-index: 999; + overflow: hidden; +} + +.poster-img { + display: block; + width: 100%; + height: 100%; +} + +.btn-container { + display: flex; + justify-content: space-around; +} + +.btn-share { + display: block; + background-color: #FE6867; + color: white; + border-radius: 8rpx; + line-height: 80rpx; + margin-top: 28rpx; + padding: 0 60rpx; +} + +/* .btn-close { + background-color: rgba(0,0,0,.5); + color: white; + width: 40rpx; + height: 40rpx; + line-height: 40rpx; + text-align: center; + border-radius: 50%; + position: absolute; + right: 20rpx; + top: 10rpx; +} */ + +.goods-price .rel_txt { + /* position: relative; top: 32rpx; */ + font-size: 30rpx; +} + +.goods-price .rel_img { + width: 62rpx; + height: 62rpx; + position: relative; + top: 8rpx; +} + +.btn-close { + /* background-color: rgba(0,0,0,.5); */ + color: #ccc; + /* width: 50rpx; + height: 50rpx; + line-height: 50rpx; + text-align: center; */ + border-radius: 50%; + position: absolute; + right: 20rpx; + top: 20rpx; +} + +.icon-close { + font-size: 36rpx; +} + +.quan_price { + background-color: #ff4700; + color: #fff; + padding: 10rpx 25rpx; + margin-left: 10rpx; + border-radius: 30rpx; +} + +/*--闪白屏--*/ +.g_img_box { + background-position: center center; + background-repeat: no-repeat; + -webkit-background-size: cover; + -moz-background-size: cover; + background-size: cover; +} + + + +.arrow { + width: auto !important; + position: absolute; + right: 0; + top: 50%; + transform: translateY(-50%); +} + + +.logo-container { + -webkit-filter: brightness(80%); + filter: brightness(80%); +} + +.logo { + width: 132rpx; + height: 37rpx; + margin-right: 10rpx; +} + +.miao_lab { + width: 36rpx; + height: 36rpx; + border: 4rpx solid #e71f19; + color: #e71f19; + text-align: center; + margin-right: 10rpx; + line-height: 36rpx; + font-size: 22rpx; + font-weight: bolder; + border-radius: 50%; +} + +.pop_more_act .content { + position: fixed; + background: #fff; + width: 100%; + left: 0; + bottom: 0; + z-index: 1000; +} + +.p_btn { + background-color: #f23030; + height: 70rpx; + line-height: 70rpx; + color: #fff; +} + +.mt20 { + margin-top: 20rpx +} + +.group .group-list.luck { + padding: 0 20rpx; + justify-content: flex-start; +} + +.group-list.luck .gtou~.gtou { + margin-left: -16rpx; +} + +.gtou.more { + background-color: #ddd; + text-align: center; + line-height: 70rpx; + border-radius: 50%; + color: #aaa; +} + + +.tick { + position: relative; +} + +.tick:before { + content: ''; + display: inline-block; + vertical-align: middle; + margin-top: -4rpx; + margin-right: 12rpx; + width: 22rpx; + height: 22rpx; + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAMAAADzapwJAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABCUExURUdwTPInDPInDPgoDfMnDPYqEvInDPInDPInDP87NPUoDv8vEvMoDPInDPIoDPMnDvInDPInDPInDPIoDPQoDfInDEON4KMAAAAVdFJOUwD45yawG4zz3gQ0DmLOfECQZpPlS54kMQ4AAAC0SURBVBjTbZFREoMgDERDS0xQQNHu/a/alEGtaIYfHrBhs0S1pujVifo40VkhC+BUHSDzQTlBhjHY8bjogXmDZ+orJKwXwMUeUoa/0PeGbH8Q4Y5CJopYOjosiOQxdpRGk1UXOkrBKdkimtN8UrKrJBVXdzsllSYSjR/0J9JaGn81WluWtonYKQ0op51P3M2L2bmZN9n8MKoVqTph/RsseyjfYxAkfgot/82CpuJVLOLSIv4Cd5AJ37BgpFwAAAAASUVORK5CYII=) no-repeat; + background-size: 22rpx auto; +} + +.details::after { + content: ''; + position: absolute; + right: 0; + top: 0; + bottom: 0; + margin: auto; + display: inline-block; + width: 40rpx; + height: 40rpx; + background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoBAMAAAB+0KVeAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAVUExURUdwTIyMjCYmJiYmJi0tLY+PjyYmJidnOsIAAAAGdFJOUwDt6aYcSSEXj/YAAAA8SURBVCjPY2AYBTQBLEbKDhiCTmlpKggeq2AAiDJLS0tGcBkFBUActbS0JAY4F6sgVu1YLcLnpFFAFQAATwgLKVhjC9UAAAAASUVORK5CYII=); + background-repeat: no-repeat; + background-size: 40rpx auto; +} + +.lh2 { + line-height: 2; +} + +.fill-box { + background-color: #f23030; + color: white; + padding: 0 6rpx; + border-radius: 0 0 10rpx 0; + margin-right: 4rpx; +} + +.jie_show{ display: inline-block; width: 40rpx; height: 40rpx; background-color:#ff0505;border-radius:50%;color: #fff;text-align: center; margin: 0 20rpx } + +.jie_show{ display: inline-block; width: 40rpx; height: 40rpx; background-color:#ff0505;border-radius:50%;color: #fff;text-align: center; margin: 0 20rpx } +/* 历史购买 */ +.swiper-container { + position: absolute; + top: 0; + left: 0; + padding: 20rpx 10rpx; + width: 100%; + box-sizing: border-box; + z-index: 98; +} + +.swiper { + height: 60rpx; + color: white; + font-size: 26rpx; +} + +.swiper-item { + /* width: auto !important; + background-color: rgba(0,0,0,.4); + border-radius: 60rpx; */ + position: relative; +} + +.swiper-item .item { + position: absolute; +} + +.item { + /* position: absolute; */ + display: flex; + align-items: center; + /* justify-content: center; */ + border-radius: 60rpx; + background-color: rgba(0,0,0,.4); + /* position: absolute; */ +} + +.avatar-container { + width: 60rpx; + height: 60rpx; + border-radius: 50%; + overflow: hidden; + flex-shrink: 0; +} +.avatar-container image { + width: 100%; + height: 100%; +} + +.hideArea { + position: absolute; + left: -1000px; + top: -1000px; +} + +.searchbar { + height: 95rpx; + border-bottom: 2rpx solid rgb(238, 238, 238); +} +.storeListpadd { + padding: 0rpx 31rpx; +} +.search { + width: 125rpx; + height: 45rpx; + line-height: 45rpx; + background-color: rgb(219, 27, 52); + border-radius: 30rpx; + color: rgb(255, 255, 255); +} +.inputstore { + width: 510rpx; + height: 43rpx; + line-height: 43rpx; + border-radius: 30rpx; + border: 2rpx solid rgb(238, 238, 238); + padding-left: 30rpx; +} + +.modal-close { + position: absolute; + right: 25rpx; + top:16rpx; +} +.ai_end{ + align-items: flex-end; +} +/* 中间等距两边贴边 */ +.flex-space-between{ + display: flex; + justify-content:space-between; +} +.fs30{ + font-size:30rpx; +} +.fs28{ + font-size: 28rpx; +} +.red-co{ + color: #d60021; + +} +.flex{ + display: flex; + align-items: center; +} +.fs28{ + font-size: 28rpx; +} +/* 水平垂直 */ +.flex-center{ + display:flex; + justify-content:center; + align-items:center; + } + /* 垂直居中 */ +.flex-vertical{ + display:flex; + align-items:center; + } + .fs20{ + font-size: 20rpx; +} +.red-b{ + background: #d60021; +} +.white{ + color: #fff; +} +/* 圆 */ +.circle{ + border-radius: 50%; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; +} +.xc-ash{ + color: #b9b9b9; + } + /* 垂直居中 中间等距两边贴边 7.13*/ +.flex-vertical-between{ + display:flex; + align-items:center; + justify-content:space-between; + } + .xc-ash-9f{ + color: #9fa1a0; + +} +.fs24{ + font-size: 24rpx !important; +} +.t-c { + text-align: center; +} +.xc-black3{ + color: #333; +} +/* 圆 */ +.circle{ + border-radius: 50%; + -moz-border-radius: 50%; + -webkit-border-radius: 50%; +} +.yellow{ + background-color: #ffb03f; +} \ No newline at end of file diff --git a/components/diy_floatingWindow/diy_floatingWindow.js b/components/diy_floatingWindow/diy_floatingWindow.js new file mode 100644 index 0000000..cef6ad0 --- /dev/null +++ b/components/diy_floatingWindow/diy_floatingWindow.js @@ -0,0 +1,39 @@ +Component({ + properties: { + // 这里定义了innerText属性,属性值可以在组件使用时指定 + object:{ + type: Object, + value:null + }, + + }, + data: { + // 这里是一些组件内部数据 + someData: {} + }, + methods: { + //--智能跳转-- + go_url:function (e) { + var url=e.currentTarget.dataset.url; + getApp().goto(url); + }, + + berror:function(e){ + var iurl=getApp().globalData.setting.imghost; + var ob={}; + var txt="object.title_img"; + ob[txt] = iurl +'/miniapp/images/logo.png?v=1'; + this.setData(ob); + }, + nv_void(e){ + var feedId=e.currentTarget.dataset.feedid; + var finderUserName=e.currentTarget.dataset.finderusername; + var video_type=e.currentTarget.dataset.video_type; + getApp().openChannelsActivity({ + feedId, + finderUserName, + video_type + }) + } + } +}) diff --git a/components/diy_floatingWindow/diy_floatingWindow.json b/components/diy_floatingWindow/diy_floatingWindow.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/components/diy_floatingWindow/diy_floatingWindow.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/components/diy_floatingWindow/diy_floatingWindow.wxml b/components/diy_floatingWindow/diy_floatingWindow.wxml new file mode 100644 index 0000000..1dda3e3 --- /dev/null +++ b/components/diy_floatingWindow/diy_floatingWindow.wxml @@ -0,0 +1,29 @@ + + + + + + + {{object.title}} + + + + + {{object.title}} + + + + + {{object.title}} + + + + + {{object.title}} + + + diff --git a/components/diy_floatingWindow/diy_floatingWindow.wxss b/components/diy_floatingWindow/diy_floatingWindow.wxss new file mode 100644 index 0000000..60919ad --- /dev/null +++ b/components/diy_floatingWindow/diy_floatingWindow.wxss @@ -0,0 +1,25 @@ +.custom-service { + width: 100rpx; + height: 100rpx; + /* background-color: red; */ + border-radius: 50%; + z-index: 100; + line-height: 28rpx; + position: fixed; + top: 50%; + + /* background-position: 50%; */ + background-repeat: no-repeat; + /* background-attachment: fixed; */ + background-size: cover; + +} +.s_title{ + font-size: 20rpx; + position: absolute; + left: 0; + right: 0; + bottom: 5rpx; + text-align: center; + color: #fff; +} diff --git a/components/diy_goodsGroup/diy_goodsGroup.js b/components/diy_goodsGroup/diy_goodsGroup.js index f40fad6..e2c5d55 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.js +++ b/components/diy_goodsGroup/diy_goodsGroup.js @@ -62,8 +62,9 @@ Component({ is_get:0, is_retail_price:0, //是否显示零售价 - swiperHeight:0 + swiperHeight:0, // action_index:0, //选中的tab项 + add_purchase:false, }, lifetimes: { @@ -626,7 +627,29 @@ Component({ if (this.data.object.goodscount * this.data.page < this.data.total) { this.setLoading() } - } + }, + // 加购方法show + addPurchase(even){ + this.setData({ + add_purchase:true + }) + let gid = even.currentTarget.dataset.gid + let prom_id = even.currentTarget.dataset.prom_id + let prom_type = even.currentTarget.dataset.prom_type + let add_purchase = this.selectComponent("#add_purchase"); + if (add_purchase) { + add_purchase.init(gid,prom_type,prom_id) + } + }, + // 加购方法 hide + hide_add_purchase(){ + console.error('隐藏加购方法。。。。'); + setTimeout(()=>{ + this.setData({ + add_purchase:false + }) + },1000) + } diff --git a/components/diy_goodsGroup/diy_goodsGroup.json b/components/diy_goodsGroup/diy_goodsGroup.json index 184585e..c34605a 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.json +++ b/components/diy_goodsGroup/diy_goodsGroup.json @@ -2,6 +2,7 @@ "component": true, "usingComponents": { "mp-loading": "weui-miniprogram/loading/loading", - "mp-sticky": "../mp-sticky/mp-sticky" + "mp-sticky": "../mp-sticky/mp-sticky", + "add_purchase": "/components/add_purchase/add_purchase" } } \ No newline at end of file diff --git a/components/diy_goodsGroup/diy_goodsGroup.wxml b/components/diy_goodsGroup/diy_goodsGroup.wxml index 7d6faa1..1f378f9 100644 --- a/components/diy_goodsGroup/diy_goodsGroup.wxml +++ b/components/diy_goodsGroup/diy_goodsGroup.wxml @@ -79,7 +79,7 @@ - + {{object.button_content}} @@ -127,7 +127,7 @@ ¥{{aitem.market_price}} - + {{object.button_content}} @@ -175,7 +175,7 @@ ¥{{aitem.market_price}} - + @@ -222,7 +222,7 @@ - + {{object.button_content}} @@ -277,7 +277,7 @@ - + {{object.button_content}} @@ -315,7 +315,7 @@ ¥{{aitem.market_price}} - + {{object.button_content}} @@ -353,7 +353,7 @@ ¥{{aitem.market_price}} - + {{object.button_content}} @@ -448,7 +448,7 @@ ¥{{aitem.market_price}} - + @@ -1360,4 +1360,8 @@ - \ No newline at end of file + + + + + \ No newline at end of file diff --git a/components/diy_public/diy_public.js b/components/diy_public/diy_public.js index a03c9c9..286c635 100644 --- a/components/diy_public/diy_public.js +++ b/components/diy_public/diy_public.js @@ -55,7 +55,7 @@ Component({ }, nav1:'/packageA/pages/goodsInfo/goodsInfo?', nav2:'/pages/goods/goodsInfo/goodsInfo?', - + add_purchase:false, }, pageLifetimes: { @@ -547,6 +547,27 @@ Component({ } + }, + // 加购方法show + addPurchase(even){ + this.setData({ + add_purchase:true + }) + let gid = even.currentTarget.dataset.gid + let prom_id = even.currentTarget.dataset.prom_id + let prom_type = even.currentTarget.dataset.prom_type + let add_purchase = this.selectComponent("#add_purchase"); + if (add_purchase) { + add_purchase.init(gid,prom_type,prom_id) + } + }, + // 加购方法 hide + hide_add_purchase(){ + setTimeout(()=>{ + this.setData({ + add_purchase:false + }) + },1000) } }, diff --git a/components/diy_public/diy_public.json b/components/diy_public/diy_public.json index e8cfaaf..f80abb3 100644 --- a/components/diy_public/diy_public.json +++ b/components/diy_public/diy_public.json @@ -1,4 +1,6 @@ { "component": true, - "usingComponents": {} + "usingComponents": { + "add_purchase": "/components/add_purchase/add_purchase" + } } \ No newline at end of file diff --git a/components/diy_public/diy_public.wxml b/components/diy_public/diy_public.wxml index fa1613e..56531e3 100644 --- a/components/diy_public/diy_public.wxml +++ b/components/diy_public/diy_public.wxml @@ -61,7 +61,7 @@ - + {{object.button_content}} @@ -115,7 +115,7 @@ ¥{{aitem.market_price || aitem.shop_price }} - + {{object.button_content}} @@ -163,7 +163,7 @@ ¥{{aitem.market_price || aitem.shop_price }} - + @@ -214,7 +214,7 @@ - + {{object.button_content}} @@ -273,7 +273,7 @@ - + {{object.button_content}} @@ -315,7 +315,7 @@ ¥{{aitem.market_price || aitem.shop_price }} - + {{object.button_content}} @@ -357,7 +357,7 @@ ¥{{aitem.market_price || aitem.shop_price }} - + {{object.button_content}} @@ -452,10 +452,10 @@ ¥{{aitem.market_price || aitem.shop_price }} - + - + @@ -464,4 +464,13 @@ - \ No newline at end of file + + + + + + + + + + diff --git a/components/diy_scan/diy_scan.js b/components/diy_scan/diy_scan.js index 5072315..c25f56e 100644 --- a/components/diy_scan/diy_scan.js +++ b/components/diy_scan/diy_scan.js @@ -32,7 +32,7 @@ Component({ success: (res) => { var result = res.result; wx.navigateTo({ - url: "/pages/goods/search/search?s_key=" + result, + url: "/packageG/pages/goods/search/search?s_key=" + result, }); } }) diff --git a/components/diy_searchbox/diy_searchbox.js b/components/diy_searchbox/diy_searchbox.js index 32b86db..783129f 100644 --- a/components/diy_searchbox/diy_searchbox.js +++ b/components/diy_searchbox/diy_searchbox.js @@ -67,7 +67,7 @@ Component({ click_sear:function(){ //如果搜索的单词为空的时候,就要跳到搜索页 if(this.data.keyword!=''){ - getApp().goto("/pages/goods/search/search"); + getApp().goto("/packageG/pages/goods/search/search"); return false; } this.setData({first:0,inputShowed:1,inputval:''}); @@ -94,7 +94,7 @@ Component({ this.setData({inputval:val}); }, sear:function(){ - var url="/pages/goods/search/search?s_key="+this.data.inputval; + var url="/packageG/pages/goods/search/search?s_key="+this.data.inputval; getApp().goto(url); }, @@ -108,7 +108,7 @@ Component({ sear_key:function(e){ this.data.click_sear=1; var str=e.currentTarget.dataset.item; - var url="/pages/goods/search/search?s_key="+str; + var url="/packageG/pages/goods/search/search?s_key="+str; this.data.click_sear=0; getApp().goto(url); diff --git a/components/diy_seckill/diy_seckill.js b/components/diy_seckill/diy_seckill.js index a4c43be..62fe10b 100644 --- a/components/diy_seckill/diy_seckill.js +++ b/components/diy_seckill/diy_seckill.js @@ -38,7 +38,9 @@ Component({ user_id:0, img_width:100, img_height:100, - swiperHeight:0 + swiperHeight:0, + prom_type:1, + add_purchase:false, }, pageLifetimes: { @@ -387,6 +389,28 @@ Component({ } + }, + // 加购方法show + addPurchase(even){ + this.setData({ + add_purchase:true + }) + let gid = even.currentTarget.dataset.gid + let prom_id = even.currentTarget.dataset.prom_id + let prom_type = even.currentTarget.dataset.prom_type + let goods_type= even.currentTarget.dataset.goods_type + let add_purchase = this.selectComponent("#add_purchase"); + if (add_purchase) { + add_purchase.init(gid,prom_type,prom_id,goods_type) + } + }, + // 加购方法 hide + hide_add_purchase(){ + setTimeout(()=>{ + this.setData({ + add_purchase:false + }) + },1000) } }, diff --git a/components/diy_seckill/diy_seckill.json b/components/diy_seckill/diy_seckill.json index e8cfaaf..f80abb3 100644 --- a/components/diy_seckill/diy_seckill.json +++ b/components/diy_seckill/diy_seckill.json @@ -1,4 +1,6 @@ { "component": true, - "usingComponents": {} + "usingComponents": { + "add_purchase": "/components/add_purchase/add_purchase" + } } \ No newline at end of file diff --git a/components/diy_seckill/diy_seckill.wxml b/components/diy_seckill/diy_seckill.wxml index 32a1fd8..7119f86 100644 --- a/components/diy_seckill/diy_seckill.wxml +++ b/components/diy_seckill/diy_seckill.wxml @@ -1,3 +1,4 @@ + @@ -56,7 +57,7 @@ - + {{object.button_content}} @@ -104,7 +105,7 @@ ¥{{aitem.market_price}} - + {{object.button_content}} @@ -152,7 +153,7 @@ ¥{{aitem.market_price}} - + @@ -199,7 +200,7 @@ - + {{object.button_content}} @@ -254,7 +255,7 @@ - + {{object.button_content}} @@ -292,7 +293,7 @@ ¥{{aitem.market_price}} - + {{object.button_content}} @@ -330,7 +331,7 @@ ¥{{aitem.market_price}} - + {{object.button_content}} @@ -425,7 +426,7 @@ ¥{{aitem.market_price}} - + @@ -571,4 +572,9 @@ - \ No newline at end of file + + + + + + \ No newline at end of file diff --git a/components/diy_service/diy_service.wxss b/components/diy_service/diy_service.wxss index d0bf844..57658b5 100644 --- a/components/diy_service/diy_service.wxss +++ b/components/diy_service/diy_service.wxss @@ -1,6 +1,6 @@ -.custom-service{ width: 116rpx; height: 116rpx; border-radius: 50%; background-color: #fff;z-index: 100; +.custom-service{ width: 100rpx; height: 100rpx; border-radius: 50%; background-color: #fff;z-index: 100; border: 1px solid #adadad; box-shadow: 0 0 10px 2px #adadad; line-height: 28rpx; position: fixed; top: 40%; right: 2rpx; display: flex;align-items: center;justify-content: center;} .cs-img{ width: 36rpx; height: 36rpx;} -.s_title{ font-size: 20rpx;} \ No newline at end of file +.s_title{ font-size: 14rpx;} \ No newline at end of file diff --git a/components/nav_b/nav_b.js b/components/nav_b/nav_b.js index b394f8d..5acda65 100644 --- a/components/nav_b/nav_b.js +++ b/components/nav_b/nav_b.js @@ -9,7 +9,7 @@ Component({ nav_center: "预约", //导航中间 nav_right: "我的", //导航右边 nav_left_url: "/pages/index/index/index", //导航左边地址 - nav_center_url: "/pages/user/my_service/tment_order_list", //导航中间地址 + nav_center_url: "/packageG/pages/user/my_service/tment_order_list", //导航中间地址 nav_right_url: "/pages/user/index/index", //导航右边地址 }, diff --git a/packageA/pages/cart2_ser/cart2_ser.js b/packageA/pages/cart2_ser/cart2_ser.js index 5c06bb6..feff52b 100644 --- a/packageA/pages/cart2_ser/cart2_ser.js +++ b/packageA/pages/cart2_ser/cart2_ser.js @@ -46,9 +46,10 @@ Page({ /*------------------------*/ yuer: 0, - is_cart: 0, //是不是购物车进来的购买 + is_cart: 0, //是不是购物车进来的购买 + template_id:[],//订阅消息 }, - onLoad: function(t) { + onLoad: async function(t) { //定义第一次进入 this.data.fir_in=1; @@ -68,19 +69,25 @@ Page({ var th = this; - getApp().promiseGet("/api/wx/weappSendlist/page", { - data: { - store_id: os.stoid, - typeid: "1001" - } - }).then(res => { - if (res.data.code == 0 && res.data.data.pageData.length > 0) { - var template_id = res.data.data.pageData[0].template_id; - th.setData({ - template_id: template_id - }); - } - }) + // getApp().promiseGet("/api/wx/weappSendlist/page", { + // data: { + // store_id: os.stoid, + // typeid: "1001" + // } + // }).then(res => { + // if (res.data.code == 0 && res.data.data.pageData.length > 0) { + // var template_id = res.data.data.pageData[0].template_id; + // th.setData({ + // template_id: template_id + // }); + // } + // }) + try { + let template_id =await getApp().get_template_id('1001,1012,1027') + this.setData({ + template_id + }) + } catch (error) {} }, onUnload: function() { @@ -289,7 +296,7 @@ Page({ if(fy) return false; t_pay.set_fir(); - var back_url="/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id; + var back_url="/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id; //-- 通联的第三方支付的返回优化 -- ut.is_pay_ok(th.data.order_id,back_url,"/pages/user/order_list/order_list?index=2&tabindex=1",function (){ @@ -682,7 +689,7 @@ Page({ }); setTimeout(function () { wx.reLaunch({ - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id, + url: "/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id, }) }, 1000) @@ -728,7 +735,7 @@ Page({ // }); // setTimeout(function () { // wx.reLaunch({ - // url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, + // url: "/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, // }) // }, 1000) // }, @@ -799,7 +806,7 @@ Page({ }); "function" == typeof success && success(); wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id, + url: "/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id, }); }, fail: function(n) { @@ -816,7 +823,7 @@ Page({ var template_id = this.data.template_id; // //授权订阅 wx.requestSubscribeMessage({ - tmplIds: [template_id], + tmplIds: template_id, success(res) { func(); }, diff --git a/packageA/pages/details_serviceCard/details_serviceCard.js b/packageA/pages/details_serviceCard/details_serviceCard.js index e50aa62..1feb330 100644 --- a/packageA/pages/details_serviceCard/details_serviceCard.js +++ b/packageA/pages/details_serviceCard/details_serviceCard.js @@ -966,7 +966,7 @@ Page({ } else{ wx.reLaunch({ - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, + url: "/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, }) } @@ -1009,7 +1009,7 @@ Page({ console.log(n), getApp().showSuccess("支付成功!"); "function" == typeof success && success(); wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, + url: "/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, }); }, fail: function(n) { diff --git a/packageA/pages/my_service/appment_main.js b/packageA/pages/my_service/appment_main.js index 0460e93..065c292 100644 --- a/packageA/pages/my_service/appment_main.js +++ b/packageA/pages/my_service/appment_main.js @@ -532,7 +532,7 @@ Page({ is_textea: 1 }) console.log('optionsxxx===>', this.data.options); - // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id); + // console.log('1-->', "/packageG/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id); wx.navigateTo({ url: "/packageA/pages/my_service/cosmetology_list?userid=" + this.data.options.userid + '&storageId=' + storageId + '&itemId=' + itemId + "&projectId=" + project_id }); diff --git a/packageA/pages/my_service/appment_main.wxml b/packageA/pages/my_service/appment_main.wxml index 4b99d91..5c67ca6 100644 --- a/packageA/pages/my_service/appment_main.wxml +++ b/packageA/pages/my_service/appment_main.wxml @@ -84,7 +84,7 @@ -
diff --git a/packageA/pages/my_service/i_service.wxml b/packageA/pages/my_service/i_service.wxml index de660ef..086a6a7 100644 --- a/packageA/pages/my_service/i_service.wxml +++ b/packageA/pages/my_service/i_service.wxml @@ -63,7 +63,7 @@ 立即使用 - + 预约 --> diff --git a/packageA/pages/my_service/tment_eval.js b/packageA/pages/my_service/tment_eval.js index 35595f5..74d45e4 100644 --- a/packageA/pages/my_service/tment_eval.js +++ b/packageA/pages/my_service/tment_eval.js @@ -242,7 +242,7 @@ Page({ evaluate_qt:function(){ wx.redirectTo({ - url: "/pages/user/my_service/tment_order_list?state="+2 + url: "/packageG/pages/user/my_service/tment_order_list?state="+2 }); }, //点击领取礼包 diff --git a/packageA/pages/my_service2/appment_main.js b/packageA/pages/my_service2/appment_main.js index 277492a..dbfcb61 100644 --- a/packageA/pages/my_service2/appment_main.js +++ b/packageA/pages/my_service2/appment_main.js @@ -479,7 +479,7 @@ Page({ }) console.log('optionsxxx===>', this.data.options); - // console.log('1-->', "/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id); + // console.log('1-->', "/packageG/pages/user/my_service/cosmetology_list?userid=" + th.data.options.userid + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id); wx.navigateTo({ url: "/packageA/pages/my_service/cosmetology_list?userid=" + this.data.options.userid + '&storageId=' + storageId + '&itemId=' + itemId + "&projectId=" + project_id }); diff --git a/packageA/pages/my_service2/appment_main.wxml b/packageA/pages/my_service2/appment_main.wxml index 4fc5fd6..c2cf49a 100644 --- a/packageA/pages/my_service2/appment_main.wxml +++ b/packageA/pages/my_service2/appment_main.wxml @@ -88,7 +88,7 @@ - + 我的预约 diff --git a/packageA/pages/my_service2/tment_eval.js b/packageA/pages/my_service2/tment_eval.js index 35595f5..74d45e4 100644 --- a/packageA/pages/my_service2/tment_eval.js +++ b/packageA/pages/my_service2/tment_eval.js @@ -242,7 +242,7 @@ Page({ evaluate_qt:function(){ wx.redirectTo({ - url: "/pages/user/my_service/tment_order_list?state="+2 + url: "/packageG/pages/user/my_service/tment_order_list?state="+2 }); }, //点击领取礼包 diff --git a/packageA/pages/serviceCard_pd/cart/cart.js b/packageA/pages/serviceCard_pd/cart/cart.js index 7911842..0257efc 100644 --- a/packageA/pages/serviceCard_pd/cart/cart.js +++ b/packageA/pages/serviceCard_pd/cart/cart.js @@ -5,7 +5,7 @@ var regeneratorRuntime = require('../../../../utils/runtime.js'); var util_pay = require("../../../../utils/pay.js"); var t_pay = require("../../../../utils/pay2.js"); -Page({ +Page({ data: { url: t.globalData.setting.url, resourceUrl: t.globalData.setting.resourceUrl, @@ -65,11 +65,11 @@ Page({ card_name: '', //显示的卡的名称 card_cut_price: null,//减价多少钱 - + template_id:[], //dis_config:null, //因为拼团有佣金抵扣 //bn_use_commission: 0, //是不是使用佣金 }, - onLoad: function (t) { + onLoad: async function (t) { console.log("onLoad_pt_cart"); //定义第一次进入 this.data.fir_in=1; @@ -94,6 +94,12 @@ Page({ //先获取物流,再获取用户信息,再展示页面 //th.get_wuliu(th.get_info(th.show_page)); //getApp().is_distribut(this); + try { + let template_id =await getApp().get_template_id('1001,1012,1027') + this.setData({ + template_id + }) + } catch (error) {} }, onUnload: function () { this.setData({ isclose: 1 }) }, @@ -536,7 +542,7 @@ Page({ var template_id = this.data.template_id; // //授权订阅 wx.requestSubscribeMessage({ - tmplIds: [template_id], + tmplIds: template_id, success(res) { func(); }, diff --git a/packageA/pages/serviceCard_pd/cart_wk/cart_wk.js b/packageA/pages/serviceCard_pd/cart_wk/cart_wk.js index b6ac5bf..a32bccf 100644 --- a/packageA/pages/serviceCard_pd/cart_wk/cart_wk.js +++ b/packageA/pages/serviceCard_pd/cart_wk/cart_wk.js @@ -107,7 +107,7 @@ Page({ util_pay.set_fir(); - var back_url="/pages/payment/pay_success/pay_success?order_id=" + th.data.order.order_id + "&type=1&card=1"; + var back_url="/packageG/pages/payment/pay_success/pay_success?order_id=" + th.data.order.order_id + "&type=1&card=1"; //-- 通联的第三方支付的返回优化 -- ut.is_pay_ok(th.data.wk_pyed,back_url,"/pages/user/order_list/order_list?index=2&tabindex=1",function (){ if(!th.data.wk_pyed) return false; @@ -737,7 +737,7 @@ Page({ //------支付成功页面-------- jumpPaymentPage: function (order_id, order_amount) { wx.setStorageSync("order:order_list:update", !0), wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?order_id=" + order_id + "&type=1&card=1", + url: "/packageG/pages/payment/pay_success/pay_success?order_id=" + order_id + "&type=1&card=1", }); }, diff --git a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js index 899fbdb..bdb5427 100644 --- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js +++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.js @@ -4,7 +4,7 @@ var ut = require("../../../../utils/util.js"), oo = getApp().globalData, os = oo.setting; var s=getApp(); -//评价加载更多 +//评价加载更多 var more = function (e) { return e && e.__esModule ? e : { default: e @@ -203,10 +203,11 @@ Page({ nav_type: 2, //导航类型 istop: 0, //是否置顶风格为1 searchbox_transparent: 1, + template_id:[],//订阅消息id }, //------初始化加载---------- - onLoad: function (t) { + onLoad: async function (t) { self = this; this.setData({options: t,}); var ee = this, that = ee, th = ee, @@ -447,6 +448,12 @@ Page({ }); + try { + let template_id =await getApp().get_template_id('1023') + this.setData({ + template_id + }) + } catch (error) {} }, @@ -3363,6 +3370,21 @@ Page({ }); }, + //天天拼团订阅消息提醒 + sendsm: function (ee) { + let th = this; + var template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: template_id, + success(res) { + th.openSpecModel_pt(ee); + }, + fail(res) { + th.openSpecModel_pt(ee); + } + }) + }, //--点击弹起拼单-- openSpecModel_pt: function (e) { diff --git a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml index 0478b0a..73be720 100644 --- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml +++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml @@ -594,12 +594,12 @@ - + ¥{{prom_act.price}} 去参团 - + 一键开团 @@ -616,7 +616,7 @@ - + ¥{{filters.toFix(prom_act.yf_price,2)}} 支付定金 diff --git a/packageB/pages/user/Change_phone/Change_phone.js b/packageB/pages/user/Change_phone/Change_phone.js index f0d7873..da47cac 100644 --- a/packageB/pages/user/Change_phone/Change_phone.js +++ b/packageB/pages/user/Change_phone/Change_phone.js @@ -143,7 +143,7 @@ Page({ getApp().request.put("/api/weshop/users/updateMobile/" + r.stoid + '/' + o.user_id + '/' + code + '/' + mobile, { success: function(res) { if (res.data.code == 0) { - var url = "/pages/user/userinfo/userinfo?change_phone" + change_phone + var url = "/packageG/pages/user/userinfo/userinfo?change_phone" + change_phone getApp().globalData.userInfo.mobile = mobile; getApp().my_warnning("更换成功", 0, th); getApp().goto(url); diff --git a/packageB/pages/user/choice_guide/choice_guide.js b/packageB/pages/user/choice_guide/choice_guide.js index ca623d2..4fe5d75 100644 --- a/packageB/pages/user/choice_guide/choice_guide.js +++ b/packageB/pages/user/choice_guide/choice_guide.js @@ -107,7 +107,7 @@ Page({ if( this.data.is_back) wx.navigateBack({ delta: 1 }) else - getApp().goto("/pages/user/userinfo/userinfo"); + getApp().goto("/packageG/pages/user/userinfo/userinfo"); }, img_err:function (e) { diff --git a/packageB/pages/zuhegou/index/index.wxml b/packageB/pages/zuhegou/index/index.wxml index 209fc57..c8fa98e 100644 --- a/packageB/pages/zuhegou/index/index.wxml +++ b/packageB/pages/zuhegou/index/index.wxml @@ -61,7 +61,7 @@ - + diff --git a/packageC/pages/goods/goodsList/goodsList.wxml b/packageC/pages/goods/goodsList/goodsList.wxml index 821faf5..b3c3b58 100644 --- a/packageC/pages/goods/goodsList/goodsList.wxml +++ b/packageC/pages/goods/goodsList/goodsList.wxml @@ -50,7 +50,7 @@ --> - diff --git a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js index e0a22a3..c9efe7d 100644 --- a/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js +++ b/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart.js @@ -2873,7 +2873,7 @@ Page({ //app.my_warnning("支付成功",1,th); //setTimeout(function () { wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data }) //},1000) @@ -2905,7 +2905,7 @@ Page({ //setTimeout(function () { th.setData({ isclose: 0 }); wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, }) //}, 1000) } diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js index fdf3caa..6a451fc 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.js @@ -79,6 +79,7 @@ Page({ same_ok:1, //同城配送的控制,默认ok bconfig: null, showFold:true, + template_id:[], }, @@ -126,7 +127,7 @@ Page({ flag: !this.data.flag, }) }, - onLoad: function (t) { + onLoad: async function (t) { //定义第一次进入 this.data.fir_in=1; @@ -181,6 +182,12 @@ Page({ //判断是不是佣金抵扣 getApp().is_distribut(this); + try { + let template_id =await getApp().get_template_id('1001,1012,1027') + this.setData({ + template_id + }) + } catch (error) {} }, onUnload: function () { @@ -1260,7 +1267,22 @@ Page({ //}); }, - + //订阅消息提醒 + sendsm: function (t) { + let that = this; + let template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: template_id, + success(res) { + that.submitConfirm(t) + }, + fail(res) { + that.submitConfirm(t) + } + }) + + }, // 提交订单前弹出确认对话框 submitConfirm(e) { @@ -1534,7 +1556,7 @@ Page({ util_pay.pay(data.data, function () { setTimeout(function () { // wx.reLaunch({ - // //url: "/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data, + // //url: "/packageG/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data, // url: "/packageG/pages/team/team_success/team_success?ordersn=" + data.data, // }) @@ -1604,7 +1626,7 @@ Page({ // url: "/pages/user/order_list/order_list", // })--*/ - // // var url="/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data; + // // var url="/packageG/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data; // // wx.reLaunch({ // // url: url // // }) diff --git a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml index 2474d93..71a9765 100644 --- a/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml +++ b/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct.wxml @@ -1,5 +1,5 @@ - + diff --git a/packageC/pages/payForAnother/payForAnother.js b/packageC/pages/payForAnother/payForAnother.js index 183ddbd..cad3426 100644 --- a/packageC/pages/payForAnother/payForAnother.js +++ b/packageC/pages/payForAnother/payForAnother.js @@ -2549,7 +2549,7 @@ Page({ //app.my_warnning("支付成功",1,th); //setTimeout(function () { wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data }) //},1000) @@ -2581,7 +2581,7 @@ Page({ //setTimeout(function () { th.setData({isclose: 0}); wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, }) //}, 1000) } diff --git a/packageC/pages/presell/cart/cart2.js b/packageC/pages/presell/cart/cart2.js index 8838b9d..8289951 100644 --- a/packageC/pages/presell/cart/cart2.js +++ b/packageC/pages/presell/cart/cart2.js @@ -223,11 +223,11 @@ Page({ t_pay.set_fir(); let err_url="/pages/user/order_list/order_list"; - let ok_url="/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn; + let ok_url="/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn; if(th.data.is_fwk){ err_url='/pages/user/order_list/order_list?index=2&tabindex=1'; - ok_url="/pages/payment/pay_success/pay_success?card=1&order_id=" + this.data.order_id; + ok_url="/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + this.data.order_id; } //-- 通联的第三方支付的返回优化 -- @@ -1375,7 +1375,7 @@ Page({ }); setTimeout(function () { wx.reLaunch({ - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id, + url: "/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + th.data.order_id, }) }, 1000) @@ -1963,7 +1963,7 @@ Page({ //app.my_warnning("支付成功",1,th); //setTimeout(function () { wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data }) //},1000) @@ -1995,7 +1995,7 @@ Page({ //setTimeout(function () { th.setData({ isclose: 0 }); wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, }) //}, 1000) } diff --git a/packageC/pages/presell/cart/cart2_pre.js b/packageC/pages/presell/cart/cart2_pre.js index 2021f1b..c050bb3 100644 --- a/packageC/pages/presell/cart/cart2_pre.js +++ b/packageC/pages/presell/cart/cart2_pre.js @@ -60,6 +60,7 @@ Page({ showFold:true, is_fwk:0, //判断服务卡项的类型 + template_id:[], }, onReady() { setTimeout(() => { @@ -80,7 +81,7 @@ Page({ flag: !this.data.flag, }) }, - onLoad: function (t) { + onLoad: async function (t) { //定义第一次进入 this.data.fir_in=1; @@ -97,11 +98,16 @@ Page({ }, 1); var gg = getApp().get_b_now(); - debugger; + if(gg.fwk){ this.setData({is_fwk: 1}); } - + try { + let template_id =await getApp().get_template_id('1001,1012,1027') + this.setData({ + template_id + }) + } catch (error) {} }, onUnload: function () { this.setData({ isclose: 1 }) }, @@ -1248,7 +1254,22 @@ Page({ complete: function () { } }) }, + //订阅消息提醒 + sendsm: function (t) { + let that = this; + let template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: template_id, + success(res) { + that.submitForm(t) + }, + fail(res) { + that.submitForm(t) + } + }) + }, //--------------------提交订单----------------------- submitForm: function (t) { var th = this; diff --git a/packageC/pages/presell/cart/cart2_pre.wxml b/packageC/pages/presell/cart/cart2_pre.wxml index b466740..a546eef 100644 --- a/packageC/pages/presell/cart/cart2_pre.wxml +++ b/packageC/pages/presell/cart/cart2_pre.wxml @@ -1,6 +1,6 @@ - - + + - + diff --git a/packageD/pages/user/deposit/prepaid/msg/msg.js b/packageD/pages/user/deposit/prepaid/msg/msg.js index 8888876..06c44c8 100644 --- a/packageD/pages/user/deposit/prepaid/msg/msg.js +++ b/packageD/pages/user/deposit/prepaid/msg/msg.js @@ -57,7 +57,7 @@ Page({ my_confirm.open_cancel(0); }, function () { - let url = '/pages/user/userinfo/userinfo?isstcsp=1'; + let url = '/packageG/pages/user/userinfo/userinfo?isstcsp=1'; wx.redirectTo({url: url,}) //跳到非tabbar页 } ); diff --git a/packageE/pages/cart/cart2/cart2.js b/packageE/pages/cart/cart2/cart2.js index f8b1e2e..cd890a0 100644 --- a/packageE/pages/cart/cart2/cart2.js +++ b/packageE/pages/cart/cart2/cart2.js @@ -169,7 +169,8 @@ Page({ bconfig: null, showFold:true, - ly_map:{} + ly_map:{}, + template_id:[] }, @@ -194,7 +195,7 @@ Page({ }) }, - onLoad: function (t) { + onLoad:async function (t) { this.data.fir_in=1; @@ -219,18 +220,23 @@ Page({ if (t.state) { th.data.state = 1; } - getApp().promiseGet("/api/wx/weappSendlist/page", { - data: { - store_id: os.stoid, - typeid: "1001" - } - }).then(res => { - if (res.data.code == 0 && res.data.data.pageData.length > 0) { - var template_id = res.data.data.pageData[0].template_id; - th.setData({ template_id: template_id }); - } - }) - + // getApp().promiseGet("/api/wx/weappSendlist/page", { + // data: { + // store_id: os.stoid, + // typeid: "1001" + // } + // }).then(res => { + // if (res.data.code == 0 && res.data.data.pageData.length > 0) { + // var template_id = res.data.data.pageData[0].template_id; + // th.setData({ template_id: template_id }); + // } + // }) + try { + let template_id =await getApp().get_template_id('1001,1012,1027') + this.setData({ + template_id + }) + } catch (error) {} //判断是不是佣金抵扣 getApp().is_distribut(this); @@ -285,7 +291,7 @@ Page({ util_pay.set_fir(); //-- 通联的第三方支付的返回优化 -- - ut.is_pay_ok(th.data.ok_order_sn,"/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn, + ut.is_pay_ok(th.data.ok_order_sn,"/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + this.data.ok_order_sn, "/pages/user/order_list/order_list",function (){ //支付信息会先记录着 if(!th.data.ok_order_sn) return false; @@ -297,7 +303,7 @@ Page({ //支付支付,返回首页 ut.m_toast('支付成功'); setTimeout(()=>{ - getApp().re_to("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn); + getApp().re_to("/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn); },1000) }else{ @@ -4395,26 +4401,32 @@ Page({ requestSubscribe() { const th = this; const template_id = this.data.template_id; - wx.getSetting({ - withSubscriptions: true, - success(res) { - let itemSettings = res.subscriptionsSetting.itemSettings; - if (itemSettings && itemSettings[template_id] == "accept") { - //要检查一下赠品有可以足够 - th.sub_check_gift(function () { - th.submit_func(); - }) - - } else { - th.sendsm(function () { - //要检查一下赠品有可以足够 - th.sub_check_gift(function () { - th.submit_func(); - }) - }) - } - } + th.sendsm(function () { + //要检查一下赠品有可以足够 + th.sub_check_gift(function () { + th.submit_func(); + }) }) + // wx.getSetting({ + // withSubscriptions: true, + // success(res) { + // let itemSettings = res.subscriptionsSetting.itemSettings; + // if (itemSettings && itemSettings[template_id] == "accept") { + // //要检查一下赠品有可以足够 + // th.sub_check_gift(function () { + // th.submit_func(); + // }) + + // } else { + // th.sendsm(function () { + // //要检查一下赠品有可以足够 + // th.sub_check_gift(function () { + // th.submit_func(); + // }) + // }) + // } + // } + // }) this.setData({ submit: 1, }) @@ -5479,15 +5491,15 @@ Page({ // } // wx.hideLoading() // wx.redirectTo({ - // url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data + // url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data // }) // } else { // wx.redirectTo({ - // url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data + // url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data // }) // } wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data }) //},1000) @@ -5522,17 +5534,17 @@ Page({ // wx.hideLoading() // th.setData({ isclose: 0 }); // wx.redirectTo({ - // url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, + // url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, // }) // } else { // th.setData({ isclose: 0 }); // wx.redirectTo({ - // url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, + // url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, // }) // } th.setData({ isclose: 0 }); wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, }) //}, 1000) } @@ -7311,7 +7323,7 @@ Page({ var template_id = this.data.template_id; // //授权订阅 wx.requestSubscribeMessage({ - tmplIds: [template_id], + tmplIds: template_id, success(res) { func(); }, diff --git a/packageE/pages/cart/cart2_inte/cart2_inte.js b/packageE/pages/cart/cart2_inte/cart2_inte.js index a354d02..873ffd3 100644 --- a/packageE/pages/cart/cart2_inte/cart2_inte.js +++ b/packageE/pages/cart/cart2_inte/cart2_inte.js @@ -85,6 +85,7 @@ Page({ same_ok:1, //同城配送的控制,默认ok bconfig: null, showFold:true, + template_id:[] }, @@ -109,7 +110,7 @@ Page({ flag: !this.data.flag, }) }, - onLoad: function (t) { + onLoad: async function (t) { this.data.fir_in=1; wx.setNavigationBarTitle({ title: "填写订单", }) @@ -193,7 +194,12 @@ Page({ //判断是不是佣金抵扣 getApp().is_distribut(this); - + try { + let template_id =await getApp().get_template_id('1001,1012,1027') + this.setData({ + template_id + }) + } catch (error) {} }, onUnload: function () { this.setData({ isclose: 1 }) }, onHide: function () { @@ -225,7 +231,7 @@ Page({ util_pay.set_fir(); //-- 通联的第三方支付的返回优化 -- - ut.is_pay_ok(th.data.ok_order_sn,"/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn, + ut.is_pay_ok(th.data.ok_order_sn,"/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn, "/pages/user/order_list/order_list",function (){ if(!th.data.ok_order_sn) return false; getApp().request.promiseGet("/api/weshop/order/page", @@ -236,7 +242,7 @@ Page({ //支付支付,返回首页 ut.m_toast('支付成功'); setTimeout(()=>{ - getApp().re_to("/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn); + getApp().re_to("/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + th.data.ok_order_sn); },1000) }else{ @@ -1150,7 +1156,22 @@ Page({ //}); }, + //订阅消息提醒 + sendsm: function (t) { + let that = this; + let template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: template_id, + success(res) { + that.submitForm(t) + }, + fail(res) { + that.submitForm(t) + } + }) + }, //--------------------提交订单----------------------- async submitForm(t) { var sub_value = t; @@ -1382,7 +1403,7 @@ Page({ //app.my_warnning("支付成功",1,th); //setTimeout(function () { wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data }) //},1000) @@ -1408,7 +1429,7 @@ Page({ //setTimeout(function () { th.setData({ isclose: 0 }); wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, + url: "/packageG/pages/payment/pay_success/pay_success?type=2&order_sn=" + data.data, }) //}, 1000) } diff --git a/packageE/pages/cart/cart2_inte/cart2_inte.wxml b/packageE/pages/cart/cart2_inte/cart2_inte.wxml index 7dc6a4e..dd18640 100644 --- a/packageE/pages/cart/cart2_inte/cart2_inte.wxml +++ b/packageE/pages/cart/cart2_inte/cart2_inte.wxml @@ -2,7 +2,7 @@ - + diff --git a/packageE/pages/cart/cart2_pt/cart2_pt.js b/packageE/pages/cart/cart2_pt/cart2_pt.js index 908f8d4..10052d9 100644 --- a/packageE/pages/cart/cart2_pt/cart2_pt.js +++ b/packageE/pages/cart/cart2_pt/cart2_pt.js @@ -6,7 +6,7 @@ var util_pay = require("../../../../utils/pay.js"); Page({ - data: { + data: { url: t.globalData.setting.url, resourceUrl: t.globalData.setting.resourceUrl, imgUrl: t.globalData.setting.imghost, @@ -76,6 +76,7 @@ Page({ same_ok:1, //同城配送的控制,默认ok bconfig:null, showFold:true, + template_id:[], }, @@ -100,7 +101,7 @@ Page({ flag: !this.data.flag, }) }, - onLoad: function (t) { + onLoad: async function (t) { this.data.fir_in=1; wx.setNavigationBarTitle({ title: "填写订单", }) var th = this; @@ -132,6 +133,12 @@ Page({ //th.get_wuliu(th.get_info(th.show_page)); //判断是不是佣金抵扣 getApp().is_distribut(this); + try { + let template_id =await getApp().get_template_id('1001,1012,1027') + this.setData({ + template_id + }) + } catch (error) {} }, onUnload: function () { this.setData({ isclose: 1 }) @@ -1154,6 +1161,22 @@ Page({ //}); }, + //订阅消息提醒 + sendsm: function (t) { + let that = this; + let template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: template_id, + success(res) { + that.submitForm(t) + }, + fail(res) { + that.submitForm(t) + } + }) + + }, //--------------------提交订单----------------------- submitForm: async function (t) { if (this.data.is_summit_ing == 1) return false; //--提交中退出-- @@ -1388,7 +1411,7 @@ Page({ util_pay.pay(data.data, function () { setTimeout(function () { wx.reLaunch({ - //url: "/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data, + //url: "/packageG/pages/payment/pay_success/pay_success?type=1&order_sn="+data.data, url: "/packageG/pages/team/team_success/team_success?ordersn=" + data.data, }) }, 1000) @@ -1428,7 +1451,7 @@ Page({ wx.navigateTo({ url: "/pages/user/order_list/order_list", })--*/ - var url = "/pages/payment/pay_success/pay_success?type=1&order_sn=" + data.data; + var url = "/packageG/pages/payment/pay_success/pay_success?type=1&order_sn=" + data.data; wx.reLaunch({ url: url }) diff --git a/packageE/pages/cart/cart2_pt/cart2_pt.wxml b/packageE/pages/cart/cart2_pt/cart2_pt.wxml index 35d9a8e..d67ded0 100644 --- a/packageE/pages/cart/cart2_pt/cart2_pt.wxml +++ b/packageE/pages/cart/cart2_pt/cart2_pt.wxml @@ -1,5 +1,5 @@ - + @@ -9,7 +9,7 @@ - + 同城配送 diff --git a/packageE/pages/cart/cart_wk/cart_wk.js b/packageE/pages/cart/cart_wk/cart_wk.js index 7a6926c..d121275 100644 --- a/packageE/pages/cart/cart_wk/cart_wk.js +++ b/packageE/pages/cart/cart_wk/cart_wk.js @@ -111,7 +111,7 @@ Page({ util_pay.set_fir(); //-- 通联的第三方支付的返回优化 -- - ut.is_pay_ok(th.data.ok_order_sn,"/pages/payment/pay_success/pay_success?type=1&order_sn=" + this.data.ok_order_sn,'back',function (){ + ut.is_pay_ok(th.data.ok_order_sn,"/packageG/pages/payment/pay_success/pay_success?type=1&order_sn=" + this.data.ok_order_sn,'back',function (){ if(!th.data.ok_order_sn) return false; getApp().request.promiseGet("/api/weshop/order/page", {data:{store_id:os.stoid,parent_sn:th.data.ok_order_sn}}).then(res=>{ @@ -123,7 +123,7 @@ Page({ //支付支付,返回首页 ut.m_toast('支付成功'); setTimeout(()=>{ - getApp().re_to("/pages/payment/pay_success/pay_success?type=1&order_sn=" + th.data.ok_order_sn); + getApp().re_to("/packageG/pages/payment/pay_success/pay_success?type=1&order_sn=" + th.data.ok_order_sn); },1000) }else{ @@ -1240,7 +1240,7 @@ Page({ //------支付成功页面-------- jumpPaymentPage: function (order_sn, order_amount) { wx.setStorageSync("order:order_list:update", !0), wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?order_sn=" + order_sn + "&type=1", + url: "/packageG/pages/payment/pay_success/pay_success?order_sn=" + order_sn + "&type=1", }); }, diff --git a/packageE/pages/togoin/togoin.js b/packageE/pages/togoin/togoin.js index a4d52c9..d1e92a2 100644 --- a/packageE/pages/togoin/togoin.js +++ b/packageE/pages/togoin/togoin.js @@ -96,6 +96,50 @@ Page({ this.save_the_data(r, e, sessionKey, openid) }, + //订阅消息提醒 + newsendsm: function (ee) { + if (!this.data.isAgree) { + wx.showToast({ + title: '请您先阅读和勾选指定的内容', + icon: 'none', + }); + return false; + } + let th = this; + var template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: [template_id], + success(res) { + th.bindGetUserInfo(ee); + }, + fail(res) { + th.bindGetUserInfo(ee); + } + }) + }, + //订阅消息提醒 + oldsendsm: function (ee) { + if (!this.data.isAgree) { + wx.showToast({ + title: '请您先阅读和勾选指定的内容', + icon: 'none', + }); + return false; + } + let th = this; + var template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: [template_id], + success(res) { + th.bindUserInfo(ee); + }, + fail(res) { + th.bindUserInfo(ee); + } + }) + }, //-- 会员授权 -- bindGetUserInfo: function (ee) { @@ -485,16 +529,51 @@ Page({ // 是否同意协议 isAgree(e) { - let isAgree = null; - if (e.detail.value[0]) { - isAgree = true; - } else { - isAgree = false; - }; - // this.data.isAgree = isAgree; - this.setData({ - isAgree, - }); + let template_id = this.data.template_id; + let that = this + let userinfo=getApp().globalData.userInfo; + + if (userinfo) { + let isAgree = null; + if (e.detail.value[0]) { + isAgree = true; + } else { + isAgree = false; + }; + // this.data.isAgree = isAgree; + this.setData({ + isAgree, + }); + }else{ + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: [template_id], + success(res) { + let isAgree = null; + if (e.detail.value[0]) { + isAgree = true; + } else { + isAgree = false; + }; + // this.data.isAgree = isAgree; + that.setData({ + isAgree, + }); + }, + fail(res) { + let isAgree = null; + if (e.detail.value[0]) { + isAgree = true; + } else { + isAgree = false; + }; + // this.data.isAgree = isAgree; + that.setData({ + isAgree, + }); + } + }) + } }, //弹出框的同意的优化 diff --git a/packageE/pages/user/labels/labels.js b/packageE/pages/user/labels/labels.js index af9a316..93db6f3 100644 --- a/packageE/pages/user/labels/labels.js +++ b/packageE/pages/user/labels/labels.js @@ -333,7 +333,7 @@ Page({ }) var url = "/api/weshop/marketing/holiday/vip/interest/label/update"; //更新标签接口地址 - var nav_url = "/pages/user/userinfo/userinfo"; //领取成功之后跳转页面 + var nav_url = "/packageG/pages/user/userinfo/userinfo"; //领取成功之后跳转页面 var my_confirm = th.selectComponent("#my_confirm"); //组件的id remark = "兴趣标签赠送"; diff --git a/packageE/pages/user/labels/labels.wxml b/packageE/pages/user/labels/labels.wxml index 8513599..fba2493 100644 --- a/packageE/pages/user/labels/labels.wxml +++ b/packageE/pages/user/labels/labels.wxml @@ -5,19 +5,18 @@ 兴趣标签 + - + 跳过 - - 关闭 - + + 关闭 + - - @@ -45,7 +44,7 @@ - + 保存 @@ -69,7 +68,7 @@ - + 提交修改 diff --git a/packageG/pages/goods/com_screen.js b/packageG/pages/goods/com_screen.js new file mode 100644 index 0000000..8c74aac --- /dev/null +++ b/packageG/pages/goods/com_screen.js @@ -0,0 +1,241 @@ +const ut = require("../../../utils/util.js"); +var regeneratorRuntime = require('../../../utils/runtime.js'); +var oo = getApp().globalData.setting; +module.exports = { + //下拉排序 + bind_pk_sort:function (e,th){ + var index=e.detail.value; + var ob=th.data.more_sort_arr[index]; + + var url = th.data.requestUrl; + if (th.data.tabname!=ob.value){ + + var txt='desc'; + if(ob.value=='sort') txt='asc' + th.setData({ tabname: ob.value, adname:txt }); + } + th.resetData(); + + //开始点击分类 + if(th.requestGoodsList) { + //-- 开始点击分类 -- + th.requestGoodsList(url); + }else if(th.requestSearch){ + //-- 重新开始搜索 -- + th.requestSearch(url); + } + + }, + + //-- 获取列表 -- + set_screen:async function (url,th){ + if(!url) url=th.data.requestUrl; + + var arr=url.split('1=1&'); + url='/api/weshop/goods/goodsBrandGroup?'+arr[1]; + + var screen_brand=null; + var screen_nation=null; + var screen_price=null; + var screen_cate=null; + //如果有分类的话 + if( th.data.cat_id && !th.data.screen_cate){ + var c_url="/api/weshop/goodscategory/get/"+oo.stoid+"/"+ th.data.cat_id; + var f_cate=null; + await getApp().request.promiseGet(c_url,{ + }).then(res=>{ + if(res.data.code==0 && res.data.data){ + f_cate=res.data.data; + } + }) + + //分类必须有parent_id_path值 + if(f_cate && f_cate['parent_id_path']){ + var new_arr=f_cate['parent_id_path'].split('_'); + c_url='/api/weshop/goodscategory/page?store_id='+oo.stoid+'&parent_id_path='+(new_arr[0]+"_"+new_arr['1']); + await getApp().request.promiseGet(c_url,{ + data:{level:2,pageSize:1000} + }).then(res=>{ + if(ut.ajax_ok(res) ){ + screen_cate=res.data.data.pageData.filter(function(e){ + return e.name + }); + } + }) + } + + } + + + if(url.indexOf('brand_id')==-1) { + var url1 = url + "&grouptype=1"; + await getApp().request.promiseGet(url1, { + data: {is_mainshow: 1, isonsale: 1, store_id: oo.stoid} + }).then(res => { + if (res.data.code == 0 && res.data.data && res.data.data.length) { + screen_brand = res.data.data.filter(function(e){ + return e.name + }); + } + }) + } + + if(url.indexOf('nation_id')==-1) { + url1 = url + "&grouptype=2"; + await getApp().request.promiseGet(url1, { + data: {is_mainshow: 1, isonsale: 1, store_id: oo.stoid} + }).then(res => { + if (res.data.code == 0 && res.data.data && res.data.data.length) { + screen_nation = res.data.data.filter(function(e){ + return e.name; + }); + } + }) + } + + + if(url.indexOf('startprice')==-1) { + url1 = url + "&grouptype=3"; + await getApp().request.promiseGet(url1, { + data: {is_mainshow: 1, isonsale: 1, store_id: oo.stoid} + }).then(res => { + if (res.data.code == 0 && res.data.data && res.data.data.length) { + var price = res.data.data; + var max_price = price[0].final_price; + var psize = Math.ceil(max_price / 5); // 每一段累积的价钱 + var parr = []; + for (var i = 0; i < 5; i++) { + var start = i * psize; + var end = start + psize; + // 如果没有这个价格范围的商品则不列出来 + var ii = false; + for (var v in price) { + var item_p = price[v]; + if (item_p.final_price > start && item_p.final_price <= end) { + ii = true; + } + } + if (ii == false) continue; + var obj = {}; + obj['price'] = start + "-" + end; + if (i == 0) obj['name'] = end + "元以下"; + else if (i == 4) obj['name'] = start + "元以上"; + else obj['name'] = start + "-" + end + '元'; + parr.push(obj) + } + screen_price = parr; + } + }) + } + + th.setData({screen_brand,screen_nation,screen_price,screen_cate}) + + }, + + + filterGoods:function (e,th){ + + var index=e.currentTarget.dataset.index; + var type=e.currentTarget.dataset.type; + var url=th.data.requestUrl; + + switch (type){ + case "1"://分类 + var item=th.data.screen_cate[index]; + if( th.data.cat_id){ + var arr_m=url.split("1=1&"); + var arr_m2=arr_m[1].split('&'); + var url=""; + for(var jj in arr_m2){ + if(arr_m2[jj].indexOf('cat_id')>=-1){ + url+="&cat_id="+item.id; + }else if(arr_m2[jj].indexOf('pid')>=-1){ + url+="&pid="+item.parent_id; + }else{ + url+="&"+arr_m2[jj]; + } + } + }else { + url+="&cat_id="+item.id+"&pid="+item.parent_id; + } + url=arr_m[0]+"1=1&"+url; + break; + case "2"://国别 + var item=th.data.screen_nation[index]; + url+="&nation_id="+item.nation_id; + break; + case "3"://品牌 + var item=th.data.screen_brand[index]; + url+="&brand_id="+item.brand_id; + break; + case "4"://价格 + var item=th.data.screen_price[index]; + var p_arr=item.price.split('-'); + url+="&startprice="+p_arr[0]+"&endprice="+p_arr[1]; + break; + } + + th.setData({screen_brand:null,screen_nation:null,openFilterModal:0,is_go:0, + screen_price:null,screen_cate:null,requestData:null}) + th.data.currentPage=1; + //进行筛选 + this.set_screen(url,th); + + th.setData({ + tabname:"sort", //排序的字段 + adname:"asc", //升降的字段 + }) + + //开始点击分类 + if(th.requestGoodsList) { + //-- 开始点击分类 -- + th.requestGoodsList(url); + }else if(th.requestSearch){ + //-- 重新开始搜索 -- + th.requestSearch(url); + } + }, + + //-- 展开和收起的控制 -- + open_more:function(e,th){ + var type=e.currentTarget.dataset.type; + switch(type){ + case "1": + if(th.data.fil_cate_state==0 || th.data.fil_cate_state==2) th.setData({fil_cate_state:1}) + else th.setData({fil_cate_state:2}) + break; + case "2": + if(th.data.fil_nation_state==0 || th.data.fil_nation_state==2) th.setData({fil_nation_state:1}) + else th.setData({fil_nation_state:2}) + break; + case "3": + if(th.data.fil_brand_state==0 || th.data.fil_brand_state==2) th.setData({fil_brand_state:1}) + else th.setData({fil_brand_state:2}) + break; + case "4": + if(th.data.fil_price_state==0 || th.data.fil_price_state==2) th.setData({fil_price_state:1}) + else th.setData({fil_price_state:2}) + break; + + } + }, + + clear_fil(th){ + var url=th.data.old_req_url; + th.setData({screen_brand:null,screen_nation:null,openFilterModal:0,is_go:0, + screen_price:null,screen_cate:null,requestData:null}) + th.data.currentPage=1; + + //进行筛选 + this.set_screen(url,th); + if(th.requestGoodsList) { + //-- 开始点击分类 -- + th.requestGoodsList(url); + }else if(th.requestSearch){ + //-- 重新开始搜索 -- + th.requestSearch(url); + } + } + + +} \ No newline at end of file diff --git a/packageG/pages/goods/com_screen.wxss b/packageG/pages/goods/com_screen.wxss new file mode 100644 index 0000000..7309f21 --- /dev/null +++ b/packageG/pages/goods/com_screen.wxss @@ -0,0 +1,79 @@ +/*--三角形的显示--*/ +.arrow_down,.arrow_up{ + width: 0px; + height: 0px; + font-size: 0; + line-height: 0; + border-right: 5px solid transparent; + border-left: 5px solid transparent; +} + +.arrow_down { + border-top: 5px solid #a5a5a5; margin-top: 4rpx; +} +.arrow_up{ + border-bottom: 5px solid #a5a5a5; +} + +.arrow_down.on{ + border-top: 5px solid #F4281C ; +} +.arrow_up.on{ + border-bottom: 5px solid #F4281C; +} + +.f_cate_item{ height:80rpx; display:flex; justify-content: space-between; align-items: center; border-bottom: 1rpx solid #dcdcdc;} + +.filter-items{ color: #666; overflow:hidden} +.filter-items.normal_to{ max-height: 260rpx} +.filter-items.back_to{ height: 0rpx} + +.up_ar{ transform: rotate(180deg)} +.fil_btn{ width: 47%; height:80rpx; border-radius:10rpx; display: flex; + justify-content:center; align-items: center; font-size:28rpx;color:#fff} +.fil_cancle{ background-color: #25c6fc } +.fil_sure{ background-color:#dd272c } + +.filter-modal { + position: fixed; + left: 150rpx; + top: 0; + right: 0; + bottom: 0; + z-index: 1120; + background-color: white; + overflow-x: hidden; +} + +.filter-box { + box-sizing: border-box; + width: 100%; + font-size: 28rpx; + padding: 20rpx; +} + +.filter-name { + width: 100%; + padding: 20rpx 0; + word-break: keep-all; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + font-size: 30rpx; +} + +.filter-item { + float: left; + width: fit-content; + max-width: 500rpx; + word-break: keep-all; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + padding: 10rpx; + border-radius: 10rpx; + border: 1rpx #ddd solid; + margin: 0 10rpx 10rpx 0; + background-color: #fdfdfd; + color: #666; +} \ No newline at end of file diff --git a/pages/goods/search/g_filter.wxs b/packageG/pages/goods/search/g_filter.wxs index c4f0f55..c4f0f55 100644 --- a/pages/goods/search/g_filter.wxs +++ b/packageG/pages/goods/search/g_filter.wxs diff --git a/pages/goods/search/search.js b/packageG/pages/goods/search/search.js index 4edb05c..b5778d4 100644 --- a/pages/goods/search/search.js +++ b/packageG/pages/goods/search/search.js @@ -2,7 +2,7 @@ var t = function (t) { return t && t.__esModule ? t : { default: t }; -}(require("../../../utils/LoadMore.js")), ut = require("../../../utils/util.js"), +}(require("../../../../utils/LoadMore.js")), ut = require("../../../../utils/util.js"), a = getApp(), e = new t.default(), rq = a.request, oo = a.globalData.setting; const com_fil = require("../com_screen.js"); diff --git a/pages/goods/search/search.json b/packageG/pages/goods/search/search.json index daca033..daca033 100644 --- a/pages/goods/search/search.json +++ b/packageG/pages/goods/search/search.json diff --git a/pages/goods/search/search.wxml b/packageG/pages/goods/search/search.wxml index 1b7c591..1b7c591 100644 --- a/pages/goods/search/search.wxml +++ b/packageG/pages/goods/search/search.wxml diff --git a/pages/goods/search/search.wxss b/packageG/pages/goods/search/search.wxss index 6f525a6..6f525a6 100644 --- a/pages/goods/search/search.wxss +++ b/packageG/pages/goods/search/search.wxss diff --git a/pages/payment/pay_success/pay_success.js b/packageG/pages/payment/pay_success/pay_success.js index 9a120e8..2dfcc15 100644 --- a/pages/payment/pay_success/pay_success.js +++ b/packageG/pages/payment/pay_success/pay_success.js @@ -1,6 +1,6 @@ var e = getApp(); -var regeneratorRuntime = require('../../../utils/runtime.js'); -var ut = require("../../../utils/util.js"); +var regeneratorRuntime = require('../../../../utils/runtime.js'); +var ut = require("../../../../utils/util.js"); Page({ /** * 页面的初始数据 diff --git a/pages/payment/pay_success/pay_success.json b/packageG/pages/payment/pay_success/pay_success.json index 3d262cb..3d262cb 100644 --- a/pages/payment/pay_success/pay_success.json +++ b/packageG/pages/payment/pay_success/pay_success.json diff --git a/pages/payment/pay_success/pay_success.wxml b/packageG/pages/payment/pay_success/pay_success.wxml index f38426d..671c153 100644 --- a/pages/payment/pay_success/pay_success.wxml +++ b/packageG/pages/payment/pay_success/pay_success.wxml @@ -1,4 +1,4 @@ - + diff --git a/pages/payment/pay_success/pay_success.wxss b/packageG/pages/payment/pay_success/pay_success.wxss index eb7a55a..eb7a55a 100644 --- a/pages/payment/pay_success/pay_success.wxss +++ b/packageG/pages/payment/pay_success/pay_success.wxss diff --git a/pages/user/my_service/appment_main.js b/packageG/pages/user/my_service/appment_main.js index afe043e..034182c 100644 --- a/pages/user/my_service/appment_main.js +++ b/packageG/pages/user/my_service/appment_main.js @@ -34,7 +34,7 @@ Page({ is_success: 0, //是否提交成功 remarks: "", //备注 storageId: "", //线下门店id - url: "/pages/user/my_service/appment_main", //本页面地址路径用于选择时间页面跳转回来 + url: "/packageG/pages/user/my_service/appment_main", //本页面地址路径用于选择时间页面跳转回来 buyType: "", //项目类型 time: "", //选择预约时间 tment_count: "", //可预约人数 @@ -517,7 +517,7 @@ Page({ is_textea: 1 }) wx.navigateTo({ - url: "/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id + url: "/packageG/pages/user/my_service/cosmetology_list?" + 'storageId=' + storageId + '&' + 'itemId=' + itemId + '&' + "projectId=" + project_id }); } diff --git a/pages/user/my_service/appment_main.json b/packageG/pages/user/my_service/appment_main.json index 104895a..104895a 100644 --- a/pages/user/my_service/appment_main.json +++ b/packageG/pages/user/my_service/appment_main.json diff --git a/pages/user/my_service/appment_main.wxml b/packageG/pages/user/my_service/appment_main.wxml index 788e683..3fbd1d9 100644 --- a/pages/user/my_service/appment_main.wxml +++ b/packageG/pages/user/my_service/appment_main.wxml @@ -1,4 +1,4 @@ - + @@ -55,7 +55,7 @@ - + {{time==""?'选择时间':time}} @@ -84,7 +84,7 @@ - + 我的预约 diff --git a/pages/user/my_service/appment_main.wxss b/packageG/pages/user/my_service/appment_main.wxss index ba5d2c1..ba5d2c1 100644 --- a/pages/user/my_service/appment_main.wxss +++ b/packageG/pages/user/my_service/appment_main.wxss diff --git a/pages/user/my_service/beauty_deta.js b/packageG/pages/user/my_service/beauty_deta.js index d49c9c3..d49c9c3 100644 --- a/pages/user/my_service/beauty_deta.js +++ b/packageG/pages/user/my_service/beauty_deta.js diff --git a/pages/user/my_service/beauty_deta.json b/packageG/pages/user/my_service/beauty_deta.json index 710a83b..710a83b 100644 --- a/pages/user/my_service/beauty_deta.json +++ b/packageG/pages/user/my_service/beauty_deta.json diff --git a/pages/user/my_service/beauty_deta.wxml b/packageG/pages/user/my_service/beauty_deta.wxml index 57591e4..57591e4 100644 --- a/pages/user/my_service/beauty_deta.wxml +++ b/packageG/pages/user/my_service/beauty_deta.wxml diff --git a/pages/user/my_service/beauty_deta.wxss b/packageG/pages/user/my_service/beauty_deta.wxss index 09fc465..09fc465 100644 --- a/pages/user/my_service/beauty_deta.wxss +++ b/packageG/pages/user/my_service/beauty_deta.wxss diff --git a/pages/user/my_service/cosmetology_list.js b/packageG/pages/user/my_service/cosmetology_list.js index 5d71119..5d71119 100644 --- a/pages/user/my_service/cosmetology_list.js +++ b/packageG/pages/user/my_service/cosmetology_list.js diff --git a/pages/user/my_service/cosmetology_list.json b/packageG/pages/user/my_service/cosmetology_list.json index 90bf58b..90bf58b 100644 --- a/pages/user/my_service/cosmetology_list.json +++ b/packageG/pages/user/my_service/cosmetology_list.json diff --git a/pages/user/my_service/cosmetology_list.wxml b/packageG/pages/user/my_service/cosmetology_list.wxml index 66049b0..403789f 100644 --- a/pages/user/my_service/cosmetology_list.wxml +++ b/packageG/pages/user/my_service/cosmetology_list.wxml @@ -27,7 +27,7 @@ - + 预约 diff --git a/pages/user/my_service/cosmetology_list.wxss b/packageG/pages/user/my_service/cosmetology_list.wxss index 4a8fb7b..4a8fb7b 100644 --- a/pages/user/my_service/cosmetology_list.wxss +++ b/packageG/pages/user/my_service/cosmetology_list.wxss diff --git a/pages/user/my_service/tment_order_list.js b/packageG/pages/user/my_service/tment_order_list.js index 8ad4b7f..8ad4b7f 100644 --- a/pages/user/my_service/tment_order_list.js +++ b/packageG/pages/user/my_service/tment_order_list.js diff --git a/pages/user/my_service/tment_order_list.json b/packageG/pages/user/my_service/tment_order_list.json index 2dcefce..2dcefce 100644 --- a/pages/user/my_service/tment_order_list.json +++ b/packageG/pages/user/my_service/tment_order_list.json diff --git a/pages/user/my_service/tment_order_list.wxml b/packageG/pages/user/my_service/tment_order_list.wxml index 43df4a9..91ed5cf 100644 --- a/pages/user/my_service/tment_order_list.wxml +++ b/packageG/pages/user/my_service/tment_order_list.wxml @@ -70,9 +70,9 @@ 查看详情 - 更改时间 + 更改时间 发表评价 - 重新预约 + 重新预约 评价详情 diff --git a/pages/user/my_service/tment_order_list.wxss b/packageG/pages/user/my_service/tment_order_list.wxss index 2219dee..2219dee 100644 --- a/pages/user/my_service/tment_order_list.wxss +++ b/packageG/pages/user/my_service/tment_order_list.wxss diff --git a/pages/user/userinfo/userinfo.js b/packageG/pages/user/userinfo/userinfo.js index 0f1a4a6..1773a31 100644 --- a/pages/user/userinfo/userinfo.js +++ b/packageG/pages/user/userinfo/userinfo.js @@ -10,8 +10,8 @@ function e(e, a, r) { var a = getApp(), r = a.globalData.setting, t = a.request, - s = require("../../../utils/common.js"), - util = require("../../../utils/util.js"), + s = require("../../../../utils/common.js"), + util = require("../../../../utils/util.js"), ut = util, d = getApp().globalData; @@ -20,7 +20,7 @@ var date = new Date(timestamp); const { barcode, qrcode -} = require('../../../utils/index.js'); +} = require('../../../../utils/index.js'); Page({ data: { diff --git a/pages/user/userinfo/userinfo.json b/packageG/pages/user/userinfo/userinfo.json index 9a57847..9a57847 100644 --- a/pages/user/userinfo/userinfo.json +++ b/packageG/pages/user/userinfo/userinfo.json diff --git a/pages/user/userinfo/userinfo.wxml b/packageG/pages/user/userinfo/userinfo.wxml index f275f8f..8e92f9a 100644 --- a/pages/user/userinfo/userinfo.wxml +++ b/packageG/pages/user/userinfo/userinfo.wxml @@ -1,4 +1,4 @@ - + diff --git a/pages/user/userinfo/userinfo.wxss b/packageG/pages/user/userinfo/userinfo.wxss index 8d60f47..8d60f47 100644 --- a/pages/user/userinfo/userinfo.wxss +++ b/packageG/pages/user/userinfo/userinfo.wxss diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index c0377af..df45ee2 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -729,7 +729,7 @@ Page({ goseach: function () { wx.navigateTo({ - url: "/pages/goods/search/search" + url: "/packageG/pages/goods/search/search" }); }, @@ -876,7 +876,7 @@ Page({ success: (res) => { var result = res.result; wx.navigateTo({ - url: "/pages/goods/search/search?s_key=" + result, + url: "/packageG/pages/goods/search/search?s_key=" + result, }); } }) diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index 732ba79..2af60b2 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -13,7 +13,7 @@ var t = require("../../../utils/util.js"), var wxlog = require("../../../utils/wxlog.js"); let self = null; -//评价加载更多 +//评价加载更多 var more = function (e) { return e && e.__esModule ? e : { default: e @@ -284,11 +284,11 @@ Page({ nav_type: 2, //导航类型 istop: 0, //是否置顶风格为1 searchbox_transparent: 1, - + template_id:[],//订阅消息id }, //------初始化加载---------- - onLoad: function (t) { + onLoad: async function (t) { var ee = this, that = ee, th = ee, @@ -553,6 +553,12 @@ Page({ } }); + try { + let template_id =await getApp().get_template_id('1023') + this.setData({ + template_id + }) + } catch (error) {} }, @@ -3902,6 +3908,7 @@ Page({ }, 800) } else { setTimeout(function () { + th.deal_pickup(e); //--普通门店排版-- }, 800) } @@ -4257,6 +4264,7 @@ Page({ //------------处理线下门店库存-------- deal_pickup_dline(e) { + var pkno = [], th = this; if (!th.data.sele_g){ @@ -4450,7 +4458,7 @@ Page({ if (iu.CanOutQty <= 0) iu.is_no_qyt = 1; } - + //---把数组组装进去--- th.deal_pickup(em); @@ -5371,7 +5379,21 @@ Page({ pd_xx: 0, }) }, - + //天天拼团订阅消息提醒 + sendsm: function (ee) { + let th = this; + var template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: template_id, + success(res) { + th.openSpecModel_pt(ee); + }, + fail(res) { + th.openSpecModel_pt(ee); + } + }) + }, //--点击弹起拼单-- openSpecModel_pt:function (e) { @@ -8426,7 +8448,7 @@ Page({ img = th.data.iurl + th.data.prom_act.share_imgurl; } let user_id = getApp().globalData.user_id - console.error(img); + return { title: this.data.data.goods_name + '-' + store_name, // imageUrl: this.data.gallery[0].image_url, diff --git a/pages/goods/goodsInfo/goodsInfo.wxml b/pages/goods/goodsInfo/goodsInfo.wxml index 274ba8d..a11ce83 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxml +++ b/pages/goods/goodsInfo/goodsInfo.wxml @@ -11,7 +11,7 @@ - + @@ -1187,12 +1187,12 @@ - + ¥{{prom_act.price}} 去参团 - + 一键开团 @@ -1210,7 +1210,7 @@ - + ¥{{filters.toFix(prom_act.yf_price,2)}} 支付定金 diff --git a/pages/goods/goodsInfo/goodsInfo.wxss b/pages/goods/goodsInfo/goodsInfo.wxss index be8fae9..79c63de 100644 --- a/pages/goods/goodsInfo/goodsInfo.wxss +++ b/pages/goods/goodsInfo/goodsInfo.wxss @@ -1,4 +1,4 @@ -@import "../../../utils/wxParse/wxParse.wxss"; +@import "../../../utils/wxParse/wxParse.wxss"; .container { margin-bottom: 100rpx; diff --git a/pages/goods/goodsList/goodsList.js b/pages/goods/goodsList/goodsList.js index d75dec2..206976b 100644 --- a/pages/goods/goodsList/goodsList.js +++ b/pages/goods/goodsList/goodsList.js @@ -6,7 +6,7 @@ var regeneratorRuntime = require('../../../utils/runtime.js'); var com_fil= require('../com_screen.js'); -Page({ +Page({ data: { url: e.globalData.setting.imghost, resourceUrl: e.globalData.setting.resourceUrl, @@ -44,6 +44,7 @@ Page({ limit_num:0, gr_fir:0, //分组第一次 share_imgurl:'', //分享图片 + add_purchase:false, }, onLoad: function(t) { @@ -601,7 +602,29 @@ Page({ open_more(e){ com_fil.open_more(e,this); }, clear_fil(){ //清空 this.data.gr_fir=0;com_fil.clear_fil(this); - } + }, + // 加购方法show + addPurchase(even){ + this.setData({ + add_purchase:true + }) + let gid = even.currentTarget.dataset.gid + let prom_id = even.currentTarget.dataset.prom_id + let prom_type = even.currentTarget.dataset.prom_type + let goods_type= even.currentTarget.dataset.goods_type + let add_purchase = this.selectComponent("#add_purchase"); + if (add_purchase) { + add_purchase.init(gid,prom_type,prom_id,goods_type) + } + }, + // 加购方法 hide + hide_add_purchase(){ + setTimeout(()=>{ + this.setData({ + add_purchase:false + }) + },1000) + } }); \ No newline at end of file diff --git a/pages/goods/goodsList/goodsList.json b/pages/goods/goodsList/goodsList.json index 67f1f66..bb0f81f 100644 --- a/pages/goods/goodsList/goodsList.json +++ b/pages/goods/goodsList/goodsList.json @@ -2,6 +2,7 @@ "backgroundTextStyle": "dark", "navigationBarTitleText": "商品列表", "usingComponents": { - "share_box": "/components/share_box/share_box" + "share_box": "/components/share_box/share_box", + "add_purchase": "/components/add_purchase/add_purchase" } -} \ No newline at end of file +} \ No newline at end of file diff --git a/pages/goods/goodsList/goodsList.wxml b/pages/goods/goodsList/goodsList.wxml index fa34472..dfece13 100644 --- a/pages/goods/goodsList/goodsList.wxml +++ b/pages/goods/goodsList/goodsList.wxml @@ -1,86 +1,87 @@ - + + - 每人限参与{{limit_num}}次; - - - 满{{item.condition}} - 减{{item.content.money}}元 - 包邮 - 打{{item.content.sale}}折 - 送{{item.content.int}}积分 - 送{{item.content.coupon_money}}元优惠券 - 送{{item.content.zp_mode==1?'多赠品':item.content.gift_name}} - 送{{item.content.lb_name}} - 送{{item.content.zxlb_name}} - 送{{item.content.monthgift_name}} - - - - - 阶梯促销:{{jieti_prom}} + 每人限参与{{limit_num}}次; + + + 满{{item.condition}} + 减{{item.content.money}}元 + 包邮 + 打{{item.content.sale}}折 + 送{{item.content.int}}积分 + 送{{item.content.coupon_money}}元优惠券 + 送{{item.content.zp_mode==1?'多赠品':item.content.gift_name}} + 送{{item.content.lb_name}} + 送{{item.content.zxlb_name}} + 送{{item.content.monthgift_name}} + + + + + 阶梯促销:{{jieti_prom}} - - - - 请输入商品关键字 - - - - - - - - - - - - 新品 - 评论 - 综合 - - - - - - - - - - 筛选 - - - - - + + 请输入商品关键字 + + + + + + + + + + + + 新品 + 评论 + 综合 + + + + + + + + + + 筛选 + + + + + - - - - + + + + @@ -89,24 +90,142 @@ {{item.goods_name}} - - - - {{item.prom_integral}}积分 - + - {{item.prom_price}} - - {{item.market_price}} - - - + + + + {{item.prom_integral}}积分 + + + {{item.prom_price}} + + {{item.market_price}} + + + + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + + + + + + + {{item[card_field]}} + + + {{card_name}} + + + + {{item.market_price}} + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + {{item.shop_price}} + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + + + {{item.shop_price}} + {{item.market_price}} + + + + {{g_filter.get_card_price(item,card_list,0)}} + + + {{g_filter.get_card_price(item,card_list,1)}} + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + {{item.shop_price}} + {{item.market_price}} + + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + + + {{item.shop_price}} + {{item.market_price}} + + - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + + + + + + + + + + + + + + {{item.goods_name}} + + + + + + {{item.prom_integral}}积分 + + + {{item.prom_price}} + + {{item.market_price}} + + + + + + + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + @@ -125,19 +244,19 @@ {{item.market_price}} - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + {{item.shop_price}} - + {{item.market_price}} - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + @@ -156,176 +275,73 @@ - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + - - {{item.shop_price}} - {{item.market_price}} - + + {{item.shop_price}} + {{item.market_price}} + - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + - - {{item.shop_price}} - {{item.market_price}} - - + + {{item.shop_price}} + {{item.market_price}} + - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - + 评论{{item.comment_count}} + 已售{{item.sales_sum}} + + + + + - - - - - - - - - - {{item.goods_name}} - - - - - - {{item.prom_integral}}积分 - + - {{item.prom_price}} - - {{item.market_price}} - - - - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - - - - - - - {{item[card_field]}} - - - {{card_name}} - - - - {{item.market_price}} - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - {{item.shop_price}} - - {{item.market_price}} - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - - - {{item.shop_price}} - {{item.market_price}} - - - - {{g_filter.get_card_price(item,card_list,0)}} - - - {{g_filter.get_card_price(item,card_list,1)}} - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - {{item.shop_price}} - {{item.market_price}} - - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - - - {{item.shop_price}} - {{item.market_price}} - - - - 评论{{item.comment_count}} - 已售{{item.sales_sum}} - - - - - - - - - - - - - - - 暂无相关商品 - 回到首页 - + + + + + + + 暂无相关商品 + 回到首页 + + + - - - {{err_txt}} - 回到首页 - - \ No newline at end of file + + + {{err_txt}} + 回到首页 + + + + + + + + + + diff --git a/pages/goods/goodsList/goodsList.wxss b/pages/goods/goodsList/goodsList.wxss index b0752a8..797d93f 100644 --- a/pages/goods/goodsList/goodsList.wxss +++ b/pages/goods/goodsList/goodsList.wxss @@ -48,7 +48,7 @@ page { top: 0; /* width: 95%; */ background-color: #f0f0f0; - z-index: 999; + z-index: 11; } .nav-box { @@ -56,7 +56,7 @@ page { top: 114rpx; /* width: 95%; */ background-color: #f0f0f0; - z-index: 999; + z-index: 11; } .ico-dir { @@ -294,5 +294,20 @@ page { color: white; padding: 20rpx 50rpx; } - +.gicon{ + position: absolute; + right: 20rpx; + top: 0; + bottom: 0; + display: flex; + align-items: center; +} +.gicon2{ + position: absolute; + right: 20rpx; + top: 0; + bottom: 0; + display: flex; + align-items: center; +} @import '../com_screen.wxss'; \ No newline at end of file diff --git a/pages/index/index/index.js b/pages/index/index/index.js index f016df5..fa22e1b 100644 --- a/pages/index/index/index.js +++ b/pages/index/index/index.js @@ -932,7 +932,7 @@ Page({ }, jumpSearch: function () { wx.navigateTo({ - url: "/pages/goods/search/search" + url: "/packageG/pages/goods/search/search" }); }, onShareAppMessage: function (e) { @@ -1149,7 +1149,7 @@ Page({ success: (res) => { var result = res.result; wx.navigateTo({ - url: "/pages/goods/search/search?s_key=" + result, + url: "/packageG/pages/goods/search/search?s_key=" + result, }); } }) diff --git a/pages/index/index/index.json b/pages/index/index/index.json index 0c4fc61..beea52d 100644 --- a/pages/index/index/index.json +++ b/pages/index/index/index.json @@ -25,7 +25,8 @@ "serviceCard": "/components/diy_serviceCard/diy_serviceCard", "live": "/components/diy_live/diy_live", "mp-dialog": "weui-miniprogram/dialog/dialog", - "mp-sticky": "/components/mp-sticky/mp-sticky", + "mp-sticky": "/components/mp-sticky/mp-sticky", + "floatingWindow": "/components/diy_floatingWindow/diy_floatingWindow", "privacy_pop": "/components/privacy_pop/privacy_pop" }, "enablePullDownRefresh": false, diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index 811f2fa..ab92bd5 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -495,6 +495,10 @@ + + + + diff --git a/pages/order/refund_order/refund_order.js b/pages/order/refund_order/refund_order.js index fce99ad..266dcc4 100644 --- a/pages/order/refund_order/refund_order.js +++ b/pages/order/refund_order/refund_order.js @@ -15,9 +15,10 @@ Page({ reasonSelect: 0, reasonList: [ "没有收到货", "不喜欢/不想要", "个人原因拍错/漏拍", "空包裹", "未按照约定时间发货", "快递/物流未送达", "快递/物流无跟踪记录", "发错快递", "商品破损", "商品尺寸规格不符", "商品质量差,与网上描述不符", "其他原因" ], refund_type:0, - isloading:0, + isloading:0, + template_id:[], }, - onLoad: function(t) { + onLoad: async function(t) { var th=this; getApp().getConfig2(function (em) { @@ -53,8 +54,30 @@ Page({ }) }); }) + try { + let template_id =await getApp().get_template_id('1025') + this.setData({ + template_id + }) + } catch (error) {} }, - + //订阅消息提醒 + sendsm: function (ee) { + let th = this; + var template_id = this.data.template_id; + console.error('退款'); + console.error(template_id); + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: template_id, + success(res) { + th.refundOrder(ee); + }, + fail(res) { + th.refundOrder(ee); + } + }) + }, //------提交退款申请------- refundOrder: function(e) { //if(!this.data.back_money){ diff --git a/pages/order/refund_order/refund_order.wxml b/pages/order/refund_order/refund_order.wxml index 4e53dce..0b46269 100644 --- a/pages/order/refund_order/refund_order.wxml +++ b/pages/order/refund_order/refund_order.wxml @@ -8,7 +8,7 @@ 3.支付金额,抵扣余额积分都按原路退款 4.订单一旦取消,无法恢复 - + 退款原因: {{reasonList[reasonSelect]}} diff --git a/pages/team/team_show/team_show.js b/pages/team/team_show/team_show.js index c37d922..1281fa6 100644 --- a/pages/team/team_show/team_show.js +++ b/pages/team/team_show/team_show.js @@ -91,9 +91,9 @@ Page({ sort_store: 0, //门店分类 choice_sort_store: 0, //选择分类门店 - + template_id:[],//订阅消息id }, - onLoad: function(options) { + onLoad: async function(options) { wx.setNavigationBarTitle({ title: "拼团订单",}) //var postdata=getApp().globalData.to_group; var postdata=options; @@ -139,7 +139,13 @@ Page({ th.setData({ bconfig: e,sys_switch:json_d}); th.wait_for_store_config(); //获取默认的门店 }) - + try { + let template_id =await getApp().get_template_id('1023') + this.setData({ + template_id + }) + } catch (error) {} + }, //显示加载 @@ -164,7 +170,21 @@ Page({ close_pt_xx: function() { this.setData({ pd_xx: false, }) }, - + //天天拼团订阅消息提醒 + sendsm: function (ee) { + let th = this; + var template_id = this.data.template_id; + // //授权订阅 + wx.requestSubscribeMessage({ + tmplIds: template_id, + success(res) { + th.cyijian(ee); + }, + fail(res) { + th.cyijian(ee); + } + }) + }, //按钮点击一键参加团按钮 cyijian: function(e) { //--先判断会员状态-- diff --git a/pages/team/team_show/team_show.wxml b/pages/team/team_show/team_show.wxml index fa6c676..7f4f542 100644 --- a/pages/team/team_show/team_show.wxml +++ b/pages/team/team_show/team_show.wxml @@ -105,14 +105,14 @@ - 去参团 + 去参团 返回首页 - + 一键参团 返回首页 - + 一键参团 返回首页 diff --git a/pages/template/index.json b/pages/template/index.json index 10882a3..965356a 100644 --- a/pages/template/index.json +++ b/pages/template/index.json @@ -21,7 +21,8 @@ "picMax": "/components/diy_picMax/diy_picMax", "mvideo": "/components/diy_video/diy_video", "service": "/components/diy_service/diy_service", - "scan": "/components/diy_scan/diy_scan", + "scan": "/components/diy_scan/diy_scan", + "floatingWindow": "/components/diy_floatingWindow/diy_floatingWindow", "presell": "/components/diy_pregoods/diy_pregoods" }, "enablePullDownRefresh": false, diff --git a/pages/template/index.wxml b/pages/template/index.wxml index 082b61e..b6fc754 100644 --- a/pages/template/index.wxml +++ b/pages/template/index.wxml @@ -58,6 +58,10 @@ + + + + diff --git a/pages/user/index/index.js b/pages/user/index/index.js index 7f7c037..d005bde 100644 --- a/pages/user/index/index.js +++ b/pages/user/index/index.js @@ -916,7 +916,7 @@ Page({ go_info: function () { - getApp().goto("/pages/user/userinfo/userinfo"); + getApp().goto("/packageG/pages/user/userinfo/userinfo"); }, jump: function () { diff --git a/pages/user/my_service/hist_service.wxml b/pages/user/my_service/hist_service.wxml index 0ad282f..1bb31ce 100644 --- a/pages/user/my_service/hist_service.wxml +++ b/pages/user/my_service/hist_service.wxml @@ -40,7 +40,7 @@ - + 未服务 更改时间 diff --git a/pages/user/my_service/i_service.wxml b/pages/user/my_service/i_service.wxml index 642b41e..d82ddcc 100644 --- a/pages/user/my_service/i_service.wxml +++ b/pages/user/my_service/i_service.wxml @@ -56,7 +56,7 @@ 立即使用 - + 预约 diff --git a/pages/user/my_service/tment_details.wxml b/pages/user/my_service/tment_details.wxml index bc3eed6..d0a5955 100644 --- a/pages/user/my_service/tment_details.wxml +++ b/pages/user/my_service/tment_details.wxml @@ -97,11 +97,11 @@ 取消预约 - + 我的服务 - + 更改时间 @@ -110,7 +110,7 @@ 查看评价 - + 重新预约 diff --git a/pages/user/my_service/tment_eval.js b/pages/user/my_service/tment_eval.js index 3c60c6a..00abb22 100644 --- a/pages/user/my_service/tment_eval.js +++ b/pages/user/my_service/tment_eval.js @@ -241,7 +241,7 @@ Page({ evaluate_qt:function(){ wx.redirectTo({ - url: "/pages/user/my_service/tment_order_list?state="+2 + url: "/packageG/pages/user/my_service/tment_order_list?state="+2 }); }, //点击领取礼包 diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js index f223af5..9c83899 100644 --- a/pages/user/order_list/order_list.js +++ b/pages/user/order_list/order_list.js @@ -3269,7 +3269,7 @@ Page({ console.log(n), getApp().showSuccess("支付成功!"); "function" == typeof success && success(); wx.redirectTo({ - url: "/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, + url: "/packageG/pages/payment/pay_success/pay_success?card=1&order_id=" + order_id, }); }, fail: function (n) { diff --git a/utils/filter.wxs b/utils/filter.wxs index a3f3eb5..e2952c4 100644 --- a/utils/filter.wxs +++ b/utils/filter.wxs @@ -265,10 +265,22 @@ var filters = { endDate = filters.format_time2(getDate(startDate).getTime() + days); return startDate + '至' + endDate; }; - }, + }, + //判断加购按钮是否显示 + has_add_goods:function(type){ + var hide_add_goods=[4,6,8,9] //不显示加购按钮的活动 + var off = true + for (var index = 0; index < hide_add_goods.length; index++) { + if (hide_add_goods[index] === type) { + off = false + } + } + return off + } }; module.exports = { + has_add_goods:filters.has_add_goods, toFix: filters.toFix, replace_time: filters.replace_time, replace_time2: filters.replace_time2,