diff --git a/app.js b/app.js
index 823a0e6..e3c09a5 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..d96d9ae 100644
--- a/app.json
+++ b/app.json
@@ -5,41 +5,25 @@
"pages/cart/cart/cart",
"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/goods/goodsList/goodsList",
"pages/user/index/index",
"pages/user/order_list/order_list",
- "pages/user/order_detail/order_detail",
- "pages/user/userinfo/userinfo",
+ "pages/user/order_detail/order_detail",
"pages/user/coupon/coupon",
- "pages/user/checkcoupon/checkcoupon",
-
+ "pages/user/checkcoupon/checkcoupon",
"pages/activity/seckill_list/seckill_list",
- "pages/activity/pind_list/pind_list",
-
+ "pages/activity/pind_list/pind_list",
"pages/team/team_show/team_show",
-
"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",
"pages/giftpack/payment/payment",
"pages/giftpack/buygiftpack/giftpackbuy",
"pages/giftpack/giftpacklist/giftpacklist",
-
"pages/giftpack/mygiftpack/mygiftpack",
"pages/user/assistance/giftpacklist",
"pages/user/assistance/task_assistance",
@@ -47,8 +31,6 @@
"pages/user/assistance/assistance_success",
"pages/user/assistance/assistance",
"pages/giftpack/festival/festival",
-
-
"pages/distribution/distribution",
"pages/template/index"
],
@@ -213,9 +195,9 @@
"pages/user/monthgiftbag/giftpacklist/giftpacklist",
"pages/user/monthgiftbag/giftpackinfo/giftpackinfo",
"pages/user/monthgiftbag/giftpackbuy/giftpackbuy",
- "pages/cart/cart2_inte/cart2_inte",
"pages/cart/cart2_pt/cart2_pt",
- "pages/cart/cart_wk/cart_wk"
+ "pages/cart/cart_wk/cart_wk",
+ "pages/cart/cart2_inte/cart2_inte"
]
},
@@ -243,7 +225,19 @@
"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",
+ "pages/user/my_service/hist_service",
+ "pages/order/refund_order/refund_order",
+ "pages/payment/payment/payment",
+ "pages/user/my_service/tment_details",
+ "pages/user/my_service/tment_eval"
]
}
],
diff --git a/app.wxss b/app.wxss
index c67a2f4..435920f 100644
--- a/app.wxss
+++ b/app.wxss
@@ -1211,6 +1211,11 @@ background: #ffe3e2;
content: "\e618";
}
+.icon-weixin:before {
+ content: "\e677";
+}
+
+
/* 去掉零售价划线 */
.no_line_x{
text-decoration: none !important;
diff --git a/components/add_purchase/add_purchase.js b/components/add_purchase/add_purchase.js
new file mode 100644
index 0000000..88c941b
--- /dev/null
+++ b/components/add_purchase/add_purchase.js
@@ -0,0 +1,5261 @@
+// 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()
+ // console.error('加购组件');
+ // 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);
+ },
+ initbef: function () {
+ // this.clearTime()
+ console.error('加购组件');
+ 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);
+ },
+ init(gid, prom_type, prom_id, goods_type = 0, iscart = 0, cartid = 0) {
+ this.initbef()
+ // 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: '加载中.',
+ mask:true
+ });
+ //----------获取门店----------------
+ 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..023b9f2
--- /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}}
+
+
+
+
+
+
+
+
+ 商品规格
+
+
+
+
+ {{item.gg}}
+
+
+
+
+ {{item.gg}}
+
+
+
+
+
+ 购买数量
+
+
+ -
+
+
+ +
+
+
+
+
+ 再买{{hui_condition.need}}
+ ,免{{hui_condition.money}}元
+ ,打{{hui_condition.sale}}折
+ ,包邮
+ ,送{{hui_condition.intValue}}积分
+ ,送优惠券
+ ,送赠品
+ ,送礼包
+ ,送专享礼包
+ ,送每月礼包
+
+
+
+
+
+
+ 配送不匹配
+
+
+ 该店不可售
+
+
+ 该店不可售
+
+
+ 该店不可售
+
+
+
+
+
+ 库存不足
+
+
+
+
+
+ 库存不足
+
+
+
+
+
+ 库存不足
+
+
+
+
+
+ 请先选择门店
+
+
+
+
+
+
+
+
+
+ 库存不足
+
+
+
+
+ 加入购物车
+
+
+ {{sele_g.offline_price?"券后购买":"立即购买"}}
+
+
+
+
+
+
+
+
+ 已抢光
+
+
+
+
+ 库存不足
+
+
+
+
+ 加入购物车
+
+
+ {{sele_g.offline_price?"券后购买":"立即购买"}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择门店
+
+
+
+
+
+ {{item.name}}
+
+
+
+
+ {{item.pickup_name}}
+
+
+
+
+
+
+ {{sec_sto.name}}
+
+
+
+ {{item.pickup_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/diy_top_nav/diy_top_nav.js b/components/diy_top_nav/diy_top_nav.js
new file mode 100644
index 0000000..8700664
--- /dev/null
+++ b/components/diy_top_nav/diy_top_nav.js
@@ -0,0 +1,143 @@
+// components/diy_top_nav/diy_top_nav.js
+const app = getApp();
+var os = app.globalData.setting;
+Component({
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ nav_type:{
+ type:Number,
+ value:0,
+ },
+ istop:{
+ type:Number,
+ value:0,
+ },
+ nav_title:{
+ type:String,
+ value:'首页',
+ },
+ nav_frontColor:{
+ type:String,
+ value:'#ffffff',
+ },
+ nav_backgroundColor:{
+ type:String,
+ value:'#ff7295',
+ },
+ is_share:{
+ type:Boolean,
+ value:true
+ }
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ imghots: os.imghost,
+ nav_h:0, //导航胶囊上面状态栏的高度
+ mentButt_h:0,//导航胶囊高度
+ navleft_pb:0, //导航左边的自定义内容的左右内边距
+ nav_left_w:281, // 导航左边自定义的内容宽度
+ navleft_w:0, //左边胶囊宽度
+ nav_pb:0, // 导航的下内边距
+ show_menu:false,//详情页导航下拉菜单显示
+ men_list:[
+ {
+ name:'首页',
+ img:'miniapp/js_img/goods_info/home.png?v=3',
+ url:'/pages/index/index/index'
+ },
+ {
+ name:'我的订单',
+ img:'miniapp/js_img/goods_info/order.png?v=3',
+ url:'/pages/user/order_list/order_list'
+ },
+ {
+ name:'我的收藏',
+ img:'miniapp/js_img/goods_info/collect.png?v=3',
+ url:'/packageB/pages/user/collect_list/collect_list'
+ },
+ // {
+ // name:'浏览足迹',
+ // img:'',
+ // url:''
+ // },
+ ]
+ },
+ lifetimes:{
+ attached:function(){
+ //满屏顶部导航参数获取-----------
+ try {
+ let systemInfo = wx.getSystemInfoSync()
+ let mentButt = wx.getMenuButtonBoundingClientRect()
+ let nav_pb = mentButt.top - systemInfo.statusBarHeight
+ let navleft_pb = systemInfo.windowWidth - mentButt.right
+
+ let user_no='';
+ if(getApp().globalData.userInfo){
+ user_no=getApp().globalData.userInfo.erpvipno
+ }
+
+ this.setData({
+ nav_h:mentButt.top,
+ mentButt_h:mentButt.height,
+ nav_left_w:mentButt.left,
+ navleft_pb,
+ nav_pb,
+ navleft_w:mentButt.width*0.9,
+ user_no
+ })
+ } catch (e) {
+ console.error(e);
+ wx.showToast({
+ title: '系统参数获取失败',
+ icon: 'none',
+ duration: 2000
+ })
+ // this.setData({
+ // is_full_screen_navigation:false
+ // })
+ // Do something when catch error
+ }
+ }
+ },
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ nav_menu(e){
+ let url=e.currentTarget.dataset.url
+ getApp().goto(url)
+ },
+ show_menu_fn(){
+ this.setData({
+ show_menu:!this.data.show_menu
+ })
+ },
+ hide_menu_fn(){
+ this.setData({
+ show_menu:false
+ })
+ },
+ //分享
+ fenx_fn(){
+ this.triggerEvent('clickShare')
+ },
+ call_back(){
+ wx.navigateBack({
+ delta:1,
+ fail:()=>{
+ wx.reLaunch({
+ url: '/pages/index/index/index',
+ })
+ }
+ })
+ },
+ nav_search(){
+ getApp().goto('/pages/goods/search/search')
+ }
+ }
+})
diff --git a/components/diy_top_nav/diy_top_nav.json b/components/diy_top_nav/diy_top_nav.json
new file mode 100644
index 0000000..e8cfaaf
--- /dev/null
+++ b/components/diy_top_nav/diy_top_nav.json
@@ -0,0 +1,4 @@
+{
+ "component": true,
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/components/diy_top_nav/diy_top_nav.wxml b/components/diy_top_nav/diy_top_nav.wxml
new file mode 100644
index 0000000..e9812c6
--- /dev/null
+++ b/components/diy_top_nav/diy_top_nav.wxml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+ {{nav_title}}
+
+
+
+
+
+
+
+
+ {{nav_title}}
+
+
+
+
+
+
+ {{nav_title}}
+
+
+
+
+
+
+ ID:{{user_no}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索更多商品
+
+
+
+
+
+
+
+
+ 1212121
+
+
diff --git a/components/diy_top_nav/diy_top_nav.wxss b/components/diy_top_nav/diy_top_nav.wxss
new file mode 100644
index 0000000..004d038
--- /dev/null
+++ b/components/diy_top_nav/diy_top_nav.wxss
@@ -0,0 +1,135 @@
+/* components/diy_top_nav/diy_top_nav.wxss */
+@import '../../app.wxss';
+.nav_left{
+ box-sizing: border-box;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+.nav_left_box{
+ width: 48%;
+ align-items: center;
+ justify-content: center;
+ height: 100%;
+}
+.nav_right{
+ flex: 1;
+}
+.navl_left{
+ height: 100%;
+ background-color:rgba(255, 255, 255, .5);
+ border-radius:30rpx;
+ border: 1rpx solid rgba(227, 227, 227);
+ display: flex;
+ align-items: center;
+ justify-content: space-around;
+ padding: 0 4%;
+ box-sizing: border-box;
+}
+
+.navl_minddle{
+ height: 100%;
+ flex: 1;
+ background-color: bisque;
+ display: flex;
+ align-items: center;
+ vertical-align: middle;
+ /* justify-content: center; */
+ border-radius: 30rpx;
+ background-color: rgb(242, 243, 245);
+ /* background-color: #898989; */
+ font-size: 28rpx;
+ color: #898989;
+}
+.nav_search{
+ display: flex;
+ align-items: center;
+ margin: 0 10rpx 0 20rpx;
+}
+.navl_right{
+ background-color: #fff;
+ border-radius: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ border: 1rpx solid rgba(227, 227, 227);
+}
+.navl_left_b{
+ width: 1rpx;
+ height: 65%;
+ background-color:rgb(227,227,227) ;
+}
+.we_chat{
+ width: 45rpx;
+ height: 45rpx;
+}
+.nav_fh {
+ width: 18rpx;
+ height: 18rpx;
+ border-top: 2rpx solid #000;
+ border-right: 2rpx solid #000;
+ transform: rotateZ(-135deg);
+ display: inline-block;
+ margin-bottom: 3rpx;
+}
+.list_menu{
+ position: absolute;
+ /* bottom: -10rpx; */
+ /* top: -13rpx; */
+ left: -35rpx;
+ /* width: 180rpx; */
+ /* width: auto; */
+ padding: 10rpx 26rpx;
+ /* height: 400rpx; */
+ margin-top: 18rpx;
+ background-color: #fff;
+ /* background-color: rebeccapurple; */
+ border-radius: 15rpx;
+ z-index: 9999999;
+}
+.list_menu_top{
+ position: absolute;
+ top: -10rpx;
+ left: 50rpx;
+ width: 26rpx;
+ height: 26rpx;
+ /* background-color: rebeccapurple; */
+ background-color: #fff;
+ transform: rotateZ(45deg);
+ display: inline-block;
+}
+.menu_item{
+ display: flex;
+ align-items: center;
+ font-size: 26rpx;
+ white-space: nowrap;
+ /* padding: 20rpx; */
+}
+.menu_item image{
+ width: 36rpx;
+ height: 36rpx;
+ margin-right: 20rpx;
+}
+.call_back_box{
+ width: 100rpx;
+ height: 100%;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ position: absolute;
+ /* background-color: blueviolet; */
+ left: 0;
+ bottom: 0;
+}
+.call_back_box .nav_fh{
+ width: 20rpx;
+ height: 20rpx;
+}
+
+.tb_con{
+ position: absolute; bottom: 0; right: 24rpx; font-size: 18rpx;color: #333;
+}
+
+.sear_fangda{
+ vertical-align: middle; margin-left:20rpx; margin-right:8rpx;position:relative; top: 10rpx;
+}
\ 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/chongzhi/chongzhi.js b/packageA/pages/chongzhi/chongzhi.js
index 01173f0..72160e9 100644
--- a/packageA/pages/chongzhi/chongzhi.js
+++ b/packageA/pages/chongzhi/chongzhi.js
@@ -183,16 +183,45 @@ Page({
app.goto('../chongzhiDetails/chongzhiDetails?id=' + id+"&type=1");
},
- viewDetails(e){
+ viewDetails(e){
var index=e.currentTarget.dataset.index;
- var WriteOffCode=this.data.list[index].WriteOffCode;
+ //var WriteOffCode=this.data.list[index].WriteOffCode;
+ var id=this.data.list[index].ID;
+
+ this.detail_next(id);
+ },
+
+ async detail_next(id){
+ var code='';
+ //获取二维码,强制更新
+ let res= await getApp().request.promisePut("/api/weshop/store/updateErpApi",{
+ data:{
+ store_id:getApp().globalData.setting.stoid,
+ ApiName:"/api/erp/vip/buyaddmoneyactDetails/updateMainCode",
+ Id:id,
+ VIPId:getApp().globalData.userInfo.erpvipid
+ }
+ })
+ if(res){
+ if(res.data.code==-1){
+ util.m_toast(res.data.msg);
+ return false;
+ }
+ if(res.data.data)
+ code = res.data.data.WriteOffCode;
+ }
+ if(!code){
+ util.m_toast('未找到二维码');
+ return false;
+ }
+
+
var qrcode = this.selectComponent("#qrcode"); //组件的id
- var code=WriteOffCode;
- var e={is_fw:1,val:code,code:code}
- qrcode.open(e);
-
+ var e={is_fw:1,val:code,code:code}
+ qrcode.open(e);
},
-
+
+
// 检测上拉滚动到底部
// scrollToLower: function (requestData, callback) {
// // 数据总量
diff --git a/packageA/pages/chongzhi/chongzhi.wxml b/packageA/pages/chongzhi/chongzhi.wxml
index 4f8d541..4f4c320 100644
--- a/packageA/pages/chongzhi/chongzhi.wxml
+++ b/packageA/pages/chongzhi/chongzhi.wxml
@@ -28,7 +28,7 @@
{{item.ActName}}
零售价:¥{{item.PosPrice}}
- {{(currentIndex == 0 ? '兑换截止日期': '核销时间') + ':' + item.BeginDate + '至' + (item.EndDate==''?'不限':item.EndDate)}}
+ 购买时间:{{item.BillDate}}
@@ -36,7 +36,7 @@
立即使用
- 已过期
+ 已过期
详情
diff --git a/packageA/pages/chongzhiDetails/chongzhiDetails.js b/packageA/pages/chongzhiDetails/chongzhiDetails.js
index 481ed6a..a0d82f0 100644
--- a/packageA/pages/chongzhiDetails/chongzhiDetails.js
+++ b/packageA/pages/chongzhiDetails/chongzhiDetails.js
@@ -63,7 +63,8 @@ Page({
if(options.type==1){
api="/api/weshop/users/getBuyaddmoneyactDetails";
}
-
+
+ this.data.op_id=options.id;
app.request.get(api, {
data: {
Id:options.id,
@@ -71,8 +72,8 @@ Page({
user_id: UserInfo.user_id,
},
success: function (res) {
+
var result=res.data.data;
-
var now=new Date();
var reg = RegExp("-", "g");
var endtime = result.EndDate.replace(reg, '/');
@@ -136,11 +137,41 @@ Page({
},
- onUse() {
- var qrcode = this.selectComponent("#qrcode"); //组件的id
- var code=this.data.result.WriteOffCode;
- var e={is_fw:1,val:code,code:code}
- qrcode.open(e);
+ async onUse() {
+ //-- 如果过期就不可用 ---
+ if(this.data.result.IsGQ){
+ return false;
+ }
+
+
+ //var code=this.data.result.WriteOffCode;
+ var code='';
+
+ //获取二维码
+ let res= await getApp().request.promisePut("/api/weshop/store/updateErpApi",{
+ data:{
+ store_id:os.stoid,
+ ApiName:"/api/erp/vip/buyaddmoneyactDetails/updateMainCode",
+ Id:this.data.op_id,
+ VIPId:getApp().globalData.userInfo.erpvipid
+ }
+ })
+ if(res){
+ if(res.data.code==-1){
+ util.m_toast(res.data.msg);
+ return false;
+ }
+ if(res.data.data)
+ code = res.data.data.WriteOffCode;
+ }
+ if(!code){
+ util.m_toast('未找到二维码');
+ return false;
+ }
+
+ var qrcode = this.selectComponent("#qrcode"); //组件的id
+ var e={is_fw:1,val:code,code:code}
+ qrcode.open(e);
},
@@ -286,5 +317,53 @@ Page({
if(url){
getApp().goto(url);
}
+ },
+
+ //-- 显示二维码 --
+ getcode(e) {
+ var idx = e.currentTarget.dataset.index;
+ var item = this.data.result.givelist[idx];
+ this.get_code_next(item);
+ },
+
+ async get_code_next(item){
+ var th = this;
+ //--获取成功的时候--
+ var no = '';
+
+ var id=item.GiftsId;
+ var IsRetrieval=item.IsRetrieval;
+
+ //-- 有调起的时候 --
+ if(IsRetrieval){
+ no=item.WriteOffCodeOne;
+ }else {
+ //获取二维码
+ let res = await getApp().request.promisePut("/api/weshop/store/updateErpApi", {
+ data: {
+ store_id: os.stoid,
+ ApiName: "/api/erp/vip/buyaddmoneyactDetails/updateMainCodeOne",
+ Id: id,
+ VIPId: getApp().globalData.userInfo.erpvipid
+ }
+ })
+ if (res) {
+ if (res.data.code == -1) {
+ util.m_toast(res.data.msg);
+ return false;
+ }
+ if (res.data.data)
+ no = res.data.data.WriteOffCode;
+ }
+ }
+ if(!no){
+ util.m_toast('未找到二维码');
+ return false;
+ }
+
+
+ var qc_com = th.selectComponent("#qrcode"); //组件的id
+ var e={is_fw:1,val:no,code:no}
+ qc_com.open(e)
}
})
\ No newline at end of file
diff --git a/packageA/pages/chongzhiDetails/chongzhiDetails.wxml b/packageA/pages/chongzhiDetails/chongzhiDetails.wxml
index 3b92c0e..6629f42 100644
--- a/packageA/pages/chongzhiDetails/chongzhiDetails.wxml
+++ b/packageA/pages/chongzhiDetails/chongzhiDetails.wxml
@@ -39,13 +39,26 @@
-
+
{{item.CouponSum}}元优惠券
{{item.Integral}}积分
{{item.GradeSum}}成长值
- {{item.GiveName}}
+ {{item.GiveName}}
- 数量:{{item.Qty}}
+ 数量:{{item.Qty}}
+ {{'兑换截止日期' + ':' + item.BeginDate + '至' + (item.EndDate==''?'不限':item.EndDate) }}
+
+
+
+
+
+
+
+
@@ -57,7 +70,7 @@
立即充值
- 立即使用
+ 立即使用
已核销
diff --git a/packageA/pages/chongzhiDetails/chongzhiDetails.wxss b/packageA/pages/chongzhiDetails/chongzhiDetails.wxss
index 606542a..136ff51 100644
--- a/packageA/pages/chongzhiDetails/chongzhiDetails.wxss
+++ b/packageA/pages/chongzhiDetails/chongzhiDetails.wxss
@@ -109,6 +109,10 @@
font-size: 28rpx;
}
+.btn.bk_huise {
+ background-color: gainsboro;
+}
+
.img-block {
display: block;
width: 100%;
@@ -147,4 +151,24 @@
.container{
display: block;min-height: 100%;width: 100%;position: absolute;left: 0;top: 0;z-index: 1;
+}
+
+.date {
+ padding-top: 10rpx;
+ color: #FE6867;
+}
+
+.box_ware_code.data-v-3a5b7e36 {
+ position: absolute;
+ right: 10rpx;
+ top: 10rpx;
+}
+
+.box_ware_code image.data-v-3a5b7e36 {
+ width: 50rpx;
+ height: 50rpx;
+}
+
+.max_len_name{
+ max-width: 480rpx;
}
\ No newline at end of file
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/goodsInfo/goodsInfo.js b/packageA/pages/goodsInfo/goodsInfo.js
index 42c4b4b..bd7f826 100644
--- a/packageA/pages/goodsInfo/goodsInfo.js
+++ b/packageA/pages/goodsInfo/goodsInfo.js
@@ -212,9 +212,15 @@ Page({
hiddenCS: true, //控制客服操作菜单显示和控制
- openSpecModal_flash_normal: 0,
- keyword:'', //门店搜索
- sec_i:-1,//选中分类门店 下标
+ openSpecModal_flash_normal: 0,
+ keyword:'', //门店搜索
+ sec_i:-1,//选中分类门店 下标
+
+ nav_frontColor: "#ffffff",
+ nav_backgroundColor: "#ffffff",
+ nav_type: 2, //导航类型
+ istop: 0, //是否置顶风格为1
+ searchbox_transparent: 1,
},
//------初始化加载----------
diff --git a/packageA/pages/goodsInfo/goodsInfo.json b/packageA/pages/goodsInfo/goodsInfo.json
index 95b96a3..5b20c87 100644
--- a/packageA/pages/goodsInfo/goodsInfo.json
+++ b/packageA/pages/goodsInfo/goodsInfo.json
@@ -6,7 +6,7 @@
"warn": "/components/long_warn/long_warn",
"serviceCard_recommend": "/components/serviceCard_list/serviceCard_list",
"privacy_pop": "/components/privacy_pop/privacy_pop",
- "com_top_nav": "/components/com_top_nav/com_top_nav"
+ "top_nav": "/components/diy_top_nav/diy_top_nav"
},
"navigationStyle": "custom"
}
\ No newline at end of file
diff --git a/packageA/pages/goodsInfo/goodsInfo.wxml b/packageA/pages/goodsInfo/goodsInfo.wxml
index c732b93..23f13df 100644
--- a/packageA/pages/goodsInfo/goodsInfo.wxml
+++ b/packageA/pages/goodsInfo/goodsInfo.wxml
@@ -2,16 +2,20 @@
-
-
-
-
+
+
-
+
+
+
+
+
+
{{item.name}}
diff --git a/packageA/pages/goodsInfo/goodsInfo.wxss b/packageA/pages/goodsInfo/goodsInfo.wxss
index 202a616..2ff8d60 100644
--- a/packageA/pages/goodsInfo/goodsInfo.wxss
+++ b/packageA/pages/goodsInfo/goodsInfo.wxss
@@ -2993,6 +2993,14 @@ button.custom-service::after{
padding-left: 30rpx;
}
+
/*按钮变灰色的优化*/
.spec-cart-btn.gray{ background-color:gainsboro !important; }
+.type-navbar_box{
+ position: fixed;
+ top: 0;
+ z-index: 999;
+ width: 100%;
+}
+
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_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/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 3b04c80..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
@@ -197,10 +197,17 @@ Page({
user_order_pt_state: 0,
is_retail_price: 0,
+
+ nav_frontColor: "#ffffff",
+ nav_backgroundColor: "#ffffff",
+ 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,
@@ -441,6 +448,12 @@ Page({
});
+ try {
+ let template_id =await getApp().get_template_id('1023')
+ this.setData({
+ template_id
+ })
+ } catch (error) {}
},
@@ -3357,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.json b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.json
index bfe3050..d3599be 100644
--- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.json
+++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.json
@@ -7,7 +7,7 @@
"serviceCard_recommend": "/components/serviceCard_list/serviceCard_list",
"share": "/components/share/share",
"privacy_pop": "/components/privacy_pop/privacy_pop",
- "com_top_nav": "/components/com_top_nav/com_top_nav"
+ "top_nav": "/components/diy_top_nav/diy_top_nav"
},
"navigationStyle": "custom"
}
\ No newline at end of file
diff --git a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml
index 3f36a21..73be720 100644
--- a/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml
+++ b/packageA/pages/serviceCard_pd/goodsInfo/goodsInfo.wxml
@@ -3,15 +3,21 @@
-
-
+
+
-
+
+
+
+
+
+
{{item.name}}
@@ -588,12 +594,12 @@
-
+
¥{{prom_act.price}}
去参团
-
+
一键开团
@@ -610,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..c9601f9 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 () {
@@ -313,7 +320,8 @@ Page({
let obj = {
wareno: ite.goods_sn,
price: ite.goods_price,
- qty: ite.goods_num
+ qty: ite.goods_num,
+ sumprice:ite.sumprice
}
listform.push(obj)
})
@@ -1141,6 +1149,7 @@ Page({
goods_sn: th.data.bn_goods.goods_sn,
goods_price: th.data.param.goods_price || th.data.bn_goods.shop_price || th.data.bn_goods.goods_price,
goods_num: th.data.bn_goods.buynum || th.data.bn_goods.goods_num,
+ sumprice:parseFloat(allpice).toFixed(2) //幸运购没有优惠券
}],
sto: {
keyid: th.data.bn_goods.keyid
@@ -1260,7 +1269,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 +1558,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 +1628,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 @@
-
+
+
+
+
+
+
+
+
+
+ {{item.goods_name}}
+
+
+
+
+
+ {{item.prom_integral}}积分
+ +
+ {{item.prom_price}}
+
+ {{item.market_price}}
+
+
+
+
@@ -125,19 +244,19 @@
{{item.shop_price}}
@@ -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.shop_price}}
- {{item.market_price}}
-
-
+
+ {{item.shop_price}}
+ {{item.market_price}}
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- {{item.goods_name}}
-
-
-
-
-
- {{item.prom_integral}}积分
- +
- {{item.prom_price}}
-
- {{item.market_price}}
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{item[card_field]}}
-
-
- {{card_name}}
-
-
-
-
-
- {{item.shop_price}}
-
-
-
-
-
-
- {{item.shop_price}}
- {{item.market_price}}
-
-
-
-
-
- {{item.shop_price}}
- {{item.market_price}}
-
-
-
-
-
-
-
-
- {{item.shop_price}}
- {{item.market_price}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 暂无相关商品
- 回到首页
-
+
+
+
+
+
+
+ 暂无相关商品
+ 回到首页
+
+
+
-
-
- {{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/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/team/team_success/team_success.js b/pages/team/team_success/team_success.js
deleted file mode 100644
index 68053c5..0000000
--- a/pages/team/team_success/team_success.js
+++ /dev/null
@@ -1,1050 +0,0 @@
-var t = require("../../../utils/util.js"),
- ut = t,
- e = require("../../../utils/common.js"),
- a = require("../../../utils/wxParse/wxParse.js"),
- s = getApp(),
- i = s.request,
- rq = i,
- oo = s.globalData,
- o = s.globalData.setting,
- os = o;
- var regeneratorRuntime = require('../../../utils/runtime.js');
-
-Page({
- data: {
- //activity_type:1,//活动类型 商家1 阶梯2 会员3
- p_status:1,//会员团的详细情况 1是正在行 2是成功 3失败
- sf_length: 1,//人数大于5
-
- erweima:false,
- meng:false,
- zk:true,
- stoid: o.stoid,
- hiddenName: true,
- teamlist:null,
- teamgroup:null,
- goods:null,//商品数据
- pindGoods: null,//拼单数据
- imageurl: o.imghost,
- pay_f:0,//支付是否成功
- order_sn:"",//订单编号
- canvasHidden:false, //画画版
- screenWidth:0,
-
- pd_xx: 0, //弹框
- max_num:0,//最低成团人数
- min_price:0,//最低价格
- is_show:0,//加载完才显示
-
- share_img_localpath:"", //分享图片的本地图片
- share_ewm_localpath: "", //分享的二维码本地图片
- share_head:"", //分享头像的本地图片
-
- iurl:os.imghost,
- ct_price:0,//阶梯团成团价格
- sf_arr:null,
-
- },
- onLoad: function (t) {
- wx.setNavigationBarTitle({ title: "拼团订单",})
- var that=this;
- var th=this;
- //获取用户设备信息,屏幕宽度
- wx.getSystemInfo({
- success: res => {
- that.setData({ screenWidth: res.screenWidth })
- }
- })
- var pay_f = t.payf, order_sn = t.ordersn;
- this.setData({ pay_f: pay_f, order_sn: order_sn});
- this.init(order_sn);
-
- //-- 自定义海报 --
- getApp().request.promiseGet("/api/weshop/goods/poster/page",{
- data:{store_id:os.stoid, type:1, is_use:1 }
- }).then(res=>{
- if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData[0] ){
-
- var poster_data=res.data.data.pageData[0];
- var json_str=poster_data.jsonStr;
- if(json_str){
- var json_data=JSON.parse(json_str);
- if(json_data.bg_img){
-
- //-- 把图片那到本地 --
- wx.getImageInfo({
- src:json_data.bg_img,
- success: function(res) {
- var path= res.path;
- th.setData({share_b_img:path})
- },
- fail: function(res) {}
- });
- }
- th.setData({poster:json_data})
- }
- }
- })
-
- getApp().getConfig(function (e) {
- th.setData({sto_sele_name_1: e.store_name})
- })
- },
- onShow:function () {
- getApp().check_can_share(this);
- },
-
- //关闭展开列表
- click:function(e){
- this.setData({
- hiddenName: !this.data.hiddenName,
- zk: !this.data.zk,
- })
- },
- //打开收起拼团列表
- czk:function(e){
- this.setData({
- zk:!this.data.zk,
- hiddenName: !this.data.hiddenName,
- })
- },
- //打开蒙板提示
- cmeng:function(e){
- this.setData({
- meng:!this.data.meng,
- })
- },
-
- //关闭蒙板提示
- cmc:function(e){
- this.setData({
- meng: !this.data.meng,
- })
- },
-//打开二维码提示
- cerweima:function(e){
- this.setData({
- meng: !this.data.meng,
- erweima: !this.data.erweima,
- })
- },
-
- cerc:function(e){
- this.setData({
- erweima: !this.data.erweima,
- meng: !this.data.meng,
- })
- },
-
- async init( order_sn) {
-
- wx.showLoading();
-
- var goods_id = 0,//商品ID,
- pageteam=null,//
- original_img=null ,//商品图片
- order=null,//订单编号
- id = 0,//团购id
- pt_listno = "",//团编号
- pt_prom_id = 0, //活动id
- ee = this,
- team_id = 0,//活动id
- ordertx=[],//头像图片
- share_img=null,//分享图片
- teamlist=null,//活动表
- goods=null,//商品
- teamgroup=null,//活動从表
- max_num=0,//最低价格时的成团人数
- p_status=1;
-
- //--如果商家团的时候---
- await getApp().request.promisePost("/api/weshop/order/pay/vipAutoTuan", {
- data: {orderSn:order_sn,storeId:os.stoid }
- })
-
- //获取order信息根据订单编号order_sn
- await getApp().request.promiseGet("/api/weshop/order/page", {
- data: { store_id: o.stoid, order_sn: order_sn,}
- }).then(res => {
- order = res.data.data.pageData[0];
- pt_prom_id = order.pt_prom_id;
- pt_listno = order.pt_listno;
- })
-
-
-
- if (this.data.payf || order.pt_status == 3) p_status = 3; //失败
- if (order.pt_status == 2 || order.pt_status == 4 || order.pt_status == 5)
- p_status = 2; //成功
- if (order.pt_status < 2 && !this.data.payf)
- p_status = 1; //正在进行
- if ( order.pt_status == 6) p_status = 4; //支付尾款失败
-
- var team_g=null;
- if(pt_listno) {
- //多少人参团头像
- await getApp().request.promiseGet("/api/weshop/order/pagePtList", {
- data: {store_id: o.stoid, pt_listno: pt_listno,}
- }).then(res => {
- ordertx = res.data.data.pageData;
- })
-
- //获取teamgroup中的值
- await getApp().request.promiseGet("/api/weshop/teamgroup/page", {
- data: { store_id: os.stoid, listno: pt_listno,pageSize:1,page:1}
- }).then(res => {
- team_g = res.data.data.pageData[0]
- })
- }
-
-
- var min_price=0;
- //获取活动表的信息根据活动pt_prom_id
- await getApp().request.promiseGet("/api/weshop/teamlist/get/" + os.stoid + "/" + pt_prom_id, {
- data: { }
- }).then(res => {
- if(res.data.code==0){
- teamlist=res.data.data;
- this.setData({
- teamlist:teamlist
- });
- var nt =ut.gettimestamp();
- teamlist.status=0;
-
- if (nt >= teamlist.start_time) teamlist.status = 1;
- goods_id = res.data.data.goods_id;
- id = res.data.data.id;
- share_img = ee.data.imageurl + res.data.data.share_imgurl;
-
- //----------查看阶梯团------------
- if (teamlist.ct_rylist != "" && teamlist.ct_rylist != null && teamlist.ct_rylist != undefined){
- var ct_rylist = JSON.parse(teamlist.ct_rylist);
- var max=0; var pri=0;
- ct_rylist.forEach(function (val,ind) {
- if(parseInt(val.rynum)>parseInt(max)){
- max=val.rynum;
- pri = val.price;
- }
- })
- max_num=max;
- min_price=pri;
- }
-
- }
- //获取商品信息
- getApp().request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + goods_id, {
- }).then(res => {
- //商品地址
- original_img = ee.data.imageurl+ res.data.data.original_img,
- goods = res.data.data
- ee.setData({goods: goods,image: original_img,})
- })
-
- })
-
- if(ordertx && ordertx.length){
- //只装5个
- var ordertx2=[],sf_num=0,ct_nun=teamlist.ct_num;
- if(max_num && !team_g.is_xuni_ct){
- ct_nun=parseInt(max_num);
- if (ct_nun < ordertx.length) ct_nun = ordertx.length;
- }
-
- if(ct_nun>5) ct_nun=5;
- for(var i=0;i= ordertx.length) sf_num++
- else
- ordertx2.push(ordertx[i]);
- }
- }
-
-
-
-
- var head=[];
- if(team_g.is_xuni_ct) {
- head=team_g.xuni_head_id.split(",");
- order.is_xuni_ct=1;
-
- this.setData({head:head,});
- }
-
-
- var sf_arr=[];
- for (var i=0;i {
- teamgroup = res.data.data.pageData[0];
- if (teamgroup){
- var buy_start_date = ut.formatTime(teamgroup.buy_start_date, "yyyy-MM-dd hh:mm:ss");
- teamgroup.buy_start_date=buy_start_date;
- }
- })
-
-
- var ct_price = 0;
- var num_0 = ordertx?ordertx.length:0;
- if (teamlist.kttype == 3){
- var js_data = JSON.parse(teamlist.ct_rylist);
- js_data.forEach(function (val,ind) {
- if (num_0<=val.rynum && ct_price==0){
- ct_price=val.price;
- }
- })
- if(ct_price==0) ct_price=min_price;
- }
-
- //获取大家都在团信息
- getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1?store_id="+ os.stoid +"&is_end=0&is_show=1" , {
- data:{page:1,pageSize:2}
- }).then(res => {
- if(res.data.code==0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length>0){
- pageteam = res.data.data.pageData;
- ee.setData({pageteam: pageteam,})
- }
-
- })
-
- if(!teamlist.virtual) teamlist.virtual=0;
-
- //--当是成团的时候的操作--
- if(order.pt_status==2 || order.pt_status==4 || order.pt_status==5){
- //设置值
-
- ee.setData({
- ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup, min_price: min_price,
- order: order, share_img: share_img,max_num:max_num,
- pindGoods: teamlist,is_show:1, zk:false,
- hiddenName: false, ct_price:ct_price,p_status:p_status,sf_arr:sf_arr});
-
- //--是否支付了尾款--
- if(order.pt_status==4 || order.pt_status==5){
- ee.setData({is_pay_wk:1});
- }
- }else{
- //设置值
- ee.setData({
- ordertx2: ordertx2, ordertx: ordertx, teamlist: teamlist, teamgroup: teamgroup,
- order: order, p_status: p_status, min_price:min_price,
- share_img: share_img, max_num: max_num, pindGoods: teamlist, is_show: 1,
- ct_price: ct_price, p_status: p_status,sf_arr:sf_arr});
- }
-
- wx.hideLoading();
-
- wx.setNavigationBarTitle({
- title: "拼团详情",
- })
-
- ee.countDown2();
-
- //获取分享图片的本地地址
- var path2 = os.imghost + teamlist.share_imgurl;
- wx.getImageInfo({
- src: path2,
- success: function (res) {
- //res.path是网络图片的本地地址
- ee.data.share_img_localpath = res.path;
- },
- fail: function (res) {
- //失败回调
- }
- });
-
-
- },
- //---小于10的格式化函数----
- timeFormat(param) {
- return param < 10 ? '0' + param : param;
- },
- countDown2() {
- var th = this;
- // 获取当前时间,同时得到活动结束时间数组
- var newTime = ut.gettimestamp();
- var o = this.data.teamgroup;
- if(!o) return false;
-
- var endTime = o.kt_end_time;
- if (o.status == 0) endTime = o.start_time;
-
- //看一下,是否要支付尾款
- if(o.team_type==3 && th.data.order.pt_status==2){
- endTime = o.wk_end_time;
- }
-
- let obj = null;
- // 如果活动未结束,对时间进行处理
- if (endTime - newTime > 0) {
- let time = (endTime - newTime);
- // 获取天、时、分、秒
- let day = parseInt(time / (60 * 60 * 24));
- let hou = parseInt(time % (60 * 60 * 24) / 3600);
- let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
- let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
- obj = {
- day: this.timeFormat(day),
- hou: this.timeFormat(hou),
- min: this.timeFormat(min),
- sec: this.timeFormat(sec)
- }
- } else {
- //活动已结束,全部设置为'00'
- obj = {
- day: '00',
- hou: '00',
- min: '00',
- sec: '00'
- }
- }
- var txt = "pindGoods.djs";
- th.setData({
- obj: obj
- });
- setTimeout(th.countDown2, 1000);
- },
-
- //--定义的保存图片方法,分享团---
- saveImageToPhotosAlbum: function () {
- //类型 0普通商品 1秒杀商品 2商家和会员团 3阶梯团
- var type=1;
- if(this.data.teamlist.kttype==3) type=2;
-
- wx.showLoading({ title: '生成中...', })
- var that = this, th = that;
- //设置画板显示,才能开始绘图
- that.setData({
- canvasHidden: true,
- })
-
- if(this.data.share_hidden) {
- this.setData({
- share_hidden: false,
- });
- };
-
- var app = getApp();
- var unit = that.data.screenWidth / 750 * 1.35;
- var scene=th.data.teamgroup.id;
- var goods_id=th.data.teamlist.goods_id;
- var user_id=getApp().globalData.user_id?getApp().globalData.user_id:0;
- if(user_id>0){
- scene+="_"+user_id;
- }
- if(goods_id !==""){
- scene+="_"+goods_id;
- }
-
- //二微码
- var path3 = os.url+ "/api/wx/open/app/user/getWeAppEwm/"+
- os.stoid+"?sceneValue="+scene+"&pageValue=pages/team/team_show/team_show";
-
- console.log(path3,6000);
-
- //读取文件成功则OK--
- wx.getImageInfo({
- src: path3,
- success:function (res) {
- console.log(res,5000);
- //回调写法
- th.get_head_temp(th.get_goods_temp,function () {
- var vpath = res.path;
- var context = wx.createCanvasContext('share');
-
-
- //先画背景
- var pg_path = "../../../images/share/share_bg.png";
- //-- 如果有自定义海报的时候,判断背景的图片 --
- if(th.data.share_b_img){
- pg_path=th.data.share_b_img;
- }
-
- var share_title=th.data.teamlist.share_title;
- if(!share_title)
- share_title=th.data.teamlist.title;
-
- if (!th.data.share_b_img){ // 如果是普通商品,绘制新海报
- th.drawPoster(context, unit, th.data.share_img_localpath, vpath, type);
- } else {
- context.drawImage(pg_path, 0, 0, 554 * unit, 899 * unit);
- //-- 是自定义海报的情况下 --
- if(th.data.poster && parseInt(th.data.poster.style)==2){
- //在线上分享人的情况下
- if(parseInt(th.data.poster.show_headpic)){
- //获取坐标
- var x=parseFloat(th.data.poster.head_x)*2;
- var y=parseFloat(th.data.poster.head_y)*2;
- var x1=(x+90) *unit;
- var y1=(y+50) *unit;
- //--昵称---
- context.setFontSize(24 * unit)
- context.setFillStyle("black")
- context.fillText(app.globalData.userInfo.nickname, x1, y1);
- var width = 24 * app.globalData.userInfo.nickname.length * unit + 4 * unit;
- //强烈推荐 改许程
- var tj_path = "../../../images/share/q_tj.png";
- context.drawImage(tj_path, x1 + width, y1-22*unit, 85 * unit, 30 * unit);
- context.setFontSize(16 * unit)
- context.setLineJoin('round'); //交点设置成圆角
- context.setFillStyle("white")
- context.fillText('强烈推荐', x1 + width+8*unit, y1-1*unit);
- }
-
- }else{
- //--昵称---
- context.setFontSize(24 * unit)
- context.setFillStyle("black")
- context.fillText(app.globalData.userInfo.nickname, 152 * unit, 76 * unit);
- var width = 24 * app.globalData.userInfo.nickname.length * unit + 2 * unit;
- //强烈推荐
- var tj_path = "../../../images/share/q_tj.png";
- context.drawImage(tj_path, 152 * unit + width, 54 * unit, 110 * unit, 30 * unit);
- context.setFontSize(18 * unit)
- context.setFillStyle("white")
- context.fillText('强烈推荐', 152 * unit + width + 20 * unit, 76 * unit);
- }
-
-
- //---产品名称---
- context.setFontSize(21.3 * unit);
- context.setFillStyle("black");
-
-
- getApp().draw_Text(context,share_title,
- 38 * unit, 180 * unit, 200 * unit, 279 * unit, unit);
- //------产品的价格-------
- context.setFontSize(24 * unit)
- context.setFillStyle("red")
-
- var pri0 = th.data.teamlist.price;
- pri0=parseFloat(pri0).toFixed(2);
- var wd1=th.data.screenWidth-ut.measureText(pri0, 31 * unit)-25;
- context.fillText("¥", wd1-15, 180 * unit);
- context.setFontSize(31 * unit)
- context.fillText(pri0, wd1, 180 * unit);
-
- //---市场价划掉---
- context.setFillStyle("gray")
- context.setFontSize(22 * unit)
- pri0= "¥" + parseFloat(th.data.goods.market_price).toFixed(2);
- var wd2=th.data.screenWidth-ut.measureText(pri0, 22 * unit)-25;
- context.fillText(pri0, wd2, 210 * unit);
-
- context.setStrokeStyle('gray')
- context.setLineWidth(1 * unit)
- context.moveTo(wd2-5, 204 * unit)
- context.lineTo(wd2+ut.measureText(pri0, 22 * unit)+5, 204 * unit)
- context.stroke();
- console.log(th.data.share_img_localpath);
-
-
- //---中间大图---
- context.drawImage(th.data.share_img_localpath, 68 * unit, 242 * unit, 410 * unit, 410 * unit);
-
- var g_ct=th.data.teamlist.ct_num-th.data.ordertx.length;
- var wz= "";
- if(g_ct>0) wz="还差"+g_ct+"人成团,";
- else{
- g_ct= th.data.max_num -th.data.ordertx.length;
- if(g_ct>0){
- wz="还差"+g_ct+"人享最低优惠,";
- }else{
- wz="已享受最优惠,";
- }
- }
-
- //-------大图后面就不一样了-----------
- switch (type) {
- case 1://会员团和商家团的展示
- //---画线---
- context.setLineWidth(1 * unit)
- context.moveTo(32 * unit, 670 * unit)
- context.lineTo(520 * unit, 670 * unit)
- context.stroke();
-
- //---文字---
- context.setFontSize(22 * unit)
- context.setFillStyle("black")
- context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
-
- //绘制成团图片
- var ct_img ="../../../images/share/ct_num.png";
- context.drawImage(ct_img, 40 * unit, 740 * unit, 120 * unit, 30 * unit);
- var ct_num = th.data.teamlist.ct_num;
- context.setFontSize(14 * unit)
-
- context.setFillStyle("red")
- if(ct_num<10){
- context.fillText(ct_num+"人拼团", 92 * unit, 760 * unit);
- }else{
- context.fillText(ct_num+"人拼团", 86 * unit, 760 * unit);
- }
- context.setFontSize(22 * unit)
- context.fillText("已拼"+th.data.teamlist.buy_num+"份", 166 * unit, 763 * unit);
- context.setFillStyle("gray")
- context.fillText(wz+"快来和我一起拼团吧!", 40 * unit, 826 * unit);
- context.setFillStyle("black")
-
- context.setFontSize(22 * unit)
- context.fillText("长按识别二维码,立即参团", 40 * unit, 856 * unit);
- //---二维吗图---
- //-- 自定义海报 --
- if(th.data.poster){
- var erm_x= parseFloat(th.data.poster.ewm_x)*2;
- var erm_y= parseFloat(th.data.poster.ewm_y)*2;
- context.drawImage(vpath, erm_x * unit, erm_y * unit, 120 * unit, 120 * unit);
- }else{
- //---二维吗图---
- context.drawImage(vpath, 420 * unit, 726 * unit, 120 * unit, 120 * unit);
- }
- break
- case 2://阶梯团的展示
- //---画线---
- context.setLineWidth(1 * unit)
- context.moveTo(32 * unit, 670 * unit)
- context.lineTo(520 * unit, 670 * unit)
- context.stroke();
- //---文字---
- context.setFontSize(22 * unit)
- context.setFillStyle("black")
- context.fillText("好物拼起来,拼拼更划算", 40 * unit, 726 * unit);
- //---绘制中间阶梯的价格---
- var list= JSON.parse(th.data.teamlist.ct_rylist);
- for(var i=0; i0)
- url+="&first_leader="+getApp().globalData.user_id;
- else
- url+="?first_leader="+getApp().globalData.user_id;
- }
- // console.log('url+++++>>>>>', url, th.data.teamlist.title);
-
- var share_title=th.data.teamlist.title;
- if(th.data.teamlist.share_title){
- share_title=th.data.teamlist.share_title;
- }
- return {
- path:url,
- title: share_title,
- imageUrl: img,
- }
- },
-
- clickShare() {
- if(!getApp().globalData.user_id){
- getApp().goto("/packageE/pages/togoin/togoin");
- return false;
- }
- this.setData({
- share_hidden: true,
- });
- },
-
- send() {
- this.setData({
- share_hidden:false,
- });
- },
-
- cancel() {
- this.setData({
- share_hidden:false,
- });
- },
-
-
- closePoster() {
- this.setData({
- showPoster: false,
- });
- },
-
-
- // 保存图片到手机
- savePic() {
- console.log('保存图片');
- getApp().savePic(this);
-
- },
-
- //-- 先版绘制 --
- drawPoster(context, unit, img, vpath, type) {
-
- var self=this;
- self.data.prom_act=this.data.teamlist;
-
- // 1.灰色背景
- context.setFillStyle('#f2f1f6');
- context.rect(0, 0, 554 * unit, 899 * unit);
- context.fill();
-
- // 2.商城名称
- let shopName = this.data.sto_sele_name_1;
- context.setTextAlign('center');
- context.setFontSize(26 * unit);
- context.setFillStyle('black');
- context.fillText(shopName, 277 * unit, 60 * unit);
-
- // 3.推荐来源
- let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
- context.setTextAlign('center');
- context.setFontSize(22 * unit);
- context.setFillStyle('#96959a');
- context.fillText(fromText, 277 * unit, 105 * unit);
-
- // 4.海报背景
- context.setFillStyle('white');
- context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit);
-
- // 5.商品图片
- // 图片的x坐标
- let bg_x = 37 * unit
- // 图片的y坐标
- let bg_y = 157 * unit
- // 图片宽度
- let bg_w = 480 * unit
- // 图片高度
- let bg_h = 474 * unit
- // 图片圆角
- let bg_r = 4
- // 绘制海报背景图片圆角
- context.save()
- context.beginPath()
- context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5)
- context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2)
- context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5)
- context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI)
- context.clip()
- context.drawImage(img, bg_x, bg_y, bg_w, bg_h);
- context.restore();
-
- // 6.强烈推荐
- let src = '';
- context.beginPath();
-
-
- if (type == 1) { // 商家和会员团
- src = '../../../images/share/ct_num.png';
- context.drawImage(src, 54 * unit, 648 * unit, 120 * unit, 30 * unit);
- context.setTextAlign('left');
-
- let ct_num = self.data.prom_act.ct_num;
- context.setFontSize(16 * unit)
- context.font = 'normal';
- context.setFillStyle("red")
- if (ct_num < 10) {
- context.fillText(ct_num + "人拼团", 100 * unit, 670 * unit);
- } else {
- context.fillText(ct_num + "人拼团", 96 * unit, 670 * unit);
- }
- context.setFontSize(22 * unit)
- context.fillText("已拼" + self.data.prom_act.buy_num + "份", 186 * unit, 672 * unit);
- }
-
- if (type == 2) { // 阶梯团
- let list = self.data.prom_act.ct_rylist;
- if(ut.isString(list)){
- list=JSON.parse(list);
- }
-
- for (let i = 0; i < list.length; i++) {
- let item = list[i];
- let wi = i * 90 * unit;
- context.font = 'normal';
- context.setTextAlign('left');
- context.setFontSize(16 * unit)
- context.setFillStyle("red")
- context.fillText("¥", 50 * unit + wi, 680 * unit);
- context.setFontSize(22 * unit)
- let pri = parseFloat(item.price).toFixed(2);
- context.fillText(pri, 66 * unit + wi, 680 * unit);
-
-
- context.setFillStyle("gray")
- context.fillText("满" + item.rynum + "人", 50 * unit + wi, 716 * unit);
- }
-
-
- var wp= 52 * unit;
- var hp=755 * unit
- self.draw_pos_price(context,wp,hp,self.data.goods.market_price,unit);
- }
-
-
- // 8.商品标题
- context.setFontSize(20 * unit);
- context.setFillStyle('#898989');
- getApp().draw_Text(context, this.data.goods.goods_name, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1);
- // 9.小程序码
- context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit);
- context.setFontSize(16 * unit);
- context.setFillStyle('#777');
- context.fillText('长按识别二维码', 378 * unit, 810 * unit);
-
- // 10.竖线
- context.beginPath();
- context.setFillStyle('#eee');
- context.rect(354 * unit, 670 * unit, 1 * unit, 130 * unit);
- context.fill();
- },
-
-
- //---市场价划掉---
- draw_pos_price(context, w, h, market_price, unit) {
-
- if (!this.data.sys_switch) return false;
- if (!this.data.sys_switch.is_retail_price) return false;
-
- context.setFillStyle("gray")
- context.setFontSize(22 * unit)
- var pri0 = "¥" + market_price.toFixed(2);
- context.fillText(pri0, w, h);
-
- var c_h = h - 6;
- context.setStrokeStyle('gray');
- context.setLineWidth(1 * unit);
- context.moveTo(w - 5, c_h);
- context.lineTo(w + ut.measureText(pri0, 22 * unit) + 5, c_h);
- context.stroke();
-
- },
-
-
-
-
-
-})
-
diff --git a/pages/team/team_success/team_success.json b/pages/team/team_success/team_success.json
deleted file mode 100644
index 528e630..0000000
--- a/pages/team/team_success/team_success.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "windom": {
- "navigationBarTitleText": "拼团订单",
- "backgroundTextStyle": "light",
- "navigationBarTextStyle": "white",
- "navigationBarBackgroundColor": "#ffffff",
- "backgroundColor": "#eeeeee"
- },
- "usingComponents": {
- "share": "/components/share/share"
- }
-}
\ No newline at end of file
diff --git a/pages/team/team_success/team_success.wxml b/pages/team/team_success/team_success.wxml
deleted file mode 100644
index eed5363..0000000
--- a/pages/team/team_success/team_success.wxml
+++ /dev/null
@@ -1,355 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
- {{goods.goods_name}}
-
-
-
-
-
- ¥{{teamlist.price}}
-
- ¥{{goods.shop_price}}
-
-
-
-
- 已拼{{teamlist.buy_num+teamlist.virtual}}件
-
-
-
-
-
- {{teamlist.ct_num}}人拼
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 当前价格
- ¥{{ct_price}},
-
- 还差{{max_num-ordertx.length}}人享受最低价格¥{{min_price}}
-
-
- 该团已经拼购到最低价了哦~
-
-
-
-
- 拼团成功,当前价格
- ¥{{ct_price}}
-
-
-
-
-
-
-
-
-
-
- 拼团失败
-
-
-
-
-
-
-
- 还差
- {{teamlist.ct_num-ordertx.length}}人成团,组团成功为您节省
- {{filters.toFix(goods.market_price-teamlist.price,2)}}元
-
-
-
- 拼团成功,为您节省
- {{filters.toFix(goods.market_price-teamlist.price,2)}}元
-
-
-
-
-
-
-
-
-
-
- 团长
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 剩余
-
- {{obj.hou}}:
- {{obj.hou}}:
- {{obj.min}}:
- {{obj.sec}}结束
-
-
-
-
- 剩余支付时间:
-
- {{obj.hou}}时
- {{obj.min}}分
- {{obj.sec}}秒
-
-
-
- 拼团已结束
-
-
-
-
-
- 还差
- {{teamlist.ct_num-ordertx.length}}人参团, 拼团失败。
-
-
-
- 已经有
- {{ordertx.length>teamlist.ct_num?ordertx.length:teamlist.ct_num}}人参团, 拼团成功。
-
-
-
-
-
-
-
-
-
-
- 拼团成功, 规定时间内支付尾款即发货
-
-
- 点击下方按钮分享给小伙伴,可快速成团!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 查看拼团列表
-
-
-
-
-
-
-
-
- 查看拼团列表
-
-
-
-
-
-
-
- 团长
-
- {{item.nickname}}
-
-
- {{item.add_time_date}}
- 开团
-
- {{item.add_time_date}} 参团
-
-
-
-
-
-
- 匿名
-
- {{filters.format_time(teamgroup.buyenddate,1)}} 参团
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 大家都在团
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 拼
- ¥{{item.price}}
-
- {{item.ct_num}}
- 人参团
-
-
-
-
- {{item.goods_name}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 拼团玩法介绍
-
-
- 1.开团:
- 选择心仪商品,点击“发起X人团”按钮,付款后即为开团成功;
-
- 2.参团:
- 进入朋友分享的页面,点击“立即参团”按钮,付款后即为参团成功,若多人同时支付,支付成功时间较早的人获得参团资格;
-
- 3.成团:
- 在开团或参团成功后,点击“邀请小伙伴参团”将页面分享给好友,在有效时间内凑齐人数即为成团,此时商家会开始发货;
-
- 4.组团失败:
- 在有效时间内未凑齐人数,即为组团失败,此时付款项会原路退回到支付账户;
-
- 5.
- 组团有效期间内,拼购商品订单不允许取消。
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/pages/team/team_success/team_success.wxss b/pages/team/team_success/team_success.wxss
deleted file mode 100644
index 9d13c9f..0000000
--- a/pages/team/team_success/team_success.wxss
+++ /dev/null
@@ -1,965 +0,0 @@
-page{
- background-color:#eee;
-}
-.top{
- background-color:rgb(216, 230, 220);
- color: rgb(98, 155, 13);
- text-align: center;
- height:120rpx;
- width: 100%;
- padding-top:24rpx;
-}
-
-.center{
- height: 240rpx;
- width: 100%;
- position: relative;
- background:#fff;
-}
-
-.cenleft{
- width: 240rpx;
- height: 100%;
-
- float: left;
- display:flex;
- justify-content: center;
- align-items: center;
-}
-
-.cenleft image{
- background-color:white ;
- width: 200rpx;
- height: 200rpx;
-
-}
-
-
-.cenrt{
- width: 460rpx; margin-top: 10rpx;
-}
-
-.cenright{
- height: 100%;
- width: 460rpx;
-
- float: left;
-}
-
-.cenrtop{
- margin-top: 10rpx;
- background-color: red;
- color: white;
- border-radius:10rpx;
- padding-left: 16rpx;
- width: 140rpx;
- font-size: 32rpx;
- float: left;
- height: 40rpx;
-}
-
-.cenrtoptitle{
- float: left;
- width: 295rpx;
- height: 40rpx;
- margin-left: 12rpx;
- font-size: 28rpx;
- margin-top:12rpx;
-}
-
-.cenrtoptitle>span{
- width: 100%;
- display: inline-block;
- overflow:hidden;
- text-overflow:ellipsis;
- white-space:nowrap
-}
-
-.cenrcen{
- height: 70rpx;
- margin-top: 35rpx;
- width:474rpx;
-}
-.jg{ font-size: 40rpx;
- margin-right: 30rpx;}
-.jgx{
- font-size: 28rpx;
- color: #777;
- text-decoration:line-through;
- margin-left: 20rpx;
-}
-
-.cenrfoot{
- align-content: center;
- text-align: center;
- border: 2rpx solid red;
- border-radius:10rpx;
- color: red;
- float: left;
- font-size: 24rpx;
- padding: 4rpx 16rpx;
-}
-
-.body{
- background-color: white;
- /* min-height:418rpx; */
- width: 100%;
- margin-top: 4rpx;
- border-top:5rpx solid #eee;
- height: auto;
-}
-
-.bodytop{
- background-color: white;
- text-align: center;
- font-size: 28rpx;
- height:100rpx;
- line-height:117rpx;
-
-}
-
-.bodytop span{
- color: red;
-}
-
-
-.bodyimg{
- height:140rpx;
- width:590rpx;
-
-
-
-}
-.bodyimg image{
-
-border-radius:50rpx;
-height: 96rpx;
-width: 96rpx;
-background-color:burlywood;
-margin-top: 30rpx;
- position: absolute;
-
-}
-
-.d{
-width:101rpx;
- height:101rpx;
- display: inline-block;
- margin-right:15rpx;
-
-}
-
-.bodyimg span{
- background-color:#e22b44;
- color: white;
- font-size: 24rpx;
- border-radius:6rpx;
- padding:2rpx 10rpx;
- position: relative;
- top: 0rpx;
- left: 40rpx;
-}
-
-
-
-.bodyspan{
- color: red;
- text-align: center;
- font-size: 26rpx;
-
-}
-
-.bodyselect{
- line-height: 47rpx;
-}
-
-.bodytime{
- height: 88rpx;
- width: 100%;
- display: flex;
- flex-wrap: nowrap;
- margin-left:40rpx;
- align-items:center;
-
-}
-
-.bodytimeleft{
- text-decoration:line-through;
- flex-grow: 1.7;
-}
-
-
-.bodytimecen-success{
- text-align: center;
- flex-grow: 1;
- line-height:75rpx;
- font-size: 30rpx;
- color: #000;
-}
-.bodytimecen-success span{
-
- color: #18ba5f;
- border-radius:7rpx;
- font-size: 30rpx;
- margin: 0 auto;
-
-}
-.bodytimecen{
- text-align: center;
- flex-grow: 1;
-
- font-size: 30rpx;
- color: #000;
-}
-.bodytimecen span{
- background-color: #333333;
- color: white;
- border-radius:7rpx;
- padding-left: 10rpx;
- font-size: 30rpx;
- margin: 0 auto;
- padding-right:10rpx;
- margin-right:5px
-}
-
-
-.bodytimecen span:last-child{
- margin-right: 10rpx;
-}
-
-.bodytimeright{
- flex-grow: 1.7;
- margin-right:72rpx;
-
-}
-
-.bodybutton{
- width: 90%;
- margin: 0 auto;
- text-align: center;
- line-height: 60rpx;
- border-radius:15rpx;
- height: auto;
-}
-
-.bodybutton button{
- height:60rpx;
- width: 100%;
- background-color: #e4374d;
- color: white;
- font-size:26rpx;
- border-radius:12rpx;
-
-}
-
-.bodyfoot{
-
- width: 100%;
- text-align: center;
-
- font-size: 28rpx;
- color: #000;
- background-color: white;
-}
-
-
-
-
-
-.pintuan{
- width: 100%;
- height: 84rpx;
- background-color: white;
- color: black;
- text-align: center;
- font-size:36rpx;
- margin-top: 60rpx;
-}
-
-.pintuanzhou{
-float: left;
-
-line-height: 84rpx;
-width: 220rpx;
-}
-
-.pintuanyou{
- float: right;
- color: rgb(168, 167, 167);
- line-height: 84rpx;
- font-size: 28rpx;
- margin-right: 20rpx;
-}
-
-.onegoods{
- background-color: white;
- width: 345rpx;
- min-height: 490rpx;
- height:auto;
-
- border:2rpx solid #eee;
-
- float: left;
- margin-right:17rpx;
- border-radius:20rpx;
-}
-
-.goodsl{
- background-color: white;
-}
-
-.onegoodsimg{
- width: 100%;
- height: 360rpx;
-}
-
-.onegoodsimg image{
- height: 100%;
- width: 100%;
- border-radius:20rpx 20rpx 0 0;
-
-}
- .xc-buttmo-frame{
- min-height: 103rpx;
- height: auto;
- padding-bottom:15rpx;
-
- }
-.xc-buttmo-frame .onegoodsdesc {
-
- height: 80rpx;
-}
-
-.xc-buttmo-frame .onegoodsdesc .price{
-
- padding-left:10rpx;
- height:85rpx;
-
-}
-.xc-ping{
- border-radius: 50%;
- background: #fff;
- line-height:34rpx;
-width:34rpx;
-height:34rpx;
-font-size:24rpx;
-
-}
-.jgleft{
-border-radius:36rpx;
-height:45rpx;
-line-height:50rpx;
-color:#fff;
-padding-left:7rpx;
-padding-right:24rpx;
-background:#e4374d;
-}
-
-.jgright{
- font-size: 26rpx;
- height:16rpx;
-padding-right:10rpx;
-color:rgb(168, 167, 167);
-}
-
-.jgright span{
- color: rgb(168, 167, 167);
-}
-
-.goodslisttop{
- width: 100%;
-}
-
-.goodslisttop{
- width: 100%;
- margin-top: 5rpx;
- border-bottom: 4rpx solid #eee;
- text-align: center;
-}
-
-.goodslistspan{
-
- margin: 0 auto;
- padding-top: 20rpx;
-}
-
-.xian{
- width: 100%;
- border-bottom: 2rpx solid #eee;
- float: left;
-}
-
-.bodyselect{
- height: 90rpx;
- background-color: white;
- width: 100%;
- line-height:90rpx;
-
-}
-
-
-.changxin{
- overflow: hidden;
- width: 100%;
- padding-left:20rpx;
-
-}
-
-.zhangxi{
- width: 100%;
- background-color:white;
- color: black;
-}
-
-.img{
- height: 100rpx;
- margin-bottom: 0rpx;
- float: left;
- color: black;
- line-height:100rpx;
-display:flex;
-align-items:center;
-
-}
-
-.zhangxi image{
- border-radius:50rpx;
- height: 60rpx;
- width: 60rpx;
- float: left;
-
- background-color: red;
- margin-left: 40rpx;
- margin-right:10rpx;
-
-}
-
-.zhangxi .zssj{
- width: 413rpx;
- margin-left: 28rpx;
- float: right;
- margin-top:32rpx;
-}
-
-.zspan{
- float: left;
- text-align: center;
- display: flex;
- align-items: center;
- justify-content: center;
- height: 48rpx;
- font-size: 28rpx;
- color:#000;
- margin-bottom: 10rpx;
- padding-bottom: 10rpx;
- width: 100%;
- background: #fff;
- border-bottom:3rpx solid #eee;
- margin-top:20rpx;
-
-}
-
-
-
-.mtop{
- text-align: center;
- color: white;
- background-color:rgba(0, 0, 0, .4);
- width: 100%;
- height: 100%;
- position: fixed;
- z-index: 5;top:0;left: 0;
-
-}
-
-.mt1{
- margin-top: 200rpx;
- margin-bottom: 20rpx;
-}
-
-.mts{
- color:#E1E10B;
-}
-
-.mcou{
- font-size: 48rpx;
-
-}
-
-.mfoot{
- width: 100%;
- margin-top: 700rpx;
-}
-
-
-.mbtn{
- margin-top: 60rrpx;
- width: 400rpx;
- background: #666666;
- color: #fff;
- border-radius: 20rpx;
- font-size: 32rpx;
-}
-
-
-
-
-
-
-
-.etop{
- padding-top: 200rpx;
- width: 100%;
- height: 100%;
- position: fixed;
- left: 0rpx;
- top: 0rpx;
- z-index: 12rpx;
-background-color:rgba(0, 0, 0, .4);
-
-}
-
-.emyimage{
- display:flex;
- justify-content: center;
- align-items: center;
-}
-
-
-.emyimage image{
- background-color: red;
- width: 300rpx;
- height: 300rpx;
- margin: 0 auto;
-
-}
-
-.espan{
- font-size: 32rpx;
- margin-top: 10rpx;
-}
-
-.erweima{
- margin-top: 10rpx;
- display: flex;
- width: 100%;
-
-}
-
-.erzhou{
- width: 200rpx;
-
-
- margin-right: 20rpx;
-}
-
-.erzhou image{
- background-color: blanchedalmond;
- width: 200rpx;
- height: 200rpx;
-}
-
-
-.eright{
- width: 500rpx;
- font-size: 32rpx;
-
-}
-
-
-
-.ecc{
- float: right;
- margin-right: 48rpx;
-}
-
-
-.eee{
- padding-top:40rpx;
-
-width:90%;
-height:70%;
-
-padding-left:32rpx;
-margin-left:20rpx;
-
-background-color:white;
-
-}
-
-.clear{
- clear: both;
-}
-
-.down-arrow {
- display: inline-block;
- position: relative;
- width: 40rpx;
- height: 30rpx;
- margin-right: 20rpx;
-}
-
-.down-arrow::after {
- display: inline-block;
- content: " ";
- height: 18rpx;
- width: 18rpx;
- border-width: 0 2rpx 2rpx 0;
- border-color: #000;
- border-style: solid;
- transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
- transform-origin: center;
- transition: transform 0.3s;
- position: absolute;
- top: 50%;
- right: 10rpx;
- margin-top: -10rpx;
-}
-
-.down-arrow1 {
- display: inline-block;
- position: relative;
- width: 40rpx;
- height: 30rpx;
- margin-right: 20rpx;
- margin-top: 12rpx;
-}
-
-.down-arrow1::after {
- display: inline-block;
- content: " ";
- height: 18rpx;
- width: 18rpx;
- border-width: 0 2rpx 2rpx 0;
- border-color: #000;
- border-style: solid;
- transform: matrix(0.71, 0.71, -0.71, 0.71, 0, 0);
- transform-origin: center;
- transition: transform 0.3s;
- position: absolute;
- top: 50%;
- right: 10rpx;
- margin-top: -10rpx;
-}
-
-.down-arrow1::after {
- transform-origin: center;
- transform: rotate(-135deg);
- transition: transform 0.3s;
-}
-
-.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;
-}
-
-.spec-cart-btn.w100 {
- width: 100%;
- margin-left: 0;
- height: 80rpx;
- line-height: 80rpx;
-}
-
-.pt_status_set{
- position: absolute; right: 10rpx; top:50rpx; width: 120rpx; height: 120rpx;
-}
-
-
-
-.xc-goods-details{
-width:479rpx;
-margin-top:20rpx;
-height:77rpx;
-}
-
-.xc-valframe{
- border-radius:7rpx;
-border:1rpx solid;
-margin-top:3rpx;
-}
-.xc-valframe .xc-frame-img{
- width:30rpx;
-height:100%;
-background:#e22b44;
-}
-.xc-valframe .xc-frame-img .picture{
- width:25rpx;
-height:25rpx;
-margin-top:4rpx;
-
-}
-.xc-ellipsis-img{
-width:56rpx;
-height:96rpx;
-
-}
-.xc-ellipsis-img .pictures{
- width:56rpx;height:56rpx;
-}
-.flex_tou{ display: flex; justify-content: center; width: 100%;}
-.xc-ptcomplete{
- width:74%;
-height:105rpx;
-line-height:105rpx;
-float:right;
-
-}
-.xc-ptcomplete .xc-img-frame .img{
- width: 105rpx;
- height: 105rpx;
- float: right;
-}
-.xc-ptcomplete-ladder .xc-img-frame{
- width:201rpx;
- height: 105rpx;
- margin-top:20rpx;
-}
-.xc-ptcomplete-ladder .xc-img-frame .img{
- width: 105rpx;
- height: 105rpx;
- float: right;
- padding-right:6rpx;
-}
-.xc-ptcomplete .xc-img-frame{
- width:190rpx;
- height: 105rpx;
- margin-top:20rpx;
-}
-.xc-ptcomplete .xc-end{
- width:283rpx;
-text-align:right;
-}
-.iw{
-padding-right:33rpx;
-}
-.xc-ptcomplete .xc-img-frames{
- width:360rpx;
-height:105rpx;
-margin-top:20rpx;
-
-}
-.xc-ptcomplete .xc-img-frames .img{
- width: 105rpx;
- height: 105rpx;
- float: right;
- padding-right:6rpx;
-}
-.xc-home-page-frame{
- padding-top:16rpx;
-
-}
-.xc-home-page-frame .xc-home-page{
- background-color: #e22b44;border-radius:15rpx;
-width:90%;
-color:#fff;
-height:60rpx;
-font-size:26rpx;
-line-height:60rpx;
-}
-/* */
-.xc-people-val{
- padding-left:8rpx;
-padding-right:8rpx;
-}
-.xc-onclik{
- width:100%;
-height:70rpx;
-
-}
-.xc-green{
- color: #18ba5f;
- text-align:center;
-flex-grow:1;
-height:90rpx;
-
-
-}
-.xc-ptcomplete-ladder{
- width:74%;
-height:105rpx;
-line-height:105rpx;
-float:right;
-}
-.xc-fail-ladder{
- width:61%;
-height:105rpx;
-line-height:105rpx;
-float:right;
-
-}
-.xc-fail-ladder .xc-img-frame{
- width:61%;
-height:105rpx;
-margin-top:20rpx;
-}
-.xc-fail-ladder .xc-img-frame .img{
- width: 105rpx;
- height: 105rpx;
- float: right;
- padding-right:6rpx;
-}
-.xc-list{
- background-color:#e22b44;
-color:white;
-font-size:17rpx;
-border-radius:6rpx;
-padding:0 5rpx;
-position:absolute;
-top:13rpx;
-left:80rpx;
-width:34rpx;
-line-height:25rpx;
-
-}
-
-.xc-linellae-frame{
- width: 100%;
- height: 60rpx;
- background: #eee;
-}
-.xc-linellae-frame .xc-linellae{
- width: 425rpx;
- height: 1rpx;
- border-bottom: 1rpx solid #a5a5a5;
-}
-.xc-recommend-frame{
-background:#eee;
-width:200rpx;
-height:100%;
-
-}
-.xc-recommend-frame .xc-recommend{
- width: 35rpx;
- height: 27rpx;
- margin-top:7rpx;
-}
-.xc-recommend-frame .xc-recommend-word{
-font-size:26rpx;
-color: #a9a9a9;
-margin-left:5rpx;
-}
-.xc-rmbs{
-
-height:40rpx;
-}
-.xc-shuoming{
- padding-left:10rpx;
-}
-
-
-.poster-container {
- box-sizing: border-box;
- position: fixed;
- 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,.4);
-}
-.poster-wrapper {
- width: 100%;
-}
-
-.poster {
- box-sizing: border-box;
- width: 100%;
- height: 905rpx;
- border-radius: 20rpx;
- /* 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: #ccc;
- width: 50rpx;
- height: 50rpx;
- line-height: 50rpx;
- text-align: center;
- border-radius: 50%;
- position: absolute;
- right: 20rpx;
- top: 20rpx;
-}
-
-.icon-close {
- font-size: 48rpx;
-}
\ No newline at end of file
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/g_filter.wxs b/pages/user/my_service/g_filter.wxs
new file mode 100644
index 0000000..17a817b
--- /dev/null
+++ b/pages/user/my_service/g_filter.wxs
@@ -0,0 +1,12 @@
+var is_acting = function(stime){
+ //判断结束时间减去当前时间 ,如果当前时间大于0则为True
+ if(stime=='') return true;
+ stime = stime.substring(0, 19);
+ var reg = getRegExp("-", "g");
+ stime = stime.replace(reg, '/');
+ var bijiao = getDate(stime) - getDate();
+ return bijiao >= 0 ? false : true;
+}
+module.exports = {
+ is_acting:is_acting
+}
\ No newline at end of file
diff --git a/pages/user/my_service/i_service.js b/pages/user/my_service/i_service.js
index 74d2102..a222f93 100644
--- a/pages/user/my_service/i_service.js
+++ b/pages/user/my_service/i_service.js
@@ -71,10 +71,14 @@ Page({
}
}).then(res => {
wx.hideLoading();
- if (res.data.code == 0) {
+ if (res.data.code == 0 && res.data.data && res.data.data.pageData && res.data.data.pageData.length) {
th.data.curpage++;
var arr1 = th.data.service_List;
var arr2 = res.data.data.pageData;
+
+
+
+
var arr3 = [...arr1, ...arr2];
var ismore = 0;
if (arr3.length == res.data.data.total) ismore = 1
@@ -129,7 +133,7 @@ Page({
"继续使用",
function() {
my_confirm.open_cancel(0);
- var deta_url = "/pages/user/my_service/tment_details?number=" + res.data.data.Number;
+ var deta_url = "/packageG/pages/user/my_service/tment_details?number=" + res.data.data.Number;
wx.navigateTo({
url: deta_url
})
@@ -214,7 +218,7 @@ Page({
"继续预约",
function() {
my_confirm.open_cancel(0);
- var deta_url = "/pages/user/my_service/tment_details?number=" + number;
+ var deta_url = "/packageG/pages/user/my_service/tment_details?number=" + number;
wx.navigateTo({
url: deta_url
})
diff --git a/pages/user/my_service/i_service.wxml b/pages/user/my_service/i_service.wxml
index 642b41e..744f9a3 100644
--- a/pages/user/my_service/i_service.wxml
+++ b/pages/user/my_service/i_service.wxml
@@ -1,3 +1,4 @@
+
@@ -5,7 +6,7 @@
服务记录
- 历史预约
+ 历史预约
@@ -52,11 +53,16 @@
-
+
+
立即使用
+
+ 未开始
+
+
-
+
预约
diff --git a/pages/user/my_service/i_service.wxss b/pages/user/my_service/i_service.wxss
index 071f783..427aa73 100644
--- a/pages/user/my_service/i_service.wxss
+++ b/pages/user/my_service/i_service.wxss
@@ -182,3 +182,7 @@ page {
align-items: center;
z-index: 999;
}
+
+.nostart{
+ background-color:rgb(153,153,153)
+}
diff --git a/pages/user/order_detail/order_detail.js b/pages/user/order_detail/order_detail.js
index 7706973..b342045 100644
--- a/pages/user/order_detail/order_detail.js
+++ b/pages/user/order_detail/order_detail.js
@@ -404,6 +404,68 @@ Page({
th.setData({ paying: 0 });
return false;
}
+
+ var listform=[];
+ var adv_num=0;
+ order_goods.map(ite => {
+ //-- 不是赠品的时候 --
+ if(!ite.is_gift) {
+ let obj = {
+ wareno: ite.goods_sn,
+ price: ite.first_account, //account是平摊后的实收价格
+ qty: ite.goods_num,
+ sumprice: parseFloat(ite.account * ite.goods_num - ite.account_yu-(ite.quan_num?ite.quan_num:0)).toFixed(2)
+ }
+
+ adv_num+=ite.account * ite.goods_num - ite.account_yu-(ite.quan_num?ite.quan_num:0);
+ listform.push(obj)
+ }
+ })
+
+ adv_num=parseFloat(adv_num).toFixed(2);
+ let res1 = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, {
+ data: {
+ accdb: getApp().globalData.config.erpid,
+ ApiName: 'api.pos.shop.advancesum.seek',
+ usercode: "admin",
+ vipid: getApp().globalData.userInfo.erpvipid,
+ oddsum: "0",
+ advancesum: adv_num,
+ storageid: keyid,
+ listform
+ },
+ is_json: 1
+ })
+ if(!res1 && res1.data.code!=0 ){
+ getApp().confirmBox("获取预存的金额失败");
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+ if(res1.data.data.length<=0){
+ getApp().confirmBox("获取预存的金额失败");
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+ var yck=0
+ let resData = res1.data.data
+ resData.map(ite => {
+ yck += ite.advancesum*1
+ })
+ if(yck<=0){
+ getApp().confirmBox("获取预存的金额失败");
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+ if(pre_cut && yck!=pre_cut){
+ getApp().confirmBox("获取预存的金额不对");
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+
}
// 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id}
if (parseInt(order_goods['0']['prom_type']) == 9) {
diff --git a/pages/user/order_detail/order_detail.wxml b/pages/user/order_detail/order_detail.wxml
index 32763bb..f741cbc 100644
--- a/pages/user/order_detail/order_detail.wxml
+++ b/pages/user/order_detail/order_detail.wxml
@@ -183,12 +183,12 @@
- 申请退款
- 申请退款
+ 申请退款
+ 申请退款
删除订单
- 重新退款
+ 重新退款
退款详情
diff --git a/pages/user/order_list/order_list.js b/pages/user/order_list/order_list.js
index f223af5..698afd8 100644
--- a/pages/user/order_list/order_list.js
+++ b/pages/user/order_list/order_list.js
@@ -708,16 +708,78 @@ Page({
//如果使用预存的话,要重新效验下预存金额是否足够
if(order.pre_cut && order.pre_json){
- let pickup_id=order.pickup_id
- let res = await r.promiseGet('/api/weshop/pickup/get/' + os.stoid + '/' + pickup_id, {})
- let keyid = res.data.data.keyid
- let resdata = await th.vipadvancesum(keyid,order.pre_cut,order.pre_json)
- if(resdata.code !=0){
- let msg=resdata.msg || "预存金额不足"
- getApp().confirmBox(msg);
- th.setData({ paying: 0 });
- return false;
- }
+ let pickup_id=order.pickup_id
+ let res = await r.promiseGet('/api/weshop/pickup/get/' + os.stoid + '/' + pickup_id, {})
+ let keyid = res.data.data.keyid
+ let resdata = await th.vipadvancesum(keyid,order.pre_cut,order.pre_json)
+ if(resdata.code !=0){
+ let msg=resdata.msg || "预存金额不足"
+ getApp().confirmBox(msg);
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+ var listform=[];
+ var adv_num=0;
+ order_goods.map(ite => {
+ //-- 不是赠品的时候 --
+ if(!ite.is_gift) {
+ let obj = {
+ wareno: ite.goods_sn,
+ price: ite.first_account, //account是平摊后的实收价格
+ qty: ite.goods_num,
+ sumprice: parseFloat(ite.account * ite.goods_num - ite.account_yu-(ite.quan_num?ite.quan_num:0)).toFixed(2)
+ }
+
+ adv_num+=ite.account * ite.goods_num - ite.account_yu-(ite.quan_num?ite.quan_num:0);
+ listform.push(obj)
+ }
+ })
+
+ adv_num=parseFloat(adv_num).toFixed(2);
+ let res1 = await getApp().request.promisePost(`/api/weshop/delphiapi/saveErpApi`, {
+ data: {
+ accdb: getApp().globalData.config.erpid,
+ ApiName: 'api.pos.shop.advancesum.seek',
+ usercode: "admin",
+ vipid: getApp().globalData.userInfo.erpvipid,
+ oddsum: "0",
+ advancesum: adv_num,
+ storageid: keyid,
+ listform
+ },
+ is_json: 1
+ })
+ if(!res1 && res1.data.code!=0 ){
+ getApp().confirmBox("获取预存的金额失败");
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+ if(res1.data.data.length<=0){
+ getApp().confirmBox("获取预存的金额失败");
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+ var yck=0
+ let resData = res1.data.data
+ resData.map(ite => {
+ yck += ite.advancesum*1
+ })
+ if(yck<=0){
+ getApp().confirmBox("获取预存的金额失败");
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+ if(pre_cut && yck!=pre_cut){
+ getApp().confirmBox("获取预存的金额不对");
+ th.setData({ paying: 0 });
+ return false;
+ }
+
+
}
// 幸运购检查库存量 api/weshop/activitylist/getActLen/{store_id}/{prom_type}/{prom_id}
@@ -3269,7 +3331,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/pages/user/order_list/order_list.wxml b/pages/user/order_list/order_list.wxml
index 685581a..252d19e 100644
--- a/pages/user/order_list/order_list.wxml
+++ b/pages/user/order_list/order_list.wxml
@@ -253,12 +253,12 @@
拼团失败
- 申请退款
- 申请退款
+ 申请退款
+ 申请退款
删除订单
- 重新退款
+ 重新退款
退款详情
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,