|
@@ -16,39 +16,50 @@
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="shop"> <i class="el-icon-s-shop"></i>{{ shop.name }}</el-col>
|
|
|
- <el-col :span="24" class="goods">
|
|
|
- <el-col :span="6"><el-image :src="file"></el-image></el-col>
|
|
|
- <el-col :span="18">
|
|
|
- <el-col :span="12">
|
|
|
- <p>{{ goods_goods.name }}</p>
|
|
|
- <p>规格:{{ goods.name }}</p>
|
|
|
- </el-col>
|
|
|
- <el-col :span="12" class="money">
|
|
|
- <p>¥{{ goods.sell_money }}</p>
|
|
|
- <p>X{{ goods.buy_num }}</p>
|
|
|
+ <el-col :span="24" v-for="(item, index) in list" :key="index">
|
|
|
+ <el-col :span="24" class="goods">
|
|
|
+ <el-col :span="6"><el-image :src="item.goods.file[0].url"></el-image></el-col>
|
|
|
+ <el-col :span="18">
|
|
|
+ <el-col :span="12">
|
|
|
+ <p>{{ item.goods.name }}</p>
|
|
|
+ <p>规格:{{ item.name }}</p>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12" class="money">
|
|
|
+ <p>¥{{ item.sell_money }}</p>
|
|
|
+ <p>X{{ item.buy_num }}</p>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="6">运费</el-col>
|
|
|
+ <el-col :span="18" class="other" v-if="!item.freight_total == '0'">{{ item.freight_total }}</el-col>
|
|
|
+ <el-col :span="18" class="other" v-else>包邮</el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="6">订单备注</el-col>
|
|
|
+ <el-col :span="18" class="other" v-if="item.goods.remarks">{{ item.goods.remarks }}</el-col>
|
|
|
+ <el-col :span="18" class="other" v-else>暂无备注</el-col>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-col :span="6">配送方式</el-col>
|
|
|
<el-col :span="18" class="other">快递配送</el-col>
|
|
|
</el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-col :span="6">运费</el-col>
|
|
|
- <el-col :span="18" class="other" v-if="!goods.freight_total == '0'">{{ goods.freight_total }}</el-col>
|
|
|
- <el-col :span="18" class="other" v-else>包邮</el-col>
|
|
|
- </el-col>
|
|
|
- <el-col :span="24">
|
|
|
- <el-col :span="6">订单备注</el-col>
|
|
|
- <el-col :span="18" class="other" v-if="goods_goods.remarks">{{ goods_goods.remarks }}</el-col>
|
|
|
- <el-col :span="18" class="other" v-else>选填,可填写您与卖家达成一致的要求</el-col>
|
|
|
- </el-col>
|
|
|
<el-col :span="24" class="goods_total">
|
|
|
<el-col :span="6">实付金额</el-col>
|
|
|
<el-col :span="18" class="other">
|
|
|
- <p>¥{{ total_detail.goods_total }}</p>
|
|
|
+ <p v-if="total_detail.discount_detail">¥{{ goods_total }}</p>
|
|
|
+ <p v-else>¥{{ total_detail.goods_total }}</p>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="6">下单时间</el-col>
|
|
|
+ <el-col :span="18" class="other">{{ info.buy_time }}</el-col>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24">
|
|
|
+ <el-col :span="6">支付时间</el-col>
|
|
|
+ <el-col :span="18" class="other">{{ info.pay_time }}</el-col>
|
|
|
+ </el-col>
|
|
|
</el-col>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
@@ -60,20 +71,17 @@ const _ = require('lodash');
|
|
|
const moment = require('moment');
|
|
|
import { mapState, mapGetters, createNamespacedHelpers } from 'vuex';
|
|
|
const { mapActions } = createNamespacedHelpers('orderDetail');
|
|
|
-const { mapActions: shop } = createNamespacedHelpers('shop');
|
|
|
-
|
|
|
export default {
|
|
|
name: 'form-1',
|
|
|
props: {},
|
|
|
components: {},
|
|
|
data: function () {
|
|
|
return {
|
|
|
- form: {},
|
|
|
+ info: {},
|
|
|
address: {},
|
|
|
+ goods_total: 0,
|
|
|
shop: {},
|
|
|
- goods: {},
|
|
|
- goods_goods: {},
|
|
|
- file: '',
|
|
|
+ list: [],
|
|
|
total_detail: {},
|
|
|
typeList: [],
|
|
|
statusList: [],
|
|
@@ -84,25 +92,33 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
...mapActions(['query', 'fetch', 'create', 'update']),
|
|
|
- ...shop({ shopFetch: 'fetch' }),
|
|
|
// 查询
|
|
|
async search() {
|
|
|
let res;
|
|
|
res = await this.fetch(this.id);
|
|
|
if (this.$checkRes(res)) {
|
|
|
+ this.$set(this, `info`, res.data);
|
|
|
// 地址
|
|
|
this.$set(this, `address`, res.data.address);
|
|
|
+ this.$set(this, `shop`, res.data.goods[0]);
|
|
|
// 商品
|
|
|
- this.$set(this, `goods`, res.data.goods[0]);
|
|
|
- this.$set(this, `goods_goods`, res.data.goods[0].goods);
|
|
|
- this.$set(this, `file`, res.data.goods[0].goods.file[0].url);
|
|
|
+ this.$set(this, `list`, res.data.goods);
|
|
|
// 实付金额
|
|
|
this.$set(this, `total_detail`, res.data.total_detail);
|
|
|
- // 店铺
|
|
|
- res = await this.shopFetch(res.data.shop);
|
|
|
- if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `shop`, res.data);
|
|
|
+ var goods_total = 0;
|
|
|
+ let discount_detail = res.data.total_detail.discount_detail;
|
|
|
+ for (const key in discount_detail) {
|
|
|
+ if (Object.hasOwnProperty.call(discount_detail, key)) {
|
|
|
+ const element = discount_detail[key];
|
|
|
+ for (const i in element) {
|
|
|
+ if (Object.hasOwnProperty.call(element, i)) {
|
|
|
+ const ele = element[i].realPay;
|
|
|
+ goods_total += ele;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+ this.$set(this, `goods_total`, goods_total);
|
|
|
}
|
|
|
},
|
|
|
// 返回
|