修改项目库bug
This commit is contained in:
parent
b2a76456fe
commit
8425be5904
@ -40,10 +40,10 @@ Component({
|
||||
// 新 轮播图 自动滑动事件,修改下标
|
||||
bindchangeSwiper(e) {
|
||||
let current = e.detail.current
|
||||
|
||||
this.setData({
|
||||
swiperCurrent: current
|
||||
})
|
||||
setTimeout(() => this.triggerEvent("bindchange"), 500)
|
||||
},
|
||||
}
|
||||
})
|
@ -16,7 +16,7 @@
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<view class="pilot">
|
||||
<view class="pilot" wx:if="{{ documents.length > 1 }}">
|
||||
<view class="item {{ swiperCurrent == index ? 'pitch' : '' }}" wx:for="{{ documents }}" wx:key="index"></view>
|
||||
</view>
|
||||
</view>
|
@ -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";
|
||||
});
|
||||
|
@ -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)
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
|
@ -723,6 +723,7 @@ navigator {
|
||||
background-repeat: repeat-y;
|
||||
background-position: 0 0;
|
||||
white-space: pre-wrap;
|
||||
width: 508.5rpx;
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
|
@ -12,21 +12,15 @@
|
||||
{{ info.schoolname || '' }}
|
||||
<image class="arrows" mode="widthFix" src="https://app.gter.net/image/miniApp/offer/arrows-circle-yellow-green.svg"></image>
|
||||
</view>
|
||||
<block wx:if="{{ info.academic_unit[0] }}">
|
||||
<view class="flexacenter black" bind:tap="goDepartment">
|
||||
<view class="line">|</view>
|
||||
{{ info.academic_unit[0]['academic_unit_zh'] }}
|
||||
<image class="arrows" mode="widthFix" src="https://app.gter.net/image/miniApp/offer/arrows-circle-yellow-green.svg"></image>
|
||||
</view>
|
||||
</block>
|
||||
<block wx:if="{{ info.academic_unit[1] }}">
|
||||
<view class="line">|</view>
|
||||
{{ info.academic_unit[1]['academic_unit_zh'] }}
|
||||
</block>
|
||||
<block wx:if="{{ info.academic_unit[2] }}">
|
||||
<view class="line">|</view>
|
||||
{{ info.academic_unit[2]['academic_unit_zh'] }}
|
||||
</block>
|
||||
<view class="line" wx:if="{{ info.academic_unit[0] }}">|</view>
|
||||
<view class="flexacenter black" bind:tap="goDepartment">
|
||||
{{ info.academic_unit[0]['academic_unit_zh'] }}
|
||||
<image class="arrows" mode="widthFix" src="https://app.gter.net/image/miniApp/offer/arrows-circle-yellow-green.svg"></image>
|
||||
</view>
|
||||
<view class="line" wx:if="{{ info.academic_unit[1] }}">|</view>
|
||||
<block wx:if="{{ info.academic_unit[1] }}">{{ info.academic_unit[1]['academic_unit_zh'] }}</block>
|
||||
<view class="line" wx:if="{{ info.academic_unit[2] }}">|</view>
|
||||
<block wx:if="{{ info.academic_unit[2] }}">{{ info.academic_unit[2]['academic_unit_zh'] }}</block>
|
||||
</view>
|
||||
<view bind:tap="goPage" data-url="/pages/webview/webview?url={{ admissionofficerin[0]['url'] }}" class="answer flexacenter" wx:if="{{ answerType == 1 }}">
|
||||
<view class="left flexcenter">
|
||||
@ -159,7 +153,7 @@
|
||||
<view class="borderTop"></view>
|
||||
</block>
|
||||
<view class="" style="margin-bottom: 60rpx;">
|
||||
<view class="semester-box flexacenter ">
|
||||
<view class="semester-box flexacenter " wx:if="{{ newest }}">
|
||||
<view class="text gray semester">{{ newest || '' }}</view>
|
||||
本项目招生信息已更新为{{ newest || '' }}
|
||||
</view>
|
||||
@ -254,7 +248,7 @@
|
||||
<block wx:if="{{ applyListState }}">
|
||||
<view class="apply-mask" bind:tap="cutApplyState"></view>
|
||||
<view class="apply-list">
|
||||
<view class="apply-item flexacenter {{ item.id == admissionsObj.id ? 'pitch' : ''}}" wx:for="{{ admissions }}" bind:tap="cutApplyIndex" data-id="{{ item.id }}">
|
||||
<view class="apply-item flexacenter {{ item.id == admissionsObj.id ? 'pitch' : ''}}" wx:for="{{ admissions }}" bind:tap="cutApplyIndex" data-id="{{ item.id }}" wx:key="index">
|
||||
<view class="dot"></view>
|
||||
<view class="text">{{ item.season }}申请信息</view>
|
||||
</view>
|
||||
@ -292,20 +286,22 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template is="item-header" data="{{ text: '最低入学要求' }}"></template>
|
||||
<view class="demand block {{ demandState != 0 ? 'arrowShow' : '' }} {{ demandState == 2 ? 'demandShow' : '' }}">
|
||||
<text class="text" user-select="{{ true }}">{{ admission_requirementsObj.basic_requirements }}</text>
|
||||
<view class="demand-content" wx:if="{{ admission_requirementsObj.language_requirements.length != 0 }}">
|
||||
<template is="demand" wx:for="{{ admission_requirementsObj.language_requirements }}" wx:key="index" data="{{ item }}"></template>
|
||||
<block wx:if="{{ !isNoRequire }}">
|
||||
<template is="item-header" data="{{ text: '最低入学要求' }}"></template>
|
||||
<view class="demand block {{ demandState != 0 ? 'arrowShow' : '' }} {{ demandState == 2 ? 'demandShow' : '' }}">
|
||||
<text class="text" user-select="{{ true }}">{{ admission_requirementsObj.basic_requirements }}</text>
|
||||
<view class="demand-content" wx:if="{{ admission_requirementsObj.language_requirements.length != 0 }}">
|
||||
<template is="demand" wx:for="{{ admission_requirementsObj.language_requirements }}" wx:key="index" data="{{ item }}"></template>
|
||||
</view>
|
||||
<view class="demand-bottom flexcenter {{ demandState == 2 ? 'demandShow' : '' }}" bind:tap="cutDemandState" wx:if="{{ demandState != 0 }}">
|
||||
<image class="bottom-icon" src="https://app.gter.net/image/miniApp/offer/arrow-circle-gray.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="demand-bottom flexcenter {{ demandState == 2 ? 'demandShow' : '' }}" bind:tap="cutDemandState" wx:if="{{ demandState != 0 }}">
|
||||
<image class="bottom-icon" src="https://app.gter.net/image/miniApp/offer/arrow-circle-gray.png" mode="widthFix"></image>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block wx:if="{{ documents.length != 0 }}">
|
||||
<template is="item-header" data="{{ text: '必须文件' }}"></template>
|
||||
<document-box documents="{{ documents }}"></document-box>
|
||||
<document-box documents="{{ documents }}" bind:bindchange="getHeadHeight"></document-box>
|
||||
</block>
|
||||
|
||||
<template is="item-header" data="{{ text: '费用' }}"></template>
|
||||
@ -500,12 +496,11 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- <view wx:if="{{ offerList.length != 0 }}" class="side-item" data-type="consult"> -->
|
||||
<view wx:if="{{ offerList.length != 0 }}" class="side-item" data-type="consult">
|
||||
<view wx:if="{{ offerShowList.length != 0 }}" class="side-item" data-type="consult">
|
||||
<view class="side-head flexcenter">录取参考</view>
|
||||
<template is="item-header" data="{{ text: '寄托录取参考', type: 'consult' }}"></template>
|
||||
<view class="consult-list">
|
||||
<navigator class="consult-item" wx:for="{{ offerList }}" wx:key="index" target="miniProgram" app-id="wxa9296b07391c2bc7" path="/pages/victoryDetails/victoryDetails?id={{ item.id || item.uniqid }}" hover-class="none">
|
||||
<navigator class="consult-item" wx:for="{{ offerShowList }}" wx:key="index" target="miniProgram" app-id="wxa9296b07391c2bc7" path="/pages/victoryDetails/victoryDetails?id={{ item.id || item.uniqid }}" hover-class="none">
|
||||
<view class="school flexacenter">
|
||||
<image class="img" src="{{ item.schoolimage }}" mode="widthFix"></image>
|
||||
<view class="flex1">{{ item.schoolname }}</view>
|
||||
@ -566,7 +561,7 @@
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="consult-more flexcenter" wx:if="{{ offerPage != 0 }}" bind:tap="getOfferData">
|
||||
<view class="consult-more flexcenter" wx:if="{{ offerPage != 0 }}" bind:tap="moreOfferData">
|
||||
加载更多
|
||||
<image class="icon" src="https://app.gter.net/image/miniApp/offer/arrow-circle.png" mode="widthFix"></image>
|
||||
</view>
|
||||
@ -602,7 +597,7 @@
|
||||
复制链接
|
||||
</view>
|
||||
</view>
|
||||
<view class="link block magb30" wx:if="{{ admissionsObj.application_url }}" >
|
||||
<view class="link block magb30" wx:if="{{ admissionsObj.application_url }}">
|
||||
<view class="title">学院网站项目详情</view>
|
||||
<view class="text">{{ admissionsObj.application_url }}</view>
|
||||
<view class="btn flexcenter" bind:tap="copy" data-text="{{ admissionsObj.application_url }}">
|
||||
@ -611,7 +606,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="link block magb30" wx:if="{{ admissionsObj.catalog_url }}" >
|
||||
<view class="link block magb30" wx:if="{{ admissionsObj.catalog_url }}">
|
||||
<view class="title">项目目录项目详情</view>
|
||||
<view class="text">{{ admissionsObj.catalog_url }}</view>
|
||||
<view class="btn flexcenter" bind:tap="copy" data-text="{{ admissionsObj.catalog_url }}">
|
||||
@ -644,7 +639,7 @@
|
||||
<view class="word" wx:if="{{ item.distinctive }}">{{ item.distinctive }}</view>
|
||||
<view class="tag flexflex">
|
||||
<view class="tag-item admissions" wx:if="{{ item.admissionsproject }}">招生官项目</view>
|
||||
<view class="tag-item gray {{ item.semesterState ? 'semester' : '' }}">{{ item.semester.text }}</view>
|
||||
<view wx:if="{{ item.semester.text != 'Fall' }}" class="tag-item gray {{ item.semesterState ? 'semester' : '' }}">{{ item.semester.text }}</view>
|
||||
<view class="tag-item" wx:for="{{ item.tags }}" wx:key="index">{{ item }}</view>
|
||||
</view>
|
||||
<view class="btn flexacenter">
|
||||
|
@ -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: "";
|
||||
|
@ -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: [],
|
||||
|
@ -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",
|
||||
|
Loading…
x
Reference in New Issue
Block a user