Commit b4228d0736e7f5e4da68e06c9d1af2f5d0180b1c
Merge branch 'dev' of http://git.vipzhuang.cn/wxd/MShopWeApp into test
Showing
6 changed files
with
107 additions
and
19 deletions
packageB/pages/zuhegou/index/index.js
| ... | ... | @@ -191,11 +191,60 @@ Page({ |
| 191 | 191 | */ |
| 192 | 192 | onShow: function () { |
| 193 | 193 | getApp().check_can_share(); |
| 194 | + var th = this, | |
| 195 | + that = this, | |
| 196 | + ee = this; | |
| 197 | + | |
| 198 | + let scene = wx.getLaunchOptionsSync().scene; | |
| 199 | + //--判断是否是单页面-- | |
| 200 | + if (scene== 1154) { | |
| 201 | + var url = "/api/weshop/prom/zhbuy/getone/" + os.stoid + "/" + th.data.id; | |
| 202 | + getApp().request.get(url, { | |
| 203 | + success: function (e) { | |
| 204 | + th.data.is_get_act = 1; | |
| 205 | + if (e.data.code == 0 && e.data.data) { | |
| 206 | + self.setData({ | |
| 207 | + act: e.data.data | |
| 208 | + }); | |
| 209 | + if (e.data.data.is_show != 1) { | |
| 210 | + th.setData({ | |
| 211 | + error: '活动未开启' | |
| 212 | + }); | |
| 213 | + return false; | |
| 214 | + } | |
| 215 | + if (ut.gettimestamp() < e.data.data.start_time) { | |
| 216 | + th.setData({ | |
| 217 | + error: '活动还未开始' | |
| 218 | + }); | |
| 219 | + return false; | |
| 220 | + } | |
| 221 | + if (e.data.data.is_end == 0 && ut.gettimestamp() < e.data.data.end_time) { | |
| 222 | + //判断是否有限制购买次数 | |
| 223 | + if(e.data.data.buy_limit !=0){ | |
| 224 | + | |
| 225 | + } | |
| 226 | + //-- 获取商品列表 -- | |
| 227 | + self.get_list(); | |
| 228 | + self.countDown(); | |
| 229 | + } else { | |
| 230 | + th.setData({ | |
| 231 | + error: '活动已经过期' | |
| 232 | + }); | |
| 233 | + return false; | |
| 234 | + } | |
| 235 | + } else { | |
| 236 | + th.data.is_get_act = 0; | |
| 237 | + th.setData({ | |
| 238 | + error: e.data.msg | |
| 239 | + }); | |
| 240 | + return false; | |
| 241 | + } | |
| 242 | + } | |
| 243 | + }); | |
| 244 | + } | |
| 194 | 245 | |
| 195 | 246 | getApp().is_Single_page(this, function () { |
| 196 | - var th = this, | |
| 197 | - that = this, | |
| 198 | - ee = this; | |
| 247 | + | |
| 199 | 248 | this.data.is_timer = 1; |
| 200 | 249 | if (this.data.act) this.countDown(); |
| 201 | 250 | //如果有会员的时候 |
| ... | ... | @@ -414,6 +463,9 @@ Page({ |
| 414 | 463 | return false; |
| 415 | 464 | } |
| 416 | 465 | }) |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 417 | 469 | }, |
| 418 | 470 | //获取用户参与活动的次数 |
| 419 | 471 | getUserBuyPromNum(){ | ... | ... |
packageE/pages/cart/cart2/cart2.js
| ... | ... | @@ -2192,6 +2192,9 @@ Page({ |
| 2192 | 2192 | |
| 2193 | 2193 | //普通券的时候 |
| 2194 | 2194 | if (quan_no && th.data.using_quan[pickid].isby != 1) { |
| 2195 | + | |
| 2196 | + var IsUserWare=1; | |
| 2197 | + | |
| 2195 | 2198 | //---获取优惠券优惠--- |
| 2196 | 2199 | await getApp().request.promiseGet("/api/weshop/couponList/getUseCouponPrice", { |
| 2197 | 2200 | data: { |
| ... | ... | @@ -2205,11 +2208,33 @@ Page({ |
| 2205 | 2208 | var q_data = res.data.data; |
| 2206 | 2209 | //--存储商品优惠的内容-- |
| 2207 | 2210 | cart_item.quan_youhui_list = q_data; |
| 2208 | - for (var k in q_data) | |
| 2209 | - quan_price += q_data[k].WareCashSum; | |
| 2211 | + for (var k in q_data){ | |
| 2212 | + quan_price += q_data[k].WareCashSum; | |
| 2213 | + IsUserWare=q_data[k].IsUserWare; | |
| 2214 | + if(!IsUserWare){ | |
| 2215 | + quan_price=0; | |
| 2216 | + break; | |
| 2217 | + } | |
| 2218 | + | |
| 2219 | + } | |
| 2220 | + | |
| 2210 | 2221 | } |
| 2211 | 2222 | }) |
| 2212 | 2223 | |
| 2224 | + | |
| 2225 | + if(!IsUserWare){ | |
| 2226 | + | |
| 2227 | + wx.showToast({ | |
| 2228 | + title: '优惠券使用对象的订单金额未满足', | |
| 2229 | + icon: 'none', | |
| 2230 | + duration: 1000, | |
| 2231 | + }); | |
| 2232 | + th.setData({ submit: 0 }); | |
| 2233 | + var txt='using_quan['+pickid+']'; | |
| 2234 | + th.setData({[txt]:null}); | |
| 2235 | + return false; | |
| 2236 | + } | |
| 2237 | + | |
| 2213 | 2238 | if(cart_item.quan_youhui_list){ |
| 2214 | 2239 | for (var kk in cart_item.quan_youhui_list) { |
| 2215 | 2240 | var you_item = cart_item.quan_youhui_list[kk]; |
| ... | ... | @@ -5559,7 +5584,7 @@ Page({ |
| 5559 | 5584 | th.data.ckeck_quan_price = good.offline_price; //如果有线下取价,就用线下价 |
| 5560 | 5585 | } |
| 5561 | 5586 | //--如果商家后台没有限制使用优惠券,同时商品的优惠活动没有限制使用优惠券-- |
| 5562 | - if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1) { | |
| 5587 | + if (th.data.is_close_quan != 1 && th.data.bn_goods.is_xz_yh != 1 && th.data.check_quan_ware_list) { | |
| 5563 | 5588 | var url0 = "/api/weshop/users/frozenQuan/listFrozenQuan/" + app.globalData.user_id; |
| 5564 | 5589 | var url = "/api/weshop/couponList/getUseCouponList"; |
| 5565 | 5590 | app.request.promiseGet(url0, { 1: 1 }).then(res => { | ... | ... |
pages/goods/goodsInfo/goodsInfo.wxml
| ... | ... | @@ -614,7 +614,7 @@ |
| 614 | 614 | <view wx:if="{{item.prom_type==2}}" class="miao_lab">团</view> |
| 615 | 615 | <view wx:if="{{item.prom_type==4}}" class="miao_lab">积</view> |
| 616 | 616 | <view wx:if="{{item.prom_type==6}}" class="miao_lab">拼</view> |
| 617 | - <view wx:if="{{item.prom_type==6}}" class="miao_lab">预</view> | |
| 617 | + <view wx:if="{{item.prom_type==8}}" class="miao_lab">预</view> | |
| 618 | 618 | |
| 619 | 619 | |
| 620 | 620 | <view class="order_hui"> | ... | ... |
pages/goods/goodsList/goodsList.js
| ... | ... | @@ -42,6 +42,7 @@ Page({ |
| 42 | 42 | fil_brand_state:0, |
| 43 | 43 | fil_price_state:0, |
| 44 | 44 | limit_num:0, |
| 45 | + gr_fir:0, //分组第一次 | |
| 45 | 46 | }, |
| 46 | 47 | |
| 47 | 48 | onLoad: function(t) { |
| ... | ... | @@ -83,8 +84,8 @@ Page({ |
| 83 | 84 | if (0 != t.brand_id && t.brand_id != undefined) { url += "&brand_id=" + t.brand_id; } |
| 84 | 85 | if (0 != t.nation_id && t.nation_id != undefined) { url += "&nation_id=" + t.nation_id; } |
| 85 | 86 | |
| 86 | - if (0 != t.group_id && t.group_id != undefined) { url += "&group_id=" + t.group_id; } | |
| 87 | - if (0 != t.gid && t.gid != undefined) { url += "&group_id=" + t.gid; } | |
| 87 | + if (0 != t.group_id && t.group_id != undefined) { url += "&group_id=" + t.group_id; this.data.gr_fir=1; } | |
| 88 | + if (0 != t.gid && t.gid != undefined) { url += "&group_id=" + t.gid; this.data.gr_fir=1; } | |
| 88 | 89 | |
| 89 | 90 | if (0 != t.max_price && t.max_price != undefined) { url += "&min_pirce=" + t.min_pirce + "&max_price=" + t.max_price; } |
| 90 | 91 | |
| ... | ... | @@ -306,11 +307,14 @@ Page({ |
| 306 | 307 | var user_id=getApp().globalData.user_id; |
| 307 | 308 | if(!user_id) user_id=0; |
| 308 | 309 | |
| 309 | - //不是商品分组的,不是默认排序的 | |
| 310 | - // if(t.indexOf("group_id")==-1 ){ | |
| 311 | - t += "&orderField=" + e.data.tabname; | |
| 312 | - t += "&orderType=" + e.data.adname; | |
| 313 | - // } | |
| 310 | + | |
| 311 | + //不是商品分组的,不是默认排序的 | |
| 312 | + if (t.indexOf("group_id") == -1 || !this.data.gr_fir) { | |
| 313 | + t += "&orderField=" + e.data.tabname; | |
| 314 | + t += "&orderType=" + e.data.adname; | |
| 315 | + } | |
| 316 | + this.data.gr_fir=0; | |
| 317 | + | |
| 314 | 318 | |
| 315 | 319 | t +="&page=" + e.data.currentPage; |
| 316 | 320 | wx.showLoading({}); | ... | ... |
pages/index/index/index.js
| ... | ... | @@ -394,9 +394,11 @@ Page({ |
| 394 | 394 | |
| 395 | 395 | getApp().check_can_share(); |
| 396 | 396 | |
| 397 | - this.getTabBar().setData({ | |
| 398 | - cartGoodsNum: getApp().globalData.cartGoodsNum | |
| 399 | - }) | |
| 397 | + if (typeof this.getTabBar === 'function' && this.getTabBar()) { | |
| 398 | + this.getTabBar().setData({ | |
| 399 | + cartGoodsNum: getApp().globalData.cartGoodsNum | |
| 400 | + }) | |
| 401 | + } | |
| 400 | 402 | var th = this; |
| 401 | 403 | //-- 登录回来判断弹框 -- |
| 402 | 404 | var user_id = getApp().globalData.user_id; | ... | ... |
pages/user/my_service/i_service.js
| ... | ... | @@ -164,8 +164,13 @@ Page({ |
| 164 | 164 | var dd = d.getDate(); |
| 165 | 165 | if (dd < 10) dd = "0" + dd; |
| 166 | 166 | var fm = [d.getFullYear(), m, dd].join('-'); |
| 167 | - if (isFull == 1) | |
| 168 | - fm = fm + ' ' + [d.getHours(), d.getMinutes(), d.getSeconds()].join(':') | |
| 167 | + if (isFull == 1){ | |
| 168 | + var H=d.getHours();if(H<10) H="0"+H; | |
| 169 | + var I=d.getMinutes();if(I<10) I="0"+I; | |
| 170 | + var S=d.getSeconds();if(S<10) S="0"+S; | |
| 171 | + fm = fm + ' ' + [H, I, S].join(':') | |
| 172 | + } | |
| 173 | + | |
| 169 | 174 | return fm; |
| 170 | 175 | }, |
| 171 | 176 | //跳转到首页 | ... | ... |