|
@@ -112,6 +112,7 @@ export default {
|
112
|
112
|
message: x => x.index.message,
|
113
|
113
|
project: x => x.index.project,
|
114
|
114
|
cms: x => x.index.cms,
|
|
115
|
+ user: x => x.userCenter.userInfo
|
115
|
116
|
}),
|
116
|
117
|
...mapProjectState({
|
117
|
118
|
courseDetail: x => x.courseDetail
|
|
@@ -136,7 +137,7 @@ export default {
|
136
|
137
|
this.courseDetail.CourseImgs.sort(this.getSortFun('asc', 'Sort'))
|
137
|
138
|
this.detailImage = this.courseDetail.CourseImgs
|
138
|
139
|
}
|
139
|
|
- console.log(this.detailImage)
|
|
140
|
+ // console.log(this.detailImage)
|
140
|
141
|
this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
|
141
|
142
|
let nowDate = Date.now()
|
142
|
143
|
let endData = new Date(this.courseDetail.EndDate).getTime()
|
|
@@ -153,6 +154,7 @@ export default {
|
153
|
154
|
methods: {
|
154
|
155
|
...mapProjectActions([
|
155
|
156
|
'getCourseDetailInfo',
|
|
157
|
+ 'placeCourseOrderBefore',
|
156
|
158
|
]),
|
157
|
159
|
getSortFun (order, sortBy) {
|
158
|
160
|
var ordAlpah = (order == 'asc') ? '>' : '<'
|
|
@@ -184,7 +186,18 @@ export default {
|
184
|
186
|
if (nowDate > endData) {
|
185
|
187
|
this.$toast('该课程已过期')
|
186
|
188
|
} else {
|
187
|
|
- this.$router.push({ name: 'placeOrderForCourse', query: { id: this.courseDetail.CourseId } })
|
|
189
|
+ this.placeCourseOrderBefore({
|
|
190
|
+ order: {
|
|
191
|
+ CourseId: this.courseDetail.CourseId,
|
|
192
|
+ CaseId: this.courseDetail.CaseId,
|
|
193
|
+ CustomerId: this.user.CustomerId,
|
|
194
|
+ Price: this.courseDetail.Price
|
|
195
|
+ },
|
|
196
|
+ customercouponid: ''
|
|
197
|
+ }).then((res) => {
|
|
198
|
+ // console.log(JSON.stringify(res))
|
|
199
|
+ this.$router.push({ name: 'placeOrderForCourse', query: { id: this.courseDetail.CourseId, ordersid: res.OrdersId } })
|
|
200
|
+ })
|
188
|
201
|
}
|
189
|
202
|
},
|
190
|
203
|
openMap () {
|