diff --git a/components/filter-popup/filter-popup.vue b/components/filter-popup/filter-popup.vue index d377343..70ce029 100644 --- a/components/filter-popup/filter-popup.vue +++ b/components/filter-popup/filter-popup.vue @@ -19,9 +19,12 @@ 学科专业 - - {{categoryName ? categoryName : '请选择'}} - + + + {{categoryName ? categoryName : '请选择'}} + + + @@ -213,18 +216,24 @@ export default { const i1IsNumber = typeof i1 === 'number' const i2IsNumber = typeof i2 === 'number' const list = this.categories - this.categoryId = list[0][i0].id - this.professionalCategoryId = !i1IsNumber ? '' : list[1][i1].id - this.professionalId = !i2IsNumber ? '' : list[2][i2].id - this.categoryName = list[0][i0].title - if (i1IsNumber && list[1].length) this.categoryName += '/' + list[1][i1].title - if (i2IsNumber && list[2].length) this.categoryName += '/' + list[2][i2].title + + this.professionalCategoryId = '' + this.professionalId = '' + if (i1IsNumber && list[1].length > 0) { + this.professionalCategoryId = list[1][i1].id + this.categoryName += '/' + list[1][i1].title + } + if (i2IsNumber && list[2].length > 0) { + this.professionalId = list[2][i2].id + this.categoryName += '/' + list[2][i2].title + } }, // 学科专业切换回调 async columnchange(e) { const { column } = e.detail + console.log('change',column) if (column == 0) { const { list } = await courseProfessionalClass(this.categories[0][e.detail.value].id) list.map(e => { @@ -234,6 +243,7 @@ export default { this.categories[1] = list this.categories[2] = [] this.$set(this.categories, 1, list) + console.log('inner',this.categories) } else if (column == 1) { const { list } = await courseProfessional(this.categories[1][e.detail.value].id) @@ -245,6 +255,14 @@ export default { this.$set(this.categories, 2, list) } }, + // 删除学科专业 + delCatagory() { + this.category = [] + this.categoryName = '' + this.categoryId = '' + this.professionalCategoryId = '' + this.professionalId = '' + }, // 点击完成 finsh() { @@ -264,6 +282,14 @@ export default { //重置 reset() { this.acceptForm = {} + this.categoryId = '' + this.professionalCategoryId = '' + this.professionalId = '' + this.categoryName = '' + this.$nextTick(() => { + this.$emit("finsh", this.acceptForm); + this.$emit("input", false); + }) }, }, }; @@ -301,8 +327,15 @@ export default { } .select-scroll { } - .category { + .category-wrap { + display: flex; + align-items: center; margin-top: 10rpx; + .icon { + margin-left: 10rpx; + } + } + .category { font-size: 28rpx; } .select-main { diff --git a/libs/util.js b/libs/util.js index ecc0c75..ebf5089 100644 --- a/libs/util.js +++ b/libs/util.js @@ -32,7 +32,7 @@ export default { }, // 如果非数字,则返回0 handleNaN(val) { - return isNaN(val) ? 0 : val + return isNaN(val) || val == 0 ? '' : val }, // 小于10,返回0+传入值 preZero(val) { @@ -117,4 +117,8 @@ export default { if (id == 5) return 0 if (id == 6) return 4 }, + // 去掉html标签 + removeTag(str) { + return str.replace(/(<[^>]+>)|(( )+)/g , '') + }, } \ No newline at end of file diff --git a/order/addCourse/addCourse.vue b/order/addCourse/addCourse.vue index 2ce2a39..71f5934 100644 --- a/order/addCourse/addCourse.vue +++ b/order/addCourse/addCourse.vue @@ -5,8 +5,12 @@ @@ -28,7 +32,7 @@