学校详情跳转综合排名

This commit is contained in:
A1300399510 2025-02-13 19:04:57 +08:00
parent 255a93c3d4
commit 1c0feaa153
6 changed files with 47 additions and 14 deletions

View File

@ -184,7 +184,7 @@ Page({
const info = data.info || {} const info = data.info || {}
const fields = ['tuition_fee',]; const fields = ['tuition_fee', ];
fields.forEach(field => { fields.forEach(field => {
const textKey = `${field}_text`; const textKey = `${field}_text`;
info[textKey] = common.formatNumberWithSpaces(info[field] || ''); info[textKey] = common.formatNumberWithSpaces(info[field] || '');
@ -711,7 +711,7 @@ Page({
item['system'] = encodeURIComponent(item['system']) item['system'] = encodeURIComponent(item['system'])
item['subject'] = encodeURIComponent(item['subject']) item['subject'] = encodeURIComponent(item['subject'])
wx.navigateTo({ wx.navigateTo({
url: `/pages/projectList/projectList?year=${ item.year }&system=${item.system}&subject=${item.subject}`, url: `/pages/projectList/projectList?type=subject&year=${ item.year }&system=${item.system}&subject=${item.subject}`,
}) })
}, },
}) })

View File

@ -78,8 +78,10 @@
<view style="height: 100%" class="details-box flex1" scroll-y="{{ true }}" scroll-with-animation="{{ scrollAnimation }}"> <view style="height: 100%" class="details-box flex1" scroll-y="{{ true }}" scroll-with-animation="{{ scrollAnimation }}">
<!-- 招生官 --> <!-- 招生官 -->
<view class="side-item" data-type="pivotal"> <view class="side-item" data-type="pivotal">
<image wx:if="{{ urls.length != 0 && answerType == 0 }}" class="quick-answer" src="https://app.gter.net/image/miniApp/offer/quick-answer.png" mode="widthFix" bind:tap="cutQuickAnswer"></image> <block wx:if="{{ urls.length != 0 && answerType == 0 }}">
<view class="borderTop"></view> <image class="quick-answer" src="https://app.gter.net/image/miniApp/offer/quick-answer.png" mode="widthFix" bind:tap="cutQuickAnswer"></image>
<view class="borderTop"></view>
</block>
<view class="semester-box flexacenter "> <view class="semester-box flexacenter ">
<view class="text gray {{ info.semesterState ? 'semester' : '' }}">{{ info.semester.text || '' }}</view> <view class="text gray {{ info.semesterState ? 'semester' : '' }}">{{ info.semester.text || '' }}</view>

View File

@ -68,7 +68,7 @@ Page({
universityArr, universityArr,
}) })
if (JSON.stringify(options) != "{}") { if (options.type == 'subject') {
let discipline = this.data.discipline || {} let discipline = this.data.discipline || {}
discipline["yearKey"] = options.year + "" discipline["yearKey"] = options.year + ""
discipline["organizationKey"] = this.decodeKey(options.system) discipline["organizationKey"] = this.decodeKey(options.system)
@ -79,6 +79,16 @@ Page({
}) })
} }
if (options.type == 'school') {
let comprehensive = this.data.comprehensive
comprehensive["yearKey"] = options.year + ""
comprehensive['organizationKey'] = this.decodeKey(options.mechanism)
this.setData({
classify: "school",
comprehensive,
})
}
this.getRankings() this.getRankings()
}) })
}) })
@ -205,12 +215,12 @@ Page({
let comprehensiveTarget = this.data.comprehensive let comprehensiveTarget = this.data.comprehensive
let organizationSet = [...this.objectOne(comprehensive)] let organizationSet = [...this.objectOne(comprehensive)]
comprehensiveTarget['organization'] = organizationSet comprehensiveTarget['organization'] = organizationSet
comprehensiveTarget['organizationKey'] = organizationSet[0] if (!comprehensiveTarget['organizationKey']) comprehensiveTarget['organizationKey'] = organizationSet[0]
let yearsSet = [...this.collectYears(comprehensive)] let yearsSet = [...this.collectYears(comprehensive)]
yearsSet.sort((a, b) => b - a); yearsSet.sort((a, b) => b - a);
comprehensiveTarget['yearKey'] = yearsSet[0] if (!comprehensiveTarget['yearKey']) comprehensiveTarget['yearKey'] = yearsSet[0]
comprehensiveTarget['obj'] = comprehensive comprehensiveTarget['obj'] = comprehensive
this.checkComprehensiveYear() this.checkComprehensiveYear()

View File

@ -649,4 +649,15 @@ Page({
title: "【寄托港校项目库】- " + this.data.info.name, title: "【寄托港校项目库】- " + this.data.info.name,
} }
}, },
// 跳转专业排名
goProjectList(e) {
const rankings = this.data.info.ranks || []
const index = e.currentTarget.dataset.index
let item = rankings[index]
item['mechanism'] = encodeURIComponent(item['mechanism'])
wx.navigateTo({
url: `/pages/projectList/projectList?type=school&year=${ item.year }&mechanism=${item.mechanism}`,
})
},
}) })

View File

@ -9,14 +9,14 @@
<view class="right flex1 flexflex"> <view class="right flex1 flexflex">
<view class="name">{{ info.name }}</view> <view class="name">{{ info.name }}</view>
<view class="english">{{ info.enname }}</view> <view class="english">{{ info.enname }}</view>
<view wx:if="{{ info.ranks.length != 0 }}" class="world" bind:tap="goPage" data-url="/pages/projectList/projectList"> <view wx:if="{{ info.ranks.length != 0 }}" class="world" >
<view class="head flexcenter"> <view class="head flexcenter">
<view class="icon flexcenter"> <view class="icon flexcenter">
<image class="img" src="https://app.gter.net/image/miniApp/offer/world-ranking-icon.png" mode="widthFix"></image> <image class="img" src="https://app.gter.net/image/miniApp/offer/world-ranking-icon.png" mode="widthFix"></image>
</view> </view>
</view> </view>
<view class="list flexacenter"> <view class="list flexacenter">
<view class="item" wx:for="{{ info.ranks }}" wx:key="index"> <view class="item" wx:for="{{ info.ranks }}" wx:key="index" bind:tap="goProjectList" data-index="{{ index }}">
<view class="quantity">{{ item.ranktext }}</view> <view class="quantity">{{ item.ranktext }}</view>
<view class="ranking-name"> <view class="ranking-name">
{{ item.mechanism }} {{ item.mechanism }}
@ -28,10 +28,6 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view wx:else class="ranking-box flexacenter">
QS世界综合排名 [2024]
<view class="sum">16</view>
</view> -->
</view> </view>
</view> </view>
<rich-text id="rich-text" class="brief" nodes="{{ info.message }}"></rich-text> <rich-text id="rich-text" class="brief" nodes="{{ info.message }}"></rich-text>

View File

@ -8,6 +8,20 @@
"condition": { "condition": {
"miniprogram": { "miniprogram": {
"list": [ "list": [
{
"name": "pages/projectList/projectList",
"pathName": "pages/projectList/projectList",
"query": "type=school&year=2024&mechanism=QS",
"launchMode": "default",
"scene": null
},
{
"name": "pages/projectSchoolHomepage/projectSchoolHomepage",
"pathName": "pages/projectSchoolHomepage/projectSchoolHomepage",
"query": "id=312",
"launchMode": "default",
"scene": null
},
{ {
"name": "pages/projectDetails/projectDetails", "name": "pages/projectDetails/projectDetails",
"pathName": "pages/projectDetails/projectDetails", "pathName": "pages/projectDetails/projectDetails",