|
@@ -1,20 +1,20 @@
|
1
|
1
|
<template>
|
2
|
2
|
<div class="mainPage">
|
3
|
|
- <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
|
|
3
|
+ <scroll ref='scroll' :isloading='isloading' class='wrapper' :data='courseOrderList.list' :pullUpLoad='pullUpLoadObj' :startY='parseInt(startY)' @pullingUp='getList'>
|
4
|
4
|
<div class="box">
|
5
|
|
- <div class="order-card flex-h" v-for="(item,index) in list" :key='index' :class="{'opacity' : item.useType == '已失效'}" @click="toDetail(item)">
|
|
5
|
+ <div class="order-card flex-h" v-for="(item,index) in courseOrderList.list" :key='index' :class="{'opacity' : item.status === 1}" @click="toDetail(item)">
|
6
|
6
|
<div class="card-pic">
|
7
|
|
- <div :class="{'gray-location' : item.useType == '已失效'}"><span>{{item.LocationName}}</span></div>
|
|
7
|
+ <div :class="{'gray-location' : item.status === 1}"><span>{{item.LocationName}}</span></div>
|
8
|
8
|
<img src="" class="cover" width="100%" height="100%" alt="">
|
9
|
9
|
</div>
|
10
|
10
|
<div class="card-msg">
|
11
|
|
- <div class="title">{{item.title}}</div>
|
12
|
|
- <div class="text">付款方式:{{item.payType}}</div>
|
13
|
|
- <div class="text">下单时间:{{item.time}}</div>
|
|
11
|
+ <div class="title">{{item.CourseName}}</div>
|
|
12
|
+ <div class="text">付款方式:{{item.CourseObtaimType === 'cheng-coin' ? '城币支付' : '优惠券抵用'}}</div>
|
|
13
|
+ <div class="text">下单时间:{{toolClass.dateFormat(item.CreateDate)}}</div>
|
14
|
14
|
</div>
|
15
|
15
|
<div class="card-price">
|
16
|
|
- <div class="price">¥ {{item.price}}</div>
|
17
|
|
- <div class="type" :class="{'un-use' : item.useType == '未使用'}">{{item.useType}}</div>
|
|
16
|
+ <div class="price" style="white-space: nowrap;">¥ {{item.Price}}</div>
|
|
17
|
+ <div class="type" :class="{'un-use' : item.IsDone === 0}">{{item.IsDone === 0 ? '未使用' : '已使用'}}</div>
|
18
|
18
|
</div>
|
19
|
19
|
</div>
|
20
|
20
|
<!-- <noMore v-if="hasPic"></noMore> -->
|
|
@@ -27,6 +27,8 @@
|
27
|
27
|
// 上拉加载组件
|
28
|
28
|
import scroll from '../../../components/scroll/scroll'
|
29
|
29
|
import noMore from '../../../components/noMore/noMore'
|
|
30
|
+import { mapState, createNamespacedHelpers } from 'vuex'
|
|
31
|
+const { mapActions: mapUserActions, mapState: mapUserState } = createNamespacedHelpers('userCenter')
|
30
|
32
|
export default {
|
31
|
33
|
data () {
|
32
|
34
|
return {
|
|
@@ -34,65 +36,28 @@ export default {
|
34
|
36
|
pullUpLoad: true,
|
35
|
37
|
pullUpLoadThreshold: 40,
|
36
|
38
|
startY: 0,
|
|
39
|
+ page: 1,
|
37
|
40
|
isloading: true,
|
38
|
41
|
hasMore: true,
|
39
|
|
- list: [
|
40
|
|
- {
|
41
|
|
- LocationName: '社交',
|
42
|
|
- title: '小小外交官课程',
|
43
|
|
- payType: '优惠券抵用',
|
44
|
|
- time: '2018-7-18 12:19',
|
45
|
|
- price: 199,
|
46
|
|
- useType: '未使用'
|
47
|
|
- },
|
48
|
|
- {
|
49
|
|
- LocationName: '社交',
|
50
|
|
- title: '小小外交官课程',
|
51
|
|
- payType: '优惠券抵用',
|
52
|
|
- time: '2018-7-18 12:19',
|
53
|
|
- price: 199,
|
54
|
|
- useType: '已使用'
|
55
|
|
- },
|
56
|
|
- {
|
57
|
|
- LocationName: '社交',
|
58
|
|
- title: '小小外交官课程',
|
59
|
|
- payType: '优惠券抵用',
|
60
|
|
- time: '2018-7-18 12:19',
|
61
|
|
- price: 199,
|
62
|
|
- useType: '已失效'
|
63
|
|
- },
|
64
|
|
- {
|
65
|
|
- LocationName: '社交',
|
66
|
|
- title: '小小外交官课程',
|
67
|
|
- payType: '优惠券抵用',
|
68
|
|
- time: '2018-7-18 12:19',
|
69
|
|
- price: 199,
|
70
|
|
- useType: '已失效'
|
71
|
|
- },
|
72
|
|
- {
|
73
|
|
- LocationName: '社交',
|
74
|
|
- title: '小小外交官课程',
|
75
|
|
- payType: '优惠券抵用',
|
76
|
|
- time: '2018-7-18 12:19',
|
77
|
|
- price: 199,
|
78
|
|
- useType: '已失效'
|
79
|
|
- },
|
80
|
|
- {
|
81
|
|
- LocationName: '社交',
|
82
|
|
- title: '小小外交官课程',
|
83
|
|
- payType: '优惠券抵用',
|
84
|
|
- time: '2018-7-18 12:19',
|
85
|
|
- price: 199,
|
86
|
|
- useType: '已失效'
|
87
|
|
- }
|
88
|
|
- ]
|
|
42
|
+ list: []
|
89
|
43
|
}
|
90
|
44
|
},
|
91
|
45
|
components: {
|
92
|
46
|
scroll,
|
93
|
47
|
noMore
|
94
|
48
|
},
|
|
49
|
+ created () {
|
|
50
|
+ var _that = this
|
|
51
|
+ this.getCourseLocationList().then((res) => {
|
|
52
|
+ console.log(JSON.stringify(res))
|
|
53
|
+ this.getCourseOrderList({ page: this.page })
|
|
54
|
+ })
|
|
55
|
+ },
|
95
|
56
|
computed: {
|
|
57
|
+ ...mapUserState({
|
|
58
|
+ courseOrderList: x => x.courseOrderList,
|
|
59
|
+ courseLocationList: x => x.courseLocationList,
|
|
60
|
+ }),
|
96
|
61
|
pullUpLoadObj: function () {
|
97
|
62
|
return this.pullUpLoad
|
98
|
63
|
? {
|
|
@@ -106,17 +71,22 @@ export default {
|
106
|
71
|
}
|
107
|
72
|
},
|
108
|
73
|
methods: {
|
|
74
|
+ ...mapUserActions([
|
|
75
|
+ 'getCourseOrderList',
|
|
76
|
+ 'getCourseLocationList',
|
|
77
|
+ ]),
|
109
|
78
|
getList () {
|
110
|
|
- this.list.length <= 8 ? this.hasMore = true : this.hasMore = false
|
|
79
|
+ var _that = this
|
|
80
|
+ Math.ceil(this.courseOrderList.pagenum / this.courseOrderList.pagesize) > this.page ? this.hasMore = true : this.hasMore = false
|
|
81
|
+ // this.list.length <= 8 ? this.hasMore = true : this.hasMore = false
|
111
|
82
|
if (this.hasMore) {
|
112
|
83
|
setTimeout(() => {
|
113
|
|
- this.list.push({
|
114
|
|
- LocationName: '社交',
|
115
|
|
- title: '小小外交官课程',
|
116
|
|
- payType: '优惠券抵用',
|
117
|
|
- time: '2018-7-18 12:19',
|
118
|
|
- price: 199,
|
119
|
|
- useType: '已失效'
|
|
84
|
+ this.getCourseOrderList({
|
|
85
|
+ page: _that.page + 1
|
|
86
|
+ }).then((res) => {
|
|
87
|
+ if(res.list.length){
|
|
88
|
+ _that.page += 1
|
|
89
|
+ }
|
120
|
90
|
})
|
121
|
91
|
}, 1000)
|
122
|
92
|
} else {
|
|
@@ -125,12 +95,12 @@ export default {
|
125
|
95
|
}
|
126
|
96
|
},
|
127
|
97
|
toDetail () {
|
128
|
|
- this.$router.push({name: 'lessonDetail'})
|
|
98
|
+ this.$router.push({ name: 'lessonDetail' })
|
129
|
99
|
}
|
130
|
100
|
}
|
131
|
101
|
}
|
132
|
102
|
</script>
|
133
|
103
|
|
134
|
104
|
<style lang="scss" scoped>
|
135
|
|
-@import "page.scss";
|
|
105
|
+@import 'page.scss';
|
136
|
106
|
</style>
|