|
@@ -17,13 +17,14 @@
|
17
|
17
|
</div>
|
18
|
18
|
<h5>结识更多朋友</h5>
|
19
|
19
|
<div class="courseList flex-h">
|
20
|
|
- <ul class="flex-item">
|
21
|
|
- <router-link tag="li" :to="{name:'',query:{}}" v-for="(item,index) in courseList" :key="index">
|
|
20
|
+ <ul class="flex-item" v-if="!fiveANoData">
|
|
21
|
+ <router-link tag="li" v-for="(item,index) in courseList" :key="index" :to="{name:'majorProjectsDetail',query:{id: item.id}}">
|
22
|
22
|
<courseItem :data="item"></courseItem>
|
23
|
23
|
</router-link>
|
24
|
24
|
</ul>
|
|
25
|
+ <span v-if="fiveANoData" style="width:100%;line-height:.3rem;display:block;text-align:center;color:#ccc;margin-bottom:.1rem;">暂无数据</span>
|
25
|
26
|
</div>
|
26
|
|
- <router-link :to="{name:'',query:{}}" class="more">查看更多</router-link>
|
|
27
|
+ <router-link :to="{name:'',query:{}}" class="more" v-if="!fiveANoData">查看更多</router-link>
|
27
|
28
|
<div style="width:100%;height:.1rem;background:#f8f8f8;margin:0 auto;"></div>
|
28
|
29
|
<h5>资讯</h5>
|
29
|
30
|
<div class="newsList flex-h">
|
|
@@ -50,8 +51,9 @@ export default {
|
50
|
51
|
name: '',
|
51
|
52
|
data () {
|
52
|
53
|
return {
|
|
54
|
+ fiveANoData: false,
|
53
|
55
|
active: {
|
54
|
|
- index: 1,
|
|
56
|
+ index: 0,
|
55
|
57
|
locationid: ''
|
56
|
58
|
},
|
57
|
59
|
swiperOption: {
|
|
@@ -65,63 +67,8 @@ export default {
|
65
|
67
|
LocationId: "selected",
|
66
|
68
|
LocationName: "精选"
|
67
|
69
|
}],
|
68
|
|
- courseList: [{ // 课程列表
|
69
|
|
- id: '',
|
70
|
|
- title: '课程名称',
|
71
|
|
- img: '',
|
72
|
|
- time: '2018.04.04 18:30-20:00',
|
73
|
|
- address: '南京南',
|
74
|
|
- tag: ['儿童教育', '小小外交官'],
|
75
|
|
- courseType: '团体课',
|
76
|
|
- defaultPrice: '168/节',
|
77
|
|
- getWay: 'ticket'
|
78
|
|
- }, {
|
79
|
|
- id: '',
|
80
|
|
- title: '课程名称',
|
81
|
|
- img: '',
|
82
|
|
- time: '2018.04.04 18:30-20:00',
|
83
|
|
- address: '南京南',
|
84
|
|
- tag: ['儿童教育', '小小外交官'],
|
85
|
|
- courseType: '团体课',
|
86
|
|
- defaultPrice: '168/节',
|
87
|
|
- getWay: 'free'
|
88
|
|
- }, {
|
89
|
|
- id: '',
|
90
|
|
- title: '课程名称',
|
91
|
|
- img: '',
|
92
|
|
- time: '2018.04.04 18:30-20:00',
|
93
|
|
- address: '南京南',
|
94
|
|
- tag: ['儿童教育', '小小外交官'],
|
95
|
|
- courseType: '团体课',
|
96
|
|
- defaultPrice: '168/节',
|
97
|
|
- getWay: 'free'
|
98
|
|
- }],
|
99
|
|
- newsList: [{ // 资讯列表
|
100
|
|
- title: '我是标题我是标题我是标题我是标题我是标题我是标题',
|
101
|
|
- time: '2018年5月25日',
|
102
|
|
- img: '',
|
103
|
|
- id: ''
|
104
|
|
- }, {
|
105
|
|
- title: '我是标题我是标题我是标题我是标题我是标题我是标题',
|
106
|
|
- time: '2018年5月25日',
|
107
|
|
- img: '',
|
108
|
|
- id: ''
|
109
|
|
- }, {
|
110
|
|
- title: '我是标题我是标题我是标题我是标题我是标题我是标题',
|
111
|
|
- time: '2018年5月25日',
|
112
|
|
- img: '',
|
113
|
|
- id: ''
|
114
|
|
- }, {
|
115
|
|
- title: '我是标题我是标题我是标题我是标题我是标题我是标题',
|
116
|
|
- time: '2018年5月25日',
|
117
|
|
- img: '',
|
118
|
|
- id: ''
|
119
|
|
- }, {
|
120
|
|
- title: '我是标题我是标题我是标题我是标题我是标题我是标题',
|
121
|
|
- time: '2018年5月25日',
|
122
|
|
- img: '',
|
123
|
|
- id: ''
|
124
|
|
- }]
|
|
70
|
+ courseList: [], // 课程列表
|
|
71
|
+ newsList: [], // 资讯列表
|
125
|
72
|
}
|
126
|
73
|
},
|
127
|
74
|
computed: {
|
|
@@ -129,7 +76,8 @@ export default {
|
129
|
76
|
orgid: x => x.app.orgId,
|
130
|
77
|
navList: x => x.fiveA.nav,
|
131
|
78
|
banner: x => x.fiveA.banner,
|
132
|
|
- cms: x => x.fiveA.cms
|
|
79
|
+ cms: x => x.fiveA.cms,
|
|
80
|
+ fiveAList: x => x.fiveA.fiveAList,
|
133
|
81
|
}),
|
134
|
82
|
MySwiper () {
|
135
|
83
|
return this.$refs.mySwiper.swiper
|
|
@@ -147,22 +95,65 @@ export default {
|
147
|
95
|
created () {
|
148
|
96
|
this.getNav({ orgid: this.orgid, issys: '0' }).then(() => {
|
149
|
97
|
this.nav = this.nav.concat(this.navList)
|
150
|
|
- this.active.locationid = this.nav[this.active.index].LocationId
|
|
98
|
+ for (var n = 0; n < this.nav.length; n++) {
|
|
99
|
+ if(this.nav[n].LocationId === this.$route.query.id){
|
|
100
|
+ this.active.index = n
|
|
101
|
+ this.active.locationid = this.nav[n].LocationId
|
|
102
|
+ }
|
|
103
|
+ }
|
|
104
|
+ this.getFiveAList({ locationid: this.active.locationid, orgid: this.orgid }).then((res) => {
|
|
105
|
+ // console.log(JSON.stringify(res))
|
|
106
|
+ this.courseList = []
|
|
107
|
+ if (res !== null) {
|
|
108
|
+ this.fiveANoData = false
|
|
109
|
+ this.returnCourseList(res)
|
|
110
|
+ } else {
|
|
111
|
+ this.fiveANoData = true
|
|
112
|
+ }
|
|
113
|
+ })
|
151
|
114
|
this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
|
152
|
115
|
this.newsList = this.cms
|
153
|
116
|
})
|
154
|
117
|
})
|
155
|
118
|
},
|
156
|
119
|
methods: {
|
157
|
|
- ...mapFiveAActions(['getNav']),
|
158
|
|
- ...mapFiveAActions(['getFiveAInfo']),
|
|
120
|
+ ...mapFiveAActions([
|
|
121
|
+ 'getNav',
|
|
122
|
+ 'getFiveAInfo',
|
|
123
|
+ 'getFiveAList',
|
|
124
|
+ ]),
|
159
|
125
|
changeLocation (item, index) {
|
160
|
126
|
this.active.index = index
|
161
|
127
|
this.active.locationid = item.LocationId
|
|
128
|
+ this.getFiveAList({ locationid: this.active.locationid, orgid: this.orgid }).then((res) => {
|
|
129
|
+ // console.log(JSON.stringify(res))
|
|
130
|
+ this.courseList = []
|
|
131
|
+ if (res !== null) {
|
|
132
|
+ this.fiveANoData = false
|
|
133
|
+ this.returnCourseList(res)
|
|
134
|
+ } else {
|
|
135
|
+ this.fiveANoData = true
|
|
136
|
+ }
|
|
137
|
+ })
|
162
|
138
|
this.getFiveAInfo({ orgid: this.orgid, locationid: this.active.locationid }).then(() => {
|
163
|
139
|
this.newsList = this.cms
|
164
|
140
|
})
|
165
|
141
|
},
|
|
142
|
+ returnCourseList (arr) { // 转换课程列表格式
|
|
143
|
+ for (var n = 0; n < arr.length; n++) {
|
|
144
|
+ this.courseList.push({
|
|
145
|
+ id: arr[n].CourseId,
|
|
146
|
+ title: arr[n].CourseName,
|
|
147
|
+ img: arr[n].CourseImg,
|
|
148
|
+ time: this.toolClass.dateFormat(arr[n].BeginDate),
|
|
149
|
+ address: arr[n].CaseInfo.CaseAddress,
|
|
150
|
+ tag: arr[n].CourseTags || [],
|
|
151
|
+ courseType: '',
|
|
152
|
+ defaultPrice: arr[n].Price + '/节',
|
|
153
|
+ getWay: 'ticket'
|
|
154
|
+ })
|
|
155
|
+ }
|
|
156
|
+ },
|
166
|
157
|
jump (item) {
|
167
|
158
|
console.log(item)
|
168
|
159
|
item.ForwardType = item.ForwardType || ''
|
|
@@ -180,5 +171,5 @@ export default {
|
180
|
171
|
|
181
|
172
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
182
|
173
|
<style lang="scss" scoped>
|
183
|
|
-@import "page.scss";
|
|
174
|
+@import 'page.scss';
|
184
|
175
|
</style>
|