diff --git a/component/admission-box/admission-box.js b/component/admission-box/admission-box.js new file mode 100644 index 0000000..01b6756 --- /dev/null +++ b/component/admission-box/admission-box.js @@ -0,0 +1,119 @@ +// template/admission-box/admission-box.js +var miucms = require('../../utils/miucms.js'); +var common = require('../../utils/commonMethod.js'); +const util = require("../../utils/util") +const app = getApp() +Component({ + /** + * 组件的属性列表 + */ + properties: { + initFinish: { + type: Boolean, + value: false, + observer(res) { + if (res) this.getAdmissionsOfficer() + } + }, + }, + + /** + * 组件的初始数据 + */ + data: { + urls: [], + countdownInterval: null, + countDown: { + days: 0, + hours: '00', + minutes: '00', + seconds: '00', + }, + + admissionCurrent: 0, + + countDownState: false, + }, + + /** + * 组件的方法列表 + */ + methods: { + getAdmissionsOfficer() { + util.wxget('/miniprogramApi/offer/home/admissionsOfficer').then(res => { + if (res.code != 200) return + const data = res.data || [] + const today = new Date() + today.setHours(0, 0, 0, 0) + // data[0]['date'] = "1733899465" + data.forEach(element => { + let mold = null + let timestamp = "" + if (!element.date || (typeof element.date == 'string' && element.date.indexOf("答疑") >= 0)) mold = 3; + else { + const date = new Date(element.date * 1000); + if (!isNaN(date.getTime())) { + if (date >= today) mold = 1 + else mold = 2 + if (Date.now() < date.getTime()) timestamp = date.getTime() - Date.now() + } else mold = 3 + } + + element['mold'] = mold + element['timestamp'] = timestamp + }) + + this.setData({ + urls: data, + }) + + this.setCountDown(0) + }) + }, + + bindanimationfinish(e) { + const current = e.detail.current || 0 + this.setData({ + admissionCurrent: current + }) + + this.setCountDown(current) + }, + + setCountDown(index) { + const urls = this.data.urls + clearTimeout(this.data.countdownInterval); + if (urls[index]['timestamp']) this.startCountdown(urls[index]['timestamp']) + else { + this.setData({ + countDownState: false, + }) + } + }, + + startCountdown(duration) { + clearTimeout(this.data.countdownInterval); + let timer = duration; + const days = Math.floor(timer / (24 * 60 * 60 * 1000)); + const hours = Math.floor((timer % (24 * 60 * 60 * 1000)) / (60 * 60 * 1000)); + const minutes = Math.floor((timer % (60 * 60 * 1000)) / (60 * 1000)); + const seconds = Math.floor(timer % (60 * 1000) / 1000); + this.setData({ + countDown: { + days, + hours: hours.toString().padStart(2, '0'), + minutes: minutes.toString().padStart(2, '0'), + seconds: seconds.toString().padStart(2, '0'), + }, + countDownState: true, + }); + timer = timer - 1000 + if (timer > 0) this.data.countdownInterval = setTimeout(() => this.startCountdown(timer), 1000) + }, + + goPage(e) { + const url = e.currentTarget.dataset.url + common.goPage(url) + }, + } +}) \ No newline at end of file diff --git a/component/admission-box/admission-box.json b/component/admission-box/admission-box.json new file mode 100644 index 0000000..e8cfaaf --- /dev/null +++ b/component/admission-box/admission-box.json @@ -0,0 +1,4 @@ +{ + "component": true, + "usingComponents": {} +} \ No newline at end of file diff --git a/component/admission-box/admission-box.less b/component/admission-box/admission-box.less new file mode 100644 index 0000000..7556ab6 --- /dev/null +++ b/component/admission-box/admission-box.less @@ -0,0 +1,172 @@ +/* template/admission-box/admission-box.wxss */ +.flexflex { + display: flex; +} + +.flexcenter { + display: flex; + justify-content: center; + align-items: center; +} + +.flexjcenter { + display: flex; + justify-content: center; +} + +.flexacenter { + display: flex; + align-items: center; +} + +.flex1 { + flex: 1; +} + +.flexcolumn { + display: flex; + flex-direction: column; +} + +.admission-box { + box-sizing: border-box; + background: linear-gradient(-78.6688125977936deg, rgba(207, 247, 255, 1) -12%, rgba(239, 240, 209, 1) 45%, rgba(207, 247, 255, 1) 155%); + border: none; + border-radius: 24rpx; + padding: 12rpx 15rpx 0; + margin: 0 22.5rpx 30rpx; + + .head { + margin-bottom: 9rpx; + + .icon { + width: 230rpx; + height: 28rpx; + margin-right: 15rpx; + } + + .text { + width: 180rpx; + height: 30rpx; + border-radius: 9rpx; + position: relative; + font-size: 21rpx; + color: #FFFFFF; + z-index: 1; + + .bj { + width: 180rpx; + height: 30rpx; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: -1; + } + } + + .operate { + display: flex; + justify-content: flex-end; + align-items: center; + + .more { + font-size: 22.5rpx; + color: #026277; + text-align: center; + line-height: 39rpx; + height: 39rpx; + + .icon { + width: 21rpx; + height: 21rpx; + margin-left: 9rpx; + margin-right: 0; + vertical-align: middle; + } + } + + .count-down { + font-size: 18rpx; + color: #000000; + line-height: 39rpx; + display: flex; + justify-content: center; + align-items: center; + + .item { + width: 38rpx; + height: 38rpx; + margin: 0 5rpx; + background-color: rgba(2, 98, 119, 1); + background-color: rgba(249, 93, 93, 1); + border-radius: 19.5rpx; + font-size: 21rpx; + color: #FFFFFF; + } + } + } + } + + .content { + background-color: rgba(255, 255, 255, 1); + border-radius: 18rpx; + height: 120rpx; + + .item { + position: relative; + padding-left: 16.5rpx; + + .schoolimg-box { + width: 60rpx; + margin-right: 18rpx; + } + + .schoolimg { + width: 60rpx; + height: 60rpx; + } + + .title { + font-size: 26rpx; + color: #000000; + line-height: 39rpx; + font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif; + padding: 0 30rpx 0 0; + position: relative; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 2; + } + } + } + + .indicator { + height: 27rpx; + + .item { + width: 7.5rpx; + height: 7.5rpx; + background-color: rgba(215, 215, 215, 1); + border-radius: 30rpx; + + &:not(:last-of-type) { + margin-right: 7.5rpx; + } + + &.pitch { + background-color: rgba(250, 107, 17, 1); + } + } + } +} + +.admissionState { + width: 120rpx; + height: 36rpx; + vertical-align: middle; + margin-right: 16.5rpx; + margin-bottom: 5rpx; +} \ No newline at end of file diff --git a/component/admission-box/admission-box.wxml b/component/admission-box/admission-box.wxml new file mode 100644 index 0000000..03666e2 --- /dev/null +++ b/component/admission-box/admission-box.wxml @@ -0,0 +1,42 @@ + + + + + + + 招生官为你答疑 + + + + {{ countDown.days }}天 + {{ countDown.hours }}: + {{ countDown.minutes }}: + {{ countDown.seconds }} + + + more + + + + + + + + + + + + + + + + {{ item.title }} + + + + + + + + + \ No newline at end of file diff --git a/component/admission-box/admission-box.wxss b/component/admission-box/admission-box.wxss new file mode 100644 index 0000000..5ca3679 --- /dev/null +++ b/component/admission-box/admission-box.wxss @@ -0,0 +1,147 @@ +/* template/admission-box/admission-box.wxss */ +.flexflex { + display: flex; +} +.flexcenter { + display: flex; + justify-content: center; + align-items: center; +} +.flexjcenter { + display: flex; + justify-content: center; +} +.flexacenter { + display: flex; + align-items: center; +} +.flex1 { + flex: 1; +} +.flexcolumn { + display: flex; + flex-direction: column; +} +.admission-box { + box-sizing: border-box; + background: linear-gradient(-78.6688126deg, #cff7ff -12%, #eff0d1 45%, #cff7ff 155%); + border: none; + border-radius: 24rpx; + padding: 12rpx 15rpx 0; + margin: 0 22.5rpx 30rpx; +} +.admission-box .head { + margin-bottom: 9rpx; +} +.admission-box .head .icon { + width: 230rpx; + height: 28rpx; + margin-right: 15rpx; +} +.admission-box .head .text { + width: 180rpx; + height: 30rpx; + border-radius: 9rpx; + position: relative; + font-size: 21rpx; + color: #FFFFFF; + z-index: 1; +} +.admission-box .head .text .bj { + width: 180rpx; + height: 30rpx; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: -1; +} +.admission-box .head .operate { + display: flex; + justify-content: flex-end; + align-items: center; +} +.admission-box .head .operate .more { + font-size: 22.5rpx; + color: #026277; + text-align: center; + line-height: 39rpx; + height: 39rpx; +} +.admission-box .head .operate .more .icon { + width: 21rpx; + height: 21rpx; + margin-left: 9rpx; + margin-right: 0; + vertical-align: middle; +} +.admission-box .head .operate .count-down { + font-size: 18rpx; + color: #000000; + line-height: 39rpx; + display: flex; + justify-content: center; + align-items: center; +} +.admission-box .head .operate .count-down .item { + width: 38rpx; + height: 38rpx; + margin: 0 5rpx; + background-color: #026277; + background-color: #f95d5d; + border-radius: 19.5rpx; + font-size: 21rpx; + color: #FFFFFF; +} +.admission-box .content { + background-color: #ffffff; + border-radius: 18rpx; + height: 120rpx; +} +.admission-box .content .item { + position: relative; + padding-left: 16.5rpx; +} +.admission-box .content .item .schoolimg-box { + width: 60rpx; + margin-right: 18rpx; +} +.admission-box .content .item .schoolimg { + width: 60rpx; + height: 60rpx; +} +.admission-box .content .item .title { + font-size: 26rpx; + color: #000000; + line-height: 39rpx; + font-family: 'PingFangSC-Regular', 'PingFang SC', sans-serif; + padding: 0 30rpx 0 0; + position: relative; + display: -webkit-box; + -webkit-box-orient: vertical; + overflow: hidden; + text-overflow: ellipsis; + -webkit-line-clamp: 2; +} +.admission-box .indicator { + height: 27rpx; +} +.admission-box .indicator .item { + width: 7.5rpx; + height: 7.5rpx; + background-color: #d7d7d7; + border-radius: 30rpx; +} +.admission-box .indicator .item:not(:last-of-type) { + margin-right: 7.5rpx; +} +.admission-box .indicator .item.pitch { + background-color: #fa6b11; +} +.admissionState { + width: 120rpx; + height: 36rpx; + vertical-align: middle; + margin-right: 16.5rpx; + margin-bottom: 5rpx; +} diff --git a/component/goLogin/goLogin.js b/component/goLogin/goLogin.js index 952614a..7871dcf 100644 --- a/component/goLogin/goLogin.js +++ b/component/goLogin/goLogin.js @@ -139,7 +139,8 @@ Component({ wx.login({ success: res => { miucms.request("https://passport.gter.net/api/user/authorityInit", { - code: res.code + code: res.code, + appid: "wxd7ebf76a0a87057d" }).then(res => { console.log("res", res); diff --git a/component/rent-pop/rent-pop.wxml b/component/rent-pop/rent-pop.wxml index d62cd36..febbbfd 100644 --- a/component/rent-pop/rent-pop.wxml +++ b/component/rent-pop/rent-pop.wxml @@ -1,5 +1,4 @@ - @@ -36,7 +35,6 @@ - @ 学生公寓实景照片 diff --git a/component/toTop/toTop.wxss b/component/toTop/toTop.wxss index 3632a19..cfdfa41 100644 --- a/component/toTop/toTop.wxss +++ b/component/toTop/toTop.wxss @@ -1,24 +1,17 @@ .to-top-btn{ position: fixed; - /* right: 5px; */ right: 22rpx; bottom: 110px; display: flex; align-items: center; justify-content: center; - /* width: 50px; - height: 50px; */ width: 72rpx; height: 72rpx; - /* line-height:50px; */ - /* border:1px solid #e4e4e4; */ border-radius: 50%; background: rgba(0,0,0,0.4); z-index: 1003; } .to-top-btn image{ - /* width: 23px; */ width: 32rpx; height: 32rpx; - /* height: 23px; */ } \ No newline at end of file diff --git a/pages/projectLibrary/projectLibrary.js b/pages/projectLibrary/projectLibrary.js index 38ca572..bc92157 100644 --- a/pages/projectLibrary/projectLibrary.js +++ b/pages/projectLibrary/projectLibrary.js @@ -14,26 +14,19 @@ Page({ isFirstPattern: true, // 是否是首屏模式 classify: "school", // school subject current: 0, - discipline: [], // 学科 university: [], // 学校 - bezier: {}, - page: 1, list: [], listLeft: [], listRight: [], - fateProject: [], // 缘分项目 admissionList: [], // 招生官项目 contrastcount: 0, // 项目对比 数量 - - informationState: false, // 授权后可能需要弹出完成信息框 个人背景那些 islogin: false, isloginBtnState: false, - isInitFinish: false, user: {}, }, @@ -269,8 +262,6 @@ Page({ const query = this.createSelectorQuery(); if (status == 1) return - console.log("random", random); - query.select('#add' + random).boundingClientRect(); if (status == 0) { this.setData({ @@ -306,8 +297,6 @@ Page({ admissionList, }) } - - console.log("type", type); if (type === 'left') { const listLeft = this.data.listLeft if (listLeft[index]['contraststatus'] == null) listLeft[index]['contraststatus'] = {} @@ -374,36 +363,27 @@ Page({ appId: "wxa9296b07391c2bc7", path: "/pages/admissionList/admissionList" }) - // common.goPage("/pages/admissionList/admissionList") }, // 点击 查看 学校 goClassifyValue(e) { const classify = this.data.classify const value = e.currentTarget.dataset.value - const name = e.currentTarget.dataset.label let url = "" if (classify == 'school') url = `/pages/projectSchoolHomepage/projectSchoolHomepage?id=${value}` else url = `/pages/projectSubjectList/projectSubjectList?id=${value}` - common.goPage(url) }, // 点击项目详情 goDetails(e) { const uniqid = e.currentTarget.dataset.uniqid - const pageUrl = e.currentTarget.dataset.url - - let url = `/pages/projectDetails/projectDetails?uniqid=${uniqid}` - - common.goPage(url) + common.goPage(`/pages/projectDetails/projectDetails?uniqid=${uniqid}`) }, // 点击跳转群主 jumpGroup() { - // const url = "https://form.gter.net/D8i0iS5uXCWG#/qr" - // common.goPage(`/pages/webview/webview?url=${url}`) this.indexSidebar.setData({ groupState: true, }) @@ -426,8 +406,6 @@ Page({ }) } - - let sidebarState = this.indexSidebar.data.sidebarState if (scrollTop > this.windowHeight * 3 && sidebarState !== 3) sidebarState = 3 @@ -441,7 +419,6 @@ Page({ } this.indexSidebar.openSidebarTwoHide() - }, goPage(e) { @@ -538,7 +515,6 @@ Page({ listRight, }) } - }, addProject(e) { diff --git a/pages/projectLibrary/projectLibrary.json b/pages/projectLibrary/projectLibrary.json index 16ea275..8519f12 100644 --- a/pages/projectLibrary/projectLibrary.json +++ b/pages/projectLibrary/projectLibrary.json @@ -3,6 +3,7 @@ "header-nav": "/component/headerNav/headerNav", "xg-bottom": "/component/xg-bottom/xg-bottom", "go-login": "/component/goLogin/goLogin", - "index-sidebar": "/component/indexSidebar/indexSidebar" + "index-sidebar": "/component/indexSidebar/indexSidebar", + "admission-box": "/component/admission-box/admission-box" } } \ No newline at end of file diff --git a/pages/projectLibrary/projectLibrary.wxml b/pages/projectLibrary/projectLibrary.wxml index 939141e..414503f 100644 --- a/pages/projectLibrary/projectLibrary.wxml +++ b/pages/projectLibrary/projectLibrary.wxml @@ -43,10 +43,12 @@ {{ item.label }} - {{ item.label }} + {{ item.label }} + + 今日缘分项目 @@ -153,7 +155,6 @@ -