diff --git a/app.wxss b/app.wxss index 67bf9e9..2134717 100644 --- a/app.wxss +++ b/app.wxss @@ -4,6 +4,9 @@ .pdt4 { padding-top: 4rpx; } +.pdt6 { + padding-top: 6rpx; +} .pd10 { padding: 10rpx; } @@ -712,9 +715,9 @@ background: #ffe3e2; /* 图标字体(ty) */ @font-face { font-family: 'iconfont'; /* Project id 2054717 */ - src: url('//at.alicdn.com/t/font_2054717_5ibgy0a15gm.woff2?t=1635479077648') format('woff2'), - url('//at.alicdn.com/t/font_2054717_5ibgy0a15gm.woff?t=1635479077648') format('woff'), - url('//at.alicdn.com/t/font_2054717_5ibgy0a15gm.ttf?t=1635479077648') format('truetype'); + src: url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.woff2?t=1635844276600') format('woff2'), + url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.woff?t=1635844276600') format('woff'), + url('//at.alicdn.com/t/font_2054717_kwrwze5y6c.ttf?t=1635844276600') format('truetype'); } .iconfont { @@ -725,6 +728,10 @@ background: #ffe3e2; -moz-osx-font-smoothing: grayscale; } +.icon-luck:before { + content: "\e621"; +} + .icon-shizhong:before { content: "\e74f"; } diff --git a/pages/cart/cart/cart.js b/pages/cart/cart/cart.js index d832427..5d65ea5 100644 --- a/pages/cart/cart/cart.js +++ b/pages/cart/cart/cart.js @@ -155,6 +155,7 @@ Page({ }, //-------------获取购物车列表,要安装门店进行分类订单----------- getCardList: function() { + var th = this; //要获取会员是不是等级会员 @@ -190,6 +191,7 @@ Page({ th.get_cart(); th.get_ser_cart(); } + } }) @@ -219,6 +221,7 @@ Page({ state:0 }, success:async function(su) { + console.log(su,10000); //按门店分类的数组 var arr = new Array(), carr = su.data.data.pageData; @@ -385,9 +388,11 @@ Page({ if(!th.data.zuhe_map[item.prom_id]){ //如果有组合购 var isok = 1; + var is_flag=1; var act=null; var url="/api/weshop/prom/zhbuy/get/"+os.stoid+"/"+item.prom_id+"/"+getApp().globalData.userInfo.user_id; await getApp().request.promiseGet(url, {}).then(res => { + console.log(res,1000); if(res.data.code==0 && res.data.data){ if(res.data.data.is_show!=1){ isok=0; @@ -405,12 +410,11 @@ Page({ isok=0; } act=res.data.data; - + }else{ - //未找到商品的活动 - isok = 0; - } - + //未找到商品的活动 + is_flag = 0; + } }) if (!isok){ var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; @@ -419,7 +423,6 @@ Page({ continue; } th.data.zuhe_map[item.prom_id]=act; - var url1 = "/api/weshop/prom/zhbuyGoods/page"; var req_data = { page: 1, @@ -430,8 +433,17 @@ Page({ await getApp().request.promiseGet(url1, { data: req_data }).then(res => { + console.log(res,2000); if (ut.ajax_ok(res)) { var gdlist = res.data.data.pageData; + gdlist.forEach(i=>{ + if(item.goods_id==i.goods_id&&!is_flag){ + item.prom_type=0; + item.prom_type1=0; + item.prom_id=0; + item.prom_id1=0 + } + }) th.data.zuhe_map_good[item.prom_id]=gdlist; } }) @@ -451,12 +463,12 @@ Page({ item.buyqty=t_item.buyqty; item.zh_b_num=promgoodsbuynum; item.act=th.data.zuhe_map[item.prom_id]; - }else{ - var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; - getApp().request.delete(url, {}); - th.data.zuhe_map[item.prom_id]=-1; - continue; - } + }//else{ + // var url = '/api/weshop/cart/del/' + oo.stoid + '/' + item.id; + // getApp().request.delete(url, {}); + // th.data.zuhe_map[item.prom_id]=-1; + // continue; + // } } else if(item.prom_type == 0) { //如果有优惠活动,要更新活动 @@ -563,7 +575,9 @@ Page({ } } - + // console.log('AAAAAAAAAAAA', all_num); + // getApp().globalData.cartGoodsNum = all_num; + th.setData({ requestData: arr, all_num: all_num, @@ -662,7 +676,7 @@ Page({ } } - + // console.log('BBBBBB', all_num); th.setData({ service_data: arr, all_num2: all_num, @@ -773,7 +787,8 @@ Page({ var a = t.currentTarget.dataset.item; var b = t.currentTarget.dataset.pitems; a = this.data.requestData[b].goods[a]; - + + console.log('add+'); if (a.goods_num limit && limit > 0) { @@ -2094,7 +2117,11 @@ Page({ var url = '/api/weshop/cart/delIds/' + oo.stoid + '/' + user_id + "/" + glist; getApp().request.delete(url, { success: function(t) { + // console.log('del done1111111111'); th.getCardList(); + getApp().requestCardNum(th); + // console.log('all================', th.data.all_num); + // getApp().globalData.cartGoodsNum = } }); } @@ -2105,10 +2132,12 @@ Page({ getApp().request.delete(url, { success: function(t) { th.getCardList(); + getApp().requestCardNum(th); + console.log('all2================', th.data.all_num); } }); } - + }, //跳到首页 goto: function(e) { diff --git a/pages/cart/cart2/cart2.js b/pages/cart/cart2/cart2.js index 23a705c..6be2361 100644 --- a/pages/cart/cart2/cart2.js +++ b/pages/cart/cart2/cart2.js @@ -779,10 +779,10 @@ Page({ } } - if(gg.prom_type){ + gd.prom_type=gg.prom_type; gd.prom_id=gg.prom_id; - } + switch (gd.prom_type) { case 0: case 2: diff --git a/pages/goods/categoryList/categoryList.js b/pages/goods/categoryList/categoryList.js index 5d62b2d..548ef2f 100644 --- a/pages/goods/categoryList/categoryList.js +++ b/pages/goods/categoryList/categoryList.js @@ -52,7 +52,7 @@ Page({ currentPage: 1, allData: null, openFilterModal: !1, - baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=goods_id&orderType=desc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", + baseUrl: "api/weshop/goods/page?1=1&cat_id=1&parent_id=0&orderField=sort&orderType=asc&page=1&is_mainshow=1&isonsale=1&store_id="+oo.stoid+"&is_recommend=1", requestUrl: "", tabname: "goods_id", //排序的字段 adname: "desc", //升降的字段 @@ -791,7 +791,7 @@ Page({ var that = this; that.data.requestUrl = t; e.get("/api/weshop/goods/page?1=1", { - data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, + data: { page: that.data.stylePage, cat_id: that.data.cat_id, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, success: function (data) { console.log(data.data.data.pageData) that.setData({ @@ -853,7 +853,7 @@ Page({ console.log("page:=" + page) var s = this e.get("/api/weshop/goods/page?1=1", { - data: { page: page, cat_id: cid, parent_id: 0, orderField: 'goods_id', orderType: 'desc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, + data: { page: page, cat_id: cid, parent_id: 0, orderField: 'sort', orderType: 'asc', is_mainshow: 1, isonsale: 1, store_id: oo.stoid, is_recommend: 1 }, success: function (e) { console.log(e.data.data.pageData) s.setData({ diff --git a/pages/goods/goodsInfo/goodsInfo.js b/pages/goods/goodsInfo/goodsInfo.js index e0492f8..00b80f4 100644 --- a/pages/goods/goodsInfo/goodsInfo.js +++ b/pages/goods/goodsInfo/goodsInfo.js @@ -1399,7 +1399,7 @@ Page({ add_cart_next(e, t, a, o, newd, CanOutQty) { var th = this, i = getApp().request; //---如果商品不是积分购和拼团,要判断一个是否要进行等级价的判断------ - if (o.prom_type != 1 && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) { + if ((o.prom_type != 1 || o.prom_id<=0) && ((o.prom_type != 6 && o.prom_type != 4) || th.data.is_normal)) { var conf = th.data.bconfig; if (conf.switch_list && getApp().globalData.userInfo['card_field'] && getApp().globalData.userInfo['card_expiredate']) { var s_list = JSON.parse(conf.switch_list); diff --git a/pages/index/index/index.wxml b/pages/index/index/index.wxml index e8b0e0f..b78889d 100644 --- a/pages/index/index/index.wxml +++ b/pages/index/index/index.wxml @@ -215,7 +215,52 @@ - + + + + + + + + + + + 幸运购 + + + 查看全部 + + + + + + + + + + + 我是商品 + + + 189.00 + 零售价:155 + + + + 去参团 + + + + + + *5人成团,5人得商品,5人全额退款并得惊喜礼品 + + + + + + + diff --git a/pages/index/index/index.wxss b/pages/index/index/index.wxss index d956d5e..fb89c60 100644 --- a/pages/index/index/index.wxss +++ b/pages/index/index/index.wxss @@ -2,7 +2,8 @@ background: #ff7295; } -.icon-presell { +.icon-presell, +.icon-luck { color: #ED6064; font-size: 18px; margin-right: 4rpx; @@ -1115,3 +1116,82 @@ page { margin-right: 10rpx; } + + +/* .luck { + padding-left: 20rpx; + padding-right: 20rpx; +} */ + +.luck .list-item { + background-color: white; + padding: 20rpx; + border-radius: 12rpx; +} + +.luck .img-container { + width: 200rpx; + height: 200rpx; + border-radius: 14rpx; + overflow: hidden; + flex-shrink: 0; + position: relative; +} + +.luck .img-container::before { + content: '幸运购'; + position: absolute; + left: 0; + top: 0; + padding: 4rpx; + background-color: rgba(255,103,103,.7); + color: white; + font-size: 22rpx; + border-radius: 0 0 14rpx 0; +} + +.luck .name::before { + content: '5人团'; + background-color: #FF6768; + color: white; + font-size: 26rpx; + padding-left: 10rpx; + padding-right: 10rpx; + border-radius: 20rpx; + margin-right: 10rpx; +} + +.rmb::before { + content: '¥'; + font-size: 24rpx; +} + +.del { + text-decoration: line-through; +} + +.luck .btn { + background-color: #FF6768; + border-radius: 20rpx; + padding-left:20rpx; + padding-right: 20rpx; + color: white; +} + +.luck .name { + height: 88rpx; +} + + +.luck .progress { + position: relative; +} +.luck .progress::before { + position: absolute; + width: 100%; + content: attr(data-content); + font-size: 20rpx; + color: white; + text-align: center; +} +