|
@@ -11,10 +11,10 @@
|
|
|
<p class="py-15px text-20px leading-28px">转换券购买记录</p>
|
|
|
</div>
|
|
|
<client-only>
|
|
|
- <el-table :data="tableData" :default-sort = "{prop: 'startDate', order: 'descending'}">
|
|
|
+ <el-table :data="tableData" :default-sort="{ prop: 'startDate', order: 'descending' }">
|
|
|
<el-table-column label="类目" prop="totalPoints"></el-table-column>
|
|
|
<el-table-column label="金额" prop="price"></el-table-column>
|
|
|
- <el-table-column label="订单编号" ></el-table-column>
|
|
|
+ <el-table-column label="订单编号"></el-table-column>
|
|
|
<el-table-column label="时间" prop="startDate"></el-table-column>
|
|
|
<!-- 表格无数据显示 -->
|
|
|
<div slot="empty">
|
|
@@ -29,9 +29,10 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import { mapState } from 'vuex'
|
|
|
export default {
|
|
|
layout: 'userCenter',
|
|
|
- middleware: ['auth','user'],
|
|
|
+ middleware: ['auth', 'user'],
|
|
|
data() {
|
|
|
return {
|
|
|
tableData: []
|
|
@@ -53,23 +54,40 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
- this.$axios.get("/members/getMemberInfo").then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- // console.log(res.result)
|
|
|
- const change = []
|
|
|
- res.result.pricingList.forEach(item => {
|
|
|
- // console.log("数据",item)
|
|
|
- const totalPoints = item.totalPoints + "张转换劵"
|
|
|
- const price="¥"+item.price+".0"
|
|
|
- const id= ''
|
|
|
- const startDate=item.startDate
|
|
|
- const all={totalPoints,price,id,startDate}
|
|
|
- change.push(all)
|
|
|
- });
|
|
|
- this.tableData=change
|
|
|
- }
|
|
|
- })
|
|
|
+ this.getTableData()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ getTableData() {
|
|
|
+ this.$axios.get("/members/getMemberInfo").then((res) => {
|
|
|
+ if (res.code === 200) {
|
|
|
+ // console.log(res.result)
|
|
|
+ const change = []
|
|
|
+ res.result.pricingList.forEach(item => {
|
|
|
+ // console.log("数据",item)
|
|
|
+ const totalPoints = item.totalPoints + "张转换劵"
|
|
|
+ const price = "¥" + item.price + ".0"
|
|
|
+ const id = ''
|
|
|
+ const startDate = item.startDate
|
|
|
+ const all = { totalPoints, price, id, startDate }
|
|
|
+ change.push(all)
|
|
|
+ });
|
|
|
+ this.tableData = change
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState([
|
|
|
+ "globalLoginVisiable",
|
|
|
+ ]),
|
|
|
},
|
|
|
+ watch:{
|
|
|
+ globalLoginVisiable(newValue){
|
|
|
+ if(!newValue){
|
|
|
+ this.getTableData()
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
|