提交 ca5c991f authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 acd948f3
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
"core-js": "^3.12.1", "core-js": "^3.12.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
"element-ui": "^2.15.1", "element-ui": "^2.15.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"qrcode.vue": "^1.7.0", "qrcode.vue": "^1.7.0",
"vue": "^2.6.12", "vue": "^2.6.12",
...@@ -4460,9 +4460,9 @@ ...@@ -4460,9 +4460,9 @@
"dev": true "dev": true
}, },
"node_modules/element-ui": { "node_modules/element-ui": {
"version": "2.15.1", "version": "2.15.2",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.1.tgz", "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.2.tgz",
"integrity": "sha512-TqlScAKGH97XndSScUDeEHIzL1x7yg7DvQdKPEOUdiDcyIz3y3FJJBlpHYaJT96FOn1xpIcUZb+I2FJeU9EcrQ==", "integrity": "sha512-S66VvOt1AR698uzxAnJeajnIPI1eIzlkKXHx2F2v94PAs/8JuyRcLOUGy100mJHIIaSkRlxVOtI+As2XTB8Oew==",
"dependencies": { "dependencies": {
"async-validator": "~1.8.1", "async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0", "babel-helper-vue-jsx-merge-props": "^2.0.0",
...@@ -17328,9 +17328,9 @@ ...@@ -17328,9 +17328,9 @@
"dev": true "dev": true
}, },
"element-ui": { "element-ui": {
"version": "2.15.1", "version": "2.15.2",
"resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.1.tgz", "resolved": "https://registry.npmjs.org/element-ui/-/element-ui-2.15.2.tgz",
"integrity": "sha512-TqlScAKGH97XndSScUDeEHIzL1x7yg7DvQdKPEOUdiDcyIz3y3FJJBlpHYaJT96FOn1xpIcUZb+I2FJeU9EcrQ==", "integrity": "sha512-S66VvOt1AR698uzxAnJeajnIPI1eIzlkKXHx2F2v94PAs/8JuyRcLOUGy100mJHIIaSkRlxVOtI+As2XTB8Oew==",
"requires": { "requires": {
"async-validator": "~1.8.1", "async-validator": "~1.8.1",
"babel-helper-vue-jsx-merge-props": "^2.0.0", "babel-helper-vue-jsx-merge-props": "^2.0.0",
......
...@@ -76,7 +76,7 @@ ...@@ -76,7 +76,7 @@
"core-js": "^3.12.1", "core-js": "^3.12.1",
"cross-env": "^7.0.3", "cross-env": "^7.0.3",
"dayjs": "^1.10.5", "dayjs": "^1.10.5",
"element-ui": "^2.15.1", "element-ui": "^2.15.2",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"qrcode.vue": "^1.7.0", "qrcode.vue": "^1.7.0",
"vue": "^2.6.12", "vue": "^2.6.12",
......
<template> <template>
<app-card> <app-card>
<!--列表--> <!--列表-->
<table-list v-bind="tableOptions" ref="list"> <table-list
v-bind="tableOptions"
:span-method="arraySpanMethod"
:row-class-name="tableRowClassName"
border
ref="list"
>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane :label="item.label" :name="item.value" v-for="item in orderStatus" :key="item.value"></el-tab-pane> <el-tab-pane :label="item.label" :name="item.value" v-for="item in orderStatus" :key="item.value"></el-tab-pane>
</el-tabs> </el-tabs>
...@@ -37,8 +43,27 @@ ...@@ -37,8 +43,27 @@
</el-radio-group> </el-radio-group>
</div> </div>
</template> </template>
<template v-slot:table-goods="{ row }"> <template v-slot:table-goods="{ row, $index }">
<goods-item :data="row"></goods-item> <template v-if="isOrderRow($index)">
<div class="order-row">
<div class="order-row-item">
订单号:{{ row.order_detail_id }}
<el-popover placement="bottom-start" trigger="click">
<el-button type="text" size="medium" slot="reference">更多</el-button>
<div>外部订单编号: {{ row.pay_order_id }}</div>
<div>支付流水号:{{ row.payment_order_id }}</div>
</el-popover>
</div>
<div class="order-row-item">下单时间:{{ row.create_time }}</div>
<div class="order-row-item">{{ paymentMethod(row.payment_method) }}</div>
<div class="order-row-tools">
<router-link :to="{ name: 'orderDetail', params: { id: row.order_detail_id } }">
<el-button type="text">查看详情</el-button>
</router-link>
</div>
</div>
</template>
<goods-item :data="row" v-else></goods-item>
</template> </template>
<template v-slot:table-price="{ row }"> <template v-slot:table-price="{ row }">
<p>{{ row.product_price }}</p> <p>{{ row.product_price }}</p>
...@@ -94,7 +119,8 @@ export default { ...@@ -94,7 +119,8 @@ export default {
order_status: '', order_status: '',
payment_method: '' payment_method: ''
}, },
beforeRequest: this.beforeRequest beforeRequest: this.beforeRequest,
callback: this.callback
}, },
filters: [ filters: [
{ {
...@@ -141,28 +167,8 @@ export default { ...@@ -141,28 +167,8 @@ export default {
columns: [ columns: [
{ label: '商品', prop: 'shop_name', slots: 'table-goods', minWidth: 140 }, { label: '商品', prop: 'shop_name', slots: 'table-goods', minWidth: 140 },
{ label: '单价(元)/数量', prop: 'product_price', slots: 'table-price', align: 'right' }, { label: '单价(元)/数量', prop: 'product_price', slots: 'table-price', align: 'right' },
{ label: '订单号', prop: 'order_detail_id' },
{ label: '下单时间', prop: 'create_time', width: 110 },
{ label: '买家 / 收货人', prop: 'shipping_user', align: 'center' }, { label: '买家 / 收货人', prop: 'shipping_user', align: 'center' },
{ label: '实收金额(元)', prop: 'payment_money', align: 'center' }, { label: '实收金额(元)', prop: 'payment_money', align: 'center' },
{
label: '付款方式',
prop: 'payment_method',
align: 'center',
computed({ row }) {
const map = {
1: '微信扫码支付',
2: '微信小程序支付',
3: '微信JSAPI支付',
4: '微信h5支付',
11: '支付宝扫码支付',
12: '支付宝手机网站支付',
13: '支付宝网站支付',
99: '线下支付'
}
return map[row.payment_method] || row.payment_method
}
},
{ {
label: '订单状态', label: '订单状态',
prop: 'order_status', prop: 'order_status',
...@@ -171,8 +177,8 @@ export default { ...@@ -171,8 +177,8 @@ export default {
const map = { 1: '待付款', 2: '待发货', 3: '已发货', 4: '已完成', 5: '已关闭', 6: '售后' } const map = { 1: '待付款', 2: '待发货', 3: '已发货', 4: '已完成', 5: '已关闭', 6: '售后' }
return map[row.order_status] return map[row.order_status]
} }
}, }
{ label: '操作', slots: 'table-x', align: 'right', width: 60 } // { label: '操作', slots: 'table-x', align: 'right', width: 60 }
] ]
} }
} }
...@@ -190,6 +196,36 @@ export default { ...@@ -190,6 +196,36 @@ export default {
params.order_status = this.activeName === '0' ? '' : this.activeName params.order_status = this.activeName === '0' ? '' : this.activeName
return params return params
}, },
callback(data) {
return data.reduce((result, item) => {
result.push(item, item)
return result
}, [])
},
arraySpanMethod({ rowIndex, columnIndex }) {
if (rowIndex % 2 === 0) {
return columnIndex === 0 ? [1, 9] : [0, 0]
}
},
tableRowClassName({ rowIndex }) {
return rowIndex % 2 === 0 ? 'is-order-row' : ''
},
isOrderRow(rowIndex) {
return rowIndex % 2 === 0
},
paymentMethod(value) {
const map = {
1: '微信扫码支付',
2: '微信小程序支付',
3: '微信JSAPI支付',
4: '微信h5支付',
11: '支付宝扫码支付',
12: '支付宝手机网站支付',
13: '支付宝网站支付',
99: '线下支付'
}
return map[value] || value
},
// tab // tab
handleClick() { handleClick() {
this.$refs.list.refetch(true) this.$refs.list.refetch(true)
...@@ -233,4 +269,18 @@ export default { ...@@ -233,4 +269,18 @@ export default {
display: none !important; display: none !important;
} }
} }
.order-row {
display: flex;
align-items: center;
}
.order-row-item {
margin-right: 20px;
}
.order-row-tools {
flex: 1;
text-align: right;
}
::v-deep .is-order-row {
background-color: #f5f7fa;
}
</style> </style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论