commit
This commit is contained in:
@@ -323,7 +323,7 @@ layout("/mobile/platform.html"){
|
||||
style="color: #dd6363">点我查看微信群二维码</span>
|
||||
</div>
|
||||
<div class="train-card-actions"
|
||||
v-if="activityStatus !== '1' || (o.isSign === true && moment().valueOf() < moment(activity.activitySignUpEndTime).valueOf())">
|
||||
v-if="o.isOpen !== false && (activityStatus !== '1' || (o.isSign === true && moment().valueOf() < moment(activity.activitySignUpEndTime).valueOf()))">
|
||||
<van-button type="primary" color="#1867b0" round size="mini"
|
||||
class="train-card-button"
|
||||
v-if="activityStatus !== '1' && o.isSign === false"
|
||||
@@ -625,11 +625,27 @@ layout("/mobile/platform.html"){
|
||||
const {data} = await $.get('/platform/trainSingUp/manage/userAdjust/registerUserList', this.registerForm)
|
||||
this.signUsers = data
|
||||
},
|
||||
// 未开启的课程排到最后,其余课程保持原有顺序不变
|
||||
sortCourseList(courseList) {
|
||||
return (courseList || []).map((item, index) => {
|
||||
return {
|
||||
item: item,
|
||||
index: index
|
||||
}
|
||||
}).sort((a, b) => {
|
||||
const aOrder = a.item.isOpen === false ? 1 : 0
|
||||
const bOrder = b.item.isOpen === false ? 1 : 0
|
||||
if (aOrder !== bOrder) {
|
||||
return aOrder - bOrder
|
||||
}
|
||||
return a.index - b.index
|
||||
}).map(v => v.item)
|
||||
},
|
||||
tabClick(name, title) {
|
||||
if (this.courseType === '0' && this.activityStatus !== '1') {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(o => o.assort === title)
|
||||
this.tableData.courseList = this.sortCourseList(this.tempArray.courseList.filter(o => o.assort === title))
|
||||
} else {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(o => o.assort === title && o.courseType === this.courseType)
|
||||
this.tableData.courseList = this.sortCourseList(this.tempArray.courseList.filter(o => o.assort === title && o.courseType === this.courseType))
|
||||
}
|
||||
},
|
||||
calcSignUpCount(o) {
|
||||
@@ -1030,10 +1046,11 @@ layout("/mobile/platform.html"){
|
||||
})
|
||||
if (resp.code === 0) {
|
||||
this.tableData = resp.data
|
||||
this.tableData.courseList = this.sortCourseList(this.tableData.courseList)
|
||||
this.assortList = Array.from(new Set(this.tableData.courseList.map(o => o.assort).filter(o => o !== '' && o !== undefined)))
|
||||
this.tempArray = clone(this.tableData)
|
||||
if (this.assortList.length > 0 && this.activityStatus !== '1') {
|
||||
this.tableData.courseList = this.tableData.courseList.filter(o => o.assort === this.assortList[0])
|
||||
this.tableData.courseList = this.sortCourseList(this.tableData.courseList.filter(o => o.assort === this.assortList[0]))
|
||||
}
|
||||
const type = this.trainTypeList.find(o => o.code === this.tableData.trainType)
|
||||
this.trainType = type ? type.name : '培训班'
|
||||
@@ -1089,12 +1106,14 @@ layout("/mobile/platform.html"){
|
||||
}
|
||||
if (this.assortList.length > 0 && this.activityStatus !== '1') {
|
||||
if (value === '0') {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(o => o.assort === this.assort)
|
||||
this.tableData.courseList = this.sortCourseList(this.tempArray.courseList.filter(o => o.assort === this.assort))
|
||||
} else {
|
||||
this.tableData.courseList = this.tempArray.courseList.filter(item => item.courseType === value && item.assort === this.assort)
|
||||
this.tableData.courseList = this.sortCourseList(this.tempArray.courseList.filter(item => item.courseType === value && item.assort === this.assort))
|
||||
}
|
||||
} else {
|
||||
this.tableData.courseList = value === '0' ? this.tempArray.courseList : this.tempArray.courseList.filter(item => item.courseType === value)
|
||||
this.tableData.courseList = value === '0'
|
||||
? this.sortCourseList(this.tempArray.courseList)
|
||||
: this.sortCourseList(this.tempArray.courseList.filter(item => item.courseType === value))
|
||||
}
|
||||
this.closeLoading()
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user