code review by hf: do gulp ge to gzip css and js
Showing
1 changed file
with
41 additions
and
340 deletions
@@ -13,10 +13,6 @@ class ShoppingCartController extends AbstractAction | @@ -13,10 +13,6 @@ class ShoppingCartController extends AbstractAction | ||
13 | /* | 13 | /* |
14 | * 购物车首页 | 14 | * 购物车首页 |
15 | */ | 15 | */ |
16 | -<<<<<<< HEAD | ||
17 | - | ||
18 | -======= | ||
19 | ->>>>>>> develop | ||
20 | public function indexAction() | 16 | public function indexAction() |
21 | { | 17 | { |
22 | $this->setTitle('购物车'); | 18 | $this->setTitle('购物车'); |
@@ -75,270 +71,6 @@ class ShoppingCartController extends AbstractAction | @@ -75,270 +71,6 @@ class ShoppingCartController extends AbstractAction | ||
75 | } | 71 | } |
76 | } | 72 | } |
77 | 73 | ||
78 | -<<<<<<< HEAD | ||
79 | - /* | ||
80 | - * 异步获取购物车数据 | ||
81 | - */ | ||
82 | - | ||
83 | - public function getCartDataAction() | ||
84 | - { | ||
85 | - $result = array(); | ||
86 | - | ||
87 | - if ($this->isAjax()) { | ||
88 | - $shoppingKey = Helpers::getShoppingKeyByCookie(); | ||
89 | - $uid = $this->getUid(true); | ||
90 | - | ||
91 | - $result = CartModel::getCartData($uid, $shoppingKey); | ||
92 | - } | ||
93 | - | ||
94 | - if (empty($result)) { | ||
95 | - echo ' '; | ||
96 | - } else { | ||
97 | - $this->echoJson($result); | ||
98 | - } | ||
99 | - } | ||
100 | - | ||
101 | - /** | ||
102 | - * 购物车商品选择与取消 | ||
103 | - */ | ||
104 | - public function selectAction() | ||
105 | - { | ||
106 | - $result = array(); | ||
107 | - | ||
108 | - if ($this->isAjax()) { | ||
109 | - $productId = $this->post('id', 0); | ||
110 | - $uid = $this->getUid(true); | ||
111 | - $shoppingKey = $this->getSession('shoppingKey'); | ||
112 | - $result = CartModel::selectGoods($uid, $productId, $shoppingKey); | ||
113 | - } | ||
114 | - | ||
115 | - if (empty($result)) { | ||
116 | - echo ' '; | ||
117 | - } else { | ||
118 | - $this->echoJson($result); | ||
119 | - } | ||
120 | - } | ||
121 | - | ||
122 | - /** | ||
123 | - * 移出购物车 | ||
124 | - */ | ||
125 | - public function delAction() | ||
126 | - { | ||
127 | - $result = array(); | ||
128 | - | ||
129 | - if ($this->isAjax()) { | ||
130 | - $productId = $this->post('id', 0); | ||
131 | - $uid = $this->getUid(true); | ||
132 | - $shoppingKey = $this->getSession('shoppingKey'); | ||
133 | - $result = CartModel::removeFromCart($uid, $productId, $shoppingKey); | ||
134 | - } | ||
135 | - | ||
136 | - if (empty($result)) { | ||
137 | - echo ' '; | ||
138 | - } else { | ||
139 | - $this->echoJson($result); | ||
140 | - } | ||
141 | - } | ||
142 | - | ||
143 | - /** | ||
144 | - * 移入收藏夹 | ||
145 | - */ | ||
146 | - public function colAction() | ||
147 | - { | ||
148 | - $result = array(); | ||
149 | - | ||
150 | - if ($this->isAjax()) { | ||
151 | - $productId = $this->post('id', 0); | ||
152 | - $uid = $this->getUid(true); | ||
153 | - $result = CartModel::addToFav($uid, $productId); | ||
154 | - } | ||
155 | - | ||
156 | - if (empty($result)) { | ||
157 | - echo ' '; | ||
158 | - } else { | ||
159 | - $this->echoJson($result); | ||
160 | - } | ||
161 | - } | ||
162 | - | ||
163 | - /* | ||
164 | - * 获取购物车商品数据 | ||
165 | - */ | ||
166 | - | ||
167 | - public function goodinfoAction() | ||
168 | - { | ||
169 | - $result = array(); | ||
170 | - | ||
171 | - if ($this->isAjax()) { | ||
172 | - $num = $this->get('buy_num', 1); | ||
173 | - $skn = $this->get('id', 1); | ||
174 | - $uid = $this->getUid(true); | ||
175 | - $result = CartModel::cartProductData($uid, $skn, $num); // 测试skn的ID为51172055 | ||
176 | - $result['num'] = $num; | ||
177 | - } | ||
178 | - | ||
179 | - if (empty($result)) { | ||
180 | - echo ' '; | ||
181 | - } else { | ||
182 | - $this->echoJson($result); | ||
183 | - } | ||
184 | - } | ||
185 | - | ||
186 | - /* | ||
187 | - * 获取购物车加价购商品数据 | ||
188 | - */ | ||
189 | - | ||
190 | - public function giftinfoAction() | ||
191 | - { | ||
192 | - $result = array(); | ||
193 | - | ||
194 | - if ($this->isAjax()) { | ||
195 | - $skn = $this->get('skn', null); | ||
196 | - $promotionId = $this->get('promotionId', null); | ||
197 | - $result = CartModel::giftProductData($skn, $promotionId); | ||
198 | - } | ||
199 | - | ||
200 | - if (empty($result)) { | ||
201 | - echo ' '; | ||
202 | - } else { | ||
203 | - $this->echoJson($result); | ||
204 | - } | ||
205 | - } | ||
206 | - | ||
207 | - /** | ||
208 | - * 修改购物车商品数据 | ||
209 | - */ | ||
210 | - public function modifyAction() | ||
211 | - { | ||
212 | - $result = array(); | ||
213 | - | ||
214 | - if ($this->isAjax()) { | ||
215 | - $shoppingKey = $this->getSession('shoppingKey'); | ||
216 | - $uid = $this->getUid(true); | ||
217 | - | ||
218 | - $params = array(); | ||
219 | - $params['old_product_sku'] = $this->post('old_product_sku', 0); | ||
220 | - $params['new_product_sku'] = $this->post('new_product_sku', 0); | ||
221 | - $params['buy_number'] = $this->post('buy_number', 0); | ||
222 | - $params['selected'] = $this->post('selected', null); | ||
223 | - $result = CartModel::modifyCartProduct($uid, $params, $shoppingKey); | ||
224 | - } | ||
225 | - | ||
226 | - if (empty($result)) { | ||
227 | - echo ' '; | ||
228 | - } else { | ||
229 | - $this->echoJson($result); | ||
230 | - } | ||
231 | - } | ||
232 | - | ||
233 | - /** | ||
234 | - * 购物车结算请求 | ||
235 | - */ | ||
236 | - public function orderEnsureAction() | ||
237 | - { | ||
238 | - $this->setTitle('购物车'); | ||
239 | - $this->setNavHeader('购物车'); | ||
240 | - | ||
241 | - $cartType = $this->post('cartType', 'ordinary'); | ||
242 | - $cookieData = $this->getCookie('order-info', null); | ||
243 | - $uid = $this->getUid(true); | ||
244 | - $data = array( | ||
245 | - 'orderEnsurePage' => true, | ||
246 | - 'orderEnsure' => CartModel::cartPay($uid, $cartType, $cookieData) | ||
247 | - ); | ||
248 | - // var_dump($data); | ||
249 | - $this->_view->display('order-ensure', $data); | ||
250 | - } | ||
251 | - | ||
252 | - /** | ||
253 | - * 购物车选择改变字段,重新运算订单数据 | ||
254 | - */ | ||
255 | - public function orderComputeAction() | ||
256 | - { | ||
257 | - $result = array(); | ||
258 | - | ||
259 | - if ($this->isAjax()) { | ||
260 | - $cartType = $this->post('cartType', 'ordinary'); | ||
261 | - $deliveryWay = $this->post('deliveryId', 1); | ||
262 | - $paymentType = $this->post('paymentTypeId', 1); | ||
263 | - $couponCode = $this->post('couponCode', null); | ||
264 | - $yohoCoin = $this->post('yohoCoin', null); | ||
265 | - $uid = $this->getUid(true); | ||
266 | - $result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin); | ||
267 | - } | ||
268 | - | ||
269 | - if (empty($result)) { | ||
270 | - echo ' '; | ||
271 | - } else { | ||
272 | - $this->echoJson($result); | ||
273 | - } | ||
274 | - } | ||
275 | - | ||
276 | - /** | ||
277 | - * 购物车输入优惠券码使用优惠券 | ||
278 | - */ | ||
279 | - public function couponSearchAction() | ||
280 | - { | ||
281 | - $result = array(); | ||
282 | - | ||
283 | - if ($this->isAjax()) { | ||
284 | - $couponCode = $this->get('couponCode', ''); | ||
285 | - $uid = $this->getUid(true); | ||
286 | - $result = CartModel::searchCoupon($uid, $couponCode); | ||
287 | - } | ||
288 | - | ||
289 | - if (empty($result)) { | ||
290 | - echo ' '; | ||
291 | - } else { | ||
292 | - $this->echoJson($result); | ||
293 | - } | ||
294 | - } | ||
295 | - | ||
296 | - /** | ||
297 | - * 购物车结算--获取优惠券列表 | ||
298 | - */ | ||
299 | - public function couponListAction() | ||
300 | - { | ||
301 | - $result = array(); | ||
302 | - | ||
303 | - if ($this->isAjax()) { | ||
304 | - $uid = $this->getUid(true); | ||
305 | - $page = $this->get('page', 1); | ||
306 | - $result = CartModel::getCouponList($uid); | ||
307 | - } | ||
308 | - | ||
309 | - if (empty($result)) { | ||
310 | - echo ' '; | ||
311 | - } else { | ||
312 | - $this->echoJson($result); | ||
313 | - } | ||
314 | - } | ||
315 | - | ||
316 | - /** | ||
317 | - * 下单流程 选择地址 | ||
318 | - */ | ||
319 | - public function selectAddressAction() | ||
320 | - { | ||
321 | - // 设置网站标题 | ||
322 | - $this->setTitle('选择地址'); | ||
323 | - $this->setNavHeader('选择地址', Helpers::url('/shoppingCart/orderEnsure')); | ||
324 | - | ||
325 | - $uid = $this->getUid(true); | ||
326 | - $address = UserModel::getAddressData($uid); | ||
327 | - | ||
328 | - $this->_view->display('select-address', array( | ||
329 | - 'selectAddressPage' => true, | ||
330 | - 'pageFooter' => true, | ||
331 | - 'address' => $address | ||
332 | - )); | ||
333 | - } | ||
334 | - | ||
335 | - /** | ||
336 | - * 下单流程 选择优惠券 | ||
337 | - */ | ||
338 | - public function selectCouponAction() | ||
339 | - { | ||
340 | - // 设置网站标题 | ||
341 | -======= | ||
342 | /** | 74 | /** |
343 | * 移出购物车 | 75 | * 移出购物车 |
344 | */ | 76 | */ |
@@ -381,6 +113,47 @@ class ShoppingCartController extends AbstractAction | @@ -381,6 +113,47 @@ class ShoppingCartController extends AbstractAction | ||
381 | } | 113 | } |
382 | 114 | ||
383 | /* | 115 | /* |
116 | + * 赠品页面 | ||
117 | + */ | ||
118 | + public function giftAction() | ||
119 | + { | ||
120 | + $this->setTitle('赠品'); | ||
121 | + $this->setNavHeader('赠品'); | ||
122 | + | ||
123 | + $shoppingKey = Helpers::getShoppingKeyByCookie(); | ||
124 | + $uid = $this->getUid(true); | ||
125 | + | ||
126 | + $data = array( | ||
127 | + 'shoppingCartPage' => true, | ||
128 | + 'shoppingCart' => CartModel::getCartData($uid, $shoppingKey, true) | ||
129 | + ); | ||
130 | + | ||
131 | + // 渲染模板 | ||
132 | + $this->_view->display('gift-advance-good', $data); | ||
133 | + } | ||
134 | + | ||
135 | + /* | ||
136 | + * 加价购页面 | ||
137 | + */ | ||
138 | + public function advanceBuyAction() | ||
139 | + { | ||
140 | + $this->setTitle('加价购'); | ||
141 | + $this->setNavHeader('加价购'); | ||
142 | + | ||
143 | + $shoppingKey = Helpers::getShoppingKeyByCookie(); | ||
144 | + $uid = $this->getUid(true); | ||
145 | + | ||
146 | + $data = array( | ||
147 | + 'shoppingCartPage' => true, | ||
148 | + 'shoppingCart' => CartModel::getCartData($uid, $shoppingKey, false, true) | ||
149 | + ); | ||
150 | + print_r($data); | ||
151 | + | ||
152 | + // 渲染模板 | ||
153 | + $this->_view->display('gift-advance-good', $data); | ||
154 | + } | ||
155 | + | ||
156 | + /* | ||
384 | * 获取购物车商品数据 | 157 | * 获取购物车商品数据 |
385 | */ | 158 | */ |
386 | public function goodinfoAction() | 159 | public function goodinfoAction() |
@@ -556,7 +329,6 @@ class ShoppingCartController extends AbstractAction | @@ -556,7 +329,6 @@ class ShoppingCartController extends AbstractAction | ||
556 | public function selectCouponAction() | 329 | public function selectCouponAction() |
557 | { | 330 | { |
558 | // 设置网站标题 | 331 | // 设置网站标题 |
559 | ->>>>>>> develop | ||
560 | $this->setTitle('选择优惠券'); | 332 | $this->setTitle('选择优惠券'); |
561 | $this->setNavHeader('选择优惠券', Helpers::url('/shoppingCart/orderEnsure')); | 333 | $this->setNavHeader('选择优惠券', Helpers::url('/shoppingCart/orderEnsure')); |
562 | $this->_view->display('select-coupon', array( | 334 | $this->_view->display('select-coupon', array( |
@@ -565,76 +337,6 @@ class ShoppingCartController extends AbstractAction | @@ -565,76 +337,6 @@ class ShoppingCartController extends AbstractAction | ||
565 | )); | 337 | )); |
566 | } | 338 | } |
567 | 339 | ||
568 | -<<<<<<< HEAD | ||
569 | - /** | ||
570 | - * 确认结算订单 | ||
571 | - */ | ||
572 | - public function orderSubAction() | ||
573 | - { | ||
574 | - $result = array(); | ||
575 | - | ||
576 | - if ($this->isAjax()) { | ||
577 | - $uid = $this->getUid(true); | ||
578 | - $addressId = $this->post('addressId', null); | ||
579 | - $cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车 | ||
580 | - $deliveryTime = $this->post('deliveryTimeId', 1); // 默认只工作日配送 | ||
581 | - $deliveryWay = $this->post('deliveryId', 1); // 默认普通快递 | ||
582 | - $invoiceTitle = $this->post('invoiceText', null); | ||
583 | - $invoiceId = $this->post('invoiceType', null); | ||
584 | - $paymentId = $this->post('paymentTypeId', 15); | ||
585 | - $paymentType = $this->post('paymentType', 1); // 默认在线支付 | ||
586 | - $remark = $this->post('msg', null); | ||
587 | - $couponCode = $this->post('couponCode', null); | ||
588 | - $yohoCoin = $this->post('yohoCoin', 1); | ||
589 | - $result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin); | ||
590 | - } | ||
591 | - | ||
592 | - if (empty($result)) { | ||
593 | - echo ' '; | ||
594 | - } else { | ||
595 | - // 提交成功清除Cookie | ||
596 | - $this->setCookie('order-info', null); | ||
597 | - | ||
598 | - $this->echoJson($result); | ||
599 | - } | ||
600 | - } | ||
601 | - | ||
602 | - /** | ||
603 | - * 加入购物车 | ||
604 | - * | ||
605 | - * @param string productSku 商品的SKU | ||
606 | - * @param int buyNumber 购买数量 | ||
607 | - * @param int promotionId 促销ID, 加价购有关 | ||
608 | - * @param int goodsType 商品类型,0表示普通商品,1表示加价购商品 | ||
609 | - * @param int isEdit 是否是编辑商品SKU,0表示不是编辑 | ||
610 | - * @return json | ||
611 | - */ | ||
612 | - public function addAction() | ||
613 | - { | ||
614 | - $result = array(); | ||
615 | - | ||
616 | - if ($this->isAjax()) { | ||
617 | - $shoppingKey = Helpers::getShoppingKeyByCookie(); | ||
618 | - $productSku = $this->post('productSku'); | ||
619 | - $buyNumber = $this->post('buyNumber', 1); | ||
620 | - $goodsType = $this->post('goodsType', 0); | ||
621 | - $promotionId = $this->post('promotionId', 0); | ||
622 | - $isEdit = $this->post('isEdit', 0); | ||
623 | - $uid = $this->getUid(true); | ||
624 | - | ||
625 | - // 执行加入购物车操作 | ||
626 | - $result = CartModel::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey); | ||
627 | - | ||
628 | - // 设置加入购物车凭证到客户端浏览器 | ||
629 | - if (isset($result['data']['shopping_key'])) { | ||
630 | - $this->setCookie('_spk', $shoppingKey); | ||
631 | - } | ||
632 | - } | ||
633 | - | ||
634 | - $this->echoJson($result); | ||
635 | - } | ||
636 | - | ||
637 | -======= | ||
638 | /** | 340 | /** |
639 | * 确认结算订单 | 341 | * 确认结算订单 |
640 | */ | 342 | */ |
@@ -667,5 +369,4 @@ class ShoppingCartController extends AbstractAction | @@ -667,5 +369,4 @@ class ShoppingCartController extends AbstractAction | ||
667 | $this->echoJson($result); | 369 | $this->echoJson($result); |
668 | } | 370 | } |
669 | } | 371 | } |
670 | ->>>>>>> develop | ||
671 | } | 372 | } |
-
Please register or login to post a comment