From 4c79609069810d5d9db59265b81591711288e2bc Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Wed, 26 Mar 2025 18:48:02 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=B9=E9=BD=90offer=E6=A6=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- component/admission-box/admission-box.js | 2 +- pages/projectAllList/projectAllList.js | 6 +- pages/projectComparison/projectComparison.js | 95 ++++++++++++++----- .../projectComparison/projectComparison.wxml | 15 +-- pages/projectDetails/projectDetails.js | 2 +- pages/projectDetails/projectDetails.wxml | 18 ++-- pages/projectLibrary/projectLibrary.js | 14 +-- pages/projectList/projectList.js | 6 +- pages/projectMy/projectMy.js | 16 ++-- .../projectSchoolHomepage.js | 10 +- .../projectSubjectList/projectSubjectList.js | 8 +- pages/search/search.js | 7 +- project.private.config.json | 2 +- utils/commonMethod.js | 4 +- 14 files changed, 125 insertions(+), 80 deletions(-) diff --git a/component/admission-box/admission-box.js b/component/admission-box/admission-box.js index dda797a..0bbef21 100644 --- a/component/admission-box/admission-box.js +++ b/component/admission-box/admission-box.js @@ -46,7 +46,7 @@ Component({ */ methods: { getAdmissionsOfficer() { - util.wxget("/api/project.other/admissionOfficerIn").then(res => { + util.wxget("https://api.gter.net/v1/program/admissionOfficerIn").then(res => { if (res.code != 200) return const data = res.data || [] const today = new Date() diff --git a/pages/projectAllList/projectAllList.js b/pages/projectAllList/projectAllList.js index 456c248..01cd03f 100644 --- a/pages/projectAllList/projectAllList.js +++ b/pages/projectAllList/projectAllList.js @@ -97,7 +97,7 @@ Page({ // 专业 getMajorRanking() { - util.wxget("/api/ranking/getMajorRanking", {}).then(res => { + util.wxget("https://api.gter.net/v1/ranking/getMajorRanking", {}).then(res => { if (res.code != 200) return const data = res.data let list = data.list || [] @@ -160,7 +160,7 @@ Page({ // 综合 getComprehensiveRanking() { - util.wxget("/api/ranking/getComprehensiveRanking", {}).then(res => { + util.wxget("https://api.gter.net/v1/ranking/getComprehensiveRanking", {}).then(res => { if (res.code != 200) return const data = res.data this.setData({ @@ -175,7 +175,7 @@ Page({ wx.showLoading({ title: '加载中...', }) - util.wxget("/api/project.rankings", {}).then(res => { + util.wxget("https://api.gter.net/v1/program/rankings", {}).then(res => { if (res.code != 200) return const data = res.data diff --git a/pages/projectComparison/projectComparison.js b/pages/projectComparison/projectComparison.js index fcfe92a..ecc57f7 100644 --- a/pages/projectComparison/projectComparison.js +++ b/pages/projectComparison/projectComparison.js @@ -16,6 +16,7 @@ Page({ islogin: false, isloginBtnState: false, // 登录弹窗的状态 informationState: false, // 授权后可能需要弹出完成信息框 个人背景那些 + briefness: false, // 是否开启头部的简单模式 isquick: false, // 快速保存按钮显示 @@ -43,7 +44,7 @@ Page({ schoolList: [], schoolPitch: {}, - schoolValue: [], + schoolValue: {}, projectList: [], projectPitch: {}, @@ -96,6 +97,7 @@ Page({ rankingsObj, disciplineObj: obj, }) + this.initData() }) }) @@ -108,51 +110,90 @@ Page({ this.setData({ loading: true, }) - util.wxpost("/api/project.contrast", { + let url = "https://api.gter.net/v1/program/contrast" + util.wxpost(url, { projectid: this.ids, }).then(res => { if (res.code != 200) return const data = res.data const list = data.data || [] - let allArr = [] list.forEach(element => allArr.push(common.decodeKey(element))) const obj = this.data.disciplineObj + // console.log("obj", obj); Promise.allSettled(allArr).then(res => { - console.log("res", res); let list = [] res.forEach(element => list.push(element.status === "fulfilled" ? element.value : {})); list.forEach(element => { - element['tuition_fee_text'] = common.formatNumberWithSpaces(element['tuition_fee'] || '') - element['admission_deposit_text'] = common.formatNumberWithSpaces(element['admission_deposit'] || '') + element['result_date'] = element['admissions'][0].remarks_zh - if (element.language_of_instruction) { - let strOutput = element.language_of_instruction.join(','); + if (element.accreditations) { + element['accreditation'] = "" + element.accreditations.forEach(ele => { + element['accreditation'] += '- ' + ele.body_full_zh + '\n' + }) + } + + element['concentration'] = "" + if (element.details?.career_fields) { + element.details.career_fields.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` + }) + } + }) + } + }) + + let documents_required = "" + element.documents.forEach(ele => { + documents_required += '- ' + ele.details + '\n' + }) + element['documents_required'] = documents_required + + element['entrance_requirements'] = element.admission_requirements[0]['basic_requirements'] + + element['tuition_fee_text'] = common.formatNumberWithSpaces(element.admissions?.[0]?.tuition_fee ? element.admissions[0].tuition_fee + '' : '') + + element['admission_deposit_text'] = common.formatNumberWithSpaces(element.admissions?.[0]?.admission_deposit ? 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 } - let scores = element.language_proficiency_scores || [] + element['period'] = element.details.full_time_normal_year ? (element.details.full_time_normal_year + '年') : '_' - const scoresList = common.scoresList(scores) + if (element.details.language_of_instruction) { + let strOutput = element.details.language_of_instruction.join(','); + element['language_of_instruction_text'] = strOutput + } - element["english_proficiency_text"] = "" - scoresList.forEach(ele => { - element["english_proficiency_text"] += `・ ${ele.name}:${ele.text}; \n` - }) + // let scores = element.language_proficiency_scores || [] - // if (Array.isArray(element.english_proficiency)) { - // const english = element.english_proficiency - // let text = "" - // english.forEach(element => { - // text += `・${element.name_zh}(${element.name_en}) ${element.total}分以上 \n` - // }) - // element['english_proficiency_text'] = text - // } + // const scoresList = common.scoresList(scores) - if (element.scholarship) element['scholarshipText'] = this.JudgmentScholarshipText(element.scholarship) + // element["english_proficiency_text"] = "" + // scoresList.forEach(ele => { + // element["english_proficiency_text"] += `・ ${ele.name}:${ele.text}; \n` + // }) + + // if (element.scholarship) element['scholarshipText'] = this.JudgmentScholarshipText(element.scholarship) element['disciplinename'] = obj[element.disciplineid] || '' }) + this.setData({ isquick: data.isquick, list, @@ -180,6 +221,8 @@ Page({ year: element.year, }) }) + + // console.log("schoolArr", schoolArr); const schoolList = this.removeDuplicates(schoolArr) this.setData({ projectList, @@ -242,7 +285,6 @@ Page({ // 去掉重复 removeDuplicates(arr) { - console.log("arr", arr); const uniqueSet = new Set(); const uniqueArray = []; arr.forEach(item => { @@ -360,7 +402,7 @@ Page({ wx.showLoading({ title: '加载中...', }) - util.wxpost("/api/project.user", { + util.wxpost("https://api.gter.net/v1/program/user", { limit: 2000, }).then(res => { if (res.code != 200) return @@ -387,7 +429,7 @@ Page({ }) return } - util.wxpost("/api/project.contrast/addQuick", { + util.wxpost("https://api.gter.net/v1/program/addQuick", { projectid: this.ids }).then(res => { common.toast(res.message) @@ -407,6 +449,7 @@ Page({ showObj, }) }, + userClickLogin(e) { let data = e.detail.data this.setData({ diff --git a/pages/projectComparison/projectComparison.wxml b/pages/projectComparison/projectComparison.wxml index 23751a0..363a63c 100644 --- a/pages/projectComparison/projectComparison.wxml +++ b/pages/projectComparison/projectComparison.wxml @@ -13,7 +13,8 @@ {{ item.schoolalias }} - {{ item.semester.text }} + + {{ item.newest }} @@ -31,7 +32,7 @@ - + 专业排名 {{ rankingKey[projectPitch.system] || projectPitch.system }}世界专业排名({{ projectPitch.year }}) @@ -93,7 +94,7 @@ 奖学金 - + @@ -102,7 +103,7 @@ 一般学习时长 - + @@ -185,7 +186,7 @@ 是否含论文课程 - + @@ -194,7 +195,7 @@ 是否含项目课程 - + @@ -203,7 +204,7 @@ 是否含实习课程 - + diff --git a/pages/projectDetails/projectDetails.js b/pages/projectDetails/projectDetails.js index 94e453d..9ec9788 100644 --- a/pages/projectDetails/projectDetails.js +++ b/pages/projectDetails/projectDetails.js @@ -766,7 +766,7 @@ Page({ getOfferData() { if (this.data.offerPage == 0) return - util.wxget(`https://api.gter.net/v1/program/offerList?limit=5&projectid=${ this.data.info.id }&page=${ this.data.offerPage }`).then(res => { + util.wxget(`https://api.gter.net/v1/program/offerList?limit=10&projectid=${ this.data.info.id }&page=${ this.data.offerPage }`).then(res => { const data = res.data const list = data.list || [] let side = this.data.side diff --git a/pages/projectDetails/projectDetails.wxml b/pages/projectDetails/projectDetails.wxml index 872a853..16bb444 100644 --- a/pages/projectDetails/projectDetails.wxml +++ b/pages/projectDetails/projectDetails.wxml @@ -504,7 +504,7 @@ 录取参考 - + {{ item.schoolname }} @@ -542,13 +542,9 @@ {{ item.timestamp }} - - - - - + - + {{ item.view || 0 }} @@ -765,10 +761,14 @@ 榜单 - + + Offer榜 - + + + diff --git a/pages/projectLibrary/projectLibrary.js b/pages/projectLibrary/projectLibrary.js index 0c7f644..46f6893 100644 --- a/pages/projectLibrary/projectLibrary.js +++ b/pages/projectLibrary/projectLibrary.js @@ -98,7 +98,7 @@ Page({ }, bannerData() { - util.wxget("/api/project.banner").then(res => { + util.wxget("https://api.gter.net/v1/program/getBanner").then(res => { if (res.code != 200) return const data = res.data || [] this.setData({ @@ -261,7 +261,7 @@ Page({ wx.showLoading({ title: '加载中...', }) - util.wxget("/api/project.other/todayFateProject").then(res => { + util.wxget("https://api.gter.net/v1/program/todayFateProject").then(res => { if (res.code != 200) return let data = res.data || [] @@ -294,7 +294,7 @@ Page({ // 获取 招生官项目 getAdmission() { - util.wxget("/api/project.lists", { + util.wxget("https://api.gter.net/v1/program/getList", { limit: 20, page: 1, admissionsproject: 1, @@ -331,7 +331,7 @@ Page({ wx.showLoading({ title: '加载中...', }) - util.wxget("/api/project.lists", { + util.wxget("https://api.gter.net/v1/program/getList", { limit: 20, page: this.data.page, }).then(res => { @@ -395,7 +395,7 @@ Page({ }); } - let url = "/api/project.contrast/add" + let url = "https://api.gter.net/v1/program/addContrast" util.wxpost(url, { projectid: id @@ -638,7 +638,7 @@ Page({ const id = e.currentTarget.dataset.id const type = e.currentTarget.dataset.type - util.wxpost("/api/project.contrast/add", { + util.wxpost("https://api.gter.net/v1/program/addContrast", { projectid: id }).then(res => { if (res.code != 200) return @@ -796,7 +796,7 @@ Page({ }, getRankingData() { - util.wxpost("/api/ranking/homeRankingRecommend").then(res => { + util.wxpost("https://api.gter.net/v1/ranking/homeRankingRecommend").then(res => { if (res.code != 200) { common.toast(res.message || '') return diff --git a/pages/projectList/projectList.js b/pages/projectList/projectList.js index 5019bf7..2f9193c 100644 --- a/pages/projectList/projectList.js +++ b/pages/projectList/projectList.js @@ -106,7 +106,7 @@ Page({ wx.showLoading({ title: '加载中...', }) - util.wxget("/api/project.rankings/comprehensive", { + util.wxget("https://api.gter.net/v1/program/comprehensiverankings", { token: com['token'] || comDefault['token'], ishongkong: this.data.comOnly || 0, limit: 2000, @@ -153,7 +153,7 @@ Page({ }) let majDefault = this.data.majDefault let maj = this.data.maj - util.wxget("/api/project.rankings/discipline", { + util.wxget("https://api.gter.net/v1/program/disciplinerankings", { token: maj['token'] || majDefault['token'], ishongkong: this.data.majOnly || 0, }).then(res => { @@ -192,7 +192,7 @@ Page({ wx.showLoading({ title: '加载中...', }) - util.wxget("/api/project.rankings", {}).then(res => { + util.wxget("https://api.gter.net/v1/program/rankings", {}).then(res => { if (res.code != 200) return const data = res.data diff --git a/pages/projectMy/projectMy.js b/pages/projectMy/projectMy.js index 91ec0f0..b7aa695 100644 --- a/pages/projectMy/projectMy.js +++ b/pages/projectMy/projectMy.js @@ -113,7 +113,7 @@ Page({ title: '加载中...', }) - util.wxpost("/api/project.user", { + util.wxpost("https://api.gter.net/v1/program/user", { limit: 2000, page: obj.page || 1, typeid: obj.typeid || '', @@ -150,7 +150,7 @@ Page({ // 获取快速列表 getQuickList() { - util.wxget("/api/project.contrast/getQuickList", {}).then(res => { + util.wxget("https://api.gter.net/v1/program/getQuickList", {}).then(res => { if (res.code != 200) return const data = res.data const quickList = data || [] @@ -460,7 +460,7 @@ Page({ newId.push(obj.projectid) }); - util.wxpost("/api/project.user/changeSorting", { + util.wxpost("https://api.gter.net/v1/program/changeProjectSorting", { projectids: newId }).then(res => common.toast(res.message)) }, @@ -533,7 +533,7 @@ Page({ // 发送 备注 postRemarks(token, remarks) { - util.wxpost("/api/project.user/remarks", { + util.wxpost("https://api.gter.net/v1/program/remarksProject", { token, remarks, }).then(res => common.toast(res.message)) @@ -605,7 +605,7 @@ Page({ const index = e.currentTarget.dataset.index const quickList = this.data.quickList - util.wxpost("/api/project.contrast/deleteQuick", { + util.wxpost("https://api.gter.net/v1/program/deleteQuick", { id }).then(res => { quickList.splice(index, 1) @@ -663,7 +663,7 @@ Page({ let list = this.data.list const target = list[index] - util.wxpost("/api/project.user/delete", { + util.wxpost("https://api.gter.net/v1/program/deleteProject", { token: target.token, }).then(res => { if (res.code != 200) return @@ -714,7 +714,7 @@ Page({ const list = this.data.list || [] const target = JSON.parse(JSON.stringify(list[index])) || {} - util.wxpost("/api/project.user/changeType", { + util.wxpost("https://api.gter.net/v1/program/changeProjectType", { token: target.token, typeid, }).then(res => { @@ -787,7 +787,7 @@ Page({ const index = e.currentTarget.dataset.index const projectid = e.currentTarget.dataset.projectid - util.wxpost("/api/project.contrast/delete", { + util.wxpost("https://api.gter.net/v1/program/deleteContrast", { projectid }).then(res => { if (res.code != 200) return diff --git a/pages/projectSchoolHomepage/projectSchoolHomepage.js b/pages/projectSchoolHomepage/projectSchoolHomepage.js index 938bd7a..814578d 100644 --- a/pages/projectSchoolHomepage/projectSchoolHomepage.js +++ b/pages/projectSchoolHomepage/projectSchoolHomepage.js @@ -100,7 +100,7 @@ Page({ wx.showLoading({ title: '加载中...', }) - util.wxget("/api/project.university/getInfo", { + util.wxget("https://api.gter.net/v1/program/getUniversityInfo", { id: this.data.id, }).then(res => { if (res.code != 200) return @@ -142,7 +142,7 @@ Page({ if (this.data.page == 0 || this.loading) return this.loading = true - util.wxget("/api/project.lists", { + util.wxget("https://api.gter.net/v1/program/getList", { limit: 2000, page: this.data.page, sid: this.data.id, @@ -341,8 +341,8 @@ Page({ }); } - let url = "/api/project.contrast/add" - if (status == 1) url = "/api/project.contrast/delete" + let url = "https://api.gter.net/v1/program/addContrast" + if (status == 1) url = "https://api.gter.net/v1/program/deleteContrast" util.wxpost(url, { projectid: id @@ -528,7 +528,7 @@ Page({ const index = e.currentTarget.dataset.index const id = e.currentTarget.dataset.id - let url = "/api/project.contrast/add" + let url = "https://api.gter.net/v1/program/addContrast" util.wxpost(url, { projectid: id diff --git a/pages/projectSubjectList/projectSubjectList.js b/pages/projectSubjectList/projectSubjectList.js index 38fb8e7..bac842b 100644 --- a/pages/projectSubjectList/projectSubjectList.js +++ b/pages/projectSubjectList/projectSubjectList.js @@ -102,7 +102,7 @@ Page({ }) this.loading = true - util.wxget("/api/project.lists", { + util.wxget("https://api.gter.net/v1/program/getList", { limit: 2000, disciplineid: this.data.id, sid: this.data.sid, @@ -273,8 +273,8 @@ Page({ }); // } - let url = "/api/project.contrast/add" - if (status == 1) url = "/api/project.contrast/delete" + let url = "https://api.gter.net/v1/program/addContrast" + if (status == 1) url = "https://api.gter.net/v1/program/deleteContrast" util.wxpost(url, { projectid: id @@ -367,7 +367,7 @@ Page({ const index = e.currentTarget.dataset.index const id = e.currentTarget.dataset.id - util.wxpost("/api/project.contrast/add", { + util.wxpost("https://api.gter.net/v1/program/addContrast", { projectid: id }).then(res => { if (res.code != 200) return diff --git a/pages/search/search.js b/pages/search/search.js index 9275f4b..a0e8b11 100644 --- a/pages/search/search.js +++ b/pages/search/search.js @@ -235,7 +235,7 @@ Page({ wx.showLoading() let url = "/miniprogramApi/offer/search/lists" - if (this.data.type == 'xg') url = '/api/project.lists' + if (this.data.type == 'xg') url = 'https://api.gter.net/v1/program/getList' util.wxpost(url, { page, @@ -319,9 +319,8 @@ Page({ handleClick(e) { const index = e.currentTarget.dataset.index const id = e.currentTarget.dataset.id - const random = e.currentTarget.dataset.random - util.wxpost("/api/project.contrast/add", { + util.wxpost("https://api.gter.net/v1/program/addContrast", { projectid: id }).then(res => { if (res.code != 200) return @@ -380,7 +379,7 @@ Page({ const index = e.currentTarget.dataset.index const id = e.currentTarget.dataset.id - util.wxpost("/api/project.contrast/add", { + util.wxpost("https://api.gter.net/v1/program/addContrast", { projectid: id }).then(res => { if (res.code != 200) return diff --git a/project.private.config.json b/project.private.config.json index 24f307a..168304e 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": true + "urlCheck": false }, "condition": { "miniprogram": { diff --git a/utils/commonMethod.js b/utils/commonMethod.js index 42de7bd..2541cdd 100644 --- a/utils/commonMethod.js +++ b/utils/commonMethod.js @@ -48,7 +48,7 @@ function xgBasicData(that, app, isindex = false) { return } - util.wxget("/api/project.home/basicData").then(res => { + util.wxget("https://api.gter.net/v1/program/basicData").then(res => { if (res.code != 200) return const data = res.data const basicData = { @@ -75,6 +75,8 @@ function formatNumberWithSpaces(number) { function decodeKey(encrypted, key) { return new Promise((resolve, reject) => { try { + if (typeof encrypted != "string") resolve(encrypted) + const app = getApp() var decodekey = app.globalData.basicData.encodekey const encryptedData = CryptoJS.enc.Base64.parse(encrypted)