Commit c1c036b5d5dc939ac6d8b416893a7470ec9c21fd
Merge branch 'dev' of ssh://git.vipzhuang.cn:22032/wxd/MShopWeApp into dev
Showing
18 changed files
with
1374 additions
and
1224 deletions
components/diy_goodsGroup/diy_goodsGroup.js
| ... | ... | @@ -107,12 +107,13 @@ Component({ |
| 107 | 107 | this.data.is_new = 1 |
| 108 | 108 | } |
| 109 | 109 | this.data.requestData = new Array(); |
| 110 | + //---将数组--- | |
| 110 | 111 | this.data.g_id = this.data.object.data; |
| 111 | 112 | var arr = []; |
| 112 | - | |
| 113 | - for (var i = 0; i < this.data.g_id.length; i += this.data.goodscount) { | |
| 114 | - arr.push(this.data.g_id.slice(i, i + this.data.goodscount)); | |
| 113 | + for (var i = 0; i < this.data.g_id .length; i += this.data.goodscount) { | |
| 114 | + arr.push(this.data.g_id .slice(i, i + this.data.goodscount)); | |
| 115 | 115 | } |
| 116 | + | |
| 116 | 117 | this.data.firist_type_data = arr; |
| 117 | 118 | this.init(this.data.classstyle_id, this.data.wgroup); |
| 118 | 119 | }, |
| ... | ... | @@ -124,7 +125,7 @@ Component({ |
| 124 | 125 | var th = this; |
| 125 | 126 | var g_id = this.data.g_id; |
| 126 | 127 | if (classstyle_id == 1) { |
| 127 | - //手动选择的时候 | |
| 128 | + //---手动选择的时候--- | |
| 128 | 129 | g_id = this.data.firist_type_data[th.data.firist_type_curr]; |
| 129 | 130 | th.data.firist_type_curr++; |
| 130 | 131 | } |
| ... | ... | @@ -136,75 +137,46 @@ Component({ |
| 136 | 137 | |
| 137 | 138 | //--初始化卡类-- |
| 138 | 139 | th.card_init(); |
| 139 | - | |
| 140 | 140 | var os=getApp().globalData.setting; |
| 141 | - | |
| 142 | 141 | classstyle_id = classstyle_id + ""; |
| 143 | 142 | switch (classstyle_id) { |
| 144 | - case "1": | |
| 145 | - g_id.forEach(function (val, ind) { | |
| 146 | - var item = {}; | |
| 147 | - var prom_id = null; | |
| 148 | - console.log(val.goodsid); | |
| 149 | - app.request.promiseGet("/api/weshop/goods/get/" + os.stoid + "/" + val.goodsid, {}).then(res => { | |
| 150 | - //商品地址 | |
| 151 | - var goods = res.data.data; | |
| 152 | - th.setData({ | |
| 153 | - goods_btn: res.data.data | |
| 154 | - }) | |
| 155 | - | |
| 156 | - item.goods_name = goods.goods_name; | |
| 157 | - item.goods_img = th.data.imghost + goods.original_img; | |
| 158 | - item.market_price = goods.market_price; | |
| 159 | - item.shop_price = goods.shop_price; | |
| 160 | - item.sales_sum = goods.sales_sum; | |
| 161 | - item.goods_id = goods.goods_id; | |
| 162 | - item.cardprice1 = goods.cardprice1; | |
| 163 | - item.cardprice2 = goods.cardprice2; | |
| 164 | - item.cardprice3 = goods.cardprice3; | |
| 165 | - | |
| 166 | - prom_id = res.data.data.prom_id; | |
| 167 | - | |
| 168 | - var prom_type = res.data.data.prom_type; //0普通商品 1秒杀 6拼单 | |
| 169 | - | |
| 170 | - var url = ""; | |
| 171 | - if (prom_type == 6) { | |
| 172 | - url = "/api/weshop/teamlist/get/" + os.stoid + "/" + prom_id; | |
| 173 | - } else if (prom_type == 1) { | |
| 174 | - url = "/api/ms/flash_sale/get/" + os.stoid + "/" + prom_id; | |
| 175 | - } | |
| 176 | - if(url==""){ | |
| 177 | - th.data.requestData.push(item); | |
| 178 | - th.setData({ goods_array: th.data.requestData, }); | |
| 179 | - if (th.data.firist_type_curr == th.data.firist_type_data.length) { | |
| 180 | - th.setData({ goods_btn: [] }); | |
| 181 | - } | |
| 182 | - }else{ | |
| 183 | - return app.request.promiseGet(url, {}) | |
| 184 | - } | |
| 185 | - | |
| 186 | - }).then(res => { | |
| 187 | - index++; | |
| 188 | - var prom = res.data.data; | |
| 189 | - var now=ut.gettimestamp(); | |
| 190 | - if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) { | |
| 191 | - item.prom_price = res.data.data.price; | |
| 192 | - } | |
| 193 | - th.data.requestData.push(item); | |
| 194 | - th.setData({ | |
| 195 | - goods_array: th.data.requestData, | |
| 196 | - }); | |
| 197 | 143 | |
| 198 | - if (th.data.firist_type_curr == th.data.firist_type_data.length) { | |
| 199 | - th.setData({ | |
| 200 | - goods_btn: [] | |
| 201 | - }); | |
| 202 | - } | |
| 203 | - }) | |
| 204 | - }) | |
| 144 | + //---手动选择商品--- | |
| 145 | + case "1": | |
| 146 | + var str=""; | |
| 147 | + for (var i = 0; i < g_id.length; i++) { | |
| 148 | + str += g_id[i].goodsid + ","; | |
| 149 | + } | |
| 150 | + str=str.substring(0, str.length - 1); | |
| 151 | + app.request.get("/api/weshop/goods/getgoodslistOrdby?store_id=" + os.stoid + "&goodsidlist=" + str, { | |
| 152 | + success: function(res) { | |
| 153 | + console.log("121212"); | |
| 154 | + if(res.data.code==0 && res.data.data){ | |
| 155 | + var rData = th.data.requestData; | |
| 156 | + if (rData == null) rData=[]; | |
| 157 | + var now=ut.gettimestamp(); | |
| 158 | + | |
| 159 | + var new_arr=[]; | |
| 160 | + for (var ii in res.data.data){ | |
| 161 | + var item=res.data.data[ii]; | |
| 162 | + item.goods_img=th.data.imghost + item.original_img; | |
| 163 | + if(item.e_time<now) {item.prom_type=0; item.prom_price=0;} | |
| 164 | + if(item.warm_uptime>now) {item.prom_type=0; item.prom_price=0;} | |
| 165 | + new_arr.push(item); | |
| 166 | + } | |
| 167 | + rData = rData.concat(new_arr); | |
| 168 | + th.data.requestData = rData; | |
| 169 | + th.setData({ goods_array: rData }); | |
| 170 | + //---控制有没有加载更多的按钮--- | |
| 171 | + if (th.data.firist_type_curr == th.data.firist_type_data.length) {th.setData({ goods_btn: [] }); } | |
| 172 | + else th.setData({ goods_btn: res.data}); | |
| 173 | + } | |
| 174 | + } | |
| 175 | + | |
| 176 | + }) | |
| 177 | + | |
| 205 | 178 | break; |
| 206 | 179 | case "2": |
| 207 | - | |
| 208 | 180 | var item = {}; |
| 209 | 181 | app.request.promiseGet("/api/weshop/goods/page", { |
| 210 | 182 | data: { |
| ... | ... | @@ -256,7 +228,8 @@ Component({ |
| 256 | 228 | } |
| 257 | 229 | if(url!="") { |
| 258 | 230 | await app.request.promiseGet(url, {}).then(res => { |
| 259 | - var prom = res.data.data; | |
| 231 | + var prom = null | |
| 232 | + if (res && res.data) prom=res.data.data; | |
| 260 | 233 | if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) { |
| 261 | 234 | item.prom_price = res.data.data.price; |
| 262 | 235 | } |
| ... | ... | @@ -329,7 +302,8 @@ Component({ |
| 329 | 302 | |
| 330 | 303 | if(url!=null){ |
| 331 | 304 | await app.request.promiseGet(url, {}).then(res => { |
| 332 | - var prom = res.data.data; | |
| 305 | + var prom =null; | |
| 306 | + if(res && res.data) res.data.data; | |
| 333 | 307 | if (prom != null && prom.is_end==0 && prom.end_time>now && prom.show_time<now) { |
| 334 | 308 | item.prom_price = res.data.data.price; |
| 335 | 309 | } | ... | ... |
components/diy_goodsGroup/diy_goodsGroup.wxss
| ... | ... | @@ -258,10 +258,13 @@ |
| 258 | 258 | display: flex; |
| 259 | 259 | /* padding-left: 2rpx; */ |
| 260 | 260 | margin-bottom: 12rpx; |
| 261 | - width: 48.5%; | |
| 261 | + width: 48%; | |
| 262 | 262 | float: left; |
| 263 | 263 | background: #fff; |
| 264 | 264 | margin-left: 1%; |
| 265 | + border:1rpx solid rgb(214, 214, 214); | |
| 266 | + border-radius: 25rpx; | |
| 267 | + margin-top: 10rpx; | |
| 265 | 268 | } |
| 266 | 269 | |
| 267 | 270 | .zs_goods_2l { | ... | ... |
components/diy_pingd_buy/diy_pingd_buy.wxml
| 1 | 1 | <!--pages/wp/wp.wxml--> |
| 2 | 2 | <block wx:if="goods_array.length>0"> |
| 3 | - <!--拼单--> | |
| 4 | - <view class='top_p'> | |
| 5 | - <view class='t_left_p'></view> | |
| 6 | - <view class='t_ms_p'>拼单</view> | |
| 7 | - <view class='right_p' bindtap="go_to_pindlist"> | |
| 8 | - <image src="{{iurl}}/miniapp/images/icon-arrowdown.png"></image> | |
| 9 | - </view> | |
| 3 | + <!--拼单--> | |
| 4 | + <view class='top_p' bindtap="go_to_pindlist"> | |
| 5 | + <view class="top"> | |
| 6 | + <view class='t_left_p'></view> | |
| 7 | + <view class='t_ms_p'>拼单</view> | |
| 10 | 8 | </view> |
| 11 | - <!--商品展示--> | |
| 12 | - <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.style==1}}"> | |
| 13 | - <view class='sp_p' wx:if="{{object.style==1}}"> | |
| 14 | - <swiper-item class="s_it" wx:for="{{goods_array}}" > | |
| 15 | - <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" > | |
| 16 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> | |
| 17 | - <view class='one_p'> | |
| 18 | - <view class='sp_top_p'> | |
| 19 | - | |
| 20 | - <block wx:if="{{aitem.start_time>newTime}}"> | |
| 21 | - <span class='s_top_p' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> | |
| 22 | - </block> | |
| 23 | - <block wx:if="{{aitem.start_time<newTime}}"> | |
| 24 | - <span class='s_top_p'>火热进行</span> | |
| 25 | - </block> | |
| 26 | - | |
| 27 | - <!-- <span class='s_top_p'>火热进行</span> --> | |
| 28 | - | |
| 29 | - <view class='s_img_p'> | |
| 30 | - <image src="{{iurl+aitem.original_img}}" | |
| 31 | - data-errorimg="goods_array[{{index}}][{{aind}}].original_img" | |
| 32 | - binderror="bind_bnerr3"></image> | |
| 33 | - </view> | |
| 9 | + <view class='right_p'> | |
| 10 | + <image src="{{iurl}}/miniapp/images/icon-arrowdown.png" lazy-load="true"></image> | |
| 11 | + </view> | |
| 12 | + </view> | |
| 13 | + <!--商品展示--> | |
| 14 | + <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.style==1}}"> | |
| 15 | + <view class='sp_p' wx:if="{{object.style==1}}"> | |
| 16 | + <swiper-item class="s_it" wx:for="{{goods_array}}"> | |
| 17 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
| 18 | + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> | |
| 19 | + <view class='one_p'> | |
| 20 | + <view class='sp_top_p'> | |
| 34 | 21 | |
| 35 | - <!--<view class='s_foot_p'>--> | |
| 36 | - <!--<text>{{aitem.djs.hou}}天</text>--> | |
| 37 | - <!--<text>{{aitem.djs.hou}}时</text>--> | |
| 38 | - <!--<text>{{aitem.djs.min}}分</text>--> | |
| 39 | - <!--<text>{{aitem.djs.sec}}秒</text>--> | |
| 40 | - <!--</view>--> | |
| 22 | + <block wx:if="{{aitem.start_time>newTime}}"> | |
| 23 | + <span class='s_top_p' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> | |
| 24 | + </block> | |
| 25 | + <block wx:if="{{aitem.start_time<newTime}}"> | |
| 26 | + <span class='s_top_p'>火热进行</span> | |
| 27 | + </block> | |
| 41 | 28 | |
| 42 | - <view class='sp_sj_p' wx:if="{{aitem.kttype==1}}">商家</view> | |
| 43 | - <view class='sp_sj_p' wx:if="{{aitem.kttype==2}}">会员</view> | |
| 44 | - <view class='sp_sj_p' wx:if="{{aitem.kttype==3}}">阶梯</view> | |
| 45 | - </view> | |
| 29 | + <!-- <span class='s_top_p'>火热进行</span> --> | |
| 46 | 30 | |
| 47 | - <view class='sp_wz_p'> | |
| 48 | - <view class='sp_wzi_p'>{{aitem.goods_name}}</view> | |
| 49 | - <view class='sp_jg_p'>¥{{aitem.price}}</view> | |
| 50 | - <!--<view class='sp_jgx_p'>¥{{aitem.market_price}}</view>--> | |
| 31 | + <view class='s_img_p'> | |
| 32 | + <image src="{{iurl+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
| 33 | + </view> | |
| 51 | 34 | |
| 52 | - <view class="tuan_set_num"> | |
| 53 | - <view class="co-red2">{{aitem.ct_num}}人团</view> | |
| 35 | + <!--<view class='s_foot_p'>--> | |
| 36 | + <!--<text>{{aitem.djs.hou}}天</text>--> | |
| 37 | + <!--<text>{{aitem.djs.hou}}时</text>--> | |
| 38 | + <!--<text>{{aitem.djs.min}}分</text>--> | |
| 39 | + <!--<text>{{aitem.djs.sec}}秒</text>--> | |
| 40 | + <!--</view>--> | |
| 54 | 41 | |
| 55 | - <view wx:if="{{aitem.kttype==1 && aitem.goods_num>aitem.buy_num }}" class="cantuan">去参团</view> | |
| 56 | - <view wx:if="{{aitem.kttype==2 && aitem.goods_num>aitem.buy_num }}" class="cantuan">去开团</view> | |
| 57 | - <view wx:if="{{aitem.kttype==3 && aitem.goods_num>aitem.buy_num }}" class="cantuan">去开团</view> | |
| 58 | - <view wx:if="{{aitem.goods_num<=aitem.buy_num }}" class="cantuan huise">已抢光</view> | |
| 59 | - </view> | |
| 60 | - </view> | |
| 61 | - </view> | |
| 62 | - </navigator> | |
| 63 | - </block> | |
| 64 | - </swiper-item> | |
| 42 | + <view class='sp_sj_p' wx:if="{{aitem.kttype==1}}">商家</view> | |
| 43 | + <view class='sp_sj_p' wx:if="{{aitem.kttype==2}}">会员</view> | |
| 44 | + <view class='sp_sj_p' wx:if="{{aitem.kttype==3}}">阶梯</view> | |
| 45 | + </view> | |
| 65 | 46 | |
| 66 | - </view> | |
| 67 | - </swiper> | |
| 68 | - <view class="sp2_p" wx:if="{{object.style==2}}"> | |
| 69 | - <block wx:for="{{goods_array}}" > | |
| 70 | - <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" > | |
| 71 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> | |
| 72 | - <view class='one1_p'> | |
| 73 | - <block> | |
| 74 | - <view class="o1_img_p"> | |
| 75 | - <image src="{{iurl+aitem.original_img}}" | |
| 76 | - data-errorimg="goods_array[{{index}}][{{aind}}].original_img" | |
| 77 | - binderror="bind_bnerr3"></image> | |
| 78 | - <view class='sp_sj1_p' wx:if="{{aitem.kttype==1}}">商家</view> | |
| 79 | - <view class='sp_sj1_p' wx:if="{{aitem.kttype==2}}">会员</view> | |
| 80 | - <view class='sp_sj1_p' wx:if="{{aitem.kttype==3}}">阶梯</view> | |
| 81 | - </view> | |
| 82 | - </block> | |
| 47 | + <view class='sp_wz_p'> | |
| 48 | + <view class='sp_wzi_p'>{{aitem.goods_name}}</view> | |
| 49 | + <view class='sp_jg_p'>¥{{aitem.price}}</view> | |
| 50 | + <!--<view class='sp_jgx_p'>¥{{aitem.market_price}}</view>--> | |
| 83 | 51 | |
| 84 | - <view class="o1_right_p"> | |
| 52 | + <view class="tuan_set_num"> | |
| 53 | + <view class="co-red2">{{aitem.ct_num}}人团</view> | |
| 85 | 54 | |
| 86 | - <view class="sp_wzi_p">{{aitem.title}}</view> | |
| 87 | - <view class="co-red2"> | |
| 88 | - <text class="yituan_num">已团{{aitem.buy_num}}件</text> | |
| 89 | - {{aitem.ct_num}}人团 | |
| 90 | - </view> | |
| 91 | - <view class='sp_jg_p'>¥{{aitem.price}}</view> | |
| 92 | - <view class='sp_jgx_p'>¥{{aitem.market_price}}</view> | |
| 93 | - | |
| 94 | - <view class="o1_sj_p"> | |
| 95 | - <image class="time_img" src="/public/static/images/model/time.png"></image><block wx:if="aitem.djs.day>0">{{aitem.djs.day}}天</block>{{aitem.djs.hou}}时{{aitem.djs.min}}分{{aitem.djs.sec}}秒 | |
| 96 | - </view> | |
| 97 | - | |
| 98 | - <view wx:if="{{aitem.kttype==1 && aitem.goods_num>aitem.buy_num }}" class="wo_p">去参团</view> | |
| 99 | - <view wx:if="{{aitem.kttype==2 && aitem.goods_num>aitem.buy_num }}" class="wo_p">去开团</view> | |
| 100 | - <view wx:if="{{aitem.kttype==3 && aitem.goods_num>aitem.buy_num }}" class="wo_p">去参团</view> | |
| 101 | - <view wx:if="{{aitem.goods_num<=aitem.buy_num }}" class="wo_p huise">已抢光</view> | |
| 102 | - | |
| 103 | - </view> | |
| 104 | - </view> | |
| 105 | - </navigator> | |
| 106 | - </block> | |
| 55 | + <view wx:if="{{aitem.kttype==1 && aitem.goods_num>aitem.buy_num }}" class="cantuan">去参团</view> | |
| 56 | + <view wx:if="{{aitem.kttype==2 && aitem.goods_num>aitem.buy_num }}" class="cantuan">去开团</view> | |
| 57 | + <view wx:if="{{aitem.kttype==3 && aitem.goods_num>aitem.buy_num }}" class="cantuan">去开团</view> | |
| 58 | + <view wx:if="{{aitem.goods_num<=aitem.buy_num }}" class="cantuan huise">已抢光</view> | |
| 59 | + </view> | |
| 60 | + </view> | |
| 61 | + </view> | |
| 62 | + </navigator> | |
| 107 | 63 | </block> |
| 64 | + </swiper-item> | |
| 65 | + | |
| 108 | 66 | </view> |
| 67 | + </swiper> | |
| 68 | + <view class="sp2_p" wx:if="{{object.style==2}}"> | |
| 69 | + <block wx:for="{{goods_array}}"> | |
| 70 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
| 71 | + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> | |
| 72 | + <view class='one1_p'> | |
| 73 | + <block> | |
| 74 | + <view class="o1_img_p"> | |
| 75 | + <image src="{{iurl+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
| 76 | + <view class='sp_sj1_p' wx:if="{{aitem.kttype==1}}">商家</view> | |
| 77 | + <view class='sp_sj1_p' wx:if="{{aitem.kttype==2}}">会员</view> | |
| 78 | + <view class='sp_sj1_p' wx:if="{{aitem.kttype==3}}">阶梯</view> | |
| 79 | + </view> | |
| 80 | + </block> | |
| 81 | + | |
| 82 | + <view class="o1_right_p"> | |
| 83 | + | |
| 84 | + <view class="sp_wzi_p">{{aitem.title}}</view> | |
| 85 | + <view class="co-red2"> | |
| 86 | + <text class="yituan_num">已团{{aitem.buy_num}}件</text> {{aitem.ct_num}}人团 | |
| 87 | + </view> | |
| 88 | + <view class="money"> | |
| 89 | + <view class='sp_jg_p'>¥{{aitem.price}}</view> | |
| 90 | + <view class='sp_jgx_p'>¥{{aitem.market_price}}</view> | |
| 91 | + </view> | |
| 92 | + <view class="o1_sj_p"> | |
| 93 | + <image class="time_img" src="/public/static/images/model/time.png"></image> | |
| 94 | + <block wx:if="aitem.djs.day>0">{{aitem.djs.day}}天</block>{{aitem.djs.hou}}时{{aitem.djs.min}}分{{aitem.djs.sec}}秒 | |
| 95 | + </view> | |
| 96 | + | |
| 97 | + <view wx:if="{{aitem.kttype==1 && aitem.goods_num>aitem.buy_num }}" class="wo_p">去参团</view> | |
| 98 | + <view wx:if="{{aitem.kttype==2 && aitem.goods_num>aitem.buy_num }}" class="wo_p">去开团</view> | |
| 99 | + <view wx:if="{{aitem.kttype==3 && aitem.goods_num>aitem.buy_num }}" class="wo_p">去参团</view> | |
| 100 | + <view wx:if="{{aitem.goods_num<=aitem.buy_num }}" class="wo_p huise">已抢光</view> | |
| 101 | + | |
| 102 | + </view> | |
| 103 | + </view> | |
| 104 | + </navigator> | |
| 105 | + </block> | |
| 106 | + </block> | |
| 107 | + </view> | |
| 109 | 108 | |
| 110 | 109 | </block> |
| 111 | 110 | \ No newline at end of file | ... | ... |
components/diy_pingd_buy/diy_pingd_buy.wxss
| 1 | 1 | /* pages/wp/wp.wxss */ |
| 2 | - | |
| 2 | +.top{ | |
| 3 | + display: flex; | |
| 4 | + align-items: center; | |
| 5 | + font-size: 32rpx; | |
| 6 | +} | |
| 3 | 7 | .top_p { |
| 4 | - width: 100%; | |
| 8 | + padding:0rpx 20rpx; | |
| 5 | 9 | background-color: white; |
| 6 | 10 | height: 70rpx; |
| 7 | 11 | line-height: 70rpx; |
| ... | ... | @@ -9,12 +13,12 @@ |
| 9 | 13 | text-align: left; |
| 10 | 14 | border-bottom: 2rpx solid #eee; |
| 11 | 15 | display: flex; |
| 16 | + justify-content: space-between; | |
| 17 | + align-items: center; | |
| 12 | 18 | } |
| 13 | 19 | |
| 14 | 20 | .right_p { |
| 15 | 21 | width: 30rpx; |
| 16 | - height: 100%; | |
| 17 | - margin-left: 580rpx; | |
| 18 | 22 | } |
| 19 | 23 | |
| 20 | 24 | .right_p image { |
| ... | ... | @@ -26,9 +30,7 @@ |
| 26 | 30 | width: 10rpx; |
| 27 | 31 | height: 38rpx; |
| 28 | 32 | background: #c4182e; |
| 29 | - margin-top: 18rpx; | |
| 30 | 33 | margin-right: 12rpx; |
| 31 | - margin-left: 20rpx; | |
| 32 | 34 | } |
| 33 | 35 | |
| 34 | 36 | .sp_p { |
| ... | ... | @@ -42,7 +44,7 @@ |
| 42 | 44 | .sp_p .sp_top_p { |
| 43 | 45 | height: 220rpx; |
| 44 | 46 | min-width: 30%; |
| 45 | - position: relative; | |
| 47 | + position: relative; | |
| 46 | 48 | } |
| 47 | 49 | |
| 48 | 50 | .sp_p .sp_top_p .s_img_p { |
| ... | ... | @@ -206,38 +208,41 @@ swiper { |
| 206 | 208 | } |
| 207 | 209 | |
| 208 | 210 | .sp2_p .one1_p { |
| 209 | - width: 100%; | |
| 210 | 211 | background-color: white; |
| 211 | 212 | height: 252rpx; |
| 212 | 213 | display: flex; |
| 213 | 214 | padding: 20rpx; |
| 214 | 215 | border-bottom: 6rpx#eee solid; |
| 216 | + align-items: center; | |
| 215 | 217 | } |
| 216 | 218 | |
| 217 | 219 | .sp2_p .one1_p .o1_img_p { |
| 218 | - width: 200rpx; | |
| 219 | - height: 240rpx; | |
| 220 | - margin-right: 24rpx; | |
| 220 | + width: 220rpx; | |
| 221 | + height: 220rpx; | |
| 222 | + margin-right: 25rpx; | |
| 221 | 223 | } |
| 222 | 224 | |
| 223 | -.o1_right_p{position: relative; width: 485rpx;} | |
| 225 | +.o1_right_p { | |
| 226 | + position: relative; | |
| 227 | + width: 465rpx; | |
| 228 | +} | |
| 224 | 229 | |
| 225 | 230 | .o1_right_p .sp_wzi_p { |
| 226 | - font-size: 36rpx; | |
| 231 | + font-size: 30rpx; | |
| 227 | 232 | margin-bottom: 6rpx; |
| 228 | 233 | width: 100%; |
| 229 | 234 | text-align: left; |
| 230 | 235 | padding: 4rpx 0; |
| 231 | - overflow: hidden; | |
| 232 | 236 | height: 48rpx; |
| 237 | + overflow: hidden; | |
| 238 | + white-space: nowrap; | |
| 233 | 239 | text-overflow: ellipsis; |
| 234 | 240 | } |
| 235 | 241 | |
| 236 | 242 | .o1_right_p .o1_sj_p { |
| 237 | 243 | height: 60rpx; |
| 238 | - margin-bottom: 10rpx; | |
| 239 | - font-size: 28rpx; | |
| 240 | - line-height: 40rpx; | |
| 244 | + font-size: 26rpx; | |
| 245 | + line-height: 40rpx; | |
| 241 | 246 | } |
| 242 | 247 | |
| 243 | 248 | .o1_right_p .o1_sj_p text { |
| ... | ... | @@ -250,7 +255,7 @@ swiper { |
| 250 | 255 | |
| 251 | 256 | .o1_right_p .sp_jg_p { |
| 252 | 257 | color: #c4182e; |
| 253 | - font-size: 36rpx; | |
| 258 | + font-size: 30rpx; | |
| 254 | 259 | overflow: hidden; |
| 255 | 260 | display: inline-block; |
| 256 | 261 | margin-right: 10rpx; |
| ... | ... | @@ -269,22 +274,20 @@ swiper { |
| 269 | 274 | height: 100%; |
| 270 | 275 | background-color: blueviolet; |
| 271 | 276 | position: relative; |
| 272 | - top: -8rpx; | |
| 273 | - left: 0rpx; | |
| 274 | 277 | } |
| 275 | 278 | |
| 276 | 279 | .o1_right_p .wo_p { |
| 277 | 280 | background-color: #c4182e; |
| 278 | - width: 160rpx; | |
| 279 | - height: 60rpx; | |
| 280 | - line-height: 60rpx; | |
| 281 | + width: 150rpx; | |
| 282 | + height: 55rpx; | |
| 283 | + line-height: 55rpx; | |
| 281 | 284 | color: white; |
| 282 | 285 | text-align: center; |
| 283 | - font-size: 26rpx; | |
| 286 | + font-size: 30rpx; | |
| 284 | 287 | border-radius: 14rpx; |
| 285 | - position: absolute; | |
| 286 | - right: 0; | |
| 287 | - bottom:46rpx; | |
| 288 | + position: absolute; | |
| 289 | + right: 0; | |
| 290 | + bottom: 46rpx; | |
| 288 | 291 | } |
| 289 | 292 | |
| 290 | 293 | .sp_sj_p { |
| ... | ... | @@ -295,12 +298,11 @@ swiper { |
| 295 | 298 | position: absolute; |
| 296 | 299 | bottom: 300rpx; |
| 297 | 300 | right: 0rpx; |
| 298 | - top: 0; | |
| 301 | + top: 0; | |
| 299 | 302 | width: 60rpx; |
| 300 | 303 | height: 60rpx; |
| 301 | 304 | text-align: center; |
| 302 | 305 | line-height: 60rpx; |
| 303 | - | |
| 304 | 306 | } |
| 305 | 307 | |
| 306 | 308 | .sp_sj1_p { |
| ... | ... | @@ -315,20 +317,49 @@ swiper { |
| 315 | 317 | text-align: center; |
| 316 | 318 | line-height: 60rpx; |
| 317 | 319 | } |
| 318 | -.tuan_set_num{ | |
| 319 | - display: flex;justify-content: space-between; font-size: 28rpx; | |
| 320 | + | |
| 321 | +.tuan_set_num { | |
| 322 | + display: flex; | |
| 323 | + justify-content: space-between; | |
| 324 | + font-size: 28rpx; | |
| 320 | 325 | } |
| 321 | 326 | |
| 322 | -.tuan_set_num .co-red2{ | |
| 323 | - color: #B2AEA8;font-size: 26rpx; | |
| 327 | +.tuan_set_num .co-red2 { | |
| 328 | + color: #b2aea8; | |
| 329 | + font-size: 26rpx; | |
| 324 | 330 | } |
| 325 | -.tuan_set_num .cantuan{ | |
| 326 | - background:#c4182e; color: #fff; padding: 4rpx 10rpx; border-radius:5rpx ; | |
| 331 | + | |
| 332 | +.tuan_set_num .cantuan { | |
| 333 | + background: #c4182e; | |
| 334 | + color: #fff; | |
| 335 | + padding: 4rpx 10rpx; | |
| 336 | + border-radius: 5rpx; | |
| 327 | 337 | } |
| 328 | -.tuan_set_num .cantuan.huise{ | |
| 329 | - background:gainsboro; color: #666; | |
| 338 | + | |
| 339 | +.tuan_set_num .cantuan.huise { | |
| 340 | + background: gainsboro; | |
| 341 | + color: #666; | |
| 330 | 342 | } |
| 331 | 343 | |
| 332 | -.o1_sj_p .time_img{width: 40rpx; height: 40rpx; vertical-align: top; margin-right: 10rpx;} | |
| 333 | -.o1_right_p .co-red2{font-size:30rpx; color: #999;} | |
| 334 | -.o1_right_p .co-red2 .yituan_num{font-size:30rpx; margin-right: 10rpx; color: #333;} | |
| 344 | +.o1_sj_p .time_img { | |
| 345 | + width: 35rpx; | |
| 346 | + height: 35rpx; | |
| 347 | + vertical-align: top; | |
| 348 | + margin-right: 10rpx; | |
| 349 | +} | |
| 350 | + | |
| 351 | +.o1_right_p .co-red2 { | |
| 352 | + font-size: 26rpx; | |
| 353 | + color: #999; | |
| 354 | +} | |
| 355 | + | |
| 356 | +.o1_right_p .co-red2 .yituan_num { | |
| 357 | + font-size: 26rpx; | |
| 358 | + margin-right: 10rpx; | |
| 359 | + color: #333; | |
| 360 | +} | |
| 361 | +.money{ | |
| 362 | + display: flex; | |
| 363 | + align-items: center; | |
| 364 | + margin:5rpx 0rpx; | |
| 365 | +} | |
| 335 | 366 | \ No newline at end of file | ... | ... |
components/diy_seckill/diy_seckill.wxml
| 1 | 1 | <block wx:if="goods_array.length>0"> |
| 2 | - <!--秒杀--> | |
| 3 | - <view class='top'> | |
| 4 | - <view class='t_left'></view> | |
| 5 | - <view class='t_ms'>秒杀</view> | |
| 6 | - <view class='right_k' bindtap="go_to_skill"> | |
| 7 | - <image src="{{imghost}}/miniapp/images/icon-arrowdown.png"></image> | |
| 8 | - </view> | |
| 2 | + <!--秒杀--> | |
| 3 | + <view class='top' bindtap="go_to_skill"> | |
| 4 | + <view class="flex"> | |
| 5 | + <view class='t_left'></view> | |
| 6 | + <view class='t_ms'>秒杀</view> | |
| 9 | 7 | </view> |
| 8 | + <view class='right_k'> | |
| 9 | + <image src="{{imghost}}/miniapp/images/icon-arrowdown.png" lazy-load="true"></image> | |
| 10 | + </view> | |
| 11 | + </view> | |
| 10 | 12 | |
| 11 | - <!--商品展示--> | |
| 12 | - <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.style==1}}"> | |
| 13 | - <view class='sp' wx:if="{{object.style==1}}"> | |
| 14 | - <swiper-item class="s_it" wx:for="{{goods_array}}" > | |
| 15 | - <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
| 16 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> | |
| 17 | - <view class='one'> | |
| 18 | - <view class='sp_top'> | |
| 19 | - <view class='po'></view> | |
| 20 | - <block wx:if="{{aitem.start_time>newTime}}"> | |
| 21 | - <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> | |
| 22 | - </block> | |
| 23 | - <block wx:if="{{aitem.start_time<newTime}}"> | |
| 24 | - <span class='s_top_kill'>火热进行</span> | |
| 25 | - </block> | |
| 26 | - <view class='clear'></view> | |
| 27 | - | |
| 28 | - <view class='s_img'> | |
| 29 | - <image src="{{imghost+aitem.original_img}}" | |
| 30 | - data-errorimg="goods_array[{{index}}][{{aind}}].original_img" | |
| 31 | - binderror="bind_bnerr3"></image> | |
| 32 | - </view> | |
| 33 | - | |
| 34 | - <view class='s_foot_kill'> | |
| 35 | - <text>{{aitem.djs.day}}天</text> | |
| 36 | - <text>{{aitem.djs.hou}}时</text> | |
| 37 | - <text>{{aitem.djs.min}}分</text> | |
| 38 | - <text>{{aitem.djs.sec}}秒</text> | |
| 39 | - </view> | |
| 40 | - <view class='clear'></view> | |
| 41 | - | |
| 42 | - </view> | |
| 43 | - | |
| 44 | - <view class='sp_wz'> | |
| 45 | - <view class='sp_wzi'>{{aitem.goods_name}}</view> | |
| 46 | - <view class='sp_jg'>¥{{aitem.price}}</view> | |
| 47 | - <view class='sp_jgx'>¥{{aitem.market_price}}</view> | |
| 48 | - </view> | |
| 49 | - | |
| 50 | - </view> | |
| 51 | - </navigator> | |
| 13 | + <!--商品展示--> | |
| 14 | + <swiper class="s_prom" indicator-active-color='red' indicator-dots="false" wx:if="{{object.style==1}}"> | |
| 15 | + <view class='sp' wx:if="{{object.style==1}}"> | |
| 16 | + <swiper-item class="s_it" wx:for="{{goods_array}}"> | |
| 17 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
| 18 | + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> | |
| 19 | + <view class='one'> | |
| 20 | + <view class='sp_top'> | |
| 21 | + <view class='po'></view> | |
| 22 | + <block wx:if="{{aitem.start_time>newTime}}"> | |
| 23 | + <view class="rob"> | |
| 24 | + <span class='s_top_kill' style="background-color: #ffe718;color: #3c3b31;font-weight: bold">即将开始</span> | |
| 25 | + </view> | |
| 52 | 26 | </block> |
| 53 | - </swiper-item> | |
| 54 | - </view> | |
| 55 | - </swiper> | |
| 56 | - | |
| 57 | - <view class="sp2" wx:if="{{object.style==2}}"> | |
| 58 | - <block wx:for="{{goods_array}}" > | |
| 59 | - <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind" > | |
| 60 | - <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> | |
| 61 | - <view class='one1'> | |
| 62 | - | |
| 63 | - <view class="o1_img"> | |
| 64 | - <image src="{{imghost+aitem.original_img}}" | |
| 65 | - data-errorimg="goods_array[{{index}}][{{aind}}].original_img" | |
| 66 | - binderror="bind_bnerr3"></image> | |
| 67 | - </view> | |
| 68 | - | |
| 69 | - <view class="o1_right"> | |
| 70 | - <view class="sp_wzi">{{aitem.goods_name}}</view> | |
| 71 | - <view class="o1_sj_kill"> | |
| 72 | - <text>{{aitem.djs.day}}</text> | |
| 73 | - 天 | |
| 74 | - <text>{{aitem.djs.hou}}</text> | |
| 75 | - : | |
| 76 | - <text>{{aitem.djs.min}}</text> | |
| 77 | - : | |
| 78 | - <text>{{aitem.djs.sec}}</text> | |
| 79 | - | |
| 80 | - </view> | |
| 81 | - <view class='sp_jg'>¥{{aitem.price}}</view> | |
| 82 | - <view class='sp_jgx'>¥{{aitem.market_price}}</view> | |
| 83 | - <block wx:if="{{aitem.start_time>newTime}}"> | |
| 84 | - <view class="wo" style="background-color: #adadad">正在预热</view> | |
| 85 | - </block> | |
| 86 | - <block wx:if="{{aitem.start_time<newTime}}"> | |
| 87 | - <view class="wo">我要抢</view> | |
| 88 | - </block> | |
| 89 | - | |
| 90 | - | |
| 91 | - </view> | |
| 92 | - </view> | |
| 93 | - </navigator> | |
| 94 | - </block> | |
| 95 | - </block> | |
| 27 | + <block wx:if="{{aitem.start_time<newTime && aitem.goods_num>aitem.buy_num}}"> | |
| 28 | + <view class="rob"> | |
| 29 | + <span class='s_top_kill'>火热进行</span> | |
| 30 | + </view> | |
| 31 | + </block> | |
| 32 | + <block wx:if="{{aitem.goods_num<=aitem.buy_num}}"> | |
| 33 | + <view class="rob"> | |
| 34 | + <span class='s_top_kill gray'>已抢光</span> | |
| 35 | + </view> | |
| 36 | + </block> | |
| 37 | + | |
| 38 | + <view class='clear'></view> | |
| 39 | + | |
| 40 | + <view class='s_img'> | |
| 41 | + <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
| 42 | + </view> | |
| 43 | + | |
| 44 | + <view class='s_foot_kill'> | |
| 45 | + <text>{{aitem.djs.day}}天</text> | |
| 46 | + <text>{{aitem.djs.hou}}时</text> | |
| 47 | + <text>{{aitem.djs.min}}分</text> | |
| 48 | + <text>{{aitem.djs.sec}}秒</text> | |
| 49 | + </view> | |
| 50 | + <view class='clear'></view> | |
| 51 | + | |
| 52 | + </view> | |
| 53 | + | |
| 54 | + <view class='sp_wz'> | |
| 55 | + <view class='sp_wzi'>{{aitem.goods_name}}</view> | |
| 56 | + <view class='sp_jg'>¥{{aitem.price}}</view> | |
| 57 | + <view class='sp_jgx'>¥{{aitem.market_price}}</view> | |
| 58 | + </view> | |
| 96 | 59 | |
| 60 | + </view> | |
| 61 | + </navigator> | |
| 62 | + </block> | |
| 63 | + </swiper-item> | |
| 97 | 64 | </view> |
| 98 | - <view class='clear'></view> | |
| 65 | + </swiper> | |
| 66 | + | |
| 67 | + <view class="sp2" wx:if="{{object.style==2}}"> | |
| 68 | + <block wx:for="{{goods_array}}"> | |
| 69 | + <block wx:for="{{item}}" wx:for-item="aitem" wx:for-index="aind"> | |
| 70 | + <navigator url="/pages/goods/goodsInfo/goodsInfo?goods_id={{aitem.goods_id}}" class="s1_gk_a1"> | |
| 71 | + <view class='one1'> | |
| 72 | + | |
| 73 | + <view class="o1_img"> | |
| 74 | + <image src="{{imghost+aitem.original_img}}" data-errorimg="goods_array[{{index}}][{{aind}}].original_img" binderror="bind_bnerr3"></image> | |
| 75 | + </view> | |
| 76 | + | |
| 77 | + <view class="o1_right"> | |
| 78 | + <view class="sp_wzi">{{aitem.goods_name}}</view> | |
| 79 | + <view class="o1_sj_kill"> | |
| 80 | + <text>{{aitem.djs.day}}</text> 天 | |
| 81 | + <text>{{aitem.djs.hou}}</text> : | |
| 82 | + <text>{{aitem.djs.min}}</text> : | |
| 83 | + <text>{{aitem.djs.sec}}</text> | |
| 84 | + | |
| 85 | + </view> | |
| 86 | + <view class="money"> | |
| 87 | + <view class='sp_jg'>¥{{aitem.price}}</view> | |
| 88 | + <view class='sp_jgx'>¥{{aitem.market_price}}</view> | |
| 89 | + </view> | |
| 90 | + <block wx:if="{{aitem.start_time>newTime}}"> | |
| 91 | + <view class="rob"> | |
| 92 | + <view class="wo" style="background-color: #adadad">正在预热</view> | |
| 93 | + </view> | |
| 94 | + </block> | |
| 95 | + <block wx:if="{{aitem.start_time<newTime && aitem.goods_num>aitem.buy_num}}"> | |
| 96 | + <view class="rob"> | |
| 97 | + <view class="wo">我要抢</view> | |
| 98 | + </view> | |
| 99 | + </block> | |
| 100 | + | |
| 101 | + <block wx:if="{{aitem.goods_num<=aitem.buy_num}}"> | |
| 102 | + <view class="rob"> | |
| 103 | + <view class="wo" style="background-color: #adadad">已抢光</view> | |
| 104 | + </view> | |
| 105 | + </block> | |
| 106 | + | |
| 107 | + | |
| 108 | + </view> | |
| 109 | + </view> | |
| 110 | + </navigator> | |
| 111 | + </block> | |
| 112 | + </block> | |
| 113 | + | |
| 114 | + </view> | |
| 115 | + <view class='clear'></view> | |
| 99 | 116 | |
| 100 | 117 | </block> |
| 101 | 118 | \ No newline at end of file | ... | ... |
components/diy_seckill/diy_seckill.wxss
| 1 | - | |
| 2 | -.top{ | |
| 3 | - width: 100%; | |
| 1 | +.flex{ | |
| 2 | + display: flex; | |
| 3 | + align-items: center; | |
| 4 | +} | |
| 5 | +.top { | |
| 4 | 6 | background-color: white; |
| 5 | 7 | height: 70rpx; |
| 6 | 8 | line-height: 70rpx; |
| 7 | - color: #000; | |
| 8 | - text-align: left; | |
| 9 | - border-bottom: 2rpx solid #eee; | |
| 10 | - display: flex; | |
| 9 | + color: #000; | |
| 10 | + border-bottom: 2rpx solid #eee; | |
| 11 | + padding:0rpx 20rpx; | |
| 12 | + display: flex; | |
| 13 | + justify-content: space-between; | |
| 14 | + font-size: 32rpx; | |
| 11 | 15 | } |
| 12 | 16 | |
| 13 | - | |
| 14 | -.s_it{ | |
| 17 | +.s_it { | |
| 15 | 18 | width: 100%; |
| 16 | 19 | display: flex; |
| 17 | 20 | background-color: white; |
| 18 | 21 | } |
| 19 | 22 | |
| 20 | -.s_prom{ | |
| 23 | +.s_prom { | |
| 21 | 24 | width: 100%; |
| 22 | 25 | background-color: white; |
| 23 | 26 | min-height: 200rpx; |
| 24 | 27 | } |
| 25 | 28 | |
| 26 | 29 | swiper { |
| 27 | - display:block; | |
| 28 | - height:400rpx; | |
| 29 | - | |
| 30 | + display: block; | |
| 31 | + height: 400rpx; | |
| 30 | 32 | } |
| 31 | 33 | |
| 32 | -.right_k{ | |
| 34 | +.right_k { | |
| 33 | 35 | width: 30rpx; |
| 34 | - height: 100%; | |
| 35 | - margin-left: 580rpx; | |
| 36 | 36 | } |
| 37 | -.right_k image{ width: 30rpx; height: 30rpx} | |
| 38 | - | |
| 39 | - | |
| 40 | -.top .t_left{ | |
| 41 | - width: 10rpx; | |
| 42 | - height: 38rpx; | |
| 43 | - background: #C4182E; | |
| 44 | - margin-top:18rpx; | |
| 45 | -margin-right:12rpx; | |
| 46 | -margin-left:20rpx; | |
| 37 | +.right_k image{ | |
| 38 | + width: 30rpx; | |
| 39 | + height: 30rpx; | |
| 40 | +} | |
| 41 | + .t_left { | |
| 42 | + width: 10rpx; | |
| 43 | + height: 38rpx; | |
| 44 | + background: #c4182e; | |
| 45 | + margin-right: 10rpx; | |
| 47 | 46 | } |
| 48 | 47 | |
| 49 | 48 | |
| 50 | -.sp{ | |
| 49 | +.sp { | |
| 51 | 50 | min-height: 300rpx; |
| 52 | 51 | width: 100%; |
| 53 | 52 | background-color: white; |
| 54 | - padding:18rpx; | |
| 55 | -display: flex; | |
| 53 | + padding: 18rpx; | |
| 54 | + display: flex; | |
| 56 | 55 | } |
| 57 | 56 | |
| 58 | -.sp .sp_top{ | |
| 57 | +.sp .sp_top { | |
| 59 | 58 | height: 220rpx; |
| 60 | 59 | min-width: 30%; |
| 61 | - | |
| 62 | - | |
| 63 | 60 | } |
| 64 | 61 | |
| 65 | -.sp .sp_top .s_img{ | |
| 62 | +.sp .sp_top .s_img { | |
| 66 | 63 | width: 210rpx; |
| 67 | 64 | height: 100%; |
| 68 | 65 | } |
| 69 | 66 | |
| 70 | -.sp .sp_top .s_img image{ | |
| 67 | +.sp .sp_top .s_img image { | |
| 71 | 68 | width: 210rpx; |
| 72 | 69 | height: 100%; |
| 73 | - | |
| 74 | 70 | position: relative; |
| 75 | 71 | top: -74rpx; |
| 76 | - left:0rpx; | |
| 77 | - | |
| 72 | + left: 0rpx; | |
| 78 | 73 | } |
| 79 | 74 | |
| 80 | -.sp .sp_top .s_top_kill | |
| 81 | - | |
| 82 | -{ | |
| 83 | - | |
| 84 | -background-color:#C4182E; | |
| 85 | -font-size:24rpx; | |
| 86 | -height:38rpx; | |
| 87 | -line-height:38rpx; | |
| 88 | -left:6rpx; | |
| 89 | - | |
| 90 | -padding:4rpx 10rpx; | |
| 91 | - | |
| 92 | -border-radius:10rpx; | |
| 93 | - | |
| 94 | - | |
| 95 | -z-index: 999; | |
| 75 | +.sp .sp_top .s_top_kill { | |
| 76 | + background-color: #c4182e; | |
| 77 | + font-size: 24rpx; | |
| 78 | + height: 38rpx; | |
| 79 | + line-height: 38rpx; | |
| 80 | + left: 6rpx; | |
| 81 | + padding: 4rpx 10rpx; | |
| 82 | + border-radius: 10rpx; | |
| 83 | + z-index: 999; | |
| 96 | 84 | position: relative; |
| 97 | - top:-6rpx; | |
| 98 | - width: 210rpx; | |
| 99 | - | |
| 100 | - | |
| 101 | - color: #fff; | |
| 102 | - text-align: center; | |
| 103 | - | |
| 104 | - | |
| 85 | + top: -6rpx; | |
| 86 | + width: 210rpx; | |
| 87 | + color: #fff; | |
| 88 | + text-align: center; | |
| 105 | 89 | } |
| 106 | 90 | |
| 107 | -.po{ | |
| 91 | +.po { | |
| 108 | 92 | position: absolute; |
| 109 | 93 | } |
| 110 | 94 | |
| 111 | -.sp .sp_top .s_foot_kill{ | |
| 95 | +.sp .sp_top .s_foot_kill { | |
| 112 | 96 | font-size: 20rpx; |
| 113 | 97 | position: relative; |
| 114 | - top:-90rpx; | |
| 115 | - width: 210rpx; | |
| 116 | - height: 38rpx; | |
| 117 | - line-height: 38rpx; | |
| 118 | - color: #fff; | |
| 119 | - text-align: center; | |
| 120 | - background-color: rgba(0, 0, 0, 0.5); | |
| 98 | + top: -90rpx; | |
| 99 | + width: 210rpx; | |
| 100 | + height: 38rpx; | |
| 101 | + line-height: 38rpx; | |
| 102 | + color: #fff; | |
| 103 | + text-align: center; | |
| 104 | + background-color: rgba(0, 0, 0, 0.5); | |
| 121 | 105 | } |
| 122 | 106 | |
| 123 | - | |
| 124 | - | |
| 125 | -.sp_wz{ | |
| 126 | -width: 210rpx; | |
| 127 | - min-height:100rpx; | |
| 128 | - | |
| 107 | +.sp_wz { | |
| 108 | + width: 210rpx; | |
| 109 | + min-height: 100rpx; | |
| 129 | 110 | } |
| 130 | 111 | |
| 131 | -.sp_wz .sp_wzi{ | |
| 132 | - font-size: 30rpx; | |
| 133 | - border-bottom: 2rpx solid #dcdcdc; | |
| 134 | - width: 100%; | |
| 135 | - text-align: left; | |
| 136 | - padding: 4rpx 0; | |
| 137 | - overflow: hidden; | |
| 138 | - height: 48rpx; | |
| 139 | - text-overflow: ellipsis; | |
| 140 | - white-space: nowrap; | |
| 141 | - line-height: 48rpx; | |
| 112 | +.sp_wz .sp_wzi { | |
| 113 | + font-size: 30rpx; | |
| 114 | + border-bottom: 2rpx solid #dcdcdc; | |
| 115 | + width: 100%; | |
| 116 | + text-align: left; | |
| 117 | + padding: 4rpx 0; | |
| 118 | + overflow: hidden; | |
| 119 | + height: 48rpx; | |
| 120 | + text-overflow: ellipsis; | |
| 121 | + white-space: nowrap; | |
| 122 | + line-height: 48rpx; | |
| 142 | 123 | } |
| 143 | 124 | |
| 144 | -.sp_wz .sp_jg{ | |
| 145 | - color: #C4182E; | |
| 146 | - font-size: 30rpx; | |
| 147 | - overflow: hidden; | |
| 148 | - display: inline-block; | |
| 149 | - text-overflow: ellipsis; | |
| 150 | - white-space: nowrap; | |
| 151 | - margin-right: 10rpx; | |
| 125 | +.sp_wz .sp_jg { | |
| 126 | + color: #c4182e; | |
| 127 | + font-size: 30rpx; | |
| 128 | + overflow: hidden; | |
| 129 | + display: inline-block; | |
| 130 | + text-overflow: ellipsis; | |
| 131 | + white-space: nowrap; | |
| 132 | + margin-right: 10rpx; | |
| 152 | 133 | } |
| 153 | 134 | |
| 154 | -.sp_wz .sp_jgx{ | |
| 135 | +.sp_wz .sp_jgx { | |
| 155 | 136 | color: #adadad; |
| 156 | - text-decoration: line-through; | |
| 157 | - font-size: 24rpx; | |
| 158 | - | |
| 159 | - overflow: hidden; | |
| 160 | - display: inline-block; | |
| 161 | - text-overflow: ellipsis; | |
| 162 | - white-space: nowrap; | |
| 163 | - | |
| 137 | + text-decoration: line-through; | |
| 138 | + font-size: 24rpx; | |
| 139 | + overflow: hidden; | |
| 140 | + display: inline-block; | |
| 141 | + text-overflow: ellipsis; | |
| 142 | + white-space: nowrap; | |
| 164 | 143 | } |
| 165 | 144 | |
| 166 | -.one{ | |
| 145 | +.one { | |
| 167 | 146 | margin-left: 14rpx; |
| 168 | - | |
| 169 | 147 | } |
| 170 | 148 | |
| 171 | - | |
| 172 | -.sp .sp_top .s_top1_kill{ | |
| 149 | +.sp .sp_top .s_top1_kill { | |
| 173 | 150 | position: absolute; |
| 174 | -background-color:#C4182E; | |
| 175 | -font-size:24rpx; | |
| 176 | -height:38rpx; | |
| 177 | -line-height:38rpx; | |
| 178 | -left:265rpx; | |
| 179 | -top:100rpx; | |
| 180 | -padding:0 10rpx; | |
| 181 | -color:white; | |
| 182 | -border-radius:10rpx; | |
| 183 | - | |
| 151 | + background-color: #c4182e; | |
| 152 | + font-size: 24rpx; | |
| 153 | + height: 38rpx; | |
| 154 | + line-height: 38rpx; | |
| 155 | + left: 265rpx; | |
| 156 | + top: 100rpx; | |
| 157 | + padding: 0 10rpx; | |
| 158 | + color: white; | |
| 159 | + border-radius: 10rpx; | |
| 184 | 160 | } |
| 185 | 161 | |
| 186 | -.sp .sp_top .s_top2_kill{ | |
| 162 | +.sp .sp_top .s_top2_kill { | |
| 187 | 163 | position: absolute; |
| 188 | -background-color:#C4182E; | |
| 189 | -font-size:24rpx; | |
| 190 | -height:38rpx; | |
| 191 | -line-height:38rpx; | |
| 192 | -right:146rpx; | |
| 193 | -top:100rpx; | |
| 194 | -padding:0 10rpx; | |
| 195 | -color:white; | |
| 196 | -border-radius:10rpx; | |
| 197 | - | |
| 164 | + background-color: #c4182e; | |
| 165 | + font-size: 24rpx; | |
| 166 | + height: 38rpx; | |
| 167 | + line-height: 38rpx; | |
| 168 | + right: 146rpx; | |
| 169 | + top: 100rpx; | |
| 170 | + padding: 0 10rpx; | |
| 171 | + color: white; | |
| 172 | + border-radius: 10rpx; | |
| 198 | 173 | } |
| 199 | 174 | |
| 200 | - | |
| 201 | - | |
| 202 | -.sp .sp_top .s_foot1_kill{ | |
| 175 | +.sp .sp_top .s_foot1_kill { | |
| 203 | 176 | font-size: 20rpx; |
| 204 | 177 | position: absolute; |
| 205 | - top:270rpx; | |
| 206 | - width: 210rpx; | |
| 207 | - height: 38rpx; | |
| 208 | - line-height: 38rpx; | |
| 209 | - color: #fff; | |
| 210 | - text-align: center; | |
| 211 | - background-color: rgba(0, 0, 0, 0.5); | |
| 178 | + top: 270rpx; | |
| 179 | + width: 210rpx; | |
| 180 | + height: 38rpx; | |
| 181 | + line-height: 38rpx; | |
| 182 | + color: #fff; | |
| 183 | + text-align: center; | |
| 184 | + background-color: rgba(0, 0, 0, 0.5); | |
| 212 | 185 | } |
| 213 | 186 | |
| 214 | -.po1{ | |
| 187 | +.po1 { | |
| 215 | 188 | position: absolute; |
| 216 | 189 | } |
| 217 | 190 | |
| 218 | - | |
| 219 | -.sp .sp_top .s_foot2_kill{ | |
| 191 | +.sp .sp_top .s_foot2_kill { | |
| 220 | 192 | font-size: 20rpx; |
| 221 | 193 | position: absolute; |
| 222 | - top:270rpx; | |
| 223 | - width: 210rpx; | |
| 224 | - height: 38rpx; | |
| 225 | - line-height: 38rpx; | |
| 226 | - color: #fff; | |
| 227 | - text-align: center; | |
| 228 | - background-color: rgba(0, 0, 0, 0.5); | |
| 194 | + top: 270rpx; | |
| 195 | + width: 210rpx; | |
| 196 | + height: 38rpx; | |
| 197 | + line-height: 38rpx; | |
| 198 | + color: #fff; | |
| 199 | + text-align: center; | |
| 200 | + background-color: rgba(0, 0, 0, 0.5); | |
| 229 | 201 | } |
| 230 | 202 | |
| 231 | - | |
| 232 | - | |
| 233 | - | |
| 234 | - | |
| 235 | - | |
| 236 | - | |
| 237 | -.sp2{ | |
| 203 | +.sp2 { | |
| 238 | 204 | width: 100%; |
| 239 | 205 | min-height: 240rpx; |
| 240 | - | |
| 241 | 206 | } |
| 242 | 207 | |
| 243 | -.sp2 .one1{ | |
| 244 | - width: 100%; | |
| 208 | +.sp2 .one1 { | |
| 245 | 209 | background-color: white; |
| 246 | - height: 252rpx; | |
| 210 | + height: 285rpx; | |
| 247 | 211 | display: flex; |
| 248 | - padding: 20rpx; | |
| 249 | - border-bottom:6rpx#eee solid; | |
| 250 | - | |
| 212 | + padding:0rpx 20rpx; | |
| 213 | + border-bottom: 6rpx#eee solid; | |
| 214 | + align-items: center; | |
| 251 | 215 | } |
| 252 | 216 | |
| 253 | -.sp2 .one1 .o1_img{ | |
| 254 | - width: 200rpx; | |
| 255 | - height: 240rpx; | |
| 256 | - | |
| 257 | - margin-right: 24rpx; | |
| 217 | +.sp2 .one1 .o1_img { | |
| 218 | + width: 220rpx; | |
| 219 | + height: 220rpx; | |
| 220 | + margin-right: 25rpx; | |
| 258 | 221 | } |
| 259 | 222 | |
| 260 | -.o1_right .sp_wzi{ | |
| 261 | - font-size: 36rpx; | |
| 262 | - margin-bottom:6rpx; | |
| 263 | - | |
| 264 | - width: 100%; | |
| 223 | +.o1_right .sp_wzi { | |
| 224 | + font-size: 30rpx; | |
| 225 | + margin-bottom: 6rpx; | |
| 265 | 226 | text-align: left; |
| 266 | 227 | padding: 4rpx 0; |
| 267 | - overflow: hidden; | |
| 268 | 228 | height: 48rpx; |
| 229 | + overflow: hidden; | |
| 230 | + white-space: nowrap; | |
| 269 | 231 | text-overflow: ellipsis; |
| 270 | - white-space: nowrap | |
| 271 | 232 | } |
| 272 | 233 | |
| 273 | -.o1_right .o1_sj_kill{ | |
| 234 | +.o1_right .o1_sj_kill { | |
| 274 | 235 | height: 60rpx; |
| 275 | - | |
| 276 | 236 | margin-bottom: 10rpx; |
| 237 | + font-size: 28rpx; | |
| 277 | 238 | } |
| 278 | 239 | |
| 279 | -.o1_right .o1_sj_kill text{ | |
| 240 | +.o1_right .o1_sj_kill text { | |
| 280 | 241 | background-color: #fdcb08; |
| 281 | 242 | text-align: center; |
| 282 | 243 | border-radius: 10rpx; |
| 283 | - padding:4rpx; | |
| 284 | -margin-left:6rpx; | |
| 285 | - | |
| 244 | + padding: 4rpx; | |
| 245 | + margin-left: 6rpx; | |
| 286 | 246 | } |
| 287 | 247 | |
| 288 | - | |
| 289 | - | |
| 290 | -.o1_right .sp_jg{ | |
| 291 | - color: #C4182E; | |
| 292 | - font-size: 36rpx; | |
| 293 | - | |
| 248 | +.o1_right .sp_jg { | |
| 249 | + color: #c4182e; | |
| 250 | + font-size: 30rpx; | |
| 294 | 251 | overflow: hidden; |
| 295 | 252 | display: inline-block; |
| 296 | 253 | margin-right: 10rpx; |
| 297 | 254 | } |
| 298 | 255 | |
| 299 | -.o1_right .sp_jgx{ | |
| 256 | +.o1_right .sp_jgx { | |
| 300 | 257 | color: #dcdcdc; |
| 301 | 258 | text-decoration: line-through; |
| 302 | 259 | font-size: 26rpx; |
| 303 | - | |
| 304 | 260 | overflow: hidden; |
| 305 | 261 | display: inline-block; |
| 306 | 262 | } |
| 307 | 263 | |
| 308 | - | |
| 309 | -.o1_img image{ | |
| 310 | - width: 100%; | |
| 311 | - height: 100%; | |
| 312 | - | |
| 313 | - position:relative; | |
| 314 | -top:-23rpx; | |
| 315 | -left:0rpx; | |
| 316 | - | |
| 264 | +.o1_img image { | |
| 265 | + width: 220rpx; | |
| 266 | + height: 220rpx; | |
| 317 | 267 | } |
| 318 | - | |
| 319 | -.o1_right .wo{ | |
| 320 | - background-color: #C4182E; | |
| 321 | - width: 160rpx; | |
| 322 | - height: 60rpx; | |
| 323 | - line-height: 60rpx; | |
| 268 | +.o1_right{ | |
| 269 | + width: 465rpx; | |
| 270 | +} | |
| 271 | +.o1_right .wo { | |
| 272 | + background-color: #c4182e; | |
| 273 | + width: 150rpx; | |
| 274 | + height: 50rpx; | |
| 275 | + line-height: 50rpx; | |
| 324 | 276 | color: white; |
| 325 | 277 | text-align: center; |
| 326 | - font-size: 38rpx; | |
| 327 | - margin-left:298rpx; | |
| 328 | -border-radius:14rpx; | |
| 329 | -padding-left: 10rpx; | |
| 330 | -padding-right: 10rpx; | |
| 278 | + font-size: 30rpx; | |
| 279 | + border-radius: 14rpx; | |
| 280 | +} | |
| 281 | +.rob{ | |
| 282 | + display: flex; | |
| 283 | + justify-content: flex-end; | |
| 284 | + font-size: 30rpx; | |
| 285 | +} | |
| 286 | +.money{ | |
| 287 | + display: flex; | |
| 288 | + align-items: center; | |
| 331 | 289 | } |
| 332 | 290 | |
| 333 | - | |
| 334 | - | |
| 291 | +.sp .sp_top .s_top_kill.gray{background-color:#bdbdc1;color: #fff;font-weight: normal} | |
| 335 | 292 | \ No newline at end of file | ... | ... |
pages/cart/cart2/cart2.js
| ... | ... | @@ -113,11 +113,7 @@ Page({ |
| 113 | 113 | onShow: function() { |
| 114 | 114 | var th=this; |
| 115 | 115 | if (th.data.isclose==0){ |
| 116 | - /*--- | |
| 117 | - wx.navigateTo({ | |
| 118 | - url: "/pages/user/index/index" | |
| 119 | - //url: "/pages/index/index/index" | |
| 120 | - })---*/ | |
| 116 | + | |
| 121 | 117 | wx.switchTab({ |
| 122 | 118 | url: "/pages/index/index/index" |
| 123 | 119 | }) |
| ... | ... | @@ -131,7 +127,7 @@ Page({ |
| 131 | 127 | th.setData({user_addr: ie }); |
| 132 | 128 | var going=0; |
| 133 | 129 | |
| 134 | - //使用计算器,避免空现象 | |
| 130 | + //使用计时器,避免空现象 | |
| 135 | 131 | var jishi= setInterval(function () { |
| 136 | 132 | if (th.data.is_b_now == 1 && going==0) { |
| 137 | 133 | if(th.data.bn_goods) { |
| ... | ... | @@ -243,7 +239,7 @@ Page({ |
| 243 | 239 | data: { |
| 244 | 240 | user_id: to.globalData.user_id, selected:1, |
| 245 | 241 | store_id: oo.stoid, pageSize: 600 }, |
| 246 | - success: async function (su) { | |
| 242 | + success:function (su) { | |
| 247 | 243 | //按门店分类的数组 |
| 248 | 244 | var arr = new Array(); |
| 249 | 245 | var carr = su.data.data.pageData; |
| ... | ... | @@ -305,74 +301,13 @@ Page({ |
| 305 | 301 | arr.push(ie); |
| 306 | 302 | } |
| 307 | 303 | } |
| 308 | - | |
| 309 | - //------------开始计算使用优惠券相关------------ | |
| 310 | - for(var ind in arr){ | |
| 311 | - var ep=arr[ind]; | |
| 312 | - var goodlist=ep.goods; | |
| 313 | - | |
| 314 | - //--更优惠券抵用有关,立即购买的,如果是购物车,如果有等级价还有考虑等级价的东西 | |
| 315 | - //就要把相应的值,写入cartlist数组中-- | |
| 316 | - var ckeck_quan_price=0, | |
| 317 | - check_quan_price_list='', | |
| 318 | - check_quan_ware_list=''; | |
| 319 | - | |
| 320 | - for(var i in goodlist){ | |
| 321 | - var gd=goodlist[i]; | |
| 322 | - //--如果是秒杀就跳出-- | |
| 323 | - if(gd.prom_type==1){ continue; } | |
| 324 | - var item_price=gd.goods_price*gd.goods_num; | |
| 325 | - ckeck_quan_price+=item_price; | |
| 326 | - | |
| 327 | - //--组装价格list-- | |
| 328 | - if (check_quan_price_list) { | |
| 329 | - check_quan_price_list += "," +item_price; | |
| 330 | - } else { | |
| 331 | - check_quan_price_list = item_price; | |
| 332 | - } | |
| 333 | - //--组装商品的线下erpwareid-- | |
| 334 | - if (check_quan_ware_list) { | |
| 335 | - check_quan_ware_list += "," +gd['erpwareid']; | |
| 336 | - } else { | |
| 337 | - check_quan_ware_list = gd['erpwareid']; | |
| 338 | - } | |
| 339 | - } | |
| 340 | - | |
| 341 | - arr[ind].ckeck_quan_price=ckeck_quan_price; | |
| 342 | - arr[ind].check_quan_ware_list=check_quan_ware_list; | |
| 343 | - arr[ind].check_quan_price_list=check_quan_price_list; | |
| 344 | - | |
| 345 | - //是否关闭使用优惠券 | |
| 346 | - if (th.data.is_close_quan != 1) { | |
| 347 | - //调用接口,获取优惠券的列表 | |
| 348 | - var url="/api/weshop/couponList/getUseCouponList"; | |
| 349 | - await app.request.promiseGet(url,{ | |
| 350 | - data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:ckeck_quan_price,WareIds:check_quan_ware_list,pageSize:100} | |
| 351 | - }).then(res=>{ | |
| 352 | - if(res.data.code==0) | |
| 353 | - arr[ind].quan_list=res.data.data.pageData; | |
| 354 | - }) | |
| 355 | - | |
| 356 | - var frozenQuan=null; | |
| 357 | - var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; | |
| 358 | - await app.request.promiseGet(url0,{1:1}).then(res=>{ | |
| 359 | - if(res.data.code==0){ | |
| 360 | - frozenQuan=res.data.data; | |
| 361 | - } | |
| 362 | - }) | |
| 363 | - | |
| 364 | - if (frozenQuan && arr[ind].quan_list){ | |
| 365 | - arr[ind].quan_list=th.check_is_frozenQuan(arr[ind].quan_list,frozenQuan); | |
| 366 | - } | |
| 367 | - | |
| 368 | - } | |
| 369 | - } | |
| 370 | - | |
| 371 | 304 | th.setData({ |
| 372 | 305 | cartlist: arr, |
| 373 | 306 | }), |
| 374 | 307 | |
| 375 | 308 | th.calculatePrice(); |
| 309 | + //--- 获取一下看有没有优惠券 ---- | |
| 310 | + th.get_cart_quan(); | |
| 376 | 311 | } |
| 377 | 312 | }); |
| 378 | 313 | }, |
| ... | ... | @@ -381,7 +316,6 @@ Page({ |
| 381 | 316 | get_buy_goods: function (e){ |
| 382 | 317 | var th=this; |
| 383 | 318 | var gg = to.get_b_now(); |
| 384 | - | |
| 385 | 319 | //--------如果goods_id一样,就是要立即购买----- |
| 386 | 320 | if(e==gg.goods_id){ |
| 387 | 321 | a.get("/api/weshop/goods/get/" + oo.stoid+"/"+e, { |
| ... | ... | @@ -408,7 +342,6 @@ Page({ |
| 408 | 342 | } |
| 409 | 343 | } |
| 410 | 344 | |
| 411 | - | |
| 412 | 345 | switch (gd.prom_type){ |
| 413 | 346 | case 0: |
| 414 | 347 | case 2: |
| ... | ... | @@ -419,46 +352,21 @@ Page({ |
| 419 | 352 | //--此时开始计算商品的使用券相关,如果有等级价还要计算和等级价相关的, |
| 420 | 353 | // 如果有优惠促销,还要把促销的部分计算在内,因为促销还有不能使用优惠券-- |
| 421 | 354 | t.data.data.shop_price=gg.goods_price; |
| 422 | - | |
| 423 | 355 | th.data.ckeck_quan_price=t.data.data.shop_price*gg.goods_num; |
| 424 | 356 | th.data.check_quan_price_list=t.data.data.shop_price*gg.goods_num+""; |
| 425 | 357 | th.data.check_quan_ware_list=t.data.data.erpwareid+""; |
| 426 | 358 | |
| 427 | - var quanlist=null; | |
| 428 | - | |
| 429 | - if (th.data.is_close_quan != 1) { | |
| 430 | - var url="/api/weshop/couponList/getUseCouponList"; | |
| 431 | - await app.request.promiseGet(url,{ | |
| 432 | - data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} | |
| 433 | - }).then(res=>{ | |
| 434 | - if(res.data.code==0) | |
| 435 | - quanlist=res.data.data.pageData; | |
| 436 | - | |
| 437 | - | |
| 438 | - }) | |
| 439 | - } | |
| 440 | - | |
| 441 | - var frozenQuan=null; | |
| 442 | - var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; | |
| 443 | - await app.request.promiseGet(url0,{1:1}).then(res=>{ | |
| 444 | - if(res.data.code==0){ | |
| 445 | - frozenQuan=res.data.data; | |
| 446 | - } | |
| 447 | - }) | |
| 448 | - | |
| 449 | - if (frozenQuan && quanlist){ | |
| 450 | - quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); | |
| 451 | - } | |
| 452 | - | |
| 453 | 359 | t.data.data.prom_id = 0; |
| 454 | 360 | t.data.data.prom_type = 0; |
| 455 | 361 | |
| 456 | 362 | th.setData({ |
| 457 | 363 | bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, |
| 458 | - bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist | |
| 364 | + bn_pick: gg.pick_id, bn_t_exp_t: distr_t | |
| 459 | 365 | }); |
| 460 | 366 | //计算价格 |
| 461 | 367 | th.calculatePrice2(); |
| 368 | + //获取优惠券 | |
| 369 | + th.get_buy_now_quan(); | |
| 462 | 370 | |
| 463 | 371 | break; |
| 464 | 372 | case 1: //---秒杀----- |
| ... | ... | @@ -474,37 +382,16 @@ Page({ |
| 474 | 382 | th.data.ckeck_quan_price=t.data.data.shop_price*gg.goods_num; |
| 475 | 383 | th.data.check_quan_price_list=t.data.data.shop_price*gg.goods_num+""; |
| 476 | 384 | th.data.check_quan_ware_list=t.data.data.erpwareid+""; |
| 477 | - | |
| 478 | - if (th.data.is_close_quan != 1) { | |
| 479 | - | |
| 480 | - var url="/api/weshop/couponList/getUseCouponList"; | |
| 481 | - await app.request.promiseGet(url,{ | |
| 482 | - data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:th.data.ckeck_quan_price,WareIds:th.data.check_quan_ware_list,pageSize:100} | |
| 483 | - }).then(res=>{ | |
| 484 | - if(res.data.code==0) | |
| 485 | - quanlist=res.data.data.pageData; | |
| 486 | - }) | |
| 487 | - | |
| 488 | - var frozenQuan=null; | |
| 489 | - var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; | |
| 490 | - await app.request.promiseGet(url0,{1:1}).then(res=>{ | |
| 491 | - if(res.data.code==0){ | |
| 492 | - frozenQuan=res.data.data; | |
| 493 | - } | |
| 494 | - }) | |
| 495 | - | |
| 496 | - if (frozenQuan && quanlist){ | |
| 497 | - quanlist=th.check_is_frozenQuan(quanlist,frozenQuan); | |
| 498 | - } | |
| 499 | - } | |
| 500 | 385 | } |
| 501 | 386 | |
| 502 | 387 | th.setData({ |
| 503 | 388 | bn_goods: t.data.data, bn_pickname: gg.pick_name, bn_exp_type: et,index:m_wind, |
| 504 | - bn_pick: gg.pick_id, bn_t_exp_t: distr_t,selected_quan_list:quanlist | |
| 389 | + bn_pick: gg.pick_id, bn_t_exp_t: distr_t | |
| 505 | 390 | }); |
| 506 | 391 | //计算价格 |
| 507 | 392 | th.calculatePrice2(); |
| 393 | + //获取优惠券 | |
| 394 | + th.get_buy_now_quan(); | |
| 508 | 395 | } |
| 509 | 396 | }); |
| 510 | 397 | |
| ... | ... | @@ -1397,7 +1284,9 @@ Page({ |
| 1397 | 1284 | |
| 1398 | 1285 | //--验证是否已经冻结-- |
| 1399 | 1286 | check_is_frozenQuan:function(quanlist,frozenQuan){ |
| 1400 | - console.log("券列表",quanlist); | |
| 1287 | + console.log("券列表",quanlist); | |
| 1288 | + if(!quanlist) return null; | |
| 1289 | + if(!frozenQuan) return quanlist; | |
| 1401 | 1290 | var arr=[]; |
| 1402 | 1291 | for(var i=0;i<quanlist.length;i++){ |
| 1403 | 1292 | var item=quanlist[i]; |
| ... | ... | @@ -1519,7 +1408,99 @@ Page({ |
| 1519 | 1408 | } |
| 1520 | 1409 | } |
| 1521 | 1410 | },500); |
| 1522 | - } | |
| 1411 | + }, | |
| 1412 | + //-----获取购物车进来的劵------- | |
| 1413 | + get_cart_quan:function () { | |
| 1414 | + var arr=this.data.cartlist,th=this; | |
| 1415 | + //------------开始计算使用优惠券相关------------ | |
| 1416 | + for(var ind in arr){ | |
| 1417 | + var ep=arr[ind]; | |
| 1418 | + var goodlist=ep.goods; | |
| 1419 | + //--更优惠券抵用有关,立即购买的,如果是购物车,如果有等级价还有考虑等级价的东西 | |
| 1420 | + //就要把相应的值,写入cartlist数组中-- | |
| 1421 | + var ckeck_quan_price=0, | |
| 1422 | + check_quan_price_list='', | |
| 1423 | + check_quan_ware_list=''; | |
| 1424 | + | |
| 1425 | + for(var i in goodlist){ | |
| 1426 | + var gd=goodlist[i]; | |
| 1427 | + //--如果是秒杀就跳出-- | |
| 1428 | + if(gd.prom_type==1){ continue; } | |
| 1429 | + var item_price=gd.goods_price*gd.goods_num; | |
| 1430 | + ckeck_quan_price+=item_price; | |
| 1431 | + | |
| 1432 | + //--组装价格list-- | |
| 1433 | + if (check_quan_price_list) { | |
| 1434 | + check_quan_price_list += "," +item_price; | |
| 1435 | + } else { | |
| 1436 | + check_quan_price_list = item_price; | |
| 1437 | + } | |
| 1438 | + //--组装商品的线下erpwareid-- | |
| 1439 | + if (check_quan_ware_list) { | |
| 1440 | + check_quan_ware_list += "," +gd['erpwareid']; | |
| 1441 | + } else { | |
| 1442 | + check_quan_ware_list = gd['erpwareid']; | |
| 1443 | + } | |
| 1444 | + } | |
| 1523 | 1445 | |
| 1446 | + arr[ind].ckeck_quan_price=ckeck_quan_price; | |
| 1447 | + arr[ind].check_quan_ware_list=check_quan_ware_list; | |
| 1448 | + arr[ind].check_quan_price_list=check_quan_price_list; | |
| 1524 | 1449 | |
| 1450 | + //是否关闭使用优惠券 | |
| 1451 | + if (th.data.is_close_quan != 1) { | |
| 1452 | + var frozenQuan=null; | |
| 1453 | + var url0="/api/weshop/users/frozenQuan/listFrozenQuan/"+app.globalData.user_id; | |
| 1454 | + app.request.promiseGet(url0,{1:1}).then(res=>{ | |
| 1455 | + if(res.data.code==0){ frozenQuan=res.data.data; } | |
| 1456 | + //--调用接口,获取优惠券的列表,3秒钟内控制接口请求-- | |
| 1457 | + var url="/api/weshop/couponList/getUseCouponList"; | |
| 1458 | + app.request.time_limit_get(6,url,{ | |
| 1459 | + data:{storeId:oo.stoid,userId:app.globalData.user_id,BuySum:ckeck_quan_price,WareIds:check_quan_ware_list,pageSize:100}, | |
| 1460 | + success:function (res) { | |
| 1461 | + if (res.data.code == 0) { | |
| 1462 | + arr[ind].quan_list = res.data.data.pageData; | |
| 1463 | + arr[ind].quan_list = th.check_is_frozenQuan(arr[ind].quan_list, frozenQuan); | |
| 1464 | + th.setData({cartlist:arr }) | |
| 1465 | + } | |
| 1466 | + } | |
| 1467 | + }) | |
| 1468 | + }) | |
| 1469 | + } | |
| 1470 | + } | |
| 1471 | + }, | |
| 1472 | + //------ 获取立即购买的购物车的劵 -------- | |
| 1473 | + get_buy_now_quan:function () { | |
| 1474 | + var quanlist=null,th=this,frozenQuan = null; | |
| 1475 | + if(th.data.is_close_quan != 1) | |
| 1476 | + { | |
| 1477 | + var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; | |
| 1478 | + var url="/api/weshop/couponList/getUseCouponList"; | |
| 1479 | + app.request.promiseGet(url0, {1: 1}).then(res => { | |
| 1480 | + if (res.data.code == 0) { | |
| 1481 | + frozenQuan = res.data.data; | |
| 1482 | + } | |
| 1483 | + app.request.time_limit_get(6, url, { | |
| 1484 | + data: { | |
| 1485 | + storeId: oo.stoid, | |
| 1486 | + userId: app.globalData.user_id, | |
| 1487 | + BuySum: th.data.ckeck_quan_price, | |
| 1488 | + WareIds: th.data.check_quan_ware_list, | |
| 1489 | + pageSize: 100 | |
| 1490 | + }, | |
| 1491 | + success: function (res) { | |
| 1492 | + if (res.data.code == 0) { | |
| 1493 | + quanlist = res.data.data.pageData; | |
| 1494 | + if (quanlist) { | |
| 1495 | + quanlist = th.check_is_frozenQuan(quanlist, frozenQuan); | |
| 1496 | + th.setData({selected_quan_list:quanlist }) | |
| 1497 | + } | |
| 1498 | + } | |
| 1499 | + } | |
| 1500 | + | |
| 1501 | + }) | |
| 1502 | + }) | |
| 1503 | + | |
| 1504 | + } | |
| 1505 | + } | |
| 1525 | 1506 | }); | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.js
| 1 | +var i = require("../../../utils/util.js"); | |
| 1 | 2 | var e = getApp(), |
| 2 | 3 | a = e.globalData.setting, |
| 3 | 4 | os = a, |
| ... | ... | @@ -12,35 +13,43 @@ Page({ |
| 12 | 13 | wareCard: [], |
| 13 | 14 | page: 0, |
| 14 | 15 | pageSize: 10, |
| 15 | - isEmpty: true, | |
| 16 | + isEmpty: false, | |
| 16 | 17 | loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore |
| 17 | 18 | contentText: { |
| 18 | 19 | contentdown: '加载更多', |
| 19 | 20 | contentrefresh: '加载中...', |
| 20 | 21 | contentnomore: '已加载全部' |
| 21 | - } | |
| 22 | + }, | |
| 23 | + ismore: 0, //数据是否全部加载完成 | |
| 24 | + is_read: 0, //是否查询过我的礼包接口 | |
| 25 | + curpage: 1, //当前分页数 | |
| 26 | + pageSize: 3, //页大小 | |
| 27 | + total: 0, //总数量 | |
| 22 | 28 | }, |
| 23 | 29 | onLoad: function(options) { |
| 24 | 30 | var th = this; |
| 31 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | |
| 32 | + my_confirm.open_cancel(0); | |
| 25 | 33 | th.setData({ |
| 26 | 34 | getStorageID: a.stoid, |
| 27 | - getUserID: 5682130 | |
| 35 | + getUserID: d.user_id | |
| 28 | 36 | }) |
| 37 | + th.getList(); | |
| 29 | 38 | }, |
| 30 | 39 | onShow: function() { |
| 31 | - var th = this; | |
| 32 | - th.setData({ | |
| 33 | - pages: 1, | |
| 34 | - pageSize: 10, | |
| 35 | - loadingType: 0 | |
| 36 | - }) | |
| 37 | - th.getList(); | |
| 40 | + // var th = this; | |
| 41 | + // th.setData({ | |
| 42 | + // pages: 1, | |
| 43 | + // pageSize: 10, | |
| 44 | + // loadingType: 0 | |
| 45 | + // }) | |
| 46 | + // th.getList(); | |
| 38 | 47 | }, |
| 39 | 48 | |
| 40 | 49 | GetBuyPrice: function(e) { |
| 41 | 50 | var that = this.data; |
| 42 | 51 | var th = this; |
| 43 | - var lbId = e.currentTarget.dataset.lbId;//活动id | |
| 52 | + var id = e.currentTarget.dataset.id; //活动id | |
| 44 | 53 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 45 | 54 | my_confirm.open( |
| 46 | 55 | "是否确定购买该礼包", |
| ... | ... | @@ -50,11 +59,12 @@ Page({ |
| 50 | 59 | my_confirm.open_cancel(0); |
| 51 | 60 | }, |
| 52 | 61 | function() { |
| 62 | + my_confirm.open_cancel(0); | |
| 53 | 63 | var json = { |
| 54 | 64 | "actId": '', //活动Id |
| 55 | 65 | "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 |
| 56 | 66 | "buyType": '2', //1=积分兑换 2=余额购买 |
| 57 | - "lbId": lbId, //礼包Id | |
| 67 | + "lbId": id, //礼包Id | |
| 58 | 68 | "storeId": that.getStorageID, //商家Id |
| 59 | 69 | "userId": that.getUserID, //用户ID |
| 60 | 70 | "buyFrom": 2 |
| ... | ... | @@ -68,9 +78,22 @@ Page({ |
| 68 | 78 | header: { |
| 69 | 79 | 'content-type': 'application/json' |
| 70 | 80 | }, // 设置请求的 header |
| 71 | - success: function (res) { | |
| 81 | + success: function(res) { | |
| 72 | 82 | if (res.data.code == 0) { |
| 73 | - window.location.href = th.data.url + '/Mobile/Payment/getPay.html?stoid=' + that.getStorageID + '&order_sn=' + res.data.data.orderSn + '&recharge_type=6'; | |
| 83 | + res = res.data.data; | |
| 84 | + wx.requestPayment({ | |
| 85 | + timeStamp: String(res.timeStamp), | |
| 86 | + nonceStr: res.nonceStr, | |
| 87 | + package: res.packageValue, | |
| 88 | + signType: res.signType, | |
| 89 | + paySign: res.paySign, | |
| 90 | + success: function(n) { | |
| 91 | + | |
| 92 | + }, | |
| 93 | + fail: function(n) { | |
| 94 | + | |
| 95 | + } | |
| 96 | + }); | |
| 74 | 97 | } else { |
| 75 | 98 | getApp().my_warnning(res.data.msg, 0, th); |
| 76 | 99 | } |
| ... | ... | @@ -87,7 +110,7 @@ Page({ |
| 87 | 110 | GetBuyIntegral: function(e) { |
| 88 | 111 | var that = this.data; |
| 89 | 112 | var th = this; |
| 90 | - var lbId = e.currentTarget.dataset.lbId;//活动id | |
| 113 | + var id = e.currentTarget.dataset.id; //活动id | |
| 91 | 114 | var my_confirm = th.selectComponent("#my_confirm"); //组件的id |
| 92 | 115 | my_confirm.open( |
| 93 | 116 | "是否确定兑换该礼包", |
| ... | ... | @@ -97,16 +120,25 @@ Page({ |
| 97 | 120 | my_confirm.open_cancel(0); |
| 98 | 121 | }, |
| 99 | 122 | function() { |
| 100 | - getApp().request.post('/api/weshop/marketing/buy/receive/gift/record/insert', { | |
| 101 | - data: { | |
| 102 | - "actId": '', //活动Id | |
| 103 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 104 | - "buyType": '1', //1=积分兑换 2=余额购买 | |
| 105 | - "lbId": 26, //礼包Id | |
| 106 | - "storeId": that.getStorageID, //商家Id | |
| 107 | - "userId": that.getUserID //用户ID | |
| 108 | - }, | |
| 109 | - success: function success(res) { | |
| 123 | + my_confirm.open_cancel(0); | |
| 124 | + var json = { | |
| 125 | + "actId": '', //活动Id | |
| 126 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 127 | + "buyType": '1', //1=积分兑换 2=余额购买 | |
| 128 | + "lbId": id, //礼包Id | |
| 129 | + "storeId": that.getStorageID, //商家Id | |
| 130 | + "userId": that.getUserID //用户ID | |
| 131 | + }; | |
| 132 | + var data = JSON.stringify(json); | |
| 133 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
| 134 | + wx.request({ | |
| 135 | + url: url, | |
| 136 | + data: data, | |
| 137 | + method: 'post', | |
| 138 | + header: { | |
| 139 | + 'content-type': 'application/json' | |
| 140 | + }, // 设置请求的 header | |
| 141 | + success: function(res) { | |
| 110 | 142 | if (res.data.code == 0) { |
| 111 | 143 | getApp().my_warnning("兑换成功!", 1, th); |
| 112 | 144 | } else { |
| ... | ... | @@ -117,66 +149,66 @@ Page({ |
| 117 | 149 | |
| 118 | 150 | }) |
| 119 | 151 | |
| 120 | - | |
| 121 | 152 | }, |
| 122 | 153 | getList: function(e) { |
| 123 | - var _this = this; //上拉加载 | |
| 124 | - var that = this.data; | |
| 125 | - if (that.loadingType != 0) { | |
| 126 | - return false; | |
| 127 | - } | |
| 128 | - // that.loadingType = 1; | |
| 129 | - _this.setData({ | |
| 130 | - loadingType: 1 | |
| 131 | - }) | |
| 132 | - getApp().request.get('/api/weshop/marketing/my/giftbag/page', { | |
| 154 | + var th = this; | |
| 155 | + getApp().request.get('/api/weshop/marketing/giftbag/page', { | |
| 133 | 156 | data: { |
| 134 | - "storeId": that.getStorageID, //商家ID | |
| 135 | - "userId": that.getUserID, //用户ID | |
| 136 | - "page": that.pages, | |
| 137 | - "pageSize": that.pageSize | |
| 157 | + storeId: th.data.getStorageID, //商家ID | |
| 158 | + userId: th.data.getUserID, //用户ID | |
| 159 | + page: th.data.pages, | |
| 160 | + pageSize: th.data.pageSize | |
| 138 | 161 | }, |
| 139 | 162 | success: function success(res) { |
| 163 | + wx.hideLoading(); | |
| 140 | 164 | if (res.data.code == 0) { |
| 141 | - if (res.data.data.total > 0) { | |
| 142 | - _this.setData({ | |
| 143 | - isEmpty: false | |
| 144 | - }) | |
| 145 | - } else { | |
| 146 | - _this.setData({ | |
| 147 | - isEmpty: true | |
| 148 | - }) | |
| 149 | - } | |
| 150 | - if (res.data.data.pageData.length == 0) { | |
| 151 | - _this.setData({ | |
| 152 | - loadingType: 2 | |
| 153 | - }) | |
| 154 | - } else { | |
| 155 | - var wareCard = that.wareCard; | |
| 156 | - if (wareCard.length < res.data.data.total) { | |
| 157 | - for (var i = 0; i < res.data.data.pageData.length; i++) { | |
| 158 | - wareCard.push(res.data.data.pageData[i]); | |
| 159 | - } | |
| 160 | - } | |
| 161 | - _this.setData({ | |
| 162 | - wareCard: wareCard | |
| 163 | - }) | |
| 164 | - _this.setData({ | |
| 165 | - loadingType: 0 | |
| 166 | - }) | |
| 167 | - | |
| 168 | - } | |
| 165 | + th.data.curpage++; | |
| 166 | + var arr1 = th.data.wareCard; | |
| 167 | + var arr2 = res.data.data.pageData; | |
| 168 | + var arr3 = [...arr1, ...arr2]; | |
| 169 | + var ismore = 0; | |
| 170 | + if (arr3.length == res.data.data.total) ismore = 1 | |
| 171 | + th.setData({ | |
| 172 | + wareCard: arr3, | |
| 173 | + total: res.data.data.total, | |
| 174 | + ismore: ismore, | |
| 175 | + is_read: 1 | |
| 176 | + }), wx.stopPullDownRefresh(); //停止下拉刷新 | |
| 169 | 177 | } else { |
| 170 | - getApp().my_warnning(res.data.msg, 0, th); | |
| 178 | + th.setData({ | |
| 179 | + is_read: 1 | |
| 180 | + }) | |
| 171 | 181 | } |
| 172 | 182 | } |
| 173 | 183 | }) |
| 174 | 184 | |
| 175 | 185 | }, |
| 176 | - //界面跳转 | |
| 177 | - goto: function(e) { | |
| 186 | + //销毁界面跳转 | |
| 187 | + redirectTo: function(e) { | |
| 178 | 188 | var th = this; |
| 179 | 189 | var url = e.currentTarget.dataset.url; |
| 180 | - getApp().goto(url); | |
| 181 | - } | |
| 190 | + //销毁跳转 | |
| 191 | + wx.redirectTo({ | |
| 192 | + url: url | |
| 193 | + }); | |
| 194 | + }, | |
| 195 | + //不销毁界面跳转 | |
| 196 | + navigateTo: function(e) { | |
| 197 | + var th = this; | |
| 198 | + var url = e.currentTarget.dataset.url; | |
| 199 | + wx.navigateTo({ | |
| 200 | + url: url, | |
| 201 | + }) | |
| 202 | + }, | |
| 203 | + //下拉事件 | |
| 204 | + onReachBottom: function() { | |
| 205 | + var th = this; | |
| 206 | + if (th.data.total <= th.data.pageSize) return; | |
| 207 | + if (th.data.ismore) return; | |
| 208 | + wx.showLoading({ | |
| 209 | + title: '加载中...', | |
| 210 | + }) | |
| 211 | + th.getList(); | |
| 212 | + }, | |
| 213 | + | |
| 182 | 214 | }) |
| 183 | 215 | \ No newline at end of file | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.json
pages/giftpack/buygiftpack/giftpackbuy.wxml
| 1 | 1 | <view class="top_img"> |
| 2 | - <view class="top_img"> | |
| 3 | - <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}"></image> | |
| 2 | + <view class="top_img"> | |
| 3 | + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}" lazy-load="true"></image> | |
| 4 | + </view> | |
| 5 | + <view class="top_title"> | |
| 6 | + <view class="top_title_box"> | |
| 7 | + <text class="top_title_redtext">礼包列表</text> | |
| 4 | 8 | </view> |
| 5 | - <view class="top_title"> | |
| 6 | - <view class="top_title_box"> | |
| 7 | - <text class="top_title_redtext">礼包列表</text> | |
| 9 | + <view class="top_title_box_S"></view> | |
| 10 | + <view class="top_title_box"> | |
| 11 | + <a class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a> | |
| 12 | + </view> | |
| 13 | + </view> | |
| 14 | + <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> | |
| 15 | + <view class="content_box"> | |
| 16 | + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn={{items.orderSn}}"> | |
| 17 | + <view class="content_box_img"> | |
| 18 | + <image src="{{iurl+items.lbUrl}}" lazy-load="true"></image> | |
| 8 | 19 | </view> |
| 9 | - <view class="top_title_box_S"></view> | |
| 10 | - <view class="top_title_box"> | |
| 11 | - <a data-event-opts="{{[['tap',[['MyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="goto" data-url="/pages/giftpack/mygiftpack/mygiftpack">我的礼包</a> | |
| 20 | + <view class="content_box_title"> | |
| 21 | + <view class="content_ware_title"> | |
| 22 | + <text bindtap="__e">{{items.giftTitle}}</text> | |
| 23 | + </view> | |
| 24 | + <view class="content_ware_type flex"> | |
| 25 | + <block wx:if="{{items.payMoney>0}}"> | |
| 26 | + <text>{{"¥"+items.payMoney}}</text> | |
| 27 | + </block> | |
| 28 | + <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}"> | |
| 29 | + <text>/</text> | |
| 30 | + </block> | |
| 31 | + <block wx:if="{{items.payIntegral>0}}"> | |
| 32 | + <view class="flex"> | |
| 33 | + <text class="ellipsis-1">{{items.payIntegral}}</text> | |
| 34 | + <view>积分</view> | |
| 35 | + </view> | |
| 36 | + </block> | |
| 37 | + </view> | |
| 38 | + <view class="content_ware_price"> | |
| 39 | + <text class="ellipsis-1">{{"原价:¥"+items.giftPosPrice}}</text> | |
| 40 | + </view> | |
| 41 | + <view class="content_ware_time"> | |
| 42 | + <text class="ellipsis-1">{{"活动时间:"+items.endTime}}</text> | |
| 43 | + </view> | |
| 12 | 44 | </view> |
| 13 | - </view> | |
| 14 | - <block wx:for="{{wareCard}}" wx:for-item="items" wx:for-index="index" wx:key="index"> | |
| 15 | - <view class="content_box"> | |
| 16 | - <view class="content_box_ware" bindtap="goto" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=1&lbId={{items.lbId}}&orderSn={{items.orderSn}}"> | |
| 17 | - <view data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" class="content_box_img"> | |
| 18 | - <image src="{{iurl+items.lbUrl}}"></image> | |
| 19 | - </view> | |
| 20 | - <view class="content_box_title"> | |
| 21 | - <view class="content_ware_title"> | |
| 22 | - <text data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}" bindtap="__e">{{items.giftTitle}}</text> | |
| 23 | - </view> | |
| 24 | - <view class="content_ware_type"> | |
| 25 | - <block wx:if="{{items.payMoney>0}}"> | |
| 26 | - <text>{{"¥"+items.payMoney}}</text> | |
| 27 | - </block> | |
| 28 | - <block wx:if="{{items.payMoney>0&&items.payIntegral>0}}"> | |
| 29 | - <text>/</text> | |
| 30 | - </block> | |
| 31 | - <block wx:if="{{items.payIntegral>0}}"> | |
| 32 | - <text>{{items.payIntegral+"积分"}}</text> | |
| 33 | - </block> | |
| 34 | - </view> | |
| 35 | - <view class="content_ware_price"> | |
| 36 | - <text>{{"原价:¥"+items.giftPosPrice}}</text> | |
| 37 | - </view> | |
| 38 | - <view class="content_ware_time"> | |
| 39 | - <text>{{"活动时间:"+items.endTime}}</text> | |
| 40 | - </view> | |
| 41 | - </view> | |
| 42 | - </view> | |
| 43 | - <view class="content_box_button"> | |
| 44 | - <view class="box_button_remark"> | |
| 45 | - <text>{{"已售:"+items.giftQty+"件"}}</text> | |
| 46 | - </view> | |
| 47 | - <block wx:if="{{items.payMoney>0}}"> | |
| 48 | - <view class="box_button_buy" data-lbId="{{items.lbId}}" bindtap="GetBuyPrice"> | |
| 49 | - <button data-event-opts="{{[['tap',[['GetBuyPrice',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}">立即购买{{items.lbId}}</button> | |
| 50 | - </view> | |
| 51 | - </block> | |
| 52 | - <block wx:if="{{items.payIntegral>0}}"> | |
| 53 | - <view class="box_button_dui" bindtap="GetBuyIntegral" data-lbId="{{items.lbId}}"> | |
| 54 | - <button data-event-opts="{{[['tap',[['GetBuyIntegral',['$0','$1'],[[['wareCard','',index,'lbId']],[['wareCard','',index]]]]]]]}}">立即兑换</button> | |
| 55 | - </view> | |
| 56 | - </block> | |
| 57 | - </view> | |
| 45 | + </view> | |
| 46 | + <view class="content_box_button"> | |
| 47 | + <view class="box_button_remark"> | |
| 48 | + <text>{{"已售:"+items.giftQty+"件"}}</text> | |
| 58 | 49 | </view> |
| 59 | - </block> | |
| 60 | - <block wx:if="{{isEmpty==true}}"> | |
| 61 | - <view class="foot_empty"> | |
| 62 | - <view> | |
| 63 | - <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}"></image> | |
| 64 | - </view> | |
| 65 | - <view> | |
| 66 | - <text>当前暂无礼包</text> | |
| 50 | + <view class="flex-vertical"> | |
| 51 | + <block wx:if="{{items.payMoney>0}}"> | |
| 52 | + <view class="box_button_buy" bindtap="GetBuyPrice" data-id="{{items.lbId}}"> | |
| 53 | + <button>立即购买</button> | |
| 67 | 54 | </view> |
| 68 | - <view class="foot_empty_button"> | |
| 69 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | |
| 55 | + </block> | |
| 56 | + <block wx:if="{{items.payIntegral>0}}"> | |
| 57 | + <view class="box_button_dui" bindtap="GetBuyIntegral" data-id="{{items.lbId}}"> | |
| 58 | + <button>立即兑换</button> | |
| 70 | 59 | </view> |
| 60 | + </block> | |
| 71 | 61 | </view> |
| 72 | - </block> | |
| 73 | - <view class="foot_box"> | |
| 74 | - <text>———— 到底了 ————</text> | |
| 62 | + </view> | |
| 63 | + </view> | |
| 64 | + </block> | |
| 65 | + <block wx:if="{{is_read && wareCard.length<1}}"> | |
| 66 | + <view class="foot_empty"> | |
| 67 | + <view> | |
| 68 | + <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image> | |
| 69 | + </view> | |
| 70 | + <view> | |
| 71 | + <text>当前暂无礼包</text> | |
| 72 | + </view> | |
| 73 | + <view class="foot_empty_button"> | |
| 74 | + <text bindtap="__e">去获取</text> | |
| 75 | + </view> | |
| 75 | 76 | </view> |
| 77 | + </block> | |
| 78 | + <!-- 加载完毕并且数据大于=页大小 --> | |
| 79 | + <view class="After_all flex-center" wx:if="{{ismore && wareCard.length>=3}}"> | |
| 80 | + <view class="Line"></view> | |
| 81 | + <view class="end fs26">到底了</view> | |
| 82 | + <view class="Line"></view> | |
| 83 | + </view> | |
| 76 | 84 | </view> |
| 77 | 85 | <!-- 引入提示组件 --> |
| 78 | 86 | <warn id="warn"></warn> | ... | ... |
pages/giftpack/buygiftpack/giftpackbuy.wxss
| ... | ... | @@ -29,6 +29,7 @@ page { |
| 29 | 29 | margin: 0rpx 20rpx 0rpx 20rpx; |
| 30 | 30 | -webkit-align-content: center; |
| 31 | 31 | align-content: center; |
| 32 | + margin-bottom: 10rpx; | |
| 32 | 33 | } |
| 33 | 34 | |
| 34 | 35 | .top_title_box { |
| ... | ... | @@ -60,8 +61,9 @@ page { |
| 60 | 61 | |
| 61 | 62 | .content_box { |
| 62 | 63 | background-color: #fff; |
| 63 | - margin: 10rpx 20rpx 0rpx 20rpx; | |
| 64 | + margin: 0rpx 20rpx; | |
| 64 | 65 | border-radius: 10rpx; |
| 66 | + margin-bottom: 10rpx; | |
| 65 | 67 | } |
| 66 | 68 | |
| 67 | 69 | .content_box_ware { |
| ... | ... | @@ -149,7 +151,7 @@ page { |
| 149 | 151 | } |
| 150 | 152 | |
| 151 | 153 | .box_button_remark { |
| 152 | - margin-left: 5rpx; | |
| 154 | + | |
| 153 | 155 | } |
| 154 | 156 | |
| 155 | 157 | .box_button_remark text { |
| ... | ... | @@ -162,24 +164,20 @@ page { |
| 162 | 164 | width: 160rpx; |
| 163 | 165 | height: 50rpx; |
| 164 | 166 | font-size: 20rpx; |
| 165 | - background: #d41c34; | |
| 166 | - color: #fff; | |
| 167 | + background: #fff; | |
| 168 | + color: #000; | |
| 167 | 169 | line-height: 50rpx; |
| 168 | 170 | } |
| 169 | 171 | |
| 170 | -.box_button_dui { | |
| 171 | - text-align: right; | |
| 172 | - margin: 22rpx 25rpx 0rpx 0rpx; | |
| 173 | -} | |
| 174 | - | |
| 175 | 172 | .box_button_dui button { |
| 176 | 173 | display: inline-block; |
| 177 | 174 | width: 160rpx; |
| 178 | 175 | height: 50rpx; |
| 179 | 176 | font-size: 20rpx; |
| 180 | - background: #fff; | |
| 181 | - color: #000; | |
| 177 | + background: #d41c34; | |
| 178 | + color: #fff; | |
| 182 | 179 | line-height: 50rpx; |
| 180 | + margin-left: 20rpx; | |
| 183 | 181 | } |
| 184 | 182 | |
| 185 | 183 | .foot_box { |
| ... | ... | @@ -229,3 +227,17 @@ page { |
| 229 | 227 | font-size: 28rpx; |
| 230 | 228 | color: #fff; |
| 231 | 229 | } |
| 230 | +.After_all { | |
| 231 | + height: 80rpx; | |
| 232 | + margin-bottom: 10rpx; | |
| 233 | + color: rgb(255, 255, 255); | |
| 234 | +} | |
| 235 | + | |
| 236 | +.After_all .Line { | |
| 237 | + border-top: 3rpx solid rgb(255, 255, 255); | |
| 238 | + width: 130rpx; | |
| 239 | +} | |
| 240 | + | |
| 241 | +.After_all .end { | |
| 242 | + margin: 0rpx 15rpx; | |
| 243 | +} | |
| 232 | 244 | \ No newline at end of file | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.js
| ... | ... | @@ -22,6 +22,7 @@ Page({ |
| 22 | 22 | getUrl: '', |
| 23 | 23 | wareCard: [], |
| 24 | 24 | orderSn: "", //订单编号 |
| 25 | + lbId:"" | |
| 25 | 26 | }, |
| 26 | 27 | onLoad: function(options) { |
| 27 | 28 | var th = this; |
| ... | ... | @@ -32,93 +33,129 @@ Page({ |
| 32 | 33 | getGiftID: options.lbId, |
| 33 | 34 | orderSn: options.orderSn |
| 34 | 35 | }) |
| 35 | - }, | |
| 36 | - onShow: function() { | |
| 37 | - var th = this; | |
| 38 | - if (th.data.isBuy == 0) { | |
| 36 | + if (options.isBuy == 0) { | |
| 39 | 37 | th.GetMyGiftList(); |
| 40 | 38 | } else { |
| 41 | 39 | th.GetBuyGiftList(); |
| 42 | 40 | } |
| 43 | - | |
| 44 | - // this.giftRemark = this.giftRemark.replace(/<p><img/gi, "<p class='img'><img"); | |
| 45 | 41 | th.setData({ |
| 46 | 42 | giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") |
| 47 | 43 | }) |
| 48 | 44 | }, |
| 49 | - GetBuyPrice: function() { | |
| 50 | - var that = this; | |
| 51 | - var th = this.data; | |
| 52 | - uni.showModal({ | |
| 53 | - title: '', | |
| 54 | - content: '是否确定购买该礼包', | |
| 55 | - success: function success(res) { | |
| 56 | - if (res.confirm) { | |
| 57 | - getApp().request.post('/api/weshop/marketing/buy/receive/gift/record/insert', { | |
| 58 | - data: { | |
| 59 | - "actId": '', //活动Id | |
| 60 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 61 | - "buyType": '2', //1=积分兑换 2=余额购买 | |
| 62 | - "lbId": th.getGiftID, //礼包Id | |
| 63 | - "storeId": th.getStorageID, //商家Id | |
| 64 | - "userId": th.getUserID //用户ID | |
| 65 | - }, | |
| 66 | - success: function success(res) { | |
| 67 | - if (res.data.code == 0) { | |
| 68 | - getApp().my_warnning("购买成功!", 0, that); | |
| 69 | - | |
| 70 | - } else { | |
| 71 | - getApp().my_warnning(res.data.msg, 0, that); | |
| 72 | - } | |
| 73 | - } | |
| 74 | - }); | |
| 45 | + onShow: function() { | |
| 46 | + // var th = this; | |
| 47 | + // if (th.data.isBuy == 0) { | |
| 48 | + // th.GetMyGiftList(); | |
| 49 | + // } else { | |
| 50 | + // th.GetBuyGiftList(); | |
| 51 | + // } | |
| 52 | + // th.setData({ | |
| 53 | + // giftRemark: th.data.giftRemark.replace(/<p><img/gi, "<p class='img'><img") | |
| 54 | + // }) | |
| 55 | + }, | |
| 56 | + GetBuyPrice: function (e) { | |
| 57 | + var that = this.data; | |
| 58 | + var th = this; | |
| 59 | + // var id = e.currentTarget.dataset.id;//活动id | |
| 60 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | |
| 61 | + my_confirm.open( | |
| 62 | + "是否确定购买该礼包", | |
| 63 | + "取消", | |
| 64 | + "确定", | |
| 65 | + function () { | |
| 66 | + my_confirm.open_cancel(0); | |
| 67 | + }, | |
| 68 | + function () { | |
| 69 | + my_confirm.open_cancel(0); | |
| 70 | + var json = { | |
| 71 | + "actId": '', //活动Id | |
| 72 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 73 | + "buyType": '2', //1=积分兑换 2=余额购买 | |
| 74 | + "lbId": that.getGiftID, //礼包Id | |
| 75 | + "storeId": that.getStorageID, //商家Id | |
| 76 | + "userId": that.getUserID, //用户ID | |
| 77 | + "buyFrom": 2 | |
| 78 | + }; | |
| 79 | + var data = JSON.stringify(json); | |
| 80 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
| 81 | + wx.request({ | |
| 82 | + url: url, | |
| 83 | + data: data, | |
| 84 | + method: 'post', | |
| 85 | + header: { | |
| 86 | + 'content-type': 'application/json' | |
| 87 | + }, // 设置请求的 header | |
| 88 | + success: function (res) { | |
| 89 | + if (res.data.code == 0) { | |
| 90 | + res = res.data.data; | |
| 91 | + wx.requestPayment({ | |
| 92 | + timeStamp: String(res.timeStamp), | |
| 93 | + nonceStr: res.nonceStr, | |
| 94 | + package: res.packageValue, | |
| 95 | + signType: res.signType, | |
| 96 | + paySign: res.paySign, | |
| 97 | + success: function (n) { | |
| 75 | 98 | |
| 76 | - } else if (res.cancel) { | |
| 99 | + }, | |
| 100 | + fail: function (n) { | |
| 101 | + | |
| 102 | + } | |
| 103 | + }); | |
| 104 | + } else { | |
| 105 | + getApp().my_warnning(res.data.msg, 0, th); | |
| 106 | + } | |
| 107 | + } | |
| 108 | + }) | |
| 77 | 109 | |
| 78 | - } | |
| 79 | 110 | } |
| 80 | - }); | |
| 111 | + | |
| 112 | + | |
| 113 | + ) | |
| 81 | 114 | |
| 82 | 115 | |
| 83 | 116 | }, |
| 84 | - GetBuyIntegral: function() { | |
| 117 | + GetBuyIntegral: function (e) { | |
| 85 | 118 | var that = this.data; |
| 86 | - uni.showModal({ | |
| 87 | - title: '', | |
| 88 | - content: '是否确定兑换该礼包', | |
| 89 | - success: function success(res) { | |
| 90 | - if (res.confirm) { | |
| 91 | - getApp().request.promisepost('/api/weshop/marketing/buy/receive/gift/record/insert', { | |
| 92 | - data: { | |
| 93 | - "actId": '', //活动Id | |
| 94 | - "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 95 | - "buyType": '1', //1=积分兑换 2=余额购买 | |
| 96 | - "lbId": that.getGiftID, //礼包Id | |
| 97 | - "storeId": that.getStorageID, //商家Id | |
| 98 | - "userId": that.getUserID //用户ID | |
| 99 | - }, | |
| 100 | - success: function success(res) { | |
| 101 | - if (res.data.code == 0) { | |
| 102 | - // uni.showToast({ | |
| 103 | - // icon: 'none', | |
| 104 | - // title: '兑换成功!' | |
| 105 | - // }); | |
| 106 | - getApp().my_warnning("兑换成功!"); | |
| 107 | - | |
| 108 | - } else { | |
| 109 | - uni.showToast({ | |
| 110 | - icon: 'none', | |
| 111 | - title: res.data.msg | |
| 112 | - }); | |
| 113 | - | |
| 114 | - } | |
| 119 | + var th = this; | |
| 120 | + // var id = e.currentTarget.dataset.id;//活动id | |
| 121 | + var my_confirm = th.selectComponent("#my_confirm"); //组件的id | |
| 122 | + my_confirm.open( | |
| 123 | + "是否确定兑换该礼包", | |
| 124 | + "取消", | |
| 125 | + "确定", | |
| 126 | + function () { | |
| 127 | + my_confirm.open_cancel(0); | |
| 128 | + }, | |
| 129 | + function () { | |
| 130 | + my_confirm.open_cancel(0); | |
| 131 | + var json = { | |
| 132 | + "actId": '', //活动Id | |
| 133 | + "actType": '', //活动类型 1:新人礼、2:评价有礼、3:节日营销、4:生日营销 | |
| 134 | + "buyType": '1', //1=积分兑换 2=余额购买 | |
| 135 | + "lbId": that.getGiftID, //礼包Id | |
| 136 | + "storeId": that.getStorageID, //商家Id | |
| 137 | + "userId": that.getUserID //用户ID | |
| 138 | + }; | |
| 139 | + var data = JSON.stringify(json); | |
| 140 | + var url = that.url + "/api/weshop/marketing/buy/receive/gift/record/insert"; | |
| 141 | + wx.request({ | |
| 142 | + url: url, | |
| 143 | + data: data, | |
| 144 | + method: 'post', | |
| 145 | + header: { | |
| 146 | + 'content-type': 'application/json' | |
| 147 | + }, // 设置请求的 header | |
| 148 | + success: function (res) { | |
| 149 | + if (res.data.code == 0) { | |
| 150 | + getApp().my_warnning("兑换成功!", 1, th); | |
| 151 | + } else { | |
| 152 | + getApp().my_warnning(res.data.msg, 0, th); | |
| 115 | 153 | } |
| 116 | - }); | |
| 154 | + } | |
| 155 | + }) | |
| 117 | 156 | |
| 157 | + }) | |
| 118 | 158 | |
| 119 | - } else if (res.cancel) {} | |
| 120 | - } | |
| 121 | - }); | |
| 122 | 159 | |
| 123 | 160 | }, |
| 124 | 161 | GetMyGiftList: function() { |
| ... | ... | @@ -154,7 +191,8 @@ Page({ |
| 154 | 191 | giftPrice: res.data.data.payMoney, |
| 155 | 192 | giftType: res.data.data.actType, |
| 156 | 193 | actTitle: res.data.data.actTitle, |
| 157 | - wareCard: res.data.data.wareCard | |
| 194 | + wareCard: res.data.data.wareCard, | |
| 195 | + lbId: res.data.data.lbId | |
| 158 | 196 | }) |
| 159 | 197 | } else { |
| 160 | 198 | getApp().my_warnning("系统繁忙,请稍后再试", 0, th); |
| ... | ... | @@ -198,7 +236,7 @@ Page({ |
| 198 | 236 | giftPrice: res.data.data.payMoney, |
| 199 | 237 | giftType: res.data.data.actType, |
| 200 | 238 | actTitle: res.data.data.actTitle, |
| 201 | - wareCard: res.data.data.wareCard | |
| 239 | + wareCard: res.data.data.wareCard, | |
| 202 | 240 | }) |
| 203 | 241 | } else { |
| 204 | 242 | getApp().my_warnning("系统繁忙,请稍后再试", 0, _this2); | ... | ... |
pages/giftpack/giftpacklist/giftpacklist.wxml
| 1 | 1 | <view class="box data-v-3a5b7e36"> |
| 2 | - <view class="box_top data-v-3a5b7e36"> | |
| 3 | - <image src="{{giftImage}}" class="data-v-3a5b7e36"></image> | |
| 2 | + <view class="box_top data-v-3a5b7e36"> | |
| 3 | + <image src="{{giftImage}}" class="data-v-3a5b7e36" lazy-load="true"></image> | |
| 4 | + </view> | |
| 5 | + <view class="box_title data-v-3a5b7e36"> | |
| 6 | + <view class="top_title data-v-3a5b7e36"> | |
| 7 | + <text class="data-v-3a5b7e36 ellipsis-2">{{giftTitle}}</text> | |
| 4 | 8 | </view> |
| 5 | - <view class="box_title data-v-3a5b7e36"> | |
| 6 | - <view class="top_title data-v-3a5b7e36"> | |
| 7 | - <text class="data-v-3a5b7e36">{{giftTitle}}</text> | |
| 8 | - </view> | |
| 9 | - <view class="top_time data-v-3a5b7e36"> | |
| 10 | - <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> | |
| 9 | + <view class="top_time data-v-3a5b7e36"> | |
| 10 | + <text class="data-v-3a5b7e36">{{"兑换截至时间:"+giftDate}}</text> | |
| 11 | + </view> | |
| 12 | + <view class="top_price data-v-3a5b7e36"> | |
| 13 | + <block wx:if="{{giftPrice>0}}"> | |
| 14 | + <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text> | |
| 15 | + </block> | |
| 16 | + <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | |
| 17 | + <text class="data-v-3a5b7e36">/</text> | |
| 18 | + </block> | |
| 19 | + <block wx:if="{{giftIntegral>0}}"> | |
| 20 | + <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text> | |
| 21 | + </block> | |
| 22 | + <block wx:if="{{giftType>0}}"> | |
| 23 | + <text class="data-v-3a5b7e36">{{actTitle}}</text> | |
| 24 | + </block> | |
| 25 | + </view> | |
| 26 | + <view class="top_foot data-v-3a5b7e36"> | |
| 27 | + <view class="top_foot_price data-v-3a5b7e36"> | |
| 28 | + <text class="data-v-3a5b7e36">{{"原价:"+giftPosPrice+"元"}}</text> | |
| 29 | + </view> | |
| 30 | + <view class="top_foot_qty data-v-3a5b7e36"> | |
| 31 | + <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> | |
| 32 | + </view> | |
| 33 | + </view> | |
| 34 | + </view> | |
| 35 | + <view class="box_ware data-v-3a5b7e36"> | |
| 36 | + <view class="box_ware_title data-v-3a5b7e36"> | |
| 37 | + <text class="data-v-3a5b7e36">礼包内容</text> | |
| 38 | + </view> | |
| 39 | + <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | |
| 40 | + <view class="box_ware_box data-v-3a5b7e36"> | |
| 41 | + <view class="box_ware_img data-v-3a5b7e36"> | |
| 42 | + <block wx:if="{{item.lbType==1}}"> | |
| 43 | + <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36" lazy-load="true"></image> | |
| 44 | + </block> | |
| 45 | + <block wx:if="{{item.lbType==2}}"> | |
| 46 | + <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> | |
| 47 | + </block> | |
| 48 | + <block wx:if="{{item.lbType==3}}"> | |
| 49 | + <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> | |
| 50 | + </block> | |
| 51 | + <block wx:if="{{item.lbType==4}}"> | |
| 52 | + <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> | |
| 53 | + </block> | |
| 54 | + <block wx:if="{{item.lbType==5}}"> | |
| 55 | + <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36" lazy-load="true"></image> | |
| 56 | + </block> | |
| 11 | 57 | </view> |
| 12 | - <view class="top_price data-v-3a5b7e36"> | |
| 13 | - <block wx:if="{{giftPrice>0}}"> | |
| 14 | - <text class="data-v-3a5b7e36">{{"¥"+giftPrice}}</text> | |
| 58 | + <view class="box_ware_item data-v-3a5b7e36"> | |
| 59 | + <view class="box_ware_item_title data-v-3a5b7e36"> | |
| 60 | + <text class="data-v-3a5b7e36">{{item.couponName}}</text> | |
| 61 | + </view> | |
| 62 | + <view class="box_ware_item_price data-v-3a5b7e36"> | |
| 63 | + <text class="data-v-3a5b7e36"></text> | |
| 64 | + </view> | |
| 65 | + <view class="box_ware_item_qty data-v-3a5b7e36"> | |
| 66 | + <text class="data-v-3a5b7e36 ellipsis-1">{{"数量:"+item.num}}</text> | |
| 67 | + </view> | |
| 68 | + <view class="box_ware_code data-v-3a5b7e36"> | |
| 69 | + <block wx:if="{{isBuy==0&item.lbType==1}}"> | |
| 70 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" lazy-load="true" bindtap="__e" class="data-v-3a5b7e36"></image> | |
| 15 | 71 | </block> |
| 16 | - <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | |
| 17 | - <text class="data-v-3a5b7e36">/</text> | |
| 72 | + <block wx:if="{{isBuy==0&item.lbType==2}}"> | |
| 73 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image> | |
| 74 | + </block> | |
| 75 | + <block wx:if="{{isBuy==0&item.lbType==3}}"> | |
| 76 | + <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" bindtap="__e" class="data-v-3a5b7e36" lazy-load="true"></image> | |
| 18 | 77 | </block> |
| 19 | - <block wx:if="{{giftIntegral>0}}"> | |
| 20 | - <text class="data-v-3a5b7e36">{{giftIntegral+"积分"}}</text> | |
| 78 | + <block wx:if="{{isBuy==0&item.lbType>3}}"> | |
| 79 | + <text class="data-v-3a5b7e36">已自动到账</text> | |
| 21 | 80 | </block> |
| 22 | - <block wx:if="{{giftType>0}}"> | |
| 23 | - <text class="data-v-3a5b7e36">{{actTitle}}</text> | |
| 24 | - </block> | |
| 25 | - </view> | |
| 26 | - <view class="top_foot data-v-3a5b7e36"> | |
| 27 | - <view class="top_foot_price data-v-3a5b7e36"> | |
| 28 | - <text class="data-v-3a5b7e36">{{"原价:"+giftPosPrice+"元"}}</text> | |
| 29 | - </view> | |
| 30 | - <view class="top_foot_qty data-v-3a5b7e36"> | |
| 31 | - <text class="data-v-3a5b7e36">{{"已售:"+giftQty+"件"}}</text> | |
| 32 | - </view> | |
| 81 | + </view> | |
| 33 | 82 | </view> |
| 83 | + </view> | |
| 84 | + </block> | |
| 85 | + </view> | |
| 86 | + <view class="foot_box data-v-3a5b7e36"> | |
| 87 | + <view class="foot_box_title data-v-3a5b7e36"> | |
| 88 | + <text class="data-v-3a5b7e36">活动说明</text> | |
| 34 | 89 | </view> |
| 35 | - <view class="box_ware data-v-3a5b7e36"> | |
| 36 | - <view class="box_ware_title data-v-3a5b7e36"> | |
| 37 | - <text class="data-v-3a5b7e36">礼包内容</text> | |
| 38 | - </view> | |
| 39 | - <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> | |
| 40 | - <view class="box_ware_box data-v-3a5b7e36"> | |
| 41 | - <view class="box_ware_img data-v-3a5b7e36"> | |
| 42 | - <block wx:if="{{item.lbType==1}}"> | |
| 43 | - <image src="{{item.wareImage==''?iurl+'/miniapp/images/giftbag/gift01.png':iurl+item.wareImage}}" class="data-v-3a5b7e36"></image> | |
| 44 | - </block> | |
| 45 | - <block wx:if="{{item.lbType==2}}"> | |
| 46 | - <image src="{{iurl+'/miniapp/images/giftbag/gift05.png'}}" class="data-v-3a5b7e36"></image> | |
| 47 | - </block> | |
| 48 | - <block wx:if="{{item.lbType==3}}"> | |
| 49 | - <image src="{{iurl+'/miniapp/images/giftbag/gift02.png'}}" class="data-v-3a5b7e36"></image> | |
| 50 | - </block> | |
| 51 | - <block wx:if="{{item.lbType==4}}"> | |
| 52 | - <image src="{{iurl+'/miniapp/images/giftbag/gift03.png'}}" class="data-v-3a5b7e36"></image> | |
| 53 | - </block> | |
| 54 | - <block wx:if="{{item.lbType==5}}"> | |
| 55 | - <image src="{{iurl+'/miniapp/images/giftbag/gift04.png'}}" class="data-v-3a5b7e36"></image> | |
| 56 | - </block> | |
| 57 | - </view> | |
| 58 | - <view class="box_ware_item data-v-3a5b7e36"> | |
| 59 | - <view class="box_ware_item_title data-v-3a5b7e36"> | |
| 60 | - <text class="data-v-3a5b7e36">{{item.couponName}}</text> | |
| 61 | - </view> | |
| 62 | - <view class="box_ware_item_price data-v-3a5b7e36"> | |
| 63 | - <text class="data-v-3a5b7e36"></text> | |
| 64 | - </view> | |
| 65 | - <view class="box_ware_item_qty data-v-3a5b7e36"> | |
| 66 | - <text class="data-v-3a5b7e36">{{"数量:"+item.num}}</text> | |
| 67 | - </view> | |
| 68 | - <view class="box_ware_code data-v-3a5b7e36"> | |
| 69 | - <block wx:if="{{isBuy==0&item.lbType==1}}"> | |
| 70 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetQrCode',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | |
| 71 | - </block> | |
| 72 | - <block wx:if="{{isBuy==0&item.lbType==2}}"> | |
| 73 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetWebHttp',[0]]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | |
| 74 | - </block> | |
| 75 | - <block wx:if="{{isBuy==0&item.lbType==3}}"> | |
| 76 | - <image src="{{iurl+'/miniapp/images/giftbag/gift06.png'}}" data-event-opts="{{[['tap',[['GetWebHttp',[1]]]]]}}" bindtap="__e" class="data-v-3a5b7e36"></image> | |
| 77 | - </block> | |
| 78 | - <block wx:if="{{isBuy==0&item.lbType>3}}"> | |
| 79 | - <text class="data-v-3a5b7e36">已自动到账</text> | |
| 80 | - </block> | |
| 81 | - </view> | |
| 82 | - </view> | |
| 83 | - </view> | |
| 84 | - </block> | |
| 90 | + <view class="foot_box_remark data-v-3a5b7e36"> | |
| 91 | + <rich-text nodes="{{giftRemark}}"></rich-text> | |
| 85 | 92 | </view> |
| 86 | - <view class="foot_box data-v-3a5b7e36"> | |
| 87 | - <view class="foot_box_title data-v-3a5b7e36"> | |
| 88 | - <text class="data-v-3a5b7e36">活动说明</text> | |
| 93 | + </view> | |
| 94 | + <view class="foot_empty data-v-3a5b7e36"></view> | |
| 95 | + <block wx:if="{{isBuy==1}}"> | |
| 96 | + <view class="foot_button data-v-3a5b7e36"> | |
| 97 | + <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | |
| 98 | + <view class="foot_button_left data-v-3a5b7e36"> | |
| 99 | + <text bindtap="GetBuyPrice" class="data-v-3a5b7e36" data-id="{{lbId}}">立即购买</text> | |
| 89 | 100 | </view> |
| 90 | - <view class="foot_box_remark data-v-3a5b7e36"> | |
| 91 | - <rich-text nodes="{{giftRemark}}"></rich-text> | |
| 101 | + </block> | |
| 102 | + <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | |
| 103 | + <view class="foot_button_right data-v-3a5b7e36"> | |
| 104 | + <text bindtap="GetBuyIntegral" class="data-v-3a5b7e36" data-id="{{lbId}}">立即兑换</text> | |
| 92 | 105 | </view> |
| 93 | - </view> | |
| 94 | - <view class="foot_empty data-v-3a5b7e36"></view> | |
| 95 | - <block wx:if="{{isBuy==1}}"> | |
| 96 | - <view class="foot_button data-v-3a5b7e36"> | |
| 97 | - <block wx:if="{{giftPrice>0&&giftIntegral>0}}"> | |
| 98 | - <view class="foot_button_left data-v-3a5b7e36"> | |
| 99 | - <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> | |
| 100 | - </view> | |
| 101 | - </block> | |
| 102 | - <block wx:if="{{giftPrice>0 && giftIntegral>0}}"> | |
| 103 | - <view class="foot_button_right data-v-3a5b7e36"> | |
| 104 | - <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> | |
| 105 | - </view> | |
| 106 | - </block> | |
| 107 | - <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> | |
| 108 | - <view class="foot_button_buy data-v-3a5b7e36"> | |
| 109 | - <text data-event-opts="{{[['tap',[['GetBuyPrice',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即购买</text> | |
| 110 | - </view> | |
| 111 | - </block> | |
| 112 | - <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> | |
| 113 | - <view class="foot_button_intalge data-v-3a5b7e36"> | |
| 114 | - <text data-event-opts="{{[['tap',[['GetBuyIntegral',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即兑换</text> | |
| 115 | - </view> | |
| 116 | - </block> | |
| 106 | + </block> | |
| 107 | + <block wx:if="{{giftPrice>0 && giftIntegral<=0}}"> | |
| 108 | + <view class="foot_button_buy data-v-3a5b7e36"> | |
| 109 | + <text bindtap="GetBuyPrice" class="data-v-3a5b7e36" data-id="{{lbId}}">立即购买</text> | |
| 117 | 110 | </view> |
| 118 | - </block> | |
| 119 | - <block wx:if="{{isBuy==0}}"> | |
| 120 | - <view class="foot_button data-v-3a5b7e36"> | |
| 121 | - <view class="foot_button_buy data-v-3a5b7e36"> | |
| 122 | - <text data-event-opts="{{[['tap',[['GetQrCode',['$event']]]]]}}" bindtap="__e" class="data-v-3a5b7e36">立即使用</text> | |
| 123 | - </view> | |
| 111 | + </block> | |
| 112 | + <block wx:if="{{giftPrice<=0 && giftIntegral>0}}"> | |
| 113 | + <view class="foot_button_intalge data-v-3a5b7e36"> | |
| 114 | + <text bindtap="GetBuyIntegral" class="data-v-3a5b7e36" data-id="{{lbId}}">立即兑换</text> | |
| 124 | 115 | </view> |
| 125 | - </block> | |
| 116 | + </block> | |
| 117 | + </view> | |
| 118 | + </block> | |
| 119 | + <block wx:if="{{isBuy==0}}"> | |
| 120 | + <view class="foot_button data-v-3a5b7e36"> | |
| 121 | + <view class="foot_button_buy data-v-3a5b7e36"> | |
| 122 | + <text bindtap="__e" class="data-v-3a5b7e36">立即使用</text> | |
| 123 | + </view> | |
| 124 | + </view> | |
| 125 | + </block> | |
| 126 | 126 | </view> |
| 127 | 127 | <!-- 引入提示组件 --> |
| 128 | 128 | <warn id="warn"></warn> | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.js
| 1 | +var i = require("../../../utils/util.js") | |
| 1 | 2 | var e = getApp(), |
| 2 | 3 | a = e.globalData.setting, |
| 3 | 4 | os = a, |
| ... | ... | @@ -6,19 +7,24 @@ var e = getApp(), |
| 6 | 7 | Page({ |
| 7 | 8 | data: { |
| 8 | 9 | iurl: a.imghost, //图片前缀网址 |
| 9 | - getDate: new Date().getTime(), | |
| 10 | + getDate: "", | |
| 10 | 11 | getStorageID: '', |
| 11 | 12 | getUserID: '', |
| 12 | 13 | wareCard: [], |
| 13 | 14 | pages: 0, |
| 14 | 15 | pageSize: 10, |
| 15 | - isEmpty: true, | |
| 16 | + isEmpty: false, | |
| 16 | 17 | loadingType: 0, //定义加载方式 0---contentdown 1---contentrefresh 2---contentnomore |
| 17 | 18 | contentText: { |
| 18 | 19 | contentdown: '加载更多', |
| 19 | 20 | contentrefresh: '加载中...', |
| 20 | 21 | contentnomore: '已加载全部' |
| 21 | - } | |
| 22 | + }, | |
| 23 | + ismore:0,//数据是否全部加载完成 | |
| 24 | + is_read:0,//是否查询过我的礼包接口 | |
| 25 | + curpage: 1, //当前分页数 | |
| 26 | + pageSize: 3, //页大小 | |
| 27 | + total: 0, //总数量 | |
| 22 | 28 | }, |
| 23 | 29 | |
| 24 | 30 | onLoad: function(options) { |
| ... | ... | @@ -27,21 +33,26 @@ Page({ |
| 27 | 33 | var th = this; |
| 28 | 34 | th.setData({ |
| 29 | 35 | getStorageID: a.stoid, |
| 30 | - getUserID: 5682130 | |
| 36 | + getUserID: d.user_id, | |
| 37 | + pages: 1, | |
| 38 | + pageSize: 3, | |
| 39 | + loadingType: 0, | |
| 40 | + getDate: i.formatTime(new Date().getTime()) | |
| 31 | 41 | }) |
| 42 | + th.getList(); | |
| 32 | 43 | }, |
| 33 | 44 | onShow: function() { |
| 34 | 45 | // this.pages = 1; |
| 35 | 46 | // this.pageSize = 10; |
| 36 | 47 | // this.loadingType = 0; |
| 37 | 48 | // this.getList(); |
| 38 | - var th = this; | |
| 39 | - th.setData({ | |
| 40 | - pages: 1, | |
| 41 | - pageSize: 10, | |
| 42 | - loadingType: 0 | |
| 43 | - }) | |
| 44 | - th.getList(); | |
| 49 | + // var th = this; | |
| 50 | + // th.setData({ | |
| 51 | + // pages: 1, | |
| 52 | + // pageSize: 10, | |
| 53 | + // loadingType: 0 | |
| 54 | + // }) | |
| 55 | + // th.getList(); | |
| 45 | 56 | }, |
| 46 | 57 | // methods: { |
| 47 | 58 | // BuyGift: function BuyGift() { |
| ... | ... | @@ -60,96 +71,117 @@ Page({ |
| 60 | 71 | |
| 61 | 72 | // }, |
| 62 | 73 | getList: function() { |
| 63 | - var _this = this; //上拉加载 | |
| 64 | - var that = this.data; | |
| 65 | - if (that.loadingType != 0) { | |
| 66 | - return false; | |
| 67 | - } | |
| 68 | - // that.loadingType = 1; | |
| 69 | - _this.setData({ | |
| 70 | - loadingType: 1 | |
| 71 | - }) | |
| 74 | + var th = this; | |
| 75 | + // if (th.data.loadingType) { | |
| 76 | + // return false; | |
| 77 | + // } | |
| 78 | + // // that.loadingType = 1; | |
| 79 | + // th.setData({ | |
| 80 | + // loadingType: 1 | |
| 81 | + // }) | |
| 72 | 82 | getApp().request.get('/api/weshop/marketing/my/giftbag/page', { |
| 73 | 83 | data: { |
| 74 | 84 | // "storeId": this.getStorageID, //商家ID |
| 75 | 85 | // "userId": this.getUserID, //用户ID |
| 76 | 86 | // "page": this.pages, |
| 77 | 87 | // "pageSize": this.pageSize |
| 78 | - "storeId": that.getStorageID, //商家ID | |
| 79 | - "userId": that.getUserID, //用户ID | |
| 80 | - "page": that.pages, | |
| 81 | - "pageSize": that.pageSize | |
| 88 | + storeId: th.data.getStorageID, //商家ID | |
| 89 | + userId: th.data.getUserID, //用户ID | |
| 90 | + page: th.data.curpage, | |
| 91 | + pageSize: th.data.pageSize | |
| 82 | 92 | }, |
| 83 | 93 | success: function success(res) { |
| 94 | + wx.hideLoading(); | |
| 84 | 95 | if (res.data.code == 0) { |
| 85 | - console.log(res.data.data); | |
| 86 | - if (res.data.data.total > 0) { | |
| 87 | - // _this.isEmpty = false; | |
| 88 | - _this.setData({ | |
| 89 | - isEmpty: false | |
| 90 | - }) | |
| 91 | - } else { | |
| 92 | - // _this.isEmpty = true; | |
| 93 | - _this.setData({ | |
| 94 | - isEmpty: true | |
| 95 | - }) | |
| 96 | - } | |
| 97 | - if (res.data.data.pageData.length == 0) { | |
| 98 | - // _this.loadingType = 2; | |
| 99 | - _this.setData({ | |
| 100 | - loadingType: 2 | |
| 101 | - }) | |
| 102 | - } else { | |
| 103 | - // console.log(_this.wareCard.length); | |
| 104 | - // console.log(res.data.data.pageData.length); | |
| 105 | - var wareCard = that.wareCard; | |
| 106 | - // if (_this.wareCard.length < res.data.data.pageData.length) { | |
| 107 | - if (wareCard.length < res.data.data.total) { | |
| 108 | - for (var i = 0; i < res.data.data.pageData.length; i++) { | |
| 109 | - wareCard.push(res.data.data.pageData[i]); | |
| 110 | - } | |
| 111 | - } | |
| 112 | - _this.setData({ | |
| 113 | - wareCard: wareCard | |
| 114 | - }) | |
| 115 | - | |
| 116 | - // _this.loadingType = 0; | |
| 117 | - _this.setData({ | |
| 118 | - loadingType: 0 | |
| 119 | - }) | |
| 120 | - console.log(_this.wareCard); | |
| 121 | - } | |
| 96 | + th.data.curpage++; | |
| 97 | + var arr1 = th.data.wareCard; | |
| 98 | + var arr2 = res.data.data.pageData; | |
| 99 | + var arr3 = [...arr1, ...arr2]; | |
| 100 | + var ismore = 0; | |
| 101 | + if (arr3.length == res.data.data.total) ismore = 1 | |
| 102 | + th.setData({ | |
| 103 | + wareCard: arr3, | |
| 104 | + total: res.data.data.total, | |
| 105 | + ismore: ismore, | |
| 106 | + is_read:1 | |
| 107 | + }), wx.stopPullDownRefresh(); //停止下拉刷新 | |
| 122 | 108 | } else { |
| 123 | - console.log(res.data.msg); | |
| 109 | + th.setData({ | |
| 110 | + is_read: 1 | |
| 111 | + }) | |
| 124 | 112 | } |
| 113 | + // if (res.data.code == 0) { | |
| 114 | + // if (res.data.data.total > 0) { | |
| 115 | + // // _this.isEmpty = false; | |
| 116 | + // _this.setData({ | |
| 117 | + // isEmpty: false | |
| 118 | + // }) | |
| 119 | + // } else { | |
| 120 | + // // _this.isEmpty = true; | |
| 121 | + // _this.setData({ | |
| 122 | + // isEmpty: true | |
| 123 | + // }) | |
| 124 | + // } | |
| 125 | + // if (res.data.data.pageData.length == 0) { | |
| 126 | + // // _this.loadingType = 2; | |
| 127 | + // _this.setData({ | |
| 128 | + // loadingType: 2 | |
| 129 | + // }) | |
| 130 | + // } else { | |
| 131 | + // var wareCard = that.wareCard; | |
| 132 | + // var is_resad = 0; | |
| 133 | + // // if (_this.wareCard.length < res.data.data.pageData.length) { | |
| 134 | + // if (wareCard.length < res.data.data.total) { | |
| 135 | + // for (var i = 0; i < res.data.data.pageData.length; i++) { | |
| 136 | + // wareCard.push(res.data.data.pageData[i]); | |
| 137 | + // } | |
| 138 | + // }else{ | |
| 139 | + // is_resad=1 | |
| 140 | + // } | |
| 141 | + // _this.setData({ | |
| 142 | + // wareCard: wareCard, | |
| 143 | + // is_resad: is_resad | |
| 144 | + // }) | |
| 145 | + | |
| 146 | + // // _this.loadingType = 0; | |
| 147 | + // _this.setData({ | |
| 148 | + // loadingType: 0 | |
| 149 | + // }) | |
| 150 | + // } | |
| 151 | + // } else { | |
| 152 | + | |
| 153 | + // } | |
| 125 | 154 | } |
| 155 | + | |
| 126 | 156 | }); |
| 127 | 157 | |
| 128 | 158 | }, |
| 129 | - TimeToDate: function(num) { //时间戳数据处理 是按秒来转换 | |
| 130 | - var date = new Date(num * 1000); | |
| 131 | - //时间戳为10位需*1000,时间戳为13位的话不需乘1000 | |
| 132 | - var y = date.getFullYear(); | |
| 133 | - var MM = date.getMonth() + 1; | |
| 134 | - MM = MM < 10 ? '0' + MM : MM; //月补0 | |
| 135 | - var d = date.getDate(); | |
| 136 | - d = d < 10 ? '0' + d : d; //天补0 | |
| 137 | - var h = date.getHours(); | |
| 138 | - h = h < 10 ? '0' + h : h; //小时补0 | |
| 139 | - var m = date.getMinutes(); | |
| 140 | - m = m < 10 ? '0' + m : m; //分钟补0 | |
| 141 | - var s = date.getSeconds(); | |
| 142 | - s = s < 10 ? '0' + s : s; //秒补0 | |
| 143 | - return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; | |
| 159 | + //销毁界面跳转 | |
| 160 | + redirectTo: function (e) { | |
| 161 | + var th = this; | |
| 162 | + var url = e.currentTarget.dataset.url; | |
| 163 | + //销毁跳转 | |
| 164 | + wx.redirectTo({ | |
| 165 | + url: url | |
| 166 | + }); | |
| 144 | 167 | }, |
| 145 | - DateToTime: function DateToTime(TimeNum) { //时间转换成时间戳 | |
| 146 | - var Time = new Date(TimeNum); | |
| 147 | - return Time.getTime() / 1000; | |
| 168 | + //不销毁界面跳转 | |
| 169 | + navigateTo: function (e) { | |
| 170 | + var th = this; | |
| 171 | + var url = e.currentTarget.dataset.url; | |
| 172 | + wx.navigateTo({ | |
| 173 | + url: url, | |
| 174 | + }) | |
| 148 | 175 | }, |
| 149 | - goto: function(e) { | |
| 176 | + //下拉事件 | |
| 177 | + onReachBottom: function () { | |
| 150 | 178 | var th = this; |
| 151 | - var url = e.currentTarget.dataset.url; | |
| 152 | - getApp().goto(url); | |
| 153 | - } | |
| 179 | + if (th.data.total <= th.data.pageSize) return; | |
| 180 | + if (th.data.ismore) return; | |
| 181 | + wx.showLoading({ | |
| 182 | + title: '加载中...', | |
| 183 | + }) | |
| 184 | + th.getList(); | |
| 185 | + }, | |
| 154 | 186 | |
| 155 | 187 | }); |
| 156 | 188 | \ No newline at end of file | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.wxml
| 1 | 1 | <view class="top_img"> |
| 2 | 2 | <view class="top_img"> |
| 3 | 3 | <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift00.jpg'}}"></image> --> |
| 4 | - <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}"></image> | |
| 4 | + <image src="{{iurl+'/miniapp/images/giftbag/gift00.jpg'}}" lazy-load="true"></image> | |
| 5 | 5 | </view> |
| 6 | 6 | <view class="top_title"> |
| 7 | 7 | <view class="top_title_box"> |
| 8 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" class="top_title_blacktext" bindtap="goto" data-url="/pages/giftpack/buygiftpack/giftpackbuy">礼包列表</text> | |
| 8 | + <text class="top_title_blacktext" bindtap="redirectTo" data-url="/pages/giftpack/buygiftpack/giftpackbuy">礼包列表</text> | |
| 9 | 9 | </view> |
| 10 | 10 | <view class="top_title_box_S"></view> |
| 11 | 11 | <view class="top_title_box"> |
| ... | ... | @@ -14,14 +14,13 @@ |
| 14 | 14 | </view> |
| 15 | 15 | <block wx:for="{{wareCard}}" wx:for-item="item" wx:for-index="index" wx:key="index"> |
| 16 | 16 | <view class="content_box"> |
| 17 | - <view class="content_box_ware"> | |
| 18 | - <view data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" class="content_box_img" bindtap="__e"> | |
| 17 | + <view class="content_box_ware" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}"> | |
| 18 | + <view class="content_box_img"> | |
| 19 | 19 | <!-- <image src="{{$GetInfo.imgHttp+item.$orig.lbUrl}}"></image> --> |
| 20 | - <image src="{{iurl+item.lbUrl}}"></image> | |
| 20 | + <image src="{{iurl+item.lbUrl}}" lazy-load="true"></image> | |
| 21 | 21 | <block wx:if="{{item.actType!=0}}"> |
| 22 | 22 | <view class="{{[item.actType==1?'content_box_img_title content_box_img_ground1':item.actType==2?'content_box_img_title content_box_img_ground2':item.actType==4?'content_box_img_title content_box_img_ground3':'content_box_img_title content_box_img_ground4']}}"> |
| 23 | - <!-- <image src="{{$GetInfo.imgHttp+'/miniapp/images/giftbag/gift01.png'}}"></image> --> | |
| 24 | - <image src="{{iurl+'/miniapp/images/giftbag/gift01.png'}}"></image> | |
| 23 | + <image src="{{iurl+'/miniapp/images/giftbag/gift01.png'}}" lazy-load="true"></image> | |
| 25 | 24 | <!-- <block wx:if="{{item.$orig.actType==1}}"> --> |
| 26 | 25 | <block wx:if="{{item.actType==1}}"> |
| 27 | 26 | <text>新人有礼</text> |
| ... | ... | @@ -43,7 +42,7 @@ |
| 43 | 42 | </view> |
| 44 | 43 | <view class="content_box_title"> |
| 45 | 44 | <view class="content_ware_title"> |
| 46 | - <text data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" bindtap="__e">{{item.giftTitle}}</text> | |
| 45 | + <text bindtap="__e">{{item.giftTitle}}</text> | |
| 47 | 46 | </view> |
| 48 | 47 | <view class="content_ware_type"> |
| 49 | 48 | <block wx:if="{{item.actType==0&item.payMoney>0}}"> |
| ... | ... | @@ -72,37 +71,44 @@ |
| 72 | 71 | <text>{{"原价:¥"+item.giftPosPrice}}</text> |
| 73 | 72 | </view> |
| 74 | 73 | <view class="content_ware_time"> |
| 75 | - <!-- <block wx:if="{{getDate>item.endTime}}"> --> | |
| 76 | - <!-- <text>{{"兑换截至日期:"+item.endTime}}</text> --> | |
| 77 | - <text>{{"兑换截至日期:"+getDate}}</text> | |
| 78 | - <!-- </block> --> | |
| 74 | + <block wx:if="{{getDate>item.endTime}}"> | |
| 75 | + <text>{{"兑换截至日期:"+item.endTime}}</text> | |
| 76 | + </block> | |
| 79 | 77 | <block wx:if="{{getDate<item.starTime}}"> |
| 80 | 78 | <text>{{"距兑换开始时间: "+item.starTime}}</text> |
| 81 | 79 | </block> |
| 82 | 80 | </view> |
| 83 | 81 | </view> |
| 84 | 82 | </view> |
| 85 | - <view class="content_box_button"> | |
| 86 | - <button data-event-opts="{{[['tap',[['GetGiftPackList',['$0','$1'],[[['wareCard','',index,'orderSn']],[['wareCard','',index]]]]]]]}}" bindtap="__e">立即使用</button> | |
| 83 | + <view class="content_box_button" bindtap="navigateTo" data-url="/pages/giftpack/giftpacklist/giftpacklist?isBuy=0&lbId={{item.lbId}}&orderSn={{item.orderSn}}"> | |
| 84 | + <button>立即使用</button> | |
| 87 | 85 | </view> |
| 88 | 86 | </view> |
| 89 | 87 | </block> |
| 90 | - <block wx:if="{{this.isEmpty==true}}"> | |
| 88 | + <block wx:if="{{is_read && wareCard.length<1}}"> | |
| 91 | 89 | <view class="foot_empty"> |
| 92 | 90 | <view> |
| 93 | - <image src="../../static/img/gift07.png"></image> | |
| 91 | + <image src="{{iurl+'/miniapp/images/giftbag/gift07.png'}}" lazy-load="true"></image> | |
| 94 | 92 | </view> |
| 95 | 93 | <view> |
| 96 | 94 | <text>当前暂无礼包</text> |
| 97 | 95 | </view> |
| 98 | 96 | <view class="foot_empty_button"> |
| 99 | - <text data-event-opts="{{[['tap',[['BuyGift',['$event']]]]]}}" bindtap="__e">去获取</text> | |
| 97 | + <text bindtap="__e">去获取</text> | |
| 100 | 98 | </view> |
| 101 | 99 | </view> |
| 102 | 100 | </block> |
| 103 | - <view class="foot_box"> | |
| 101 | + <block wx:if="{{ismore}}"> | |
| 102 | + <!-- <view class="foot_box"> | |
| 104 | 103 | <text>———— 到底了 ————</text> |
| 105 | - </view> | |
| 104 | + </view> --> | |
| 105 | + <!-- 加载完毕并且数据大于=页大小 --> | |
| 106 | + <view class="After_all flex-center" wx:if="{{ismore && wareCard.length>=3}}"> | |
| 107 | + <view class="Line"></view> | |
| 108 | + <view class="end fs26">到底了</view> | |
| 109 | + <view class="Line"></view> | |
| 110 | + </view> | |
| 111 | + </block> | |
| 106 | 112 | </view> |
| 107 | 113 | <!-- 引入提示组件 --> |
| 108 | 114 | <warn id="warn"></warn> | ... | ... |
pages/giftpack/mygiftpack/mygiftpack.wxss
| 1 | - | |
| 2 | - | |
| 3 | 1 | /*引用样式路径*/ |
| 4 | 2 | @charset "UTF-8"; |
| 3 | + | |
| 5 | 4 | /* Author XGQ |
| 6 | 5 | * 2019-11-12 |
| 7 | 6 | */ |
| 7 | + | |
| 8 | 8 | .top_img { |
| 9 | - -webkit-align-content: center; | |
| 10 | - align-content: center; | |
| 9 | + -webkit-align-content: center; | |
| 10 | + align-content: center; | |
| 11 | 11 | } |
| 12 | + | |
| 12 | 13 | .top_img image { |
| 13 | - width: 100%; | |
| 14 | - height: 660rpx; | |
| 14 | + width: 100%; | |
| 15 | + height: 660rpx; | |
| 15 | 16 | } |
| 17 | + | |
| 16 | 18 | .top_title { |
| 17 | - display: -webkit-box; | |
| 18 | - display: -webkit-flex; | |
| 19 | - display: flex; | |
| 20 | - background-color: #FFFFFF; | |
| 21 | - height: 85rpx; | |
| 22 | - border-radius: 10rpx 10rpx 0rpx 0rpx; | |
| 23 | - margin: 0rpx 20rpx 0rpx 20rpx; | |
| 24 | - -webkit-align-content: center; | |
| 25 | - align-content: center; | |
| 19 | + display: -webkit-box; | |
| 20 | + display: -webkit-flex; | |
| 21 | + display: flex; | |
| 22 | + background-color: #fff; | |
| 23 | + height: 85rpx; | |
| 24 | + border-radius: 10rpx 10rpx 0rpx 0rpx; | |
| 25 | + margin: 0rpx 20rpx 0rpx 20rpx; | |
| 26 | + -webkit-align-content: center; | |
| 27 | + align-content: center; | |
| 28 | + margin-bottom: 10rpx; | |
| 26 | 29 | } |
| 30 | + | |
| 27 | 31 | .top_title_box { |
| 28 | - width: 49%; | |
| 29 | - -webkit-align-content: center; | |
| 30 | - align-content: center; | |
| 31 | - text-align: center; | |
| 32 | - padding: 15rpx; | |
| 32 | + width: 49%; | |
| 33 | + -webkit-align-content: center; | |
| 34 | + align-content: center; | |
| 35 | + text-align: center; | |
| 36 | + padding: 15rpx; | |
| 33 | 37 | } |
| 38 | + | |
| 34 | 39 | .top_title_box_S { |
| 35 | - width: 1%; | |
| 36 | - -webkit-align-content: center; | |
| 37 | - align-content: center; | |
| 38 | - text-align: center; | |
| 39 | - margin: 20rpx 0rpx 20rpx 0rpx; | |
| 40 | - border-left: #000000 solid 3rpx; | |
| 40 | + width: 1%; | |
| 41 | + -webkit-align-content: center; | |
| 42 | + align-content: center; | |
| 43 | + text-align: center; | |
| 44 | + margin: 20rpx 0rpx 20rpx 0rpx; | |
| 45 | + border-left: #000 solid 3rpx; | |
| 41 | 46 | } |
| 47 | + | |
| 42 | 48 | .top_title_redtext { |
| 43 | - font-size: 30rpx; | |
| 44 | - color: #d61b30; | |
| 49 | + font-size: 30rpx; | |
| 50 | + color: #d61b30; | |
| 45 | 51 | } |
| 52 | + | |
| 46 | 53 | .top_title_blacktext { |
| 47 | - font-size: 30rpx; | |
| 48 | - color: #000000; | |
| 54 | + font-size: 30rpx; | |
| 55 | + color: #000; | |
| 49 | 56 | } |
| 57 | + | |
| 50 | 58 | .content_box { |
| 51 | - background-color: #FFFFFF; | |
| 52 | - height: 375rpx; | |
| 53 | - margin: 10rpx 20rpx 0rpx 20rpx; | |
| 54 | - border-radius: 10rpx; | |
| 59 | + background-color: #fff; | |
| 60 | + height: 375rpx; | |
| 61 | + margin: 0rpx 20rpx; | |
| 62 | + border-radius: 10rpx; | |
| 63 | + margin-bottom: 10rpx; | |
| 55 | 64 | } |
| 65 | + | |
| 56 | 66 | .content_box_ware { |
| 57 | - border-bottom: #f5f5f5 solid 2rpx; | |
| 58 | - display: -webkit-box; | |
| 59 | - display: -webkit-flex; | |
| 60 | - display: flex; | |
| 67 | + border-bottom: #f5f5f5 solid 2rpx; | |
| 68 | + display: -webkit-box; | |
| 69 | + display: -webkit-flex; | |
| 70 | + display: flex; | |
| 61 | 71 | } |
| 72 | + | |
| 62 | 73 | .content_box_img { |
| 63 | - margin: 20rpx 20rpx 20rpx 25rpx; | |
| 64 | - width: 35%; | |
| 65 | - display: -webkit-box; | |
| 66 | - display: -webkit-flex; | |
| 67 | - display: flex; | |
| 68 | - font-size: 8rpx; | |
| 69 | - position: relative; | |
| 74 | + margin: 20rpx 20rpx 20rpx 25rpx; | |
| 75 | + width: 35%; | |
| 76 | + display: -webkit-box; | |
| 77 | + display: -webkit-flex; | |
| 78 | + display: flex; | |
| 79 | + font-size: 8rpx; | |
| 80 | + position: relative; | |
| 70 | 81 | } |
| 82 | + | |
| 71 | 83 | .content_box_img image { |
| 72 | - width: 100%; | |
| 73 | - height: 230rpx; | |
| 84 | + width: 100%; | |
| 85 | + height: 230rpx; | |
| 74 | 86 | } |
| 87 | + | |
| 75 | 88 | .content_box_img_title { |
| 76 | - position: absolute; | |
| 77 | - background: #D01119; | |
| 78 | - display: -webkit-box; | |
| 79 | - display: -webkit-flex; | |
| 80 | - display: flex; | |
| 81 | - padding: 8rpx; | |
| 82 | - border-radius: 0rpx 0rpx 10rpx 0rpx; | |
| 89 | + position: absolute; | |
| 90 | + background: #d01119; | |
| 91 | + display: -webkit-box; | |
| 92 | + display: -webkit-flex; | |
| 93 | + display: flex; | |
| 94 | + padding: 8rpx; | |
| 95 | + border-radius: 0rpx 0rpx 10rpx 0rpx; | |
| 83 | 96 | } |
| 84 | -.content_box_img_ground1{ | |
| 85 | - background: #fb6451; | |
| 97 | + | |
| 98 | +.content_box_img_ground1 { | |
| 99 | + background: #fb6451; | |
| 86 | 100 | } |
| 87 | -.content_box_img_ground2{ | |
| 88 | - background: #ffb72d; | |
| 101 | + | |
| 102 | +.content_box_img_ground2 { | |
| 103 | + background: #ffb72d; | |
| 89 | 104 | } |
| 90 | -.content_box_img_ground3{ | |
| 91 | - background: #9be0e5; | |
| 105 | + | |
| 106 | +.content_box_img_ground3 { | |
| 107 | + background: #9be0e5; | |
| 92 | 108 | } |
| 93 | -.content_box_img_ground4{ | |
| 94 | - background: #4784ef; | |
| 109 | + | |
| 110 | +.content_box_img_ground4 { | |
| 111 | + background: #4784ef; | |
| 95 | 112 | } |
| 113 | + | |
| 96 | 114 | .content_box_img_title image { |
| 97 | - width: 30rpx; | |
| 98 | - height: 30rpx; | |
| 115 | + width: 30rpx; | |
| 116 | + height: 30rpx; | |
| 99 | 117 | } |
| 118 | + | |
| 100 | 119 | .content_box_img_title text { |
| 101 | - font-size: 20rpx; | |
| 102 | - color: #FFFFFF; | |
| 103 | - line-height: 25rpx; | |
| 104 | - padding-top: 5rpx; | |
| 120 | + font-size: 20rpx; | |
| 121 | + color: #fff; | |
| 122 | + line-height: 25rpx; | |
| 123 | + padding-top: 5rpx; | |
| 105 | 124 | } |
| 125 | + | |
| 106 | 126 | .content_box_title { |
| 107 | - width: 65%; | |
| 108 | - margin: 25rpx 25rpx 10rpx 0rpx; | |
| 109 | - position: relative; | |
| 127 | + width: 65%; | |
| 128 | + margin: 25rpx 25rpx 10rpx 0rpx; | |
| 129 | + position: relative; | |
| 110 | 130 | } |
| 131 | + | |
| 111 | 132 | .content_ware_title { |
| 112 | - font-size: 30rpx; | |
| 113 | - word-break: break-all; | |
| 114 | - /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | |
| 115 | - text-overflow: ellipsis; | |
| 116 | - display: -webkit-box; | |
| 117 | - /** 对象作为伸缩盒子模型显示 **/ | |
| 118 | - -webkit-box-orient: vertical; | |
| 119 | - /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | |
| 120 | - -webkit-line-clamp: 2; | |
| 121 | - /** 显示的行数 **/ | |
| 122 | - overflow: hidden; | |
| 123 | - /** 隐藏超出的内容 **/ | |
| 133 | + font-size: 30rpx; | |
| 134 | + word-break: break-all; | |
| 135 | + /*属性规定自动换行的处理方法。normal(使用浏览器默认的换行规则。),break-all(允许在单词内换行。),keep-all(只能在半角空格或连字符处换行。)*/ | |
| 136 | + text-overflow: ellipsis; | |
| 137 | + display: -webkit-box; | |
| 138 | + /** 对象作为伸缩盒子模型显示 **/ | |
| 139 | + -webkit-box-orient: vertical; | |
| 140 | + /** 设置或检索伸缩盒对象的子元素的排列方式 **/ | |
| 141 | + -webkit-line-clamp: 2; | |
| 142 | + /** 显示的行数 **/ | |
| 143 | + overflow: hidden; | |
| 144 | + /** 隐藏超出的内容 **/ | |
| 124 | 145 | } |
| 146 | + | |
| 125 | 147 | .content_ware_type { |
| 126 | - font-size: 28rpx; | |
| 127 | - color: #c61a34; | |
| 128 | - margin-top: 10rpx; | |
| 129 | - position: absolute; | |
| 130 | - left: 0; | |
| 131 | - bottom: 100rpx; | |
| 148 | + font-size: 28rpx; | |
| 149 | + color: #c61a34; | |
| 150 | + margin-top: 10rpx; | |
| 151 | + position: absolute; | |
| 152 | + left: 0; | |
| 153 | + bottom: 100rpx; | |
| 132 | 154 | } |
| 155 | + | |
| 133 | 156 | .content_ware_price { |
| 134 | - font-size: 20rpx; | |
| 135 | - color: #b9b5b5; | |
| 136 | - margin-top: 2rpx; | |
| 137 | - text-decoration: line-through; | |
| 138 | - position: absolute; | |
| 139 | - left: 0; | |
| 140 | - bottom: 70rpx; | |
| 157 | + font-size: 20rpx; | |
| 158 | + color: #b9b5b5; | |
| 159 | + margin-top: 2rpx; | |
| 160 | + text-decoration: line-through; | |
| 161 | + position: absolute; | |
| 162 | + left: 0; | |
| 163 | + bottom: 70rpx; | |
| 141 | 164 | } |
| 165 | + | |
| 142 | 166 | .content_ware_time { |
| 143 | - font-size: 25rpx; | |
| 144 | - color: #c61a34; | |
| 145 | - margin-top: 20rpx; | |
| 146 | - position: absolute; | |
| 147 | - left: 0; | |
| 148 | - bottom: 25rpx; | |
| 167 | + font-size: 25rpx; | |
| 168 | + color: #c61a34; | |
| 169 | + margin-top: 20rpx; | |
| 170 | + position: absolute; | |
| 171 | + left: 0; | |
| 172 | + bottom: 25rpx; | |
| 149 | 173 | } |
| 174 | + | |
| 150 | 175 | .content_box_button { |
| 151 | - text-align: right; | |
| 152 | - margin: 20rpx 25rpx 20rpx 20rpx; | |
| 176 | + text-align: right; | |
| 177 | + margin: 20rpx 25rpx 20rpx 20rpx; | |
| 153 | 178 | } |
| 179 | + | |
| 154 | 180 | .content_box_button button { |
| 155 | - display: inline-block; | |
| 156 | - width: 160rpx; | |
| 157 | - height: 50rpx; | |
| 158 | - font-size: 25rpx; | |
| 159 | - background: #d41c34; | |
| 160 | - color: #FFFFFF; | |
| 161 | - line-height: 50rpx; | |
| 181 | + display: inline-block; | |
| 182 | + width: 160rpx; | |
| 183 | + height: 50rpx; | |
| 184 | + font-size: 25rpx; | |
| 185 | + background: #d41c34; | |
| 186 | + color: #fff; | |
| 187 | + line-height: 50rpx; | |
| 162 | 188 | } |
| 189 | + | |
| 163 | 190 | .foot_box { |
| 164 | - -webkit-align-content: center; | |
| 165 | - align-content: center; | |
| 166 | - text-align: center; | |
| 167 | - margin-top: 15rpx; | |
| 168 | - margin-bottom: 50rpx; | |
| 191 | + -webkit-align-content: center; | |
| 192 | + align-content: center; | |
| 193 | + text-align: center; | |
| 194 | + margin-top: 15rpx; | |
| 195 | + margin-bottom: 50rpx; | |
| 169 | 196 | } |
| 197 | + | |
| 170 | 198 | .foot_box text { |
| 171 | - font-size: 25rpx; | |
| 172 | - color: #FFFFFF; | |
| 173 | -} | |
| 174 | -.foot_empty{ | |
| 175 | - background-color: #FFFFFF; | |
| 176 | - height: 375rpx; | |
| 177 | - margin: 10rpx 20rpx 0rpx 20rpx; | |
| 178 | - border-radius: 10rpx; | |
| 179 | - text-align: center; | |
| 180 | - padding: 150rpx 0rpx 300rpx 0rpx; | |
| 181 | - -webkit-box-pack: center; | |
| 182 | - -webkit-justify-content: center; | |
| 183 | - justify-content: center; | |
| 184 | -} | |
| 185 | -.foot_empty image{ | |
| 186 | - width: 400rpx; | |
| 187 | - height: 273rpx; | |
| 188 | -} | |
| 189 | -.foot_empty text{ | |
| 190 | - font-size: 30rpx; | |
| 191 | - color: #999999; | |
| 192 | -} | |
| 193 | -.foot_empty_button{ | |
| 194 | - background: #ff6363; | |
| 195 | - margin: 60rpx 230rpx 0rpx 230rpx; | |
| 196 | - padding: 10rpx; | |
| 197 | - border-radius: 70rpx; | |
| 198 | - line-height: 40rpx; | |
| 199 | -} | |
| 200 | -.foot_empty_button text{ | |
| 201 | - font-size: 28rpx; | |
| 202 | - color: #FFFFFF; | |
| 199 | + font-size: 25rpx; | |
| 200 | + color: #fff; | |
| 201 | +} | |
| 202 | + | |
| 203 | +.foot_empty { | |
| 204 | + background-color: #fff; | |
| 205 | + height: 375rpx; | |
| 206 | + margin: 10rpx 20rpx 0rpx 20rpx; | |
| 207 | + border-radius: 10rpx; | |
| 208 | + text-align: center; | |
| 209 | + padding: 150rpx 0rpx 300rpx 0rpx; | |
| 210 | + -webkit-box-pack: center; | |
| 211 | + -webkit-justify-content: center; | |
| 212 | + justify-content: center; | |
| 203 | 213 | } |
| 214 | + | |
| 215 | +.foot_empty image { | |
| 216 | + width: 400rpx; | |
| 217 | + height: 273rpx; | |
| 218 | +} | |
| 219 | + | |
| 220 | +.foot_empty text { | |
| 221 | + font-size: 30rpx; | |
| 222 | + color: #999; | |
| 223 | +} | |
| 224 | + | |
| 225 | +.foot_empty_button { | |
| 226 | + background: #ff6363; | |
| 227 | + margin: 60rpx 230rpx 0rpx 230rpx; | |
| 228 | + padding: 10rpx; | |
| 229 | + border-radius: 70rpx; | |
| 230 | + line-height: 40rpx; | |
| 231 | +} | |
| 232 | + | |
| 233 | +.foot_empty_button text { | |
| 234 | + font-size: 28rpx; | |
| 235 | + color: #fff; | |
| 236 | +} | |
| 237 | + | |
| 204 | 238 | page { |
| 205 | - background-color: #fb7454; | |
| 239 | + background-color: #fb7454; | |
| 240 | +} | |
| 241 | +.After_all { | |
| 242 | + height: 80rpx; | |
| 243 | + margin-bottom: 10rpx; | |
| 244 | + color: rgb(255, 255, 255); | |
| 245 | +} | |
| 246 | + | |
| 247 | +.After_all .Line { | |
| 248 | + border-top: 3rpx solid rgb(255, 255, 255); | |
| 249 | + width: 130rpx; | |
| 250 | +} | |
| 251 | + | |
| 252 | +.After_all .end { | |
| 253 | + margin: 0rpx 15rpx; | |
| 206 | 254 | } | ... | ... |
pages/user/index/index.wxml
| ... | ... | @@ -212,14 +212,16 @@ |
| 212 | 212 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/add2.png"></image> |
| 213 | 213 | <view class="four-level-word">我的地址</view> |
| 214 | 214 | </view> |
| 215 | - <view class="item t-c" data-url="/pages/user/my_service/i_service" bindtap="goto_service" > | |
| 215 | + <view class="item t-c" data-url="/pages/user/my_service/i_service" bindtap="goto_service" > | |
| 216 | 216 | <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> |
| 217 | 217 | <view class="four-level-word">我的服务</view> |
| 218 | 218 | </view> |
| 219 | + <view class="item t-c" data-url="/pages/giftpack/mygiftpack/mygiftpack" bindtap="goto"> | |
| 220 | + <image class="xc-center-img " src="{{iurl}}/miniapp/images/yyservice/myservice.png"></image> | |
| 221 | + <view class="four-level-word">我的礼包</view> | |
| 222 | + </view> | |
| 219 | 223 | </view> |
| 220 | 224 | |
| 221 | - | |
| 222 | - | |
| 223 | 225 | </view> |
| 224 | 226 | </view> |
| 225 | 227 | <view style='width:100%;height:73rpx;'> | ... | ... |
utils/request.js
| ... | ... | @@ -8,7 +8,8 @@ module.exports = { |
| 8 | 8 | //"content-type": "application/texts" |
| 9 | 9 | }, s = "GET" != (e = e.toUpperCase()) && o.data ? t.json2Form(o.data) : o.data; |
| 10 | 10 | i = this.modifyUrl(i, o), o.isShowLoading = void 0 === o.isShowLoading || o.isShowLoading, |
| 11 | - o.isShowLoading && this.showLoading(), console.log("app.request", i, o), wx.request(Object.assign({}, o, { | |
| 11 | + o.isShowLoading && this.showLoading(); | |
| 12 | + var req=wx.request(Object.assign({}, o, { | |
| 12 | 13 | url: i, |
| 13 | 14 | method: e, |
| 14 | 15 | data: s, |
| ... | ... | @@ -20,9 +21,10 @@ module.exports = { |
| 20 | 21 | o.isShowLoading && n.hideLoading(), n.doFail(o, t); |
| 21 | 22 | } |
| 22 | 23 | })); |
| 24 | + return req; | |
| 23 | 25 | }, |
| 24 | 26 | get: function (t, e) { |
| 25 | - this.request("GET", t, e); | |
| 27 | + return this.request("GET", t, e); | |
| 26 | 28 | }, |
| 27 | 29 | post: function (t, e) { |
| 28 | 30 | this.request("POST", t, e); |
| ... | ... | @@ -202,6 +204,13 @@ module.exports = { |
| 202 | 204 | fail(err) { data.isShowLoading && th.hideLoading(); reject(err); } |
| 203 | 205 | }) |
| 204 | 206 | }) |
| 207 | + }, | |
| 208 | + //--------具有时间限制的读取接口---------- | |
| 209 | + time_limit_get(time,url,data){ | |
| 210 | + var req=this.get(url,data); | |
| 211 | + setTimeout(function () { | |
| 212 | + if(req) req.abort(); | |
| 213 | + },time*1000) | |
| 205 | 214 | } |
| 206 | 215 | |
| 207 | 216 | }; |
| 208 | 217 | \ No newline at end of file | ... | ... |