detail_order.vue 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div id="form-1">
  3. <el-row>
  4. <el-col :span="24" class="main animate__animated animate__backInRight">
  5. <el-col class="top-btn">
  6. <el-button type="primary" size="mini" @click="toBack()">返回</el-button>
  7. </el-col>
  8. <el-col :span="8" class="one">
  9. <el-col :span="24" class="add">
  10. <el-col :span="2">
  11. <i class="el-icon-location"></i>
  12. </el-col>
  13. <el-col :span="22">
  14. <p>{{ address.name }},{{ address.phone }}</p>
  15. <p>{{ address.province }} , {{ address.city }} , {{ address.area }} , {{ address.address }}</p>
  16. </el-col>
  17. </el-col>
  18. <el-col :span="24" v-for="(item, index) in list" :key="index">
  19. <el-col :span="24" class="shop"> <i class="el-icon-s-shop"></i>{{ item.shop_name }}</el-col>
  20. <el-col :span="24" v-for="(goods, index) in item.goods" :key="index">
  21. <el-col :span="24" class="goods">
  22. <el-col :span="6"><el-image :src="goods.goods.file[0].url"></el-image></el-col>
  23. <el-col :span="18">
  24. <el-col :span="12">
  25. <p>{{ goods.goods.name }}</p>
  26. <p>规格:{{ goods.name }}</p>
  27. </el-col>
  28. <el-col :span="12" class="money">
  29. <p v-if="info.type == '0'">¥{{ goods.sell_money }}</p>
  30. <p v-else-if="info.type == '1'">¥{{ goods.group_config.money }}</p>
  31. <p>X{{ goods.buy_num }}</p>
  32. </el-col>
  33. </el-col>
  34. </el-col>
  35. <el-col :span="24">
  36. <el-col :span="6">运费</el-col>
  37. <el-col :span="18" class="other" v-if="!goods.freight == '0'">{{ goods.freight }}</el-col>
  38. <el-col :span="18" class="other" v-else>包邮</el-col>
  39. </el-col>
  40. <el-col :span="24">
  41. <el-col :span="6">订单备注</el-col>
  42. <el-col :span="18" class="other" v-if="item.remarks">{{ item.remarks }}</el-col>
  43. <el-col :span="18" class="other" v-else>暂无备注</el-col>
  44. </el-col>
  45. </el-col>
  46. </el-col>
  47. <el-col :span="24">
  48. <el-col :span="6">配送方式</el-col>
  49. <el-col :span="18" class="other">快递配送</el-col>
  50. </el-col>
  51. <el-col :span="24" class="goods_total">
  52. <el-col :span="6">商品金额</el-col>
  53. <el-col :span="18" class="other">
  54. <p>¥{{ total_detail.goods_total }}</p>
  55. </el-col>
  56. </el-col>
  57. <el-col :span="24" class="goods_total">
  58. <el-col :span="6">快递费</el-col>
  59. <el-col :span="18" class="other">
  60. <p>¥{{ total_detail.freight_total }}</p>
  61. </el-col>
  62. </el-col>
  63. <el-col :span="24" class="goods_total">
  64. <el-col :span="8">优惠后应付金额</el-col>
  65. <el-col :span="16" class="other">
  66. <p>¥{{ pay.pay_money }}</p>
  67. </el-col>
  68. </el-col>
  69. <el-col :span="24">
  70. <el-col :span="6">下单时间</el-col>
  71. <el-col :span="18" class="other">{{ info.buy_time }}</el-col>
  72. </el-col>
  73. <el-col :span="24">
  74. <el-col :span="6">支付时间</el-col>
  75. <el-col :span="18" class="other">{{ info.pay_time || '未支付' }}</el-col>
  76. </el-col>
  77. </el-col>
  78. </el-col>
  79. </el-row>
  80. </div>
  81. </template>
  82. <script>
  83. const _ = require('lodash');
  84. const moment = require('moment');
  85. import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
  86. const { mapActions } = createNamespacedHelpers('order');
  87. export default {
  88. name: 'form-1',
  89. props: {},
  90. components: {},
  91. data: function () {
  92. return {
  93. info: {},
  94. address: {},
  95. list: [],
  96. total_detail: {},
  97. typeList: [],
  98. statusList: [],
  99. pay: {},
  100. };
  101. },
  102. async created() {
  103. await this.search();
  104. },
  105. methods: {
  106. ...mapActions(['query', 'fetch', 'create', 'update']),
  107. // 查询
  108. async search() {
  109. let res = await this.fetch(this.id);
  110. if (this.$checkRes(res)) {
  111. this.$set(this, `info`, res.data);
  112. // 地址
  113. this.$set(this, `address`, res.data.address);
  114. // 商品
  115. this.$set(this, `list`, res.data.goods);
  116. // 实付金额
  117. this.$set(this, `total_detail`, res.data.total_detail);
  118. this.$set(this, `pay`, res.data.pay);
  119. }
  120. },
  121. // 返回
  122. toBack() {
  123. window.history.go('-1');
  124. },
  125. },
  126. computed: {
  127. id() {
  128. return this.$route.query.id;
  129. },
  130. },
  131. metaInfo() {
  132. return { title: this.$route.meta.title };
  133. },
  134. watch: {
  135. test: {
  136. deep: true,
  137. immediate: true,
  138. handler(val) {},
  139. },
  140. },
  141. };
  142. </script>
  143. <style lang="less" scoped>
  144. .main {
  145. .one {
  146. margin: 10px 0 0 20%;
  147. padding: 5px;
  148. .add {
  149. border-bottom: 2px dashed #ccc;
  150. margin: 0 0 5px 0;
  151. padding: 5px 0;
  152. }
  153. .shop {
  154. padding: 4px 0;
  155. font-size: 18px;
  156. border-bottom: 1px solid #ccc;
  157. }
  158. .goods {
  159. padding: 10px 0;
  160. .money {
  161. text-align: right;
  162. }
  163. }
  164. .other {
  165. text-align: right;
  166. p {
  167. color: red;
  168. }
  169. }
  170. .el-col {
  171. margin: 4px 0;
  172. }
  173. }
  174. }
  175. </style>