排名测试修改

This commit is contained in:
DESKTOP-RQ919RC\Pc 2025-03-05 19:08:04 +08:00
parent be2dfd313e
commit e177d0db15
20 changed files with 325 additions and 455 deletions

View File

@ -1,4 +1,5 @@
// template/project-list-screen/project-list-screen.js
import common from '../../utils/commonMethod'
Component({
/**
@ -10,7 +11,7 @@ Component({
type: Object,
observer(res) {
if (!res || JSON.stringify(res) == "{}") return
this.comJGToYear()
this.initCom()
},
},
@ -20,7 +21,8 @@ Component({
type: Object,
observer(res) {
if (!res || JSON.stringify(res) == "{}") return
this.majJgList()
// this.majJgList()
this.initMaj()
}
},
maj: Object,
@ -36,28 +38,52 @@ Component({
majJgList: [], // 专业的 机构列表
majMajorList: [], // 专业的 专业列表
majYearList: [], // 专业的 年份列表
rankingKey: {
"Shanghai Ranking": "软科",
"Times Higher Education": "泰晤士",
"times": "泰晤士",
"USNEWS": "U.S. News",
"US News": "U.S. News",
},
},
/**
* 组件的方法列表
*/
methods: {
// 初始化综合
initCom() {
const option = this.data.comOption || {}
let comJgList = Object.keys(option) || []
const jg = comJgList[0]
let comYearList = Object.keys(option[jg]).sort((a, b) => b - a)
this.setData({
comJgList,
comYearList,
})
},
// 综合 通过机构 计算 出年份
comJGToYear() {
const com = this.data.com
const option = this.data.comOption || {}
console.log("com", com, "option", option);
const jg = com.jg || Object.keys(option)[0]
let comJgList = Object.keys(option)
const jg = com.jg
let year = com.year
// let comJgList = Object.keys(option)
let comYearList = Object.keys(option[jg]).sort((a, b) => b - a)
if (!comYearList.includes(year)) year = ""
this.setData({
comJgList,
// comJgList,
comYearList,
com: {
jg,
year: comYearList[0],
}
[`com.year`]: year,
// [`com.jg`]: jg,
// com: {
// jg,
// year: comYearList[0],
// }
})
},
@ -91,6 +117,37 @@ Component({
this.majJgToMajor()
},
initMaj() {
const option = this.data.majOption
const allMajor = Object.values(option).flatMap(institutionData => Object.keys(institutionData));
const majMajorList = [...new Set(allMajor)].sort((a, b) => {
if (a < b) return -1;
if (a > b) return 1;
return 0;
});
const maj = this.data.maj
if (maj.jg) {
if (maj.major) this.majMajorToJG()
let majYearList = option[maj.jg][maj.major] || []
majYearList = Object.keys(majYearList).sort((a, b) => b - a)
this.setData({
majMajorList,
majYearList,
})
} else {
let majJgList = Object.keys(option)
let majYearList = option[majJgList[0]][majMajorList[0]] || []
majYearList = Object.keys(majYearList).sort((a, b) => b - a)
this.setData({
majMajorList,
majYearList,
majJgList,
})
}
},
// 专业 通过 机构 算出 专业列表
majJgToMajor() {
const maj = this.data.maj
@ -107,9 +164,37 @@ Component({
// 专业 通过专业 算出 年份列表
majMajorToYear() {
const maj = this.data.maj
const option = this.data.majOption[maj.jg][maj.major] || {}
const majOption = this.data.majOption
const option = majOption[maj.jg][maj.major] || {}
console.log("option", this.data.majOption);
let target = {}
// if (maj.jg) {
// target = majOption[maj.jg]
// for (const key in target) {
// if (Object.hasOwnProperty.call(target, key)) {
// const element = target[key];
// console.log("key", key);
// if () {
// }
// }
// }
// }
// // console.log("target", target);
// return
// for (const key in majOption) {
// if (Object.hasOwnProperty.call(majOption, key)) {
// const element = majOption[key];
// }
// }
let majYearList = Object.keys(option).sort((a, b) => b - a) || []
const year = maj.year || majYearList[0]
let year = maj.year
if (!majYearList.includes(year)) year = ""
this.setData({
majYearList,
[`maj.year`]: year,
@ -119,15 +204,21 @@ Component({
// 专业 选择 机构
selectMajJg(e) {
const jg = e.currentTarget.dataset.key
const maj = this.data.maj
let year = maj.year
this.setData({
maj: {
jg,
major: "",
year: "",
}
['maj.jg']: jg,
// maj: {
// jg,
// major: "",
// year: "",
// }
})
this.majJgToMajor()
// this.majJgToMajor()
if (maj.major && maj.jg) this.majMajorToYear()
},
// 打开专业弹窗
@ -140,17 +231,46 @@ Component({
// 选择专业弹窗的关闭
closeselect(e) {
const major = e.detail?.value || ""
const maj = this.data.maj
this.setData({
screenState: true,
})
console.log("major", major);
if (major) {
this.setData({
['maj.major']: major,
['maj.year']: "",
})
this.majMajorToYear()
if (!major) return
this.setData({
['maj.major']: major,
})
console.log("major", major);
this.majMajorToJG()
if (major && maj.jg) this.majMajorToYear()
},
// 专业 通过专业 算出 机构
majMajorToJG() {
const option = this.data.majOption
let maj = this.data.maj
let major = maj.major
let majJgList = []
for (const key in option) {
if (Object.hasOwnProperty.call(option, key)) {
const element = option[key];
for (const k in element) {
if (k == major) majJgList.push(key)
}
}
}
let jg = maj.jg
if (!majJgList.includes(jg)) jg = ""
this.setData({
majJgList,
['maj.jg']: jg,
})
},
// 选择专业的年份
@ -170,16 +290,31 @@ Component({
haveChosen() {
const classify = this.data.classify
if (classify == "school") {
let hint = ""
const com = this.data.com
const comOption = this.data.comOption
if (!com['jg']) hint = "请选择机构"
else if (!com['year']) hint = "请选择年份"
if (hint) {
common.toast(hint)
return
}
com['token'] = comOption[com.jg][com.year]
this.triggerEvent("haveChosen", this.data.com)
} else {
let hint = ""
let maj = this.data.maj
const majOption = this.data.majOption
if (!maj['major']) hint = "请选择专业"
else if (!maj['jg']) hint = "请选择机构"
else if (!maj['year']) hint = "请选择年份"
if (hint) {
common.toast(hint)
return
}
maj['token'] = majOption[maj.jg][maj.major][maj.year]
this.triggerEvent("haveChosen", this.data.maj)
}
this.triggerEvent("haveChosen", this.data.classify == "school" ? this.data.com : this.data.maj)
},
}
})

View File

@ -1,12 +1,12 @@
<!--template/project-list-screen/project-list-screen.wxml-->
<view class="screen-mask" wx:if="{{ screenState }}" bind:tap="cutScreenState">
<view class="screen-mask" wx:if="{{ screenState }}" bind:tap="cutScreenState" catch:touchmove="return">
<view class="screen-box" catch:tap="return">
<view class="head">请选择</view>
<block wx:if="{{ classify == 'school' }}">
<view class="box">
<view class="title">评榜机构</view>
<view class="list flexflex">
<view class="item flexcenter {{ item == com.jg ? 'pitch' : '' }}" bind:tap="selectComJg" data-key="{{ item }}" wx:for="{{ comJgList }}" wx:key="index">{{ item }}</view>
<view class="item flexcenter {{ item == com.jg ? 'pitch' : '' }}" bind:tap="selectComJg" data-key="{{ item }}" wx:for="{{ comJgList }}" wx:key="index">{{ rankingKey[item] || item }}</view>
</view>
</view>
<view class="box">
@ -17,12 +17,6 @@
</view>
</block>
<block wx:else>
<view class="box">
<view class="title">评榜机构</view>
<view class="list flexflex">
<view class="item flexcenter {{ item == maj.jg ? 'pitch' : '' }}" bind:tap="selectMajJg" data-key="{{ item }}" wx:for="{{ majJgList }}" wx:key="index">{{ item }}</view>
</view>
</view>
<view class="box">
<view class="title">专业</view>
<view class="major-box flexacenter" bind:tap="opneMajorPop">
@ -31,6 +25,12 @@
<image class="icon" mode="widthFix" src="https://app.gter.net/image/miniApp/offer/arrows-yellow-green.svg"></image>
</view>
</view>
<view class="box">
<view class="title">评榜机构</view>
<view class="list flexflex">
<view class="item flexcenter {{ item == maj.jg ? 'pitch' : '' }}" bind:tap="selectMajJg" data-key="{{ item }}" wx:for="{{ majJgList }}" wx:key="index">{{ rankingKey[item] || item }}</view>
</view>
</view>
<view class="box">
<view class="title">年份</view>
<view class="list flexflex">

View File

@ -35,16 +35,8 @@ Component({
const key = e.currentTarget.dataset.key
const value = e.currentTarget.dataset.value || {}
let yearList = []
for (const key in value) {
yearList.push(key)
}
this.triggerEvent('closeselect', {
key,
yearList,
value,
})
},

View File

@ -3,10 +3,10 @@
<view class="box" catch:tap="return">
<view class="title">{{ titleObj[type] }}</view>
<scroll-view class="list" scroll-y="{{ true }}" style="max-height: 65vh;">
<view class="item {{ value === index ? 'pitch' : '' }}" wx:for="{{ list }}" wx:key="index" catch:tap="{{ type == 'subject2' || type == 'subject' || type == 'school' ? 'selectSchool' : 'select'}}" data-key="{{ index }}" data-value="{{ item }}" data-label="{{ item.name }}" data-disciplineid="{{ item.disciplineid }}" data-university="{{ item.value }}">
<view class="item {{ value === index ? 'pitch' : '' }} {{ (type == 'major' && value === item) ? 'pitch' : '' }}" wx:for="{{ list }}" wx:key="index" catch:tap="{{ type == 'subject2' || type == 'subject' || type == 'school' ? 'selectSchool' : 'select'}}" data-key="{{ index }}" data-value="{{ item }}" data-label="{{ item.name }}" data-disciplineid="{{ item.disciplineid }}" data-university="{{ item.value }}">
<view class="dot"></view>
<view class="content">
<view class="name">{{ type == 'subject2' ? item.label : (item.value || item.name || index) }}</view>
<view class="name">{{ type == 'subject2' ? item.label : type == 'major' ? item : (item.value || item.name || index) }}</view>
<view class="sum" wx:if="{{ (type == 'subject' || type == 'school') && item.count > 0 }}">{{ item.count }}</view>
</view>
</view>

View File

@ -14,12 +14,9 @@ Page({
islogin: false, //是否登录
isloginBtnState: false, // 登录弹窗的状态
realizeState: false, // 了解弹窗状态
user: {},
classifyType: "school", // school subject
classify: "school", // school subject
comData: [],
com: {},
comOption: {},
@ -29,18 +26,7 @@ Page({
majOption: {},
majSum: 0,
majObj: {},
list: [{}, {}, {}, ],
rankingObj: {
"QS": "ranking-qs-icon.png",
"USNEWS": "ranking-us-icon.png",
"泰晤士": "ranking-times-icon.png",
"软科": "ranking-soft-icon.png",
"麦考林": "ranking-macleans-icon.png",
},
rankingskeyVlaue: {},
majPitch: {
major: "",
organ: "",
@ -70,14 +56,19 @@ Page({
text: "以全面和权威著称,主要关注加拿大国内大学的综合表现,并将大学分为医博类、综合类和基础类",
}],
letterList: {}, // 字母列表
screen_data: {},
letterKey: "A",
letterFixed: false,
isFirstPattern: true, // 是否是首屏模式
rankingKey: {
"Shanghai Ranking": "软科",
"Times Higher Education": "泰晤士",
"times": "泰晤士",
"USNEWS": "U.S. News",
"US News": "U.S. News",
},
},
/**
@ -86,10 +77,11 @@ Page({
windowHeight: 0,
onLoad(options) {
miucms.pageStart(app).then(() => {
const screen_data = app.globalData.screen_data
const screen_data = app.globalData.screen_data
const user = app.globalData.user
this.setData({
islogin: app.globalData.user.uid > 0 ? true : false,
user: app.globalData.user,
islogin: user.uid > 0 ? true : false,
user,
screen_data,
})
@ -121,12 +113,8 @@ Page({
})
list.sort((a, b) => {
if (a.subject < b.subject) {
return -1;
}
if (a.subject > b.subject) {
return 1;
}
if (a.subject < b.subject) return -1;
if (a.subject > b.subject) return 1;
return 0;
});
@ -142,7 +130,6 @@ Page({
// 用于记录每个首字母的数量
const initialCount = {};
// 为每个对象添加首字母标识并统计首字母数量
list.forEach(item => {
const initial = item.subject[0].toUpperCase();
@ -188,67 +175,29 @@ Page({
const data = res.data
const comprehensive = data.comprehensive || {}
// const comSum = this.countKeysInNestedObjects(comprehensive)
let com = this.data.com
com['jg'] = Object.keys(comprehensive)[0]
let yearsSet = [...this.collectYears(comprehensive)].sort((a, b) => b - a);
com['year'] = yearsSet[0]
com['token'] = comprehensive[com.jg][com.year]
// let com = this.data.com
// com['jg'] = Object.keys(comprehensive)[0]
// let yearsSet = [...this.collectYears(comprehensive)].sort((a, b) => b - a);
// com['year'] = yearsSet[0]
const discipline = data.discipline || {}
// const majSum = this.countKeysInNestedObjects(discipline)
// const majObj = this.transform(discipline)
let maj = this.data.maj
const [dOrganizationKey, dOrganizationValue] = Object.entries(discipline)[0]
maj['jg'] = dOrganizationKey
maj['major'] = Object.entries(dOrganizationValue)[0][0]
const dYear = [...this.collectYears(discipline)].sort((a, b) => b - a);
maj['year'] = dYear[0]
maj['token'] = discipline[maj.jg][maj.major][maj.year]
// let maj = this.data.maj
// const [dOrganizationKey, dOrganizationValue] = Object.entries(discipline)[0]
// maj['jg'] = dOrganizationKey
// maj['major'] = Object.entries(dOrganizationValue)[0][0]
// const dYear = [...this.collectYears(discipline)].sort((a, b) => b - a);
// maj['year'] = dYear[0]
this.setData({
comOption: comprehensive,
// comSum,
com,
// com,
majOption: discipline,
// majSum,
// majObj,
maj,
// maj,
isInitFinish: true,
})
}).finally(() => wx.hideLoading())
},
transform(input) {
const result = {};
const subjectMap = new Map();
// 收集学科对应的机构
for (const [agency, subjects] of Object.entries(input)) {
for (const subject of Object.keys(subjects)) {
if (!subjectMap.has(subject)) subjectMap.set(subject, new Set());
subjectMap.get(subject).add(agency);
}
}
// 构建结果
for (const [agency, subjects] of Object.entries(input)) {
for (const [subject, data] of Object.entries(subjects)) {
const agencies = subjectMap.get(subject);
if (!result[subject]) result[subject] = {};
// if (agencies.size > 1) {
// console.log("99", agencies.size);
// }
result[subject][agency] = data
}
}
return result;
},
// 计算对象里对象的数量
countKeysInNestedObjects(obj) {
let count = 0;
@ -328,14 +277,6 @@ Page({
const classify = e.currentTarget.dataset.type
if (classify == this.data.classify) return
// let discipline = this.data.discipline || {}
// 切换 专业排名时 判断 是否需要 显示选择
// if (classify == 'subject' && discipline.list.length == 0) this.haveDiscipline()
// let comprehensive = this.data.comprehensive || {}
// if (classify == 'school' && comprehensive.list.length == 0) this.haveComprehensive()
this.setData({
classify,
})
@ -357,6 +298,7 @@ Page({
this.setData({
[classify == "school" ? 'com' : 'maj']: detail,
screenState: false,
classifyType: "",
})
const jg = encodeURIComponent(detail.jg || '')
@ -408,6 +350,7 @@ Page({
query.exec(res => {
if (!res) return
this.topBtnSistance = res[0].height + headHeight
res.forEach(element => {
headHeight += element.height
})
@ -429,23 +372,12 @@ Page({
jumpToIndex(e) {
const key = e.currentTarget.dataset.key
const sideHeight = this.sideHeight
console.log("sideHeight", sideHeight);
wx.pageScrollTo({
scrollTop: sideHeight[key],
})
},
// touchToIndex(e) {
// console.log("e", e);
// const key = e.target.dataset.key
// if (!key) return
// console.log("key", key);
// const sideHeight = this.sideHeight
// wx.pageScrollTo({
// scrollTop: sideHeight[key],
// })
// },
topBtnSistance: 248, //
onPageScroll(e) {
const scrollTop = e.scrollTop
const sideHeight = this.sideHeight
@ -465,16 +397,17 @@ Page({
letterKey,
})
}
// console.log("scrollTop", scrollTop, this.windowHeight / 4);
// if (scrollTop > this.windowHeight / 4) {
// this.setData({
// letterFixed: true,
// })
// } else {
// this.setData({
// letterFixed: false,
// })
// }
if (scrollTop > this.topBtnSistance && this.data.isFirstPattern) {
// 这里是 首屏的
this.setData({
isFirstPattern: false,
})
} else if (scrollTop < this.topBtnSistance && !this.data.isFirstPattern) {
this.setData({
isFirstPattern: true,
})
}
},
/**
@ -523,6 +456,17 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: "【寄托港校项目库】- 世界排行榜",
}
},
}
onShareTimeline() {
util.statistics({
name: "share-timeline"
})
return {
title: "【寄托港校项目库】- 世界排行榜",
}
},
})

View File

@ -6,7 +6,7 @@ view {
.container {
min-height: 100vh;
padding-bottom: 180rpx;
padding-bottom: 100rpx;
background-color: rgba(245, 245, 245, 1);
.header {
@ -117,7 +117,7 @@ view {
}
.all {
margin: 0 22rpx 75rpx;
margin: 0 22rpx;
border-radius: 0 0 15rpx 15rpx;
.classify {
@ -206,7 +206,7 @@ view {
.end {
font-size: 19.5rpx;
color: #D7D7D7;
padding: 100rpx 0;
padding: 60rpx 0;
text-align: center;
}
@ -215,6 +215,7 @@ view {
margin-top: -28rpx;
position: relative;
padding-top: 55.5rpx;
border-radius: 0 0 15rpx 15rpx;
.list {
padding: 0 30rpx;
@ -253,6 +254,7 @@ view {
margin-top: -28rpx;
position: relative;
padding-top: 55.5rpx;
border-radius: 0 0 15rpx 15rpx;
.letter {
// position: absolute;
@ -261,8 +263,9 @@ view {
right: 22rpx;
// transform: translateY(-50%);
position: fixed;
top: 50%;
transform: translateY(-50%);
// top: 50%;
// transform: translateY(-50%);
bottom: 80rpx;
color: #AAAAAA;
transition: all 0.3s;
@ -276,7 +279,7 @@ view {
font-size: 21rpx;
line-height: 33rpx;
padding: 0 20rpx;
text-align: center;
&.pitch {
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
@ -342,6 +345,12 @@ view {
box-shadow: 0 0 7.5rpx rgba(0, 0, 0, 0.172549019607843);
z-index: 1;
.select {
.icon {
transform: rotate(90deg);
}
}
.year {
height: auto;
}
@ -368,6 +377,7 @@ view {
width: 10rpx;
height: 9rpx;
transform: rotate(-90deg);
transition: all .3s;
}
}
@ -418,7 +428,7 @@ view {
}
.list {
padding: 0 45rpx 95rpx;
padding: 0 45rpx 150rpx;
.item {
padding: 30rpx 0;
@ -576,33 +586,4 @@ view {
}
}
}
}
// .scroll-tip {
// position: fixed;
// top: 50%;
// left: 50%;
// transform: translate(-50%, -50%);
// width: 100rpx;
// height: 100rpx;
// background: rgba(0, 0, 0, 0.7);
// color: white;
// border-radius: 50%;
// display: flex;
// align-items: center;
// justify-content: center;
// font-size: 48rpx;
// animation: scaleTip 0.3s;
// }
// @keyframes scaleTip {
// from {
// transform: translate(-50%, -50%) scale(0);
// }
// to {
// transform: translate(-50%, -50%) scale(1);
// }
// }
}

View File

@ -1,6 +1,6 @@
<!--pages/projectAllList/projectAllList.wxml-->
<view class="container">
<header-nav bgcolor="#fbfbfb" user="{{ user }}"></header-nav>
<header-nav bgcolor="#fbfbfb" user="{{ user }}">{{ isFirstPattern ? '' : '世界排行榜' }}</header-nav>
<view class="header flexflex">
<image class="medal" src="https://app.gter.net/image/miniApp/offer/medal-icon.png" mode="widthFix"></image>
@ -82,7 +82,7 @@
<view wx:else class="major">
<view class="total">共{{ majSum }}个专业排名榜单</view>
<view class="letter">
<view class="item {{ letterKey == index ? 'pitch' : '' }}" wx:for="{{ letterList }}" bind:tap="jumpToIndex" data-key="{{ index }}">{{ index }}</view>
<view class="item {{ letterKey == index ? 'pitch' : '' }}" wx:for="{{ letterList }}" bind:tap="jumpToIndex" wx:key="index" data-key="{{ index }}">{{ index }}</view>
</view>
<view class="list">
<view wx:if="{{ majPitch.major }}" class="mask" bind:tap="closeYear"></view>
@ -110,7 +110,7 @@
</view>
<!-- 了解 -->
<view class="pop flexflex" wx:if="{{ realizeState }}" bind:tap="cutRealizeState">
<view class="pop flexflex" wx:if="{{ realizeState }}" bind:tap="cutRealizeState" catch:touchmove="return">
<view class="pop-box realize-box" catch:tap="return">
<view class="name">了解评榜机构</view>
<view class="list">
@ -125,6 +125,4 @@
<go-login wx:if="{{ isloginBtnState }}" islogin="{{ islogin }}" binduserClickLogin="userClickLogin" bindpopClose="popClose"></go-login>
<perfect-information wx:if="{{ informationState }}" bindrevampInformationState="revampInformationState"></perfect-information>
<project-list-screen wx:if="{{ screenState }}" comOption="{{ comOption }}" com="{{ com }}" majOption="{{ majOption }}" maj="{{ maj }}" bind:cutScreenState="cutScreenState" bind:haveChosen="haveChosen" classify="{{ classifyType }}"></project-list-screen>
<!-- <view wx:if="{{ showScrollTip }}" class="scroll-tip">{{activeIndex}}</view> -->
</view>

View File

@ -5,7 +5,7 @@ view {
}
.container {
min-height: 100vh;
padding-bottom: 180rpx;
padding-bottom: 100rpx;
background-color: #f5f5f5;
}
.container .header {
@ -97,7 +97,7 @@ view {
margin-left: 12rpx;
}
.container .all {
margin: 0 22rpx 75rpx;
margin: 0 22rpx;
border-radius: 0 0 15rpx 15rpx;
}
.container .all .classify {
@ -175,7 +175,7 @@ view {
.container .all .end {
font-size: 19.5rpx;
color: #D7D7D7;
padding: 100rpx 0;
padding: 60rpx 0;
text-align: center;
}
.container .all .synthesis {
@ -183,6 +183,7 @@ view {
margin-top: -28rpx;
position: relative;
padding-top: 55.5rpx;
border-radius: 0 0 15rpx 15rpx;
}
.container .all .synthesis .list {
padding: 0 30rpx;
@ -211,12 +212,12 @@ view {
margin-top: -28rpx;
position: relative;
padding-top: 55.5rpx;
border-radius: 0 0 15rpx 15rpx;
}
.container .all .major .letter {
right: 22rpx;
position: fixed;
top: 50%;
transform: translateY(-50%);
bottom: 80rpx;
color: #AAAAAA;
transition: all 0.3s;
}
@ -224,6 +225,7 @@ view {
font-size: 21rpx;
line-height: 33rpx;
padding: 0 20rpx;
text-align: center;
}
.container .all .major .letter .item.pitch {
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
@ -279,6 +281,9 @@ view {
box-shadow: 0 0 7.5rpx rgba(0, 0, 0, 0.17254902);
z-index: 1;
}
.container .all .major .list .item .organ .select-box.show .select .icon {
transform: rotate(90deg);
}
.container .all .major .list .item .organ .select-box.show .year {
height: auto;
}
@ -302,6 +307,7 @@ view {
width: 10rpx;
height: 9rpx;
transform: rotate(-90deg);
transition: all 0.3s;
}
.container .all .major .list .item .organ .select-box .year {
height: 0;
@ -339,7 +345,7 @@ view {
margin-bottom: 14rpx;
}
.container .pop .pop-box.realize-box .list {
padding: 0 45rpx 95rpx;
padding: 0 45rpx 150rpx;
}
.container .pop .pop-box.realize-box .list .item {
padding: 30rpx 0;

View File

@ -208,6 +208,7 @@ Page({
project.forEach(ele => {
if (projectPitch.system == ele.system && projectPitch.year == ele.year && ele.projectid == element) {
projectValue[ele.projectid] = {
id: ele.id || "-",
rank: ele.rank || "-",
subject: ele.subject || "-",
}
@ -227,6 +228,8 @@ Page({
school.forEach(ele => {
if (schoolPitch.system == ele.mechanism && schoolPitch.year == ele.year) {
schoolValue[ele.sid] = {
mechanism: ele.mechanism || "",
year: ele.year || "",
rank: ele.rank || "-",
}
}
@ -554,4 +557,22 @@ Page({
selectType == "rank" ? this.getProjectValue() : this.getSchoolPitch()
},
goProjectList(e) {
const id = e.currentTarget.dataset.value?.id || ''
if (!id) return
const project = this.data.ranking.project || []
let target = project.find(element => element.id == id);
if (!target) return
const major = encodeURIComponent(target.subject)
const organ = encodeURIComponent(target.system)
common.goPage(`/pages/projectList/projectList?type=subject&system=${organ}&subject=${major}&year=${target.year}`)
},
goProjectSchoolList(e) {
const target = e.currentTarget.dataset.value || ""
if (!target) return
const mechanism = encodeURIComponent(target.mechanism)
common.goPage(`/pages/projectList/projectList?type=school&mechanism=${mechanism}&year=${target.year}`)
},
})

View File

@ -131,7 +131,7 @@ navigator {
// width: 100%;
color: #7F7F7F;
line-height: 21rpx;
// line-height: 21rpx;
font-size: 19.5rpx;
font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
font-weight: 400;

View File

@ -38,8 +38,8 @@
<image class="icon" src="https://app.gter.net/image/miniApp/offer/triangle-red.svg" mode="widthFix"></image>
</view>
<view class="block flexflex">
<view class="item flex1" wx:for="{{ list }}" wx:key="index">
<template is="mode1" data="{{ text: item.rank || '-' }}"></template>
<view class="item flex1" wx:for="{{ list }}" wx:key="index" data-value="{{ projectValue[item.id] }}" bind:tap="goProjectList">
<template is="mode7" data="{{ item: projectValue[item.id] || '-' }}"></template>
</view>
</view>
</view>
@ -51,8 +51,8 @@
<image class="icon" src="https://app.gter.net/image/miniApp/offer/triangle-red.svg" mode="widthFix"></image>
</view>
<view class="block flexflex">
<view class="item flex1" wx:for="{{ list }}" wx:key="index">
<template is="mode2" data="{{ text: item.schoolranking || '-' }}"></template>
<view class="item flex1" wx:for="{{ list }}" wx:key="index" data-value="{{ schoolValue[item.sid] }}" bind:tap="goProjectSchoolList">
<template is="mode2" data="{{ text: schoolValue[item.sid].rank || '-' }}"></template>
</view>
</view>
</view>

View File

@ -93,7 +93,6 @@ navigator {
}
.block .item .mode7 .major {
color: #7F7F7F;
line-height: 21rpx;
font-size: 19.5rpx;
font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif;
font-weight: 400;

View File

@ -604,7 +604,7 @@
<view class="greenDot"></view>
{{ text }}
</view>
<view wx:if="{{ type == 'rankings' }}" class="list-btn flexacenter" bind:tap="goPage" data-url="/pages/projectList/projectList">
<view wx:if="{{ type == 'rankings' }}" class="list-btn flexacenter" bind:tap="goPage" data-url="/pages/projectAllList/projectAllList">
榜单
<image class="icon" mode="widthFix" src="https://app.gter.net/image/miniApp/offer/arrow-circle-gray.png"></image>
</view>

View File

@ -919,6 +919,8 @@ view {
.text {
max-width: 240rpx;
line-height: 72rpx;
height: 72rpx;
// display: contents;
// flex: 1;
// display: contents;

View File

@ -752,6 +752,8 @@ view {
}
.ranking .swiper .swiper-item .list .item .content1 .text {
max-width: 240rpx;
line-height: 72rpx;
height: 72rpx;
}
.ranking .swiper .swiper-item .list .item .content1 .year {
white-space: nowrap;

View File

@ -25,6 +25,7 @@ Page({
comList: [],
comPage: 1,
comTotal: 0,
comDefault: {},
majOption: {},
maj: {
jg: "",
@ -35,6 +36,15 @@ Page({
majList: [],
majPage: 1,
majTotal: 0,
majDefault: {},
rankingKey: {
"Shanghai Ranking": "软科",
"Times Higher Education": "泰晤士",
"times": "泰晤士",
"USNEWS": "U.S. News",
"US News": "U.S. News",
},
},
/**
@ -58,11 +68,16 @@ Page({
universityArr,
user: app.globalData.user,
})
const rankingsObj = Object.fromEntries(Object.entries(data.rankings).map(([key, element]) => [element.name, key]));
if (options['system']) {
options.system = this.decodeKey(options.system)
options.system = rankingsObj[options.system] || options.system
}
if (['subject', 'school'].includes(options.type)) {
const isSubject = options.type === 'subject';
const targetKey = isSubject ? 'maj' : 'com';
const targetKey = isSubject ? 'majDefault' : 'comDefault';
const source = this.data[targetKey] || (isSubject ? {} : this.data.com);
const updates = {
let updates = {
jg: this.decodeKey(isSubject ? options.system : options.mechanism) || '',
year: `${options.year || ''}`
};
@ -91,13 +106,13 @@ Page({
compAllList: [],
// 获取 综合排名 数据
getSynthesizeData() {
let comDefault = this.data.comDefault
let com = this.data.com
wx.showLoading({
title: '加载中...',
})
util.wxget("/api/project.rankings/comprehensive", {
token: com['token'],
token: com['token'] || comDefault['token'],
ishongkong: this.data.comOnly || 0,
limit: 2000,
}).then(res => {
@ -141,9 +156,10 @@ Page({
wx.showLoading({
title: '加载中...',
})
let majDefault = this.data.majDefault
let maj = this.data.maj
util.wxget("/api/project.rankings/discipline", {
token: maj['token'],
token: maj['token'] || majDefault['token'],
ishongkong: this.data.majOnly || 0,
}).then(res => {
if (res.code != 200) return
@ -186,17 +202,17 @@ Page({
const data = res.data
const comprehensive = data.comprehensive
let com = this.data.com
let com = this.data.comDefault
let organizationSet = [...this.objectOne(comprehensive)]
if (!com['jg']) com['jg'] = organizationSet[0]
let yearsSet = [...this.collectYears(comprehensive)].sort((a, b) => b - a);
if (!com['year']) com['year'] = yearsSet[0]
com['token'] = comprehensive[com.jg][com.year]
com['token'] = comprehensive[com.jg]?.[com.year] || ""
const discipline = data.discipline
let maj = this.data.maj
let maj = this.data.majDefault
const [dOrganizationKey, dOrganizationValue] = Object.entries(discipline)[0]
if (!maj['jg']) maj['jg'] = dOrganizationKey
if (!maj['major']) maj['major'] = Object.entries(dOrganizationValue)[0][0]
@ -204,13 +220,13 @@ Page({
const dYear = [...this.collectYears(discipline)].sort((a, b) => b - a);
if (!maj['year']) maj['year'] = dYear[0]
maj['token'] = discipline[maj.jg][maj.major][maj.year]
maj['token'] = discipline[maj.jg]?.[maj.major]?.[maj.year] || ""
this.setData({
comOption: comprehensive,
com,
comDefault: com,
majOption: discipline,
maj,
majDefault: maj,
isInitFinish: true,
})

View File

@ -253,131 +253,6 @@ view {
}
}
.screen-mask {
width: 100vw;
height: 100vh;
background-color: rgba(0, 0, 0, 0.705882352941177);
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: flex-end;
z-index: 100;
.screen-box {
width: 100vw;
background-color: #FFFFFF;
padding-top: 43.5rpx;
border-radius: 45rpx 45rpx 0 0;
.head {
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
font-size: 30rpx;
color: #000000;
margin-bottom: 45rpx;
text-align: center;
}
.box {
margin: 0 22.5rpx 30rpx;
background-color: rgba(251, 251, 251, 1);
border: 1rpx solid rgba(242, 242, 242, 1);
border-radius: 15rpx;
padding: 16.5rpx 18rpx 30rpx 18rpx;
.title {
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
font-size: 27rpx;
color: #000000;
margin-bottom: 45rpx;
}
.major-box {
height: 72rpx;
line-height: 72rpx;
background-color: rgba(255, 255, 255, 1);
border: 1rpx solid rgba(204, 208, 3, 1);
border-radius: 112.5rpx;
padding-left: 30rpx;
padding-right: 22.5rpx;
.text {
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
font-size: 24rpx;
color: #9A9D02;
&.text-no {
color: #AAAAAA;
font-weight: 400;
}
}
.icon {
width: 10.5rpx;
height: 18rpx;
}
}
.list {
flex-wrap: wrap;
.item {
min-width: 150rpx;
height: 72rpx;
line-height: 72rpx;
background-color: rgba(246, 246, 246, 1);
border-radius: 112.5rpx;
font-size: 24rpx;
color: #555555;
margin-right: 15rpx;
padding: 0 15rpx;
margin-bottom: 10rpx;
&.pitch {
border: 1rpx solid rgba(204, 208, 3, 1);
font-weight: 650;
color: #9A9D02;
}
}
}
}
.footer {
margin-top: 45rpx;
height: 201rpx;
border-top: 1rpx solid #ebebeb;
justify-content: space-between;
font-size: 30rpx;
padding: 45rpx 30rpx 0 30rpx;
.cancel {
width: 225rpx;
height: 96rpx;
background-color: rgba(207, 247, 255, 0);
border: 1rpx solid rgba(215, 215, 215, 1);
border-radius: 112.5rpx;
color: #555555;
}
.confirm {
width: 435rpx;
height: 96rpx;
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
color: #026277;
background-color: rgba(207, 247, 255, 1);
border: 1rpx solid rgba(186, 222, 230, 1);
border-radius: 112.5rpx;
}
}
}
}
.index-sidebar {
position: relative;
z-index: 99;

View File

@ -32,7 +32,7 @@
<view class="chunk">
<block wx:if="{{ classify == 'school' }}">
<view class="pitch-on flexacenter" bind:tap="cutScreenState">
{{ com.jg }}世界综合排名({{ com.year }}年)
{{ rankingKey[com.jg] || rankingKey[comDefault.jg] || com.jg || comDefault.jg }}世界综合排名({{ com.year || comDefault.year }}年)
<image class="pitch-icon" src="https://app.gter.net/image/miniApp/offer/triangle-red.svg" mode="widthFix"></image>
</view>
<view class="message flexacenter">
@ -46,7 +46,7 @@
</block>
<block wx:else>
<view class="pitch-on major-pitch flexacenter" bind:tap="cutScreenState">
<view class="major-pitch-text one-line-display">{{ maj.jg }} > {{ maj.major }}({{ maj.year }}年)</view>
<view class="major-pitch-text one-line-display">{{ rankingKey[maj.jg] || rankingKey[majDefault.jg] || maj.jg || majDefault.jg }} > {{ maj.major || majDefault.major }}({{ maj.year || majDefault.year }}年)</view>
<image class="pitch-icon" src="https://app.gter.net/image/miniApp/offer/triangle-red.svg" mode="widthFix"></image>
</view>
<view class="message flexacenter">

View File

@ -210,114 +210,6 @@ view {
font-size: 19.5rpx;
color: #D7D7D7;
}
.screen-mask {
background-color: rgba(0, 0, 0, 0.70588235);
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: flex-end;
z-index: 100;
}
.screen-mask .screen-box {
width: 100vw;
background-color: #FFFFFF;
padding-top: 43.5rpx;
border-radius: 45rpx 45rpx 0 0;
}
.screen-mask .screen-box .head {
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
font-size: 30rpx;
color: #000000;
margin-bottom: 45rpx;
text-align: center;
}
.screen-mask .screen-box .box {
margin: 0 22.5rpx 30rpx;
background-color: #fbfbfb;
border: 1rpx solid #f2f2f2;
border-radius: 15rpx;
padding: 16.5rpx 18rpx 30rpx 18rpx;
}
.screen-mask .screen-box .box .title {
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
font-size: 27rpx;
color: #000000;
margin-bottom: 45rpx;
}
.screen-mask .screen-box .box .major-box {
height: 72rpx;
line-height: 72rpx;
background-color: #ffffff;
border: 1rpx solid #ccd003;
border-radius: 112.5rpx;
padding-left: 30rpx;
padding-right: 22.5rpx;
}
.screen-mask .screen-box .box .major-box .text {
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
font-size: 24rpx;
color: #9A9D02;
}
.screen-mask .screen-box .box .major-box .text.text-no {
color: #AAAAAA;
font-weight: 400;
}
.screen-mask .screen-box .box .major-box .icon {
width: 10.5rpx;
height: 18rpx;
}
.screen-mask .screen-box .box .list {
flex-wrap: wrap;
}
.screen-mask .screen-box .box .list .item {
min-width: 150rpx;
height: 72rpx;
line-height: 72rpx;
background-color: #f6f6f6;
border-radius: 112.5rpx;
font-size: 24rpx;
color: #555555;
margin-right: 15rpx;
padding: 0 15rpx;
margin-bottom: 10rpx;
}
.screen-mask .screen-box .box .list .item.pitch {
border: 1rpx solid #ccd003;
font-weight: 650;
color: #9A9D02;
}
.screen-mask .screen-box .footer {
margin-top: 45rpx;
height: 201rpx;
border-top: 1rpx solid #ebebeb;
justify-content: space-between;
font-size: 30rpx;
padding: 45rpx 30rpx 0 30rpx;
}
.screen-mask .screen-box .footer .cancel {
width: 225rpx;
height: 96rpx;
background-color: rgba(207, 247, 255, 0);
border: 1rpx solid #d7d7d7;
border-radius: 112.5rpx;
color: #555555;
}
.screen-mask .screen-box .footer .confirm {
width: 435rpx;
height: 96rpx;
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
font-weight: 650;
color: #026277;
background-color: #cff7ff;
border: 1rpx solid #badee6;
border-radius: 112.5rpx;
}
.index-sidebar {
position: relative;
z-index: 99;

View File

@ -8,6 +8,13 @@
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/projectList/projectList",
"pathName": "pages/projectList/projectList",
"query": "type=subject&system=%25E8%25BD%25AF%25E7%25A7%2591&subject=Oceanography&year=2024",
"launchMode": "default",
"scene": null
},
{
"name": "pages/projectList/projectList",
"pathName": "pages/projectList/projectList",