|
@@ -5,11 +5,14 @@
|
|
|
:data="orderList"
|
|
|
@sort-change="handleSort"
|
|
|
:default-sort = dataSort
|
|
|
+ v-loading="tableLoading"
|
|
|
+ :max-height="tableHeight"
|
|
|
>
|
|
|
<el-table-column
|
|
|
type="index"
|
|
|
label="#"
|
|
|
- width="48">
|
|
|
+ width="48"
|
|
|
+ :index="(pageNumber-1)*pageSize+1">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="sn"
|
|
@@ -20,7 +23,10 @@
|
|
|
prop="pay_time"
|
|
|
label="交易时间"
|
|
|
width="180"
|
|
|
- sortable>
|
|
|
+ sortable="custom">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{scope.row.pay_time?scope.row.pay_time.substring(0,16):'-'}}
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
prop="goods_name"
|
|
@@ -31,7 +37,7 @@
|
|
|
label="类型"
|
|
|
width="72">
|
|
|
<template slot-scope="scope" v-if="scope.row.goods_type>=0">
|
|
|
- <span class="items-type" :style="{background:typeList[scope.row.goods_type].bg, color:typeList[scope.row.goods_type].color}">{{typeList[scope.row.goods_type].text}}</span>
|
|
|
+ <span class="items-type" :style="{background:typeList[scope.row.goods_type]?typeList[scope.row.goods_type].bg:'', color:typeList[scope.row.goods_type]?typeList[scope.row.goods_type].color:''}">{{typeList[scope.row.goods_type]?typeList[scope.row.goods_type].text:'-'}}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
@@ -172,11 +178,11 @@ export default {
|
|
|
// color:'#F53F3F',
|
|
|
// bg:'#FFECE8'
|
|
|
// },
|
|
|
- // '3':{
|
|
|
- // text:'练习',
|
|
|
- // color:'#0FC6C2',
|
|
|
- // bg:'#E8FFFB'
|
|
|
- // },
|
|
|
+ '3':{
|
|
|
+ text:'精读',
|
|
|
+ color:'#0FC6C2',
|
|
|
+ bg:'#E8FFFB'
|
|
|
+ },
|
|
|
0:{
|
|
|
text:'课程',
|
|
|
color:'#722ED1',
|
|
@@ -200,7 +206,9 @@ export default {
|
|
|
},
|
|
|
orderList:[],
|
|
|
total_count: 0,
|
|
|
- dataSort: {}
|
|
|
+ dataSort: {},
|
|
|
+ tableLoading: false,
|
|
|
+ tableHeight: "", // 表格高度
|
|
|
}
|
|
|
},
|
|
|
//计算属性 类似于data概念
|
|
@@ -211,6 +219,16 @@ export default {
|
|
|
},
|
|
|
//方法集合
|
|
|
methods: {
|
|
|
+ //计算table高度(动态设置table高度)
|
|
|
+ getTableHeight() {
|
|
|
+ let tableH = 260; //距离页面下方的高度
|
|
|
+ let tableHeightDetil = window.innerHeight - tableH;
|
|
|
+ if (tableHeightDetil <= 300) {
|
|
|
+ this.tableHeight = 300;
|
|
|
+ } else {
|
|
|
+ this.tableHeight = window.innerHeight - tableH;
|
|
|
+ }
|
|
|
+ },
|
|
|
handleSort(value){
|
|
|
let dataSort = {
|
|
|
prop: value.prop,
|
|
@@ -252,6 +270,7 @@ export default {
|
|
|
window.getSelection().removeAllRanges();
|
|
|
},
|
|
|
getList(){
|
|
|
+ this.tableLoading = true
|
|
|
let MethodName = "/ShopServer/Client/OrderManager/PageQueryMyOrderList";
|
|
|
let order_column_list = []
|
|
|
if(this.dataSort != {}){
|
|
@@ -269,18 +288,20 @@ export default {
|
|
|
}
|
|
|
getLogin(MethodName, data)
|
|
|
.then((res) => {
|
|
|
+ this.tableLoading = false
|
|
|
if(res.status===1){
|
|
|
this.orderList = res.order_list
|
|
|
this.total_count = res.total_count
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
- this.loading = false
|
|
|
+ this.tableLoading = false
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
//生命周期 - 创建完成(可以访问当前this实例)
|
|
|
created() {
|
|
|
+ this.getTableHeight()
|
|
|
this.getList()
|
|
|
},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|