Commit bbbda7ecb4e84a9811cd9a243f7c19c3cc9c92c3
1 parent
40727adf
立即购买优化顺序
Showing
2 changed files
with
29 additions
and
150 deletions
components/promate_pop/promate_pop.wxss
| ... | ... | @@ -248,6 +248,16 @@ |
| 248 | 248 | background-color: #d60021; |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | - | |
| 252 | - | |
| 253 | 251 | @import '../../app.wxss'; |
| 252 | + | |
| 253 | +.tick:before { | |
| 254 | + content: ''; | |
| 255 | + display: inline-block; | |
| 256 | + vertical-align: middle; | |
| 257 | + margin-top: -4rpx; | |
| 258 | + margin-right: 12rpx; | |
| 259 | + width: 22rpx; | |
| 260 | + height: 22rpx; | |
| 261 | + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABYAAAAWCAMAAADzapwJAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAABCUExURUdwTPInDPInDPgoDfMnDPYqEvInDPInDPInDP87NPUoDv8vEvMoDPInDPIoDPMnDvInDPInDPInDPIoDPQoDfInDEON4KMAAAAVdFJOUwD45yawG4zz3gQ0DmLOfECQZpPlS54kMQ4AAAC0SURBVBjTbZFREoMgDERDS0xQQNHu/a/alEGtaIYfHrBhs0S1pujVifo40VkhC+BUHSDzQTlBhjHY8bjogXmDZ+orJKwXwMUeUoa/0PeGbH8Q4Y5CJopYOjosiOQxdpRGk1UXOkrBKdkimtN8UrKrJBVXdzsllSYSjR/0J9JaGn81WluWtonYKQ0op51P3M2L2bmZN9n8MKoVqTph/RsseyjfYxAkfgot/82CpuJVLOLSIv4Cd5AJ37BgpFwAAAAASUVORK5CYII=) no-repeat; | |
| 262 | + background-size: 22rpx auto; | |
| 263 | +} | |
| 254 | 264 | \ No newline at end of file | ... | ... |
pages/goods/goodsInfo/goodsInfo.js
| ... | ... | @@ -2062,150 +2062,14 @@ Page({ |
| 2062 | 2062 | }); |
| 2063 | 2063 | |
| 2064 | 2064 | } else { |
| 2065 | - | |
| 2066 | - //-- 这一步主要是要让立即购买 走 购物车的逻辑 参与活动,如果有zh_act就强制组合购购买 -- | |
| 2067 | - if (th.data.zh_act && | |
| 2068 | - th.data.zh_act.zhbuyqty <= th.data.goodsInputNum && (!th.data.zh_act.zh_num || th.data.zh_act.zh_buy_num < th.data.zh_act.zh_num)) { | |
| 2069 | - wx.hideLoading(); | |
| 2070 | - | |
| 2071 | - // if ((th.data.zh_act.buy_limit != 0 && th.data.zh_act.buy_limit <= th.data.userbuynum)) { | |
| 2072 | - // wx.showModal({ | |
| 2073 | - // title: '提示', | |
| 2074 | - // // content: `商品${str},组合购活动,购买次数已超,将以普通商品购买?`, | |
| 2075 | - // content: `${th.data.data.goods_name}超出组合购限购次数,将以普通商品购买`, | |
| 2076 | - // success: res => { | |
| 2077 | - // if (res.confirm) { | |
| 2078 | - // console.log('用户点击确定') | |
| 2079 | - // //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
| 2080 | - // getApp().request.get("/api/weshop/cart/page", { | |
| 2081 | - // data: { | |
| 2082 | - // store_id: os.stoid, | |
| 2083 | - // user_id: oo.user_id, | |
| 2084 | - // state: 1 | |
| 2085 | - // }, | |
| 2086 | - // success: function (res) { | |
| 2087 | - // //-------如果购物车中有相关的数据--------- | |
| 2088 | - // if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2089 | - // for (let j in res.data.data.pageData) { | |
| 2090 | - // let item_j = res.data.data.pageData[j]; | |
| 2091 | - // var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; | |
| 2092 | - // getApp().request.delete(url, {}); | |
| 2093 | - // } | |
| 2094 | - // } | |
| 2095 | - // newd.state = 1; | |
| 2096 | - // newd.prom_type = 0; | |
| 2097 | - // newd.prom_id = 0 | |
| 2098 | - // getApp().request.post("/api/weshop/cart/save", { | |
| 2099 | - // data: newd, | |
| 2100 | - // success: function (t) { | |
| 2101 | - // th.closeSpecModal(); | |
| 2102 | - // getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | |
| 2103 | - // } | |
| 2104 | - // }); | |
| 2105 | - // } | |
| 2106 | - // }) | |
| 2107 | - // } else if (res.cancel) { | |
| 2108 | - // | |
| 2109 | - // console.log('用户点击取消') | |
| 2110 | - // } | |
| 2111 | - // } | |
| 2112 | - // }) | |
| 2113 | - // } else { | |
| 2114 | - //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
| 2115 | - getApp().request.get("/api/weshop/cart/page", { | |
| 2116 | - data: { | |
| 2117 | - store_id: os.stoid, | |
| 2118 | - user_id: oo.user_id, | |
| 2119 | - state: 1 | |
| 2120 | - }, | |
| 2121 | - success: function (res) { | |
| 2122 | - //-------如果购物车中有相关的数据,先清理掉--------- | |
| 2123 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2124 | - for (let j in res.data.data.pageData) { | |
| 2125 | - let item_j = res.data.data.pageData[j]; | |
| 2126 | - var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; | |
| 2127 | - getApp().request.delete(url, {}); | |
| 2128 | - } | |
| 2129 | - } | |
| 2130 | - | |
| 2131 | - newd.state = 1; | |
| 2132 | - newd.prom_type = 7; | |
| 2133 | - newd.prom_id = th.data.zh_act.id; | |
| 2134 | - getApp().request.post("/api/weshop/cart/save", { | |
| 2135 | - data: newd, | |
| 2136 | - success: function (t) { | |
| 2137 | - th.closeSpecModal(); | |
| 2138 | - getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | |
| 2139 | - } | |
| 2140 | - }); | |
| 2141 | - | |
| 2142 | - } | |
| 2143 | - }) | |
| 2144 | - //} | |
| 2145 | - | |
| 2146 | - | |
| 2147 | - return false | |
| 2148 | - } else { | |
| 2149 | - //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
| 2150 | - getApp().request.get("/api/weshop/cart/page", { | |
| 2151 | - data: { | |
| 2152 | - store_id: os.stoid, | |
| 2153 | - user_id: oo.user_id, | |
| 2154 | - state: 1 | |
| 2155 | - }, | |
| 2156 | - success: function (res) { | |
| 2157 | - //-------如果购物车中有相关的数据--------- | |
| 2158 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2159 | - for (let j in res.data.data.pageData) { | |
| 2160 | - let item_j = res.data.data.pageData[j]; | |
| 2161 | - var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; | |
| 2162 | - getApp().request.delete(url, {}); | |
| 2163 | - } | |
| 2164 | - } | |
| 2165 | - | |
| 2166 | - } | |
| 2167 | - }) | |
| 2168 | - | |
| 2169 | - } | |
| 2170 | - | |
| 2171 | - if (th.data.prom_goods && newd.prom_type != 4 && newd.prom_type != 6) { | |
| 2172 | - var prom_d = th.data.prom_goods; | |
| 2173 | - for (var i in prom_d) { | |
| 2174 | - //判断活动有俩种条件,0元 1件 | |
| 2175 | - var condition_t = prom_d[i].prom_type; | |
| 2176 | - switch (condition_t) { | |
| 2177 | - case 0: //按钱 | |
| 2178 | - if (newd.goods_price >= condition_t) { | |
| 2179 | - newd.prom_type = 3; | |
| 2180 | - newd.prom_id = prom_d[i].prom_id; | |
| 2181 | - } | |
| 2182 | - break | |
| 2183 | - case 1: //按购买数量 | |
| 2184 | - if (newd.goods_num >= condition_t) { | |
| 2185 | - newd.prom_type = 3; | |
| 2186 | - newd.prom_id = prom_d[i].prom_id; | |
| 2187 | - } | |
| 2188 | - break; | |
| 2189 | - } | |
| 2190 | - } | |
| 2191 | - } | |
| 2192 | - //如果有阶梯促销的时候 | |
| 2193 | - if (th.data.jieti_prom && (newd.prom_type == 10 || newd.prom_type == 0)) { | |
| 2194 | - newd.prom_type = 10; | |
| 2195 | - newd.prom_id = th.data.ladder_act_id; | |
| 2196 | - } else { | |
| 2197 | - //-- 优惠促销的商品,立即购买就判断了,就直接购买 -- | |
| 2198 | - if ([1, 2, 4, 6].indexOf(newd.prom_type) == -1) { | |
| 2199 | - newd.prom_type = 0; | |
| 2200 | - newd.id = 0; | |
| 2201 | - } | |
| 2202 | - } | |
| 2065 | + newd.prom_type = 0; | |
| 2066 | + newd.id = 0; | |
| 2203 | 2067 | |
| 2204 | 2068 | newd['pick_name'] = th.data.sto_sele_name; |
| 2205 | 2069 | newd['pick_dis'] = th.data.sto_sele_distr; |
| 2206 | 2070 | th.buyNow(newd); |
| 2207 | - } | |
| 2208 | - }, | |
| 2071 | + } | |
| 2072 | + }, | |
| 2209 | 2073 | |
| 2210 | 2074 | //因为在购物车 普通商品和 优惠促销,搭配购,组合购 阶梯购是一样的 |
| 2211 | 2075 | check_is_like(e, newd, idx) { |
| ... | ... | @@ -2670,9 +2534,7 @@ Page({ |
| 2670 | 2534 | }, |
| 2671 | 2535 | |
| 2672 | 2536 | openSpecModel: function (t) { |
| 2673 | - | |
| 2674 | - | |
| 2675 | - | |
| 2537 | + | |
| 2676 | 2538 | var th = this; |
| 2677 | 2539 | var open_store = t.currentTarget.dataset.ind; |
| 2678 | 2540 | |
| ... | ... | @@ -7615,10 +7477,17 @@ Page({ |
| 7615 | 7477 | if (r_data.promGoodsLists) { |
| 7616 | 7478 | |
| 7617 | 7479 | var fir_act = r_data.promGoodsLists[0]; |
| 7480 | + var is_yh_out_limit=0; | |
| 7481 | + | |
| 7482 | + | |
| 7618 | 7483 | //-- 计算一下限购,满足限购数才显示 -- |
| 7619 | - await this.getUserBuyPromNum_pre(fir_act.prom_id); | |
| 7484 | + if (fir_act.limit_num ) { | |
| 7485 | + await this.getUserBuyPromNum_pre(fir_act.prom_id); | |
| 7486 | + if(th.data.user_pre_buynum < fir_act.limit_num){ | |
| 7487 | + is_yh_out_limit=1; | |
| 7488 | + } | |
| 7620 | 7489 | |
| 7621 | - if (!fir_act.limit_num || th.data.user_pre_buynum < fir_act.limit_num) { | |
| 7490 | + } | |
| 7622 | 7491 | // var more_arr = []; |
| 7623 | 7492 | // //减价 |
| 7624 | 7493 | // if (fir_act.money > 0){ |
| ... | ... | @@ -7695,10 +7564,10 @@ Page({ |
| 7695 | 7564 | limit: '每人' + (fir_act.limit_num ? '限参与' + fir_act.limit_num + '次' : '参与不限次'), |
| 7696 | 7565 | more: more_arr, |
| 7697 | 7566 | prom_type: 3, |
| 7698 | - promGoodsListsDtos:r_data.promGoodsLists | |
| 7567 | + promGoodsListsDtos:r_data.promGoodsLists, | |
| 7568 | + is_yh_out_limit:is_yh_out_limit | |
| 7699 | 7569 | }); |
| 7700 | - | |
| 7701 | - } | |
| 7570 | + //} | |
| 7702 | 7571 | |
| 7703 | 7572 | } |
| 7704 | 7573 | ... | ... |