From 4064f39b37fba1b0614d93156261bc89e273ab21 Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Tue, 4 Apr 2023 15:40:10 +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-15:40:01?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/request.js | 2 + src/views/detail/detailIndex.vue | 447 +++++++++++++++++-------------- 2 files changed, 254 insertions(+), 195 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index e73b80f..0fa4b32 100755 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -13,6 +13,8 @@ axios.defaults.emulateJSON = true baseURL = { forum: "https://forum.gter.net", offer: "https://offer.gter.net", + tenement: "https://app.gter.net", + } const service = axios.create({ diff --git a/src/views/detail/detailIndex.vue b/src/views/detail/detailIndex.vue index 054eecb..15d20a8 100755 --- a/src/views/detail/detailIndex.vue +++ b/src/views/detail/detailIndex.vue @@ -20,21 +20,7 @@
- - - - -
@@ -52,36 +38,13 @@ 详情
-
- -
-
- 学位 -
-
- MA -
-
-
-
- 专业 -
-
- Curriculum study -
-
@@ -92,10 +55,8 @@ class-name="summary-offer-head-icon">
- - 查看当前总结详情
@@ -123,26 +84,27 @@
- + +
@@ -297,7 +259,7 @@ export default { type: 0, // 定位帖 1 面经 2 租房帖 3 总结 5 捷报 6 token: "", offerinfo: {}, // offer捷报详情 - offerinfoKey: [{ + offerinfoKey: [{ // offer 字段汇总 key: "schoolname", name: "申请学校" }, { @@ -324,170 +286,265 @@ export default { }], shareurl: "", // 分享链接 collegelist: [],// 总结里的 offer 列表数据 + tenementKey: [{ // 租房 字段汇总 + key: "type", + name: "出租方式" + },{ + key: "currency", + name: "出租方式" + },] - }; + < th > 出租方式: + + + +租/: + + + +房屋类型: + + + +所在楼层: + + + +面积(平方呎): + + + +所在区域: + + + +所在区域: + + + +地段/地址: + + + +附近学校: + +
    +
  • +{{ s.name }} +{{ s.distance }} +
  • +
+ + + +性别要求: + + + +出租时长: + + + +房东或合租人介绍: + + + +发布者身份: + + + +电话: + + + +微信: + + + + + + + + + WhatsApp: + + + + }; +}, + +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() + else if (this.type == 0) this.getTenementDetails() + + }) }, - 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.get("/api/forum/detail", { + id: 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 ? '' : '、') }) - }, - // 获取offer详情 - getOfferDetail() { - this.$http.get("/api/forum/detail", { - id: this.token - }, 'offer').then(res => { - let data = res.data - let offerinfo = data.offerinfo + 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 = "" - offerinfo.useperformance && offerinfo.useperformance.forEach((el, index) => { - useperformanceStr += el + (offerinfo.useperformance.length - 1 == index ? '' : '、') + el.useperformance && el.useperformance.forEach((element, i) => { + useperformanceStr += element + (el.useperformance.length - 1 == i ? '' : '、') }) - - offerinfo['useperformanceStr'] = useperformanceStr - offerinfo['schoolname'] = offerinfo.school.name - - this.offerinfo = offerinfo - this.shareurl = data.shareurl + el['useperformanceStr'] = useperformanceStr }) - }, - - // 获取总结详情 - 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 - }) - }, + this.info = { ...this.info, ...data.info } + console.log(this.info); + this.collegelist = collegelist + this.shareurl = data.shareurl + }) + }, + + // 获取租房详情 https://app.gter.net/tenement/forum/show + getTenementDetails() { + console.log("ggjlgjkgj"); + this.$http.post("/tenement/forum/show", { + // tid: 2540476 + token: this.token + }, "tenement").then(res => { + console.log(res, "res"); + }) + }, - // 点击点赞 - tapLike() { - this.isState = true - this.prepareLiskeState = true - this.prepareLiskeAnimateState = true + // 点击点赞 + tapLike() { + this.isState = true + this.prepareLiskeState = true + this.prepareLiskeAnimateState = true - clearTimeout(this.offerLikesumTimer) - clearTimeout(this.offerLikesumAnimateTimer) + clearTimeout(this.offerLikesumTimer) + clearTimeout(this.offerLikesumAnimateTimer) - let praiseBubble = document.getElementById("praise_bubble"); - console.log("praiseBubble", praiseBubble); - let last = 0; - let b = Math.floor(Math.random() * 8) + 1; // 1 到 7的 图片 - // b = 1; // 测试写固定的 - const bl = Math.floor(Math.random() * 11) + 1; // bl1~bl11 - let d = document.createElement("div"); - d.style.backgroundImage = `url('./img/bg${b}.png')` - d.style.backgroundSize = 'contain' - d.className = `bubble`; - // d.style.animation = `bubble_${bl} 1.5s linear 1 forwards, bubble_big_${Math.floor(Math.random() * 3) + 1} 0.8s linear 1 forwards, bubble_y 1.5s linear 1 forwards` + let praiseBubble = document.getElementById("praise_bubble"); + console.log("praiseBubble", praiseBubble); + let last = 0; + let b = Math.floor(Math.random() * 8) + 1; // 1 到 7的 图片 + // b = 1; // 测试写固定的 + const bl = Math.floor(Math.random() * 11) + 1; // bl1~bl11 + let d = document.createElement("div"); + d.style.backgroundImage = `url('./img/bg${b}.png')` + d.style.backgroundSize = 'contain' + d.className = `bubble`; + // d.style.animation = `bubble_${bl} 1.5s linear 1 forwards, bubble_big_${Math.floor(Math.random() * 3) + 1} 0.8s linear 1 forwards, bubble_y 1.5s linear 1 forwards` - d.dataset.t = String(Date.now()); - praiseBubble.appendChild(d); + d.dataset.t = String(Date.now()); + praiseBubble.appendChild(d); - // this.$forceUpdate() + // this.$forceUpdate() - this.stat.like++ - this.prepareLiskeNum++ - this.offerLikesumAnimateTimer = setTimeout(() => { - this.prepareLiskeAnimateState = false - }, 500) - this.offerLikesumTimer = setTimeout(() => { - this.ispostOfferLike = false - this.postOfferLike() - }, 2000) - }, + this.stat.like++ + this.prepareLiskeNum++ + this.offerLikesumAnimateTimer = setTimeout(() => { + this.prepareLiskeAnimateState = false + }, 500) + this.offerLikesumTimer = setTimeout(() => { + this.ispostOfferLike = false + this.postOfferLike() + }, 2000) + }, - postOfferLike() { - if (this.ispostOfferLike) return - this.ispostOfferLike = true + postOfferLike() { + if (this.ispostOfferLike) return + this.ispostOfferLike = true - this.offerLikesum = 0 + this.offerLikesum = 0 - this.prepareLiskeState = false - let key = new Date().getTime() + '' - // let num = util.base64_encode(key + util.base64_encode(this.data.prepareLiskeNum + '')) + this.prepareLiskeState = false + let key = new Date().getTime() + '' + // let num = util.base64_encode(key + util.base64_encode(this.data.prepareLiskeNum + '')) - // util.wxpost("/miniprogramApi/offer/behaviour/like", { - // token: this.data.token, - // num, - // key - // }).then(res => { - // if (res.code != 200) return - // let data = res.data - // this.offerLikesum = 0 - // }).finally(() => { - // this.setData({ - // prepareLiskeState: false - // }) - // }) - - }, - - - // 点击转发 - transmit() { - let value = location.href - this.$copy(value, "已经复制链接,欢迎分享!") - }, - - setValue(key, value) { - this[key] = value - }, - - // 收藏 - postcollect() { - console.log("点击收藏"); - } + // util.wxpost("/miniprogramApi/offer/behaviour/like", { + // token: this.data.token, + // num, + // key + // }).then(res => { + // if (res.code != 200) return + // let data = res.data + // this.offerLikesum = 0 + // }).finally(() => { + // this.setData({ + // prepareLiskeState: false + // }) + // }) }, - components: { - DetailReply, Coins + // 点击转发 + transmit() { + let value = location.href + this.$copy(value, "已经复制链接,欢迎分享!") + }, + + setValue(key, value) { + this[key] = value + }, + + // 收藏 + postcollect() { + console.log("点击收藏"); } + +}, + +components: { + DetailReply, Coins + +} };