Authored by cailing

订单详情页地址修改

... ... @@ -168,4 +168,23 @@ class OrderData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 订单详情页——地址修改
* @param type $order_code
* @param type $address_id
* @return type
*/
public static function updateDeliveryAddress($order_code, $address_id)
{
// 构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.SpaceOrders.updateDeliveryAddress';
$param['order_code'] = $order_code;
$param['address_id'] = $address_id;
$param['client_secret'] = Sign::getSign($param);
// 调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -273,7 +273,7 @@
{{#if cancel}}
<p>
<span class="cancel-icon oo-icon"></span>
订单已取消
已取消
</p>
{{/if}}
... ...
... ... @@ -66,16 +66,16 @@
</div>
<div class="order-status">
{{#if noPay}}
<span class="no-pay">订单已成功,等待付款</span>
<span class="no-pay">待付款</span>
{{/if}}
{{#if paid}}
<span class="paid">订单已付款,等待备货中</span>
<span class="paid">备货中</span>
{{/if}}
{{#if shipped}}
<span class="shipped">
订单已发
待收
<em class="check-logistics">查看物流</em>
<div class="logistics hide">
<ul class="logistics-list">
... ... @@ -93,11 +93,11 @@
{{/if}}
{{#if complete}}
<span class="complete">订单已成功,等待备货中</span>
<span class="complete">备货中</span>
{{/if}}
{{#if cancel}}
<span class="cancel">订单已取消</span>
<span class="cancel">已取消</span>
{{/if}}
{{#if reback}}
... ...
... ... @@ -486,10 +486,10 @@ class OrderModel
protected static function getOrderStatus($isCancel, $status, $payType, $payStatus)
{
//初始化:未取消,待付款
$ret = array('cancel' => FALSE, 'keyName' => 'noPay', 'statusStr' => '订单已成功,等待付款');
$ret = array('cancel' => FALSE, 'keyName' => 'noPay', 'statusStr' => '待付款');
//订单已取消
if ($isCancel == 'Y') {
$ret = array('cancel' => TRUE, 'statusStr' => '订单已取消');
$ret = array('cancel' => TRUE, 'statusStr' => '已取消');
}
else {
switch ($status) {
... ... @@ -497,17 +497,17 @@ class OrderModel
//'订单已成功,等待付款'
if ($payType != 2 && $payStatus == 'N') {
$ret['keyName'] = 'noPay';
$ret['statusStr'] = '订单已成功,等待付款';
$ret['statusStr'] = '待付款';
}
//'订单已付款,等待备货中'
elseif ($payType != 2 && $payStatus == 'Y') {
$ret['keyName'] = 'paid';
$ret['statusStr'] = '订单已付款,等待备货中';
$ret['statusStr'] = '备货中';
}
//'订单已成功,等待备货中'-货到付款
elseif ($payType == 2 && $payStatus == 'N') {
$ret['keyName'] = 'complete';
$ret['statusStr'] = '订单已成功,等待备货中';
$ret['statusStr'] = '备货中';
}
break;
case 1:
... ... @@ -515,13 +515,13 @@ class OrderModel
case 3:
//'订单已付款,等待备货中'
$ret['keyName'] = 'paid';
$ret['statusStr'] = '订单已付款,等待备货中';
$ret['statusStr'] = '备货中';
break;
case 4:
case 5:
//'订单已发货'
$ret['keyName'] = 'shipped';
$ret['statusStr'] = '订单已发货';
$ret['statusStr'] = '待收货';
break;
case 6:
//'交易完成';
... ...
... ... @@ -7,6 +7,7 @@ use Home\OrderModel;
use LibModels\Web\Home\OrderData;
use Configs\ChannelConfig;
use WebPlugin\Paging;
use Shopping\CartModel;
/**
* 订单
... ... @@ -191,7 +192,7 @@ class OrdersController extends WebAction
break;
}
$uid = $this->auditJumpLogin();
$orderCode = trim($this->post('orderCode', ''));//订单编号
$orderCode = trim($this->post('orderCode', '')); //订单编号
$reason = $this->get('reason', ''); //取消订单原因
$reasonid = $this->get('reasonId', ''); //取消原因id
$data = OrderData::cancelUserOrder($uid, $orderCode, $reason, $reasonid);
... ... @@ -228,4 +229,51 @@ class OrdersController extends WebAction
$this->echoJson($data);
}
/**
* 获取省市区县信息列表
*
* @param int id
* @return json
*/
public function getAreaListAction()
{
$result = array('code' => 200, 'message' => '地区信息', 'data' => array());
if ($this->isAjax()) {
$id = $this->get('id', 0);
$result['data'] = CartModel::getAreaList($id);
}
$this->echoJson($result);
}
/**
* 订单详情页地址修改
*/
public function modifyAddressAction()
{
$result = array('code' => 400, 'message' => '', 'data' => '');
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax()) {
break;
}
//获取相关参数
$order_code = $this->get('orderCode', ''); //订单号
$address_id = $this->get('addressId', ''); //地址id
if (!$order_code || !$address_id) {
$result = array('code' => 400, 'message' => '缺失必填项', 'data' => '');
break;
}
$result = OrderData::updateDeliveryAddress($order_code, $address_id);
if (!isset($result['code'])) {
break;
}
}
while (false);
$this->echoJson($result);
}
}
... ...