|
|
|
@ -3,6 +3,7 @@ |
|
|
|
|
|
|
|
namespace App\Admin\Extensions; |
|
|
|
|
|
|
|
use App\Admin\Common\LinkUrl; |
|
|
|
use App\Models\ImsCjdcOrder; |
|
|
|
use App\Models\ImsCjdcOrderMain; |
|
|
|
use App\Models\LanzuOrderGoods; |
|
|
|
@ -14,30 +15,29 @@ use Endroid\QrCode\Exceptions\DataDoesntExistsException; |
|
|
|
class MyDetailPage extends LazyRenderable |
|
|
|
{ |
|
|
|
|
|
|
|
protected static $js = ['https://cdn.jsdelivr.net/npm/vue']; |
|
|
|
protected static $css = ['css/deatail.css']; |
|
|
|
|
|
|
|
protected static $js = [LinkUrl::VUE_JS, LinkUrl::ELEMENT_UI_JS]; |
|
|
|
protected static $css = [LinkUrl::DETAIL_CSS, LinkUrl::ELEMENT_UI_CSS]; |
|
|
|
|
|
|
|
|
|
|
|
public function render() |
|
|
|
{ |
|
|
|
//>>1.主订单数据
|
|
|
|
$order = ImsCjdcOrderMain::where('id',$this->order_id)->first()->toArray(); |
|
|
|
if ($order){ |
|
|
|
$order['created_at'] = date('Y-m-d H:i:s',$order['created_at']); |
|
|
|
$order['updated_at'] =$order['updated_at'] ? date('Y-m-d H:i:s',$order['updated_at']):null; |
|
|
|
$order = ImsCjdcOrderMain::where('id', $this->order_id)->first()->toArray(); |
|
|
|
if ($order) { |
|
|
|
$order['created_at'] = date('Y-m-d H:i:s', $order['created_at']); |
|
|
|
$order['updated_at'] = $order['updated_at'] ? date('Y-m-d H:i:s', $order['updated_at']) : null; |
|
|
|
$order['pay_type'] = config('order.pay_type')[$order['pay_type']]; |
|
|
|
$order['shipping_type'] = config('order.shipping_type')[$order['shipping_type']]; |
|
|
|
$order['horseman_name'] = LanzuServiceHorseman::getName($order['horseman_id']); |
|
|
|
//>>2.获取子订单
|
|
|
|
$orders = ImsCjdcOrder::with('user')->with('store') |
|
|
|
->where('order_main_id',$order['id'])->get()->toArray(); |
|
|
|
if (count($orders)){ |
|
|
|
foreach ($orders as &$or){ |
|
|
|
if (substr($or['store']['logo'],0,4)!='http'){ |
|
|
|
$or['store']['logo'] = env('IMG_HOST').'/'.$or['store']['logo']; |
|
|
|
->where('order_main_id', $order['id'])->get()->toArray(); |
|
|
|
if (count($orders)) { |
|
|
|
foreach ($orders as &$or) { |
|
|
|
if (substr($or['store']['logo'], 0, 4) != 'http') { |
|
|
|
$or['store']['logo'] = env('IMG_HOST') . '/' . $or['store']['logo']; |
|
|
|
} |
|
|
|
$or['goods'] = LanzuOrderGoods::where('order_id',$or['id'])->get()->toArray(); |
|
|
|
$or['goods'] = LanzuOrderGoods::where('order_id', $or['id'])->get()->toArray(); |
|
|
|
} |
|
|
|
} |
|
|
|
//dd($orders);
|
|
|
|
@ -74,6 +74,26 @@ class MyDetailPage extends LazyRenderable |
|
|
|
horseman_name: "{$order['horseman_name']}", |
|
|
|
orders: JSON.parse(orders) |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
refund() { |
|
|
|
this.\$confirm('是否同意该商品退款?', '提示', { |
|
|
|
confirmButtonText: '同意', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.\$message({ |
|
|
|
type: 'success', |
|
|
|
message: '操作成功!' |
|
|
|
}); |
|
|
|
}).catch(() => { |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
JS |
|
|
|
|