Browse Source
Merge branch 'qs_local_order' into develop
Merge branch 'qs_local_order' into develop
# Conflicts: # app/Admin/Controllers/Test.php # app/Admin/routes.phpmaster
16 changed files with 390 additions and 35 deletions
-
29app/Admin/Controllers/ImsCjdcOrderMainController.php
-
6app/Admin/Controllers/Test.php
-
66app/Admin/Extensions/MyDetailPage.php
-
28app/Admin/Extensions/OrderDetail.php
-
36app/Admin/Extensions/OrderRefund.php
-
4app/Admin/Extensions/OrderStateHandle.php
-
54app/Admin/Forms/RefundNote.php
-
12app/Admin/Renderable/PostChart.php
-
11app/Models/LanzuServiceHorseman.php
-
10composer.lock
-
33config/admin.php
-
12config/order.php
-
49public/css/deatail.css
-
1resources/lang/zh-CN/admin.php
-
1resources/lang/zh-TW/admin.php
-
73resources/views/orderdetail.php
@ -0,0 +1,66 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Admin\Extensions; |
||||
|
|
||||
|
use App\Models\ImsCjdcOrderMain; |
||||
|
use App\Models\LanzuServiceHorseman; |
||||
|
use Dcat\Admin\Admin; |
||||
|
use Dcat\Admin\Support\LazyRenderable; |
||||
|
|
||||
|
class MyDetailPage extends LazyRenderable |
||||
|
{ |
||||
|
|
||||
|
protected static $js = ['https://cdn.jsdelivr.net/npm/vue']; |
||||
|
protected static $css = ['css/deatail.css']; |
||||
|
|
||||
|
|
||||
|
|
||||
|
public function render() |
||||
|
{ |
||||
|
$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']); |
||||
|
|
||||
|
|
||||
|
} |
||||
|
//配送距离
|
||||
|
//配送费
|
||||
|
//拒绝退款理由
|
||||
|
//退款总备注原因,单个商品或者单个子订单
|
||||
|
//dd($order);
|
||||
|
Admin::script( |
||||
|
<<<JS |
||||
|
var app = new Vue({ |
||||
|
el:"#detail", |
||||
|
data:{ |
||||
|
order_num: "{$order['order_num']}", |
||||
|
name: "{$order['name']}", |
||||
|
created_at: "{$order['created_at']}", |
||||
|
updated_at: "{$order['updated_at']}", |
||||
|
pay_type: "{$order['pay_type']}", |
||||
|
shipping_type: "{$order['shipping_type']}", |
||||
|
tel: "{$order['tel']}", |
||||
|
delivery_time_note: "{$order['delivery_time_note']}", |
||||
|
address: "{$order['address']}", |
||||
|
note: "{$order['note']}", |
||||
|
money: "{$order['money']}", |
||||
|
total_money: "{$order['total_money']}", |
||||
|
services_money: "{$order['services_money']}", |
||||
|
coupon_money: "{$order['coupon_money']}", |
||||
|
delivery_money: "{$order['delivery_money']}", |
||||
|
horseman_name: "{$order['horseman_name']}" |
||||
|
} |
||||
|
}); |
||||
|
JS |
||||
|
); |
||||
|
|
||||
|
return view('orderdetail'); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
@ -0,0 +1,36 @@ |
|||||
|
<?php |
||||
|
|
||||
|
|
||||
|
namespace App\Admin\Extensions; |
||||
|
|
||||
|
|
||||
|
use App\Admin\Forms\RefundNote; |
||||
|
use Dcat\Admin\Grid\RowAction; |
||||
|
use Dcat\Admin\Widgets\Modal; |
||||
|
|
||||
|
class OrderRefund extends RowAction |
||||
|
{ |
||||
|
protected $title; |
||||
|
protected $order_id; |
||||
|
protected $currentPage; |
||||
|
public function __construct($orderId,$currentPage,$title=null) |
||||
|
{ |
||||
|
$this->order_id = $orderId; |
||||
|
$this->currentPage = $currentPage; |
||||
|
parent::__construct($title); |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public function render() |
||||
|
{ |
||||
|
|
||||
|
// 实例化表单类并传递自定义参数
|
||||
|
$form = RefundNote::make(['order_id'=>$this->order_id,'current_page'=>$this->currentPage]); |
||||
|
return Modal::make() |
||||
|
->lg() |
||||
|
->title('拒绝理由') |
||||
|
->body($form) |
||||
|
->button($this->title); |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,54 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace App\Admin\Forms; |
||||
|
|
||||
|
use App\Models\ImsCjdcOrderMain; |
||||
|
use Dcat\Admin\Widgets\Form; |
||||
|
use Symfony\Component\HttpFoundation\Response; |
||||
|
|
||||
|
class RefundNote extends Form |
||||
|
{ |
||||
|
/** |
||||
|
* Handle the form request. |
||||
|
* |
||||
|
* @param array $input |
||||
|
* |
||||
|
* @return Response |
||||
|
*/ |
||||
|
public function handle(array $input) |
||||
|
{ |
||||
|
$note = request()->get('refuse_refund_note'); |
||||
|
$oid = request()->get('order_id'); |
||||
|
$current_page = request()->get('current_page'); |
||||
|
$result = ImsCjdcOrderMain::where('id', $oid)->update([ |
||||
|
'refuse_refund_note' => $note, |
||||
|
'state'=>10, |
||||
|
'updated_at' => time() |
||||
|
]); |
||||
|
if ($result) { |
||||
|
return $this->success('操作成功', "order?page={$current_page}"); |
||||
|
} else { |
||||
|
return $this->error('操作失败'); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* Build a form here. |
||||
|
*/ |
||||
|
public function form() |
||||
|
{ |
||||
|
$this->textarea('refuse_refund_note', '原因')->placeholder('请填写拒绝退款的理由,字数不得超过50个字')->required(); |
||||
|
$this->hidden('order_id')->value($this->data['order_id']); |
||||
|
$this->hidden('current_page')->value($this->data['current_page']); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* The data of the form. |
||||
|
* |
||||
|
* @return array |
||||
|
*/ |
||||
|
public function default() |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,12 @@ |
|||||
|
<?php |
||||
|
namespace App\Admin\Renderable; |
||||
|
|
||||
|
use Dcat\Admin\Support\LazyRenderable; |
||||
|
|
||||
|
class PostChart extends LazyRenderable |
||||
|
{ |
||||
|
public function render() |
||||
|
{ |
||||
|
return view('orderdetail'); |
||||
|
} |
||||
|
} |
||||
@ -0,0 +1,49 @@ |
|||||
|
#detail .table-bordered td { |
||||
|
width: 50%; |
||||
|
white-space: initial !important; |
||||
|
font-size: 1.4rem; |
||||
|
} |
||||
|
|
||||
|
.shop-box { |
||||
|
margin-top: 1rem; |
||||
|
font-size: 1.4rem; |
||||
|
} |
||||
|
|
||||
|
.logo-img { |
||||
|
width: 8vw; |
||||
|
height: 10vh; |
||||
|
margin-right: 1rem; |
||||
|
} |
||||
|
|
||||
|
.media { |
||||
|
padding: 1rem 2rem; |
||||
|
background-color: #f8f8f8; |
||||
|
} |
||||
|
|
||||
|
.shop-logo { |
||||
|
width: 2rem; |
||||
|
height: 2rem; |
||||
|
margin-right: 0.6rem; |
||||
|
} |
||||
|
|
||||
|
.alert { |
||||
|
margin-bottom: 0; |
||||
|
border-radius: 0; |
||||
|
} |
||||
|
|
||||
|
.mt-0 { |
||||
|
max-width: 50rem; |
||||
|
font-size: 1.4rem; |
||||
|
} |
||||
|
|
||||
|
.price { |
||||
|
max-width: 48rem; |
||||
|
display: inline-block; |
||||
|
overflow: hidden; |
||||
|
font-size: 1rem; |
||||
|
color: #27272788; |
||||
|
} |
||||
|
.money{ |
||||
|
float: right; |
||||
|
font-size: 1.4rem; |
||||
|
} |
||||
@ -1,14 +1,65 @@ |
|||||
<!DOCTYPE html> |
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}"> |
|
||||
<head> |
|
||||
<meta charset="utf-8"> |
|
||||
<title>Laravel</title> |
|
||||
|
<div id="detail"> |
||||
|
<!-- 用户信息表格 --> |
||||
|
<table class="table table-bordered table-striped"> |
||||
|
<tbody> |
||||
|
<tr> |
||||
|
<td class="text-nowrap" scope="col">订单编号:{{order_num}}</td> |
||||
|
<td colspan="5">创建时间:{{created_at}}</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="text-nowrap" scope="row">用户名称:{{name}}</td> |
||||
|
<td colspan="5">联系电话:{{tel}}3</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="text-nowrap" scope="row">收货地址:{{address}}</td> |
||||
|
<td colspan="5">更新时间:{{updated_at}}</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="text-nowrap" scope="row">预约送达时间:{{delivery_time_note}}</td> |
||||
|
<td class="text-nowrap" scope="col">配送员:{{horseman_name}}</td> |
||||
|
|
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="text-nowrap" scope="row">配送距离:-- km</td> |
||||
|
<td colspan="5">配送费:{{delivery_money}} 元</td> |
||||
|
</tr> |
||||
|
<tr> |
||||
|
<td class="text-nowrap" scope="col">备注:{{note}}</td> |
||||
|
|
||||
|
</tr> |
||||
|
</tbody> |
||||
|
</table> |
||||
|
<!-- 用户信息表格END --> |
||||
|
<!-- 店铺 --> |
||||
|
<div class="shop-box" v-for=""> |
||||
|
<div class="alert alert-secondary" role="alert"> |
||||
|
<img class="shop-logo" src="https://store.lanzu.vip/attachment/zh_cjdianc/2020/06/08/0695939116515895.jpg" alt="店铺logo"/> |
||||
|
<span>2222</span> |
||||
|
</div> |
||||
|
店铺商品 |
||||
|
<div class="media"> |
||||
|
<img class="logo-img" src="https://store.lanzu.vip/attachment/zh_cjdianc/2020/06/08/0695939116515895.jpg" class="align-self-center mr-3" alt="商品图片"> |
||||
|
<div class="media-body"> |
||||
|
<h5 class="mt-0">2222</h5> |
||||
|
<div> |
||||
|
<span class="price">222</span> |
||||
|
<span style="float: right;">X 2222</span> |
||||
|
</div> |
||||
|
<p class="mb-0" style="color: red;font-size: 1.4rem;">¥222</p> |
||||
|
</div> |
||||
|
</div> |
||||
|
</div> |
||||
|
<div class="money"> |
||||
|
总金额: {{total_money}} 元 |
||||
|
   |
||||
|
优惠金额: <span style="color: red">-{{coupon_money}}</span> 元 |
||||
|
   |
||||
|
配送费: <span style="color: green">+{{delivery_money}}</span> 元 |
||||
|
   |
||||
|
增值服务费: <span style="color: green">+{{services_money}}</span> 元 |
||||
|
   |
||||
|
实付金额: {money} 元 |
||||
|
|
||||
</head> |
|
||||
<body > |
|
||||
|
|
||||
<h1>{{$id}}</h1> |
|
||||
</body> |
|
||||
</html> |
|
||||
|
</div> |
||||
|
<!-- 店铺END --> |
||||
|
</div> |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue