Commit 1970521f3b1b59fa9c8132f8f26d0b4d3553c5da
1 parent
e4358f28
幸运购的普通购买的时候,在确认订单的页要显示多活动切换
Showing
1 changed file
with
26 additions
and
178 deletions
packageC/pages/luckyGo/luckyGo_goodsInfo/luckyGo_goodsInfo.js
| ... | ... | @@ -1999,193 +1999,41 @@ Page({ |
| 1999 | 1999 | openSpecModal_pt: 0, |
| 2000 | 2000 | }) |
| 2001 | 2001 | |
| 2002 | - // if (e.prom_type == 9) { | |
| 2003 | - // s.set_b_now(e); | |
| 2004 | - // // var url = ''; | |
| 2005 | - // var url = "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id; | |
| 2006 | - // getApp().goto(url); | |
| 2007 | - // } else | |
| 2008 | - | |
| 2009 | - // if(e.prom_type == 9){ | |
| 2010 | - if (true) { | |
| 2011 | - //要判断积分购的普通购买有没有参加优惠活动 | |
| 2012 | - if (e.is_normal == 1) { | |
| 2013 | - this.check_nor_promgood(e.goods_id, function (res) { | |
| 2014 | - if (res && res.act_id) { | |
| 2015 | - e.prom_type = res.prom_type; | |
| 2016 | - e.prom_id = res.act_id; | |
| 2017 | - } else { | |
| 2018 | - e.prom_type = 0; | |
| 2019 | - // e.prom_id = 0; | |
| 2020 | - } | |
| 2021 | - | |
| 2022 | - //-- 这一步主要是要让立即购买 走 购物车的逻辑 参与活动,如果有zh_act就强制组合购购买,要计算一下组合购的总数量 -- | |
| 2023 | - if(th.data.zh_act && (!th.data.zh_act.zh_num || th.data.zh_act.zh_buy_num<th.data.zh_act.zh_num ) | |
| 2024 | - && th.data.zh_act.zhbuyqty <= th.data.goodsInputNum){ | |
| 2025 | - wx.hideLoading(); | |
| 2026 | - | |
| 2027 | - if((th.data.zh_act.buy_limit !=0 && th.data.zh_act.buy_limit <= th.data.userbuynum)){ | |
| 2028 | - wx.showModal({ | |
| 2029 | - title: '提示', | |
| 2030 | - // content: `商品${str},组合购活动,购买次数已超,将以普通商品购买?`, | |
| 2031 | - content: `${th.data.data.goods_name}超出组合购限购次数,将以普通商品购买`, | |
| 2032 | - success:res=>{ | |
| 2033 | - if (res.confirm) { | |
| 2034 | - console.log('用户点击确定') | |
| 2035 | - //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
| 2036 | - getApp().request.get("/api/weshop/cart/page", { | |
| 2037 | - data: { | |
| 2038 | - store_id: os.stoid, | |
| 2039 | - user_id: oo.user_id, | |
| 2040 | - state: 1 | |
| 2041 | - }, | |
| 2042 | - success: function (res) { | |
| 2043 | - //-------如果购物车中有相关的数据--------- | |
| 2044 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2045 | - for (let j in res.data.data.pageData) { | |
| 2046 | - let item_j = res.data.data.pageData[j]; | |
| 2047 | - var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; | |
| 2048 | - getApp().request.delete(url, {}); | |
| 2049 | - } | |
| 2050 | - } | |
| 2051 | - e.state = 1; | |
| 2052 | - e.prom_type=0; | |
| 2053 | - e.prom_id=0 | |
| 2054 | - getApp().request.post("/api/weshop/cart/save", { | |
| 2055 | - data: e, | |
| 2056 | - success: function (t) { | |
| 2057 | - th.closeSpecModal(); | |
| 2058 | - getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | |
| 2059 | - } | |
| 2060 | - }); | |
| 2061 | - } | |
| 2062 | - }) | |
| 2063 | - } else if (res.cancel) { | |
| 2064 | - | |
| 2065 | - console.log('用户点击取消') | |
| 2066 | - } | |
| 2067 | - } | |
| 2068 | - }) | |
| 2069 | - }else{ | |
| 2070 | - | |
| 2071 | - | |
| 2072 | - //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
| 2073 | - getApp().request.get("/api/weshop/cart/page", { | |
| 2074 | - data: { | |
| 2075 | - store_id: os.stoid, | |
| 2076 | - user_id: oo.user_id, | |
| 2077 | - state: 1 | |
| 2078 | - }, | |
| 2079 | - success: function (res) { | |
| 2080 | - //-------如果购物车中有相关的数据,先清理掉--------- | |
| 2081 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2082 | - for (let j in res.data.data.pageData) { | |
| 2083 | - let item_j = res.data.data.pageData[j]; | |
| 2084 | - var url = '/api/weshop/cart/del/' + os.stoid + '/' + item_j.id; | |
| 2085 | - getApp().request.delete(url, {}); | |
| 2086 | - } | |
| 2087 | - } | |
| 2088 | - | |
| 2089 | - e.state = 1; | |
| 2090 | - e.prom_type=7; | |
| 2091 | - e.prom_id=th.data.zh_act.id; | |
| 2092 | - getApp().request.post("/api/weshop/cart/save", { | |
| 2093 | - data: e, | |
| 2094 | - success: function (t) { | |
| 2095 | - th.closeSpecModal(); | |
| 2096 | - getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | |
| 2097 | - } | |
| 2098 | - }); | |
| 2002 | + e.prom_type = 0; | |
| 2003 | + e.prom_id = 0; | |
| 2004 | + e.is_pd_normal= 1; | |
| 2005 | + e.state = 1; | |
| 2099 | 2006 | |
| 2100 | - } | |
| 2101 | - }) | |
| 2102 | - } | |
| 2103 | - | |
| 2104 | - | |
| 2105 | - return false | |
| 2106 | - }else{ | |
| 2107 | - //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
| 2108 | - getApp().request.get("/api/weshop/cart/page", { | |
| 2109 | - data: { | |
| 2110 | - store_id: os.stoid, | |
| 2111 | - user_id: oo.user_id, | |
| 2112 | - state: 1 | |
| 2113 | - }, | |
| 2114 | - success: function (res) { | |
| 2115 | - //-------如果购物车中有相关的数据--------- | |
| 2116 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2117 | - for (let j in res.data.data.pageData) { | |
| 2118 | - let item_j = res.data.data.pageData[j]; | |
| 2119 | - var url = '/api/weshop/cart/del/' + e.data.stoid + '/' + item_j.id; | |
| 2120 | - getApp().request.delete(url, {}); | |
| 2121 | - } | |
| 2122 | - } | |
| 2007 | + //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
| 2008 | + getApp().request.get("/api/weshop/cart/page", { | |
| 2123 | 2009 | |
| 2124 | - } | |
| 2125 | - }) | |
| 2010 | + data: { | |
| 2011 | + store_id: os.stoid, | |
| 2012 | + user_id: oo.user_id, | |
| 2013 | + state: 1 | |
| 2014 | + }, | |
| 2126 | 2015 | |
| 2016 | + success: function (res) { | |
| 2017 | + //-------如果购物车中有相关的数据,先清理掉--------- | |
| 2018 | + if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2019 | + for (let j in res.data.data.pageData) { | |
| 2020 | + let item_j = res.data.data.pageData[j]; | |
| 2021 | + var url = '/api/weshop/cart/del/' + os.stoid + '/' + item_j.id; | |
| 2022 | + getApp().request.delete(url, {}); | |
| 2127 | 2023 | } |
| 2024 | + } | |
| 2128 | 2025 | |
| 2129 | - | |
| 2130 | - if(e.prom_type==10){ | |
| 2131 | - //----先看会员在购物车中是否加入了该商品,立即购买的----- | |
| 2132 | - getApp().request.get("/api/weshop/cart/page", { | |
| 2133 | - data: { | |
| 2134 | - store_id: e.store_id, | |
| 2135 | - user_id: oo.user_id, | |
| 2136 | - state: 1 | |
| 2137 | - }, | |
| 2138 | - success: function (res) { | |
| 2139 | - //-------如果购物车中有相关的数据,先清理掉--------- | |
| 2140 | - if (res.data.code == 0 && res.data.data.total > 0) { | |
| 2141 | - for (let j in res.data.data.pageData) { | |
| 2142 | - let item_j = res.data.data.pageData[j]; | |
| 2143 | - var url = '/api/weshop/cart/del/' + os.stoid + '/' + item_j.id; | |
| 2144 | - getApp().request.delete(url, {}); | |
| 2145 | - } | |
| 2146 | - } | |
| 2147 | - | |
| 2148 | - e.state = 1; | |
| 2149 | - getApp().request.post("/api/weshop/cart/save", { | |
| 2150 | - data: e, | |
| 2151 | - success: function (t) { | |
| 2152 | - th.closeSpecModal(); | |
| 2153 | - getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | |
| 2154 | - } | |
| 2155 | - }); | |
| 2156 | - | |
| 2157 | - } | |
| 2158 | - }) | |
| 2159 | - return false; | |
| 2026 | + getApp().request.post("/api/weshop/cart/save", { | |
| 2027 | + data: e, | |
| 2028 | + success: function (t) { | |
| 2029 | + th.closeSpecModal(); | |
| 2030 | + getApp().goto("/packageE/pages/cart/cart2/cart2?state=1"); | |
| 2160 | 2031 | } |
| 2032 | + }); | |
| 2161 | 2033 | |
| 2162 | - | |
| 2163 | - | |
| 2164 | - s.set_b_now(e); | |
| 2165 | - /*-- | |
| 2166 | - wx.redirectTo({ | |
| 2167 | - url: "?is_bnow=1&goods_id=" + e.goods_id, | |
| 2168 | - });--*/ | |
| 2169 | - | |
| 2170 | - // console.log('11111111111111111111111111======》'); | |
| 2171 | - // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&goods_id=" + e.goods_id); | |
| 2172 | - //getApp().goto("/packageC/pages/luckyGo/luckyGo_cart/luckyGo_cart?is_bnow=1&group_id=" + th.data.group_id + "&goods_id=" + e.goods_id + "&alert=" + th.data.luckGoInfo.lc_alert); | |
| 2173 | - | |
| 2174 | - getApp().goto("/packageE/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id) | |
| 2175 | - | |
| 2176 | - }) | |
| 2177 | - } else { | |
| 2178 | - //console.log('222222222222222222222222222222======》'); | |
| 2179 | - //s.set_b_now(e); | |
| 2180 | - /*-- | |
| 2181 | - wx.redirectTo({ | |
| 2182 | - url: "/pages/cart/cart2/cart2?is_bnow=1&goods_id=" + e.goods_id, | |
| 2183 | - });--*/ | |
| 2184 | - //getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&goods_id=" + e.goods_id) | |
| 2185 | - // getApp().goto("/packageC/pages/luckyGo/luckyGo_cart_ct/luckyGo_cart_ct?is_bnow=1&group_id=" + this.data.group_id +"&goods_id=" + e.goods_id + "&alert=" + this.data.luckGoInfo.lc_alert); | |
| 2186 | 2034 | } |
| 2035 | + }) | |
| 2187 | 2036 | |
| 2188 | - } | |
| 2189 | 2037 | }, |
| 2190 | 2038 | |
| 2191 | 2039 | //----------增加购买数量----------- | ... | ... |