Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop
Showing
8 changed files
with
17 additions
and
358 deletions
1 | -{{> layout/header}} | ||
2 | -<div class="gift-advance-page yoho-page"> | ||
3 | - {{# shoppingCart}} | ||
4 | - {{#if gift}} | ||
5 | - {{# gift}} | ||
6 | - {{> shopping-cart/gift-advance-good}} | ||
7 | - {{/ gift}} | ||
8 | - {{^}} | ||
9 | - {{# advance}} | ||
10 | - <div class="advance-block"> | ||
11 | - <p class="title">{{title}}</p> | ||
12 | - {{# goods}} | ||
13 | - {{> shopping-cart/gift-advance-good}} | ||
14 | - {{/ goods}} | ||
15 | - </div> | ||
16 | - {{/ advance}} | ||
17 | - {{/if}} | ||
18 | - {{/ shoppingCart}} | ||
19 | -</div> | ||
20 | -{{> layout/footer}} |
1 | -{{> layout/header}} | ||
2 | -<div id="mainCart" class="shopping-cart-page yoho-page"> | ||
3 | - {{# shoppingCart}} | ||
4 | - {{#if cartNav}} | ||
5 | - <ul class="cart-nav clearfix"> | ||
6 | - <li class="active"> | ||
7 | - <span> | ||
8 | - 普通商品({{commonGoodsCount}}) | ||
9 | - </span> | ||
10 | - </li> | ||
11 | - <li> | ||
12 | - <span> | ||
13 | - 预售商品({{presellGoodsCount}}) | ||
14 | - </span> | ||
15 | - </li> | ||
16 | - </ul> | ||
17 | - {{/if}} | ||
18 | - | ||
19 | - {{#if showLoginInfo}} | ||
20 | - <p class="login-info"> | ||
21 | - <span class="iconfont"></span> | ||
22 | - 请您先 | ||
23 | - <a class="btn btn-login">登录</a> | ||
24 | - 可以同步电脑和手机中的商品 | ||
25 | - </p> | ||
26 | - {{/if}} | ||
27 | - | ||
28 | - {{# commonCart}} | ||
29 | - <div class="cart-content common"> | ||
30 | - {{> shopping-cart/cart-content}} | ||
31 | - </div> | ||
32 | - {{/ commonCart}} | ||
33 | - | ||
34 | - {{# preSellCart}} | ||
35 | - <div class="cart-content presell hide"> | ||
36 | - <p class="presell-info"> | ||
37 | - <span class="iconfont"></span> | ||
38 | - <span class="txt">预售商品全场包邮,到货后立即发货</span> | ||
39 | - <span class="txt">预售商品不参加活动,不可使用优惠券</span> | ||
40 | - </p> | ||
41 | - {{> shopping-cart/cart-content}} | ||
42 | - </div> | ||
43 | - {{/ preSellCart}} | ||
44 | - | ||
45 | - {{/ shoppingCart}} | ||
46 | -</div> | ||
47 | -<div id="advanceBuy" class="shopping-cart-page yoho-page hide"> | ||
48 | -{{# shoppingCart}} | ||
49 | - {{# commonCart}} | ||
50 | - {{# advanceBuy}} | ||
51 | - <span> | ||
52 | - {{promotionTitle}} | ||
53 | - </span> | ||
54 | - {{# goods}} | ||
55 | - {{> shopping-cart/gift-advance-good}} | ||
56 | - {{/ goods}} | ||
57 | - {{/ advanceBuy}} | ||
58 | - {{/ commonCart}} | ||
59 | -{{/ shoppingCart}} | ||
60 | -</div> | ||
61 | - | ||
62 | -<div class="shopping-cart-zero yoho-page hide"> | ||
63 | - <div class="cart-zero"> | ||
64 | - <i class="iconfont"></i> | ||
65 | - <p>您的购物车暂无商品</p> | ||
66 | - <a href="">随便逛逛</a> | ||
67 | - </div> | ||
68 | - {{> product/recommend-for-you}} | ||
69 | -</div> | ||
70 | - | ||
71 | - {{> shopping-cart/chose-panel}} | ||
72 | -{{> layout/footer}} |
1 | -{{> layout/header}} | ||
2 | -<div class="order-ensure-page yoho-page"> | ||
3 | - {{# orderEnsure}} | ||
4 | - <a class="address-wrap block" data-id="{{addressId}}" href="/shoppingCart/selectAddress"> | ||
5 | - <p class="infos"> | ||
6 | - 收货地址 | ||
7 | - <span class="per-info">{{name}} {{phoneNum}}</span> | ||
8 | - <span class="address">{{area}} {{address}}</span> | ||
9 | - </p> | ||
10 | - <span class="iconfont"></span> | ||
11 | - </a> | ||
12 | - | ||
13 | - <section class="dispatch block"> | ||
14 | - <div class="sub-block"> | ||
15 | - <h3 class="title">配送方式</h3> | ||
16 | - <ul class="dispatch-mode clearfix"> | ||
17 | - {{#each dispatchMode}} | ||
18 | - <li {{#if isSelected}}class="chosed"{{/if}} data-id="{{id}}">{{name}}</li> | ||
19 | - {{/each}} | ||
20 | - </ul> | ||
21 | - </div> | ||
22 | - | ||
23 | - <div class="sub-block"> | ||
24 | - <h3 class="title">送货时间</h3> | ||
25 | - <ul class="dispatch-time clearfix"> | ||
26 | - {{#each dispatchTime}} | ||
27 | - <li {{#if isSelected}}class="chosed"{{/if}} data-id="{{id}}">{{name}}</li> | ||
28 | - {{/each}} | ||
29 | - </ul> | ||
30 | - </div> | ||
31 | - </section> | ||
32 | - | ||
33 | - <section class="block"> | ||
34 | - <h3 class="title">商品</h3> | ||
35 | - <div class="goods"> | ||
36 | - {{#each goods}} | ||
37 | - {{> me/order/good}} | ||
38 | - {{/each}} | ||
39 | - </div> | ||
40 | - </section> | ||
41 | - | ||
42 | - <section class="block"> | ||
43 | - <ul class="sale-invoice"> | ||
44 | - {{# coupon}} | ||
45 | - <li class="coupon"> | ||
46 | - <a href="/shoppingCart/selectCoupon"> | ||
47 | - <span class="title">优惠券</span> | ||
48 | - {{#if count}} | ||
49 | - <span class="coupon-count"> | ||
50 | - {{count}}张可用 | ||
51 | - </span> | ||
52 | - {{/if}} | ||
53 | - | ||
54 | - {{#if value}} | ||
55 | - <span class="used coupon-use"> | ||
56 | - -¥{{value}} | ||
57 | - <i class="iconfont"></i> | ||
58 | - </span> | ||
59 | - {{^}} | ||
60 | - <span class="not-used coupon-use"> | ||
61 | - 未使用 | ||
62 | - <i class="iconfont"></i> | ||
63 | - </span> | ||
64 | - {{/if}} | ||
65 | - </a> | ||
66 | - </li> | ||
67 | - {{/coupon}} | ||
68 | - | ||
69 | - <li class="coin" data-yoho-coin="{{yohoCoin}}"> | ||
70 | - <span class="title">YOHO币</span> | ||
71 | - <span class="desc">可抵用¥{{yohoCoin}}</span> | ||
72 | - <span class="coin-check"> | ||
73 | - <em>- ¥ {{yohoCoin}}</em> | ||
74 | - <i class="iconfont checkbox icon-cb-checked"></i> | ||
75 | - </span> | ||
76 | - </li> | ||
77 | - | ||
78 | - {{#if invoice}} | ||
79 | - <li class="invoice {{#if needInvoice}}focus{{/if}}"> | ||
80 | - <span class="title">发票</span> | ||
81 | - <span class="iconfont checkbox {{#if needInvoice}}icon-cb-checked{{else}}icon-checkbox{{/if}}"></span> | ||
82 | - <form id="invoice"> | ||
83 | - <input type="text" name="invoice-title" value="{{invoiceText}}" placeholder="发票抬头"> | ||
84 | - <label> | ||
85 | - 发票类型 | ||
86 | - <select class="invoice-type" name="invoice-type"> | ||
87 | - {{# invoice}} | ||
88 | - <option value="{{id}}" {{#if isSelected}}selected{{/if}}>{{name}}</option> | ||
89 | - {{/ invoice}} | ||
90 | - </select> | ||
91 | - </label> | ||
92 | - </form> | ||
93 | - </li> | ||
94 | - {{/if}} | ||
95 | - </ul> | ||
96 | - | ||
97 | - <form id="msg" action="" method="post"> | ||
98 | - <input type="text" name="msg" value="{{msg}}" placeholder="留言"> | ||
99 | - </form> | ||
100 | - </section> | ||
101 | - | ||
102 | - <section class="price-cal block"> | ||
103 | - <ul class="total"> | ||
104 | - <li> | ||
105 | - <span>总价</span> | ||
106 | - ¥{{sumPrice}} | ||
107 | - </li> | ||
108 | - <li> | ||
109 | - <span>活动价</span> | ||
110 | - - ¥{{salePrice}} | ||
111 | - </li> | ||
112 | - <li> | ||
113 | - <span>运费</span> | ||
114 | - + {{freight}} | ||
115 | - </li> | ||
116 | - {{#couponPrice}} | ||
117 | - <li> | ||
118 | - <span>优惠券</span> | ||
119 | - - ¥{{.}} | ||
120 | - </li> | ||
121 | - {{/couponPrice}} | ||
122 | - <li> | ||
123 | - <span>YOHO币</span> | ||
124 | - - ¥{{yohoCoin}} | ||
125 | - </li> | ||
126 | - <li class="cost"> | ||
127 | - 应付金额: <em>¥{{price}}</em> | ||
128 | - </li> | ||
129 | - </ul> | ||
130 | - </section> | ||
131 | - | ||
132 | - <ul class="pay-mode"> | ||
133 | - {{# paymentWay}} | ||
134 | - <li class="{{#if default}}default{{/if}}" data-pay-type="{{paymentType}}" data-pay-id="{{id}}"> | ||
135 | - <span class="iconfont"> | ||
136 | - {{#if default}} | ||
137 | -  | ||
138 | - {{else}} | ||
139 | -  | ||
140 | - {{/if}} | ||
141 | - </span> | ||
142 | - {{name}} | ||
143 | - </li> | ||
144 | - {{/ paymentWay}} | ||
145 | - </ul> | ||
146 | - {{/ orderEnsure}} | ||
147 | -</div> | ||
148 | -<script id="tmpl-price" type="text/tmpl"> | ||
149 | - <ul class="total"> | ||
150 | - <li> | ||
151 | - <span>总价</span> | ||
152 | - ¥\{{sumPrice}} | ||
153 | - </li> | ||
154 | - <li> | ||
155 | - <span>活动价</span> | ||
156 | - - ¥\{{salePrice}} | ||
157 | - </li> | ||
158 | - <li> | ||
159 | - <span>运费</span> | ||
160 | - + \{{freight}} | ||
161 | - </li> | ||
162 | - \{{#couponPrice}} | ||
163 | - <li> | ||
164 | - <span>优惠券</span> | ||
165 | - - ¥\{{.}} | ||
166 | - </li> | ||
167 | - \{{/couponPrice}} | ||
168 | - <li> | ||
169 | - <span>YOHO币</span> | ||
170 | - - ¥\{{yohoCoin}} | ||
171 | - </li> | ||
172 | - <li class="cost"> | ||
173 | - 应付金额: <em>¥\{{price}}</em> | ||
174 | - </li> | ||
175 | - </ul> | ||
176 | -</script> | ||
177 | -{{> layout/footer}} |
1 | -{{> layout/header}} | ||
2 | -<div class="my-address-page select-address-page yoho-page"> | ||
3 | - <div class="page-wrap"> | ||
4 | - {{# address}} | ||
5 | - <a class="address-item" data-address-id="{{address_id}}" href="/shoppingCart/orderEnsure"> | ||
6 | - <span class="name">{{consignee}}</span> | ||
7 | - <span class="tel">{{mobile}}</span> | ||
8 | - <p class="address-info">{{area}} {{address}}</p> | ||
9 | - <div class="action iconfont"> | ||
10 | - <span class="edit" data-href="/home/addressAct?id={{address_id}}&refer=shopping"></span> | ||
11 | - <span class="del" data-id="{{address_id}}"></span> | ||
12 | - </div> | ||
13 | - </a> | ||
14 | - {{/ address}} | ||
15 | - | ||
16 | - <a class="add-address" data-href="/home/addressAct?refer=shopping"> | ||
17 | - 添加新地址 | ||
18 | - </a> | ||
19 | - | ||
20 | - <div class="confim-mask hide"> | ||
21 | - <div class="confim-box"> | ||
22 | - <div class="content"> | ||
23 | - 您确定要删除地址? | ||
24 | - </div> | ||
25 | - <div class="action"> | ||
26 | - <span class="cancel"> | ||
27 | - 取消 | ||
28 | - </span> | ||
29 | - <span class="confim"> | ||
30 | - 确认 | ||
31 | - </span> | ||
32 | - </div> | ||
33 | - </div> | ||
34 | - </div> | ||
35 | - </div> | ||
36 | -</div> | ||
37 | -{{> layout/footer}} |
1 | -{{> layout/header}} | ||
2 | -<div class="yoho-page select-coupon-page my-coupon-page"> | ||
3 | - <form id="new-coupon" method="POST" action=""> | ||
4 | - <input type="text" name="couponCode" value="" placeholder="输入优惠券码"> | ||
5 | - <button type="submit" class="submit">确定</button> | ||
6 | - </form> | ||
7 | - <div id="coupon-list" class="coupon-list"></div> | ||
8 | - <div class="not-avaliable-coupon-line hide">不可使用的优惠券</div> | ||
9 | - <div id="coupon-list-not" class="coupon-list"></div> | ||
10 | -</div> | ||
11 | -<script id="tmpl-coupon" type="text/tmpl"> | ||
12 | -\{{#coupons}} | ||
13 | - \{{^ notAvailable}} | ||
14 | - <a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-value="\{{ couponValue}}" href="/shoppingCart/orderEnsure"> | ||
15 | - <span>\{{ couponValue}}</span> | ||
16 | - <p class="coupon-name">\{{ couponDetailInfomation}}</p> | ||
17 | - <p>有效期:\{{ couponValidity}}</p> | ||
18 | - </a> | ||
19 | - \{{/ notAvailable}} | ||
20 | -\{{/coupons}} | ||
21 | -</script> | ||
22 | -<script id="tmpl-coupon-not-avaliable" type="text/tmpl"> | ||
23 | -\{{# notAvailableCoupons}} | ||
24 | - <div class="employ-main not-avaliable"> | ||
25 | - <span>\{{ couponValue}}</span> | ||
26 | - <p class="coupon-name">\{{ couponDetailInfomation}}</p> | ||
27 | - <p>有效期:\{{ couponValidity}}</p> | ||
28 | - </div> | ||
29 | -\{{/ notAvailableCoupons}} | ||
30 | -</script> | ||
31 | -<script id="tmpl-no-coupon" type="text/tmpl"> | ||
32 | -<div class="coupon-list"> | ||
33 | - <div class="null"> | ||
34 | - <i></i> | ||
35 | - <p>您还没有优惠券!</p> | ||
36 | - </div> | ||
37 | -</div> | ||
38 | -</script> | ||
39 | -{{> layout/footer}} |
@@ -72,10 +72,11 @@ class ShoppingcartController extends AbstractAction | @@ -72,10 +72,11 @@ class ShoppingcartController extends AbstractAction | ||
72 | $result = array(); | 72 | $result = array(); |
73 | 73 | ||
74 | if ($this->isAjax()) { | 74 | if ($this->isAjax()) { |
75 | - $productId = $this->post('id', 0); | ||
76 | $uid = $this->getUid(true); | 75 | $uid = $this->getUid(true); |
77 | $shoppingKey = $this->getSession('shoppingKey'); | 76 | $shoppingKey = $this->getSession('shoppingKey'); |
78 | - $result = CartModel::selectGoods($uid, $productId, $shoppingKey); | 77 | + |
78 | + $skuList = $this->post('skuList', null); | ||
79 | + $result = CartModel::selectGoods($uid, $skuList, $shoppingKey); | ||
79 | } | 80 | } |
80 | 81 | ||
81 | if (empty($result)) { | 82 | if (empty($result)) { |
@@ -96,22 +96,25 @@ class CartModel | @@ -96,22 +96,25 @@ class CartModel | ||
96 | * 购物车商品选择与取消接口返回的数据处理 | 96 | * 购物车商品选择与取消接口返回的数据处理 |
97 | * | 97 | * |
98 | * @param int $uid 用户ID | 98 | * @param int $uid 用户ID |
99 | - * @param string $sku 商品sku列表 | 99 | + * @param string $skuList 商品sku列表 |
100 | * @param string $shoppingKey 未登录用户唯一识别码 | 100 | * @param string $shoppingKey 未登录用户唯一识别码 |
101 | * @return array 处理之后的数据的数据 | 101 | * @return array 处理之后的数据的数据 |
102 | */ | 102 | */ |
103 | - public static function selectGoods($uid, $sku, $shoppingKey) | 103 | + public static function selectGoods($uid, $skuList, $shoppingKey) |
104 | { | 104 | { |
105 | $result = array('code' => 400, 'message' => '出错啦~'); | 105 | $result = array('code' => 400, 'message' => '出错啦~'); |
106 | 106 | ||
107 | - // 处理sku | ||
108 | - $sku_list = json_encode(array($sku => 1)); | 107 | + do { |
108 | + if (empty($skuList)) { | ||
109 | + break; | ||
110 | + } | ||
109 | 111 | ||
110 | - $select = CartData::selectGoods($uid, $sku_list, $shoppingKey); | ||
111 | - if ($select && isset($select['code'])) { | ||
112 | - $result['code'] = $select['code']; | ||
113 | - $result['message'] = $select['message']; | ||
114 | - } | 112 | + $select = CartData::selectGoods($uid, $skuList, $shoppingKey); |
113 | + if ($select && isset($select['code'])) { | ||
114 | + $result['code'] = $select['code']; | ||
115 | + $result['message'] = $select['message']; | ||
116 | + } | ||
117 | + }while(0); | ||
115 | 118 | ||
116 | return $result; | 119 | return $result; |
117 | } | 120 | } |
@@ -254,13 +254,13 @@ class BindController extends AbstractAction | @@ -254,13 +254,13 @@ class BindController extends AbstractAction | ||
254 | { | 254 | { |
255 | $refer = rawurldecode($refer); | 255 | $refer = rawurldecode($refer); |
256 | } | 256 | } |
257 | - | 257 | + |
258 | if (isset($res['code']) && $res['code'] == 200 && !empty($res['data']['uid'])) | 258 | if (isset($res['code']) && $res['code'] == 200 && !empty($res['data']['uid'])) |
259 | { | 259 | { |
260 | $token = Helpers::makeToken($res['data']['uid']); | 260 | $token = Helpers::makeToken($res['data']['uid']); |
261 | $this->setCookie('_TOKEN', $token); | 261 | $this->setCookie('_TOKEN', $token); |
262 | $this->setSession('_TOKEN', $token); | 262 | $this->setSession('_TOKEN', $token); |
263 | - $refer = Helpers::syncUserSession($data['data']['uid'], $refer); | 263 | + $refer = Helpers::syncUserSession($res['data']['uid'], $refer); |
264 | $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('refer' => $refer)); | 264 | $data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('refer' => $refer)); |
265 | } | 265 | } |
266 | else | 266 | else |
-
Please register or login to post a comment