diff --git a/component/document-box/document-box.wxml b/component/document-box/document-box.wxml index f8ae64b..0252e27 100644 --- a/component/document-box/document-box.wxml +++ b/component/document-box/document-box.wxml @@ -10,7 +10,7 @@ 必须 可选 - {{ item.description_zh }} + {{ item.details }} diff --git a/pages/projectComparison/projectComparison.js b/pages/projectComparison/projectComparison.js index bafe824..db9288a 100644 --- a/pages/projectComparison/projectComparison.js +++ b/pages/projectComparison/projectComparison.js @@ -136,20 +136,44 @@ Page({ } element['concentration'] = "" - if (element.details?.career_fields) { - element.details.career_fields.forEach(ele => { - element['concentration'] += '·' + ele + '\n' - }) + if (element.features?.has_scholarship) { + (element.specialization_options || []).forEach((ele) => { + element["concentration"] += "· " + ele + "\n"; + }); } element["english_proficiency_text"] = "" element.admission_requirements[0].language_requirements.forEach(ele => { if (ele.language = "ENGLISH") { ele.proof_methods.forEach(el => { - if (el.type == 'test') { - el.tests.forEach(e => { - element["english_proficiency_text"] += `・ ${ e.test_name }:总分${ e.min_score }分以上; \n` - }) + if (el.type == "test") { + el.tests.forEach((e) => { + let text = ""; + if (e.grade && e.grade == "Pass") text = `等级 ${e.grade}`; + else if (e.grade) text = `等级 ${e.grade} 以上`; + else if (e.min_score) text = `总分 ${e.min_score} 分以上`; + if (e.sub_scores.length > 0) { + let data = e.sub_scores; + const firstScore = data[0].score; + let allEqual = true; + let nonEqualSubject; + let nonEqualScore; + + for (let i = 1; i < data.length; i++) { + if (data[i].score !== firstScore) { + allEqual = false; + nonEqualSubject = data[i].subject; + nonEqualScore = data[i].score; + break; + } + } + + if (allEqual) text += `,各项分数不低于 ${firstScore} 分`; + else text += `,各项分数不低于 ${firstScore} 分, ${nonEqualSubject}不低于${nonEqualScore}分`; + } + element["english_proficiency_text"] += `・${e.test_name}:${text}; \n`; + // element["english_proficiency_text"] += `・${e.test_name}:总分${e.min_score}分以上; \n`; + }); } }) } @@ -167,8 +191,6 @@ Page({ element['admission_deposit_text'] = common.formatNumberWithSpaces(element.admissions[0].admission_deposit || '') - element['period'] = element.details.full_time_normal_year ? (element.details.full_time_normal_year + '年') : '_' - if (element.details.language_of_instruction) { let strOutput = element.details.language_of_instruction.join(','); element['language_of_instruction_text'] = strOutput diff --git a/pages/projectDetails/projectDetails.js b/pages/projectDetails/projectDetails.js index 2eb517d..2aa984e 100644 --- a/pages/projectDetails/projectDetails.js +++ b/pages/projectDetails/projectDetails.js @@ -350,16 +350,39 @@ Page({ language.forEach(element => { element['name'] = obj[element['language']]; - element.proof_methods.forEach(ele => { - ele['name'] = obj[ele['type']]; - (ele.tests || []).forEach(e => { - let text = "" - if (e.min_score == 'Pass') text = `等级 ${e.min_score}` - else if (e.min_score && /^[A-Za-z]+$/.test(e.min_score)) text = `等级 ${e.min_score} 以上` - else if (e.min_score) text = `总分 ${e.min_score} 分以上` - e['text'] = text - }) - }) + element.proof_methods.forEach((ele) => { + ele["name"] = obj[ele["type"]]; + (ele.tests || []).forEach((e) => { + let text = ""; + if (e.grade && e.grade == "Pass") text = `等级 ${e.grade}`; + else if (e.grade) text = `等级 ${e.grade} 以上`; + else if (e.sub_scores.length > 0) { + let allEqual = true; + e.sub_scores.forEach((ee) => { + if (ee.score != e.sub_scores[0].score) allEqual = false; + }); + + const fields = { + Total: "总分", + Reading: "阅读", + Speaking: "口语", + Writing: "写作", + Listening: "听力", + }; + + if (allEqual) text = `总分 ${e.min_score} 分以上,各项分数不低于 ${e.sub_scores[0].score} 分`; + else { + e.sub_scores.forEach((ee) => { + if (fields[ee.subject] && ee.score) text += `${fields[ee.subject]} ${ee.score} 分以上、`; + }); + if (text.endsWith("、")) text = text.slice(0, -1); + } + } + else if (e.min_score) text = `总分 ${e.min_score} 分以上`; + + e["text"] = text; + }); + }); }) const standardized = target.standardized_tests_requirements || [] @@ -416,7 +439,13 @@ Page({ // 拿到 招生 选中信息 getAdmissionsObj(id) { const admissionsObj = this.data.admissions.find(item => item.id === id); - // console.log("admissionsObj", admissionsObj); + if (admissionsObj.leaflet_url) { + const leaflet_url = decodeURIComponent(admissionsObj.leaflet_url) + const urlWithoutParams = leaflet_url.split('?')[0]; + const urlParts = urlWithoutParams.split('/'); + const fileName = urlParts[urlParts.length - 1]; + admissionsObj['leaflet_name'] = fileName + } this.setData({ admissionsObj, }) @@ -764,8 +793,10 @@ Page({ return now <= date }, + offerLoading: false, // 加载中 getOfferData() { - if (this.data.offerPage == 0) return + if (this.data.offerPage == 0 || this.offerLoading) return + this.offerLoading = true const limit = this.data.offerPage == 1 ? 5 : 10 util.wxget(`https://api.gter.net/v1/program/offerList?limit=${ limit }&projectid=${ this.data.info.id }&page=${ this.data.offerPage }`).then(res => { const data = res.data @@ -789,7 +820,7 @@ Page({ this.getHeadHeight() }, 500) }) - }) + }).finally(() => this.offerLoading = false) }, /** @@ -896,9 +927,11 @@ Page({ }) }, + recommendLoading: false, // 加载中 // 获取推荐数据 getRecommendData() { - if (this.data.recommendPage == 0) return + if (this.data.recommendPage == 0 || this.recommendLoading) return + this.recommendLoading = true util.wxpost("https://api.gter.net/v1/program/recommendProgram", { uniqid: this.data.uniqid, page: this.data.recommendPage, @@ -925,7 +958,7 @@ Page({ side, recommendPage: this.data.recommendPage + 1 }) - }) + }).finally(() => this.recommendLoading = false) }, // 点击 推荐项目 的详情 diff --git a/pages/projectDetails/projectDetails.less b/pages/projectDetails/projectDetails.less index d4d135d..90e3568 100644 --- a/pages/projectDetails/projectDetails.less +++ b/pages/projectDetails/projectDetails.less @@ -561,63 +561,6 @@ navigator { } } - .key-ranking { - display: flex; - flex-direction: column; - align-items: center; - - .icon { - width: 132rpx; - height: 36rpx; - margin-top: 16rpx; - margin-bottom: 22.5rpx; - } - - .list { - display: flex; - justify-content: space-between; - padding-bottom: 25rpx; - width: 100%; - - .item { - flex: 1; - flex-direction: column; - align-items: center; - display: flex; - - .quantity { - text-align: center; - font-family: 'Arial', 'Arial-Black', 'Arial Black', sans-serif; - font-weight: 900; - font-size: 27rpx; - color: #000000; - margin-bottom: 18rpx; - } - - .ranking-name { - text-align: center; - font-family: 'HelveticaNeue', 'Helvetica Neue', sans-serif; - font-weight: 400; - font-size: 24rpx; - color: #555555; - width: fit-content; - position: relative; - line-height: 24rpx; - position: relative; - - .ranking-icon { - width: 12rpx; - height: 12rpx; - position: absolute; - bottom: 0; - right: -12rpx; - transform: rotate(270deg); - } - } - } - } - } - .tuition { padding: 15rpx; display: flex; @@ -846,9 +789,16 @@ navigator { height: 100%; width: 45rpx; + &.btn-right-show { + .arrows { + transform: rotate(180deg); + } + } + .arrows { width: 15rpx; height: 7.5rpx; + transition: all .3s; } } } @@ -2294,57 +2244,6 @@ navigator { } } -.remark-mask { - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.706); - z-index: 1002; - align-items: flex-end; - - .remark { - width: 100vw; - position: absolute; - bottom: 0; - - .remark-input { - width: 100%; - min-height: 81rpx; - font-size: 27rpx; - background-color: rgb(255, 255, 255); - padding: 30rpx 27rpx 0; - box-sizing: border-box; - } - - .remark-bottom { - justify-content: flex-end; - padding: 10rpx 27rpx 21rpx; - background-color: #fff; - - .remark-limit { - font-size: 21rpx; - color: rgb(170, 170, 170); - margin-right: 16rpx; - } - - .remark-btn { - width: 60rpx; - height: 60rpx; - background-color: rgb(207, 247, 255); - border: 1rpx solid rgb(186, 222, 230); - border-radius: 50%; - - .remark-icon { - width: 24rpx; - height: 25.5rpx; - } - } - } - } -} - .index-sidebar { position: relative; z-index: 2; diff --git a/pages/projectDetails/projectDetails.wxml b/pages/projectDetails/projectDetails.wxml index a873b5f..ff95bcc 100644 --- a/pages/projectDetails/projectDetails.wxml +++ b/pages/projectDetails/projectDetails.wxml @@ -246,7 +246,7 @@ - {{ admissionsObj.season }}申请信息 - - + diff --git a/pages/projectDetails/projectDetails.wxss b/pages/projectDetails/projectDetails.wxss index 4a56b68..ecf5f42 100644 --- a/pages/projectDetails/projectDetails.wxss +++ b/pages/projectDetails/projectDetails.wxss @@ -455,55 +455,6 @@ navigator { .details-box .accreditation .accreditation-item .list .item:not(:last-of-type) { margin-bottom: 21rpx; } -.details-box .key-ranking { - display: flex; - flex-direction: column; - align-items: center; -} -.details-box .key-ranking .icon { - width: 132rpx; - height: 36rpx; - margin-top: 16rpx; - margin-bottom: 22.5rpx; -} -.details-box .key-ranking .list { - display: flex; - justify-content: space-between; - padding-bottom: 25rpx; - width: 100%; -} -.details-box .key-ranking .list .item { - flex: 1; - flex-direction: column; - align-items: center; - display: flex; -} -.details-box .key-ranking .list .item .quantity { - text-align: center; - font-family: 'Arial', 'Arial-Black', 'Arial Black', sans-serif; - font-weight: 900; - font-size: 27rpx; - color: #000000; - margin-bottom: 18rpx; -} -.details-box .key-ranking .list .item .ranking-name { - text-align: center; - font-family: 'HelveticaNeue', 'Helvetica Neue', sans-serif; - font-weight: 400; - font-size: 24rpx; - color: #555555; - width: fit-content; - line-height: 24rpx; - position: relative; -} -.details-box .key-ranking .list .item .ranking-name .ranking-icon { - width: 12rpx; - height: 12rpx; - position: absolute; - bottom: 0; - right: -12rpx; - transform: rotate(270deg); -} .details-box .tuition { padding: 15rpx; display: flex; @@ -684,9 +635,13 @@ navigator { height: 100%; width: 45rpx; } +.details-box .apply-btn .btn .btn-right.btn-right-show .arrows { + transform: rotate(180deg); +} .details-box .apply-btn .btn .btn-right .arrows { width: 15rpx; height: 7.5rpx; + transition: all 0.3s; } .details-box .apply-btn .apply-mask { position: fixed; @@ -1870,50 +1825,6 @@ navigator { .admissionState.state3 { background-color: #04b0d5; } -.remark-mask { - position: fixed; - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background-color: rgba(0, 0, 0, 0.706); - z-index: 1002; - align-items: flex-end; -} -.remark-mask .remark { - width: 100vw; - position: absolute; - bottom: 0; -} -.remark-mask .remark .remark-input { - width: 100%; - min-height: 81rpx; - font-size: 27rpx; - background-color: #ffffff; - padding: 30rpx 27rpx 0; - box-sizing: border-box; -} -.remark-mask .remark .remark-bottom { - justify-content: flex-end; - padding: 10rpx 27rpx 21rpx; - background-color: #fff; -} -.remark-mask .remark .remark-bottom .remark-limit { - font-size: 21rpx; - color: #aaaaaa; - margin-right: 16rpx; -} -.remark-mask .remark .remark-bottom .remark-btn { - width: 60rpx; - height: 60rpx; - background-color: #cff7ff; - border: 1rpx solid #badee6; - border-radius: 50%; -} -.remark-mask .remark .remark-bottom .remark-btn .remark-icon { - width: 24rpx; - height: 25.5rpx; -} .index-sidebar { position: relative; z-index: 2; diff --git a/pages/projectSchoolHomepage/projectSchoolHomepage.js b/pages/projectSchoolHomepage/projectSchoolHomepage.js index cb4f6f9..18596bb 100644 --- a/pages/projectSchoolHomepage/projectSchoolHomepage.js +++ b/pages/projectSchoolHomepage/projectSchoolHomepage.js @@ -180,27 +180,28 @@ Page({ }) }, - // 默认选中学院 - defaultSelectCollege() { - this.setData({ - screen: { - name: decodeURI(this.department || ''), - key: "school", - pitch: "school", - } + // 默认选中学院 + defaultSelectCollege() { + this.setData({ + screen: { + name: decodeURI(this.department || ''), + university: decodeURI(this.department || ''), + key: "school", + pitch: "school", + } + }) + + + this.screenData() + this.department = "" + + setTimeout(() => { + wx.pageScrollTo({ + offsetTop: -200, + selector: ".all-projects", }) - - - this.screenData() - this.department = "" - - setTimeout(() => { - wx.pageScrollTo({ - offsetTop: -200, - selector: ".all-projects", - }) - }, 500) - }, + }, 500) + }, convertRankToRankText(rank) { if (!rank) return 0 diff --git a/pages/projectSchoolHomepage/projectSchoolHomepage.wxml b/pages/projectSchoolHomepage/projectSchoolHomepage.wxml index a1cfaf5..15dde26 100644 --- a/pages/projectSchoolHomepage/projectSchoolHomepage.wxml +++ b/pages/projectSchoolHomepage/projectSchoolHomepage.wxml @@ -133,12 +133,12 @@ {{ item.name_en }} - {{ item.department }} + {{ item.department || '' }} - | 专业排名 {{ item.rank }} + | 专业排名 {{ item.rank }} - | 学费HK$ {{ item.tuition_fee_text }} + | 学费HK$ {{ item.tuition_fee_text }} {{ item.distinctive }} diff --git a/project.private.config.json b/project.private.config.json index 720bd9b..03fce65 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -3,7 +3,7 @@ "projectname": "%E5%B0%8F%E7%A8%8B%E5%BA%8F%20-%20%E9%A1%B9%E7%9B%AE%E5%BA%93", "setting": { "compileHotReLoad": false, - "urlCheck": false + "urlCheck": true }, "condition": { "miniprogram": {