|
@@ -12,7 +12,7 @@
|
12
|
12
|
<span>精品课程名称</span>
|
13
|
13
|
</div>
|
14
|
14
|
</div>
|
15
|
|
- <span>满手</span>
|
|
15
|
+ <span>{{courseDetail.CourseName}}</span>
|
16
|
16
|
</li>
|
17
|
17
|
<li class="flex-h">
|
18
|
18
|
<div class="flex-item">
|
|
@@ -20,7 +20,7 @@
|
20
|
20
|
<span>预计开班时间</span>
|
21
|
21
|
</div>
|
22
|
22
|
</div>
|
23
|
|
- <span>满手</span>
|
|
23
|
+ <span>{{returnDate(courseDetail.BeginDate)}}</span>
|
24
|
24
|
</li>
|
25
|
25
|
<li class="flex-h">
|
26
|
26
|
<div class="flex-item">
|
|
@@ -28,7 +28,7 @@
|
28
|
28
|
<span>时间描述</span>
|
29
|
29
|
</div>
|
30
|
30
|
</div>
|
31
|
|
- <span>满手</span>
|
|
31
|
+ <span v-if="courseTimeList.length">{{returnCourseTime(courseTimeList[0].BeginDate,courseTimeList[0].EndDate)}}</span>
|
32
|
32
|
</li>
|
33
|
33
|
<li class="flex-h">
|
34
|
34
|
<div class="flex-item">
|
|
@@ -36,7 +36,7 @@
|
36
|
36
|
<span>地点</span>
|
37
|
37
|
</div>
|
38
|
38
|
</div>
|
39
|
|
- <span>满手</span>
|
|
39
|
+ <!-- <span>{{courseDetail.CaseInfo.CaseAddress}}</span> -->
|
40
|
40
|
</li>
|
41
|
41
|
<li class="flex-h">
|
42
|
42
|
<div class="flex-item">
|
|
@@ -44,7 +44,7 @@
|
44
|
44
|
<span>价格</span>
|
45
|
45
|
</div>
|
46
|
46
|
</div>
|
47
|
|
- <span>满手</span>
|
|
47
|
+ <span>¥{{courseDetail.Price}}</span>
|
48
|
48
|
</li>
|
49
|
49
|
</ul>
|
50
|
50
|
<div class="selectTicket">
|
|
@@ -91,10 +91,10 @@
|
91
|
91
|
<div class="flex-h">
|
92
|
92
|
<div class="flex-item">
|
93
|
93
|
<div>
|
94
|
|
- <span>总计¥<em>109</em>.00</span>
|
|
94
|
+ <span>总计¥<em>{{courseDetail.Price}}</em></span>
|
95
|
95
|
</div>
|
96
|
96
|
</div>
|
97
|
|
- <router-link :to="{name: '', query: {}}">确认订单</router-link>
|
|
97
|
+ <a @click="placeOrder">确认订单</a>
|
98
|
98
|
</div>
|
99
|
99
|
<div class="layer" :class="{'show': showLayer}">
|
100
|
100
|
<div>
|
|
@@ -112,12 +112,15 @@
|
112
|
112
|
</template>
|
113
|
113
|
|
114
|
114
|
<script>
|
|
115
|
+import { mapState, createNamespacedHelpers } from 'vuex'
|
|
116
|
+const { mapActions: mapProjectActions, mapState: mapProjectState } = createNamespacedHelpers('majorProjects')
|
115
|
117
|
|
116
|
118
|
export default {
|
117
|
119
|
name: '',
|
118
|
120
|
data () {
|
119
|
121
|
return {
|
120
|
122
|
agreementOff: false, // 是否同意协议
|
|
123
|
+ courseTimeList: [],
|
121
|
124
|
postData: {
|
122
|
125
|
CouponId: '',
|
123
|
126
|
CouponName: '',
|
|
@@ -138,9 +141,66 @@ export default {
|
138
|
141
|
}],
|
139
|
142
|
}
|
140
|
143
|
},
|
141
|
|
- computed: {},
|
142
|
|
- created () { },
|
|
144
|
+ computed: {
|
|
145
|
+ ...mapState({
|
|
146
|
+ orgid: x => x.app.orgId,
|
|
147
|
+ fiveA: x => x.index.fiveA,
|
|
148
|
+ banner: x => x.index.banner,
|
|
149
|
+ message: x => x.index.message,
|
|
150
|
+ project: x => x.index.project,
|
|
151
|
+ cms: x => x.index.cms,
|
|
152
|
+ user: x => x.userCenter.userInfo
|
|
153
|
+ }),
|
|
154
|
+ ...mapProjectState({
|
|
155
|
+ courseDetail: x => x.courseDetail
|
|
156
|
+ }),
|
|
157
|
+ },
|
|
158
|
+ created () {
|
|
159
|
+ this.getCourseDetailInfo({ id: this.$route.query.id }).then((res) => {
|
|
160
|
+ var arr = res.CourseDetail
|
|
161
|
+ this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
|
|
162
|
+ })
|
|
163
|
+ },
|
143
|
164
|
methods: {
|
|
165
|
+ placeOrder () { // 下单
|
|
166
|
+ if(!this.agreementOff){
|
|
167
|
+ this.$toast('请先阅读服务协议并同意')
|
|
168
|
+ return false
|
|
169
|
+ }
|
|
170
|
+ this.placeOrderForCourse({
|
|
171
|
+ order: {
|
|
172
|
+ CourseId: this.courseDetail.CourseId,
|
|
173
|
+ CaseId: this.courseDetail.CaseId,
|
|
174
|
+ CustomerId: this.user.CustomerId,
|
|
175
|
+ Price: this.courseDetail.Price
|
|
176
|
+ },
|
|
177
|
+ coupons: []
|
|
178
|
+ }).then((res) => {
|
|
179
|
+ // console.log(JSON.stringify(res))
|
|
180
|
+ this.$dialog.alert({
|
|
181
|
+ message: '下单成功!'
|
|
182
|
+ }).then(() => {
|
|
183
|
+ // this.$router.push({name: 'majorProjects'})
|
|
184
|
+ window.history.go(-2)
|
|
185
|
+ })
|
|
186
|
+ })
|
|
187
|
+ },
|
|
188
|
+ ...mapProjectActions([
|
|
189
|
+ 'getCourseDetailInfo',
|
|
190
|
+ 'placeOrderForCourse',
|
|
191
|
+ ]),
|
|
192
|
+ returnCourseTime (val, endVal) { // 返回课时时间
|
|
193
|
+ val = new Date(val)
|
|
194
|
+ endVal = new Date(endVal)
|
|
195
|
+ return this.returnNum(val.getMonth() + 1) + '/' + this.returnNum(val.getDate()) + ' 周' + '日一二三四五六'.split('')[new Date(val).getDay()] + ' ' + this.returnNum(val.getHours()) + ':' + this.returnNum(val.getMinutes()) + '~' + this.returnNum(endVal.getHours()) + ':' + this.returnNum(endVal.getMinutes())
|
|
196
|
+ },
|
|
197
|
+ returnNum (val) {
|
|
198
|
+ return val > 9 ? val : '0' + val
|
|
199
|
+ },
|
|
200
|
+ returnDate (val) {
|
|
201
|
+ val = new Date(val)
|
|
202
|
+ return this.returnNum(val.getMonth() + 1) + '月' + this.returnNum(val.getDate()) + '日'
|
|
203
|
+ },
|
144
|
204
|
onConfirm (value, index) {
|
145
|
205
|
this.postData.CouponId = value.id
|
146
|
206
|
this.postData.CouponName = value.value
|