From 8425be5904e872f964b86c3180c878d26c575b31 Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Tue, 1 Apr 2025 16:04:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E5=BA=93bu?= =?UTF-8?q?g?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/document-box/document-box.js | 2 +- component/document-box/document-box.wxml | 2 +- pages/projectComparison/projectComparison.js | 2 +- pages/projectDetails/projectDetails.js | 70 +++++++++++++++---- pages/projectDetails/projectDetails.less | 1 + pages/projectDetails/projectDetails.wxml | 63 ++++++++--------- pages/projectDetails/projectDetails.wxss | 1 + .../projectSchoolHomepage.js | 4 +- project.private.config.json | 7 ++ 9 files changed, 102 insertions(+), 50 deletions(-) diff --git a/component/document-box/document-box.js b/component/document-box/document-box.js index df3bd1d..277d875 100644 --- a/component/document-box/document-box.js +++ b/component/document-box/document-box.js @@ -40,10 +40,10 @@ Component({ // 新 轮播图 自动滑动事件,修改下标 bindchangeSwiper(e) { let current = e.detail.current - this.setData({ swiperCurrent: current }) + setTimeout(() => this.triggerEvent("bindchange"), 500) }, } }) \ No newline at end of file diff --git a/component/document-box/document-box.wxml b/component/document-box/document-box.wxml index 0252e27..61e4dbb 100644 --- a/component/document-box/document-box.wxml +++ b/component/document-box/document-box.wxml @@ -16,7 +16,7 @@ - + \ No newline at end of file diff --git a/pages/projectComparison/projectComparison.js b/pages/projectComparison/projectComparison.js index db9288a..8a8b82c 100644 --- a/pages/projectComparison/projectComparison.js +++ b/pages/projectComparison/projectComparison.js @@ -136,7 +136,7 @@ Page({ } element['concentration'] = "" - if (element.features?.has_scholarship) { + if (element.features?.has_specialization) { (element.specialization_options || []).forEach((ele) => { element["concentration"] += "· " + ele + "\n"; }); diff --git a/pages/projectDetails/projectDetails.js b/pages/projectDetails/projectDetails.js index 2aa984e..be6a60d 100644 --- a/pages/projectDetails/projectDetails.js +++ b/pages/projectDetails/projectDetails.js @@ -125,6 +125,7 @@ Page({ admission_requirements: [], // 语言能力要求 admission_requirementsObj: {}, + isNoRequire: false, // 需求是否为空 applyListState: false, // 申请信息选择列表状态 @@ -354,7 +355,8 @@ Page({ ele["name"] = obj[ele["type"]]; (ele.tests || []).forEach((e) => { let text = ""; - if (e.grade && e.grade == "Pass") text = `等级 ${e.grade}`; + if (["GMAT", "GMAT Focus Edition"].includes(e.test_name)) text = `Verbal Reasoning ${e.min_score} 分以上`; + else 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; @@ -377,8 +379,7 @@ Page({ }); if (text.endsWith("、")) text = text.slice(0, -1); } - } - else if (e.min_score) text = `总分 ${e.min_score} 分以上`; + } else if (e.min_score) text = `总分 ${e.min_score} 分以上`; e["text"] = text; }); @@ -403,6 +404,7 @@ Page({ target.language_requirements = language this.setData({ admission_requirementsObj: target, + isNoRequire: JSON.stringify(target) == "{}" ? true : false }, () => { const rpx800 = util.rpxTopx(800) const query = wx.createSelectorQuery(); @@ -707,7 +709,6 @@ Page({ const sideKey = e.currentTarget.dataset.key const sideHeight = this.sideHeight let value = sideHeight[sideKey] - this.data.totalTopHeight || 0 - // if (this.data.offerPage && ["issue", "links"].includes(sideKey)) value = 10000000 wx.pageScrollTo({ scrollTop: value, }) @@ -794,24 +795,20 @@ Page({ }, offerLoading: false, // 加载中 + offerAllList: [], getOfferData() { 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 + const limit = 5 + this.requestOfferData(limit).then(data => { const list = data.list || [] let side = this.data.side if (list.length == 0) delete side.consult - list.forEach(element => { - element["timestamp"] = util.strtimeago(element["timestamp"], 3) - }) - let sideNum = this.data.sideNum sideNum['consult'] = data.count this.setData({ - offerList: this.data.offerList.concat(list), + offerShowList: list, side, sideNum, offerPage: data.count > data.limit * data.page ? this.data.offerPage + 1 : 0, @@ -823,6 +820,55 @@ Page({ }).finally(() => this.offerLoading = false) }, + // 第二页 + moreOfferData() { + const render = () => { + let offerPage = this.data.offerPage + let allList = this.offerAllList + let offerShowList = this.data.offerShowList || [] + if (offerPage == 0) return + const offset = 10 + const startIndex = offerShowList.length; + const endIndex = startIndex + offset; + + let list = allList.slice(startIndex, endIndex); + + this.setData({ + offerShowList: offerShowList.concat(list), + offerPage: endIndex >= allList.length ? 0 : offerPage + 1, + }) + } + const request = () => { + if (this.offerLoading) return + this.offerLoading = true + this.requestOfferData(3000).then(data => { + this.offerAllList = data.list + render() + }).finally(() => this.offerLoading = false) + } + + if (this.offerAllList.length == 0) request() + else render() + }, + + // 请求 offer 数据 + requestOfferData(limit) { + return new Promise(resolve => { + util.wxget(`https://api.gter.net/v1/program/offerList?limit=${ limit }&projectid=${ this.data.info.id }`).then(res => { + if (res.code != 200) { + common.toast(res.message) + reject() + return + } + const data = res.data; + (data.list || []).forEach(element => { + element["timestamp"] = util.strtimeago(element["timestamp"], 3) + }) + resolve(data) + }).finally(() => this.offerLoading = false) + }) + }, + /** * 生命周期函数--监听页面初次渲染完成 */ diff --git a/pages/projectDetails/projectDetails.less b/pages/projectDetails/projectDetails.less index 90e3568..39715c8 100644 --- a/pages/projectDetails/projectDetails.less +++ b/pages/projectDetails/projectDetails.less @@ -723,6 +723,7 @@ navigator { background-repeat: repeat-y; background-position: 0 0; white-space: pre-wrap; + width: 508.5rpx; &::after { content: ""; diff --git a/pages/projectDetails/projectDetails.wxml b/pages/projectDetails/projectDetails.wxml index ff95bcc..29ce530 100644 --- a/pages/projectDetails/projectDetails.wxml +++ b/pages/projectDetails/projectDetails.wxml @@ -12,21 +12,15 @@ {{ info.schoolname || '' }} - - - | - {{ info.academic_unit[0]['academic_unit_zh'] }} - - - - - | - {{ info.academic_unit[1]['academic_unit_zh'] }} - - - | - {{ info.academic_unit[2]['academic_unit_zh'] }} - + | + + {{ info.academic_unit[0]['academic_unit_zh'] }} + + + | + {{ info.academic_unit[1]['academic_unit_zh'] }} + | + {{ info.academic_unit[2]['academic_unit_zh'] }} @@ -159,7 +153,7 @@ - + {{ newest || '' }} 本项目招生信息已更新为{{ newest || '' }} @@ -254,7 +248,7 @@ - + {{ item.season }}申请信息 @@ -292,20 +286,22 @@ - - - {{ admission_requirementsObj.basic_requirements }} - - + + + + {{ admission_requirementsObj.basic_requirements }} + + + + + + - - - - + - + @@ -500,12 +496,11 @@ - - + 录取参考 - + {{ item.schoolname }} @@ -566,7 +561,7 @@ - + 加载更多 @@ -602,7 +597,7 @@ 复制链接 - + 学院网站项目详情 {{ admissionsObj.application_url }} @@ -611,7 +606,7 @@ - + 项目目录项目详情 {{ admissionsObj.catalog_url }} @@ -644,7 +639,7 @@ {{ item.distinctive }} 招生官项目 - {{ item.semester.text }} + {{ item.semester.text }} {{ item }} diff --git a/pages/projectDetails/projectDetails.wxss b/pages/projectDetails/projectDetails.wxss index ecf5f42..505664f 100644 --- a/pages/projectDetails/projectDetails.wxss +++ b/pages/projectDetails/projectDetails.wxss @@ -577,6 +577,7 @@ navigator { background-repeat: repeat-y; background-position: 0 0; white-space: pre-wrap; + width: 508.5rpx; } .details-box .scholarships .text::after { content: ""; diff --git a/pages/projectSchoolHomepage/projectSchoolHomepage.js b/pages/projectSchoolHomepage/projectSchoolHomepage.js index 18596bb..af68e4a 100644 --- a/pages/projectSchoolHomepage/projectSchoolHomepage.js +++ b/pages/projectSchoolHomepage/projectSchoolHomepage.js @@ -463,8 +463,10 @@ Page({ screen['key'] = type if (type == 'all') { screen['disciplineid'] = '' - screen['universityid'] = '' + screen['university'] = '' screen['list'] = [] + screen['key'] = "all" + screen['pitch'] = "all" this.setData({ screen, list: [], diff --git a/project.private.config.json b/project.private.config.json index 03fce65..9ee369d 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -8,6 +8,13 @@ "condition": { "miniprogram": { "list": [ + { + "name": "pages/projectDetails/projectDetails", + "pathName": "pages/projectDetails/projectDetails", + "query": "uniqid=CG14CSz5K4Wm", + "launchMode": "default", + "scene": null + }, { "name": "pages/projectDetails/projectDetails", "pathName": "pages/projectDetails/projectDetails",