You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

108 lines
3.2 KiB

  1. <?php
  2. use yii\helpers\Html;
  3. use yii\widgets\DetailView;
  4. use backend\modules\shop\models\ars\AfterSale;
  5. /* @var $this yii\web\View */
  6. /* @var $model backend\modules\shop\models\ars\AfterSale */
  7. $this->title = $model->id;
  8. $this->params['breadcrumbs'][] = ['label' => 'After Sales', 'url' => ['index']];
  9. $this->params['breadcrumbs'][] = $this->title;
  10. \yii\web\YiiAsset::register($this);
  11. ?>
  12. <div class="after-sale-view">
  13. <p>
  14. <?= Html::a('返回列表', ['index'], ['class' => 'btn btn-default']) ?>
  15. <?php
  16. if ($model->status == AfterSale::STATUS_UNTREATED) {
  17. echo Html::a('同意',
  18. [
  19. 'handle',
  20. 'status' => AfterSale::STATUS_ACCEPT,
  21. 'id' => $model->id
  22. ],
  23. [
  24. 'class' => 'btn btn-default',
  25. 'data' => [
  26. 'confirm' => '同意用户的退货申请?',
  27. 'method' => 'post',
  28. ]
  29. ]
  30. );
  31. echo Html::a('拒绝',
  32. [
  33. 'handle',
  34. 'status' => AfterSale::STATUS_REJECT,
  35. 'id' => $model->id
  36. ],
  37. [
  38. 'class' => 'btn btn-default',
  39. 'data' => [
  40. 'confirm' => '拒绝用户的退货申请?',
  41. 'method' => 'post',
  42. ],
  43. ]
  44. );
  45. }
  46. ?>
  47. </p>
  48. <?= DetailView::widget([
  49. 'model' => $model,
  50. 'attributes' => [
  51. 'id',
  52. 'wx_refund_id',
  53. 'after_sale_sn',
  54. 'user_id',
  55. [
  56. 'attribute' => 'order_goods_id',
  57. 'value' => function ($model) {
  58. return $model->goods->goods_name;
  59. }
  60. ],
  61. [
  62. 'attribute' => 'amount',
  63. 'value' => function ($model) {
  64. return sprintf("%1\$.2f", $model->amount);
  65. }
  66. ],
  67. 'count',
  68. 'apply_at:datetime',
  69. 'dealt_at:datetime',
  70. 'finish_at:datetime',
  71. 'operator_id',
  72. [
  73. 'attribute' => 'refund_type',
  74. 'value' => function ($model) {
  75. return AfterSale::$refundType[$model->refund_type];
  76. }
  77. ],
  78. 'description:ntext',
  79. 'image:ntext',
  80. [
  81. 'attribute' => 'status',
  82. 'value' => function ($model) {
  83. return AfterSale::$status[$model->status];
  84. }
  85. ],
  86. [
  87. 'attribute' => 'reason',
  88. 'value' => function ($model) {
  89. return $model->reason ? AfterSale::$afterSaleReason[$model->reason] : '未设置';
  90. }
  91. ],
  92. 'remarks:ntext',
  93. 'take_shipping_sn',
  94. [
  95. 'attribute' => 'refund_mode',
  96. 'value' => function ($model) {
  97. return AfterSale::$refundMode[$model->refund_mode];
  98. }
  99. ],
  100. ],
  101. ]) ?>
  102. </div>