Commit a27273edca3112cde91d775652663d473cdf9a4d

Authored by abson
1 parent 18b3d811

4.26 oa

components/diy_picMax/diy_picMax.wxml
... ... @@ -24,6 +24,11 @@
24 24 <image src="{{item.src}}" mode="widthFix" style="display: block;"></image>
25 25 </navigator>
26 26 </block>
  27 + <block wx:elif="{{item.AppId}}">
  28 + <navigator target="miniProgram" app-id="{{item.AppId}}" path="{{item.wxapp_url}}">
  29 + <image src="{{item.src}}" mode="widthFix" style="display: block;"></image>
  30 + </navigator>
  31 + </block>
27 32 <block wx:else>
28 33 <image bindtap='gopage' wx:if="{{item.wxapp_url}}" data-url="{{item.wxapp_url}}" src="{{item.src}}" mode="widthFix" style="display: block;"></image>
29 34 <image bindtap='previewImage' wx:else data-src="{{item.src}}" src="{{item.src}}" style="display: block;" mode="widthFix"></image>
... ...
packageA/pages/myGift/myGift.js
... ... @@ -61,7 +61,8 @@ Page({
61 61 /**
62 62 * 生命周期函数--监听页面初次渲染完成
63 63 */
64   - onReady: function () {},
  64 + onReady: function () {
  65 + },
65 66  
66 67 /**
67 68 * 生命周期函数--监听页面显示
... ... @@ -75,6 +76,7 @@ Page({
75 76 userInfo: app.globalData.userInfo,
76 77 imghost: app.globalData.setting.imghost,
77 78 isLogin: true,
  79 + now:Date.parse(new Date()) / 1000,
78 80 });
79 81  
80 82 var index=this.data.currentIndex;
... ... @@ -91,7 +93,7 @@ Page({
91 93  
92 94 if(index == 0) {
93 95 url = '/api/weshop/libao/libaoForm/page';
94   - data.timetype=1;
  96 + data.timetype=2;
95 97 } else if(index == 1) {
96 98 url = '/api/weshop/libao/libaoFormvip/page';
97 99 };
... ...
packageA/pages/myGift/myGift.wxml
... ... @@ -5,11 +5,11 @@
5 5 </view>
6 6 <view class="tab-content">
7 7 <block wx:if="{{currentIndex == 0}}">
8   - <view class="tab-item" wx:for="{{list.pageData}}">
  8 + <view class="tab-item" wx:for="{{list.pageData}}" wx:if="{{now > item.startime || (item.is_show && now > item.show_time)}}">
9 9 <view bindtap="goto" data-url="{{'/packageA/pages/myGiftDetails/myGiftDetails?index=0&id=' + item.id}}">
10 10 <!-- 图片 -->
11 11 <view class="img-container rel">
12   - <image src="{{imghost + (item.lburl ? item.lburl:'miniapp/images/default_g_img.gif')}}" class="img" mode="widthFix"/>
  12 + <image src="{{imghost + (item.lburl ? item.lburl:'miniapp/images/default_g_img.gif')}}" class="img" mode="widthFix" />
13 13 <view catchtap="show_remark" data-index="{{index}}" class="lb_remark ellipsis-1" wx:if="{{item.lbintro}}">活动说明:{{item.lbintro}}</view>
14 14 </view>
15 15 <view class="desc-container">
... ... @@ -23,11 +23,11 @@
23 23 <text class="rmb">{{filter.toFix(item.lbprice,2)}}</text>/{{item.lbintegral}}积分
24 24 </block>
25 25 <block wx:elif="{{item.lbprice>0 || item.lbintegral}}">
26   - <block wx:if="{{item.lbprice>0}}" >
27   - <text class="rmb">{{filter.toFix(item.lbprice,2) }}</text>
  26 + <block wx:if="{{item.lbprice>0}}">
  27 + <text class="rmb">{{filter.toFix(item.lbprice,2) }}</text>
28 28 </block>
29 29 <block wx:if="{{item.lbintegral>0}}">
30   - {{item.lbintegral}}积分
  30 + {{item.lbintegral}}积分
31 31 </block>
32 32 </block>
33 33 </view>
... ... @@ -36,20 +36,28 @@
36 36 <view class="fs24 c-a4">已售{{item.salenum+item.virtualsales}}件</view>
37 37 </view>
38 38 <!-- 时间 -->
39   - <view class="date">活动结束日期 {{filter.format_time(item.endtime)}}</view>
  39 + <view class="date" wx:if="{{item.is_show && now < item.startime}}">活动开始日期 {{filter.format_time(item.startime)}}</view>
  40 + <view class="date" wx:else>活动结束日期 {{filter.format_time(item.endtime)}}</view>
40 41 <!-- 按钮 -->
41 42 </view>
42 43 </view>
43   - <view class="btn-container pd20">
44   - <view wx:if="{{item.lbintegral>0}}" bindtap="GetBuyIntegral" data-index="{{index}}" class="btn red">立即兑换</view>
45   - <view wx:if="{{item.lbprice>0}}" bindtap="GetBuyPrice" data-index="{{index}}" class="btn pink">立即购买</view>
46   - </view>
  44 + <block wx:if="{{now < item.startime}}">
  45 + <view class="btn1 gray">活动还未开始</view>
  46 + </block>
  47 + <block wx:else>
  48 + <view class="btn-container pd20">
  49 + <view wx:if="{{item.lbintegral>0}}" bindtap="GetBuyIntegral" data-index="{{index}}" class="btn red">立即兑换</view>
  50 + <view wx:if="{{item.lbprice>0}}" bindtap="GetBuyPrice" data-index="{{index}}" class="btn pink">立即购买</view>
  51 + </view>
  52 + </block>
47 53 </view>
48 54 </block>
49   -
  55 +
50 56 <block wx:else>
51 57 <view class="tab-item flex pd20" wx:for="{{list.pageData}}" bindtap="goto" data-url="{{'/packageA/pages/myGiftDetails/myGiftDetails?index=1&id=' + item.lbvipid}}">
52   - <view class="img-container2"><image src="{{imghost + (item.lburl ? item.lburl:'miniapp/images/default_g_img.gif')}}" class="img" mode="widthFix" data-index="{{index}}"/></view>
  58 + <view class="img-container2">
  59 + <image src="{{imghost + (item.lburl ? item.lburl:'miniapp/images/default_g_img.gif')}}" class="img" mode="widthFix" data-index="{{index}}" />
  60 + </view>
53 61 <view class="flex fdc jc_sb">
54 62 <view>
55 63 <!-- 标题 -->
... ... @@ -63,7 +71,7 @@
63 71 </view>
64 72 </view>
65 73 </block>
66   -
  74 +
67 75 <nodata nodataContainer="t-c" wx:if="{{list.pageData.length == 0}}"></nodata>
68 76 <view class="noMore" hidden="{{!noMore}}" wx:if="{{list.pageData.length !== 0}}">—— 已经到底了 ——</view>
69 77 </view>
... ... @@ -75,7 +83,7 @@
75 83 <view wx:if="{{show_rem_pop}}">
76 84 <view class="cover-layer" bindtap="close_remark"></view>
77 85 <view class="rem_pop;">
78   - <view style="text-align: right;"bindtap="close_remark"><text class="iconfont icon-close" style="font-size: 40rpx;"></text></view>
  86 + <view style="text-align: right;" bindtap="close_remark"><text class="iconfont icon-close" style="font-size: 40rpx;"></text></view>
79 87 <view style="padding: 0 16rpx;">
80 88 <view class="fs32">活动说明:</view>
81 89 <view class="fs30">{{pop_remark_text}}</view>
... ...
packageA/pages/myGift/myGift.wxss
... ... @@ -52,6 +52,16 @@ page {
52 52 font-weight: bold;
53 53  
54 54 }
  55 +.btn1 {
  56 + padding: 20rpx;
  57 + flex: 1;
  58 + text-align: center;
  59 +}
  60 +
  61 +.btn1.gray{
  62 + background-color: #cccccc;
  63 + color:#fff
  64 +}
55 65  
56 66 .tab-title-item::after {
57 67 position: absolute;
... ...
packageD/pages/user/deposit/deposit.js
  1 +/*
  2 + * @Author: your name
  3 + * @Date: 2022-03-26 11:41:08
  4 + * @LastEditTime: 2022-04-13 14:28:30
  5 + * @LastEditors: your name
  6 + * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  7 + * @FilePath: \MShopWeApp\packageD\pages\user\deposit\deposit.js
  8 + */
1 9 var t = getApp(),
2 10 a = t.request,
3 11 o = t.globalData.setting,
... ... @@ -24,7 +32,7 @@ Page({
24 32 return false;
25 33 }
26 34 wx.setNavigationBarTitle({
27   - title: "预存款",
  35 + title: "储值款",
28 36 })
29 37  
30 38 var th = this;
... ...
packageD/pages/user/deposit/deposit.wxml
1 1 <image class="pictuer" src='{{iurl}}/miniapp/images/usermoney/100.jpg'>
2 2 <view class="big">
3   - <view class="font-one">预存款</view>
  3 + <view class="font-one">储值款</view>
4 4 <view class="deposit">
5 5 <view class="rmb" >¥</view><view class="font-two">{{yucun_money}}</view>
6 6 </view>
... ... @@ -9,20 +9,20 @@
9 9 <view class="big-rim">
10 10 <view wx:if="{{is_show_yckcz}}" class="min-rim-one" type='primary' bindtap='jumPage'>
11 11 <image class="picture-two" src="{{iurl}}/miniapp/images/usermoney/recharge.png"></image>
12   - <view class="ldzj-font">预存款充值</view>
  12 + <view class="ldzj-font">储值款充值</view>
13 13 <image class="picture-five" src="{{iurl}}/miniapp/images/usermoney/left.png"></image>
14 14 </view>
15 15 </view>
16 16  
17 17 <view class="min-rim-one" type='primary'>
18 18 <image class="picture-two" src="{{iurl}}/miniapp/images/usermoney/deposit.png"></image>
19   - <view class="ldzj-font">预存款余额</view>
  19 + <view class="ldzj-font">储值款余额</view>
20 20 </view>
21 21  
22 22  
23 23 <view wx:if="{{parameter}}">
24 24  
25   - <view class="mysj">暂无任何预存款</view>
  25 + <view class="mysj">暂无任何储值款</view>
26 26 </view>
27 27 <view wx:else>
28 28 <block wx:for="{{list}}" wx:for-index="idx" wx:for-item="list">
... ...
pages/cart/cart2/cart2.js
... ... @@ -130,8 +130,9 @@ Page({
130 130 ladder_map: {}, //阶梯促销的map表
131 131 is_no_past: 1,
132 132 state: 0, //阶梯促销的的立即购买也走购物车流程state=1
133   - show_duo_gift:0,
134   - send_gf:{}, //多赠品的计算
  133 + show_duo_gift: 0,
  134 + send_gf: {}, //多赠品的计算
  135 + send_lb: {},
135 136 },
136 137 onLoad: function (t) {
137 138 wx.setNavigationBarTitle({ title: "填写订单", })
... ... @@ -171,7 +172,8 @@ Page({
171 172 isget_by_quan: {},
172 173 is_no_by: {},
173 174 is_by: {},
174   - send_gf:{}
  175 + send_gf: {},
  176 + send_lb:{},
175 177 })
176 178 },
177 179  
... ... @@ -188,7 +190,6 @@ Page({
188 190  
189 191 } else {
190 192 this.getuser_addr(function (ie) {
191   -
192 193 console.log("getuser_addr")
193 194 console.log(ie)
194 195 //地址切换要把包邮券清空
... ... @@ -381,7 +382,7 @@ Page({
381 382 to.get_allsto(function (e) {
382 383 th.setData({ allsto: e });
383 384 //-------获取购物车已经选择的商品--------
384   - console.log('购物车结算');
  385 + console.log('购物车结算');
385 386  
386 387 th.get_cart();
387 388 })
... ... @@ -408,7 +409,7 @@ Page({
408 409  
409 410 //-----真的获取购物车,入口--------
410 411 get_cart: function () {
411   - var th = this, app = getApp();
  412 + var th = this, app = getApp();
412 413 var state = 0;
413 414 if (th.data.state) state = 1;
414 415 a.get("/api/weshop/cart/list", {
... ... @@ -452,6 +453,7 @@ Page({
452 453  
453 454 //要把优惠活动加入,prom_goods_map中,赠品不要运算
454 455 if (item1.prom_type == 3 && item1.is_gift != 1) {
  456 + th.check_is_youhui(item1.goods_id, item1.pick_id);
455 457 await th.add_prom_goods_map(item1);
456 458 }
457 459  
... ... @@ -719,7 +721,7 @@ Page({
719 721 ie.wind = parseInt(th.data.cartlist[kj].wind);
720 722  
721 723 //-- 是不是全部自提清空 --
722   - if(ie.exp_type==0) th.setData({ is_all_zt: 0 });
  724 + if (ie.exp_type == 0) th.setData({ is_all_zt: 0 });
723 725  
724 726 break;
725 727 }
... ... @@ -859,7 +861,6 @@ Page({
859 861 et = th.data.bn_exp_type;
860 862 m_wind = th.data.index;
861 863 }
862   -
863 864 //---是不是购买等级卡成功的返回---等级卡显示的判断---
864 865 var is_card_back = getApp().globalData.is_card_back;
865 866 if (is_card_back) {
... ... @@ -915,12 +916,13 @@ Page({
915 916 t.data.data.prom_id = gg.prom_id;
916 917 t.data.data.prom_type = 3;
917 918 //如果是优惠活动,就要调用活动,计算价格
  919 + th.check_is_youhui(gg.goods_id,gg.pick_id);
918 920 th.buy_now_prom_goods(gg.prom_id, t.data.data, function (data) {
919 921 //判断一下购买商品的数量是不是超过
920   - if (data.gift_goods_id && (!data.zp_mode || parseInt(data.zp_mode)==0) ) {
921   - var num =data.zp_num?data.zp_num:1;
  922 + if (data.gift_goods_id && (!data.zp_mode || parseInt(data.zp_mode) == 0)) {
  923 + var num = data.zp_num ? data.zp_num : 1;
922 924 if (data.is_bz == 1) {
923   - num = num*data.bs;
  925 + num = num * data.bs;
924 926 if (num > data.gift_limit_num) num = 0;
925 927 }
926 928 //如果赠品数量超出礼品库存,就取消
... ... @@ -943,9 +945,9 @@ Page({
943 945 ob.exp_sum_type = data.gift_exp_sum_type; //商品的物流计算方式
944 946 ob.uniform_exp_sum = data.gift_uniform_exp_sum //统一运费的金额
945 947  
946   - var arr_gf=[];
  948 + var arr_gf = [];
947 949 arr_gf.push(ob);
948   - th.setData({ buy_now_gift_goods: arr_gf});
  950 + th.setData({ buy_now_gift_goods: arr_gf });
949 951 }
950 952 }
951 953  
... ... @@ -1174,8 +1176,8 @@ Page({
1174 1176 },
1175 1177  
1176 1178 calc_per: async function (c_arr) {
1177   - var send_gf={};
1178   - var duo_zp_num_arr={};
  1179 + var send_gf = {};
  1180 + var duo_zp_num_arr = {};
1179 1181 var th = this;
1180 1182 //-- 循环处理 --
1181 1183 for (var i in c_arr) {
... ... @@ -1197,7 +1199,7 @@ Page({
1197 1199 //等待,获取一下优惠活动的信息
1198 1200 await getApp().request.promiseGet("/api/weshop/goods/getDiscount", {
1199 1201 data: {
1200   - price:parseFloat(item_map.price).toFixed(2),prom_id:item_map.prom_id,
  1202 + price: parseFloat(item_map.price).toFixed(2), prom_id: item_map.prom_id,
1201 1203 goods_num: item_map.goods_num, user_id: getApp().globalData.user_id,
1202 1204 is_bz: item_map.is_bz
1203 1205 }
... ... @@ -1213,10 +1215,10 @@ Page({
1213 1215 item_map.s_coupon_num = get_data.coupon_num;
1214 1216  
1215 1217  
1216   - if (get_data.gift_id && parseInt(get_data.zp_mode)!=1
1217   - && get_data.zp_num* item_map.bs<=get_data.limit_num
1218   - && get_data.zp_num* item_map.bs<=get_data.gift_storecount
1219   - ){
  1218 + if (get_data.gift_id && parseInt(get_data.zp_mode) != 1
  1219 + && get_data.zp_num * item_map.bs <= get_data.limit_num
  1220 + && get_data.zp_num * item_map.bs <= get_data.gift_storecount
  1221 + ) {
1220 1222  
1221 1223 item_map.gift_id = get_data.gift_id;
1222 1224 item_map.gift_goods_id = get_data.goods_id;
... ... @@ -1238,21 +1240,21 @@ Page({
1238 1240 item_map.zx_libao = get_data.zxlibao;
1239 1241 item_map.zx_lb_num = get_data.zxlb_num;
1240 1242  
1241   - if(parseInt(get_data.zp_mode)==1){
1242   - if(!send_gf[pickid]) send_gf[pickid]=[];
  1243 + if (parseInt(get_data.zp_mode) == 1) {
  1244 + if (!send_gf[pickid]) send_gf[pickid] = [];
1243 1245  
1244   - var can_zp_num=0;
1245   - for(let iy in get_data.giftsinfo){
1246   - let item=get_data.giftsinfo[iy];
1247   - can_zp_num+= parseInt(item.gift_storecount)>parseInt(item.limit_num)?parseInt(item.limit_num):parseInt(item.gift_storecount);
  1246 + var can_zp_num = 0;
  1247 + for (let iy in get_data.giftsinfo) {
  1248 + let item = get_data.giftsinfo[iy];
  1249 + can_zp_num += parseInt(item.gift_storecount) > parseInt(item.limit_num) ? parseInt(item.limit_num) : parseInt(item.gift_storecount);
1248 1250 }
1249 1251  
1250   - var t_zp_num=parseInt(get_data.zp_num)*parseInt(get_data.bs);
1251   - if(duo_zp_num_arr[item_map.prom_id]){
1252   - t_zp_num+=duo_zp_num_arr[item_map.prom_id];
  1252 + var t_zp_num = parseInt(get_data.zp_num) * parseInt(get_data.bs);
  1253 + if (duo_zp_num_arr[item_map.prom_id]) {
  1254 + t_zp_num += duo_zp_num_arr[item_map.prom_id];
1253 1255 }
1254 1256  
1255   - if(can_zp_num>=t_zp_num) {
  1257 + if (can_zp_num >= t_zp_num) {
1256 1258 send_gf[pickid].push({
1257 1259 pickup_id: pickid,
1258 1260 giftsinfo: get_data.giftsinfo,
... ... @@ -1261,7 +1263,7 @@ Page({
1261 1263 prom_id: item_map.prom_id
1262 1264 });
1263 1265  
1264   - duo_zp_num_arr[item_map.prom_id]=t_zp_num;
  1266 + duo_zp_num_arr[item_map.prom_id] = t_zp_num;
1265 1267 }
1266 1268 }
1267 1269 }
... ... @@ -1325,7 +1327,7 @@ Page({
1325 1327 for (var j = 0; j < ord_goods.length; j++) {
1326 1328 if (ord_goods[j].is_gift) continue;
1327 1329 if (ord_goods[j].prom_type == 3 && ord_goods[j].prom_id == item_map.prom_id) {
1328   - ord_goods[j].is_xz_yh =ord_goods[j].is_xz_yh?ord_goods[j].is_xz_yh:item_map.is_xz_yh;
  1330 + ord_goods[j].is_xz_yh = ord_goods[j].is_xz_yh ? ord_goods[j].is_xz_yh : item_map.is_xz_yh;
1329 1331 ord_goods[j].is_past = item_map.is_past;
1330 1332 ord_goods[j].account_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_fir;
1331 1333 ord_goods[j].account_yu_fir = th.item_map_get_goods(ord_goods[j].goods_id, item_map).account_yu_fir;
... ... @@ -1373,11 +1375,11 @@ Page({
1373 1375 if (item_map.zx_libao) {
1374 1376 if (!cart_item.zx_libao) {
1375 1377 cart_item.zx_libao = item_map.zx_libao + "";
1376   - cart_item.g_zxlb_num = [{'l_id': item_map.zx_libao, "num": item_map.zx_lb_num}];
  1378 + cart_item.g_zxlb_num = [{ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num }];
1377 1379 }
1378 1380 else {
1379 1381 cart_item.zx_libao += "," + item_map.zx_libao;
1380   - cart_item.g_zxlb_num.push({'l_id': item_map.zx_libao, "num": item_map.zx_lb_num})
  1382 + cart_item.g_zxlb_num.push({ 'l_id': item_map.zx_libao, "num": item_map.zx_lb_num })
1381 1383 }
1382 1384 }
1383 1385 }
... ... @@ -1387,12 +1389,12 @@ Page({
1387 1389  
1388 1390 var arr = Object.keys(send_gf);
1389 1391 var arr2 = Object.keys(th.data.send_gf);
1390   - if(arr2.length>0) return false;
  1392 + if (arr2.length > 0) return false;
1391 1393  
1392   - if(arr.length>0){
1393   - th.setData({send_gf:send_gf})
1394   - }else{
1395   - th.setData({send_gf:{}})
  1394 + if (arr.length > 0) {
  1395 + th.setData({ send_gf: send_gf })
  1396 + } else {
  1397 + th.setData({ send_gf: {} })
1396 1398 }
1397 1399  
1398 1400 },
... ... @@ -1404,12 +1406,12 @@ Page({
1404 1406 to.getwuliuprice(async function (rs) {
1405 1407 wx.showLoading({ title: "处理中." })
1406 1408 //是不是区域包邮
1407   - th.data.is_area_by=0;
  1409 + th.data.is_area_by = 0;
1408 1410 //当不是区域不包邮的时候,没有不包邮商品的时候
1409   - th.data.free1=0;
1410   - th.data.cut_o_shipping_price=0;
1411   - th.data.cut_goods_piece=0;
1412   - th.data.cut_goods_weight=0;
  1411 + th.data.free1 = 0;
  1412 + th.data.cut_o_shipping_price = 0;
  1413 + th.data.cut_goods_piece = 0;
  1414 + th.data.cut_goods_weight = 0;
1413 1415  
1414 1416 var all_price = 0; //所有的商品总价
1415 1417 var all_shipping_m = 0; //所有的物流总价
... ... @@ -1424,7 +1426,7 @@ Page({
1424 1426  
1425 1427 var umoney = th.data.userinfo.user_money - th.data.txmon - (th.data.userinfo.frozen_money ? th.data.userinfo.frozen_money : 0);
1426 1428 var freight_free = ee.freight_free; //全场满多少包邮
1427   - var free1=freight_free;
  1429 + var free1 = freight_free;
1428 1430  
1429 1431 var weight_free = ee.weight_free; //多少kg内包邮
1430 1432 var no_ex_id = ee.no_ex_id;
... ... @@ -1596,7 +1598,7 @@ Page({
1596 1598 if (by_qc.region_list != "" && by_qc.region_list != null && by_qc.region_list != undefined) {
1597 1599 if (th.check_by_area(by_qc.region_list)) {
1598 1600 freight_free = 0;
1599   - th.data.is_area_by=1;
  1601 + th.data.is_area_by = 1;
1600 1602 //goods_weight = -1;
1601 1603 //out_of_weight = 0;
1602 1604 th.data.is_no_by[pickid] = 1;
... ... @@ -1615,36 +1617,36 @@ Page({
1615 1617  
1616 1618  
1617 1619  
1618   - var is_in_no_ex_goods_arr=0;
1619   - var by_g_weight=0;
  1620 + var is_in_no_ex_goods_arr = 0;
  1621 + var by_g_weight = 0;
1620 1622 //--------循环计算商品总物流-----------
1621 1623 for (var jo = 0; jo < item.length; jo++) {
1622 1624 //----------------如果是选择了物流---------------------
1623   - if (cart_item.exp_type == 0 && item[jo].is_free_shipping == 0 && th.data.user_addr != null){
  1625 + if (cart_item.exp_type == 0 && item[jo].is_free_shipping == 0 && th.data.user_addr != null) {
1624 1626  
1625 1627 //判断是否有设置限制重量包邮,先看商品有没有包邮
1626   - if(!no_ex_good_arr || no_ex_good_arr.indexOf(item[jo].goods_id + '')== -1){
1627   - if(!th.data.is_area_by) th.data.free1=free1;
  1628 + if (!no_ex_good_arr || no_ex_good_arr.indexOf(item[jo].goods_id + '') == -1) {
  1629 + if (!th.data.is_area_by) th.data.free1 = free1;
1628 1630 //此时是 模板里面没有不包邮商品列表或者是 该商品没有再不包邮商品列表礼包
1629 1631 if (item[jo]['is_past'] !== 1 && item[jo]['exp_sum_type'] == 2) {
1630 1632 if (goods_weight < 0) goods_weight = 0;
1631 1633 //累积商品重量 每种商品的重量 * 数量
1632 1634 goods_weight += item[jo]['weight'] * item[jo]['goods_num'];
1633   - by_g_weight+=item[jo]['weight'] * item[jo]['goods_num'];
  1635 + by_g_weight += item[jo]['weight'] * item[jo]['goods_num'];
1634 1636  
1635   - if(free1>0){
  1637 + if (free1 > 0) {
1636 1638 if (weight_free > 0) {
1637 1639 out_of_weight = (weight_free * 1000) - by_g_weight;
1638   - }else{
1639   - out_of_weight= -by_g_weight;
  1640 + } else {
  1641 + out_of_weight = -by_g_weight;
1640 1642 }
1641 1643 }
1642 1644  
1643 1645 }
1644 1646 }
1645 1647 //这个是在不包邮列表礼包
1646   - else if(no_ex_good_arr.indexOf(item[jo].goods_id + '') > -1){
1647   - is_in_no_ex_goods_arr=1;
  1648 + else if (no_ex_good_arr.indexOf(item[jo].goods_id + '') > -1) {
  1649 + is_in_no_ex_goods_arr = 1;
1648 1650 if (item[jo]['is_past'] !== 1 && item[jo]['exp_sum_type'] == 2) {
1649 1651 if (goods_weight < 0) goods_weight = 0;
1650 1652 //累积商品重量 每种商品的重量 * 数量
... ... @@ -1655,7 +1657,7 @@ Page({
1655 1657 }
1656 1658 }
1657 1659  
1658   - if(free1>0) {
  1660 + if (free1 > 0) {
1659 1661 //当商品没有超出的时候
1660 1662 if (out_of_weight >= 0) {
1661 1663 out_of_weight = -by_g_weight;
... ... @@ -1665,7 +1667,7 @@ Page({
1665 1667 }
1666 1668  
1667 1669 //所有的商品都不在不包邮商品列表,freight_free为0的时候,以及不是区域包邮
1668   - if(!is_in_no_ex_goods_arr && !freight_free && !th.data.is_area_by) freight_free=free1;
  1670 + if (!is_in_no_ex_goods_arr && !freight_free && !th.data.is_area_by) freight_free = free1;
1669 1671  
1670 1672 //--如果是物流,且选择了地址,就要开始显示包邮券,且包邮券也已经优惠了优惠活动的金额--
1671 1673 if (cart_item.exp_type == 0 && th.data.user_addr != null && !cart_item.is_xz_yh) {
... ... @@ -1751,7 +1753,7 @@ Page({
1751 1753 if (no_ex_good) {
1752 1754 is_good_no_by = th.check_by_goods(no_ex_good, item[j].goods_id);
1753 1755 }
1754   -
  1756 +
1755 1757 //--如果是包邮券使用的情况下,如果商品是包邮的,那么就不进行计算--
1756 1758 if (th.data.using_quan[pickid] && th.data.using_quan[pickid].isby == 1 && !is_good_no_by) {
1757 1759 continue;
... ... @@ -1777,7 +1779,7 @@ Page({
1777 1779 }
1778 1780  
1779 1781  
1780   - if(!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '')== -1){
  1782 + if (!no_ex_good_arr || no_ex_good_arr.indexOf(item[j].goods_id + '') == -1) {
1781 1783 switch (item[j]['exp_sum_type']) {
1782 1784 case 1:
1783 1785 //统一运费
... ... @@ -1791,7 +1793,7 @@ Page({
1791 1793 }
1792 1794  
1793 1795  
1794   - }else{
  1796 + } else {
1795 1797 /*--
1796 1798 if(item[j]['exp_sum_type']==2 && out_of_weight!==0){
1797 1799 goods_weight = -1;
... ... @@ -1839,7 +1841,7 @@ Page({
1839 1841 var order_m = 0;
1840 1842 //---判断是不是有订单优惠---
1841 1843 await getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
1842   - data: { store_id: os.stoid, orderAmount: o_condition,user_id:getApp().globalData.user_id}
  1844 + data: { store_id: os.stoid, orderAmount: o_condition, user_id: getApp().globalData.user_id }
1843 1845 }).then(res => {
1844 1846 if (res.data.code == 0) {
1845 1847 var ord_prom = res.data.data;
... ... @@ -2284,9 +2286,9 @@ Page({
2284 2286 var l_txt = "formData.give_zxlb_id";
2285 2287 //这个是json格式的
2286 2288 var l_txt1 = "formData.g_zxlb_num";
2287   - var ob = [{"num": good.zx_lb_num, "l_id": good.zx_libao}];
  2289 + var ob = [{ "num": good.zx_lb_num, "l_id": good.zx_libao }];
2288 2290 ob = JSON.stringify(ob);
2289   - th.setData({[l_txt]: good.zx_libao, [l_txt1]: ob});
  2291 + th.setData({ [l_txt]: good.zx_libao, [l_txt1]: ob });
2290 2292 }
2291 2293 })
2292 2294 } else {
... ... @@ -2343,7 +2345,7 @@ Page({
2343 2345 var l_txt1 = "formData.g_lb_num";
2344 2346 var ob = [{ "num": good.s_lb_num, "l_id": good.s_libao }];
2345 2347 ob = JSON.stringify(ob);
2346   - th.setData({[l_txt]: good.s_libao, [l_txt1]: ob});
  2348 + th.setData({ [l_txt]: good.s_libao, [l_txt1]: ob });
2347 2349 }
2348 2350  
2349 2351 //专享礼包
... ... @@ -2351,9 +2353,9 @@ Page({
2351 2353 var l_txt = "formData.give_zxlb_id";
2352 2354 //这个是json格式的
2353 2355 var l_txt1 = "formData.g_zxlb_num";
2354   - var ob = [{"num": good.zx_lb_num, "l_id": good.zx_libao}];
  2356 + var ob = [{ "num": good.zx_lb_num, "l_id": good.zx_libao }];
2355 2357 ob = JSON.stringify(ob);
2356   - th.setData({[l_txt]: good.zx_libao, [l_txt1]: ob});
  2358 + th.setData({ [l_txt]: good.zx_libao, [l_txt1]: ob });
2357 2359  
2358 2360 }
2359 2361 }
... ... @@ -2388,7 +2390,7 @@ Page({
2388 2390 }
2389 2391 })
2390 2392 this.setData({
2391   - submit:1,
  2393 + submit: 1,
2392 2394 })
2393 2395 },
2394 2396  
... ... @@ -2523,8 +2525,8 @@ Page({
2523 2525 'prom_id': th.data.bn_goods.prom_id, //促销活动id
2524 2526 };
2525 2527  
2526   - if(getApp().globalData.skinface_id){
2527   - goods.skinface_id=getApp().globalData.skinface_id;
  2528 + if (getApp().globalData.skinface_id) {
  2529 + goods.skinface_id = getApp().globalData.skinface_id;
2528 2530 }
2529 2531  
2530 2532 //-- 把导购的信息填入--
... ... @@ -2613,8 +2615,8 @@ Page({
2613 2615 //--如果有赠品的时候,赠品也要提交---
2614 2616 if (th.data.buy_now_gift_goods) {
2615 2617 var gift_gg_arr = th.data.buy_now_gift_goods;
2616   - for(let i in gift_gg_arr){
2617   - let gift_gg=gift_gg_arr[i];
  2618 + for (let i in gift_gg_arr) {
  2619 + let gift_gg = gift_gg_arr[i];
2618 2620 var g_goods = {
2619 2621 'goods_id': gift_gg.goods_id,
2620 2622 'goods_name': gift_gg.goods_name,
... ... @@ -2759,11 +2761,11 @@ Page({
2759 2761 order_prom_list.g_zxlb_num = JSON.stringify(t_item.g_zxlb_num);
2760 2762 }
2761 2763  
2762   - if (Object.keys(order_prom_list).length > 0){
2763   - if(order_prom_list.discount_amount)
2764   - order_prom_list.discount_amount= parseFloat(order_prom_list.discount_amount).toFixed(2);
2765   - if(order_prom_list.order_prom_amount)
2766   - order_prom_list.order_prom_amount= parseFloat(order_prom_list.order_prom_amount).toFixed(2);
  2764 + if (Object.keys(order_prom_list).length > 0) {
  2765 + if (order_prom_list.discount_amount)
  2766 + order_prom_list.discount_amount = parseFloat(order_prom_list.discount_amount).toFixed(2);
  2767 + if (order_prom_list.order_prom_amount)
  2768 + order_prom_list.order_prom_amount = parseFloat(order_prom_list.order_prom_amount).toFixed(2);
2767 2769  
2768 2770 item.order_prom_list = order_prom_list;
2769 2771 }
... ... @@ -2809,8 +2811,8 @@ Page({
2809 2811 'store_id': oo.stoid,
2810 2812 };
2811 2813  
2812   - if(getApp().globalData.skinface_id){
2813   - goods.skinface_id=getApp().globalData.skinface_id;
  2814 + if (getApp().globalData.skinface_id) {
  2815 + goods.skinface_id = getApp().globalData.skinface_id;
2814 2816 }
2815 2817  
2816 2818 //-- 线下取价也要写入,组合购的商品不能去线下价格 --
... ... @@ -2913,7 +2915,7 @@ Page({
2913 2915 if (pdata.length == 0) return;
2914 2916 var str = JSON.stringify(pdata);
2915 2917  
2916   -
  2918 +
2917 2919 wx.showLoading({ title: "加载中" });
2918 2920 wx.request({
2919 2921 url: oo.url + '/api/weshop/order/createWxdOrder',
... ... @@ -3036,7 +3038,7 @@ Page({
3036 3038 },
3037 3039 complete: function () {
3038 3040 th.setData({
3039   - submit:0,
  3041 + submit: 0,
3040 3042 })
3041 3043 }
3042 3044 })
... ... @@ -3232,8 +3234,8 @@ Page({
3232 3234  
3233 3235 //------超出重量----------
3234 3236 if (out_of_weight < 0 && o_price >= freight_free && !th.data.is_no_by[pickid]) {
3235   - goods_weight=goods_weight+ out_of_weight;
3236   - if(goods_weight==0) goods_weight=-1;
  3237 + goods_weight = goods_weight + out_of_weight;
  3238 + if (goods_weight == 0) goods_weight = -1;
3237 3239 }
3238 3240  
3239 3241  
... ... @@ -3247,12 +3249,12 @@ Page({
3247 3249 }
3248 3250 }
3249 3251  
3250   - if(th.data.free1 && freight_free<=0) freight_free=th.data.free1;
  3252 + if (th.data.free1 && freight_free <= 0) freight_free = th.data.free1;
3251 3253  
3252 3254  
3253 3255 //当有包邮和不包邮混合在一起的时候,件数要重新计算
3254   - if(freight_free>0 && o_price >= freight_free && goods_piece>0 && th.data.cut_goods_piece)
3255   - goods_piece=goods_piece-th.data.cut_goods_piece;
  3256 + if (freight_free > 0 && o_price >= freight_free && goods_piece > 0 && th.data.cut_goods_piece)
  3257 + goods_piece = goods_piece - th.data.cut_goods_piece;
3256 3258 //------按件数----------
3257 3259 if (goods_piece > 0 && item['piecemoney']) {
3258 3260 fp_price = parseFloat(item['piecemoney']);
... ... @@ -3263,7 +3265,7 @@ Page({
3263 3265 }
3264 3266 }
3265 3267 //当有包邮和不包邮混合在一起的时候,统一运费要重新计算
3266   - if(freight_free>0 && o_price >= freight_free && th.data.cut_o_shipping_price && price>0) price=price-th.data.cut_o_shipping_price;
  3268 + if (freight_free > 0 && o_price >= freight_free && th.data.cut_o_shipping_price && price > 0) price = price - th.data.cut_o_shipping_price;
3267 3269  
3268 3270 var rspice = parseFloat(price + fw_price + fp_price);
3269 3271 return rspice;
... ... @@ -3481,7 +3483,6 @@ Page({
3481 3483  
3482 3484 },
3483 3485  
3484   -
3485 3486 /*----- 点击选择包邮券 -----*/
3486 3487 sele_quan_item_by: function (e) {
3487 3488 var no_use = e.currentTarget.dataset.no;
... ... @@ -3936,7 +3937,7 @@ Page({
3936 3937 arr[ind].check_quan_ware_list = check_quan_ware_list;
3937 3938 arr[ind].check_quan_price_list = check_quan_price_list;
3938 3939 //是否关闭使用优惠券
3939   - if (th.data.is_close_quan != 1 ) {
  3940 + if (th.data.is_close_quan != 1) {
3940 3941 //--调用接口,获取优惠券的列表,3秒钟内控制接口请求--
3941 3942 var url = "/api/weshop/couponList/getUseCouponList";
3942 3943 await app.request.promiseGet(url, {
... ... @@ -4045,7 +4046,7 @@ Page({
4045 4046 },
4046 4047 //立即购买获取优惠活动的内容
4047 4048 buy_now_prom_goods: function (prom_id, arr, func) {
4048   - var th=this;
  4049 + var th = this;
4049 4050 var price = arr.shop_price * arr.goods_num;
4050 4051 var prom = null;
4051 4052 var gg = to.get_b_now();
... ... @@ -4068,7 +4069,7 @@ Page({
4068 4069 if (res.data.code == 0) {
4069 4070 var get_data = res.data.data;
4070 4071 arr.is_bz = prom.is_bz; //是不是倍增
4071   - arr.is_xz_yh =arr.is_xz_yh?arr.is_xz_yh:prom.is_xz_yh; //是不是优惠
  4072 + arr.is_xz_yh = arr.is_xz_yh ? arr.is_xz_yh : prom.is_xz_yh; //是不是优惠
4072 4073 arr.bs = get_data.bs; //是不是倍数
4073 4074 arr.is_past = get_data.is_past; //是不是包邮
4074 4075 arr.prom_price = get_data.price >= 0 ? get_data.price : price;
... ... @@ -4076,13 +4077,13 @@ Page({
4076 4077 arr.s_coupon_id = get_data.coupon_id;
4077 4078 arr.s_coupon_num = get_data.coupon_num;
4078 4079 arr.zp_mode = get_data.zp_mode;
4079   - arr.zp_num = get_data.zp_num?get_data.zp_num:1; //确保默认一个
  4080 + arr.zp_num = get_data.zp_num ? get_data.zp_num : 1; //确保默认一个
4080 4081  
4081 4082 //-- 看是不是有赠品 --
4082   - if (get_data.gift_id && parseInt(get_data.zp_mode)!=1
4083   - && get_data.zp_num* arr.bs<=get_data.limit_num
4084   - && get_data.zp_num* arr.bs<=get_data.gift_storecount
4085   - ){
  4083 + if (get_data.gift_id && parseInt(get_data.zp_mode) != 1
  4084 + && get_data.zp_num * arr.bs <= get_data.limit_num
  4085 + && get_data.zp_num * arr.bs <= get_data.gift_storecount
  4086 + ) {
4086 4087 arr.gift_id = get_data.gift_id;
4087 4088 arr.gift_goods_id = get_data.goods_id;
4088 4089 arr.gift_goods_name = get_data.goods_name;
... ... @@ -4104,28 +4105,27 @@ Page({
4104 4105  
4105 4106 arr.prom_id = prom_id;
4106 4107  
4107   - var send_gf={};
4108   - var pickid=gg.pick_id;
4109   - if(parseInt(get_data.zp_mode)==1){
4110   - if(!send_gf[pickid]) send_gf[pickid]=[];
4111   -
4112   - var a_stock_num=0;
4113   - var a_limit_num=0;
4114   - for(let iy in get_data.giftsinfo){
4115   - let item=get_data.giftsinfo[iy];
4116   - a_stock_num+= parseInt(item.gift_storecount);
4117   - a_limit_num+=parseInt(item.limit_num);
  4108 + var send_gf = {};
  4109 + var pickid = gg.pick_id;
  4110 + if (parseInt(get_data.zp_mode) == 1) {
  4111 + if (!send_gf[pickid]) send_gf[pickid] = [];
  4112 +
  4113 + var a_stock_num = 0;
  4114 + var a_limit_num = 0;
  4115 + for (let iy in get_data.giftsinfo) {
  4116 + let item = get_data.giftsinfo[iy];
  4117 + a_stock_num += parseInt(item.gift_storecount);
  4118 + a_limit_num += parseInt(item.limit_num);
4118 4119 }
4119 4120  
4120   - var t_zp_num=parseInt(get_data.zp_num)*parseInt(get_data.bs);
4121   - if(a_limit_num>= t_zp_num && a_stock_num>=t_zp_num ){
  4121 + var t_zp_num = parseInt(get_data.zp_num) * parseInt(get_data.bs);
  4122 + if (a_limit_num >= t_zp_num && a_stock_num >= t_zp_num) {
4122 4123 send_gf[pickid].push({
4123   - pickup_id:pickid,giftsinfo:get_data.giftsinfo,zp_num:get_data.zp_num*get_data.bs,
4124   - gf_pr_name:prom.name,prom_id:prom.prom_id});
4125   -
  4124 + pickup_id: pickid, giftsinfo: get_data.giftsinfo, zp_num: get_data.zp_num * get_data.bs,
  4125 + gf_pr_name: prom.name, prom_id: prom.prom_id
  4126 + });
4126 4127 }
4127   -
4128   - th.setData({send_gf:send_gf});
  4128 + th.setData({ send_gf: send_gf });
4129 4129 }
4130 4130 }
4131 4131 func(arr);
... ... @@ -4137,7 +4137,7 @@ Page({
4137 4137 if (this.data.is_b_now == 1) pick = this.data.bn_pick;
4138 4138 //---获取订单优惠---
4139 4139 getApp().request.promiseGet("/api/weshop/promorder/getOrderPromotion", {
4140   - data: { store_id: os.stoid, orderAmount: condition,user_id:getApp().globalData.user_id }
  4140 + data: { store_id: os.stoid, orderAmount: condition, user_id: getApp().globalData.user_id }
4141 4141 }).then(res => {
4142 4142 if (res.data.code == 0) {
4143 4143 var data = res.data.data;
... ... @@ -4202,6 +4202,89 @@ Page({
4202 4202  
4203 4203 }
4204 4204 },
  4205 + //---检查有没有优惠活动---
  4206 + check_is_youhui: function (gid, pick_id) {
  4207 + let th = this;
  4208 + let user_id = getApp().globalData.user_id;
  4209 + let send_lb = th.data.send_lb;
  4210 + if (!user_id) user_id = 0;
  4211 + //调用接口判断订单优惠,
  4212 + getApp().request.get("/api/weshop/goods/getGoodsPromList/" + os.stoid + "/" + gid + "/0" + "/" + user_id, {
  4213 + success: function (res) {
  4214 + if (res.data.code == 0 && res.data.data) {
  4215 + let r_data = res.data.data.promGoodsLists.filter(lb => {
  4216 + return lb.lb_id ?? lb.zxlb_id;
  4217 + });
  4218 + r_data.forEach(item => {
  4219 + if (send_lb[pick_id]) {
  4220 + for (let i = 0; i < send_lb[pick_id].length; i++) {
  4221 + let sends = send_lb[pick_id][i];
  4222 + if (item.lb_id) {
  4223 + if (sends.id === item.lb_id) {
  4224 + sends['num']++;
  4225 + } else {
  4226 + let send_arr1 = send_lb[pick_id].filter(ii=>ii.id === item.lb_id);
  4227 + if (send_arr1.length == 0) {
  4228 + if (item.lb_id) {
  4229 + let ob = {};
  4230 + ob.num = 1;
  4231 + ob.title = item.lbtitle;
  4232 + ob.id = item.lb_id;
  4233 + send_lb[pick_id].push(ob);
  4234 + break;
  4235 + }
  4236 + }
  4237 +
  4238 + }
  4239 + }
  4240 + if (item.zxlb_id) {
  4241 + if (sends.id === item.zxlb_id) {
  4242 + sends['num']++;
  4243 + } else {
  4244 + let send_arr = send_lb[pick_id].filter(ii=>ii.id === item.zxlb_id);
  4245 + if (send_arr.length == 0) {
  4246 + if (item.zxlb_id) {
  4247 + let ob = {};
  4248 + ob.num = 1;
  4249 + ob.flag = 1;
  4250 + ob.title = item.zxlbtitle;
  4251 + ob.id = item.zxlb_id;
  4252 + send_lb[pick_id].push(ob);
  4253 + break;
  4254 + }
  4255 + }
  4256 + }
  4257 + }
  4258 + }
  4259 +
  4260 + } else {
  4261 + let arr = new Array();
  4262 + if (item.lb_id) {
  4263 + let ob = {};
  4264 + ob.num = 1;
  4265 + ob.title = item.lbtitle;
  4266 + ob.id = item.lb_id;
  4267 + arr.push(ob);
  4268 + }
  4269 + if (item.zxlb_id) {
  4270 + let ob = {};
  4271 + ob.num = 1;
  4272 + ob.flag = 1;
  4273 + ob.title = item.zxlbtitle;
  4274 + ob.id = item.zxlb_id;
  4275 + arr.push(ob);
  4276 + }
  4277 + send_lb[pick_id] = arr;
  4278 + }
  4279 + })
  4280 + th.setData({
  4281 + send_lb,
  4282 + })
  4283 +
  4284 + }
  4285 + }
  4286 + })
  4287 + },
4205 4288  
4206 4289 //计算立即购买赠品的物流费用
4207 4290 get_now_gift_goods_wuliu: function (code, o_shipping_price, user_addr, gift_freight_free, out_of_weight, allpice, rs, shipping_price, no_by_data, goods_weight1, goods_piece1) {
... ... @@ -4209,8 +4292,7 @@ Page({
4209 4292 var goods_weight = -1, goods_piece = -1;
4210 4293  
4211 4294 var gift_shipping_price = 0;
4212   - if (shipping_price)
4213   - {
  4295 + if (shipping_price) {
4214 4296 gift_shipping_price = shipping_price;
4215 4297 }
4216 4298 var th = this;
... ... @@ -4226,8 +4308,8 @@ Page({
4226 4308 }
4227 4309 }
4228 4310  
4229   - for(var i in good_arr) {
4230   - var good=good_arr[i];
  4311 + for (var i in good_arr) {
  4312 + var good = good_arr[i];
4231 4313 switch (good['exp_sum_type']) {
4232 4314 case 1:
4233 4315 //统一运费
... ... @@ -4247,7 +4329,7 @@ Page({
4247 4329 case 3:
4248 4330 if (goods_piece < 0) goods_piece = 0;
4249 4331 //累积商品数量
4250   - goods_piece += parseInt(good['buynum']) ;
  4332 + goods_piece += parseInt(good['buynum']);
4251 4333 if (goods_piece1) {
4252 4334 goods_piece += goods_piece1;
4253 4335 }
... ... @@ -4259,14 +4341,14 @@ Page({
4259 4341 if (th.check_by_goods(no_by_data.goods_list, good.goods_id)) {
4260 4342 gift_freight_free = 0;
4261 4343 // out_of_weight = 0
4262   - th.data.is_no_by[th.data.bn_pick]=1;
  4344 + th.data.is_no_by[th.data.bn_pick] = 1;
4263 4345 }
4264 4346 }
4265 4347 }
4266 4348  
4267 4349 var t_shipping_price =
4268 4350 this.calculatewuliu(code, gift_shipping_price, goods_weight, out_of_weight,
4269   - goods_piece, user_addr, gift_freight_free, allpice, rs,th.data.bn_pick);
  4351 + goods_piece, user_addr, gift_freight_free, allpice, rs, th.data.bn_pick);
4270 4352 return t_shipping_price;
4271 4353  
4272 4354 },
... ... @@ -4334,6 +4416,20 @@ Page({
4334 4416 this.setData({ is_offline_show: 1, show_off_price: off_price.toFixed(2), is_get_offline: is_get_offline });
4335 4417 },
4336 4418  
  4419 + // 促销 -> 送礼包 -> 查看详情
  4420 + viewLbDetails(e) {
  4421 + let id = e.currentTarget.dataset.id; // 获取礼包id
  4422 + let flag = e.currentTarget.dataset.flag;
  4423 + let url = '';
  4424 + if (flag == 1) { // flag =1 控制跳转到专享礼包
  4425 + url = `/pages/giftpack/giftpacklist/giftpacklist?lbId=${id}&flag=1`;
  4426 + } else {
  4427 + url = `/packageA/pages/myGiftDetails/myGiftDetails?btn=0&index=0&id=${id}`; // btn=0 控制跳转到的页面不显示按钮
  4428 + };
  4429 + // console.log('myurl', url);
  4430 + getApp().goto(url);
  4431 + },
  4432 +
4337 4433 //确定使用线下取价
4338 4434 sure_offline: function () {
4339 4435 var bn_goods = this.data.bn_goods;
... ... @@ -4459,7 +4555,7 @@ Page({
4459 4555 },
4460 4556 //订阅消息提醒
4461 4557 sendsm: function (func) {
4462   - let th =this;
  4558 + let th = this;
4463 4559 var template_id = this.data.template_id;
4464 4560 // //授权订阅
4465 4561 wx.requestSubscribeMessage({
... ... @@ -4467,417 +4563,417 @@ Page({
4467 4563 success(res) {
4468 4564 func();
4469 4565 th.setData({
4470   - submit:0,
  4566 + submit: 0,
4471 4567 })
4472 4568 },
4473 4569 fail(res) {
4474 4570 func();
4475 4571 th.setData({
4476   - submit:0,
  4572 + submit: 0,
4477 4573 })
4478 4574 }
4479 4575 })
4480 4576  
4481 4577 },
4482 4578  
4483   - setexptype2: function(e) {
4484   - this.debounce(this.setexptype.bind(this, e),400)();
4485   - },
4486   -
4487   - setexptype_w2: function(e) {
4488   - this.debounce(this.setexptype_w.bind(this, e),400)();
4489   - },
4490   -
4491   - // 函数防抖
4492   - debounce: function (func, wait) {
4493   - return () => {
4494   - clearTimeout(timer);
4495   - timer = setTimeout(func, wait);
4496   - };
4497   - },
4498   -
4499   -
4500   - //-- 判断是不是选中 --
4501   - check_th_item:function (e) {
4502   - var th=this;
4503   - var idx=e.currentTarget.dataset.item;
4504   - var check=e.currentTarget.dataset.check;
4505   - var txt="giftsinfo["+idx+"].selected";
4506   - var gift_item=this.data.giftsinfo[idx];
4507   -
4508   - if(check){
4509   - th.setData({[txt]:0});
4510   - }else{
4511   -
4512   - var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,gift_item.goods_num);
4513   - if(!is_true){ return false; }
4514   -
4515   - th.setData({[txt]:1});
4516   - }
4517   - },
4518   -
4519   -
4520   - //输入框输入数量的时候
4521   - valueToNum:function (e){
4522   - var th=this;
4523   - var idx=e.currentTarget.dataset.item;
4524   - var gift_item=this.data.giftsinfo[idx];
4525   - var num=parseInt(e.detail.value);
4526   - var txt="giftsinfo["+idx+"].goods_num";
4527   - var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num);
4528   - if(!is_true){
4529   - th.setData({[txt]:1});
4530   - return false;
4531   - }
4532   - th.setData({[txt]:num});
  4579 + setexptype2: function (e) {
  4580 + this.debounce(this.setexptype.bind(this, e), 400)();
  4581 + },
4533 4582  
4534   - },
  4583 + setexptype_w2: function (e) {
  4584 + this.debounce(this.setexptype_w.bind(this, e), 400)();
  4585 + },
  4586 +
  4587 + // 函数防抖
  4588 + debounce: function (func, wait) {
  4589 + return () => {
  4590 + clearTimeout(timer);
  4591 + timer = setTimeout(func, wait);
  4592 + };
  4593 + },
4535 4594  
4536 4595  
  4596 + //-- 判断是不是选中 --
  4597 + check_th_item: function (e) {
  4598 + var th = this;
  4599 + var idx = e.currentTarget.dataset.item;
  4600 + var check = e.currentTarget.dataset.check;
  4601 + var txt = "giftsinfo[" + idx + "].selected";
  4602 + var gift_item = this.data.giftsinfo[idx];
4537 4603  
4538   - addNum:function (e) {
4539   - var th=this;
4540   - var idx=e.currentTarget.dataset.item;
4541   - var txt="giftsinfo["+idx+"].goods_num";
4542   - var num=th.data.giftsinfo[idx].goods_num+1;
4543   - var gift_item=this.data.giftsinfo[idx];
4544   - var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num);
4545   - if(!is_true){ return false; }
4546   - th.setData({[txt]:num});
4547   - },
4548   -
4549   - subNum:function (e) {
4550   - var th=this;
4551   - var idx=e.currentTarget.dataset.item;
4552   - var txt="giftsinfo["+idx+"].goods_num";
4553   - var num=th.data.giftsinfo[idx].goods_num-1;
4554   - var gift_item=this.data.giftsinfo[idx];
4555   - var is_true=th.check_out_num_cart(gift_item,this.data.gift_pkid,num);
4556   - if(!is_true){
4557   - return false;
4558   - }
4559   - if(num<1) return false;
4560   - th.setData({[txt]:num});
4561   - },
  4604 + if (check) {
  4605 + th.setData({ [txt]: 0 });
  4606 + } else {
  4607 +
  4608 + var is_true = th.check_out_num_cart(gift_item, this.data.gift_pkid, gift_item.goods_num);
  4609 + if (!is_true) { return false; }
  4610 +
  4611 + th.setData({ [txt]: 1 });
  4612 + }
  4613 + },
  4614 +
  4615 +
  4616 + //输入框输入数量的时候
  4617 + valueToNum: function (e) {
  4618 + var th = this;
  4619 + var idx = e.currentTarget.dataset.item;
  4620 + var gift_item = this.data.giftsinfo[idx];
  4621 + var num = parseInt(e.detail.value);
  4622 + var txt = "giftsinfo[" + idx + "].goods_num";
  4623 + var is_true = th.check_out_num_cart(gift_item, this.data.gift_pkid, num);
  4624 + if (!is_true) {
  4625 + th.setData({ [txt]: 1 });
  4626 + return false;
  4627 + }
  4628 + th.setData({ [txt]: num });
  4629 +
  4630 + },
  4631 +
  4632 +
  4633 +
  4634 + addNum: function (e) {
  4635 + var th = this;
  4636 + var idx = e.currentTarget.dataset.item;
  4637 + var txt = "giftsinfo[" + idx + "].goods_num";
  4638 + var num = th.data.giftsinfo[idx].goods_num + 1;
  4639 + var gift_item = this.data.giftsinfo[idx];
  4640 + var is_true = th.check_out_num_cart(gift_item, this.data.gift_pkid, num);
  4641 + if (!is_true) { return false; }
  4642 + th.setData({ [txt]: num });
  4643 + },
  4644 +
  4645 + subNum: function (e) {
  4646 + var th = this;
  4647 + var idx = e.currentTarget.dataset.item;
  4648 + var txt = "giftsinfo[" + idx + "].goods_num";
  4649 + var num = th.data.giftsinfo[idx].goods_num - 1;
  4650 + var gift_item = this.data.giftsinfo[idx];
  4651 + var is_true = th.check_out_num_cart(gift_item, this.data.gift_pkid, num);
  4652 + if (!is_true) {
  4653 + return false;
  4654 + }
  4655 + if (num < 1) return false;
  4656 + th.setData({ [txt]: num });
  4657 + },
4562 4658  
4563 4659 //-- 点击选中赠品 --
4564   - show_sele_gift:function (e) {
4565   - var index=e.currentTarget.dataset.index;
4566   - var pk=e.currentTarget.dataset.pk;
4567   - var giftsinfo=this.data.send_gf[pk][index].giftsinfo;
4568   -
4569   - for(let i in giftsinfo){
4570   - let item=giftsinfo[i];
4571   - if(!item.goods_num) giftsinfo[i].goods_num=1;
  4660 + show_sele_gift: function (e) {
  4661 + var index = e.currentTarget.dataset.index;
  4662 + var pk = e.currentTarget.dataset.pk;
  4663 + var giftsinfo = this.data.send_gf[pk][index].giftsinfo;
  4664 +
  4665 + for (let i in giftsinfo) {
  4666 + let item = giftsinfo[i];
  4667 + if (!item.goods_num) giftsinfo[i].goods_num = 1;
4572 4668 }
4573 4669  
4574 4670 this.setData({
4575   - show_duo_gift:1,
4576   - giftsinfo:giftsinfo,
4577   - gf_pr_name:this.data.send_gf[pk][index].gf_pr_name,
4578   - zp_num:this.data.send_gf[pk][index].zp_num,
4579   - gift_pkid:pk,
4580   - gf_prom_id:this.data.send_gf[pk][index].prom_id,
4581   - send_gf_index:index
  4671 + show_duo_gift: 1,
  4672 + giftsinfo: giftsinfo,
  4673 + gf_pr_name: this.data.send_gf[pk][index].gf_pr_name,
  4674 + zp_num: this.data.send_gf[pk][index].zp_num,
  4675 + gift_pkid: pk,
  4676 + gf_prom_id: this.data.send_gf[pk][index].prom_id,
  4677 + send_gf_index: index
4582 4678 })
4583 4679 },
4584 4680  
4585   - close_sele_gift:function () {
4586   - this.setData({show_duo_gift:0})
  4681 + close_sele_gift: function () {
  4682 + this.setData({ show_duo_gift: 0 })
4587 4683 },
4588 4684  
4589 4685 //购物车赠品有咩有超出库存。有灭有超出限购
4590   - check_out_num_cart:function(discount,pick_id,num) {
4591   - var prom_id= discount.prom_id;
4592   - var alllist=this.data.cartlist;
4593   - var all_num=num;
4594   - var all_limit_num=num;
4595   - var gift_id=discount.gift_id;
4596   - for (var i in alllist) {
4597   - var list_item = alllist[i];
4598   - //-- 门店相同,活动相同的时候 --
4599   - if(pick_id==list_item.pickup_id && prom_id==list_item.prom_id) continue;
4600   - for (var j in list_item.goods) {
4601   - //如果赠品的ID一样,要进行统计数量
4602   - if (list_item.goods[j].is_gift == 1 &&
4603   - list_item.goods[j].gift_id == gift_id) {
4604   - all_num += list_item.goods[j].goods_num;
4605   - }
4606   - if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id ==gift_id && list_item.goods[j].prom_id == prom_id) {
4607   - all_limit_num += list_item.goods[j].limit_num;
4608   - }
4609   - }
4610   - }
4611   - //-- 赠品的数量超出库存数量和会员的限制,
4612   - // 这里是保证所有的赠品部会超出 --
4613   - if (discount.gift_storecount < all_num ) {
4614   - wx.showToast({
4615   - title: "赠品库存不足",
4616   - icon: 'none',
4617   - duration: 2000
4618   - });
4619   - return false;
4620   - }
4621   - if (discount.limit_num < all_limit_num) {
4622   - wx.showToast({
4623   - title:"超出赠品限购",
4624   - icon: 'none',
4625   - duration: 2000
4626   - });
4627   - return false;
4628   - }
4629   - return true;
4630   - },
4631   -
4632   - //-- 确定赠品 --
4633   - sure_this_gift:async function () {
4634   - var th = this;
4635   - var gf_pickup_id = this.data.gift_pkid;
4636   -
4637   - var zp_num = this.data.zp_num;
4638   - var giftsinfo = this.data.giftsinfo;
4639   - var all_num = 0;
4640   - for (let i in giftsinfo) {
4641   - let item = giftsinfo[i];
4642   - if (!item.selected) continue;
4643   - all_num += item.goods_num;
4644   - }
4645   - if (all_num > zp_num) {
4646   - wx.showToast({
4647   - title: "超出活动赠品赠送的数量" + zp_num + "件",
4648   - icon: 'none',
4649   - duration: 2000
4650   - });
4651   - return false;
4652   - }
4653   - if (all_num < zp_num) {
4654   - wx.showToast({
4655   - title: "您还可以加" + (zp_num - all_num) + "件",
4656   - icon: 'none',
4657   - duration: 2000
4658   - });
4659   - return false;
4660   - }
4661   -
4662   - //-- 当是购物车购买的时候 --
4663   - if(this.data.cartlist && this.data.cartlist.length>0){
4664   - var alllist = this.data.cartlist;
4665   - var index = alllist.findIndex(function (e) {
4666   - return e.pickup_id == gf_pickup_id
4667   - });
4668   - var pk_list_goods = alllist[index].goods;
4669   -
4670   - var url = "/api/weshop/cart/delGift?store_id=" + os.stoid + "&user_id="
4671   - + getApp().globalData.user_id + "&is_gift=1&pick_id=" + this.data.gift_pkid + "&prom_id=" + this.data.prom_id;
4672   - await getApp().request.promiseDelete(url, {});
4673   -
4674   - var new_pk_list_goods = [];
4675   - for (let i in pk_list_goods) {
4676   - let item = pk_list_goods[i];
4677   - if (item.is_gift && item.prom_id == this.data.gf_prom_id) {
4678   - continue;
4679   - }
4680   - new_pk_list_goods.push(item)
4681   - }
4682   -
4683   - //-- 循环把赠品添加进去 --
4684   - for (var i = 0; i < giftsinfo.length; i++) {
4685   - var gf_item = giftsinfo[i];
4686   - if (!gf_item.selected) continue;
4687   - var add_data = null;
4688   - var newd = {
4689   - goods_id: gf_item.goodsinfo.goods_id,
4690   - goods_num: gf_item.goods_num,
4691   - pick_id: gf_pickup_id,
4692   - user_id: app.globalData.user_id,
4693   - store_id: os.stoid,
4694   - goods_price: 0,
4695   - member_goods_price: 0,
4696   - goods_name: gf_item.goodsinfo.goods_name,
4697   - goods_sn: gf_item.goodsinfo.goods_sn,
4698   - sku: gf_item.goodsinfo.sku,
4699   - is_gift: 1,
4700   - prom_id: th.data.gf_prom_id,
4701   - prom_type: 3,
4702   - selected: 1,
4703   - gift_id: gf_item.gift_id,
4704   - original_img: th.data.imgUrl + gf_item.goodsinfo.original_img,
4705   - exp_sum_type: gf_item.goodsinfo.exp_sum_type,
4706   - is_free_shipping: gf_item.goodsinfo.is_free_shipping,
4707   - weight: gf_item.goodsinfo.weight,
4708   - uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
4709   - goods_spec: gf_item.goodsinfo.goods_spec,
4710   - goods_color: gf_item.goodsinfo.goods_color,
4711   - };
4712   -
4713   - await getApp().request.promisePost("/api/weshop/cart/save", {
4714   - data: newd
4715   - }).then(res => {
4716   - if (res.data.code == 0) {
4717   - add_data = res.data.data;
4718   - }
4719   - })
4720   - if (add_data) {
4721   - newd.id = add_data.id;
4722   - new_pk_list_goods.push(newd);
4723   - }
4724   - }
4725   -
4726   - var set_data = this.data.send_gf[gf_pickup_id][this.data.send_gf_index];
4727   - set_data.selected = 1;
4728   - var txt9 = "cartlist[" + index + "].goods";
4729   -
4730   - th.setData({[txt9]: new_pk_list_goods, send_gf: this.data.send_gf});
4731   - this.data.old_cartlist[index].goods = new_pk_list_goods;
4732   -
4733   -
4734   - console.log(this.data.send_gf,"----");
4735   -
4736   - th.calculatePrice();
4737   - }else{
4738   - var new_pk_list_goods=[];
4739   - //-- 当是立即购买的时候 --
4740   - for (var i = 0; i < giftsinfo.length; i++) {
4741   - var gf_item = giftsinfo[i];
4742   - if (!gf_item.selected) continue;
4743   - var newd = {
4744   - goods_id: gf_item.goodsinfo.goods_id,
4745   - buynum: gf_item.goods_num,
4746   - pick_id: gf_pickup_id,
4747   - user_id: app.globalData.user_id,
4748   - store_id: os.stoid,
4749   - goods_price: 0,
4750   - member_goods_price: 0,
4751   - goods_name: gf_item.goodsinfo.goods_name,
4752   - goods_sn: gf_item.goodsinfo.goods_sn,
4753   - sku: gf_item.goodsinfo.sku,
4754   - is_gift: 1,
4755   - prom_id: th.data.gf_prom_id,
4756   - prom_type: 3,
4757   - selected: 1,
4758   - gift_id: gf_item.gift_id,
4759   - original_img: th.data.imgUrl + gf_item.goodsinfo.original_img,
4760   - exp_sum_type: gf_item.goodsinfo.exp_sum_type,
4761   - is_free_shipping: gf_item.goodsinfo.is_free_shipping,
4762   - weight: gf_item.goodsinfo.weight,
4763   - uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
4764   - uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
4765   - goods_spec: gf_item.goodsinfo.goods_spec,
4766   - goods_color: gf_item.goodsinfo.goods_color,
4767   - };
4768   - new_pk_list_goods.push(newd);
4769   - }
4770   - var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index];
4771   - set_data.selected = 1;
4772   - var txt1 = "send_gf[" + gf_pickup_id + "][" + this.data.send_gf_index + "]";
4773   -
4774   - th.setData({buy_now_gift_goods:new_pk_list_goods,[txt1]:set_data});
4775   - th.calculatePrice2();
4776   -
4777   - }
4778   - th.close_sele_gift();
4779   - },
4780   -
4781   - //获取输入
4782   - getInput:function (e) {
4783   - this.data.gift_sear=e.detail.value;
4784   - },
4785   - //-- 搜索赠品 --
4786   - submitSearch:function () {
4787   - var giftsinfo=this.data.giftsinfo;
4788   - if(!this.data.gift_sear){
4789   - for(let i in giftsinfo){
4790   - let item=giftsinfo[i];
4791   - item.hide_div=0;
4792   - }
4793   - }else{
4794   - for(let i in giftsinfo){
4795   - let item=giftsinfo[i];
4796   - item.hide_div=0;
4797   - if(item.goods_name.indexOf(this.data.gift_sear)==-1){
4798   - item.hide_div=1;
4799   - }
4800   - }
4801   - }
4802   - this.setData({giftsinfo:giftsinfo})
4803   -
4804   - },
4805   -
4806   - //-- 赠品的验证 --
4807   - sub_check_gift(func){
4808   - var th=this;
4809   - if(th.data.send_gf){
4810   - var error_arr=[];
4811   - for(let io in th.data.send_gf){
4812   - let item_arr=th.data.send_gf[io];
4813   - for(let ip in item_arr){
4814   - var gf_pr_name=item_arr[ip].gf_pr_name;
4815   - var zp_num=item_arr[ip].zp_num;
4816   - var giftsinfo=item_arr[ip].giftsinfo;
4817   - var limit_all=0;
4818   - var stock_all=0;
4819   - for(let iu in giftsinfo){
4820   - let gf_item=giftsinfo[iu];
4821   - limit_all+=gf_item.limit_num;
4822   - stock_all+=gf_item.gift_storecount;
4823   - }
4824   - if(limit_all<zp_num){
4825   - error_arr.push(gf_pr_name+"限购不足");
4826   - }
4827   - if(stock_all<zp_num){
4828   - error_arr.push(gf_pr_name+"赠品库存不足");
4829   - }
4830   - }
4831   - }
4832   -
4833   - //-- 有赠品错误的时候,是不是继续下单 --
4834   - if(error_arr.length){
4835   - var err=error_arr.join(",");
4836   - wx.showModal({
4837   - title: '提示',
4838   - content: err+',无法赠送赠品,是否继续下单',
4839   - success (res) {
4840   - if (res.confirm) {
4841   - func();
4842   - } else if (res.cancel) {
4843   - console.log('用户点击取消');
4844   - th.setData({
4845   - submit:0,
4846   - })
4847   - }
4848   - }
4849   - })
4850   - }else {
4851   -
4852   - var is_ok = 1;
4853   - var error_arr = [];
4854   - for (let io in th.data.send_gf) {
4855   - let item_arr1 = th.data.send_gf[io];
4856   - for (let ip1 in item_arr1) {
4857   - var item_b = item_arr1[ip1];
4858   - if (!item_b.selected) {
4859   - is_ok = 0;
4860   - break;
4861   - }
4862   - }
4863   - if (!is_ok) break;
4864   - }
4865   -
4866   - if (!is_ok) {
4867   - getApp().confirmBox("请选择赠品");
4868   - th.setData({
4869   - submit:0,
4870   - })
4871   - return false;
4872   - }
4873   - func();
4874   - }
4875   -
4876   -
4877   - }else{
4878   - func();
4879   - }
4880   - }
  4686 + check_out_num_cart: function (discount, pick_id, num) {
  4687 + var prom_id = discount.prom_id;
  4688 + var alllist = this.data.cartlist;
  4689 + var all_num = num;
  4690 + var all_limit_num = num;
  4691 + var gift_id = discount.gift_id;
  4692 + for (var i in alllist) {
  4693 + var list_item = alllist[i];
  4694 + //-- 门店相同,活动相同的时候 --
  4695 + if (pick_id == list_item.pickup_id && prom_id == list_item.prom_id) continue;
  4696 + for (var j in list_item.goods) {
  4697 + //如果赠品的ID一样,要进行统计数量
  4698 + if (list_item.goods[j].is_gift == 1 &&
  4699 + list_item.goods[j].gift_id == gift_id) {
  4700 + all_num += list_item.goods[j].goods_num;
  4701 + }
  4702 + if (list_item.goods[j].is_gift == 1 && list_item.goods[j].gift_id == gift_id && list_item.goods[j].prom_id == prom_id) {
  4703 + all_limit_num += list_item.goods[j].limit_num;
  4704 + }
  4705 + }
  4706 + }
  4707 + //-- 赠品的数量超出库存数量和会员的限制,
  4708 + // 这里是保证所有的赠品部会超出 --
  4709 + if (discount.gift_storecount < all_num) {
  4710 + wx.showToast({
  4711 + title: "赠品库存不足",
  4712 + icon: 'none',
  4713 + duration: 2000
  4714 + });
  4715 + return false;
  4716 + }
  4717 + if (discount.limit_num < all_limit_num) {
  4718 + wx.showToast({
  4719 + title: "超出赠品限购",
  4720 + icon: 'none',
  4721 + duration: 2000
  4722 + });
  4723 + return false;
  4724 + }
  4725 + return true;
  4726 + },
  4727 +
  4728 + //-- 确定赠品 --
  4729 + sure_this_gift: async function () {
  4730 + var th = this;
  4731 + var gf_pickup_id = this.data.gift_pkid;
  4732 +
  4733 + var zp_num = this.data.zp_num;
  4734 + var giftsinfo = this.data.giftsinfo;
  4735 + var all_num = 0;
  4736 + for (let i in giftsinfo) {
  4737 + let item = giftsinfo[i];
  4738 + if (!item.selected) continue;
  4739 + all_num += item.goods_num;
  4740 + }
  4741 + if (all_num > zp_num) {
  4742 + wx.showToast({
  4743 + title: "超出活动赠品赠送的数量" + zp_num + "件",
  4744 + icon: 'none',
  4745 + duration: 2000
  4746 + });
  4747 + return false;
  4748 + }
  4749 + if (all_num < zp_num) {
  4750 + wx.showToast({
  4751 + title: "您还可以加" + (zp_num - all_num) + "件",
  4752 + icon: 'none',
  4753 + duration: 2000
  4754 + });
  4755 + return false;
  4756 + }
  4757 +
  4758 + //-- 当是购物车购买的时候 --
  4759 + if (this.data.cartlist && this.data.cartlist.length > 0) {
  4760 + var alllist = this.data.cartlist;
  4761 + var index = alllist.findIndex(function (e) {
  4762 + return e.pickup_id == gf_pickup_id
  4763 + });
  4764 + var pk_list_goods = alllist[index].goods;
  4765 +
  4766 + var url = "/api/weshop/cart/delGift?store_id=" + os.stoid + "&user_id="
  4767 + + getApp().globalData.user_id + "&is_gift=1&pick_id=" + this.data.gift_pkid + "&prom_id=" + this.data.prom_id;
  4768 + await getApp().request.promiseDelete(url, {});
  4769 +
  4770 + var new_pk_list_goods = [];
  4771 + for (let i in pk_list_goods) {
  4772 + let item = pk_list_goods[i];
  4773 + if (item.is_gift && item.prom_id == this.data.gf_prom_id) {
  4774 + continue;
  4775 + }
  4776 + new_pk_list_goods.push(item)
  4777 + }
  4778 +
  4779 + //-- 循环把赠品添加进去 --
  4780 + for (var i = 0; i < giftsinfo.length; i++) {
  4781 + var gf_item = giftsinfo[i];
  4782 + if (!gf_item.selected) continue;
  4783 + var add_data = null;
  4784 + var newd = {
  4785 + goods_id: gf_item.goodsinfo.goods_id,
  4786 + goods_num: gf_item.goods_num,
  4787 + pick_id: gf_pickup_id,
  4788 + user_id: app.globalData.user_id,
  4789 + store_id: os.stoid,
  4790 + goods_price: 0,
  4791 + member_goods_price: 0,
  4792 + goods_name: gf_item.goodsinfo.goods_name,
  4793 + goods_sn: gf_item.goodsinfo.goods_sn,
  4794 + sku: gf_item.goodsinfo.sku,
  4795 + is_gift: 1,
  4796 + prom_id: th.data.gf_prom_id,
  4797 + prom_type: 3,
  4798 + selected: 1,
  4799 + gift_id: gf_item.gift_id,
  4800 + original_img: th.data.imgUrl + gf_item.goodsinfo.original_img,
  4801 + exp_sum_type: gf_item.goodsinfo.exp_sum_type,
  4802 + is_free_shipping: gf_item.goodsinfo.is_free_shipping,
  4803 + weight: gf_item.goodsinfo.weight,
  4804 + uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
  4805 + goods_spec: gf_item.goodsinfo.goods_spec,
  4806 + goods_color: gf_item.goodsinfo.goods_color,
  4807 + };
  4808 +
  4809 + await getApp().request.promisePost("/api/weshop/cart/save", {
  4810 + data: newd
  4811 + }).then(res => {
  4812 + if (res.data.code == 0) {
  4813 + add_data = res.data.data;
  4814 + }
  4815 + })
  4816 + if (add_data) {
  4817 + newd.id = add_data.id;
  4818 + new_pk_list_goods.push(newd);
  4819 + }
  4820 + }
  4821 +
  4822 + var set_data = this.data.send_gf[gf_pickup_id][this.data.send_gf_index];
  4823 + set_data.selected = 1;
  4824 + var txt9 = "cartlist[" + index + "].goods";
  4825 +
  4826 + th.setData({ [txt9]: new_pk_list_goods, send_gf: this.data.send_gf });
  4827 + this.data.old_cartlist[index].goods = new_pk_list_goods;
  4828 +
  4829 +
  4830 + console.log(this.data.send_gf, "----");
  4831 +
  4832 + th.calculatePrice();
  4833 + } else {
  4834 + var new_pk_list_goods = [];
  4835 + //-- 当是立即购买的时候 --
  4836 + for (var i = 0; i < giftsinfo.length; i++) {
  4837 + var gf_item = giftsinfo[i];
  4838 + if (!gf_item.selected) continue;
  4839 + var newd = {
  4840 + goods_id: gf_item.goodsinfo.goods_id,
  4841 + buynum: gf_item.goods_num,
  4842 + pick_id: gf_pickup_id,
  4843 + user_id: app.globalData.user_id,
  4844 + store_id: os.stoid,
  4845 + goods_price: 0,
  4846 + member_goods_price: 0,
  4847 + goods_name: gf_item.goodsinfo.goods_name,
  4848 + goods_sn: gf_item.goodsinfo.goods_sn,
  4849 + sku: gf_item.goodsinfo.sku,
  4850 + is_gift: 1,
  4851 + prom_id: th.data.gf_prom_id,
  4852 + prom_type: 3,
  4853 + selected: 1,
  4854 + gift_id: gf_item.gift_id,
  4855 + original_img: th.data.imgUrl + gf_item.goodsinfo.original_img,
  4856 + exp_sum_type: gf_item.goodsinfo.exp_sum_type,
  4857 + is_free_shipping: gf_item.goodsinfo.is_free_shipping,
  4858 + weight: gf_item.goodsinfo.weight,
  4859 + uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
  4860 + uniform_exp_sum: gf_item.goodsinfo.uniform_exp_sum,
  4861 + goods_spec: gf_item.goodsinfo.goods_spec,
  4862 + goods_color: gf_item.goodsinfo.goods_color,
  4863 + };
  4864 + new_pk_list_goods.push(newd);
  4865 + }
  4866 + var set_data = this.data.send_gf[th.data.bn_pick][this.data.send_gf_index];
  4867 + set_data.selected = 1;
  4868 + var txt1 = "send_gf[" + gf_pickup_id + "][" + this.data.send_gf_index + "]";
  4869 +
  4870 + th.setData({ buy_now_gift_goods: new_pk_list_goods, [txt1]: set_data });
  4871 + th.calculatePrice2();
  4872 +
  4873 + }
  4874 + th.close_sele_gift();
  4875 + },
  4876 +
  4877 + //获取输入
  4878 + getInput: function (e) {
  4879 + this.data.gift_sear = e.detail.value;
  4880 + },
  4881 + //-- 搜索赠品 --
  4882 + submitSearch: function () {
  4883 + var giftsinfo = this.data.giftsinfo;
  4884 + if (!this.data.gift_sear) {
  4885 + for (let i in giftsinfo) {
  4886 + let item = giftsinfo[i];
  4887 + item.hide_div = 0;
  4888 + }
  4889 + } else {
  4890 + for (let i in giftsinfo) {
  4891 + let item = giftsinfo[i];
  4892 + item.hide_div = 0;
  4893 + if (item.goods_name.indexOf(this.data.gift_sear) == -1) {
  4894 + item.hide_div = 1;
  4895 + }
  4896 + }
  4897 + }
  4898 + this.setData({ giftsinfo: giftsinfo })
  4899 +
  4900 + },
  4901 +
  4902 + //-- 赠品的验证 --
  4903 + sub_check_gift(func) {
  4904 + var th = this;
  4905 + if (th.data.send_gf) {
  4906 + var error_arr = [];
  4907 + for (let io in th.data.send_gf) {
  4908 + let item_arr = th.data.send_gf[io];
  4909 + for (let ip in item_arr) {
  4910 + var gf_pr_name = item_arr[ip].gf_pr_name;
  4911 + var zp_num = item_arr[ip].zp_num;
  4912 + var giftsinfo = item_arr[ip].giftsinfo;
  4913 + var limit_all = 0;
  4914 + var stock_all = 0;
  4915 + for (let iu in giftsinfo) {
  4916 + let gf_item = giftsinfo[iu];
  4917 + limit_all += gf_item.limit_num;
  4918 + stock_all += gf_item.gift_storecount;
  4919 + }
  4920 + if (limit_all < zp_num) {
  4921 + error_arr.push(gf_pr_name + "限购不足");
  4922 + }
  4923 + if (stock_all < zp_num) {
  4924 + error_arr.push(gf_pr_name + "赠品库存不足");
  4925 + }
  4926 + }
  4927 + }
  4928 +
  4929 + //-- 有赠品错误的时候,是不是继续下单 --
  4930 + if (error_arr.length) {
  4931 + var err = error_arr.join(",");
  4932 + wx.showModal({
  4933 + title: '提示',
  4934 + content: err + ',无法赠送赠品,是否继续下单',
  4935 + success(res) {
  4936 + if (res.confirm) {
  4937 + func();
  4938 + } else if (res.cancel) {
  4939 + console.log('用户点击取消');
  4940 + th.setData({
  4941 + submit: 0,
  4942 + })
  4943 + }
  4944 + }
  4945 + })
  4946 + } else {
  4947 +
  4948 + var is_ok = 1;
  4949 + var error_arr = [];
  4950 + for (let io in th.data.send_gf) {
  4951 + let item_arr1 = th.data.send_gf[io];
  4952 + for (let ip1 in item_arr1) {
  4953 + var item_b = item_arr1[ip1];
  4954 + if (!item_b.selected) {
  4955 + is_ok = 0;
  4956 + break;
  4957 + }
  4958 + }
  4959 + if (!is_ok) break;
  4960 + }
  4961 +
  4962 + if (!is_ok) {
  4963 + getApp().confirmBox("请选择赠品");
  4964 + th.setData({
  4965 + submit: 0,
  4966 + })
  4967 + return false;
  4968 + }
  4969 + func();
  4970 + }
  4971 +
  4972 +
  4973 + } else {
  4974 + func();
  4975 + }
  4976 + }
4881 4977  
4882 4978  
4883 4979  
... ...
pages/cart/cart2/cart2.wxml
... ... @@ -8,24 +8,20 @@
8 8 <block wx:if="{{is_b_now==1}}">
9 9 <view class="tab-container">
10 10 <view class="tab-wrapper">
11   - <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype2' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}"
12   - data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  11 + <view hidden="{{bn_t_exp_t==2}}" bindtap='setexptype2' data-t='1' class="tab {{bn_exp_type == 1? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">门店自提</view>
13 12  
14   - <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype2' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}"
15   - data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  13 + <view hidden="{{bn_t_exp_t==1}}" bindtap='setexptype2' data-t='0' class="tab {{bn_exp_type== 0 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">快递邮寄</view>
16 14  
17 15 </view>
18 16 </view>
19 17 </block>
20   - <!-- 购物购买只有一单的时候 -->
  18 + <!-- 购物购买只有一单的时候 -->
21 19 <block wx:if="{{is_b_now==0 && cartlist.length==1}}">
22 20 <view class="tab-container">
23 21 <view class="tab-wrapper">
24   - <view hidden="{{cartlist[0].distr_t==2}}" bindtap='setexptype_w2' data-ind="0" data-t='1' class="tab {{cartlist[0].exp_type == 1? 'active':''}}"
25   - data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >门店自提</view>
  22 + <view hidden="{{cartlist[0].distr_t==2}}" bindtap='setexptype_w2' data-ind="0" data-t='1' class="tab {{cartlist[0].exp_type == 1? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">门店自提</view>
26 23  
27   - <view hidden="{{cartlist[0].distr_t==1}}" bindtap='setexptype_w2' data-ind="0" data-t='0' class="tab {{cartlist[0].exp_type== 0 ? 'active':''}}"
28   - data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}" >快递邮寄</view>
  24 + <view hidden="{{cartlist[0].distr_t==1}}" bindtap='setexptype_w2' data-ind="0" data-t='0' class="tab {{cartlist[0].exp_type== 0 ? 'active':''}}" data-txt='cartlist[0].exp_type' data-wl_txt='cartlist[0].wind' data-index="{{index}}">快递邮寄</view>
29 25  
30 26 </view>
31 27 </view>
... ... @@ -82,7 +78,7 @@
82 78 <image class="wh100 bdr14" src="{{items.original_img}}" binderror='cart_set_err' data-err='cartlist[{{pidx}}].goods[{{idx}}].original_img'></image>
83 79 </view>
84 80 <!----商品名称规格---->
85   - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}" >
  81 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{items.goods_id}}&prom_type={{items.prom_type}}&prom_id={{items.prom_id}}">
86 82 <view class="goods-name ellipsis-2">{{items.goods_name}}</view>
87 83 <!-- 商品属性 -->
88 84 <view class="flex-vertical fs28 color-gray n_guige">
... ... @@ -104,8 +100,9 @@
104 100 <view class="plus_buy fs28" wx:if="{{item.card_cut_price>0}}">
105 101 <view class="flex">
106 102 <view class="card_bg ellipsis-1" style="margin-right: 10rpx;">
107   - <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image>
108   - <text class="card_name">{{show_card.CardName}}</text>
  103 + <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png">
  104 + </ image>
  105 + <text class="card_name">{{show_card.CardName}}</text>
109 106 </view>
110 107 <view>立减 <text style="color:#f23030;">{{filters.toFix(item.card_cut_price,2) }}</text> 元</view>
111 108 </view>
... ... @@ -119,19 +116,7 @@
119 116 </view>
120 117  
121 118  
122   - <!-----使用优惠券------>
123   - <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" wx:if="{{(item.quan_list && item.quan_list.length>0) || get_by_quan_list_cart[item.pickup_id]!=null}}"
124   - data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}">
125   - <view class="work-frame flex-space-between">
126   - <view class="work">优惠券<text class="quan_num_show fs20">{{item.can_num}}张可用</text></view>
127   - <view class="xc-right-frame">
128   - <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text>
129   - <text wx:if="{{using_quan[item.pickup_id].money}}">¥{{using_quan[item.pickup_id].money}}元优惠券</text>
130   - <text wx:if="{{using_quan[item.pickup_id].isby}}">包邮券</text>
131   - <view class="xc-right"></view>
132   - </view>
133   - </view>
134   - </view>
  119 +
135 120  
136 121  
137 122 <view class="set-mes bdr_b-14">
... ... @@ -142,9 +127,8 @@
142 127  
143 128 <!-- 当是物流很多单的时候 -->
144 129 <view class="use-item flex-space-between" wx:if="{{cartlist.length>1}}">
145   - <view class="flex-vertical" >
146   - <view bindtap='setexptype_w2' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type'
147   - style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};">
  130 + <view class="flex-vertical">
  131 + <view bindtap='setexptype_w2' data-ind="{{pidx}}" data-t='1' data-txt='cartlist[{{pidx}}].exp_type' style="padding-right:26rpx;display:{{item.distr_t==2?'none':'flex;align-items: center'}};">
148 132 <!-- <icon bindtap='setexptype_w' data-t='1' data-txt='cartlist[{{pidx}}].exp_type' color="{{item.exp_type==1?'red':'gray'}}" size="16" type="success"></icon> -->
149 133  
150 134 <block wx:if="{{item.exp_type==1}}">
... ... @@ -166,14 +150,13 @@
166 150 <view class="circle xc-hookts on"></view>
167 151 </block>
168 152  
169   - <view bindtap='setexptype_w2' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind'
170   - class="yu_er">快递邮寄</view>
  153 + <view bindtap='setexptype_w2' data-t='0' data-ind="{{pidx}}" data-txt='cartlist[{{pidx}}].exp_type' data-wl_txt='cartlist[{{pidx}}].wind' class="yu_er">快递邮寄</view>
171 154 </view>
172 155 </view>
173 156  
174 157  
175 158 <!-- 点击显示物流选择,如果是默认使用的情况不成立 -->
176   - <view wx:if="{{!is_default_logistics && item.exp_type!=1}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
  159 + <view wx:if="{{!is_default_logistics && item.exp_type!=1}}" class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
177 160 <view>{{wu_arr[item.wind].name}}</view>
178 161 <view class="xc-right"></view>
179 162 </view>
... ... @@ -181,69 +164,92 @@
181 164 </view>
182 165  
183 166 <!-- 当是物流,只有一单的时候 -->
184   - <block wx:else >
185   - <view class="use-item flex-space-between" wx:if="{{item.exp_type==0 && !is_default_logistics}}">
186   - <view class="flex jc_sb" style="width: 100%; padding: 0 13rpx;">
187   - <view>选择物流</view>
188   - <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
189   - <view>{{wu_arr[item.wind].name}}</view>
190   - <view class="xc-right"></view>
  167 + <block wx:else>
  168 + <view class="use-item flex-space-between" wx:if="{{item.exp_type==0 && !is_default_logistics}}">
  169 + <view class="flex jc_sb" style="width: 100%; padding: 0 13rpx;">
  170 + <view>选择物流</view>
  171 + <view class="flex-vertical" bindtap="show_wu_arr" data-txt='cartlist[{{pidx}}].wind' data-w_sele_index="{{pidx}}" style="padding-right:6rpx;">
  172 + <view>{{wu_arr[item.wind].name}}</view>
  173 + <view class="xc-right"></view>
  174 + </view>
191 175 </view>
192 176 </view>
193   - </view>
194 177 </block>
195 178 </view>
196 179  
  180 + <!-- 有送礼包 -->
  181 + <view wx:if="{{send_lb[item.pickup_id]}}">
  182 + <block wx:for="{{send_lb[item.pickup_id]}}" wx:key="id" wx:for-item="send">
  183 + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.id}}" data-flag="{{send.flag}}" bindtap="viewLbDetails">
  184 + <view class="flex ai_c">
  185 + <view class="circle1">赠</view>{{send.title}}
  186 + <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} -->
  187 + </view>
  188 + <view class="flex ai_c">
  189 + x{{send.num}}<text class="bg_jj"></text>
  190 + </view>
  191 + </view>
  192 + </block>
  193 + </view>
197 194  
198 195 <!-- 赠品的显示 -->
199 196 <view wx:if="{{send_gf[item.pickup_id]}}">
200 197 <block wx:for="{{send_gf[item.pickup_id]}}" wx:for-item="iter">
201   - <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx"
202   - data-pk="{{item.pickup_id}}" data-index="{{index}}"
203   - bindtap="show_sele_gift" >
204   - <view class="flex ai_c">
205   - <view class="circle1">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个
206   - </view>
  198 + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-pk="{{item.pickup_id}}" data-index="{{index}}" bindtap="show_sele_gift">
  199 + <view class="flex ai_c">
  200 + <view class="circle1">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个
  201 + </view>
207 202  
208   - <view class="flex ai_c" wx:if="{{iter.selected}}">
209   - 已选择<text class="bg_jj"></text>
210   - </view>
  203 + <view class="flex ai_c" wx:if="{{iter.selected}}">
  204 + 已选择<text class="bg_jj"></text>
  205 + </view>
211 206  
212   - <view class="flex ai_c" wx:else="{{}}">
  207 + <view class="flex ai_c" wx:else="{{}}">
213 208 未选择<text class="bg_jj"></text>
214   - </view>
  209 + </view>
215 210  
216   - </view>
  211 + </view>
217 212 </block>
218 213 </view>
219 214  
  215 + <!-----使用优惠券------>
  216 + <view class="xc-coupon-frame flex-center" data-bn="0" bindtap="open_coupon_list" wx:if="{{(item.quan_list && item.quan_list.length>0) || get_by_quan_list_cart[item.pickup_id]!=null}}" data-cind="{{pidx}}" data-pickid="{{item.pickup_id}}">
  217 + <view class="work-frame flex-space-between">
  218 + <view class="work">优惠券<text class="quan_num_show fs20">{{item.can_num}}张可用</text></view>
  219 + <view class="xc-right-frame">
  220 + <text wx:if="{{using_quan[item.pickup_id].is_nouse}}">不使用</text>
  221 + <text wx:if="{{using_quan[item.pickup_id].money}}">¥{{using_quan[item.pickup_id].money}}元优惠券</text>
  222 + <text wx:if="{{using_quan[item.pickup_id].isby}}">包邮券</text>
  223 + <view class="xc-right"></view>
  224 + </view>
  225 + </view>
  226 + </view>
  227 +
220 228  
221 229 <!-- 留言 -->
222 230 <view class="coupon-mes flex-vertical">
223 231 <view>留言</view>
224 232 <view class="leave-word">
225   - <input placeholder="给商家留言,最多100字" bindinput="keyUpChangeNum"
226   - data-index="{{pidx}}" value="{{user_note[pidx]}}"
227   - class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}" />
  233 + <input placeholder="给商家留言,最多100字" bindinput="keyUpChangeNum" data-index="{{pidx}}" value="{{user_note[pidx]}}" class="word-box" maxlength="100" name="user_note_{{item.pickup_id}}" />
228 234  
229 235 </view>
230 236 </view>
231 237  
232   - <!-- 是否参与店铺优惠 -->
233   - <view class="coupon-mes flex-vertical" data-index="{{index}}" bindtap="cart_pop_offline" wx:if="{{item.offline_price}}">
234   - <view>店铺优惠</view>
235   - <view class="leave-word fs32" style="color: #999;">
236   - 省{{filters.toFix(item.offline_price,2)}}元
237   - </view>
238   - <block wx:if="{{item.is_offline}}">
239   - <text style="color: #d7642b;">-¥{{filters.toFix(item.offline_price,2)}}</text>
240   - </block>
241   - <block wx:else>
242   - <text style="color: #d7642b;">不使用优惠</text>
243   - </block>
244   - <!-- 右边点击 -->
245   - <view class="xc-right" style="margin-right: 12rpx; border-color: #d7642b;"></view>
246   - </view>
  238 + <!-- 是否参与店铺优惠 -->
  239 + <view class="coupon-mes flex-vertical" data-index="{{index}}" bindtap="cart_pop_offline" wx:if="{{item.offline_price}}">
  240 + <view>店铺优惠</view>
  241 + <view class="leave-word fs32" style="color: #999;">
  242 + 省{{filters.toFix(item.offline_price,2)}}元
  243 + </view>
  244 + <block wx:if="{{item.is_offline}}">
  245 + <text style="color: #d7642b;">-¥{{filters.toFix(item.offline_price,2)}}</text>
  246 + </block>
  247 + <block wx:else>
  248 + <text style="color: #d7642b;">不使用优惠</text>
  249 + </block>
  250 + <!-- 右边点击 -->
  251 + <view class="xc-right" style="margin-right: 12rpx; border-color: #d7642b;"></view>
  252 + </view>
247 253  
248 254 </view>
249 255  
... ... @@ -286,27 +292,27 @@
286 292 </view>
287 293 <!-- 赠品的显示 -->
288 294 <block wx:if="{{buy_now_gift_goods}}">
289   - <view class="order-detail" wx:for="{{buy_now_gift_goods}}" >
290   - <view class="goods-img" style="position: relative">
291   - <image src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image>
  295 + <view class="order-detail" wx:for="{{buy_now_gift_goods}}">
  296 + <view class="goods-img" style="position: relative">
  297 + <image src="{{imgUrl}}/miniapp/images/giveaway.png" class="gift_image"></image>
292 298  
293   - <image class="wh100 bdr14" src="{{item.original_img}}" binderror='cart_set_err' data-err="item.original_img"></image>
294   - </view>
295   - <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
296   - <view class="goods-name ellipsis-2">{{item.goods_name}}</view>
297   - <!-- 商品属性 -->
298   - <view class="flex-vertical fs28 xc-ash color-gray n_guige">
299   - <view class="goods-color">
300   - <block><text>{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</text></block>
301   - </view>
302   - </view>
303   - <!-- ---商品名称规格---- -->
304   - <view class="order-num flex-space-between">
305   - <view class="co-red">¥<text class="fs36">0</text></view>
306   - <view class="goods-num">x{{item.buynum}}</view>
  299 + <image class="wh100 bdr14" src="{{item.original_img}}" binderror='cart_set_err' data-err="item.original_img"></image>
307 300 </view>
308   - </navigator>
309   - </view>
  301 + <navigator class="order-cont" url="/pages/goods/goodsInfo/goodsInfo?goods_id={{item.goods_id}}">
  302 + <view class="goods-name ellipsis-2">{{item.goods_name}}</view>
  303 + <!-- 商品属性 -->
  304 + <view class="flex-vertical fs28 xc-ash color-gray n_guige">
  305 + <view class="goods-color">
  306 + <block><text>{{filters.show_gui_ge(item.goods_spec,item.goods_color)}}</text></block>
  307 + </view>
  308 + </view>
  309 + <!-- ---商品名称规格---- -->
  310 + <view class="order-num flex-space-between">
  311 + <view class="co-red">¥<text class="fs36">0</text></view>
  312 + <view class="goods-num">x{{item.buynum}}</view>
  313 + </view>
  314 + </navigator>
  315 + </view>
310 316 </block>
311 317  
312 318  
... ... @@ -333,12 +339,13 @@
333 339 </view>
334 340 </block>
335 341  
336   - <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 -->
  342 + <!-- 如果是等级卡的商品,会员没有注册,要提醒注册 -->
337 343 <view class="plus_buy fs28" wx:if="{{card_cut_price>0}}">
338 344 <view class="flex">
339 345 <view class="card_bg ellipsis-1" style="margin-right: 10rpx;">
340   - <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png"></ image>
341   - <text class="card_name">{{show_card.CardName}}</text>
  346 + <image src="{{imgUrl}}/miniapp/images/plus/dj_icon.png">
  347 + </ image>
  348 + <text class="card_name">{{show_card.CardName}}</text>
342 349 </view>
343 350 <view>立减 <text style="color:#f23030;">{{filters.toFix(card_cut_price,2) }}</text> 元</view>
344 351 </view>
... ... @@ -351,6 +358,45 @@
351 358 <view bindtap="buycard" class="card_op">立即开通</view>
352 359 </view>
353 360  
  361 + <!-- 有送礼包 -->
  362 + <view wx:if="{{send_lb[bn_pick]}}">
  363 + <block wx:for="{{send_lb[bn_pick]}}" wx:key="id" wx:for-item="send">
  364 + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-id="{{send.id}}" data-flag="{{send.flag}}" bindtap="viewLbDetails">
  365 + <view class="flex ai_c">
  366 + <view class="circle1">赠</view>{{send.title}}
  367 + <!-- <view class="circle1" wx:if="{{item.zxlb_id>0}}">赠</view>{{item.zxlbtitle}} -->
  368 + </view>
  369 + <view class="flex ai_c">
  370 + x{{send.num}}<text class="bg_jj"></text>
  371 + </view>
  372 + </view>
  373 + </block>
  374 + </view>
  375 +
  376 +
  377 + <!-- 赠品的显示 -->
  378 + <view wx:if="{{send_gf[bn_pick]}}">
  379 + <block wx:for="{{send_gf[bn_pick]}}" wx:for-item="iter">
  380 + <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx" data-pk="{{bn_pick}}" data-index="{{index}}" bindtap="show_sele_gift">
  381 + <view class="flex ai_c">
  382 + <view class="circle1">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个
  383 + </view>
  384 +
  385 + <view class="flex ai_c" wx:if="{{iter.selected}}">
  386 + 已选择<text class="bg_jj"></text>
  387 + </view>
  388 +
  389 + <view class="flex ai_c" wx:else="{{}}">
  390 + 未选择<text class="bg_jj"></text>
  391 + </view>
  392 +
  393 + </view>
  394 + </block>
  395 + </view>
  396 +
  397 +
  398 +
  399 +
354 400 <view class="set-mes bdr_b-14">
355 401  
356 402 <view wx:if="{{order.store_prom}}">
... ... @@ -377,41 +423,20 @@
377 423 <view class="flex-space-between" style="padding: 20rpx 25rpx; font-size: 30rpx;">
378 424 <view>选择物流</view>
379 425 <view class="flex-vertical" bindtap="show_wu_arr" data-txt='index' style="margin-right: 12rpx;">
380   - <view class="logistics-name">{{wu_arr[index].name}}</view>
381   - <view class="xc-right"></view>
  426 + <view class="logistics-name">{{wu_arr[index].name}}</view>
  427 + <view class="xc-right"></view>
382 428 </view>
383 429 </view>
384 430 </view>
385 431 </view>
386 432  
387   - <!-- 赠品的显示 -->
388   - <view wx:if="{{send_gf[bn_pick]}}">
389   - <block wx:for="{{send_gf[bn_pick]}}" wx:for-item="iter">
390   - <view class="coupon-mes flex jc_sb" style="margin: 10rpx 0; padding-right: 35rpx"
391   - data-pk="{{bn_pick}}" data-index="{{index}}"
392   - bindtap="show_sele_gift" >
393   - <view class="flex ai_c">
394   - <view class="circle1">赠</view>{{iter.name}} 可选赠品{{iter.zp_num}}个
395   - </view>
396   -
397   - <view class="flex ai_c" wx:if="{{iter.selected}}">
398   - 已选择<text class="bg_jj"></text>
399   - </view>
400   -
401   - <view class="flex ai_c" wx:else="{{}}">
402   - 未选择<text class="bg_jj"></text>
403   - </view>
404 433  
405   - </view>
406   - </block>
407   - </view>
408 434  
409 435 <!-- 留言 -->
410 436 <view class="coupon-mes flex-vertical">
411 437 <view>留言</view>
412 438 <view class="leave-word">
413   - <input placeholder-class="fs28" placeholder='给商家留言,最多100字' data-index="{{index}}" bindinput="keyUpChangeNum"
414   - class="word-box" maxlength="100" name="user_note"></input>
  439 + <input placeholder-class="fs28" placeholder='给商家留言,最多100字' data-index="{{index}}" bindinput="keyUpChangeNum" class="word-box" maxlength="100" name="user_note"></input>
415 440 </view>
416 441 </view>
417 442  
... ... @@ -422,10 +447,10 @@
422 447 省{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}元
423 448 </view>
424 449 <block wx:if="{{bn_goods.is_offline}}">
425   - <text style="color: #d7642b;">-¥{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}</text>
  450 + <text style="color: #d7642b;">-¥{{filters.toFix(bn_goods.shop_price-bn_goods.offline_price,2)}}</text>
426 451 </block>
427 452 <block wx:else>
428   - <text style="color: #d7642b;">不使用优惠</text>
  453 + <text style="color: #d7642b;">不使用优惠</text>
429 454 </block>
430 455 <!-- 右边点击 -->
431 456 <view class="xc-right" style="margin-right: 12rpx; border-color: #d7642b;"></view>
... ... @@ -487,7 +512,7 @@
487 512 <view class="payable">应付金额:<text class="co-red"><text class="fs24">¥</text>{{formData.order_amount}}</text></view>
488 513 <!-- <view class="co-red big"></view> -->
489 514 </view>
490   - <button class="tips-btn" formType="submit" id="submitOrder" disabled="{{submit}}" bindtap="requestSubscribe">提交订单</button>
  515 + <button class="tips-btn" formType="submit" id="submitOrder" disabled="{{submit}}" bindtap="requestSubscribe">提交订单</button>
491 516 </view>
492 517 </form>
493 518  
... ... @@ -519,8 +544,7 @@
519 544 <!-- 中间券内容显示 -->
520 545 <view class="xc-frame flex-level">
521 546 <view class="list-frame">
522   - <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}"
523   - wx:for-item="item" wx:for-index="q_index">
  547 + <view wx:for="{{selected_quan_list}}" bindtap="sele_quan_item" wx:if="{{!item.is_using}}" data-ind="{{q_index}}" wx:for-item="item" wx:for-index="q_index">
524 548 <view class="xc-coupon-frame flex-center" data-ind="{{q_index}}">
525 549 <view class="coupon-frame flex rel">
526 550 <!-- 锯齿 -->
... ... @@ -561,8 +585,7 @@
561 585 </view>
562 586 <!-- 包邮券的显示,立即购买 -->
563 587 <block wx:if="{{ is_b_now && bn_exp_type==0}}">
564   - <view wx:for="{{get_by_quan_list}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}"
565   - wx:for-item="item" wx:for-index="byq_index">
  588 + <view wx:for="{{get_by_quan_list}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}" wx:for-item="item" wx:for-index="byq_index">
566 589 <view class="xc-coupon-frame flex-center" data-ind="{{byq_index}}">
567 590 <view class="coupon-frame flex rel">
568 591 <!-- 锯齿 -->
... ... @@ -605,8 +628,7 @@
605 628  
606 629 <!-- 包邮券的显示,购物车购买 -->
607 630 <block wx:if="{{!is_b_now && sele_exp_type==0}}">
608   - <view wx:for="{{by_quan_list_cart}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}"
609   - wx:for-item="item" wx:for-index="byq_index">
  631 + <view wx:for="{{by_quan_list_cart}}" bindtap="sele_quan_item_by" wx:if="{{!item.is_using}}" data-ind="{{byq_index}}" wx:for-item="item" wx:for-index="byq_index">
610 632 <view class="xc-coupon-frame flex-center" data-ind="{{byq_index}}">
611 633 <view class="coupon-frame flex rel">
612 634 <!-- 锯齿 -->
... ... @@ -672,8 +694,7 @@
672 694 </view>
673 695 <view class="express_list">
674 696 <view wx:for="{{wu_arr}}" wx:for-item="express_list" wx:for-index="idx">
675   - <view class="express_list_frame" bindtap="click_express_name" data-shippingcode="{{express_list.shipping_code}}"
676   - data-name="{{express_list.name}}" data-idxe="{{idx}}">
  697 + <view class="express_list_frame" bindtap="click_express_name" data-shippingcode="{{express_list.shipping_code}}" data-name="{{express_list.name}}" data-idxe="{{idx}}">
677 698  
678 699 <block wx:if="{{is_express==idx}}">
679 700 <view class="circle white xc-hook fs20 red-b"><text>Γ</text></view>
... ... @@ -703,77 +724,77 @@
703 724 <view style="background-color: #fff; width: 540rpx; margin: 0 auto; border-radius: 20rpx;">
704 725 <view class="fs32" style="text-align: center;height: 80rpx; line-height: 80rpx;">店铺优惠</view>
705 726 <view class="flex jc_sb ai-center fs28" style="height: 80rpx; width: 400rpx; margin-left: 70rpx;">
706   - <view catchtap="sure_offline" class="flex ai-center" >优惠¥{{show_off_price}}
707   - <icon style="margin-left: 10rpx;" color="{{is_get_offline?'red':'gray'}}" size="14" type="success" role="img"></icon></view>
708   - <view catchtap="cancle_offline" class="flex ai-center" >不用优惠
709   - <icon style="margin-left: 10rpx;" color="{{is_get_offline!=1?'red':'gray'}}" size="14" type="success" role="img"></icon> </view>
  727 + <view catchtap="sure_offline" class="flex ai-center">优惠¥{{show_off_price}}
  728 + <icon style="margin-left: 10rpx;" color="{{is_get_offline?'red':'gray'}}" size="14" type="success" role="img"></icon>
  729 + </view>
  730 + <view catchtap="cancle_offline" class="flex ai-center">不用优惠
  731 + <icon style="margin-left: 10rpx;" color="{{is_get_offline!=1?'red':'gray'}}" size="14" type="success" role="img"></icon>
  732 + </view>
710 733 </view>
711 734 </view>
712 735 </view>
713 736  
714 737 <!-- 多赠品 -->
715 738 <view class="duo_gift_sele" wx:if="{{show_duo_gift}}">
716   - <!-- top search -->
  739 + <!-- top search -->
717 740 <view class="flex gift_top_v ai_c">
718   - <text bindtap="close_sele_gift" class="bg_jj1"></text>
  741 + <text bindtap="close_sele_gift" class="bg_jj1"></text>
719 742 <view class="pdh20 pdv10 flex ai_c jc_sb">
720 743 <view class="input-box" style="width: 580rpx;display: flex; padding-left: 20rpx">
721 744 <view class="sear_box" bindtap="submitSearch"></view>
722   - <input autoFocus class="input-search" name="word" placeholder="搜索关键字" bindconfirm="submitSearch" bindinput="getInput" bindfocus="inputFocus" value="{{keyword}}"/>
  745 + <input autoFocus class="input-search" name="word" placeholder="搜索关键字" bindconfirm="submitSearch" bindinput="getInput" bindfocus="inputFocus" value="{{keyword}}" />
723 746 </view>
724 747 </view>
725 748  
726   - </view>
  749 + </view>
727 750 <!-- top act_name -->
728 751 <view class="flex gift_top_v ai_c fs30" style="padding-left: 70rpx">
729 752 {{gf_pr_name}},可任选{{zp_num}}件商品为赠品
730 753 </view>
731 754 <!-- 赠品选择 -->
732 755 <scroll-view scroll-y="{{true}}" style="height:calc(100% - 300rpx);">
733   - <view class="order-item" hidden="{{items.hide_div}}" data-item="{{idx}}" wx:for="{{giftsinfo}}" wx:for-item="items" wx:for-index="idx">
  756 + <view class="order-item" hidden="{{items.hide_div}}" data-item="{{idx}}" wx:for="{{giftsinfo}}" wx:for-item="items" wx:for-index="idx">
734 757  
735   - <view bindtap="check_th_item" class="order-raido flex-vertical " data-check="{{items.selected?items.selected:0}}" data-item="{{idx}}">
736   - <icon wx:if="{{items.selected}}" color="red" size="20" type="success"></icon>
737   - <text wx:else class="icon_no_sele"></text>
738   - </view>
  758 + <view bindtap="check_th_item" class="order-raido flex-vertical " data-check="{{items.selected?items.selected:0}}" data-item="{{idx}}">
  759 + <icon wx:if="{{items.selected}}" color="red" size="20" type="success"></icon>
  760 + <text wx:else class="icon_no_sele"></text>
  761 + </view>
  762 +
  763 + <navigator class="goods-img rel" bindtap="go_gd" data-gd="{{items.goods_id}}">
  764 + <image class="wh100" src="{{imgUrl+items.goodsinfo.original_img}}" binderror="bind_bnerr2" data-errorimg="gift_goods[{{idx}}].goodsinfo.original_img"></image>
  765 + </navigator>
  766 + <view class="goods-cont">
  767 + <view class="goods-name">
  768 + <navigator bindtap="go_gd" class="ellipsis-2 fs30" data-gd="{{items.goods_id}}">{{items.goods_name}}</navigator>
739 769  
740   - <navigator class="goods-img rel" bindtap="go_gd" data-gd="{{items.goods_id}}">
741   - <image class="wh100" src="{{imgUrl+items.goodsinfo.original_img}}" binderror="bind_bnerr2" data-errorimg="gift_goods[{{idx}}].goodsinfo.original_img"></image>
742   - </navigator>
743   - <view class="goods-cont">
744   - <view class="goods-name">
745   - <navigator bindtap="go_gd" class="ellipsis-2 fs30" data-gd="{{items.goods_id}}">{{items.goods_name}}</navigator>
746   -
747   - <view class="specifications ellipsis-1">
748   - <view wx:if="{{items.goodsinfo.goods_color || items.goodsinfo.goods_spec}}">
749   - {{items.goodsinfo.goods_color}}{{items.goodsinfo.goods_color?"/":''}}{{items.goodsinfo.goods_spec}}</view>
750   - <view wx:else>规格1</view>
  770 + <view class="specifications ellipsis-1">
  771 + <view wx:if="{{items.goodsinfo.goods_color || items.goodsinfo.goods_spec}}">
  772 + {{items.goodsinfo.goods_color}}{{items.goodsinfo.goods_color?"/":''}}{{items.goodsinfo.goods_spec}}</view>
  773 + <view wx:else>规格1</view>
  774 + </view>
751 775 </view>
752   - </view>
753 776  
754   - <view class="flex alend jc_sb">
  777 + <view class="flex alend jc_sb">
755 778 <view class="goods-price co-red baseline ellipsis-1">
756 779 <view class="fs20">¥</view>
757 780 <view class="fs28">{{items.goodsinfo.shop_price}}</view>
758 781 </view>
759 782 <view class="count">
760 783 <view bindtap="{{items.goods_num <= 1 ? '':'subNum'}}" class="sub fs28 {{items.goods_num <= 1 ? 'active':''}}" data-pitems="{{pidx}}" data-item="{{idx}}">一</view>
761   - <input class="goodadd" bindblur="valueToNum" data-item="{{idx}}"
762   - bindinput="refresh_input" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input>
763   - <view class="add" bindtap="addNum" data-item="{{idx}}">+</view>
  784 + <input class="goodadd" bindblur="valueToNum" data-item="{{idx}}" bindinput="refresh_input" data-item="{{idx}}" type="number" value="{{items.goods_num}}"></input>
  785 + <view class="add" bindtap="addNum" data-item="{{idx}}">+</view>
764 786 </view>
765 787 </view>
766 788  
  789 + </view>
767 790 </view>
768   - </view>
769 791 </scroll-view>
770   - <!-- 确认选择 -->
  792 + <!-- 确认选择 -->
771 793 <view class="pay-for flex-vertical-between" style="bottom: 0">
772 794 <view></view>
773 795 <view>
774   - <button bindtap="sure_this_gift" class="pay-btn">确定</button>
  796 + <button bindtap="sure_this_gift" class="pay-btn">确定</button>
775 797 </view>
776 798 </view>
777 799  
778   -</view>
779   -
  800 +</view>
780 801 \ No newline at end of file
... ...
pages/giftpack/buygiftpack/giftpackbuy.js
... ... @@ -70,6 +70,7 @@ Page({
70 70 onLoad: function (options) {
71 71 this.setData({
72 72 params: options,
  73 + now:Date.parse(new Date()) / 1000,
73 74 })
74 75  
75 76 },
... ...
pages/giftpack/buygiftpack/giftpackbuy.wxml
1   -<view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};">
  1 +<view class="top_img" style="background-color: {{ad_data?ad_data.bgcolor:'rgb(250, 120, 88)'}};">
2 2 <block wx:if="{{ad_data}}">
3 3 <view class="top_img">
4   - <image src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image>
  4 + <image src="{{ad_data.ad_code}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image>
5 5 </view>
6 6 </block>
7 7 <block wx:else>
8   - <view class="top_img">
9   - <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image>
10   - </view>
11   - </block>
12   -
13   -
14   - <view class="top_title">
15   - <view class="top_title_box">
16   - <text class="top_title_redtext">礼包列表</text>
17   - </view>
18   - <view class="top_title_box_S"></view>
19   - <view class="top_title_box">
20   - <a class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a>
21   - </view>
22   - </view>
23   - <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index">
24   - <view class="content_box">
25   - <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn=''">
26   - <view class="content_box_img">
27   - <image src="{{iurl+items.cover_img}}" lazy-load="true" binderror="bind_bnerr2" wx:if="{{items.cover_img}}"
28   - data-errorimg="wareCard[{{index}}].cover_img"></image>
29   - <image src="{{iurl+items.lbUrl}}" lazy-load="true" binderror="bind_bnerr2" wx:else
30   - data-errorimg="wareCard[{{index}}].lbUrl"></image>
31   - </view>
32   - <view class="content_box_title">
33   - <view class="content_ware_title">
34   - <text>{{items.giftTitle}}</text>
35   - </view>
36   - <view class="content_ware_type flex">
37   - <block wx:if="{{items.payMoney>0}}">
38   - <text>{{"¥"+items.payMoney}}</text>
39   - </block>
40   - <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}">
41   - <text>/</text>
42   - </block>
43   - <block wx:if="{{items.payIntegral>0}}">
44   - <view class="flex">
45   - <text class="ellipsis-1">{{items.payIntegral}}</text>
46   - <view>积分</view>
47   - </view>
48   - </block>
49   - </view>
50   - <view class="content_ware_price">
51   - <text class="ellipsis-1">{{"零售价:¥"+items.giftPosPrice}}</text>
52   - </view>
53   - <view class="content_ware_time">
54   - <text class="ellipsis-1">{{"活动结束时间:"+items.endTime}}</text>
55   - </view>
56   - </view>
57   - </view>
58   - <view class="content_box_button">
59   - <view class="box_button_remark">
60   - <text>{{"已售:"+items.giftQty+"件"}}</text>
61   - </view>
62   - <view class="flex-vertical">
63   - <block wx:if="{{items.payMoney>0 && items.payIntegral>0}}">
64   - <block wx:if="{{items.payMoney>0}}">
65   - <view class="flex" bindtap="GetBuyPrice" data-index="{{index}}">
66   - <button class="box_button_dui">立即购买</button>
67   - </view>
68   - </block>
69   - <block wx:if="{{items.payIntegral>0}}">
70   - <view class="flex" bindtap="GetBuyIntegral" data-index="{{index}}">
71   - <button class="box_button_dui box_button_buy">立即兑换</button>
72   - </view>
73   - </block>
74   - </block>
75   - <block wx:else>
76   - <block wx:if="{{items.payMoney>0}}">
77   - <view class="flex" bindtap="GetBuyPrice" data-index="{{index}}">
78   - <button class="box_button_dui box_button_buy">立即购买</button>
79   - </view>
80   - </block>
81   - <block wx:if="{{items.payIntegral>0}}">
82   - <view class="flex" bindtap="GetBuyIntegral" data-index="{{index}}">
83   - <button class="box_button_dui box_button_buy">立即兑换</button>
84   - </view>
85   - </block>
86   - </block>
87   - <block wx:if="{{!items.payMoney && !items.payIntegral}}">
88   - <view class="flex" bindtap="GetFree" data-index="{{index}}">
89   - <button class="box_button_dui box_button_buy">免费领取</button>
90   - </view>
91   - </block>
  8 + <view class="top_img">
  9 + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg?v=2019'}}" lazy-load="true" binderror="bind_bnerr2" data-errorimg="wareCard[{{index}}].lbUrl"></image>
  10 + </view>
  11 + </block>
92 12  
93   - </view>
94   - </view>
95   - </view>
96   - </block>
97   - <block wx:if="{{is_read && wareCard.length<1 && is_get}}">
98   - <view class="foot_empty">
99   - <view>
100   - <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image>
101   - </view>
102   - <view>
103   - <text>当前暂无礼包</text>
104   - </view>
105   - <view class="foot_empty_button">
106   - <text bindtap="goto" data-url="/pages/index/index/index">回到首页</text>
107   - </view>
108   - </view>
109   - </block>
110   - <!-- 加载完毕并且数据大于=页大小 -->
111   - <view class="After_all flex-center" wx:if="{{ismore && wareCard.length>=3}}">
112   - <view class="Line"></view>
113   - <view class="end fs26">到底了</view>
114   - <view class="Line"></view>
115   - </view>
  13 +
  14 + <view class="top_title">
  15 + <view class="top_title_box">
  16 + <text class="top_title_redtext">礼包列表</text>
  17 + </view>
  18 + <view class="top_title_box_S"></view>
  19 + <view class="top_title_box">
  20 + <a class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a>
  21 + </view>
  22 + </view>
  23 + <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index">
  24 + <view class="content_box">
  25 + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn=''">
  26 + <view class="content_box_img">
  27 + <image src="{{iurl+items.cover_img}}" lazy-load="true" binderror="bind_bnerr2" wx:if="{{items.cover_img}}" data-errorimg="wareCard[{{index}}].cover_img"></image>
  28 + <image src="{{iurl+items.lbUrl}}" lazy-load="true" binderror="bind_bnerr2" wx:else data-errorimg="wareCard[{{index}}].lbUrl"></image>
  29 + </view>
  30 + <view class="content_box_title">
  31 + <view class="content_ware_title">
  32 + <text>{{items.giftTitle}}</text>
  33 + </view>
  34 + <view class="content_ware_type flex">
  35 + <block wx:if="{{items.payMoney>0}}">
  36 + <text>{{"¥"+items.payMoney}}</text>
  37 + </block>
  38 + <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}">
  39 + <text>/</text>
  40 + </block>
  41 + <block wx:if="{{items.payIntegral>0}}">
  42 + <view class="flex">
  43 + <text class="ellipsis-1">{{items.payIntegral}}</text>
  44 + <view>积分</view>
  45 + </view>
  46 + </block>
  47 + </view>
  48 + <view class="content_ware_price">
  49 + <text class="ellipsis-1">{{"零售价:¥"+items.giftPosPrice}}</text>
  50 + </view>
  51 + <view class="content_ware_time">
  52 + <text class="ellipsis-1">{{"活动结束时间:"+items.endTime}}</text>
  53 + </view>
  54 + </view>
  55 + </view>
  56 + <view class="content_box_button">
  57 + <view class="box_button_remark">
  58 + <text>{{"已售:"+items.giftQty+"件"}}</text>
  59 + </view>
  60 + <block wx:if="{{now > item.starTime}}">
  61 + <view class="flex-vertical">
  62 + <block wx:if="{{items.payMoney>0 && items.payIntegral>0}}">
  63 + <block wx:if="{{items.payMoney>0}}">
  64 + <view class="flex" bindtap="GetBuyPrice" data-index="{{index}}">
  65 + <button class="box_button_dui">立即购买</button>
  66 + </view>
  67 + </block>
  68 + <block wx:if="{{items.payIntegral>0}}">
  69 + <view class="flex" bindtap="GetBuyIntegral" data-index="{{index}}">
  70 + <button class="box_button_dui box_button_buy">立即兑换</button>
  71 + </view>
  72 + </block>
  73 + </block>
  74 + <block wx:else>
  75 + <block wx:if="{{items.payMoney>0}}">
  76 + <view class="flex" bindtap="GetBuyPrice" data-index="{{index}}">
  77 + <button class="box_button_dui box_button_buy">立即购买</button>
  78 + </view>
  79 + </block>
  80 + <block wx:if="{{items.payIntegral>0}}">
  81 + <view class="flex" bindtap="GetBuyIntegral" data-index="{{index}}">
  82 + <button class="box_button_dui box_button_buy">立即兑换</button>
  83 + </view>
  84 + </block>
  85 + </block>
  86 + <block wx:if="{{!items.payMoney && !items.payIntegral}}">
  87 + <view class="flex" bindtap="GetFree" data-index="{{index}}">
  88 + <button class="box_button_dui box_button_buy">免费领取</button>
  89 + </view>
  90 + </block>
  91 + </view>
  92 + </block>
  93 + <block wx:else>
  94 + <view class="flex-vertical">
  95 + <view >活动还未开始</view>
  96 + </view>
  97 + </block>
  98 + </view>
  99 + </view>
  100 + </block>
  101 + <block wx:if="{{is_read && wareCard.length<1 && is_get}}">
  102 + <view class="foot_empty">
  103 + <view>
  104 + <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image>
  105 + </view>
  106 + <view>
  107 + <text>当前暂无礼包</text>
  108 + </view>
  109 + <view class="foot_empty_button">
  110 + <text bindtap="goto" data-url="/pages/index/index/index">回到首页</text>
  111 + </view>
  112 + </view>
  113 + </block>
  114 + <!-- 加载完毕并且数据大于=页大小 -->
  115 + <view class="After_all flex-center" wx:if="{{ismore && wareCard.length>=3}}">
  116 + <view class="Line"></view>
  117 + <view class="end fs26">到底了</view>
  118 + <view class="Line"></view>
  119 + </view>
116 120 </view>
117 121 <!-- 引入提示组件 -->
118 122 <warn id="warn"></warn>
... ...
pages/goods/search/search.js
1   -var t = function(t) {
  1 +var t = function (t) {
2 2 return t && t.__esModule ? t : {
3 3 default: t
4 4 };
5 5 }(require("../../../utils/LoadMore.js")), ut = require("../../../utils/util.js"),
6   - a = getApp(), e = new t.default(), rq = a.request, oo = a.globalData.setting;
  6 + a = getApp(), e = new t.default(), rq = a.request, oo = a.globalData.setting;
7 7  
8 8 Page({
9 9 data: {
... ... @@ -18,31 +18,32 @@ Page({
18 18 requestUrl: "",
19 19 //hotWords: [ [ "手机", "小米", "iphone" ], [ "三星", "华为", "冰箱" ] ]
20 20 hotWords: null,
21   - is_no_plus:1,
  21 + is_no_plus: 1,
22 22 tabname: "sort", //排序的字段
23 23 adname: "asc", //升降的字段
24   - rq_data:null,
25   - searchRecord: [],
26   - keyword: '',
27   - is_his:0,
28   - hiddenClear: true,
  24 + rq_data: null,
  25 + searchRecord: [],
  26 + keyword: '',
  27 + is_his: 0,
  28 + hiddenClear: true,
  29 + fliter_flag: false,
29 30 },
30   -
31   - onLoad: function(t) {
32   - this.data.rq_data=t;
33   - if(t.o) {
34   - this.data.rq_data.o = JSON.parse(t.o);
35   - };
36   -
37   -
  31 +
  32 + onLoad: function (t) {
  33 + this.data.rq_data = t;
  34 + if (t.o) {
  35 + this.data.rq_data.o = JSON.parse(t.o);
  36 + };
  37 +
  38 +
38 39 //接受有没有导购的参数
39   - var first_leader=t.first_leader;
40   - if(first_leader){
41   - getApp().globalData.first_leader=first_leader;
  40 + var first_leader = t.first_leader;
  41 + if (first_leader) {
  42 + getApp().globalData.first_leader = first_leader;
42 43 //调用接口判断是不是会员
43   - getApp().request.promiseGet("/api/weshop/shoppingGuide/get/"+oo.stoid+"/"+first_leader,{}).then(res=>{
44   - if(res.data.code==0){
45   - getApp().globalData.guide_id=res.data.data.id;
  44 + getApp().request.promiseGet("/api/weshop/shoppingGuide/get/" + oo.stoid + "/" + first_leader, {}).then(res => {
  45 + if (res.data.code == 0) {
  46 + getApp().globalData.guide_id = res.data.data.id;
46 47 }
47 48 })
48 49 }
... ... @@ -63,145 +64,145 @@ Page({
63 64 }
64 65 })
65 66  
66   - var th=this;
67   - a.getConfig2(function(rs) {
68   - var arr=new Array(),arr2=new Array();
69   - if (rs.hot_keywords != null && ut.trim(rs.hot_keywords)!="" ){
70   - var arr1 = rs.hot_keywords.split('|');
71   - for (var i = 0; i < arr1.length;i++){
72   - if(i%5==0 && i!=0){
73   - arr.push(arr2);
74   - arr2=[];
75   - }else{
76   - arr2.push(arr1[i]);
  67 + var th = this;
  68 + a.getConfig2(function (rs) {
  69 + var arr = new Array(), arr2 = new Array();
  70 + if (rs.hot_keywords != null && ut.trim(rs.hot_keywords) != "") {
  71 + var arr1 = rs.hot_keywords.split('|');
  72 + for (var i = 0; i < arr1.length; i++) {
  73 + if (i % 5 == 0 && i != 0) {
  74 + arr.push(arr2);
  75 + arr2 = [];
  76 + } else {
  77 + arr2.push(arr1[i]);
  78 + }
77 79 }
  80 + if (arr2.length > 0) arr.push(arr2);
  81 + th.setData({ hotWords: arr });
78 82 }
79   - if (arr2.length > 0) arr.push(arr2);
80   - th.setData({ hotWords: arr});
81   - }
82   -
83   -
84   - //计算等级价相关
85   - var swithc_list=rs.switch_list;
86   - var sw_arr=JSON.parse(swithc_list);
87   - //---如果后台又开等级卡的开关---
88   - if(sw_arr.rank_switch && sw_arr.rank_switch=="2"){
89   - th.setData({rank_switch:true});
90   - var user=getApp().globalData.userInfo;
91   - var ti=setInterval(function(){
92   - if(!user) return false;
93   - clearInterval(ti);
94   - //---回调卡的列表---
95   - th.getPlusCardType(function(ob){
96   - th.setData({card_list:ob.card_list});
97   - if(user.card_field ){
98   - var str = user['card_expiredate'].replace(/-/g, '/');
99   - var end = new Date(str);
100   - end = Date.parse(end) / 1000;
101   - var now = ut.gettimestamp();
102   -
103   - //--- 判断是等级会员,且在有效期范围内 ---
104   - if(user.card_field && now<end){
105   - var card_name=ob.name_map.get(user.card_field);
106   - if(card_name && card_name.length>7) card_name=card_name.substring(0,8);
107   - th.setData({card_field:user.card_field,card_name:card_name,card_list:ob.card_list});
108   - }
109   - }
110   - })
111   - },500)
112   - }
113   -
114   -
115   -
116   - })
117   - //e.init(this, "", "requestData");
118   - var url = this.data.baseUrl;
119   -
120   - //扫一扫过来,显示搜索的内容
121   - var s_key = t.s_key;
122   - if (s_key){
123   - s_key=s_key.trim();
124   - this.search(s_key); this.openSearchModal();
125   - return;
126   - }
127   -
128   - if (0 != t.brand_id && t.brand_id!=undefined){ url += "&brand_id=" + t.brand_id;}
129   - if (0 != t.nation_id && t.nation_id!=undefined) { url += "&nation_id=" + t.nation_id;}
130   - if (0 != t.max_price && t.max_price!=undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price;}
131   - if (0 != t.ladder_id && t.ladder_id != undefined) {
132   - url += "&ladder_id=" + t.ladder_id;
133   - this.setData({
134   - baseUrl:url,
  83 +
  84 +
  85 + //计算等级价相关
  86 + var swithc_list = rs.switch_list;
  87 + var sw_arr = JSON.parse(swithc_list);
  88 + //---如果后台又开等级卡的开关---
  89 + if (sw_arr.rank_switch && sw_arr.rank_switch == "2") {
  90 + th.setData({ rank_switch: true });
  91 + var user = getApp().globalData.userInfo;
  92 + var ti = setInterval(function () {
  93 + if (!user) return false;
  94 + clearInterval(ti);
  95 + //---回调卡的列表---
  96 + th.getPlusCardType(function (ob) {
  97 + th.setData({ card_list: ob.card_list });
  98 + if (user.card_field) {
  99 + var str = user['card_expiredate'].replace(/-/g, '/');
  100 + var end = new Date(str);
  101 + end = Date.parse(end) / 1000;
  102 + var now = ut.gettimestamp();
  103 +
  104 + //--- 判断是等级会员,且在有效期范围内 ---
  105 + if (user.card_field && now < end) {
  106 + var card_name = ob.name_map.get(user.card_field);
  107 + if (card_name && card_name.length > 7) card_name = card_name.substring(0, 8);
  108 + th.setData({ card_field: user.card_field, card_name: card_name, card_list: ob.card_list });
  109 + }
  110 + }
  111 + })
  112 + }, 500)
  113 + }
  114 +
  115 +
  116 +
135 117 })
136   - }
137   - if (url != this.data.baseUrl) return this.requestSearch(url);
138   - this.openSearchModal();
  118 + //e.init(this, "", "requestData");
  119 + var url = this.data.baseUrl;
  120 +
  121 + //扫一扫过来,显示搜索的内容
  122 + var s_key = t.s_key;
  123 + if (s_key) {
  124 + s_key = s_key.trim();
  125 + this.search(s_key); this.openSearchModal();
  126 + return;
  127 + }
  128 +
  129 + if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; }
  130 + if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; }
  131 + if (0 != t.max_price && t.max_price != undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price; }
  132 + if (0 != t.ladder_id && t.ladder_id != undefined) {
  133 + url += "&ladder_id=" + t.ladder_id;
  134 + this.setData({
  135 + baseUrl: url,
  136 + })
  137 + }
  138 + if (url != this.data.baseUrl) return this.requestSearch(url);
  139 + this.openSearchModal();
139 140 // 获取历史搜索记录
140   - this.getHistorySearch();
  141 + this.getHistorySearch();
141 142 },
142 143  
143   - onShow:function () {
  144 + onShow: function () {
144 145 getApp().check_can_share();
145 146 },
146 147  
147   - changeTab: function(t) {
148   - var ord = t.currentTarget.dataset.href;
149   - var ad = t.currentTarget.dataset.ad;
  148 + changeTab: function (t) {
  149 + var ord = t.currentTarget.dataset.href;
  150 + var ad = t.currentTarget.dataset.ad;
150 151  
151   - var url = this.data.requestUrl;
  152 + var url = this.data.requestUrl;
152 153  
153   - if (this.data.tabname != ord) {
154   - this.setData({ tabname: ord, adname: "desc" });
155   - } else {
156   - ad = ad == "desc" ? "asc" : "desc";
157   - this.setData({ adname: ad });
158   - }
159   - this.resetData(), this.requestSearch(url);
  154 + if (this.data.tabname != ord) {
  155 + this.setData({ tabname: ord, adname: "desc" });
  156 + } else {
  157 + ad = ad == "desc" ? "asc" : "desc";
  158 + this.setData({ adname: ad });
  159 + }
  160 + this.resetData(), this.requestSearch(url);
160 161  
161 162 },
162 163  
163 164 //-----------真的调用地址进行搜索------------
164   - requestSearch: function(t) {
165   - // console.log('t===>', t);
166   - if(this.data.loading) return false;
167   - this.data.loading=1;
168   - var e = this,th=e;
169   - if(getApp().globalData.userInfo) {
170   - t += "&user_id=" + getApp().globalData.userInfo.user_id;
171   - }
  165 + requestSearch: function (t) {
  166 + // console.log('t===>', t);
  167 + if (this.data.loading) return false;
  168 + this.data.loading = 1;
  169 + var e = this, th = e;
  170 + if (getApp().globalData.userInfo) {
  171 + t += "&user_id=" + getApp().globalData.userInfo.user_id;
  172 + }
172 173 this.data.requestUrl = t;
173 174  
174   - var user_id=getApp().globalData.user_id;
175   - if(!user_id) user_id=0;
176   - let data = {
177   - is_mainshow: 1,
178   - isonsale: 1,
179   - store_id: oo.stoid,
180   - orderField: e.data.tabname,
181   - orderType: e.data.adname,
182   - page: e.data.currentPage,
183   - };
184   -
185   - let o = this.data.rq_data.o;
186   - if(o) {
187   - if(o.cat_id) data.cat_id = o.cat_id;
188   - if(o.pid && o.pid != 'three') data.parent_id = o.pid;
189   - if(o.nation_id) data.nation_id = o.nation_id;
190   - if(o.brand_id) data.brand_id = o.brand_id;
191   - };
192   -
193   -
194   - getApp().request.promiseGet(t, {data:data}).then(async res=>{
195   - th.data.loading=0;
196   - if(ut.ajax_ok(res)){
197   - if(!e.data.requestData) {
198   - // e.data.requestData=[];
199   - e.setData({
200   - requestData: [],
201   - });
202   - };
203   - for(let i in res.data.data.pageData){
204   - let item=res.data.data.pageData[i];
  175 + var user_id = getApp().globalData.user_id;
  176 + if (!user_id) user_id = 0;
  177 + let data = {
  178 + is_mainshow: 1,
  179 + isonsale: 1,
  180 + store_id: oo.stoid,
  181 + orderField: e.data.tabname,
  182 + orderType: e.data.adname,
  183 + page: e.data.currentPage,
  184 + };
  185 +
  186 + let o = this.data.rq_data.o;
  187 + if (o) {
  188 + if (o.cat_id) data.cat_id = o.cat_id;
  189 + if (o.pid && o.pid != 'three') data.parent_id = o.pid;
  190 + if (o.nation_id) data.nation_id = o.nation_id;
  191 + if (o.brand_id) data.brand_id = o.brand_id;
  192 + };
  193 +
  194 +
  195 + getApp().request.promiseGet(t, { data: data }).then(async res => {
  196 + th.data.loading = 0;
  197 + if (ut.ajax_ok(res)) {
  198 + if (!e.data.requestData) {
  199 + // e.data.requestData=[];
  200 + e.setData({
  201 + requestData: [],
  202 + });
  203 + };
  204 + for (let i in res.data.data.pageData) {
  205 + let item = res.data.data.pageData[i];
205 206 item.original_img = th.data.url + item.original_img;
206 207  
207 208 /*--
... ... @@ -218,48 +219,48 @@ Page({
218 219 })--*/
219 220  
220 221 var prom_type = item.prom_type; //0普通商品 1秒杀 6拼单 2团购 4积分购
221   - var prom_id=item.prom_id;
222   - var now=ut.gettimestamp();
  222 + var prom_id = item.prom_id;
  223 + var now = ut.gettimestamp();
223 224 var url = "";
224   - switch (prom_type){
  225 + switch (prom_type) {
225 226 case 1:
226   - url = "/api/ms/flash_sale/getNew/" +oo.stoid + "/" +user_id+"/"+ prom_id;
  227 + url = "/api/ms/flash_sale/getNew/" + oo.stoid + "/" + user_id + "/" + prom_id;
227 228 break;
228 229 case 2:
229   - url ="/api/weshop/goods/groupBuy/getActInfo/" +oo.stoid + "/" +item.goods_id+"/"+ prom_id
  230 + url = "/api/weshop/goods/groupBuy/getActInfo/" + oo.stoid + "/" + item.goods_id + "/" + prom_id
230 231 break;
231 232 case 4:
232   - url ="/api/weshop/integralbuy/get/"+oo.stoid +"/"+prom_id;
  233 + url = "/api/weshop/integralbuy/get/" + oo.stoid + "/" + prom_id;
233 234 break;
234 235 case 6:
235 236 url = "/api/weshop/teamlist/get/" + oo.stoid + "/" + prom_id;
236   - await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1",{
237   - data:{
238   - store_id: oo.stoid,
239   - is_end: 0,
240   - is_show: 1,
241   - user_id: getApp().globalData.user_id,
242   - pageSize:1000,
  237 + await getApp().request.promiseGet("/api/weshop/teamlist/pageteam/1", {
  238 + data: {
  239 + store_id: oo.stoid,
  240 + is_end: 0,
  241 + is_show: 1,
  242 + user_id: getApp().globalData.user_id,
  243 + pageSize: 1000,
243 244 }
244   - }).then(pd=>{
245   - let pd_list=pd.data.data.pageData;
246   - if(res.data.code==0 && pd_list.length>0){
247   - var flag = pd_list.some(pd=>{
248   - return pd.goods_id==item.goods_id
249   - })
250   -
251   - if(!flag){
252   - item.prom_type=0;
253   - item.prom_id=0;
254   - item.prom_price=null;
255   - }
  245 + }).then(pd => {
  246 + let pd_list = pd.data.data.pageData;
  247 + if (res.data.code == 0 && pd_list.length > 0) {
  248 + var flag = pd_list.some(pd => {
  249 + return pd.goods_id == item.goods_id
  250 + })
  251 +
  252 + if (!flag) {
  253 + item.prom_type = 0;
  254 + item.prom_id = 0;
  255 + item.prom_price = null;
  256 + }
256 257 }
257   - })
  258 + })
258 259 break;
259 260 case 8:
260 261 var presell_id = prom_id;
261 262 var url1 = "/api/weshop/marketing/marketingPresellList/list";
262   - var rd= {
  263 + var rd = {
263 264 store_id: oo.stoid,
264 265 presell_id: presell_id,
265 266 goods_id: item.goods_id
... ... @@ -271,287 +272,303 @@ Page({
271 272 if (res.data.code == 0 && res.data.data && res.data.data.length > 0) {
272 273 var arr = res.data.data[0];
273 274 item.prom_price = arr.luck_goods_price;
274   - item.sales_sum=arr.buy_goodnum+(arr.virtual_qty?arr.virtual_qty:0);
  275 + item.sales_sum = arr.buy_goodnum + (arr.virtual_qty ? arr.virtual_qty : 0);
275 276 }
276 277 })
277 278 break;
278 279 default:
279 280 break;
280 281 };
281   - if(url!=null && url!=''){
  282 + if (url != null && url != '') {
282 283 await getApp().request.promiseGet(url, {}).then(async res => {
283   - var prom =null;
284   - if(res.data.code==0 && res.data.data){
285   - prom=res.data.data;
  284 + var prom = null;
  285 + if (res.data.code == 0 && res.data.data) {
  286 + prom = res.data.data;
286 287  
287   - if (prom != null && prom.is_end==0 && prom.end_time>now && (prom.start_time<now || (prom.show_time && prom.show_time<now)) ) {
  288 + if (prom != null && prom.is_end == 0 && prom.end_time > now && (prom.start_time < now || (prom.show_time && prom.show_time < now))) {
288 289 item.prom_price = res.data.data.price;
289   - if(res.data.data.user_price) item.prom_price=res.data.data.user_price;
290   - var vNum=prom.virtual_num?prom.virtual_num:0;
291   - var vNum1=prom.virtualNum?prom.virtualNum:0;
292   - var vNum2=prom.virtual?prom.virtual:0;
293   - item.sales_sum=prom.buy_num+(vNum+vNum1+vNum2);
294   - }else{
295   - item.prom_type=0;
296   - item.prom_id=0;
297   - item.prom_price=null;
  290 + if (res.data.data.user_price) item.prom_price = res.data.data.user_price;
  291 + var vNum = prom.virtual_num ? prom.virtual_num : 0;
  292 + var vNum1 = prom.virtualNum ? prom.virtualNum : 0;
  293 + var vNum2 = prom.virtual ? prom.virtual : 0;
  294 + item.sales_sum = prom.buy_num + (vNum + vNum1 + vNum2);
  295 + } else {
  296 + item.prom_type = 0;
  297 + item.prom_id = 0;
  298 + item.prom_price = null;
298 299 }
299 300 }
300 301 })
301 302 };
302   - if(!th.data.requestData) th.data.requestData=[];
  303 + if (!th.data.requestData) th.data.requestData = [];
303 304 th.data.requestData.push(item);
304   - e.setData({requestData: e.data.requestData});
  305 + e.setData({ requestData: e.data.requestData });
305 306 }
306 307 }
307 308 e.closeSearchModal();
308 309 })
309 310 },
310   - onReachBottom: function() {
311   - console.log('触发上滑加载事件');
  311 + onReachBottom: function () {
  312 + console.log('触发上滑加载事件');
312 313 this.data.currentPage++
313   - console.log('触发上滑加载事件currentPage',this.data.currentPage);
  314 + console.log('触发上滑加载事件currentPage', this.data.currentPage);
314 315 this.data.openSearchModal || e.canloadMore() && this.requestSearch(this.data.requestUrl);
315 316 },
316   -
317   -
318   - openFilterModal: function() {
  317 +
  318 +
  319 + openFilterModal: function () {
319 320 this.setData({
320 321 openFilterModal: !0
321 322 });
322 323 },
323   - closeFilterModal: function() {
  324 + closeFilterModal: function () {
324 325 this.setData({
325 326 openFilterModal: !1
326 327 });
327 328 },
328   - filterGoods: function(t) {
  329 + filterGoods: function (t) {
329 330 this.resetData(), this.requestSearch(t.currentTarget.dataset.href), this.closeFilterModal();
330 331 },
331   -
332   -
333   -
334   - resetData: function() {
335   - e.resetConfig(),
336   - // this.data.requestData = null,
337   - this.data.currentPage = 1;
338   - this.setData({
339   - requestData: null,
340   - });
  332 +
  333 +
  334 +
  335 + resetData: function () {
  336 + e.resetConfig(),
  337 + // this.data.requestData = null,
  338 + this.data.currentPage = 1;
  339 + this.setData({
  340 + requestData: null,
  341 + });
341 342 },
342 343  
343 344 //---回复最初的设置---显示全部分类--
344   - restoreData: function() {
  345 + restoreData: function () {
345 346 this.setData({
346 347 requestData: this.data.allData,
347 348 });
348   - this.data.currentPage=2;
  349 + this.data.currentPage = 2;
349 350 },
350   - openSearchModal: function() {
  351 + openSearchModal: function () {
351 352 this.setData({
352 353 openSearchModal: !0
353 354 });
354 355 },
355   - closeSearchModal: function() {
  356 + closeSearchModal: function () {
356 357 this.setData({
357 358 openSearchModal: !1
358 359 });
359 360 },
360   -
361   - submitSearch: function(t) {
362   - var val=t.detail.value.word;
363   - if(val==undefined) val=t.detail.value;
364   - val=val?val.trim():'';
365   - if(!val){
366   - a.showWarning("请输入关键词");
367   - }
368   - this.search(val);
  361 +
  362 + submitSearch: function (t) {
  363 + var val = t.detail.value.word;
  364 + if (val == undefined) val = t.detail.value;
  365 + val = val ? val.trim() : '';
  366 + if (!val) {
  367 + a.showWarning("请输入关键词");
  368 + }
  369 + this.search(val);
369 370 },
370 371  
371 372 //热搜关键字
372   - searchHotWord: function(t) {
373   - var word = t.currentTarget.dataset.word;
374   - if(word) {
375   - this.setData({
376   - keyword: word,
377   - hiddenClear: false,
378   - });
379   - };
380   - this.historyRecord(word);
381   - this.search(word);
  373 + searchHotWord: function (t) {
  374 + var word = t.currentTarget.dataset.word;
  375 + if (word) {
  376 + this.setData({
  377 + keyword: word,
  378 + hiddenClear: false,
  379 + });
  380 + };
  381 + this.historyRecord(word);
  382 + this.search(word);
382 383 },
383 384  
384 385 //-----点击搜索按钮----
385   - search: function(t) {
  386 + search: function (t) {
386 387 if ("string" != typeof t || "" == t) return a.showWarning("请输入关键词");
387   - this.data.key_str=t;
  388 + this.data.key_str = t;
388 389 this.resetData();
389   - this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t));
390   - this.historyRecord();
  390 + this.requestSearch(this.data.baseUrl + "&key_str=" + encodeURIComponent(t));
  391 + this.historyRecord();
391 392 },
392 393  
393 394 //---------分享配置--------
394 395 onShareAppMessage: function (e) {
395   - getApp().globalData.no_clear=1;
396   - var curPage=this;
  396 + getApp().globalData.no_clear = 1;
  397 + var curPage = this;
397 398 var pagePath = curPage.route; //当前页面url
398 399 if (pagePath.indexOf('/') != 0) {
399 400 pagePath = '/' + pagePath;
400 401 }
401 402  
402   - if(this.data.key_str) {
  403 + if (this.data.key_str) {
403 404 pagePath += "?s_key=" + this.data.key_str;
404 405 }
405 406  
406   - if(getApp().globalData.user_id){
  407 + if (getApp().globalData.user_id) {
407 408  
408   - if(pagePath.indexOf("?")>0){
409   - pagePath+="&first_leader="+getApp().globalData.user_id;
410   - }else{
411   - pagePath+="?first_leader="+getApp().globalData.user_id;
  409 + if (pagePath.indexOf("?") > 0) {
  410 + pagePath += "&first_leader=" + getApp().globalData.user_id;
  411 + } else {
  412 + pagePath += "?first_leader=" + getApp().globalData.user_id;
412 413 }
413 414 }
414 415  
415 416 // console.log("11-11"+pagePath);
416 417 return {
417 418 title: "商品搜索",
418   - path:pagePath,
  419 + path: pagePath,
419 420 }
420 421 },
421 422  
422 423  
423 424 //---------图片失败,默认图片--------
424 425 bind_bnerr: function (e) {
425   - var _errImg = e.target.dataset.errorimg;
426   - var _errObj = {};
427   - _errObj[_errImg] = this.data.url+ "/miniapp/images/default_g_img.gif";
428   - this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
  426 + var _errImg = e.target.dataset.errorimg;
  427 + var _errObj = {};
  428 + _errObj[_errImg] = this.data.url + "/miniapp/images/default_g_img.gif";
  429 + this.setData(_errObj) //注意这里的赋值方式,只是将数据列表中的此项图片路径值替换掉 ;
429 430 },
430   -
431   - //--- 获取卡类列表 ---
432   - getPlusCardType: function (func) {
433   - var storid = oo.stoid;
434   - var th = this;
435   - getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
436   - var plusCard = res.data.data;
437   - var arr = [1219, 2089, 3031];
438   - var new_arr = new Array();
439   - var card_name_map=new Map();
440   - var user = getApp().globalData.userInfo;
441   -
442   - for (var i = 0; i < plusCard.length; i++) {
443   - if ((!user || user.card_field==null || user.card_field=="") && (plusCard[i].IsStopBuy==true)) {
444   - continue;
445   - }
446   - var name="card"+plusCard[i].CorrPrice.toLowerCase();
447   - card_name_map.set(name,plusCard[i].CardName);
448   - new_arr.push(plusCard[i]);
449   -
450   - }
451   -
452   - var ob={"card_list":new_arr,"name_map":card_name_map};
453   - func(ob);
454   - })
455   - },
456   -
457   -
458   - getInput(e) {
459   - let val = e.detail.value;
460   - if(val) {
461   - this.setData({
462   - keyword: e.detail.value,
463   - hiddenClear: false,
464   - });
465   - } else {
466   - this.setData({
467   - hiddenClear: true,
468   - });
469   - }
470   -
471   - },
472   -
473   - historyRecord(w) {
474   - let keyword =w;
475   - let self = this;
476   - if(!keyword){
477   - keyword = this.data.key_str.trim();
478   - }
479   - let searchRecord = this.data.searchRecord;
480   - if(!searchRecord || searchRecord.length==0) searchRecord=wx.getStorageSync('searchRecord') || [];
481   -
482   - if(keyword) {
483   -
484   - var index=searchRecord.indexOf(keyword);
485   - if(index > -1) {
486   - // 已经存在该值
487   - searchRecord.splice(index,1);
488   - searchRecord.unshift(keyword);
489   -
490   - // 将历史记录添加到缓存中
491   - wx.setStorage({
492   - key: 'searchRecord',
493   - data: searchRecord,
494   - success: function(res) {
495   - self.setData({
496   - searchRecord,
497   - })
498   - }
499   - })
500   -
501   - return;
502   - } else {
503   - if(searchRecord.length >= 10) {
504   - searchRecord.pop(); // 删除最早的一条记录
505   - };
506   - searchRecord.unshift(keyword);
507   -
508   - // // 将历史记录添加到缓存中
509   - wx.setStorage({
510   - key: 'searchRecord',
511   - data: searchRecord,
512   - success: function(res) {
513   - self.setData({
514   - searchRecord,
515   - })
516   - }
517   - })
518   - };
519   - };
520   - },
521   -
522   -
523   -
524   - // 获取历史搜索记录
525   - getHistorySearch() {
526   - this.setData({
527   - searchRecord: wx.getStorageSync('searchRecord') || [] //若无存储则为空
528   - });
529   - },
530   -
531   - // 清除历史搜素记录
532   - clearSearchRecord() {
533   - wx.clearStorageSync('searchRecord');
534   - this.setData({
535   - searchRecord: []
536   - });
537   - },
538   -
539   - go_url:function (e) {
540   - var url=e.currentTarget.dataset.url;
  431 +
  432 + //--- 获取卡类列表 ---
  433 + getPlusCardType: function (func) {
  434 + var storid = oo.stoid;
  435 + var th = this;
  436 + getApp().request.promiseGet("/api/weshop/plus/vip/mem/bership/list?" + "storeId=" + storid, {}).then(res => {
  437 + var plusCard = res.data.data;
  438 + var arr = [1219, 2089, 3031];
  439 + var new_arr = new Array();
  440 + var card_name_map = new Map();
  441 + var user = getApp().globalData.userInfo;
  442 +
  443 + for (var i = 0; i < plusCard.length; i++) {
  444 + if ((!user || user.card_field == null || user.card_field == "") && (plusCard[i].IsStopBuy == true)) {
  445 + continue;
  446 + }
  447 + var name = "card" + plusCard[i].CorrPrice.toLowerCase();
  448 + card_name_map.set(name, plusCard[i].CardName);
  449 + new_arr.push(plusCard[i]);
  450 +
  451 + }
  452 +
  453 + var ob = { "card_list": new_arr, "name_map": card_name_map };
  454 + func(ob);
  455 + })
  456 + },
  457 +
  458 +
  459 + getInput(e) {
  460 + let val = e.detail.value;
  461 + if (val) {
  462 + this.setData({
  463 + keyword: e.detail.value,
  464 + hiddenClear: false,
  465 + });
  466 + } else {
  467 + this.setData({
  468 + hiddenClear: true,
  469 + });
  470 + }
  471 +
  472 + },
  473 +
  474 + historyRecord(w) {
  475 + let keyword = w;
  476 + let self = this;
  477 + if (!keyword) {
  478 + keyword = this.data.key_str.trim();
  479 + }
  480 + let searchRecord = this.data.searchRecord;
  481 + if (!searchRecord || searchRecord.length == 0) searchRecord = wx.getStorageSync('searchRecord') || [];
  482 +
  483 + if (keyword) {
  484 +
  485 + var index = searchRecord.indexOf(keyword);
  486 + if (index > -1) {
  487 + // 已经存在该值
  488 + searchRecord.splice(index, 1);
  489 + searchRecord.unshift(keyword);
  490 +
  491 + // 将历史记录添加到缓存中
  492 + wx.setStorage({
  493 + key: 'searchRecord',
  494 + data: searchRecord,
  495 + success: function (res) {
  496 + self.setData({
  497 + searchRecord,
  498 + })
  499 + }
  500 + })
  501 +
  502 + return;
  503 + } else {
  504 + if (searchRecord.length >= 10) {
  505 + searchRecord.pop(); // 删除最早的一条记录
  506 + };
  507 + searchRecord.unshift(keyword);
  508 +
  509 + // // 将历史记录添加到缓存中
  510 + wx.setStorage({
  511 + key: 'searchRecord',
  512 + data: searchRecord,
  513 + success: function (res) {
  514 + self.setData({
  515 + searchRecord,
  516 + })
  517 + }
  518 + })
  519 + };
  520 + };
  521 + },
  522 +
  523 + closePoster() {
  524 + this.setData({
  525 + fliter_flag: false,
  526 + });
  527 + },
  528 +
  529 + show_fliter() {
  530 + this.setData({
  531 + fliter_flag: true
  532 + })
  533 + },
  534 + fliter_close() {
  535 + this.setData({
  536 + fliter_flag: false,
  537 + })
  538 + },
  539 +
  540 +
  541 + // 获取历史搜索记录
  542 + getHistorySearch() {
  543 + this.setData({
  544 + searchRecord: wx.getStorageSync('searchRecord') || [] //若无存储则为空
  545 + });
  546 + },
  547 +
  548 + // 清除历史搜素记录
  549 + clearSearchRecord() {
  550 + wx.clearStorageSync('searchRecord');
  551 + this.setData({
  552 + searchRecord: []
  553 + });
  554 + },
  555 +
  556 + go_url: function (e) {
  557 + var url = e.currentTarget.dataset.url;
541 558 getApp().goto(url);
542 559 },
543   -
544   - clearInput() {
545   - this.setData({
546   - keyword: '',
547   - hiddenClear: true,
548   - openSearchModal: true,
549   - });
550   - },
551   -
552   - inputFocus() {
553   - this.setData({
554   - openSearchModal: true,
555   - });
556   - },
  560 +
  561 + clearInput() {
  562 + this.setData({
  563 + keyword: '',
  564 + hiddenClear: true,
  565 + openSearchModal: true,
  566 + });
  567 + },
  568 +
  569 + inputFocus(e) {
  570 + this.setData({
  571 + openSearchModal: true,
  572 + });
  573 + },
557 574 });
558 575 \ No newline at end of file
... ...
pages/goods/search/search.json
... ... @@ -2,6 +2,10 @@
2 2 "navigationBarTitleText": "商品搜索",
3 3 "enablePullDownRefresh": false,
4 4 "usingComponents": {
5   - "share_box": "/components/share_box/share_box"
6   - }
  5 + "share_box": "/components/share_box/share_box",
  6 + "van-popup":"/packageB/components/vant_ui/popup"
  7 + },
  8 + "componentPlaceholder": {
  9 + "van-popup": "view"
  10 + }
7 11 }
8 12 \ No newline at end of file
... ...
pages/goods/search/search.wxml
... ... @@ -6,7 +6,7 @@
6 6 <form bindsubmit="submitSearch">
7 7 <view class="pdh20 pdv10 flex ai_c jc_sb">
8 8 <view class="input-box">
9   - <input autoFocus class="input-search" name="word" placeholder="搜索商品" bindconfirm="submitSearch" bindinput="getInput" bindfocus="inputFocus" value="{{keyword}}"/>
  9 + <input class="input-search" name="word" placeholder="搜索商品" bindconfirm="submitSearch" bindinput="getInput" bindfocus="inputFocus" value="{{keyword}}"/>
10 10 <text class="iconfont icon-guan" hidden="{{hiddenClear}}" catchtap="clearInput"></text>
11 11 </view>
12 12 <button class="btn" formType="submit" hover-class="none">搜索</button>
... ...
pages/goods/search/search.wxss
1 1 .container {
2 2 color: #666;
3   - overflow: visible;
  3 + overflow: visible;
4 4 }
5 5  
6 6 .nav {
7   - position: sticky;
8   - top: 90rpx;
9   - background-color: white;
10   - z-index: 999;
  7 + position: sticky;
  8 + top: 90rpx;
  9 + background-color: white;
  10 + z-index: 99;
11 11 }
12 12  
13 13 .nav-item {
... ... @@ -15,7 +15,7 @@
15 15 width: 30%;
16 16 height: 90rpx;
17 17 line-height: 90rpx; */
18   - padding: 14rpx 10rpx;
  18 + padding: 14rpx 10rpx;
19 19 display: flex;
20 20 align-items: center;
21 21 justify-content: center;
... ... @@ -82,8 +82,8 @@
82 82 width: 180rpx;
83 83 height: 180rpx;
84 84 padding: 0 10rpx 0 30rpx;
85   - flex-shrink: 0;
86   - /* padding: 10rpx; */
  85 + flex-shrink: 0;
  86 + /* padding: 10rpx; */
87 87 }
88 88  
89 89 .img-wrap image {
... ... @@ -98,7 +98,7 @@
98 98 line-height: 36rpx;
99 99 color: #333;
100 100 overflow: hidden;
101   - text-align: justify;
  101 + text-align: justify;
102 102 }
103 103  
104 104 .price {
... ... @@ -185,10 +185,10 @@
185 185 .search-bar {
186 186 /* width: 100%;
187 187 box-sizing: border-box; */
188   - background-color: white;
189   - position: sticky;
190   - top: 0;
191   - z-index: 1;
  188 + background-color: white;
  189 + position: sticky;
  190 + top: 0;
  191 + z-index: 1;
192 192 }
193 193  
194 194 .search-input {
... ... @@ -260,13 +260,13 @@
260 260 } */
261 261  
262 262 .card_bg {
263   - box-sizing: border-box;
  263 + box-sizing: border-box;
264 264 padding: 2rpx 10rpx;
265 265 /* height: 28rpx; */
266 266 border-radius: 26rpx;
267 267 font-size: 18rpx;
268 268 /* line-height: 28rpx; */
269   - max-width: 210rpx;
  269 + max-width: 210rpx;
270 270 background: #333;
271 271 color: #fff;
272 272 margin-left: 8rpx;
... ... @@ -276,12 +276,12 @@
276 276 width: 19rpx;
277 277 height: 19rpx;
278 278 margin-right: 8rpx;
279   - flex-shrink: 0;
  279 + flex-shrink: 0;
280 280 }
281 281  
282 282 .card_name {
283   - position: relative;
284   - top: -4rpx;
  283 + position: relative;
  284 + top: -4rpx;
285 285 }
286 286  
287 287 /* .card_bg image {
... ... @@ -299,7 +299,7 @@
299 299 } */
300 300  
301 301 .navigator-hover {
302   - opacity: 1;
  302 + opacity: 1;
303 303 }
304 304  
305 305 .mk_price {
... ... @@ -309,76 +309,134 @@
309 309  
310 310 .item-cont {
311 311 /* line-height: 38rpx; */
312   - flex-grow: 1;
  312 + flex-grow: 1;
313 313 }
314 314  
315 315 .history {
316   - background-color: #f0f0f0;
317   - color: #7b7b7b;
318   - border: none;
319   - margin-bottom: 16rpx;
  316 + background-color: #f0f0f0;
  317 + color: #7b7b7b;
  318 + border: none;
  319 + margin-bottom: 16rpx;
320 320 }
321 321  
322 322 .history:first-of-type {
323   - /* margin-left: 0; */
  323 + /* margin-left: 0; */
324 324 }
325 325  
326 326 .input-box {
327   - position: relative;
328   - flex: 1;
329   - padding-left: 50rpx;
330   - padding-right: 70rpx;
331   - background-color: #f0f0f0;
332   - border-radius: 60rpx;
  327 + position: relative;
  328 + flex: 1;
  329 + padding-left: 50rpx;
  330 + padding-right: 70rpx;
  331 + background-color: #f0f0f0;
  332 + border-radius: 60rpx;
333 333 }
334 334  
335 335 .input-box::before {
336   - font-family: iconfont;
337   - position: absolute;
338   - left: 20rpx;
339   - top: 50%;
340   - transform: translateY(-50%);
341   - content: '\e618';
  336 + font-family: iconfont;
  337 + position: absolute;
  338 + left: 20rpx;
  339 + top: 50%;
  340 + transform: translateY(-50%);
  341 + content: '\e618';
342 342 }
343 343  
344 344 .input-search {
345   - position: relative;
346   - padding: 10rpx;
347   - font-size: 28rpx;
  345 + position: relative;
  346 + padding: 10rpx;
  347 + font-size: 28rpx;
348 348 }
349 349  
350 350  
351 351 .btn {
352   - margin-left: 0;
353   - margin-right: 0;
354   - line-height: 1;
355   - padding: 20rpx;
356   - font-size: 30rpx;
  352 + margin-left: 0;
  353 + margin-right: 0;
  354 + line-height: 1;
  355 + padding: 20rpx;
  356 + font-size: 30rpx;
357 357 }
358 358  
359 359 .btn::after {
360   - border: none;
  360 + border: none;
361 361 }
362 362  
363 363 .icon-guan {
364   - font-size: 20rpx;
365   - padding: 10rpx;
366   - position: absolute;
367   - right: 20rpx;
368   - top: 50%;
369   - transform: translateY(-50%);
  364 + font-size: 20rpx;
  365 + padding: 10rpx;
  366 + position: absolute;
  367 + right: 20rpx;
  368 + top: 50%;
  369 + transform: translateY(-50%);
370 370 }
371 371  
372 372 .lookat {
373   - display: inline-block;
374   - color: #FF6768;
375   - border: 2rpx solid #FF6768;
376   - border-radius: 80rpx;
377   - font-size: 30rpx;
  373 + display: inline-block;
  374 + color: #FF6768;
  375 + border: 2rpx solid #FF6768;
  376 + border-radius: 80rpx;
  377 + font-size: 30rpx;
378 378 }
379 379  
380 380 .no-data .no-data-title {
381   - font-size: 28rpx;
382   - color: #999;
  381 + font-size: 28rpx;
  382 + color: #999;
  383 +}
  384 +
  385 +.mt30 {
  386 + margin-top: 30rpx;
  387 +}
  388 +
  389 +.popup_item {
  390 + display: flex;
  391 + justify-content: space-between;
  392 + margin-top: 30rpx;
383 393 }
384 394  
  395 +.popup_input {
  396 + border-radius: 20rpx;
  397 + width: 40%;
  398 + font-size: 24rpx;
  399 + padding: 10rpx;
  400 + background: #f9f9f9;
  401 +}
  402 +.popup_price1 {
  403 + text-align: center;
  404 + padding: 0 30rpx;
  405 + margin-top: 30rpx;
  406 + background: red;
  407 + border-radius: 20rpx;
  408 +}
  409 +
  410 +.popup_price {
  411 + text-align: center;
  412 + padding: 10rpx 30rpx;
  413 + margin-top: 30rpx;
  414 + background: red;
  415 + border-radius: 35rpx;
  416 +}
  417 +.mask {
  418 + position: fixed;
  419 + top: 0;
  420 + left: 0;
  421 + width: 100%;
  422 + height: 100%;
  423 + z-index: 999;
  424 + background-color: rgba(0,0,0,.4);
  425 + }
  426 +
  427 +.popup_brand {
  428 + display: flex;
  429 + flex-wrap: wrap;
  430 + justify-content: space-between;
  431 +}
  432 +
  433 +.filter {
  434 + height: 100%;
  435 + position: absolute;
  436 + right: 0;
  437 + top: 0;
  438 + background: pink;
  439 + width: 80%;
  440 + z-index: 1000;
  441 + transition: all .5s;
  442 +}
385 443 \ No newline at end of file
... ...
pages/index/index/index.wxss
  1 +/* 基本样式 */
  2 +page {
  3 + width: 100%;
  4 + height: 100%;
  5 + overflow: hidden;
  6 + box-sizing: border-box;
  7 + position: relative;
  8 +}
  9 +/* 超出滚动 */
  10 +.container {
  11 + width: 100%;
  12 + height: 100%;
  13 + overflow-y: auto;
  14 +}
  15 +
1 16 .pink-b {
2 17 background: #ff7295;
3 18 }
... ... @@ -1010,11 +1025,7 @@ page {
1010 1025 /* background-color: #f7f8fa; */
1011 1026 }
1012 1027  
1013   -.container {
1014   - /* overflow: hidden; */
1015   - overflow: visible;
1016   - /* padding-top: 140rpx; */
1017   -}
  1028 +
1018 1029  
1019 1030 .container.nor{
1020 1031 padding-top: 80rpx;
... ...
pages/user/express/express.wxml
1 1 <view class="logistics-mes">
2 2 <view class="logistics-num">
3   - <view class="logistics-title">订单编号 : </view>
  3 + <view class="logistics-title">快递单号 : </view>
4 4 <view class="logistics-cont">{{delivery.invoice_no}}</view>
5 5 </view>
6 6 <view class="logistics-num">
... ...
pages/user/index/filter.wxs
... ... @@ -8,7 +8,7 @@ var is_close = function (name,c_list) {
8 8 map['我的权益']="5";
9 9 map['联系客服']="6";
10 10 map['收藏夹']="7";
11   - map['我的地址']="8";
  11 + map['附近门店']="8";
12 12 map['收入卡包']="9";
13 13 map['专享礼包']="10";
14 14 map['我的服务']="12";
... ...
pages/user/index/index.wxml
... ... @@ -38,9 +38,10 @@
38 38  
39 39  
40 40 </view>
41   - <view wx:if="{{userInfo}}" class="xc-qrcode-frame abs flex-center ">
  41 + <view wx:if="{{userInfo}}" class="xc-qrcode-frame abs ">
42 42 <!-- {{iurl}}/miniapp -->
43 43 <image bindtap='show_tc' class=" xc-qrcode " src="{{iurl}}/miniapp/images/qrcode1.png"></image>
  44 + <view style="font-size:12px;color: #fff;">会员卡</view>
44 45 </view>
45 46 <view class="flex-vertical abs xc-grow-frame rel" style="display: none">
46 47 <view class="xc-grow-up">成长值</view>
... ... @@ -58,7 +59,7 @@
58 59 <view class='numfont'>余额</view>
59 60 </view>
60 61 <view class="t-c typefont" bindtap='deposit'>{{udata.Balance?udata.Balance:0}}
61   - <view class='numfont'>预存款</view>
  62 + <view class='numfont'>储值款</view>
62 63 </view>
63 64 <view class="t-c typefont" bindtap='integral'>{{udata.Integral?udata.Integral:0}}
64 65 <view class='numfont'>积分</view>
... ... @@ -346,7 +347,7 @@
346 347 <!--<image class='g_img' src='https://mshop.yolipai.net//index.php?m=Home&c=Index&a=qr_code&data={{userInfo.mobile}}'></image>-->
347 348 <canvas class="g_img" canvas-id="qrcode" />
348 349 </view>
349   - <view class="s_sao">扫一扫上面的二维码图案,即可消费</view>
  350 + <view class="s_sao">前台收银扫此二维码,即可享受优惠!</view>
350 351 </view>
351 352 </view>
352 353 </view>
... ...
pages/user/index/index.wxss
... ... @@ -145,16 +145,19 @@
145 145 }
146 146  
147 147 .xc-qrcode-frame {
148   - border-radius: 10rpx;
  148 + /* border-radius: 10rpx;
149 149 border: 5rpx solid #fe9db5;
150 150 background: #fe9db5;
151 151 width: 70rpx;
152   - height: 70rpx;
  152 + height: 70rpx; */
153 153 top: 70rpx;
154 154 right: 64rpx;
155 155 }
156 156  
157 157 .xc-qrcode {
  158 + border-radius: 10rpx;
  159 + border: 5rpx solid #fe9db5;
  160 + background: #fe9db5;
158 161 width: 70rpx;
159 162 height: 70rpx;
160 163 }
... ... @@ -301,7 +304,7 @@
301 304 height: 50rpx;
302 305 }
303 306  
304   -.xc-send{
  307 +.xc-send {
305 308 width: 50rpx;
306 309 height: 50rpx;
307 310 }
... ... @@ -455,9 +458,11 @@
455 458 display: block;
456 459 height: 1px;
457 460 width: 100%;
458   - background-color: #999; /*颜色需与主题大背景色一致*/
  461 + background-color: #999;
  462 + /*颜色需与主题大背景色一致*/
459 463 position: relative;
460   - top: 10px; /*调节线高*/
  464 + top: 10px;
  465 + /*调节线高*/
461 466 left: 0;
462 467 }
463 468  
... ... @@ -540,10 +545,10 @@
540 545 .modal-body {
541 546 position: fixed;
542 547 top: 0;
543   - bottom: 0;
  548 + bottom: 0;
544 549 left: 0;
545   - right: 0;
546   - margin: auto;
  550 + right: 0;
  551 + margin: auto;
547 552 z-index: 100;
548 553 background: #fff;
549 554 /* margin-left: 73rpx; */
... ... @@ -666,7 +671,8 @@
666 671 color: #fff;
667 672 }
668 673  
669   -.bg_right.bcolor, .bg_left.bcolor {
  674 +.bg_right.bcolor,
  675 +.bg_left.bcolor {
670 676 border-color: #333;
671 677 }
672 678  
... ... @@ -707,45 +713,47 @@
707 713 margin-top: 8rpx;
708 714 margin-right: 5rpx;
709 715 }
710   -.banner-img{
  716 +
  717 +.banner-img {
711 718 width: 95%;
712 719 height: 140rpx;
713   - border-radius: 10px 10px 0px 0px;
714   - margin-bottom: -5rpx;
  720 + border-radius: 10px 10px 0px 0px;
  721 + margin-bottom: -5rpx;
715 722  
716 723 }
717   -.banner-frame{
  724 +
  725 +.banner-frame {
718 726 width: 100%;
719 727 background: #f2f2f2;
720 728 }
721 729  
722   -button::after{ border: 0}
  730 +button::after {
  731 + border: 0
  732 +}
723 733  
724 734 .logo-container {
725   - -webkit-filter: brightness(80%);
726   - filter: brightness(80%);
  735 + -webkit-filter: brightness(80%);
  736 + filter: brightness(80%);
727 737 }
728 738  
729 739 .logo {
730   - width: 132rpx;
731   - height: 37rpx;
732   - margin-right: 10rpx;
  740 + width: 132rpx;
  741 + height: 37rpx;
  742 + margin-right: 10rpx;
733 743 }
734 744  
735 745 .icon-dingwei {
736   - color: #EA4F2B;
737   - font-size: 28rpx;
  746 + color: #EA4F2B;
  747 + font-size: 28rpx;
738 748 }
739 749  
740 750 .c-5 {
741   - color: #555;
  751 + color: #555;
742 752 }
743 753  
744 754  
745 755  
746 756 .action .icon-guan {
747   - left: auto !important;
748   - right: 20rpx !important;
749   -}
750   -
751   -
  757 + left: auto !important;
  758 + right: 20rpx !important;
  759 +}
752 760 \ No newline at end of file
... ...