|
@@ -162,14 +162,14 @@ export default {
|
162
|
162
|
created () {
|
163
|
163
|
this.getCouponList().then((res) => {
|
164
|
164
|
this.getCourseDetailInfo({ id: this.$route.query.id }).then((result) => {
|
165
|
|
- var arr = result.CourseDetail
|
166
|
|
- console.log(arr)
|
|
165
|
+ var arr = result.CourseDetail, caseid = result.CaseId
|
|
166
|
+ // console.log(arr)
|
167
|
167
|
this.courseTimeList = arr.sort(function (a, b) { return new Date(a.BeginDate).getTime() > new Date(b.BeginDate).getTime() ? 1 : -1 })
|
168
|
168
|
var id = this.$route.query.id, arr = [], nowDate = Date.now()
|
169
|
169
|
for (var n = 0; n < res.length; n++) {
|
170
|
|
- console.log(res[n])
|
|
170
|
+ // console.log(res[n])
|
171
|
171
|
if (res[n].Coupon.CouponType === 'course' && res[n].Status === 1) {
|
172
|
|
- if (res[n].Coupon.IsAll) {
|
|
172
|
+ if (res[n].Coupon.IsAll && res[n].CaseId === caseid) {
|
173
|
173
|
this.couponList.push({
|
174
|
174
|
title: res[n].Coupon.CouponName,
|
175
|
175
|
desc: res[n].Coupon.Share.UseInstruction,
|
|
@@ -182,7 +182,7 @@ export default {
|
182
|
182
|
})
|
183
|
183
|
} else {
|
184
|
184
|
for (var a = 0; a < res[n].Coupon.Targets.length; a++) {
|
185
|
|
- if (res[n].Coupon.Targets[a].TargetId === id && nowDate < new Date(res[n].EndDate).getTime()) {
|
|
185
|
+ if (res[n].Coupon.Targets[a].TargetId === id && nowDate < new Date(res[n].EndDate).getTime() && res[n].CaseId === caseid) {
|
186
|
186
|
this.couponList.push({
|
187
|
187
|
title: res[n].Coupon.CouponName,
|
188
|
188
|
desc: res[n].Coupon.Share.UseInstruction,
|