详情专业排名跳转专业排名、对比页修改分享title和头部跳转按钮、删除不必要代码

This commit is contained in:
A1300399510 2025-02-11 18:58:59 +08:00
parent ae5103288c
commit db543cfee8
14 changed files with 137 additions and 268 deletions

View File

@ -309,23 +309,6 @@ Page({
},
/**
* 用户点击右上角分享
*/
// onShareAppMessage() {
// return {
// title: "【寄托港校项目库】 - 项目对比",
// }
// },
// onShareTimeline() {
// util.statistics({
// name: "share-timeline"
// })
// return {
// title: "【寄托港校项目库】 - 项目对比",
// }
// },
indexSidebar: null,
windowHeight: 812,
onPageScroll(e) {
@ -353,4 +336,30 @@ Page({
this.indexSidebar.openSidebarTwoHide()
},
getShareTitle() {
const list = this.data.list || []
let title = "港校项目对比:"
list.forEach((element, index) => {
title += "【" + element.schoolalias + " | " + element.name_zh + '】' + (index != list.length - 1 ? 'VS' : '')
})
return title
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: this.getShareTitle(),
}
},
onShareTimeline() {
util.statistics({
name: "share-timeline"
})
return {
title: this.getShareTitle(),
}
},
})

View File

@ -1,4 +1,5 @@
view {
view,
navigator {
box-sizing: border-box;
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
word-break: break-word;
@ -127,6 +128,7 @@ view {
&.unfold {
padding-bottom: 75rpx;
.more {
display: flex;

View File

@ -4,13 +4,13 @@
<block wx:key="index">
<view class="block head-box flexflex {{ briefness ? 'briefness' : '' }}" style="top: {{ totalTopHeight }}px;">
<view class="item flex1 " wx:for="{{ list }}" wx:key="index">
<view class="name one-line-display" style="width: calc(100vw / {{ list.length }} - 30rpx);">{{ item.name_zh }}</view>
<view class="english one-line-display" style="width: calc(100vw / {{ list.length }} - 30rpx);">{{ item.name_en }}</view>
<view class="school flexacenter">
<navigator class="name one-line-display" url="{{ '/pages/projectDetails/projectDetails?uniqid=' + item.uniqid }}" style="width: calc(100vw / {{ list.length }} - 30rpx);" hover-class="none">{{ item.name_zh }}</navigator>
<navigator class="english one-line-display" url="{{ '/pages/projectDetails/projectDetails?uniqid=' + item.uniqid }}" style="width: calc(100vw / {{ list.length }} - 30rpx);" hover-class="none">{{ item.name_en }}</navigator>
<navigator class="school flexacenter" url="{{ '/pages/projectSchoolHomepage/projectSchoolHomepage?id=' + item.sid }}" hover-class="none">
<image class="icon" src="{{ item.schoollogo }}" mode="widthFix"></image>
{{ item.schoolalias }}
<view class="semester">{{ item.semester.text }}</view>
</view>
</navigator>
<view class="operate flexacenter">
<view class="operate-item flexcenter flex1" bind:tap="handleProject" data-type="replace" data-index="{{ index }}">

View File

@ -1,4 +1,5 @@
view {
view,
navigator {
box-sizing: border-box;
font-family: 'PingFangSC-Semibold', 'PingFang SC Semibold', 'PingFang SC', sans-serif;
word-break: break-word;

View File

@ -184,7 +184,7 @@ Page({
const info = data.info || {}
const fields = ['tuition_fee', 'tuition_fee_per_credit', 'application_fee', 'admission_deposit'];
const fields = ['tuition_fee',];
fields.forEach(field => {
const textKey = `${field}_text`;
info[textKey] = common.formatNumberWithSpaces(info[field] || '');
@ -413,7 +413,7 @@ Page({
},
onPageScroll(e) {
if (Math.random() > 0.5) return
// if (Math.random() > 0.5) return
const scrollTop = e.scrollTop
@ -496,73 +496,7 @@ Page({
informationState: false
})
},
// 打开状态
cutState() {
if (!this.data.islogin) {
this.openLoginBtnState()
return
}
this.setData({
stateState: !this.data.stateState,
})
},
//监听键盘
bindkeyboardheightchange(e) {
let keyboardHeight = e.detail.height || 0;
this.setData({
keyboardHeight,
});
},
// 监听输入 失去焦点
bindblur() {
this.setData({
keyboardHeight: 0,
});
},
// 打开备注弹窗
openRemark() {
if (!this.data.islogin) {
this.openLoginBtnState()
return
}
this.setData({
remarkState: true,
remarkFocus: false,
remarkInput: this.data.remark,
}, () => {
this.setData({
remarkFocus: true,
})
})
},
// 关闭备注
closeRemark() {
this.setData({
remarkState: false,
})
},
// 确定备注
confirmRemark() {
const contras = this.data.contras
util.wxpost("/api/project.user/remarks", {
token: contras.token,
remarks: this.data.remarkInput,
}).then(res => {
common.toast(res.message)
this.setData({
remark: this.data.remarkInput,
})
this.closeRemark()
})
},
// 点击 跳转 公共方法
goPage(e) {
const url = e.currentTarget.dataset.url
@ -588,39 +522,6 @@ Page({
indexSidebar: null,
windowHeight: 812, // 屏幕高度
// 修改 项目 状态
changeType(e) {
const typeid = e.currentTarget.dataset.typeid
const contras = this.data.contras
util.wxpost("/api/project.user/changeType", {
token: contras.token || '',
typeid,
}).then(res => {
if (res.code != 200) return
common.toast(res.message)
contras['typeid'] = typeid
this.cutState()
this.setData({
contras,
})
})
},
delete() {
const contras = this.data.contras
util.wxpost("/api/project.user/delete", {
token: contras.token,
}).then(res => {
if (res.code != 200) return
common.toast(res.message)
contras['ismanage'] = 0
this.setData({
contras,
stateState: false,
})
})
},
// 点击加入对比单
addComparison() {
if (!this.data.islogin) {
@ -784,7 +685,6 @@ Page({
*/
onShareAppMessage() {
return {
// title: "【寄托港校项目库】 - " + this.data.info.name_zh,
title: `${ this.data.info.schoolalias || this.data.info.schoolname || '' }】 - ${this.data.info.name_zh}`,
}
},
@ -802,4 +702,16 @@ Page({
quickAnswerState: !this.data.quickAnswerState
})
},
// 跳转专业排名
goProjectList(e) {
const rankings = this.data.info.rankings || []
const index = e.currentTarget.dataset.index
let item = rankings[index]
item['system'] = encodeURIComponent(item['system'])
item['subject'] = encodeURIComponent(item['subject'])
wx.navigateTo({
url: `/pages/projectList/projectList?year=${ item.year }&system=${item.system}&subject=${item.subject}`,
})
},
})

View File

@ -80,29 +80,6 @@
<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>
<view class="borderTop"></view>
<!-- <block wx:if="{{ urls.length != 0 && answerType == 0 }}">
<view class="admission-box block" bind:tap="cutAdmission">
<view class="head flexcenter">
<image class="icon" src="https://app.gter.net/image/miniApp/offer/talk-live-icon.png" mode="widthFix"></image>
<view class="text flexcenter">
<image class="triangle" src="https://app.gter.net/image/miniApp/offer/triangle-dark-cyan.svg"></image>
招生官为你答疑
</view>
</view>
<view class="content">
<view class="title">
<view class="admissionState state{{ urlsOne.mold }}">{{ moldObj[urlsOne.mold] }}</view>
{{ urlsOne.title }}
</view>
<view class="more flexcenter">
<text>more</text>
<image class="icon" src="https://app.gter.net/image/miniApp/offer/arrow-circle.png" mode="widthFix"></image>
</view>
</view>
</view>
<view class="borderTop"></view>
</block> -->
<view class="semester-box flexacenter ">
<view class="text gray {{ info.semesterState ? 'semester' : '' }}">{{ info.semester.text || '' }}</view>
@ -121,7 +98,7 @@
<view wx:if="{{ info.rankings && info.rankings.length != 0 }}" class="key-ranking block" bind:tap="goPage" data-url="/pages/projectList/projectList">
<image class="icon" src="https://app.gter.net/image/miniApp/offer/major-icon.png" mode="widthFix"></image>
<view class="list">
<view class="item flex1" wx:for="{{ info.rankings }}" wx:key="index">
<view class="item flex1" wx:for="{{ info.rankings }}" wx:key="index" bind:tap="goProjectList" data-index="{{ index }}">
<view class="quantity">{{ item.rank }}</view>
<view class="ranking-name">
{{ rankingsObj[item.system].name }}
@ -141,20 +118,6 @@
<view class="text">总学费</view>
<view class="number">{{ info.tuition_fee_text || '待确认' }}</view>
</view>
<!-- <view class="right">
<view class="item flexacenter">
<view class="key">每学分学费</view>
<view class="value">{{ info.tuition_fee_per_credit_text || '-' }}</view>
</view>
<view class="item flexacenter">
<view class="key">申请费</view>
<view class="value">{{ info.application_fee_text || '-' }}</view>
</view>
<view class="item flexacenter">
<view class="key">入学保证金</view>
<view class="value">{{ info.admission_deposit_text || '-' }}</view>
</view>
</view> -->
</view>
<!-- 语言和奖金 -->
@ -201,7 +164,7 @@
<block wx:if="{{ info.rankings && info.rankings.length != 0 }}">
<template is="item-header" data="{{ text: '专业排名', type: 'rankings' }}"></template>
<view class="ranking">
<view class="item flexflex" wx:for="{{ info.rankings }}" wx:key="index" bind:tap="goPage" data-url="/pages/projectList/projectList">
<view class="item flexflex" wx:for="{{ info.rankings }}" wx:key="index" bind:tap="goProjectList" data-index="{{ index }}">
<view class="rank flexflex">
<view class="number {{ rankingsObj[item.system].alias }}">
{{ item.rank }}
@ -306,20 +269,6 @@
<view class="text">总学费</view>
<view class="number">{{ info.tuition_fee_text || '待确认' }}</view>
</view>
<!-- <view class="right">
<view class="item flexacenter">
<view class="key">每学分学费</view>
<view class="value">{{ info.tuition_fee_per_credit_text || '-' }}</view>
</view>
<view class="item flexacenter">
<view class="key">申请费</view>
<view class="value">{{ info.application_fee_text || '-' }}</view>
</view>
<view class="item flexacenter">
<view class="key">入学保证金</view>
<view class="value">{{ info.admission_deposit_text || '-' }}</view>
</view>
</view> -->
</view>
<block wx:if="{{ info.scholarships }}">
@ -644,30 +593,6 @@
</view>
<view class="bottom flexacenter">可点击左侧“我的项目”进行项目对比或管理</view>
</view>
<!-- <view class="remark flexacenter" bind:tap="openRemark">
<image class="icon" src="/img/u1434.png" mode="widthFix"></image>
<view wx:if="{{ remark }}" class="text one-line-display">{{ remark }}</view>
<view wx:else class="text placeholder">添加备注…</view>
</view>
<view class="state-mask" wx:if="{{ stateState }}" bind:tap="cutState"></view>
<view class="state">
<view class="state-box {{ contras.typeid == 0 ? 'undetermined' : '' }} {{ stateState ? 'show' : '' }}">
<view class="state-list">
<view class="state-item flexcenter {{ contras.typeid == index ? 'pitch' : '' }}" wx:for="{{ stateObj }}" wx:key="index" catch:tap="changeType" data-typeid="{{ index }}">
{{ item }}
</view>
</view>
<view class="delete flexcenter" bind:tap="delete">
<view class="delete-btn flexcenter">
<image class="icon" mode="widthFix" src="https://app.gter.net/image/miniApp/offer/delete-light-grey.svg"></image>
</view>
</view>
<view class="state-pitch flexcenter" catch:tap="cutState">
{{ stateObj[contras.typeid || 0] }}
<image class="icon" src="https://app.gter.net/image/miniApp/offer/triangle-white.svg"></image>
</view>
</view>
</view> -->
</block>
<view wx:else class="btns flex1 flexacenter">
<view class="item flexcenter flex1 {{ contras.status == 1 ? 'already' : '' }}" bind:tap="addComparison">

View File

@ -67,11 +67,30 @@ Page({
university: data.university,
universityArr,
})
if (JSON.stringify(options) != "{}") {
let discipline = this.data.discipline || {}
discipline["yearKey"] = options.year + ""
discipline["organizationKey"] = this.decodeKey(options.system)
discipline["majorKey"] = this.decodeKey(options.subject)
this.setData({
classify: "subject",
discipline,
})
}
this.getRankings()
})
})
},
decodeKey(key) {
while (key !== decodeURIComponent(key)) {
key = decodeURIComponent(key);
}
return key;
},
// 获取 综合排名 数据
getSynthesizeData() {
let comprehensive = this.data.comprehensive
@ -132,7 +151,6 @@ Page({
title: '加载中...',
})
let discipline = this.data.discipline
// console.log("discipline", discipline);
util.wxget("/api/project.rankings/discipline", {
token: discipline['token'],
@ -192,8 +210,6 @@ Page({
let yearsSet = [...this.collectYears(comprehensive)]
yearsSet.sort((a, b) => b - a);
// console.log("yearsSet", yearsSet);
// comprehensiveTarget['year'] = yearsSet
comprehensiveTarget['yearKey'] = yearsSet[0]
comprehensiveTarget['obj'] = comprehensive
@ -205,13 +221,13 @@ Page({
const dOrganization = [...this.objectOne(discipline)]
const [dOrganizationKey, dOrganizationValue] = Object.entries(discipline)[0]
disciplineTarget['organization'] = dOrganization
disciplineTarget['organizationKey'] = dOrganizationKey
disciplineTarget['majorKey'] = Object.entries(dOrganizationValue)[0][0]
if (!disciplineTarget['organizationKey']) disciplineTarget['organizationKey'] = dOrganizationKey
if (!disciplineTarget['majorKey']) disciplineTarget['majorKey'] = Object.entries(dOrganizationValue)[0][0]
const dYear = [...this.collectYears(discipline)]
dYear.sort((a, b) => b - a);
// disciplineTarget['year'] = dYear
disciplineTarget['yearKey'] = dYear[0]
if (!disciplineTarget['yearKey']) disciplineTarget['yearKey'] = dYear[0]
disciplineTarget['obj'] = discipline
this.checkDisciplineYear()
@ -222,9 +238,8 @@ Page({
isInitFinish: true,
})
if (!this.indexSidebar) this.indexSidebar = this.selectComponent('#index-sidebar')
this.haveComprehensive()
if (this.data.classify == 'school') this.haveComprehensive()
else this.haveDiscipline()
if (!this.indexSidebar) this.indexSidebar = this.selectComponent('#index-sidebar')
@ -263,11 +278,12 @@ Page({
if (classify == this.data.classify) return
let discipline = this.data.discipline
let discipline = this.data.discipline || {}
// 切换 专业排名时 判断 是否需要 显示选择
if (classify == 'subject' && discipline.list.length == 0) {
this.haveDiscipline()
}
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,
@ -352,8 +368,6 @@ Page({
if (!year.includes(comprehensive.yearKey)) comprehensive.yearKey = year[0]
// if (year.length == 1) comprehensive.yearKey = year[0]
comprehensive['year'] = year
this.setData({
comprehensive
@ -395,14 +409,11 @@ Page({
let majorsList = {}
majorsList = obj[organizationKey]
// console.log(Object.keys(majorsList)[0]);
const majorKey = Object.keys(majorsList)[0] || ''
// console.log("majorsList", majorsList[majorKey]);
const yearObj = majorsList[majorKey]
const yearList = Object.keys(yearObj)
yearList.sort((a, b) => b - a);
// console.log("yearList", yearList);
discipline['majorKey'] = majorKey
discipline['year'] = yearList
@ -624,7 +635,9 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: "【寄托港校项目库】- 榜单",
}
},
onShareTimeline() {
util.statistics({

View File

@ -380,4 +380,9 @@ view {
.index-sidebar {
position: relative;
z-index: 99;
}
.empty {
flex-direction: column;
height: 50vh;
}

View File

@ -77,7 +77,7 @@
<!-- <image wx:if="{{ item.sid }}" class="angle" src="https://app.gter.net/image/miniApp/offer/project-angle.svg" mode="widthFix"></image> -->
<view class="bottom flexflex">
<view class="site">{{ item.city }}</view>
<view class="site">{{ item.city || '' }}</view>
<view wx:if="{{ item.sid }}" class="btn flexcenter" bind:tap="goSchoolHomepage" data-sid="{{ item.sid }}">
学校主页
<image class="icon" src="https://app.gter.net/image/miniApp/offer/arrows-round-light-white.svg" mode="widthFix"></image>
@ -85,7 +85,15 @@
</view>
</view>
</view>
</view>
<view class="empty flexcenter" wx:if="{{ (classify == 'school' && comprehensive.list.length == 0) || (classify == 'subject' && discipline.list.length == 0) }}">
<view class="dot-box flexacenter">
<image class="dot" wx:for="{{ 3 }}" wx:key="index" mode="widthFix" src="/img/u1829.svg"></image>
<image class="dot" wx:for="{{ 3 }}" wx:key="index" mode="widthFix" src="/img/u1832.svg"></image>
</view>
<image class="empty-icom" mode="widthFix" src="https://app.gter.net/image/miniApp/offer/u1828.svg"></image>
<view>暂无数据</view>
</view>
<view class="end" wx:if="{{ (classify == 'school' && comprehensive.page == 0) || (classify == 'subject' && discipline.page == 0) }}">- End -</view>

View File

@ -321,3 +321,7 @@ view {
position: relative;
z-index: 99;
}
.empty {
flex-direction: column;
height: 50vh;
}

View File

@ -51,7 +51,6 @@ Page({
vsBottom: false, // 底部显示状态
// isInitFinish: false,
},
/**
@ -74,7 +73,6 @@ Page({
screen_data,
islogin,
manageHintState,
// isInitFinish: true,
})
this.windowHeight = screen_data.windowHeight || 812
@ -275,7 +273,6 @@ Page({
if (classify == this.data.classify) return
this.setData({
classify,
// isInitFinish: false,
})
if (this.data.classify == 'manage') {
@ -294,7 +291,6 @@ Page({
projectPage: 1,
projectList: [],
selectList: [],
// isInitFinish: true,
})
this.getProjectList()
this.getQuickList()
@ -487,28 +483,6 @@ Page({
let scrollTop = e.scrollTop
this.scrollTop = scrollTop
let isFirstPattern = true
if (scrollTop > this.rpx219) isFirstPattern = false
// if (this.data.isFirstPattern != isFirstPattern) {
// this.setData({
// isFirstPattern,
// })
// }
// let sidebarState = this.indexSidebar.data.sidebarState
// if (scrollTop > this.windowHeight * 3 && sidebarState !== 3) sidebarState = 3
// if (scrollTop < this.windowHeight * 3 && sidebarState == 3) sidebarState = 2
// // 同一搜集 修改的 sidebarState
// if (sidebarState !== this.indexSidebar.data.sidebarState) {
// this.indexSidebar.setData({
// sidebarState
// })
// }
// this.indexSidebar.openSidebarTwoHide()
},
slowScrollNow: "",
@ -535,6 +509,14 @@ Page({
this.calculateManageHeight()
},
remarks: "",
focusfocus(e) {
const index = e.currentTarget.dataset.index
let list = this.data.list
console.log("list", list[index]);
this.remarks = list[index]['remarks']
},
bindblur(e) {
const index = e.currentTarget.dataset.index
let list = this.data.list
@ -548,7 +530,8 @@ Page({
})
const target = list[index] || {}
this.postRemarks(target.token, target.remarks)
if (this.remarks != target.remarks) this.postRemarks(target.token, target.remarks)
this.remarks = ""
},
// 发送 备注

View File

@ -636,7 +636,9 @@ Page({
* 用户点击右上角分享
*/
onShareAppMessage() {
return {
title: "【寄托港校项目库】- " + this.data.info.name,
}
},
onShareTimeline() {
util.statistics({

View File

@ -48,24 +48,22 @@
<view class="hot">
<scroll-view class="hot-box" scroll-x="{{ true }}" bindscroll="hotscroll">
<view class="line" wx:for="{{ hotList }}" wx:key="index">
<block wx:for="{{ item }}" wx:for-index="i" wx:key="i">
<view class="item flexacenter" bind:tap="goDetails" data-uniqid="{{ item.uniqid }}">
<view class="box">
<view class="name one-line-display">{{ item.name_zh }}</view>
<view class="english one-line-display">{{ item.name_en }}</view>
</view>
<view wx:if="{{ item.contraststatus == 0 }}" class="join flexflex" catch:tap="handleClick" data-type="hot" data-random="{{ item.random }}" data-id="{{ item.id }}" data-index="{{ index }}" data-i="{{ i }}" data-status="{{ item.contraststatus }}">
<view class="add flexcenter" id="add{{ item.random }}">
<image class="icon" src="https://app.gter.net/image/miniApp/offer/plus-icon.svg" mode="widthFix"></image>
</view>
</view>
<view wx:else class="cancel flexflex">
<view class="cross flexcenter">
<image class="icon" src="https://app.gter.net/image/miniApp/offer/tick-grey.svg" mode="widthFix"></image>
</view>
<view class="item flexacenter" bind:tap="goDetails" data-uniqid="{{ item.uniqid }}" wx:for="{{ item }}" wx:for-index="i" wx:key="i">
<view class="box">
<view class="name one-line-display">{{ item.name_zh }}</view>
<view class="english one-line-display">{{ item.name_en }}</view>
</view>
<view wx:if="{{ item.contraststatus == 0 }}" class="join flexflex" catch:tap="handleClick" data-type="hot" data-random="{{ item.random }}" data-id="{{ item.id }}" data-index="{{ index }}" data-i="{{ i }}" data-status="{{ item.contraststatus }}">
<view class="add flexcenter" id="add{{ item.random }}">
<image class="icon" src="https://app.gter.net/image/miniApp/offer/plus-icon.svg" mode="widthFix"></image>
</view>
</view>
</block>
<view wx:else class="cancel flexflex">
<view class="cross flexcenter">
<image class="icon" src="https://app.gter.net/image/miniApp/offer/tick-grey.svg" mode="widthFix"></image>
</view>
</view>
</view>
</view>
</scroll-view>
<view class="indication flexacenter">

View File

@ -8,6 +8,13 @@
"condition": {
"miniprogram": {
"list": [
{
"name": "pages/projectDetails/projectDetails",
"pathName": "pages/projectDetails/projectDetails",
"query": "uniqid=rD0Sj0auDPzX",
"launchMode": "default",
"scene": null
},
{
"name": "pages/projectDetails/projectDetails",
"pathName": "pages/projectDetails/projectDetails",