Commit 04993a55d5ce1fa87d291c97d41429468f176da7

Authored by WXD-SEASON\season
2 parents 33439a11 770a8902

Merge branch 'dev_oa_lou' into dev_oaandjf

app.json
... ... @@ -53,7 +53,7 @@
53 53 "pages/giftpack/payment/payment",
54 54 "pages/giftpack/buygiftpack/giftpackbuy",
55 55 "pages/giftpack/giftpacklist/giftpacklist",
56   - "pages/giftpack/giftpacklistshop/giftpacklistshop",
  56 +
57 57 "pages/giftpack/mygiftpack/mygiftpack",
58 58 "pages/user/assistance/giftpacklist",
59 59 "pages/user/assistance/task_assistance",
... ... @@ -217,6 +217,7 @@
217 217 "pages/user/slimming/slimming",
218 218 "pages/user/punchInhistory/punchInhistory",
219 219 "pages/user/grow_value/grow_value",
  220 + "pages/giftpack/giftpacklistshop/giftpacklistshop",
220 221 "pages/user/labels/labels",
221 222 "pages/cart/cart2/cart2",
222 223 "pages/barCodeBank/barCodeBank",
... ...
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.js 0 → 100644
  1 +var e = getApp(),
  2 + a = e.globalData.setting,
  3 + os = a,
  4 + t = e.request,
  5 + d = e.globalData;
  6 +var ut = require("../../../../utils/util.js");
  7 +var com = require("../../../../pages/giftpack/public/buy_com.js");
  8 +
  9 +Page({
  10 + data: {
  11 + url: a.url, //接口网址
  12 + iurl: a.imghost, //图片前缀网址
  13 + isBuy: 0,
  14 + getGiftID: '', //礼包id
  15 + giftImage: '',
  16 + giftTitle: '',
  17 + giftDate: '',
  18 + giftPrice: '',
  19 + giftIntegral: '',
  20 + giftPosPrice: '',
  21 + giftQty: '',
  22 + giftRemark: '',
  23 + giftType: '',
  24 + actTitle: '',
  25 + getUrl: '',
  26 + wareCard: [],
  27 + orderSn: "", //订单编号
  28 + lbId: "",
  29 + code: "", //核销码
  30 + c_state: "0", //判断是否已经使用, 0正常 1已使用 2已过期
  31 + is_lb: 0, //是否有礼包
  32 + default_color: null,
  33 + first_leader: e.globalData.first_leader || 0, // 推荐人ID
  34 +
  35 + //门店相关
  36 + ismend: 0,
  37 + is_sec_mend: 0,
  38 + sto_sele_name: "", //选中的门店名称
  39 + sto_sele_id: "", //选中的门店id
  40 + sto_sele_distr: "", //选择的门店的配送方式
  41 + is_show_sto_cat: 1, //是否显示门店分类
  42 + only_pk: null,
  43 + all_sto: null,
  44 + sec_sto: null, //选择了的门店分类
  45 + pickpu_list: null, //读出的所有门店list
  46 + def_pickpu_list: null, //一开始5个门店list
  47 + sec_pick_index: 0, //第二级门店选择ID
  48 + fir_pick_index: 0, //第一级门店选择ID
  49 + all_pick_list: null,//所有的门店先记录起来
  50 + select_store: 0, //选择更多
  51 + index: 1,
  52 + more_store: 0, //选择门店
  53 + sort_store: 0, //门店分类
  54 + choice_sort_store: 0, //选择分类门店
  55 + new_user: 0, //新用户
  56 + def_pick_store: null, // 默认的门店
  57 + fir_def_store: null, //客户默认的门店的
  58 + lat: null, //维度
  59 + lon: null, //经度
  60 + is_get_local_ok: 0, //获取坐标是否完成
  61 + region_name: "门店分类", //区域的名字
  62 + is_gps: 1,
  63 + open_ind_store: 0, //哪里打开的门店列表的控制属性
  64 + default_store: {}, //创建添加默认门店地址的对象
  65 + store: 0,
  66 + openSpecModal: 0,
  67 + sto_sele_name_1: '',
  68 + share_goods_img:'', //礼包的分享图
  69 + giftImageCover:null,
  70 + canvasHidden:true,
  71 + screenWidth: 0
  72 + },
  73 + onLoad: function (options) {
  74 +
  75 + var th = this;
  76 + options.isBuy=0
  77 + this.setData({
  78 + params: options,
  79 + })
  80 +
  81 + // getApp().getConfig(function (e) {
  82 + // th.setData({sto_sele_name_1: e.store_name})
  83 + // })
  84 +
  85 + // getApp().getConfig2(function (e) {
  86 + // var json_d = JSON.parse(e.switch_list);
  87 + // th.setData({
  88 + // bconfig: e,
  89 + // sys_switch: json_d,
  90 + // is_retail_price: json_d.is_retail_price || 0
  91 + // });
  92 + // })
  93 +
  94 + //获取用户设备信息,屏幕宽度
  95 + wx.getSystemInfo({
  96 + success: res => {
  97 + th.setData({
  98 + screenWidth: res.screenWidth
  99 + })
  100 + }
  101 + });
  102 +
  103 + },
  104 + init() {
  105 + let options = this.data?.params; // this.data == null ? undefined:this.data.params
  106 + var th = this;
  107 + this.setData({
  108 + getUserID: d.user_id,
  109 + getStorageID: a.stoid,
  110 + })
  111 +
  112 + if(!options.lbId && options.scene){
  113 + var gid_str = decodeURIComponent(options.scene);
  114 + gid_str = gid_str.split("_");
  115 +
  116 + options.lbId=gid_str[0];
  117 + options.first_leader=gid_str[1];
  118 + options.isBuy=1;
  119 + }
  120 +
  121 +
  122 + this.setData({
  123 + isBuy: options.isBuy,
  124 + getGiftID: options.lbId,
  125 + orderSn: options.orderSn,
  126 + flag: options.flag, // 如果从商品详情页的促销处点击专享礼包跳转到此页,则flag为1
  127 + })
  128 + if (options.lbId) th.data.lbId = options.lbId;
  129 + //-- 获取分享人的ID --
  130 + var first_leader = options.first_leader || getApp().globalData.first_leader;
  131 + if (first_leader) {
  132 + this.setData({
  133 + first_leader,
  134 + })
  135 + //-- user_id代过来免登录 --
  136 + getApp().globalData.first_leader = first_leader;
  137 + //调用接口判断是不是会员
  138 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + os.stoid + "/" + first_leader, {}).then(res => {
  139 + if (res.data.code == 0) {
  140 + getApp().globalData.guide_id = res.data.data.id;
  141 + }
  142 + })
  143 + }
  144 + // th.close();
  145 +
  146 +
  147 + if (this.data.flag == 1) {
  148 + this.getZxlbDetails();
  149 + } else {
  150 + this.GetMyGiftList();
  151 + // if (this.data.isBuy == 0) {
  152 + // this.GetMyGiftList();
  153 + // } else if (this.data.isBuy == 1) {
  154 + // this.GetBuyGiftList();
  155 + // }
  156 +
  157 + }
  158 +
  159 + },
  160 +
  161 + onShow: function () {
  162 + getApp().check_can_share();
  163 + getApp().is_Single_page(this, function () {
  164 + //--先判断会员状态--
  165 + var user_info = getApp().globalData.userInfo;
  166 + // if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  167 + // getApp().goto('/packageE/pages/togoin/togoin');
  168 + // return false;
  169 + // }
  170 + this.init();
  171 + })
  172 + },
  173 + GetBuyPrice: function (e) {
  174 + var that = this.data;
  175 + var th = this;
  176 + //如果还没有开始的话
  177 + if (th.data.isStart != 1) {
  178 + getApp().my_warnning("活动还没有开始", 0, th);
  179 + return false;
  180 + }
  181 +
  182 + this.data.payMoney = th.data.sele_g.payMoney;
  183 + th.setData({buyType: 2})
  184 + if (th.data.sele_g.is_pickup) {
  185 + th.setData({
  186 + openSpecModal: 1
  187 + })
  188 + } else {
  189 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  190 + my_confirm.open(
  191 + "是否确定购买该礼包",
  192 + "取消",
  193 + "确定",
  194 + function () {
  195 + my_confirm.open_cancel(0);
  196 + },
  197 + function () {
  198 + my_confirm.open_cancel(0);
  199 + com.buy_libao(th)
  200 + }
  201 + )
  202 + }
  203 +
  204 +
  205 + },
  206 + GetBuyIntegral: function (e) {
  207 + var that = this.data;
  208 + var th = this;
  209 +
  210 + //如果还没有开始的话
  211 + if (th.data.isStart != 1) {
  212 + getApp().my_warnning("活动还没有开始", 0, th);
  213 + return false;
  214 + }
  215 +
  216 + th.setData({buyType: 1});
  217 + if (th.data.sele_g.is_pickup) {
  218 + th.setData({
  219 + openSpecModal: 1
  220 + })
  221 + } else {
  222 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  223 + my_confirm.open(
  224 + "是否确定兑换该礼包",
  225 + "取消",
  226 + "确定",
  227 + function () {
  228 + my_confirm.open_cancel(0);
  229 + },
  230 + function () {
  231 + my_confirm.open_cancel(0);
  232 + com.buy_libao(th)
  233 + })
  234 + }
  235 +
  236 +
  237 + },
  238 +
  239 + GetMyGiftList: function () {
  240 + var _this = this;
  241 + var th = this;
  242 + getApp().request.get('/api/weshop/marketing/my/giftbag/detail/get', {
  243 + isShowLoading: true,
  244 + data: {
  245 + "storeId": a.stoid, //商家ID
  246 + "userId": th.data.params.userId, //用户ID
  247 + "orderSn": th.data.orderSn
  248 + // "userId": d.user_id, //用户ID
  249 + // "orderSn": th.data.orderSn
  250 + // "giftBagId":th.data.params.lbId
  251 + },
  252 + success: function (res) {
  253 + if (res.data.code == 0) {
  254 + console.log('商品------++')
  255 + console.log(res)
  256 + th.setData({
  257 + giftImage: th.data.iurl + res.data.data.lbUrl,
  258 + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl),
  259 + giftTitle: res.data.data.giftTitle,
  260 + default_color: res.data.data.bgcolor
  261 + })
  262 +
  263 + if (res.data.data.iswarelbtype == 1) {
  264 + th.setData({iswarelbtype: 1})
  265 + }
  266 +
  267 + if (!res.data.data.giftRemark || res.data.data.giftRemark == '') {
  268 + th.setData({
  269 + giftRemark: '暂无详情......'
  270 + })
  271 + } else {
  272 + th.setData({
  273 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  274 + })
  275 + }
  276 +
  277 + //---获取日期的时间戳---
  278 + var t_endtime = res.data.data.endTime;
  279 + t_endtime = t_endtime.replace(/-/g, '/');
  280 + var t_date = new Date(t_endtime) / 1000;
  281 + var t_now = ut.gettimestamp();
  282 +
  283 + var t_starttime = res.data.data.starTime;
  284 + t_starttime = t_starttime.replace(/-/g, '/');
  285 + var t_sdate = new Date(t_starttime) / 1000;
  286 +
  287 + if (res.data.data.goodsUseState) th.setData({
  288 + c_state: 1
  289 + })
  290 + else if (t_date <= t_now)
  291 + th.setData({
  292 + c_state: 2
  293 + })
  294 + else if (t_sdate > t_now)
  295 + th.setData({
  296 + c_state: -1
  297 + })
  298 + th.setData({
  299 + giftDate: res.data.data.endTime,
  300 + giftPosPrice: res.data.data.giftPosPrice,
  301 + giftQty: res.data.data.giftQty,
  302 + giftIntegral: res.data.data.payIntegral,
  303 + giftPrice: res.data.data.payMoney,
  304 + giftType: res.data.data.actType,
  305 + actTitle: res.data.data.actTitle,
  306 + wareCard: res.data.data.wareCard,
  307 + lbId: res.data.data.lbId
  308 + })
  309 + //判断是否有礼包
  310 + for (var i = 0; i < res.data.data.wareCard.length; i++) {
  311 + if (res.data.data.wareCard[i].lbType == 1) {
  312 + th.setData({
  313 + is_lb: 1
  314 + })
  315 + break;
  316 + }
  317 + }
  318 +
  319 + if (res.data.data.pickup_id) {
  320 + getApp().request.get("/api/weshop/pickup/get/" + os.stoid + "/" + res.data.data.pickup_id, {
  321 + success: function (res) {
  322 + if (res.data.code == 0) {
  323 + th.setData({pick_up: res.data.data});
  324 + }
  325 + }
  326 + });
  327 +
  328 + }
  329 +
  330 +
  331 + } else {
  332 + getApp().my_warnning(res.data.msg, 0, th);
  333 + return false;
  334 + }
  335 + }
  336 + });
  337 +
  338 + },
  339 + GetBuyGiftList: function () {
  340 + var _this2 = this;
  341 + var th = this.data;
  342 + getApp().request.get('/api/weshop/marketing/giftbag/detail/get', {
  343 + isShowLoading: true,
  344 + data: {
  345 + "storeId": a.stoid, //商家ID
  346 + "userId": d.user_id, //用户ID
  347 + "giftBagId": th.getGiftID
  348 + },
  349 + success: function success(res) {
  350 + if (res.data.code == 0) {
  351 + _this2.setData({
  352 + giftImage: th.iurl + res.data.data.lbUrl,
  353 + giftImageCover: th.iurl + (_this2.data.params.cover_img ? _this2.data.params.cover_img: res.data.data.lbUrl),
  354 + giftTitle: res.data.data.giftTitle,
  355 + default_color: res.data.data.bgcolor
  356 + })
  357 + if (res.data.data.giftRemark == '') {
  358 + _this2.setData({
  359 + giftRemark: '暂无详情......'
  360 + })
  361 + } else {
  362 + _this2.setData({
  363 + giftRemark: res.data.data.giftRemark.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  364 + })
  365 + }
  366 +
  367 + var isStart = 0;
  368 + var now = ut.gettimestamp();
  369 +
  370 + var str = res.data.data.starTime.replace(/-/g, '/');
  371 + var start = Date.parse(new Date(str));
  372 + start = start / 1000;
  373 + if (start < now) isStart = 1;
  374 +
  375 + _this2.setData({
  376 + giftDate: res.data.data.endTime,
  377 + giftStart: res.data.data.starTime,
  378 + giftPosPrice: res.data.data.giftPosPrice,
  379 + giftQty: res.data.data.giftQty,
  380 + giftIntegral: res.data.data.payIntegral,
  381 + giftPrice: res.data.data.payMoney,
  382 + giftType: res.data.data.actType,
  383 + actTitle: res.data.data.actTitle,
  384 + wareCard: res.data.data.wareCard,
  385 + isStart: isStart,
  386 + sele_g: res.data.data
  387 + })
  388 +
  389 +
  390 + var sele_g = res.data.data;
  391 + //需不需要门店,不需要门店返回
  392 + if (!sele_g.is_pickup) return false;
  393 +
  394 + com.wait_for_store_config(_this2);
  395 + com.set_user_mo_store(_this2, os, function () {
  396 + if (sele_g.pickup_list && _this2.data.def_pick_store) {
  397 + com.check_def_pk(_this2);
  398 + }
  399 + });
  400 + com.get_sto(_this2, os);
  401 +
  402 +
  403 + } else {
  404 + getApp().my_warnning(res.data.msg, 0, _this2);
  405 + return false;
  406 + }
  407 + }
  408 + });
  409 +
  410 + },
  411 +
  412 + getZxlbDetails: function () {
  413 +
  414 + var th = this;
  415 + getApp().request.get('/api/weshop/marketing/giftbag/detail/getNew', {
  416 + isShowLoading: true,
  417 + data: {
  418 + "storeId": a.stoid, //商家ID
  419 + //"userId": d.user_id, //用户ID
  420 + "giftBagId": th.data.lbId
  421 + },
  422 + success: function (res) {
  423 + if (res.data.code == 0) {
  424 + th.setData({
  425 + giftImage: th.data.iurl + res.data.data.lbUrl,
  426 + giftImageCover: th.data.iurl + (th.data.params.cover_img ? th.data.params.cover_img: res.data.data.lbUrl),
  427 + giftTitle: res.data.data.lbTitle,
  428 + default_color: res.data.data.bgcolor
  429 + })
  430 + if (res.data.data.lbIntro == '') {
  431 + th.setData({
  432 + giftRemark: '暂无详情......'
  433 + })
  434 + } else {
  435 + th.setData({
  436 + giftRemark: res.data.data.lbIntro.replace(/\<img/gi, '<img style="max-width:100%;height:auto;display:block"')
  437 + })
  438 + }
  439 +
  440 + //---获取日期的时间戳---
  441 + let exchangeType = res.data.data.exchangeType;
  442 + let exchangeDay = res.data.data.exchangeDay;
  443 + let exchangeStartTime = res.data.data.exchangeStartTime;
  444 + let exchangeEndTime = res.data.data.exchangeEndTime;
  445 + // let t_endtime;
  446 +
  447 + if (exchangeType == 2) {
  448 + if (exchangeStartTime == 0 || !exchangeStartTime) {
  449 + exchangeStartTime = ut.gettimestamp();
  450 + }
  451 + exchangeStartTime = ut.formatTime(exchangeStartTime, 0);
  452 + exchangeEndTime = ut.formatTime(exchangeEndTime, 0);
  453 + }
  454 +
  455 +
  456 + th.setData({
  457 + // giftDate: t_endtime,
  458 + giftPosPrice: res.data.data.oldPrice,
  459 + giftQty: res.data.data.lbNum,
  460 + giftIntegral: res.data.data.exchangeIntegral,
  461 + giftPrice: res.data.data.lbPrice,
  462 + giftType: res.data.data.actType,
  463 + actTitle: res.data.data.actTitle,
  464 + wareCard: res.data.data.wareCard,
  465 + lbId: res.data.data.lbId,
  466 + exchangeType: exchangeType,
  467 + exchangeDay: exchangeDay,
  468 + exchangeStartTime: exchangeStartTime,
  469 + exchangeEndTime: exchangeEndTime,
  470 + })
  471 + //判断是否有礼包
  472 + for (var i = 0; i < res.data.data.wareCard.length; i++) {
  473 + if (res.data.data.wareCard[i].lbType == 1) {
  474 + th.setData({
  475 + is_lb: 1
  476 + })
  477 + break;
  478 + }
  479 + }
  480 + } else {
  481 + getApp().my_warnning(res.data.msg, 0, th);
  482 + return false;
  483 + }
  484 + }
  485 + });
  486 +
  487 + },
  488 +
  489 +
  490 + //显示核销码
  491 + code_show: function (e) {
  492 + var th = this;
  493 + //--获取成功的时候--
  494 + var no = th.data.code;
  495 + var qc_com = th.selectComponent("#qc_com"); //组件的id
  496 + var obj = {
  497 + val: no,
  498 + content: "请将二维码展示给核销员,收货更快捷"
  499 + };
  500 + qc_com.open(obj)
  501 + },
  502 + //获取核销码
  503 + getcode: function (e) {
  504 + var th = this;
  505 + var orderSn = th.data.orderSn; //订单号
  506 + let codeId = e.currentTarget.dataset.codeid;
  507 + var json = {
  508 + "storeId": a.stoid,
  509 + "orderSn": orderSn,
  510 + }
  511 + if (codeId && codeId !== "") {
  512 + json.id = codeId
  513 + }
  514 + var data = JSON.stringify(json);
  515 + var url = th.data.url + "/api/weshop/marketing/gift/goods/verify/code/get"; //预约接口地址
  516 + getApp().request.json_post(url, json,
  517 + function (res) {
  518 + if (res.data.code == 0) {
  519 + th.setData({
  520 + code: res.data.data
  521 + })
  522 + th.code_show();
  523 + } else {
  524 + getApp().my_warnning(res.data.msg, 0, th);
  525 + }
  526 + },
  527 + function (res) {
  528 +
  529 + },
  530 + "put"
  531 + )
  532 +
  533 + },
  534 + //界面跳转
  535 + goto: function (e) {
  536 + var th = this;
  537 + var url = e.currentTarget.dataset.url;
  538 + getApp().goto(url);
  539 + },
  540 + //图片失败,默认图片
  541 + bind_bnerr2: function (e) {
  542 + var _errImg = e.target.dataset.errorimg;
  543 + var _errObj = {};
  544 + _errObj[_errImg] = "/miniapp/images/giftbag/gift01.png";
  545 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  546 + },
  547 +
  548 + //图片失败,默认图片
  549 + bind_bnerr: function (e) {
  550 + var _errImg = e.target.dataset.errorimg;
  551 + var _errObj = {};
  552 + _errObj[_errImg] = this.data.iurl + "miniapp/images/big_back.jpg";
  553 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  554 + //this.setData({ giftImage: this.data.iurl + "/miniapp/images/giftbag/gift01.png"});
  555 +
  556 + },
  557 +
  558 + //关闭导航
  559 + // close: function () {
  560 + // var th = this;
  561 + // var nav_b = th.selectComponent("#nav_b"); //组件的id
  562 + // nav_b.close_box();
  563 + // nav_b.set_name("礼包", "/pages/giftpack/buygiftpack/giftpackbuy");
  564 + // },
  565 +
  566 + //--- 分享设置 --
  567 + onShareAppMessage: function (e) {
  568 + getApp().globalData.no_clear = 1;
  569 + var curPage = this;
  570 + var pagePath = curPage.route; //当前页面url
  571 + if (pagePath.indexOf('/') != 0) {
  572 + pagePath = '/' + pagePath;
  573 + }
  574 + pagePath += "?isBuy=1" + "&lbId=" + this.data.getGiftID + "&first_leader=" + this.data.getUserID;
  575 + // if (this.data.isBuy == 0) {
  576 + // pagePath += "&orderSn=" + this.data.orderSn;
  577 + // } else {
  578 + // pagePath += "&lbId=" + this.data.getGiftID;
  579 + // }
  580 + // console.log('pagePath', pagePath);
  581 + return {
  582 + title: "礼包详情",
  583 + path: pagePath,
  584 + }
  585 + },
  586 +
  587 + /**
  588 + * 用户分享朋友圈
  589 + */
  590 + onShareTimeline() {
  591 + getApp().globalData.no_clear = 1;
  592 +
  593 + var pagePath = "&isBuy=1" + "&lbId=" + this.data.lbId + "&first_leader=" + this.data.getUserID;
  594 + var user_id = getApp().globalData.user_id;
  595 + if (!user_id) user_id = 0;
  596 +
  597 + return {
  598 + title: "礼包详情",
  599 + query: 'first_leader=' + user_id + pagePath
  600 + }
  601 + },
  602 +
  603 + //免费领取
  604 + GetFree: function (e) {
  605 + var that = this.data;
  606 + var th = this;
  607 +
  608 + //如果还没有开始的话
  609 + if (th.data.isStart != 1) {
  610 + getApp().my_warnning("活动还没有开始", 0, th);
  611 + return false;
  612 + }
  613 +
  614 + th.setData({buyType: 3});
  615 + if (th.data.sele_g.is_pickup) {
  616 + th.setData({
  617 + openSpecModal: 1
  618 + })
  619 + } else {
  620 +
  621 +
  622 + // var id = e.currentTarget.dataset.id;//活动id
  623 + var my_confirm = th.selectComponent("#my_confirm"); //组件的id
  624 + my_confirm.open(
  625 + "是否确定领取该礼包",
  626 + "取消",
  627 + "确定",
  628 + function () {
  629 + my_confirm.open_cancel(0);
  630 + },
  631 + function () {
  632 + my_confirm.open_cancel(0);
  633 + com.buy_libao(th)
  634 + })
  635 + }
  636 +
  637 +
  638 + },
  639 +
  640 + //--- 设置一下默认库存的数量 ----
  641 + set_def_storage(ee) {
  642 + var that = this, th = this;
  643 + that.data.fir_def_store = ee;
  644 +
  645 + that.setData({
  646 + def_pick_store: ee,
  647 + sto_sele_name: ee.pickup_name,
  648 + sto_sele_id: ee.pickup_id,
  649 + sto_sele_distr: ee.distr_type
  650 + })
  651 + },
  652 + // 选择门店
  653 + choice_store: function (ee) {
  654 + var th = this;
  655 + var ind = ee.currentTarget.dataset.ind;
  656 + var bconfig = th.data.bconfig;
  657 +
  658 + //如果开启了,则不在选择门店
  659 + if (this.data.sys_switch.is_pricing_open_store && getApp().globalData.pk_store) {
  660 + return false;
  661 + }
  662 + if (!th.data.only_pk && !th.data.def_pickpu_list) {
  663 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  664 + return false;
  665 + }
  666 +
  667 + if (th.data.only_pk && !th.data.only_pk.length) {
  668 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  669 + return false;
  670 + }
  671 + if (th.data.def_pickpu_list && !th.data.def_pickpu_list.length) {
  672 + getApp().confirmBox("门店库存不足", null, 25000, !1);
  673 + return false;
  674 + }
  675 +
  676 +
  677 + if (bconfig && bconfig.is_sort_storage) {
  678 + wx.getLocation({
  679 + type: 'gcj02',
  680 + success: function (res) {
  681 +
  682 + th.data.lat = res.latitude;
  683 + th.data.lon = res.longitude;
  684 + th.data.is_get_local_ok = 1;
  685 + th.setData({
  686 + is_gps: 1
  687 + });
  688 + //th.onShow();
  689 + com.get_sto(th, os);
  690 + },
  691 + fail: function (res) {
  692 + //th.onShow();
  693 + th.data.is_get_local_ok = 1;
  694 + com.get_sto(th, os);
  695 + if (res.errCode == 2) {
  696 + th.setData({
  697 + is_gps: 0
  698 + });
  699 + if (th.data.is_gps == 0) {
  700 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  701 + }
  702 + } else {
  703 + th.setData({
  704 + is_gps: "3"
  705 + });
  706 + }
  707 +
  708 + }
  709 + })
  710 + } else {
  711 + th.data.is_get_local_ok = 1;
  712 + com.get_sto(th, os);
  713 + }
  714 +
  715 + if (ind != undefined && ind != null) {
  716 + this.setData({
  717 + open_ind_store: ind,
  718 + store: 1,
  719 + openSpecModal: !1,
  720 + openSpecModal_pt: !1,
  721 + openSpecModal_flash_normal: !1,
  722 + })
  723 + } else {
  724 + this.setData({
  725 + store: 1,
  726 + openSpecModal: !1,
  727 + openSpecModal_pt: !1,
  728 + openSpecModal_flash_normal: !1
  729 +
  730 + })
  731 + }
  732 + },
  733 + //关闭选择门店
  734 + close_popup: function (e) {
  735 + var th = this;
  736 + this.setData({
  737 + store: 0,
  738 + choice_sort_store: 0,
  739 + sort_store: 0,
  740 + fir_pick_index: 0,
  741 + sec_pick_index: 0
  742 + })
  743 +
  744 + var openindstore = this.data.open_ind_store;
  745 + if (openindstore == 1) {
  746 + th.setData({
  747 + openSpecModal: !0,
  748 + openSpecModal_ind: openindstore,
  749 + });
  750 + } else if (openindstore == 2) {
  751 + th.setData({
  752 + openSpecModal: !0,
  753 + openSpecModal_ind: openindstore,
  754 + });
  755 + } else if (openindstore == 4) { //4就是拼团
  756 + th.setData({
  757 + openSpecModal_pt: 1, //打开拼团购买界面
  758 + store: 0, //关闭门店
  759 + choice_sort_store: 0, //关闭门店2级
  760 + sort_store: 0, //关闭门店2级
  761 + });
  762 + } else {
  763 + th.setData({
  764 + store: 0,
  765 + choice_sort_store: 0,
  766 + sort_store: 0
  767 + })
  768 + }
  769 +
  770 +
  771 + },
  772 +
  773 + //选择更多门店
  774 + more_store: function () {
  775 + this.setData({
  776 + sort_store: 1
  777 + });
  778 + },
  779 + // 返回按钮
  780 + returns: function () {
  781 + this.setData({
  782 + sort_store: 0,
  783 + choice_sort_store: 0
  784 + });
  785 + },
  786 + //---选择分类门店---
  787 + choice_sort_store: function (e) {
  788 + var index = e.currentTarget.dataset.index;
  789 + var region_name = e.currentTarget.dataset.region;
  790 + var item = this.data.all_sto[index];
  791 + this.setData({
  792 + region_name: region_name,
  793 + sort_store: 0,
  794 + choice_sort_store: 1,
  795 + sec_sto: item,
  796 + sec_pick_index: 0
  797 + });
  798 + },
  799 +
  800 + choose_for_store_fir: function (e) {
  801 + var index_c = e.currentTarget.dataset.ind;
  802 + var th = this;
  803 + th.setData({
  804 + fir_pick_index: index_c
  805 + })
  806 +
  807 + },
  808 +
  809 + //确定def_pick为选择的门店
  810 + sure_pick: function (e) {
  811 + var th = this;
  812 + var item = null;
  813 + var openindstore = th.data.open_ind_store;
  814 +
  815 + if (th.data.choice_sort_store == 0) {
  816 + var index = th.data.fir_pick_index;
  817 + if (th.data.is_show_sto_cat == 1) {
  818 + item = th.data.def_pickpu_list[index];
  819 + } else {
  820 + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
  821 + }
  822 +
  823 + } else {
  824 + var index = th.data.sec_pick_index;
  825 + item = th.data.sec_sto.s_arr[index];
  826 + }
  827 +
  828 + if(!item) return false;
  829 +
  830 + if (!th.data.sele_g) return false;
  831 +
  832 + th.setData({
  833 + def_pick_store: item,
  834 + sto_sele_name: item.pickup_name,
  835 + sto_sele_id: item.pickup_id,
  836 + sto_sele_distr: item.distr_type,
  837 + store: 0,
  838 + choice_sort_store: 0,
  839 + fir_pick_index: 0,
  840 + openSpecModal: !0,
  841 + });
  842 +
  843 +
  844 + },
  845 + //---点击二级之后的选择---
  846 + choose_for_store: function (e) {
  847 + var index_c = e.currentTarget.dataset.ind;
  848 + var th = this;
  849 + th.setData({
  850 + sec_pick_index: index_c,
  851 + fir_pick_index: index_c
  852 + })
  853 +
  854 + },
  855 + //把选择的门店设置成默认的门店def_pick
  856 + set_def_pick: function (e) {
  857 + var th = this;
  858 + var item = null;
  859 + if (th.data.choice_sort_store == 0) {
  860 + var index = th.data.fir_pick_index;
  861 + if (th.data.is_show_sto_cat == 1) {
  862 + item = th.data.def_pickpu_list[index];
  863 + } else {
  864 + item = th.data.only_pk?th.data.only_pk[index]:null; //当没有门店分类的时候
  865 + }
  866 + } else {
  867 + var index = th.data.sec_pick_index;
  868 + item = th.data.sec_sto.s_arr[index];
  869 + }
  870 +
  871 + if(!item) return false;
  872 +
  873 + th.setData({
  874 + def_pick_store: item,
  875 + sto_sele_name: item.pickup_name,
  876 + sto_sele_id: item.pickup_id,
  877 + sto_sele_distr: item.distr_type,
  878 + store: 0,
  879 + choice_sort_store: 0,
  880 + openSpecModal: !0,
  881 + });
  882 +
  883 + var user_id = getApp().globalData.user_id;
  884 + var def_pickup_id = item.pickup_id;
  885 + getApp().request.put('/api/weshop/users/update', {
  886 + data: {
  887 + user_id: user_id,
  888 + def_pickup_id: def_pickup_id
  889 + },
  890 + success: function (res) {
  891 + if (res.data.code == 0) {
  892 + if (th.data.choice_sort_store == 0) th.setData({
  893 + fir_pick_index: 0
  894 + });
  895 + getApp().globalData.pk_store = item;
  896 + } else {
  897 + getApp().my_warnning("设置默认门店地址失败", 0, th)
  898 + }
  899 +
  900 + }
  901 + });
  902 +
  903 +
  904 + },
  905 + closeSpecModal: function () {
  906 + this.setData({openSpecModal: 0});
  907 + },
  908 +
  909 + buy_libao: function () {
  910 + com.buy_libao(this)
  911 + },
  912 +
  913 +
  914 + clickShare() {
  915 + // if (!getApp().globalData.user_id) {
  916 + // getApp().goto("/packageE/pages/togoin/togoin");
  917 + // return false;
  918 + // }
  919 + this.setData({
  920 + share_hidden: true,
  921 + });
  922 + },
  923 +
  924 + send() {
  925 + this.setData({
  926 + share_hidden: false,
  927 + });
  928 + },
  929 +
  930 + cancel() {
  931 + this.setData({
  932 + share_hidden: false,
  933 + });
  934 + },
  935 +
  936 +
  937 + //--定义的保存图片方法,分享团---
  938 + saveImageToPhotosAlbum: function () {
  939 + //--先判断会员状态--
  940 + var user_info = getApp().globalData.userInfo;
  941 + if (user_info == null || user_info.mobile == undefined || user_info.mobile == "" || user_info.mobile == null) {
  942 + //getApp().my_warnning("请先登录",0,this);
  943 + // wx.navigateTo({url: '/packageE/pages/togoin/togoin',})
  944 + // return false;
  945 + }
  946 +
  947 + if (this.data.share_hidden) {
  948 + this.setData({share_hidden: false,});
  949 + }
  950 +
  951 + wx.showLoading({title: '生成中...',})
  952 + var that = this, th = that;
  953 + //设置画板显示,才能开始绘图
  954 + that.setData({
  955 + canvasHidden: false
  956 + })
  957 +
  958 + var app = getApp();
  959 + var unit = that.data.screenWidth / 750 * 1.35; //基础单位,
  960 + var scene = th.data.lbId + "";
  961 +
  962 + var user_id = getApp().globalData.user_id ? getApp().globalData.user_id : 0;
  963 + if (user_id > 0) {
  964 + scene += "_" + user_id;
  965 + }
  966 + ///二微码
  967 + var path3 = os.url + "/api/wx/open/app/user/getWeAppEwm/" +
  968 + os.stoid + "?sceneValue=" + scene + "&pageValue=pages/giftpack/giftpacklist/giftpacklist";
  969 +
  970 + // 读取文件成功则OK--
  971 + wx.getImageInfo({
  972 + src: path3,
  973 + success: function (res) {
  974 + th.get_goods_temp(function () {
  975 + var vpath = res.path;
  976 + var context = wx.createCanvasContext('share');
  977 + // let share_goods_img = th.params.cover_img
  978 + th.drawPoster(context, unit, th.data.share_goods_img, vpath, 0);
  979 +
  980 + //把画板内容绘制成图片,并回调 画板图片路径
  981 + context.draw(false, function () {
  982 + setTimeout(function () {
  983 + wx.canvasToTempFilePath({
  984 + x: 0,
  985 + y: 0,
  986 + width: 750,
  987 + height: 1217,
  988 + destWidth: 1.2 * 750 * 750 / that.data.screenWidth,
  989 + destHeight: 1.2 * 1217 * 750 / that.data.screenWidth,
  990 + canvasId: 'share',
  991 + success: function (res) {
  992 +
  993 + that.setData({
  994 + shareImgPath: res.tempFilePath,
  995 + canvasHidden: true
  996 + })
  997 +
  998 + if (!res.tempFilePath) {
  999 + wx.showModal({
  1000 + title: '提示',
  1001 + content: '图片绘制中,请稍后重试',
  1002 + showCancel: false
  1003 + })
  1004 + return false;
  1005 + }
  1006 +
  1007 + that.setData({
  1008 + showPoster: true,
  1009 + });
  1010 + wx.hideLoading();
  1011 + }
  1012 + })
  1013 + }, 800)
  1014 +
  1015 + });
  1016 + })
  1017 + },
  1018 + fail: function (res) {
  1019 + console.log(res);
  1020 + wx.hideLoading();
  1021 +
  1022 + }
  1023 + });
  1024 + },
  1025 +
  1026 + //-- 小程序绘制海报 --
  1027 + drawPoster(context, unit, img, vpath, type) {
  1028 + // 1.灰色背景
  1029 + context.setFillStyle('#f2f1f6');
  1030 + context.rect(0, 0, 554 * unit, 899 * unit);
  1031 + context.fill();
  1032 +
  1033 + // 2.商城名称
  1034 + let shopName = this.data.sto_sele_name_1;
  1035 + context.setTextAlign('center');
  1036 + context.setFontSize(26 * unit);
  1037 + context.setFillStyle('black');
  1038 + context.fillText(shopName, 277 * unit, 60 * unit);
  1039 +
  1040 + // 3.推荐来源
  1041 + let fromText = `来自${getApp().globalData.userInfo.nickname}的推荐`;
  1042 + context.setTextAlign('center');
  1043 + context.setFontSize(22 * unit);
  1044 + context.setFillStyle('#96959a');
  1045 + context.fillText(fromText, 277 * unit, 105 * unit);
  1046 +
  1047 + // 4.海报背景
  1048 + context.setFillStyle('white');
  1049 + context.fillRect(37 * unit, 157 * unit, 480 * unit, 673 * unit);
  1050 +
  1051 + // 5.商品图片
  1052 + // 图片的x坐标
  1053 + let bg_x = 37 * unit
  1054 + // 图片的y坐标
  1055 + let bg_y = 157 * unit
  1056 + // 图片宽度
  1057 + let bg_w = 480 * unit
  1058 + // 图片高度
  1059 + let bg_h = 474 * unit
  1060 + // 图片圆角
  1061 + let bg_r = 4
  1062 + // 绘制海报背景图片圆角
  1063 + context.save()
  1064 + context.beginPath()
  1065 + context.arc(bg_x + bg_r, bg_y + bg_r, bg_r, Math.PI, Math.PI * 1.5)
  1066 + context.arc(bg_x + bg_w - bg_r, bg_y + bg_r, bg_r, Math.PI * 1.5, Math.PI * 2)
  1067 + context.arc(bg_x + bg_w, bg_y + bg_h, bg_r, 0, Math.PI * 0.5)
  1068 + context.arc(bg_x, bg_y + bg_h, 0, Math.PI * 0.5, Math.PI)
  1069 + context.clip()
  1070 + context.drawImage(img, bg_x, bg_y, bg_w, bg_h);
  1071 + context.restore();
  1072 +
  1073 + // 6.强烈推荐
  1074 + let src = '';
  1075 + context.beginPath();
  1076 + if (type == 0) { // 普通
  1077 + src = '../../../images/share/q_tj.png';
  1078 + context.drawImage(src, 54 * unit, 648 * unit, 85 * unit, 30 * unit);
  1079 + context.setFontSize(16 * unit)
  1080 + context.setFillStyle("white")
  1081 + context.setTextAlign('left');
  1082 + context.fillText('强烈推荐', 64 * unit, 668 * unit);
  1083 + }
  1084 +
  1085 +
  1086 + let price = this.data.giftPrice;
  1087 + let giftIntegral = this.data.giftIntegral;
  1088 + context.setFontSize(32 * unit);
  1089 + context.setFillStyle('#DE1117');
  1090 +
  1091 + var price_txt="";
  1092 + if(price || giftIntegral){
  1093 + if(price){
  1094 + price_txt='¥' + price;
  1095 + if(giftIntegral) price_txt+='+';
  1096 + }
  1097 + if(giftIntegral) price_txt+=giftIntegral+'积分';
  1098 + }else{
  1099 + price_txt="¥0";
  1100 + }
  1101 +
  1102 + context.fillText(price_txt, 54 * unit, 735 * unit);
  1103 +
  1104 +
  1105 + var wp= 62 * unit;
  1106 + var hp=765 * unit
  1107 + this.draw_pos_price(context,wp,hp,this.giftPosPrice,unit);
  1108 +
  1109 + // 8.商品标题
  1110 + context.setFontSize(20 * unit);
  1111 + context.setFillStyle('#898989');
  1112 + getApp().draw_Text(context, this.data.giftTitle, 54 * unit, 800 * unit, 240 * unit, 280 * unit, unit, 1);
  1113 +
  1114 + // 9.小程序码
  1115 + context.drawImage(vpath, 375 * unit, 660 * unit, 120 * unit, 120 * unit);
  1116 + context.setFontSize(16 * unit);
  1117 + context.setFillStyle('#777');
  1118 + context.fillText('长按识别二维码', 378 * unit, 810 * unit);
  1119 +
  1120 + // 10.竖线
  1121 + context.beginPath();
  1122 + context.setFillStyle('#eee');
  1123 + context.rect(354 * unit, 670 * unit, 1 * unit, 130 * unit);
  1124 + context.fill();
  1125 + },
  1126 +
  1127 +
  1128 + //---市场价划掉---
  1129 + draw_pos_price(context,w,h,market_price,unit){
  1130 +
  1131 + if(!this.is_retail_price) return false;
  1132 +
  1133 + context.setFillStyle("gray")
  1134 + context.setFontSize(22 * unit)
  1135 + var pri0 = "¥" + market_price.toFixed(2);
  1136 + context.fillText(pri0, w, h);
  1137 +
  1138 + var c_h=h-6;
  1139 + context.setStrokeStyle('gray');
  1140 + context.setLineWidth(1 * unit);
  1141 + context.moveTo(w - 5, c_h);
  1142 + context.lineTo(w + ut.measureText(pri0, 22 * unit) + 5, c_h);
  1143 + context.stroke();
  1144 +
  1145 + },
  1146 +
  1147 + //--获取商品图片的本地缓存,回调写法--
  1148 + get_goods_temp: function (tt) {
  1149 + var ee = this;
  1150 + if (ee.data.share_goods_img) {
  1151 + tt();
  1152 + return false;
  1153 + }
  1154 + var img_url = ee.data.giftImageCover ? ee.data.giftImageCover : ee.data.giftImage;
  1155 + //获取商品是分享图信息
  1156 + wx.getImageInfo({
  1157 + src: img_url,
  1158 + success: function (res) {
  1159 + //res.path是网络图片的本地地址
  1160 + ee.data.share_goods_img = res.path;
  1161 + tt();
  1162 + },
  1163 + fail: function (res) {
  1164 + //获取默认空白图
  1165 + wx.getImageInfo({
  1166 + src: ee.data.iurl+'/miniapp/images/default_g_img.gif',
  1167 + success: function(res) {
  1168 + ee.data.share_goods_img = res.path; //分享的图片不能用网络的
  1169 + tt();
  1170 + }
  1171 + })
  1172 + }
  1173 + });
  1174 + },
  1175 +
  1176 + closePoster() {
  1177 + this.setData({
  1178 + showPoster: false,
  1179 + });
  1180 + },
  1181 + // 保存图片到手机
  1182 + savePic() {
  1183 + getApp().savePic(this);
  1184 + },
  1185 + // 预览海报
  1186 + previewPoster() {
  1187 + getApp().globalData.no_clear=1;
  1188 + wx.previewImage({
  1189 + current: this.data.shareImgPath, // 当前显示图片的http链接
  1190 + urls: [this.data.shareImgPath] ,// 需要预览的图片http链接列表
  1191 + });
  1192 + },
  1193 +
  1194 +
  1195 +
  1196 +});
0 1197 \ No newline at end of file
... ...
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "礼包详情",
  3 + "usingComponents": {
  4 + "warn": "/components/long_warn/long_warn",
  5 + "my_confirm": "/components/my_confirm/my_confirm",
  6 + "qr_code": "/components/qr_code/qr_code",
  7 + "nav_b": "/components/nav_b/nav_b",
  8 + "share": "/components/share/share"
  9 + }
  10 +}
0 11 \ No newline at end of file
... ...
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.wxml 0 → 100644
  1 +<view class="box data-v-3a5b7e36" style="background-color:{{default_color?default_color:'#e85f93'}}">
  2 + <view class="box_top data-v-3a5b7e36">
  3 + <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr" data-errorimg="giftImage"></image>
  4 + </view>
  5 + <view class="box_title data-v-3a5b7e36" >
  6 +
  7 + <view class="flex ai_c fs28" style="margin-bottom: 20rpx" wx:if="{{isBuy==0 && pick_up}}">
  8 + <image class="stores-img" src="{{iurl}}/miniapp/images/stores.png"></image>{{pick_up.pickup_name}}
  9 + </view>
  10 +
  11 + <view class="top_title data-v-3a5b7e36">
  12 + <text class="data-v-3a5b7e36 ellipsis-2" style="width:90%;">{{giftTitle}}</text>
  13 +
  14 + <!-- 这个是分享按钮 -->
  15 + <!-- <view wx:if="{{c_state<2}}" class="xc-share-frame t-c" bindtap="clickShare">
  16 + <view class="iconfont icon-share fs40" ></view>
  17 + <view class="fs22 c-7b">分享</view>
  18 + </view> -->
  19 +
  20 +
  21 + </view>
  22 + <view class="top_time data-v-3a5b7e36" wx:if="{{!flag}}">
  23 + <block wx:if="{{isBuy==1 && giftTitle && isStart!=1}}" >
  24 + <text class="data-v-3a5b7e36">
  25 + {{"活动开始时间:"+giftStart}}
  26 + </text>
  27 + </block>
  28 +
  29 + <block wx:else>
  30 + <text class="data-v-3a5b7e36" wx:if="{{isBuy==0}}">{{"兑换结束时间:"+giftDate}}</text>
  31 + <text class="data-v-3a5b7e36" wx:if="{{flag == 1}}">
  32 + {{"活动结束时间:"+giftDate}}
  33 + </text>
  34 + </block>
  35 + </view>
  36 + <!-- <view class="top_time data-v-3a5b7e36" wx:if="{{flag == 1 && iswarelbtype}}">
  37 + <text class="data-v-3a5b7e36" wx:if="{{exchangeType == 1}}">
  38 + {{"兑换时间:领取后"+exchangeDay+"天内兑换"}}
  39 + </text>
  40 + <text class="data-v-3a5b7e36" wx:elif="{{exchangeType == 2}}">
  41 + {{"兑换时间:"+exchangeStartTime+"至"+exchangeEndTime}}
  42 + </text>
  43 + </view> -->
  44 +
  45 + <view class="top_price data-v-3a5b7e36">
  46 +
  47 +
  48 + <block wx:if="{{giftPrice>0}}">
  49 + <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text>
  50 + </block>
  51 + <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
  52 + <text class="data-v-3a5b7e36">/</text>
  53 + </block>
  54 + <block wx:if="{{giftIntegral>0}}">
  55 + <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text>
  56 + </block>
  57 + <block wx:if="{{giftType>0}}">
  58 + <text class="data-v-3a5b7e36">{{actTitle}}</text>
  59 + </block>
  60 +
  61 +
  62 +
  63 +
  64 + </view>
  65 + <view class="top_foot data-v-3a5b7e36">
  66 + <view class="top_foot_price data-v-3a5b7e36">
  67 + <text class="data-v-3a5b7e36"> {{is_retail_price?'零售价:':''}}{{giftPosPrice+"元"}}</text>
  68 + </view>
  69 + <view class="top_foot_qty data-v-3a5b7e36">
  70 + <text class="data-v-3a5b7e36" wx:if="{{!flag}}">{{"已售:"+giftQty+"件"}}</text>
  71 + <text class="data-v-3a5b7e36" wx:elif="{{flag == 1 && giftQty > 0}}">{{"数量:"+giftQty+"件"}}</text>
  72 + </view>
  73 + </view>
  74 + </view>
  75 + <view class="box_ware data-v-3a5b7e36">
  76 + <view class="box_ware_title data-v-3a5b7e36">
  77 + <text class="data-v-3a5b7e36">礼包内容</text>
  78 + </view>
  79 + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="Id">
  80 + <view wx:if="{{item.couponName!=undefined}}" class="box_ware_box data-v-3a5b7e36">
  81 + <view class="box_ware_img data-v-3a5b7e36">
  82 + <block wx:if="{{item.lbType==1}}">
  83 + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  84 + </block>
  85 + <block wx:if="{{item.lbType==2}}">
  86 + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  87 + </block>
  88 + <block wx:if="{{item.lbType==3}}">
  89 + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  90 + </block>
  91 + <block wx:if="{{item.lbType==4}}">
  92 + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  93 + </block>
  94 + <block wx:if="{{item.lbType==5}}">
  95 + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].wareImage"></image>
  96 + </block>
  97 + </view>
  98 + <view class="box_ware_item data-v-3a5b7e36">
  99 + <view class="box_ware_item_title data-v-3a5b7e36">
  100 + <text class="data-v-3a5b7e36">{{item.couponName}}</text>
  101 + </view>
  102 + <view class="box_ware_item_price data-v-3a5b7e36">
  103 + <text class="data-v-3a5b7e36"></text>
  104 + </view>
  105 + <view class="box_ware_item_qty data-v-3a5b7e36 flex">
  106 + <text class="data-v-3a5b7e36 ellipsis-1">
  107 + {{"数量:"+item.num}}
  108 + </text>
  109 + <!-- <block wx:if="{{isBuy==0 && !flag && item.lbType==1}}">
  110 + <text style="margin-left:10rpx" wx:if="{{item.useState}}">
  111 + 已核销
  112 + </text>
  113 + <text style="margin-left:10rpx" wx:else>
  114 + 未核销
  115 + </text>
  116 + </block> -->
  117 + </view>
  118 +
  119 + <!-- <view class="box_ware_code data-v-3a5b7e36" wx:if="{{!flag}}">
  120 + <block wx:if="{{isBuy==0&item.lbType==1}}">
  121 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="getcode" data-codeId="{{item.Id}}" class="data-v-3a5b7e36"></image>
  122 + </block>
  123 +
  124 + <block wx:if="{{isBuy==0&item.lbType==2}}">
  125 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/packageD/pages/user/coupons/coupons" bindtap="goto"></image>
  126 + </block>
  127 + <block wx:if="{{isBuy==0&item.lbType==3}}">
  128 + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" class="data-v-3a5b7e36" lazy-load="true" data-url="/pages/user/my_service/i_service" bindtap="goto"></image>
  129 + </block>
  130 + <block wx:if="{{isBuy==0&item.lbType>3}}">
  131 + <text class="data-v-3a5b7e36">奖励已发放</text>
  132 + </block>
  133 + </view> -->
  134 + </view>
  135 + </view>
  136 + </block>
  137 + </view>
  138 + <view class="foot_box data-v-3a5b7e36">
  139 + <view class="foot_box_title data-v-3a5b7e36">
  140 + <text class="data-v-3a5b7e36">活动说明</text>
  141 + </view>
  142 + <view class="foot_box_remark data-v-3a5b7e36">
  143 + <rich-text nodes="{{giftRemark}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
  144 + </view>
  145 + </view>
  146 +
  147 +
  148 + <view class="foot_empty data-v-3a5b7e36"></view>
  149 +
  150 + <!-- <block wx:if="{{flag != 1}}">
  151 + <block wx:if="{{isBuy==1 && giftTitle}}">
  152 + <block wx:if="{{isStart==1}}">
  153 + <view class="foot_button data-v-3a5b7e36">
  154 + <block wx:if="{{giftPrice>0 && giftIntegral>0}}">
  155 + <view class="foot_button_left data-v-3a5b7e36 " data-money="{{giftPrice}}" data-id="{{lbId}}" bindtap="GetBuyPrice">
  156 + <text class="data-v-3a5b7e36 ">立即购买</text>
  157 + </view>
  158 + <view class="foot_button_right data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
  159 + <text class="data-v-3a5b7e36">立即兑换</text>
  160 + </view>
  161 + </block>
  162 + <block wx:if="{{giftPrice>0 && giftIntegral<=0}}">
  163 + <view class="foot_button_buy data-v-3a5b7e36 " data-money="{{giftPrice}}" bindtap="GetBuyPrice" data-id="{{lbId}}">
  164 + <text class="data-v-3a5b7e36">立即购买</text>
  165 + </view>
  166 + </block>
  167 + <block wx:if="{{giftPrice<=0 && giftIntegral>0}}">
  168 + <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetBuyIntegral" data-id="{{lbId}}">
  169 + <text class="data-v-3a5b7e36">立即兑换</text>
  170 + </view>
  171 + </block>
  172 +
  173 + <block wx:if="{{giftPrice<=0 && giftIntegral<=0}}">
  174 + <view class="foot_button_intalge data-v-3a5b7e36 " bindtap="GetFree" data-id="{{lbId}}">
  175 + <text class="data-v-3a5b7e36">免费领取</text>
  176 + </view>
  177 + </block>
  178 +
  179 +
  180 + </view>
  181 + </block>
  182 + <block wx:else>
  183 + <view class="foot_button data-v-3a5b7e36">
  184 + <view class="foot_button_intalge data-v-3a5b7e36 gray ">
  185 + <text class="data-v-3a5b7e36">活动还未开始</text>
  186 + </view>
  187 + </view>
  188 + </block>
  189 +
  190 + </block>
  191 + <block wx:if="{{isBuy==0}}">
  192 + <view class="foot_button data-v-3a5b7e36">
  193 + <block wx:if="{{is_lb!=1}}">
  194 + <view class="foot_button_buy data-v-3a5b7e36 overdue">
  195 + <text class="data-v-3a5b7e36">无核销商品</text>
  196 + </view>
  197 + </block>
  198 + <block wx:else>
  199 + <view wx:if="{{c_state==-1}}" class="foot_button_buy data-v-3a5b7e36 overdue" >
  200 + <text class="data-v-3a5b7e36">兑换未开始</text>
  201 + </view>
  202 + <view wx:if="{{c_state==0}}" class="foot_button_buy data-v-3a5b7e36" bindtap="getcode">
  203 + <text class="data-v-3a5b7e36">立即使用</text>
  204 + </view>
  205 + <view wx:if="{{c_state==1}}" class="foot_button_buy data-v-3a5b7e36 overdue" bindtap="getcode">
  206 + <text class="data-v-3a5b7e36">商品已核销</text>
  207 + </view>
  208 + <view wx:if="{{c_state==2}}" class="foot_button_buy data-v-3a5b7e36 overdue">
  209 + <text class="data-v-3a5b7e36">商品兑换时间已过</text>
  210 + </view>
  211 + </block>
  212 + </view>
  213 + </block>
  214 + </block> -->
  215 +
  216 +</view>
  217 +<!-- 引入提示组件 -->
  218 +<warn id="warn"></warn>
  219 +<my_confirm id="my_confirm"></my_confirm>
  220 +<!-- 弹出框扫描 -->
  221 +<qr_code id="qc_com"></qr_code>
  222 +<!-- 制作一个圆球导航 -->
  223 +<!-- <nav_b id="nav_b"></nav_b> -->
  224 +
  225 +<include src="../public/buy_com.wxml"></include>
  226 +<canvas canvas-id='share' style='width:750rpx;height:1217rpx;background-color:white;' wx:if="{{!canvasHidden}}"></canvas>
  227 +<share id="share_button" bind:send="send" bind:cancel="cancel" bind:share_img="saveImageToPhotosAlbum" wx:if="{{share_hidden}}"></share>
  228 +
  229 +
  230 +<view wx:if="{{showPoster}}">
  231 + <view class="mask" catchtap="closePoster"></view>
  232 + <view class="poster-container">
  233 + <view class="poster-wrapper">
  234 + <view class="poster" bindtap="previewPoster">
  235 + <!-- <view class="poster" bindtap="previewImage"> -->
  236 + <image src="{{shareImgPath}}" class="poster-img"></image>
  237 + <view class="btn-close" catchtap="closePoster">
  238 + <text class="iconfont icon-close"></text>
  239 + </view>
  240 + </view>
  241 + <view class="btn-container">
  242 + <!-- <button class="btn-share" open-type="share" bindtap="">微信好友分享</button> -->
  243 + <button class="btn-share" bindtap="savePic">保存到相册</button>
  244 + </view>
  245 + </view>
  246 + </view>
  247 +</view>
0 248 \ No newline at end of file
... ...
packageE/pages/giftpack/giftpacklistshop/giftpacklistshop.wxss 0 → 100644
  1 +@charset "UTF-8";
  2 +/* @import '../../goods/goodsInfo/goodsInfo.wxss'; */
  3 +@import "../../../../utils/wxParse/wxParse.wxss";
  4 +.box.data-v-3a5b7e36 {
  5 + -webkit-align-content: center;
  6 + align-content: center;
  7 + background-color: #e85f93;
  8 +}
  9 +
  10 +.box_top.data-v-3a5b7e36 {
  11 + width: 100%;
  12 +}
  13 +
  14 +.box_top image.data-v-3a5b7e36 {
  15 + width: 100%;
  16 + max-height: 540rpx;
  17 +}
  18 +
  19 +.box_title.data-v-3a5b7e36 {
  20 + margin: 10rpx 20rpx 20rpx 20rpx;
  21 + padding: 35rpx;
  22 + background-color: #fff;
  23 + border-radius: 40rpx;
  24 +}
  25 +
  26 +.top_title.data-v-3a5b7e36 {
  27 + font-size: 30rpx;
  28 + margin-bottom: 10rpx;
  29 + position: relative;
  30 +}
  31 +
  32 +.top_time.data-v-3a5b7e36 {
  33 + font-size: 27rpx;
  34 + color: #b9b5b5;
  35 +}
  36 +
  37 +.top_price.data-v-3a5b7e36 {
  38 + font-size: 35rpx;
  39 + color: #d61b30;
  40 + margin-top: 30rpx;
  41 + margin-bottom: 5rpx;
  42 + position: relative;
  43 +}
  44 +
  45 +.top_foot.data-v-3a5b7e36 {
  46 + display: -webkit-box;
  47 + display: -webkit-flex;
  48 + display: flex;
  49 +}
  50 +
  51 +.top_foot_price.data-v-3a5b7e36 {
  52 + font-size: 22rpx;
  53 + color: #b9b5b5;
  54 + width: 50%;
  55 + text-decoration: line-through;
  56 +}
  57 +
  58 +.top_foot_qty.data-v-3a5b7e36 {
  59 + font-size: 22rpx;
  60 + color: #b9b5b5;
  61 + width: 50%;
  62 + -webkit-align-content: flex-end;
  63 + align-content: flex-end;
  64 + text-align: right;
  65 +}
  66 +
  67 +.box_ware.data-v-3a5b7e36 {
  68 + margin: 10rpx 20rpx 20rpx 20rpx;
  69 + padding: 35rpx;
  70 + background-color: #fff;
  71 + border-radius: 40rpx;
  72 +}
  73 +
  74 +.box_ware_title.data-v-3a5b7e36 {
  75 + font-size: 35rpx;
  76 + margin: 5rpx 0rpx 30rpx 0rpx;
  77 +}
  78 +
  79 +.box_ware_box.data-v-3a5b7e36 {
  80 + display: -webkit-box;
  81 + display: -webkit-flex;
  82 + display: flex;
  83 + margin: 10rpx 0rpx 25rpx 0rpx;
  84 +}
  85 +
  86 +/* .box_ware_img.data-v-3a5b7e36 {
  87 + width: 30%;
  88 + height: 180rpx;
  89 + border: #999999 solid 1rpx;
  90 +} */
  91 +
  92 +.box_ware_img image.data-v-3a5b7e36 {
  93 + /* width: 185rpx;
  94 + height: 190rpx; *//* background-color: rgba(138, 138, 138, 0.63); */
  95 + border: 2rpx solid #999;
  96 + width: 120rpx;
  97 + height: 120rpx;
  98 + background-color: #f8f8f8;
  99 +}
  100 +
  101 +.box_ware_item.data-v-3a5b7e36 {
  102 + width: 70%;
  103 + margin-left: 25rpx;
  104 + position: relative;
  105 +}
  106 +
  107 +.box_ware_item_title.data-v-3a5b7e36 {
  108 + font-size: 24rpx;
  109 + word-break: break-all;
  110 + text-overflow: ellipsis;
  111 + display: -webkit-box;
  112 + -webkit-box-orient: vertical;
  113 + -webkit-line-clamp: 2;
  114 + overflow: hidden;
  115 +}
  116 +
  117 +.box_ware_count.data-v-3a5b7e36 {
  118 + display: -webkit-box;
  119 + display: -webkit-flex;
  120 + display: flex;
  121 +}
  122 +
  123 +.box_ware_item_price.data-v-3a5b7e36 {
  124 + font-size: 25rpx;
  125 + color: #b9b5b5;
  126 + position: absolute;
  127 + bottom: 60rpx;
  128 + left: 0;
  129 +}
  130 +
  131 +.box_ware_item_qty.data-v-3a5b7e36 {
  132 + font-size: 22rpx;
  133 + position: absolute;
  134 + bottom: 15rpx;
  135 + left: 0;
  136 +}
  137 +
  138 +.box_ware_code.data-v-3a5b7e36 {
  139 + position: absolute;
  140 + right: 10rpx;
  141 + bottom: 10rpx;
  142 +}
  143 +
  144 +.box_ware_code image.data-v-3a5b7e36 {
  145 + width: 50rpx;
  146 + height: 50rpx;
  147 +}
  148 +
  149 +.box_ware_code text.data-v-3a5b7e36 {
  150 + font-size: 20rpx;
  151 +}
  152 +
  153 +.foot_box.data-v-3a5b7e36 {
  154 + margin: 10rpx 20rpx 50rpx 20rpx;
  155 + padding: 35rpx;
  156 + background-color: #fff;
  157 + border-radius: 40rpx;
  158 +}
  159 +
  160 +.foot_box_title.data-v-3a5b7e36 {
  161 + font-size: 35rpx;
  162 + margin-bottom: 30rpx;
  163 +}
  164 +
  165 +.foot_box_remark.data-v-3a5b7e36 {
  166 + font-size: 27rpx;
  167 + line-height: 40rpx;
  168 +}
  169 +
  170 +.foot_empty.data-v-3a5b7e36 {
  171 + height: 90rpx;
  172 +}
  173 +
  174 +.foot_button.data-v-3a5b7e36 {
  175 + display: -webkit-box;
  176 + display: -webkit-flex;
  177 + display: flex;
  178 + margin: 20rpx 0rpx 0rpx 0rpx;
  179 + padding: 25rpx 0rpx;
  180 + background: #fff;
  181 + text-align: center;
  182 + -webkit-box-pack: center;
  183 + -webkit-justify-content: center;
  184 + justify-content: center;
  185 + position: fixed;
  186 + bottom: 0;
  187 + left: 0;
  188 + width: 100%;
  189 +}
  190 +
  191 +.foot_button_left.data-v-3a5b7e36 {
  192 + background: #e4010c;
  193 + color: #fff;
  194 + width: 250rpx;
  195 + height: 70rpx;
  196 + font-size: 28rpx;
  197 + line-height: 70rpx;
  198 + border-radius: 40rpx;
  199 + margin-right: 20rpx;
  200 +}
  201 +
  202 +.foot_button_right.data-v-3a5b7e36 {
  203 + background: #ffbb42;
  204 + color: #fff;
  205 + width: 250rpx;
  206 + height: 70rpx;
  207 + font-size: 28rpx;
  208 + line-height: 70rpx;
  209 + border-radius: 40rpx;
  210 +}
  211 +
  212 +.foot_button_buy.data-v-3a5b7e36 {
  213 + background: #e4010c;
  214 + color: #fff;
  215 + width: 400rpx;
  216 + height: 70rpx;
  217 + font-size: 28rpx;
  218 + line-height: 70rpx;
  219 + border-radius: 40rpx;
  220 +}
  221 +
  222 +.foot_button_intalge.data-v-3a5b7e36 {
  223 + background: #ffbb42;
  224 + color: #fff;
  225 + width: 400rpx;
  226 + height: 70rpx;
  227 + font-size: 28rpx;
  228 + line-height: 70rpx;
  229 + border-radius: 40rpx;
  230 +}
  231 +
  232 +page.data-v-3a5b7e36 {
  233 + background-color: #e85f93;
  234 +}
  235 +
  236 +.foot_box_remark.data-v-3a5b7e36 ._img {
  237 + width: 100%;
  238 +}
  239 +
  240 +.foot_box_remark.data-v-3a5b7e36 .img {
  241 + line-height: 0;
  242 +}
  243 +.overdue.data-v-3a5b7e36{
  244 + background-color: rgb(153,153,153);
  245 +}
  246 +
  247 +.foot_button_intalge.data-v-3a5b7e36.gray{ background-color: #aaa; }
  248 +
  249 +.xc-share-frame {
  250 + position: absolute; right:0; top: -10rpx;
  251 +}
  252 +
... ...