123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784 |
- <?php namespace Place_order\Manage\Lib\Source;
- use Dever;
- class View
- {
- private $info;
- private $user;
- # 后台详情页
- public function get($info)
- {
- $info['detail'] = Dever::db('source_detail', 'place_order')->select(['order_id' => $info['id']]);
- $this->info = Dever::load('source/order', 'place_order')->getView($info);
- $this->info['source_type'] = [];
- $tab = $this->getTab();
- return ['title' => '订单详情', 'info' => $this->getInfo(), 'tab' => $tab];
- }
- # 获取基本信息
- private function getInfo()
- {
- if ($this->info['refund_status'] == 1) {
- $this->info['status_name'] .= '<span style="color:red">[退]</span>';
- }
- $info[] = [
- # 类型,info介绍 desc描述 table表格,表格有head和body即可
- 'type' => 'info',
- 'name' => '资源订单',
- 'info' => '订单号:' . $this->info['order_num'],
- # 右侧按钮
- 'button' => $this->getButton(),
- # 具体内容
- 'content' => [
- ['name' => '订单状态', 'content' => $this->info['status_name']],
- ['name' => '总金额', 'content' => $this->info['cash_text']],
- ['name' => '总数量', 'content' => $this->info['num']],
- ['name' => '下单时间', 'content' => $this->info['cdate_str']],
- ],
- ];
- return $info;
- }
- # 获取切换列表
- private function getTab()
- {
- $tab['active'] = 'view';
- $tab['content']['view'] = $this->getView();
- //$tab['content']['process'] = $this->getProcess();
- $tab['content']['list'] = $this->getList();
- if ($this->info['refund_list']) {
- if ($this->info['refund_status'] == 1) {
- $tab['active'] = 'refund';
- }
- $tab['content']['refund'] = $this->getRefund();
- }
- # 返利信息
- $rebate = Dever::db('rebate', 'place_order')->select(['table' => 'source', 'table_id' => $this->info['id']]);
- if ($rebate) {
- $tab['content']['rebate'] = $this->getRebate($rebate);
- }
- $tab['content']['log'] = $this->getLog();
- return $tab;
- }
- # 获取详情
- private function getView()
- {
- $content = [];
- $sales = Dever::load('manage/info', 'place_channel_sales')->getInfo($this->info['sales_type'], $this->info['sales_id']);
- $method = Dever::db('source', 'place_order')->value('method', $this->info['method']);
- $content[] = [
- 'type' => 'list',
- 'name' => '用户信息',
- 'content' => [
- [
- 'name' => '用户名称',
- 'content' => $this->info['user']['name'],
- ],
- [
- 'name' => '用户账户',
- 'content' => $this->info['user']['mobile'],
- ],
- [
- 'name' => '渠道信息',
- 'content' => $sales,
- ],
- [
- 'name' => '发货方式',
- 'content' => $method,
- ],
- ],
- ];
- if (isset($this->info['address']) && $this->info['address']) {
- $content[] = [
- 'type' => 'list',
- 'name' => '收货信息',
- 'copy' => true,
- 'content' => [
- [
- 'name' => '收货人',
- 'content' => $this->info['address']['name'],
- ],
- [
- 'name' => '收货电话',
- 'content' => $this->info['address']['phone'],
- ],
- [
- 'name' => '城市地区',
- 'content' => $this->info['address']['area_string'],
- ],
- [
- 'name' => '收货地址',
- 'content' => $this->info['address']['address'],
- ],
- ],
- 'button' => array
- (
- array
- (
- 'name' => '编辑',
- 'type' => 'fastadd',
- 'path' => 'source_manage/help',
- ),
- ),
- ];
- }
- $coupon_tip = '';
- if ($this->info['user_coupon_id'] > 0) {
- $user_coupon = Dever::db('coupon', 'place_user')->find($this->info['user_coupon_id']);
- $coupon = Dever::db('coupon', 'place_benefit')->find($this->info['coupon_id']);
- $coupon_tip = $coupon['name'];
- /*
- if ($user_coupon['coupon_code_id'] > 0) {
- $code = Dever::db('coupon_code', 'place_benefit')->find($user_coupon['coupon_code_id']);
- $coupon_tip .= '['.$code['code'].']';
- }*/
- if ($coupon['type'] == 3) {
- $user_coupon['value'] = floor($user_coupon['value']) . '折';
- $coupon_tip .= ',折扣:' . $user_coupon['value'] . ',抵扣:' . $this->info['coupon_cash_text'];
- } elseif ($coupon['type'] == 4) {
- $user_coupon['value'] = floor($user_coupon['value']) . '个';
- $this->info['coupon_value'] = floor($this->info['coupon_value']) . '个';
- $coupon_tip .= ',总数:' . $user_coupon['value'] . ',本次使用:'.$this->info['coupon_value'].',抵扣:' . $this->info['coupon_cash_text'];
- } else {
- $user_coupon['value'] = Dever::load('info', 'place_score')->toScore($user_coupon['value'], $this->info['score']['exp']);
- $user_coupon['value'] = Dever::load('info', 'place_score')->getText($user_coupon['value'], $this->info['score']);
- $coupon_tip .= ',总面值:' . $user_coupon['value'] . ',本次使用:' . $this->info['coupon_cash_text'];
- }
- }
- $gift_tip = '';
- if ($this->info['user_gift_id'] > 0) {
- $user_gift = Dever::db('gift', 'place_user')->find($this->info['user_gift_id']);
- $gift = Dever::db('gift', 'place_benefit')->find($this->info['gift_id']);
- $gift_tip = $gift['name'];
- /*
- if ($user_coupon['coupon_code_id'] > 0) {
- $code = Dever::db('coupon_code', 'place_benefit')->find($user_coupon['coupon_code_id']);
- $coupon_tip .= '['.$code['code'].']';
- }*/
- $user_gift['value'] = Dever::load('info', 'place_score')->toScore($user_gift['value'], $this->info['score']['exp']);
- $user_gift['value'] = Dever::load('info', 'place_score')->getText($user_gift['value'], $this->info['score']);
- $gift_tip .= ',总面值:' . $user_gift['value'] . ',本次使用:' . $this->info['gift_cash_text'];
- }
- $refund_tip = '';
- if ($this->info['refund_cash'] > 0) {
- $cash = Dever::load('source/refund', 'place_order')->getCash($this->info, $this->info['refund_cash'], 0);
- $pay_cash_money = Dever::load('info', 'place_score')->toMoney($cash['pay_cash'], $this->info['score']['exp']) . $this->info['money']['unit'];
- list($cash['pay_cash'], $cash['wallet_cash'], $cash['coupon_cash'], $cash['gift_cash']) = Dever::load('info', 'place_score')->getText([$cash['pay_cash'], $cash['wallet_cash'], $cash['coupon_cash'], $cash['gift_cash']], $this->info['score']);
- $refund_tip .= '支付退款:'.$cash['pay_cash'] . '['.$pay_cash_money.']';
- $refund_tip .= ',' . $this->info['score']['name'] . '退款:'.$cash['wallet_cash'];
- $refund_tip .= ',礼品卡退款:'.$cash['gift_cash'];
- $refund_tip .= ',优惠券退款:'.$cash['coupon_cash'];
- }
- $content[] = [
- 'type' => 'list',
- 'name' => '金额信息',
- 'content' => [
- [
- 'name' => '总金额',
- 'content' => $this->info['cash_text'],
- ],
- [
- 'name' => '优惠券抵扣',
- 'content' => $this->info['coupon_cash_text'],
- 'tip' => $coupon_tip,
- ],
- [
- 'name' => '礼品卡抵扣',
- 'content' => $this->info['gift_cash_text'],
- 'tip' => $gift_tip,
- ],
- [
- 'name' => $this->info['score']['name'] . '抵扣',
- 'content' => $this->info['wallet_cash_text'],
- ],
- [
- 'name' => '支付金额',
- 'content' => $this->info['pay_cash_text'] . '['.$this->info['pay_money_cash_text'].']',
- ],
- [
- 'name' => '退款金额',
- 'content' => $this->info['refund_cash_text'],
- 'tip' => $refund_tip,
- ],
- ],
- ];
- if ($this->info['coupon_cash'] > 0) {
- # 优惠券信息
- }
- $content[] = [
- 'type' => 'list',
- 'name' => '备注信息',
- 'content' => [
- [
- 'name' => '买家留言',
- 'content' => $this->info['buy_info'] ?: '无',
- ],
- [
- 'name' => '订单备注',
- 'content' => $this->info['sell_info'] ?: '无',
- ],
- ],
- ];
- return [
- 'type' => 'mul',
- 'name' => '详情',
- 'content' => $content
- ];
- }
- # 获取进度
- private function getProcess()
- {
- $timeline = [];
- foreach ($this->info['status_list'] as $k => $v) {
- $v['name'] = '['.$v['name'].']';
- if ($k == 1) {
- $v['name'] .= ' 下单人:' . $this->info['user']['name'] . '('.$this->info['user']['mobile'].')' . ' 付款:' . $this->info['cash'] . '元 ';
- } elseif ($k == 2) {
- if (isset($this->info['address']) && $this->info['address']) {
- $v['name'] .= ' 收货地址:' . $this->info['address']['full'];
- }
- } elseif ($k == 3) {
- if (isset($this->info['express'])) {
- $v['name'] .= ' 已发货:' . $this->info['express']['name'] . ',' . $this->info['express']['number'];
- }
- } elseif ($k == 4) {
- if (isset($this->info['express']['log'][0])) {
- $v['name'] .= ' ' . $this->info['express']['log'][0]['status'];
- }
- } elseif ($k == 5 && $this->info['status'] > 6) {
- $v['name'] .= ' 订单'.$this->info['status_name'].'';
- }
- if ($v['selected']) {
- $v['hollow'] = true;
- $v['color'] = '#0bbd87';
- $v['type'] = 'primary';
- $v['size'] = 'large';
- }
- $timeline[] = $v;
- }
- $content[] = [
- 'name' => '',
- 'type' => 'timeline',
- 'content' => $timeline,
- ];
- return [
- 'type' => 'mul',
- 'name' => '进度',
- 'content' => [
- [
- 'type' => 'desc',
- 'name' => '',
- 'column' => 1,
- 'border' => false,
- # 排列方向:horizontal横向 vertical纵向
- 'direction' => 'vertical',
- 'content' => $content,
- ],
- ]
- ];
- }
- # 获取清单
- private function getList()
- {
- if ($this->info['detail']) {
- foreach ($this->info['detail'] as &$v) {
- $v['status'] = $this->getListStatus($v);
- $v['cash'] = $this->getListCash($v);
- $v['id'] = Dever::load('info', 'place_source')->getCode($v['id']);
- $this->info['source_type'][$v['source_type']] = $v['source_type'];
- }
- }
- return [
- 'name' => '清单',
- 'type' => 'table',
- 'border' => true,
- # 这里配置和列表list一模一样
- 'head' => [
- [
- 'key' => 'id',
- 'name' => '编号',
- ],
- [
- 'key' => 'name',
- 'name' => '名称',
- ],
- [
- 'key' => 'sku_name',
- 'name' => '规格',
- ],
- [
- 'key' => 'cash',
- 'name' => '单价',
- 'type' => 'popover',
- 'location' => 'right',
- //'tag' => true,
- ],
- [
- 'key' => 'num',
- 'name' => '数量',
- ],
- [
- 'key' => 'status',
- 'name' => '状态',
- 'type' => 'popover',
- 'location' => 'right',
- 'tag' => true,
- //'fixed' => 'fixed',
- ],
- ],
- 'button' => [],
- 'body' => $this->info['detail'],
- ];
- }
- private function getListStatus($detail)
- {
- if (isset($detail['delivery']) && $info = $detail['delivery']) {
- $data['content'] = [];
- $data['content']['type'] = 'line';
- $data['content']['content'] = [];
- if ($detail['source_type'] == 1) {
- $data['content']['content'][] = ['name' => '快递公司', 'content' => $info['name']];
- $data['content']['content'][] = ['name' => '快递单号', 'content' => $info['content']];
- } else {
- $data['content']['content'][] = ['name' => '发货类型', 'content' => $info['name']];
- $data['content']['content'][] = ['name' => '发货内容', 'content' => $info['content']];
- }
-
- $data['content']['content'][] = ['name' => '发货时间', 'content' => date('Y-m-d H:i:s', $detail['ddate'])];
- if ($detail['qdate']) {
- $data['content']['content'][] = ['name' => '签收时间', 'content' => date('Y-m-d H:i:s', $detail['qdate'])];
- }
- if (isset($info['log']) && $info['log']) {
- $info['log'] = $this->html($info['log']);
- $data['content']['content'][] = ['name' => '快递信息', 'content' => '点此查看', 'alert' => $info['log']];
- }
- } else {
- $data['content'] = [];
- $data['content']['type'] = 'text';
- $data['content']['content'] = '无';
- }
- $data['name'] = Dever::db('source_detail', 'place_order')->value('status', $detail['status']);
- $result = [0 => $data];
- return $result;
- }
- // 时间线 HTML
- public function html($log) {
- $html = '<div class="timeline" style="border-left:3px solid #3498db; margin:20px; padding-left:20px;">';
- foreach($log as $index => $item) {
- // 最新状态高亮
- $bgColor = $index === 0 ? '#dff0d8' : '#f0f8ff';
- $html .= '<div class="timeline-item" style="position: relative; margin-bottom: 20px;">';
- $html .= '<div class="timeline-time" style="font-size:12px; color:#888;">' . htmlspecialchars($item['time']) . '</div>';
- $html .= '<div class="timeline-content" style="padding:8px 12px; background:' . $bgColor . '; border-radius:5px; margin-top:5px;">';
- $html .= htmlspecialchars($item['status']);
- $html .= '</div>';
- $html .= '</div>';
- }
- $html .= '</div>';
- return $html;
- }
- private function getListCash($detail)
- {
- $data['name'] = Dever::load('info', 'place_score')->getText($detail['cash'], $this->info['score']);
- $promotion = Dever::db('promotion', 'place_order')->select(['table' => 'source_detail', 'table_id' => $detail['id']]);
- if ($promotion) {
- $data['content'] = [];
- $data['content']['type'] = 'line';
- $data['content']['content'] = [];
- foreach ($promotion as $k => $v) {
- if ($k == 0) {
- $v['m_price'] = Dever::load('info', 'place_score')->getText($v['m_price'], $this->info['score']);
- $data['content']['content'][] = ['name' => '原价', 'content' => $v['m_price']];
- }
- $v['price'] = Dever::load('info', 'place_score')->getText($v['price'], $this->info['score']);
- $v['price'] = $v['price'] . '('.$v['value'].'折)';
- $data['content']['content'][] = ['name' => $v['name'], 'content' => $v['price']];
- }
- # 金额信息
- list($detail['total_cash'], $detail['pay_cash'], $detail['wallet_cash'], $detail['coupon_cash'], $detail['gift_cash'], $detail['refund_cash']) = Dever::load('info', 'place_score')->getText([$detail['total_cash'], $detail['pay_cash'], $detail['wallet_cash'], $detail['coupon_cash'], $detail['gift_cash'], $detail['refund_cash']], $this->info['score']);
- if (empty($detail['refund_num'])) {
- $detail['refund_num'] = 0;
- }
- $data['content']['content'][] = ['name' => '总金额', 'content' => $detail['total_cash']];
- $data['content']['content'][] = ['name' => '优惠券抵扣', 'content' => $detail['coupon_cash']];
- $data['content']['content'][] = ['name' => '礼品卡抵扣', 'content' => $detail['gift_cash']];
- $data['content']['content'][] = ['name' => $this->info['score']['name'] . '抵扣', 'content' => $detail['wallet_cash']];
- $data['content']['content'][] = ['name' => '支付金额', 'content' => $detail['pay_cash']];
- $data['content']['content'][] = ['name' => '退款金额', 'content' => $detail['refund_cash']];
- $data['content']['content'][] = ['name' => '退款数量', 'content' => $detail['refund_num'] . '个'];
- # 返利信息
- $rebate = Dever::db('rebate', 'place_order')->select(['table' => 'source_detail', 'table_id' => $detail['id']]);
- if ($rebate) {
- foreach ($rebate as $v) {
- if ($v['level'] == 0) {
- $data['content']['content'][] = ['name' => '购买返利', 'content' => $v['value_text']];
- } else {
- $data['content']['content'][] = ['name' => '返利' . $v['level'] . '层', 'content' => $v['value_text']];
- }
- }
- }
- }
- $result = [0 => $data];
- return $result;
- }
- # 获取退款信息
- private function getRefund()
- {
- foreach ($this->info['refund_list'] as &$v) {
- $v['status'] = $this->getRefundStatus($v);
- }
- return [
- 'name' => '退款',
- 'type' => 'table',
- 'border' => true,
- #'height' => '200',
- 'head' => [
- [
- 'key' => 'utype',
- 'name' => '申请人品牌',
- 'fixed' => 'fixed',
- //'width' => '80px',
- ],
- [
- 'key' => 'name',
- 'name' => '申请人名称',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'mobile',
- 'name' => '申请人电话',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'type_name',
- 'name' => '退款类型',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'cash_text',
- 'name' => '退款金额',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'status',
- 'name' => '退款状态',
- 'fixed' => 'fixed',
- 'type' => 'popover',
- 'location' => 'right',
- 'tag' => true,
- ],
- [
- 'key' => 'cdate_str',
- 'name' => '申请时间',
- 'fixed' => 'fixed',
- ],
- ],
- 'button' => [],
- 'body' => $this->info['refund_list'],
- ];
- }
- private function getRefundStatus($refund)
- {
- $data['name'] = $refund['status_name'];
- $data['content'] = [];
- $data['content']['type'] = 'line';
- $data['content']['content'] = [];
- $data['content']['content'][] = ['name' => '退款方式', 'content' => $refund['method_name']];
- $data['content']['content'][] = ['name' => '申请原因', 'content' => $refund['desc_type_name']];
- $data['content']['content'][] = ['name' => '申请说明', 'content' => $refund['desc']];
-
- # 获取退款明细
- if ($refund['detail_str']) {
- $data['content']['content'][] = ['name' => '退款明细', 'content' => $refund['detail_str']];
- }
- if ($refund['status'] == 5) {
- $data['content']['content'][] = ['name' => '申请驳回', 'content' => $refund['audit_desc']];
- } elseif ($refund['status'] >= 2) {
- $data['content']['content'][] = ['name' => '申请审核', 'content' => $refund['audit_desc']];
- }
- # 退货退款
- if ($refund['type'] == 1 && $refund['status'] >= 3) {
- $refund = Dever::load('source/delivery', 'place_order')->getRefundInfo($refund);
- if (isset($refund['delivery']['name']) && $refund['delivery']['name']) {
- $data['content']['content'][] = ['name' => '发货类型', 'content' => $refund['delivery']['name']];
- $data['content']['content'][] = ['name' => '发货内容', 'content' => $refund['delivery']['content']];
- }
- if (isset($refund['delivery']['log']) && $refund['delivery']['log']) {
- $data['content']['content'][] = ['name' => '快递信息', 'content' => $refund['delivery']['log']];
- }
- }
- if ($refund['status'] == 6) {
- $data['content']['content'][] = ['name' => '退货驳回', 'content' => $refund['delivery_audit_desc']];
- }
- $result = [0 => $data];
- return $result;
- }
- # 获取返利信息
- private function getRebate($rebate)
- {
- foreach ($rebate as &$v) {
- //$v['status'] = $this->getRefundStatus($v);
- $score = Dever::load('info', 'place_score')->get($v['score_id']);
- $v['score_name'] = $score['name'];
- $v['username'] = '无';
- if ($v['level'] == 0) {
- $user = Dever::db('info', 'place_user')->find($this->info['uid']);
- $v['username'] = $user['name'];
- } else {
- $parent = Dever::load('relation', 'invite')->getParent($this->info['uid'], $v['level']);
- if ($parent) {
- $user = Dever::db('info', 'place_user')->find($parent['uid']);
- if ($user) {
- $v['username'] = $user['name'];
- }
- }
- }
- $v['status_name'] = '未入账';
- if ($this->info['status'] == 5 || $this->info['status'] == 6) {
- $v['status_name'] = '已入账';
- }
- }
- return [
- 'name' => '返利',
- 'type' => 'table',
- 'border' => true,
- #'height' => '200',
- 'head' => [
- [
- 'key' => 'name',
- 'name' => '名称',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'score_name',
- 'name' => '奖励积分',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'level',
- 'name' => '奖励层级',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'value_text',
- 'name' => '奖励金额',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'username',
- 'name' => '奖励领取人',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'status_name',
- 'name' => '入账状态',
- 'fixed' => 'fixed',
- ],
- ],
- 'button' => [],
- 'body' => $rebate,
- ];
- }
- # 获取操作日志
- private function getLog()
- {
- return [
- 'name' => '记录',
- 'type' => 'table',
- 'border' => true,
- #'height' => '200',
- 'head' => [
- [
- 'key' => 'utype',
- 'name' => '品牌',
- 'fixed' => 'fixed',
- //'width' => '80px',
- ],
- [
- 'key' => 'name',
- 'name' => '名称',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'mobile',
- 'name' => '电话',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'desc',
- 'name' => '详情',
- 'fixed' => 'fixed',
- ],
- [
- 'key' => 'cdate_str',
- 'name' => '时间',
- 'fixed' => 'fixed',
- ],
- ],
- 'button' => [],
- 'body' => Dever::load('source/log', 'place_order')->getList($this->info['id'])
- ];
- }
- # 操作按钮
- private function getButton()
- {
- $button = [];
- if ($this->info['status'] == 2) {
- # 实物可以修改收货信息
- $this->info['source_type'][1] = true;
- if (isset($this->info['source_type'][1]) && $this->info['address_id']) {
- $button[] = [
- 'name' => '修改收货信息',
- 'type' => 'fastedit',
- 'path' => 'sector_place_order/source_address',
- 'row' => [
- 'id' => $this->info['id'],
- ],
- ];
- /*
- $button[] = [
- 'name' => '快递发货',
- # fastedit、fastadd、oper、api、link、route
- 'type' => 'fastadd',
- 'path' => 'sector_place_order/source_express',
- 'row' => [
- 'id' => $this->info['id'],
- ],
- 'param' => [
- 'order_id' => $this->info['id'],
- ],
- ];*/
- }
- if ($this->info['method'] <= 2) {
- $name = '平台发货';
- if ($this->info['method'] == 2) {
- $name = '店铺发货';
- }
- if ($this->info['refund_status'] == 2 && (isset($this->info['source_type'][1]) || isset($this->info['source_type'][2]))) {
- $button[] = [
- 'name' => $name,
- 'type' => 'fastadd',
- 'path' => 'sector_place_order/source_delivery',
- # row必填,这里的按钮来自于列表页,需要依赖哪一行。这里就写id就行,后续优化这里吧
- 'row' => [],
- 'param' => [
- 'order_id' => $this->info['id'],
- ],
- # 弹窗宽度
- 'width' => '60%',
- ];
- }
- }
- } elseif ($this->info['status'] == 3 && isset($this->info['delivery_edit']) && $this->info['delivery_edit']) {
- # 已发货,修改发货信息
- $button[] = [
- 'name' => '修改发货信息',
- 'type' => 'fastadd',
- 'path' => 'sector_place_order/source_delivery',
- # row必填,这里的按钮来自于列表页,需要依赖哪一行。这里就写id就行,后续优化这里吧
- 'row' => [],
- 'param' => [
- 'order_id' => $this->info['id'],
- ],
- # 弹窗宽度
- 'width' => '60%',
- ];
- } elseif ($this->info['status'] == 3 || $this->info['status'] == 4) {
- if (isset($this->info['delivery_show']) && $this->info['delivery_show']) {
- $button[] = [
- 'name' => '查看发货信息',
- 'type' => 'fastadd',
- 'path' => 'sector_place_order/source_delivery',
- # row必填,这里的按钮来自于列表页,需要依赖哪一行。这里就写id就行,后续优化这里吧
- 'row' => [],
- 'param' => [
- 'order_id' => $this->info['id'],
- ],
- # 弹窗宽度
- 'width' => '60%',
- ];
- }
- /*
- $button[] = [
- 'name' => '确认收货',
- 'type' => 'api',
- 'path' => 'sector_place_order/source_delivery',
- # row必填,这里的按钮来自于列表页,需要依赖哪一行。这里就写id就行,后续优化这里吧
- 'row' => [],
- 'param' => [
- 'order_id' => $this->info['id'],
- ],
- # 弹窗宽度
- 'width' => '60%',
- ];*/
- }
- # 退款按钮
- if (!$this->info['refund'] && $this->info['status'] >= 2 && $this->info['status'] < 7) {
- $button[] = [
- 'name' => '退款申请',
- 'type' => 'fastadd',
- 'path' => 'sector_place_order/source_refund',
- 'row' => [],
- 'param' => [
- 'order_id' => $this->info['id'],
- ],
- # 弹窗宽度
- 'width' => '60%',
- ];
- }
- if ($this->info['refund'] && $this->info['refund']['status'] == 1) {
- $button[] = [
- 'name' => '退款审核',
- 'type' => 'fastedit',
- 'path' => 'sector_place_order/source_refund_audit',
- 'row' => [
- 'id' => $this->info['refund']['id'],
- ],
- 'param' => [
- 'order_id' => $this->info['id'],
- ],
- ];
- }
- if ($this->info['refund'] && $this->info['refund']['status'] == 3) {
- $button[] = [
- 'name' => '退货审核',
- 'type' => 'fastedit',
- 'path' => 'sector_place_order/source_refund_audit_delivery',
- 'row' => [
- 'id' => $this->info['refund']['id'],
- ],
- 'param' => [
- 'order_id' => $this->info['id'],
- ],
- ];
- }
- return $button;
- }
- }
|