a1300399510@qq.com 提交于 2023/04/04 -15:40:01

This commit is contained in:
XiaoMo 2023-04-04 15:40:10 +08:00
parent 0889c66755
commit 4064f39b37
2 changed files with 254 additions and 195 deletions

View File

@ -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({

View File

@ -20,21 +20,7 @@
<!-- -->
<div class="card flexcenter">
<!-- 总结开始 -->
<!-- <div class="card-item shadow" v-if="type == 5">
<div class="card-head flexacenter">
<img class="card-head-icon" :src="info.avatar" />
<div class="card-head-content flex1 flexflex">
<div class="card-head-name flexflex">{{ info.author }}</div>
<div class="card-head-time">{{ $formattedDate(info.dateline) }}</div>
</div>
<div class="card-head-fool">楼主</div>
</div>
</div> -->
<!-- 总结结束 -->
<!-- offer -->
<div class="card-item shadow">
<div class="card-head flexacenter">
<img class="card-head-icon" :src="info.avatar" />
@ -52,36 +38,13 @@
<a class="flexacenter" :href="item.url">详情<svg-icon icon-class="arrowsBlackLeft"
class-name="summary-offer-head-icon"></svg-icon></a>
</div>
<!-- {{ item }} -->
<div class="summary-offer-box">
<template v-for="(it, i) in offerinfoKey">
<div class="summary-offer-item flexacenter" :key="i" v-if="item[it.key]">
<div class="summary-offer-key flexacenter">
{{ it.name }}
</div>
<div class="summary-offer-value flexacenter">
{{ item[it.key] }}
</div>
<div class="summary-offer-key flexacenter">{{ it.name }}</div>
<div class="summary-offer-value flexacenter">{{ item[it.key] }}</div>
</div>
</template>
<div class="summary-offer-item flexacenter">
<div class="summary-offer-key flexacenter">
学位
</div>
<div class="summary-offer-value flexacenter">
MA
</div>
</div>
<div class="summary-offer-item flexacenter">
<div class="summary-offer-key flexacenter">
专业
</div>
<div class="summary-offer-value flexacenter">
Curriculum study
</div>
</div>
</div>
</div>
@ -92,10 +55,8 @@
class-name="summary-offer-head-icon"></svg-icon></a>
</div>
<div class="summary-wenzi" v-html="info.message"></div>
</div>
<a class="examine-btn flexcenter" :href="info.url">
查看当前总结详情
<div class="examine-btn-outside flexcenter">
@ -123,26 +84,27 @@
</a>
</div>
</template>
<template>
<div class="card-content" v-html="info.message"></div>
</template>
<template v-else>
<!-- <div class="card-content" v-html="info.message"></div> -->
<div class="offer-content">
<div class="offer-content-box">
<template v-for="(item, index) in offerinfoKey">
<div class="offer-content-item flexacenter" :key="index" v-if="offerinfo[item.key]">
<div class="offer-content-key" v-if="offerinfo[item.key]">{{ item.name }}</div>
<div class="offer-content-value">{{ offerinfo[item.key] }}</div>
</div>
</template>
</div>
</div>
<!-- offer结束 -->
<!-- <div class="card-item shadow">
<div class="card-head flexacenter">
<img class="card-head-icon" :src="info.avatar" />
<div class="card-head-content flex1 flexflex">
<div class="card-head-name flexflex">{{ info.author }}</div>
<div class="card-head-time">{{ $formattedDate(info.dateline) }}</div>
<a class="examine-btn flexcenter" :href="shareurl">
查看当前捷报详情
<div class="examine-btn-outside flexcenter">
<svg-icon icon-class="arrowsRoundBlackLeft" class-name="examine-btn-icon"></svg-icon>
</div>
</a>
</div>
<div class="card-head-fool">楼主</div>
</div>
<div class="card-content flex1" v-html="info.message"></div>
</div> -->
</template>
</div>
<div class="card-item shadow" v-for="(item, index) in 7" :key="index">
<div class="card-head flexacenter">
@ -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 > 出租方式:</th>
<td v-text="info.gptype +'>>'+ info.type"></td>
</tr >
<tr>
<th><span v-text="info.rentalperiod">月</span>租/<span v-text="info.currency || '港元'"></span>:</th>
<td v-text="info.rent || info.money"></td>
</tr>
<tr>
<th>房屋类型:</th>
<td v-text="info.property"></td>
</tr>
<tr>
<th>所在楼层:</th>
<td v-text="info.floor"></td>
</tr>
<tr>
<th>面积平方呎:</th>
<td v-text="info.acreage"></td>
</tr>
<tr v-if="info.cityid==1">
<th>所在区域:</th>
<td v-text="info.location"></td>
</tr>
<tr v-if="info.cityid!=1">
<th>所在区域:</th>
<td v-text="info.country+'>>'+info.city"></td>
</tr>
<tr>
<th>地段/地址:</th>
<td v-text="info.address ||'-'"></td>
</tr>
<tr v-if=" info.school && info.school.length > 0 ">
<th>附近学校:</th>
<td >
<ul class="school-list">
<li v-for="s in info.school">
<span>{{ s.name }}</span>
<span>{{ s.distance }}</span>
</li>
</ul>
</td>
</tr>
<tr>
<th>性别要求:</th>
<td v-text="info.gender"></td>
</tr>
<tr>
<th>出租时长:</th>
<td v-text="info.rentalduration?info.rentalduration:'不限'"></td>
</tr>
<tr>
<th>房东或合租人介绍:</th>
<td v-html="info.introduction"></td>
</tr>
<tr>
<th>发布者身份:</th>
<td v-text="info.intermediary_text"></td>
</tr>
<tr>
<th>电话:</th>
<td v-text="info.tel || '-'"></td>
</tr>
<tr>
<th>微信:</th>
<td>
<span v-text="info.wechat || '-'"></span>
<span v-if="info.iswechattype==2" @click="showBig(info.wechatdata.url)">
<svg class="wechat-svg" t="1655977827199" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2209" width="32" height="32"><path d="M597.333333 597.333333h85.333334v-85.333333h85.333333v128h-85.333333v42.666667h-85.333334v-42.666667h-85.333333v-128h85.333333v85.333333z m-384-85.333333h256v256H213.333333v-256z m85.333334 85.333333v85.333334h85.333333v-85.333334H298.666667zM213.333333 213.333333h256v256H213.333333V213.333333z m85.333334 85.333334v85.333333h85.333333V298.666667H298.666667z m213.333333-85.333334h256v256h-256V213.333333z m85.333333 85.333334v85.333333h85.333334V298.666667h-85.333334z m85.333334 384h85.333333v85.333333h-85.333333v-85.333333z m-170.666667 0h85.333333v85.333333h-85.333333v-85.333333z" fill="#444444" p-id="2210"></path></svg>
</span>
</td>
</tr >
<tr>
<th>WhatsApp:</th>
<td v-text="info.whatsapp || '-'"></td>
</tr>
};
},
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
}
};
</script>