From 15e714f70804a970e5d4ef783688625e2ff6a37f Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Tue, 4 Apr 2023 14:40:11 +0800 Subject: [PATCH] =?UTF-8?q?a1300399510@qq.com=20=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E4=BA=8E=202023/04/04=20-14:40:01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SearchBox-冲突-肖荣豪_Win10.vue | 199 --- src/components/SearchBox.vue | 13 +- src/main-冲突-肖荣豪_Win10.js | 44 - src/main.js | 6 +- src/utils/common-冲突-肖荣豪_Win10.js | 75 - src/utils/common.js | 33 +- .../detail/detailIndex-冲突-肖荣豪_Win10.vue | 1240 ----------------- src/views/detail/detailIndex.vue | 231 ++- .../SearchResult-冲突-肖荣豪_Win10.vue | 332 ----- .../search/searchResult/SearchResult.vue | 123 +- ...OP-6MA514B_3月-31-231138-2023_Conflict.vue | 267 ---- .../user/UserIndex-冲突-肖荣豪_Win10.vue | 309 ---- src/views/user/UserIndex.vue | 64 +- 13 files changed, 371 insertions(+), 2565 deletions(-) delete mode 100755 src/components/SearchBox-冲突-肖荣豪_Win10.vue delete mode 100755 src/main-冲突-肖荣豪_Win10.js delete mode 100755 src/utils/common-冲突-肖荣豪_Win10.js delete mode 100755 src/views/detail/detailIndex-冲突-肖荣豪_Win10.vue delete mode 100755 src/views/search/searchResult/SearchResult-冲突-肖荣豪_Win10.vue delete mode 100755 src/views/search/searchResult/SearchResult_DESKTOP-6MA514B_3月-31-231138-2023_Conflict.vue delete mode 100755 src/views/user/UserIndex-冲突-肖荣豪_Win10.vue diff --git a/src/components/SearchBox-冲突-肖荣豪_Win10.vue b/src/components/SearchBox-冲突-肖荣豪_Win10.vue deleted file mode 100755 index 8c121fb..0000000 --- a/src/components/SearchBox-冲突-肖荣豪_Win10.vue +++ /dev/null @@ -1,199 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/components/SearchBox.vue b/src/components/SearchBox.vue index 29de112..8c121fb 100755 --- a/src/components/SearchBox.vue +++ b/src/components/SearchBox.vue @@ -30,9 +30,7 @@
热门搜索
- Bocconi - Bocconi - Bocconi + {{ item }}
@@ -49,7 +47,7 @@ export default { showClear: false, //显示清除按钮 } }, - props: ["issearch"], + props: ["issearch", "hotSearchkeywords"], methods: { collapseClick() { @@ -74,7 +72,12 @@ export default { // 清空文本框 clearText() { this.searchText = "" - } + }, + + // 跳转搜索结果 + toSearchResult(kw){ + this.$router.push(`/searchResult?kw=${kw}`) + }, }, mounted() { if (this.searchText.length > 0) this.showClear = true diff --git a/src/main-冲突-肖荣豪_Win10.js b/src/main-冲突-肖荣豪_Win10.js deleted file mode 100755 index 93b56bc..0000000 --- a/src/main-冲突-肖荣豪_Win10.js +++ /dev/null @@ -1,44 +0,0 @@ -import Vue from 'vue' -import App from './App.vue' -import router from './router' -import store from './store' -import ElementUI, { Message, Pagination } from 'element-ui'; -import 'element-ui/lib/theme-chalk/index.css'; -import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate } from "@/utils/common.js" -import http from "@/utils/request" -import hintBox from '@/components/Hintbox' - -Vue.config.productionTip = false - -Vue.prototype.$baseURL = "https://forum.gter.net/api" // 请求接口的共 url -Vue.prototype.$loginUrl = "https://passport.gter.net/" // 跳转登录的url - -Vue.prototype.$http = http // 跳转登录页面的方法 -Vue.prototype.$skipUrl = skipUrl // 跳转页面的公共方法 -Vue.prototype.$goTologin = goTologin // 跳转登录页面的方法 -// 上面的顺序不要修改 - -Vue.prototype.$pageStop = pageStop // 页面禁止滑动 -Vue.prototype.$pageMove = pageMove // 页面可以滑动 -Vue.prototype.$Message = Message // 消息提示框 -Vue.prototype.$copy = copy // 复制 -Vue.prototype.$startupUnderLoading = startupUnderLoading // 开启加载提示 element的 -Vue.prototype.$closeUnderLoading = closeUnderLoading // 关闭加载提示 element的 -Vue.prototype.$formattedDate = formattedDate // 时间戳转格式 - -//svg文件引入 -import './icons' -//动态设置fontsize -import './utils/fontSize.js' - -//ElementUI -Vue.use(ElementUI); -Vue.use(Pagination); - - - -new Vue({ - router, - store, - render: h => h(App) -}).$mount('#app') diff --git a/src/main.js b/src/main.js index 1aa5434..93b56bc 100755 --- a/src/main.js +++ b/src/main.js @@ -4,8 +4,9 @@ import router from './router' import store from './store' import ElementUI, { Message, Pagination } from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css'; -import { skipUrl, pageStop, pageMove, goTologin, copy } from "@/utils/common.js" +import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate } from "@/utils/common.js" import http from "@/utils/request" +import hintBox from '@/components/Hintbox' Vue.config.productionTip = false @@ -21,6 +22,9 @@ Vue.prototype.$pageStop = pageStop // 页面禁止滑动 Vue.prototype.$pageMove = pageMove // 页面可以滑动 Vue.prototype.$Message = Message // 消息提示框 Vue.prototype.$copy = copy // 复制 +Vue.prototype.$startupUnderLoading = startupUnderLoading // 开启加载提示 element的 +Vue.prototype.$closeUnderLoading = closeUnderLoading // 关闭加载提示 element的 +Vue.prototype.$formattedDate = formattedDate // 时间戳转格式 //svg文件引入 import './icons' diff --git a/src/utils/common-冲突-肖荣豪_Win10.js b/src/utils/common-冲突-肖荣豪_Win10.js deleted file mode 100755 index 7ec7c9d..0000000 --- a/src/utils/common-冲突-肖荣豪_Win10.js +++ /dev/null @@ -1,75 +0,0 @@ -// a标签 跳转 isblank 代表跳转新标签 -function skipUrl(url, isblank = true) { - console.log(); - let aTab = document.createElement("a"); - document.body.appendChild(aTab); - aTab.setAttribute("href", url); - if (isblank) aTab.setAttribute("target", "_blank"); - aTab.click(); -} - - -// 禁止页面滑动 -function pageStop() { - document.body.style.overflow = "hidden"; -} - -// 开启页面滑动 -function pageMove() { - document.body.style.overflow = ""; -} - -// 跳转登录 -function goTologin() { - let url = encodeURIComponent(location.href); - console.log(skipUrl); - skipUrl(`https://passport.gter.net/?referer=${url}`, false); -} - -// 点击复制 -function copy(value, message) { - // 创建一个新的输入元素 - let copyInput = document.createElement('input'); - // 将输入元素添加到文档的主体中 - document.body.appendChild(copyInput); - // 将输入元素的值设置为需要复制的URL - copyInput.setAttribute('value', value); - // 选择输入元素 - copyInput.select(); - // 使用clipboard API将所选文本复制到剪贴板 - navigator.clipboard.writeText(copyInput.value); - // 向用户显示成功消息 - // 从文档中删除动态创建的输入元素 - copyInput.remove(); - if (message) this.$message.success(message); - -} - - -// 启动加载中 -function startupUnderLoading(that) { - that.loading = that.$loading({ - lock: true, - text: '加载中...', - background: 'rgba(0, 0, 0, 0.7)' - }); -} - -// 关闭加载中 -function closeUnderLoading(that) { - that.loading.close(); -} - -// 时间戳 -function formattedDate(timestamp) { - const date = new Date(timestamp * 1000); - const year = date.getFullYear(); - const month = String(date.getMonth() + 1).padStart(2, '0'); - const day = String(date.getDate()).padStart(2, '0'); - const hours = String(date.getHours()).padStart(2, '0') - const minutes = String(date.getMinutes()).padStart(2, '0'); - const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`; - return formattedDate -} - -export { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate } \ No newline at end of file diff --git a/src/utils/common.js b/src/utils/common.js index d41c461..7ec7c9d 100755 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -41,10 +41,35 @@ function copy(value, message) { // 向用户显示成功消息 // 从文档中删除动态创建的输入元素 copyInput.remove(); - if (message) this.$message.success(message); - - + } -export { skipUrl, pageStop, pageMove, goTologin, copy } \ No newline at end of file + +// 启动加载中 +function startupUnderLoading(that) { + that.loading = that.$loading({ + lock: true, + text: '加载中...', + background: 'rgba(0, 0, 0, 0.7)' + }); +} + +// 关闭加载中 +function closeUnderLoading(that) { + that.loading.close(); +} + +// 时间戳 +function formattedDate(timestamp) { + const date = new Date(timestamp * 1000); + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + const hours = String(date.getHours()).padStart(2, '0') + const minutes = String(date.getMinutes()).padStart(2, '0'); + const formattedDate = `${year}-${month}-${day} ${hours}:${minutes}`; + return formattedDate +} + +export { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate } \ No newline at end of file diff --git a/src/views/detail/detailIndex-冲突-肖荣豪_Win10.vue b/src/views/detail/detailIndex-冲突-肖荣豪_Win10.vue deleted file mode 100755 index 4d8390e..0000000 --- a/src/views/detail/detailIndex-冲突-肖荣豪_Win10.vue +++ /dev/null @@ -1,1240 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/detail/detailIndex.vue b/src/views/detail/detailIndex.vue index 23de242..dfe0916 100755 --- a/src/views/detail/detailIndex.vue +++ b/src/views/detail/detailIndex.vue @@ -4,24 +4,24 @@
版块:香港澳门台湾留学申请
- 10378 + {{ info.views }}
- 16 + {{ info.replies }}
-
精华
-
生活贴士
- 香港永久居民的申请步骤和过程 +
精华
+
{{ info.typename }}
+ {{ info.subject }}
- -
+ +
@@ -32,54 +32,95 @@
楼主
+
+
+ Offer {{ index + 1 }} + 详情 +
+
+
+
+ 申请学校 +
+
+ 韦仕敦大学 +
+
+
+
+ 学位 +
+
+ MA +
+
+
+
+ 专业 +
+
+ Curriculum study +
+
+
+ +
- Offer1 + 总结 详情
+
+
-
- 查看当前捷报详情 + + 查看当前总结详情
-
+
- + -
+
- +
-
闫旭Mike
-
2022-7-6 14:56
+
{{ info.author }}
+
{{ $formattedDate(info.dateline) }}
楼主
- +
@@ -191,7 +232,6 @@
-
@@ -217,11 +257,6 @@ export default { } }, - info: { - avatar: "https://oss.gter.net/avatar/97KwEWANd_4DHWiY6VbnSUFSCKroYWFjYQ~~/middle", - likenum: 1 - }, - islogin: true, prepareLiskeState: false, prepareLiskeAnimateState: false, @@ -233,15 +268,116 @@ export default { ispostOfferLike: null, // 点击点赞提交状态 offerLikesumTimer: 0, // offer点赞累加定时器 offerLikesumAnimateTimer: 0, // offer点赞动画定时器 - listlist: [] + listlist: [], + + tid: 0, // 帖子id + info: {}, + type: 0, // 定位帖 1 面经 2 租房帖 3 总结 5 捷报 6 + token: "", + offerinfo: {}, // offer捷报详情 + offerinfoKey: [{ + key: "schoolname", + name: "申请学校" + }, { + key: "degree", + name: "学位" + }, { + key: "professional", + name: "专业" + }, { + key: "project", + name: "项目" + }, { + key: "apply_results", + name: "申请结果" + }, { + key: "semester", + name: "入学学期" + }, { + key: "noticedate", + name: "通知时间" + }, { + key: "useperformanceStr", + name: "使用成绩" + }], + shareurl: "", // 分享链接 + collegelist: [],// 总结里的 offer 列表数据 + + }; }, mounted() { + this.tid = this.$route.query['tid'] + this.getDetail() + }, methods: { - // 点击点赞 + + // 获取详细信息 + getDetail() { + this.$http.post("/api/thread", { + tid: this.tid + }).then(res => { + if (res.code != 200) return + + let data = res.data + console.log("data", data); + this.info = data.info + this.type = data.type + this.token = data.token + + if (this.type == 6) this.getOfferDetail() + else if (this.type == 5) this.getsummaryDetails() + + }) + }, + + // 获取offer详情 + getOfferDetail() { + this.$http.post("/api/details", { + token: this.token + }, 'offer').then(res => { + let data = res.data + let offerinfo = data.offerinfo + let useperformanceStr = "" + offerinfo.useperformance && offerinfo.useperformance.forEach((el, index) => { + useperformanceStr += el + (offerinfo.useperformance.length - 1 == index ? '' : '、') + }) + + offerinfo['useperformanceStr'] = useperformanceStr + offerinfo['schoolname'] = offerinfo.school.name + + this.offerinfo = offerinfo + this.shareurl = data.shareurl + }) + }, + + // 获取总结详情 + getsummaryDetails() { + this.$http.get(`/api/forum/details`, { + id: this.token + }, 'offer').then(res => { + let data = res.data + let collegelist = data.collegelist + + collegelist.forEach((el, index) => { + let useperformanceStr = "" + el.useperformance && el.useperformance.forEach((element, i) => { + useperformanceStr += element + (el.useperformance.length - 1 == i ? '' : '、') + }) + el['useperformanceStr'] = useperformanceStr + }) + + + this.info = { ...this.info, ...data.info } + console.log(this.info); + this.collegelist = collegelist + this.shareurl = data.shareurl + }) + }, + // 点击点赞 tapLike() { @@ -616,6 +752,7 @@ export default { .summary-content-item { border-radius: .16rem; border: .0133rem solid rgba(235, 235, 235, 1); + margin-bottom: .32rem; .summary-offer-head { justify-content: space-between; @@ -624,7 +761,7 @@ export default { color: #333; padding: 0 .24rem; - span { + span,a { font-size: .32rem; color: #333; } @@ -643,6 +780,38 @@ export default { } + .summary-offer-box { + padding-top: .28rem; + flex-direction: column; + justify-items: center; + + .summary-offer-item { + line-height: .6rem; + padding: 0 .24rem; + box-sizing: border-box; + margin-bottom: .2rem; + + .summary-offer-key { + width: 1.3rem; + color: #7f7f7f; + font-size: .32rem; + margin-right: .74rem; + } + + .summary-offer-value { + font-size: .36rem; + color: #333; + } + } + } + + .summary-wenzi { + color: #333; + font-size: .32rem; + line-height: .6rem; + padding: .28rem .24rem; + } + } } diff --git a/src/views/search/searchResult/SearchResult-冲突-肖荣豪_Win10.vue b/src/views/search/searchResult/SearchResult-冲突-肖荣豪_Win10.vue deleted file mode 100755 index 7733e26..0000000 --- a/src/views/search/searchResult/SearchResult-冲突-肖荣豪_Win10.vue +++ /dev/null @@ -1,332 +0,0 @@ - - - - - diff --git a/src/views/search/searchResult/SearchResult.vue b/src/views/search/searchResult/SearchResult.vue index 695b1af..7733e26 100755 --- a/src/views/search/searchResult/SearchResult.vue +++ b/src/views/search/searchResult/SearchResult.vue @@ -4,64 +4,61 @@
- - + +
取消
-
大约找到
{{ 800 }}
条结果
+
大约找到
{{ count }}
条结果
-
-
+
+
-
租房租房租房
-
诚招室友一起合租香港大学附近房子 女生
+
{{ item.forum }}
+ +
-
- +
-
- 回复可见 -
-
- - -
+
-
1552
+
{{ item.views }}
-
12
+
{{ item.replies }}
-
+
精华
-
-
- +
+ +
+ +
+
@@ -73,13 +70,33 @@ export default { name: "SearchResult", data() { return { - + kw: "", + count: 0, + limit: 4, + nextpage: true, + page: 1, + list: [], + searchResultState: false, + loading: null } }, components: { }, + mounted() { + this.kw = this.$route.query.kw + this.getSearchResult() + }, + + watch: { + searchResultState(val, oldval) { + if (val) this.$startupUnderLoading(this) + else this.$closeUnderLoading(this) + } + }, + + methods: { // 处理点击取消的返回上一页 handCancel() { @@ -87,6 +104,39 @@ export default { if (this.$route.params.page > 1) this.$router.go(-1) else this.$router.push('/recommend') }, + + // 获取搜索结果数据 + getSearchResult() { + if (this.searchResultState) return + this.searchResultState = true + this.$http.post("/api/search", { + keyword: this.kw, + page: this.page, + limit: this.limit + }).then(res => { + console.log(res, "res"); + let data = res.data + this.list = data.data + this.count = data.count + + document.documentElement.scrollTop = 0; + document.body.scrollTop = 0; + this.searchResultState = false + }) + }, + + // 点击改变页数 + currentChange() { + this.getSearchResult() + }, + + + + // 点击清空 input 的值 + emptyKw() { + this.kw = "" + }, + }, } @@ -94,6 +144,7 @@ export default { diff --git a/src/views/search/searchResult/SearchResult_DESKTOP-6MA514B_3月-31-231138-2023_Conflict.vue b/src/views/search/searchResult/SearchResult_DESKTOP-6MA514B_3月-31-231138-2023_Conflict.vue deleted file mode 100755 index 03656f4..0000000 --- a/src/views/search/searchResult/SearchResult_DESKTOP-6MA514B_3月-31-231138-2023_Conflict.vue +++ /dev/null @@ -1,267 +0,0 @@ - - - - - diff --git a/src/views/user/UserIndex-冲突-肖荣豪_Win10.vue b/src/views/user/UserIndex-冲突-肖荣豪_Win10.vue deleted file mode 100755 index a8153eb..0000000 --- a/src/views/user/UserIndex-冲突-肖荣豪_Win10.vue +++ /dev/null @@ -1,309 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/views/user/UserIndex.vue b/src/views/user/UserIndex.vue index 8684d87..a8153eb 100755 --- a/src/views/user/UserIndex.vue +++ b/src/views/user/UserIndex.vue @@ -2,24 +2,24 @@
- +
-
{{ info.nickname }}
+
{{ user.nickname }}
-
279
+
{{ count.prestige }}
声望
-
279
-
声望
+
{{ count.gtercurrency }}
+
寄托币
-
279
-
声望
+
{{ count.digest }}
+
精华
@@ -29,8 +29,8 @@ 消息
-
{{ count.collect }}
-
{{ 1 }}
+
{{ count.message }}
+
{{ user.messagenum }}
@@ -40,7 +40,7 @@ 收藏
-
{{ count.creation }}
+
{{ count.fav }}
@@ -49,7 +49,7 @@ 发帖
-
{{ count.likearticle }}
+
{{ count.post }}
@@ -58,7 +58,7 @@ 回帖
-
{{ count.comment }}
+
{{ count.reply }}
@@ -70,7 +70,6 @@ 个人资料
-
{{ count.creation }}
@@ -79,7 +78,6 @@ 设置头像
-
{{ count.likearticle }}
@@ -88,7 +86,6 @@ 我的状态
-
{{ count.comment }}
@@ -97,7 +94,6 @@ 修改密码
-
{{ count.comment }}
@@ -106,7 +102,6 @@ 绑定邮箱
-
{{ count.comment }}
@@ -115,7 +110,6 @@ 绑定手机
-
{{ count.comment }}
@@ -124,7 +118,6 @@ 绑定第三方账号
-
{{ count.comment }}
@@ -133,7 +126,6 @@ 浏览个人主页
-
{{ count.comment }}
@@ -141,7 +133,7 @@ -
退出登录
+
退出登录
@@ -152,26 +144,36 @@ export default { data() { return { - info: { - avatar: "https://oss.gter.net/avatar/97KwEWANd_4DHWiY6VbnSUFSCKroYWFjYQ~~/middle", - nickname: "Ada.Wu" - }, - count: { - collect: 10, - creation: 10, - likearticle: 10, - comment: 10, + user: { + avatar: "", + nickname: "", + messagenum: 0 }, + count: {}, }; }, mounted() { - + this.init() }, methods: { + init() { + this.$http.post("/api/user", "").then(res => { + console.log(res, "res"); + let data = res.data + this.count = data.count + this.user = data.user + console.log(this.count); + }) + }, + + // 点击退出登录 + logOut() { + console.log("点击退出登录"); + }, }, };