From 159d3978fcca4f2a2ca3330b07af6c2a8f60d82a Mon Sep 17 00:00:00 2001 From: XiaoMo Date: Tue, 4 Apr 2023 16:20: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-16:20:02?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/detail/detailIndex.vue | 563 +++++++++++++++---------------- 1 file changed, 280 insertions(+), 283 deletions(-) diff --git a/src/views/detail/detailIndex.vue b/src/views/detail/detailIndex.vue index 15d20a8..f3aba02 100755 --- a/src/views/detail/detailIndex.vue +++ b/src/views/detail/detailIndex.vue @@ -88,80 +88,77 @@
-
-
-
- -
-
闫旭Mike
楼主 +
@@ -289,262 +286,262 @@ export default { tenementKey: [{ // 租房 字段汇总 key: "type", name: "出租方式" - },{ + }, { key: "currency", name: "出租方式" },] - < th > 出租方式: - - - -租/: - - - -房屋类型: - - - -所在楼层: - - - -面积(平方呎): - - - -所在区域: - - - -所在区域: - - - -地段/地址: - - - -附近学校: - -
    -
  • -{{ s.name }} -{{ s.distance }} -
  • -
- - - -性别要求: - - - -出租时长: - - - -房东或合租人介绍: - - - -发布者身份: - - - -电话: - - - -微信: - - - - - - - - - WhatsApp: - - + // < 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() - - }) + }; }, - // 获取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 ? '' : '、') + 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() + }) + }, - 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) => { + // 获取offer详情 + getOfferDetail() { + this.$http.get("/api/forum/detail", { + id: this.token + }, 'offer').then(res => { + let data = res.data + let offerinfo = data.offerinfo let useperformanceStr = "" - el.useperformance && el.useperformance.forEach((element, i) => { - useperformanceStr += element + (el.useperformance.length - 1 == i ? '' : '、') + offerinfo.useperformance && offerinfo.useperformance.forEach((el, index) => { + useperformanceStr += el + (offerinfo.useperformance.length - 1 == index ? '' : '、') }) - el['useperformanceStr'] = useperformanceStr + + 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 - }) - }, + 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"); - }) - }, + // 获取租房详情 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 - // }) - // }) + // 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("点击收藏"); + } }, + components: { + DetailReply, Coins - // 点击转发 - transmit() { - let value = location.href - this.$copy(value, "已经复制链接,欢迎分享!") - }, - - setValue(key, value) { - this[key] = value - }, - - // 收藏 - postcollect() { - console.log("点击收藏"); } - -}, - -components: { - DetailReply, Coins - -} };