Showing
5 changed files
with
81 additions
and
14 deletions
@@ -168,4 +168,23 @@ class OrderData | @@ -168,4 +168,23 @@ class OrderData | ||
168 | return Yohobuy::get(Yohobuy::API_URL, $param); | 168 | return Yohobuy::get(Yohobuy::API_URL, $param); |
169 | } | 169 | } |
170 | 170 | ||
171 | + /** | ||
172 | + * 订单详情页——地址修改 | ||
173 | + * @param type $order_code | ||
174 | + * @param type $address_id | ||
175 | + * @return type | ||
176 | + */ | ||
177 | + public static function updateDeliveryAddress($order_code, $address_id) | ||
178 | + { | ||
179 | + // 构建必传参数 | ||
180 | + $param = Yohobuy::param(); | ||
181 | + $param['method'] = 'app.SpaceOrders.updateDeliveryAddress'; | ||
182 | + $param['order_code'] = $order_code; | ||
183 | + $param['address_id'] = $address_id; | ||
184 | + $param['client_secret'] = Sign::getSign($param); | ||
185 | + | ||
186 | + // 调用接口获得数据 | ||
187 | + return Yohobuy::get(Yohobuy::API_URL, $param); | ||
188 | + } | ||
189 | + | ||
171 | } | 190 | } |
@@ -66,16 +66,16 @@ | @@ -66,16 +66,16 @@ | ||
66 | </div> | 66 | </div> |
67 | <div class="order-status"> | 67 | <div class="order-status"> |
68 | {{#if noPay}} | 68 | {{#if noPay}} |
69 | - <span class="no-pay">订单已成功,等待付款</span> | 69 | + <span class="no-pay">待付款</span> |
70 | {{/if}} | 70 | {{/if}} |
71 | 71 | ||
72 | {{#if paid}} | 72 | {{#if paid}} |
73 | - <span class="paid">订单已付款,等待备货中</span> | 73 | + <span class="paid">备货中</span> |
74 | {{/if}} | 74 | {{/if}} |
75 | 75 | ||
76 | {{#if shipped}} | 76 | {{#if shipped}} |
77 | <span class="shipped"> | 77 | <span class="shipped"> |
78 | - 订单已发货 | 78 | + 待收货 |
79 | <em class="check-logistics">查看物流</em> | 79 | <em class="check-logistics">查看物流</em> |
80 | <div class="logistics hide"> | 80 | <div class="logistics hide"> |
81 | <ul class="logistics-list"> | 81 | <ul class="logistics-list"> |
@@ -93,11 +93,11 @@ | @@ -93,11 +93,11 @@ | ||
93 | {{/if}} | 93 | {{/if}} |
94 | 94 | ||
95 | {{#if complete}} | 95 | {{#if complete}} |
96 | - <span class="complete">订单已成功,等待备货中</span> | 96 | + <span class="complete">备货中</span> |
97 | {{/if}} | 97 | {{/if}} |
98 | 98 | ||
99 | {{#if cancel}} | 99 | {{#if cancel}} |
100 | - <span class="cancel">订单已取消</span> | 100 | + <span class="cancel">已取消</span> |
101 | {{/if}} | 101 | {{/if}} |
102 | 102 | ||
103 | {{#if reback}} | 103 | {{#if reback}} |
@@ -486,10 +486,10 @@ class OrderModel | @@ -486,10 +486,10 @@ class OrderModel | ||
486 | protected static function getOrderStatus($isCancel, $status, $payType, $payStatus) | 486 | protected static function getOrderStatus($isCancel, $status, $payType, $payStatus) |
487 | { | 487 | { |
488 | //初始化:未取消,待付款 | 488 | //初始化:未取消,待付款 |
489 | - $ret = array('cancel' => FALSE, 'keyName' => 'noPay', 'statusStr' => '订单已成功,等待付款'); | 489 | + $ret = array('cancel' => FALSE, 'keyName' => 'noPay', 'statusStr' => '待付款'); |
490 | //订单已取消 | 490 | //订单已取消 |
491 | if ($isCancel == 'Y') { | 491 | if ($isCancel == 'Y') { |
492 | - $ret = array('cancel' => TRUE, 'statusStr' => '订单已取消'); | 492 | + $ret = array('cancel' => TRUE, 'statusStr' => '已取消'); |
493 | } | 493 | } |
494 | else { | 494 | else { |
495 | switch ($status) { | 495 | switch ($status) { |
@@ -497,17 +497,17 @@ class OrderModel | @@ -497,17 +497,17 @@ class OrderModel | ||
497 | //'订单已成功,等待付款' | 497 | //'订单已成功,等待付款' |
498 | if ($payType != 2 && $payStatus == 'N') { | 498 | if ($payType != 2 && $payStatus == 'N') { |
499 | $ret['keyName'] = 'noPay'; | 499 | $ret['keyName'] = 'noPay'; |
500 | - $ret['statusStr'] = '订单已成功,等待付款'; | 500 | + $ret['statusStr'] = '待付款'; |
501 | } | 501 | } |
502 | //'订单已付款,等待备货中' | 502 | //'订单已付款,等待备货中' |
503 | elseif ($payType != 2 && $payStatus == 'Y') { | 503 | elseif ($payType != 2 && $payStatus == 'Y') { |
504 | $ret['keyName'] = 'paid'; | 504 | $ret['keyName'] = 'paid'; |
505 | - $ret['statusStr'] = '订单已付款,等待备货中'; | 505 | + $ret['statusStr'] = '备货中'; |
506 | } | 506 | } |
507 | //'订单已成功,等待备货中'-货到付款 | 507 | //'订单已成功,等待备货中'-货到付款 |
508 | elseif ($payType == 2 && $payStatus == 'N') { | 508 | elseif ($payType == 2 && $payStatus == 'N') { |
509 | $ret['keyName'] = 'complete'; | 509 | $ret['keyName'] = 'complete'; |
510 | - $ret['statusStr'] = '订单已成功,等待备货中'; | 510 | + $ret['statusStr'] = '备货中'; |
511 | } | 511 | } |
512 | break; | 512 | break; |
513 | case 1: | 513 | case 1: |
@@ -515,13 +515,13 @@ class OrderModel | @@ -515,13 +515,13 @@ class OrderModel | ||
515 | case 3: | 515 | case 3: |
516 | //'订单已付款,等待备货中' | 516 | //'订单已付款,等待备货中' |
517 | $ret['keyName'] = 'paid'; | 517 | $ret['keyName'] = 'paid'; |
518 | - $ret['statusStr'] = '订单已付款,等待备货中'; | 518 | + $ret['statusStr'] = '备货中'; |
519 | break; | 519 | break; |
520 | case 4: | 520 | case 4: |
521 | case 5: | 521 | case 5: |
522 | //'订单已发货' | 522 | //'订单已发货' |
523 | $ret['keyName'] = 'shipped'; | 523 | $ret['keyName'] = 'shipped'; |
524 | - $ret['statusStr'] = '订单已发货'; | 524 | + $ret['statusStr'] = '待收货'; |
525 | break; | 525 | break; |
526 | case 6: | 526 | case 6: |
527 | //'交易完成'; | 527 | //'交易完成'; |
@@ -7,6 +7,7 @@ use Home\OrderModel; | @@ -7,6 +7,7 @@ use Home\OrderModel; | ||
7 | use LibModels\Web\Home\OrderData; | 7 | use LibModels\Web\Home\OrderData; |
8 | use Configs\ChannelConfig; | 8 | use Configs\ChannelConfig; |
9 | use WebPlugin\Paging; | 9 | use WebPlugin\Paging; |
10 | +use Shopping\CartModel; | ||
10 | 11 | ||
11 | /** | 12 | /** |
12 | * 订单 | 13 | * 订单 |
@@ -191,7 +192,7 @@ class OrdersController extends WebAction | @@ -191,7 +192,7 @@ class OrdersController extends WebAction | ||
191 | break; | 192 | break; |
192 | } | 193 | } |
193 | $uid = $this->auditJumpLogin(); | 194 | $uid = $this->auditJumpLogin(); |
194 | - $orderCode = trim($this->post('orderCode', ''));//订单编号 | 195 | + $orderCode = trim($this->post('orderCode', '')); //订单编号 |
195 | $reason = $this->get('reason', ''); //取消订单原因 | 196 | $reason = $this->get('reason', ''); //取消订单原因 |
196 | $reasonid = $this->get('reasonId', ''); //取消原因id | 197 | $reasonid = $this->get('reasonId', ''); //取消原因id |
197 | $data = OrderData::cancelUserOrder($uid, $orderCode, $reason, $reasonid); | 198 | $data = OrderData::cancelUserOrder($uid, $orderCode, $reason, $reasonid); |
@@ -228,4 +229,51 @@ class OrdersController extends WebAction | @@ -228,4 +229,51 @@ class OrdersController extends WebAction | ||
228 | $this->echoJson($data); | 229 | $this->echoJson($data); |
229 | } | 230 | } |
230 | 231 | ||
232 | + /** | ||
233 | + * 获取省市区县信息列表 | ||
234 | + * | ||
235 | + * @param int id | ||
236 | + * @return json | ||
237 | + */ | ||
238 | + public function getAreaListAction() | ||
239 | + { | ||
240 | + $result = array('code' => 200, 'message' => '地区信息', 'data' => array()); | ||
241 | + | ||
242 | + if ($this->isAjax()) { | ||
243 | + $id = $this->get('id', 0); | ||
244 | + $result['data'] = CartModel::getAreaList($id); | ||
245 | + } | ||
246 | + | ||
247 | + $this->echoJson($result); | ||
248 | + } | ||
249 | + | ||
250 | + /** | ||
251 | + * 订单详情页地址修改 | ||
252 | + */ | ||
253 | + public function modifyAddressAction() | ||
254 | + { | ||
255 | + $result = array('code' => 400, 'message' => '', 'data' => ''); | ||
256 | + | ||
257 | + do { | ||
258 | + /* 判断是不是AJAX请求 */ | ||
259 | + if (!$this->isAjax()) { | ||
260 | + break; | ||
261 | + } | ||
262 | + //获取相关参数 | ||
263 | + $order_code = $this->get('orderCode', ''); //订单号 | ||
264 | + $address_id = $this->get('addressId', ''); //地址id | ||
265 | + if (!$order_code || !$address_id) { | ||
266 | + $result = array('code' => 400, 'message' => '缺失必填项', 'data' => ''); | ||
267 | + break; | ||
268 | + } | ||
269 | + $result = OrderData::updateDeliveryAddress($order_code, $address_id); | ||
270 | + if (!isset($result['code'])) { | ||
271 | + break; | ||
272 | + } | ||
273 | + } | ||
274 | + while (false); | ||
275 | + | ||
276 | + $this->echoJson($result); | ||
277 | + } | ||
278 | + | ||
231 | } | 279 | } |
-
Please register or login to post a comment