no message
This commit is contained in:
parent
27d89922da
commit
4607702bdc
6
assets/img/eye-icon.svg
Normal file
6
assets/img/eye-icon.svg
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<svg version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink" width="13px" height="8px" xmlns="http://www.w3.org/2000/svg">
|
||||
<g transform="matrix(1 0 0 1 -1497 -272 )">
|
||||
<path d="M 9.65206473214286 6.26736111111111 C 10.6217447916667 5.70486111111111 11.4281994047619 4.94907407407407 12.0714285714286 4 C 11.3363095238095 2.90740740740741 10.4149925595238 2.09027777777778 9.30747767857143 1.54861111111111 C 9.60249255952381 2.03009259259259 9.75 2.55092592592593 9.75 3.11111111111111 C 9.75 3.96759259259259 9.43201264880952 4.70023148148148 8.79603794642857 5.30902777777778 C 8.16006324404762 5.91782407407407 7.39471726190476 6.22222222222222 6.5 6.22222222222222 C 5.60528273809524 6.22222222222222 4.83993675595238 5.91782407407407 4.20396205357143 5.30902777777778 C 3.56798735119048 4.70023148148148 3.25 3.96759259259259 3.25 3.11111111111111 C 3.25 2.55092592592593 3.39750744047619 2.03009259259259 3.69252232142857 1.54861111111111 C 2.58500744047619 2.09027777777778 1.66369047619048 2.90740740740741 0.928571428571428 4 C 1.5718005952381 4.94907407407407 2.37825520833333 5.70486111111111 3.34793526785714 6.26736111111111 C 4.31761532738095 6.82986111111111 5.36830357142857 7.11111111111111 6.5 7.11111111111111 C 7.63169642857143 7.11111111111111 8.68238467261905 6.82986111111111 9.65206473214286 6.26736111111111 Z M 6.74665178571429 1.56944444444444 C 6.81436011904762 1.50462962962963 6.84821428571429 1.42592592592593 6.84821428571429 1.33333333333333 C 6.84821428571429 1.24074074074074 6.81436011904762 1.16203703703704 6.74665178571429 1.09722222222222 C 6.67894345238095 1.03240740740741 6.59672619047619 0.999999999999999 6.5 1 C 5.89546130952381 0.999999999999999 5.37676711309524 1.20717592592593 4.94391741071429 1.62152777777778 C 4.51106770833333 2.03587962962963 4.29464285714286 2.53240740740741 4.29464285714286 3.11111111111111 C 4.29464285714286 3.2037037037037 4.32849702380952 3.28240740740741 4.39620535714286 3.34722222222222 C 4.46391369047619 3.41203703703704 4.54613095238095 3.44444444444444 4.64285714285714 3.44444444444444 C 4.73958333333333 3.44444444444444 4.8218005952381 3.41203703703704 4.88950892857143 3.34722222222222 C 4.95721726190476 3.28240740740741 4.99107142857143 3.2037037037037 4.99107142857143 3.11111111111111 C 4.99107142857143 2.71296296296296 5.13857886904762 2.37268518518519 5.43359375 2.09027777777778 C 5.72860863095238 1.80787037037037 6.08407738095238 1.66666666666667 6.5 1.66666666666667 C 6.59672619047619 1.66666666666667 6.67894345238095 1.63425925925926 6.74665178571429 1.56944444444444 Z M 12.8549107142857 3.52083333333333 C 12.9516369047619 3.68287037037037 13 3.84259259259259 13 4 C 13 4.15740740740741 12.9516369047619 4.31712962962963 12.8549107142857 4.47916666666667 C 12.1778273809524 5.54398148148148 11.2673921130952 6.39699074074074 10.1236049107143 7.03819444444444 C 8.97981770833333 7.67939814814815 7.77194940476191 8 6.5 8 C 5.2280505952381 8 4.02018229166667 7.67824074074074 2.87639508928571 7.03472222222222 C 1.73260788690476 6.3912037037037 0.822172619047619 5.53935185185185 0.145089285714286 4.47916666666667 C 0.0483630952380952 4.31712962962963 0 4.15740740740741 0 4 C 0 3.84259259259259 0.0483630952380952 3.68287037037037 0.145089285714286 3.52083333333333 C 0.822172619047619 2.46064814814815 1.73260788690476 1.6087962962963 2.87639508928571 0.965277777777778 C 4.02018229166667 0.321759259259259 5.2280505952381 0 6.5 0 C 7.77194940476191 0 8.97981770833333 0.321759259259259 10.1236049107143 0.965277777777778 C 11.2673921130952 1.6087962962963 12.1778273809524 2.46064814814815 12.8549107142857 3.52083333333333 Z " fill-rule="nonzero" fill="#a4a3a3" stroke="none" transform="matrix(1 0 0 1 1497 272 )" />
|
||||
</g>
|
||||
</svg>
|
@ -24,6 +24,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<MyPopup v-if="false"></MyPopup>
|
||||
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
@ -33,8 +36,19 @@ let keyword = ref("")
|
||||
|
||||
onMounted(() => {
|
||||
getHistoricalSearchList()
|
||||
|
||||
getUser()
|
||||
})
|
||||
|
||||
const getUser = () => {
|
||||
MyUserInfoHttp().then(res => {
|
||||
if (res.code != 200) return
|
||||
let data = res.data
|
||||
console.log("data", data)
|
||||
let count = data['count']
|
||||
})
|
||||
}
|
||||
|
||||
watchEffect(() => {
|
||||
keyword.value = route.query["keyword"]
|
||||
})
|
||||
|
@ -9,6 +9,11 @@ export const operateLikeHttp = query => {
|
||||
return Http.post("/api/operate/like", query)
|
||||
}
|
||||
|
||||
// 数据操作 - 收藏
|
||||
export const operateCollectHttp = query => {
|
||||
return Http.post("/api/operate/collect", query)
|
||||
}
|
||||
|
||||
// 详情数据 - 相关列表,同院校面经列表
|
||||
export const relatedlistHttp = query => {
|
||||
return Http.post("/api/details/relatedlist", query)
|
||||
@ -21,7 +26,7 @@ export const detailsHttp = query => {
|
||||
|
||||
// 详情数据 - 获取评论数据
|
||||
export const detailsCommentListHttp = query => {
|
||||
return Http.post("https://ask.gter.net/api/comment/lists", query)
|
||||
return Http.post("/api/comment/lists", query)
|
||||
}
|
||||
// 详情数据 - 获取子评论数据
|
||||
export const detailsChildCommentListHttp = query => {
|
||||
@ -36,3 +41,13 @@ export const detailsSubmitommentListHttp = query => {
|
||||
export const publishInitHttp = query => {
|
||||
return Http.post("/api/publish", query)
|
||||
}
|
||||
|
||||
// 我的 - 用户信息
|
||||
export const MyUserInfoHttp = query => {
|
||||
return Http.post("/api/user", query)
|
||||
}
|
||||
|
||||
// 我的 - 我的发布的面经
|
||||
export const MyUserPublishHttp = query => {
|
||||
return Http.post("/api/user/publish", query)
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
// 处理时间
|
||||
|
||||
export const handleDate = (dateTimeStamp = new Date()) => {
|
||||
dateTimeStamp = dateTimeStamp ? dateTimeStamp : null
|
||||
var timestamp = new Date(dateTimeStamp)
|
||||
@ -30,3 +29,12 @@ export const handleDate = (dateTimeStamp = new Date()) => {
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
|
||||
export const timestampToDate = (timestamp) => {
|
||||
var date = new Date(timestamp);
|
||||
var year = date.getFullYear();
|
||||
var month = ("0" + (date.getMonth() + 1)).slice(-2); // Months are zero based. Add leading 0.
|
||||
var day = ("0" + date.getDate()).slice(-2); // Add leading 0.
|
||||
return `${year}-${month}-${day}`;
|
||||
}
|
||||
|
@ -9,9 +9,11 @@
|
||||
<div class="content flexflex">
|
||||
<div class="left">
|
||||
<div class="school-box flexcenter">
|
||||
<img class="school-icon" :src="info['school']?.['image']" />
|
||||
<a :href="info['school']?.['url']" target="_blank">
|
||||
<img class="school-icon" :src="info['school']?.['image']" />
|
||||
</a>
|
||||
<a class="school-name" :href="info['school']?.['url']" target="_blank">{{ info["school"]?.["name"] }}</a>
|
||||
<div class="school-en-name">{{ info["school"]?.["enname"] }}</div>
|
||||
<a class="school-en-name" :href="info['school']?.['url']" target="_blank">{{ info["school"]?.["enname"] }}</a>
|
||||
</div>
|
||||
|
||||
<div class="mj-total flexacenter">
|
||||
@ -20,7 +22,7 @@
|
||||
个面经
|
||||
</div>
|
||||
<div class="mj-list">
|
||||
<div class="mj-item flexflex" :class="{pitch: index == 0}" v-for="(item, index) in relatedlist" :key="index">
|
||||
<div class="mj-item flexflex" :class="{pitch: pitchIndex == index}" v-for="(item, index) in relatedlist" :key="index" @click="handleItem(item['uniqid'])">
|
||||
<img class="item-bj" src="@/assets/img/item-bj.svg" />
|
||||
<div class="mj-header flexacenter">
|
||||
<img class="mj-avatar" :src="item['avatar']" />
|
||||
@ -49,9 +51,15 @@
|
||||
<div class="header">
|
||||
<div class="title">{{ info["subject"] }}</div>
|
||||
<div class="mj-header flexacenter">
|
||||
<img class="mj-avatar" :src="info['avatar']" />
|
||||
<div class="user-name">{{ info["nickname"] }}</div>
|
||||
<div class="time">{{ info["releasetime"] }}发布</div>
|
||||
<div class="mj-header-left flexacenter">
|
||||
<img class="mj-avatar" :src="info['avatar']" />
|
||||
<div class="user-name">{{ info["nickname"] }}</div>
|
||||
<div class="time">{{ info["releasetime"] }}发布</div>
|
||||
</div>
|
||||
<div class="mj-header-right flexacenter">
|
||||
<img class="eye-icon" src="@/assets/img/eye-icon.svg" />
|
||||
96
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="details-box" v-if="true">
|
||||
@ -60,7 +68,7 @@
|
||||
<div class="details-list">
|
||||
<div class="details-list-item flexacenter" v-if="info['school']">
|
||||
<div class="details-name">学校</div>
|
||||
<div class="details-value">{{ info["school"]?.name }}</div>
|
||||
<a class="details-value" target="_blank" :href="info['school']?.['url']">{{ info["school"]?.name }}</a>
|
||||
</div>
|
||||
<div class="details-list-item flexacenter" v-if="info['profession']">
|
||||
<div class="details-name">专业</div>
|
||||
@ -203,10 +211,10 @@
|
||||
{{ info["likenum"] || "" }}
|
||||
</div>
|
||||
<div class="item flexacenter"><img class="icon" src="@/assets/img/comment-icon.png" />9</div>
|
||||
<div class="item flexacenter">
|
||||
<div class="item flexacenter" @click="handleCollect()">
|
||||
<img class="icon" v-if="iscollection == 1" src="@/assets/img/collect-icon-colours.svg" />
|
||||
<img class="icon" v-else src="@/assets/img/collect-icon.png" />
|
||||
{{ info["likenum"] || "" }}
|
||||
{{ info["favnum"] || "收藏" }}
|
||||
</div>
|
||||
|
||||
<el-popover placement="bottom" width="628px" trigger="click" popper-style="padding: 0;border-radius: 10px;" v-model:visible="transmitBoxState">
|
||||
@ -257,11 +265,12 @@
|
||||
|
||||
<script setup>
|
||||
const route = useRoute()
|
||||
const uniqid = route.params.id
|
||||
let uniqid = route.params.id
|
||||
|
||||
onMounted(() => {
|
||||
// getCommentListHttp()
|
||||
window.addEventListener("scroll", handleScroll)
|
||||
|
||||
getDetails()
|
||||
})
|
||||
|
||||
let floorRightState = ref(false) // 右下角 的二维码显示状态
|
||||
@ -280,43 +289,74 @@ let isdisplay = ref(true) // 是否隐藏
|
||||
let islike = ref(0) // 是否点赞
|
||||
let ismyself = ref(0) // 是否是作者
|
||||
|
||||
detailsHttp({uniqid}).then(res => {
|
||||
if (res.code != 200) return
|
||||
let data = res.data
|
||||
token = data["token"]
|
||||
info.value = data["info"]
|
||||
seo.value = data.seo
|
||||
iscollection.value = data.iscollection
|
||||
isdisplay.value = data.isdisplay
|
||||
islike.value = data.islike
|
||||
ismyself.value = data.ismyself
|
||||
qrcode.value = data["share"]["qrcode"]
|
||||
// console.log(data, "data")
|
||||
const getDetails = () => {
|
||||
detailsHttp({uniqid}).then(res => {
|
||||
if (res.code != 200) return
|
||||
let data = res.data
|
||||
token = data["token"]
|
||||
info.value = data["info"]
|
||||
seo.value = data.seo
|
||||
iscollection.value = data.iscollection
|
||||
isdisplay.value = data.isdisplay
|
||||
islike.value = data.islike
|
||||
ismyself.value = data.ismyself
|
||||
qrcode.value = data["share"]["qrcode"]
|
||||
|
||||
getRelatedlistHttp()
|
||||
})
|
||||
getCommentListHttp()
|
||||
|
||||
if (relatedlist.value.length == 0) getRelatedlistHttp()
|
||||
else CalculateSelectedList()
|
||||
})
|
||||
}
|
||||
|
||||
// 计算选中的列表
|
||||
const CalculateSelectedList = () => {
|
||||
let targetRelatedlist = [...relatedlist.value]
|
||||
targetRelatedlist.forEach((element, index) => {
|
||||
if (element["uniqid"] == uniqid) pitchIndex.value = index
|
||||
})
|
||||
|
||||
if (pitchIndex.value == null) {
|
||||
targetRelatedlist.unshift({
|
||||
avatar: info.value["avatar"],
|
||||
interviewtime: timestampToDate(info.value["interviewtime"]),
|
||||
profession: info.value["profession"],
|
||||
project: info.value["project"],
|
||||
releasetime: info.value["releasetime"],
|
||||
subject: info.value["subject"],
|
||||
uniqid: uniqid,
|
||||
username: info.value["nickname"],
|
||||
})
|
||||
relatedlist.value = targetRelatedlist
|
||||
pitchIndex.value = 0
|
||||
}
|
||||
}
|
||||
|
||||
// 左侧列表数据
|
||||
let relatedlist = ref([])
|
||||
let relatedcount = ref(0)
|
||||
|
||||
let pitchIndex = ref(null) // 列表选中 index
|
||||
|
||||
const getRelatedlistHttp = () => {
|
||||
relatedlistHttp({token, page: 1}).then(res => {
|
||||
console.log("res", res)
|
||||
if (res.code != 200) return
|
||||
|
||||
let data = res.data
|
||||
|
||||
relatedlist.value = data.data
|
||||
relatedcount.value = data.count
|
||||
|
||||
CalculateSelectedList()
|
||||
})
|
||||
}
|
||||
|
||||
let seo = ref({})
|
||||
let commentCount = ref(0)
|
||||
let commentPage = ref(1)
|
||||
let commentList = ref([])
|
||||
let commentLoading = false
|
||||
let token = "ENp0HXsDIoZMh8Kolj-duWLzl5TVRbtriSIcPsDdUg9SFa3o7spbA0CuopdETZcEJf3u25p5zHyR-St5rTxX9i3jz9mWT4qrwa42Yzhi"
|
||||
let token = ""
|
||||
// 获取详情评论数据
|
||||
const getCommentListHttp = () => {
|
||||
console.log(commentPage.value, "commentPage.value")
|
||||
@ -333,7 +373,6 @@ const getCommentListHttp = () => {
|
||||
if (res.code != 200) return
|
||||
|
||||
let data = res.data
|
||||
console.log(data, "data")
|
||||
commentCount.value = data["count"]
|
||||
commentList.value = commentList.value.concat(data["data"])
|
||||
|
||||
@ -562,6 +601,24 @@ const handleLike = () => {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 点击 收藏
|
||||
const handleCollect = () => {
|
||||
operateCollectHttp({token}).then(res => {
|
||||
console.log("res", res)
|
||||
if (res.code != 200) return
|
||||
let data = res.data
|
||||
|
||||
info.value["favnum"] = data["count"]
|
||||
iscollection.value = data["status"]
|
||||
})
|
||||
}
|
||||
|
||||
// 处理点击列表
|
||||
const handleItem = uni => {
|
||||
uniqid = uni
|
||||
getDetails()
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@ -612,7 +669,7 @@ const handleLike = () => {
|
||||
}
|
||||
|
||||
.mj-list {
|
||||
padding: 0 30px 15px;
|
||||
padding: 0 25px 15px 30px;
|
||||
|
||||
.mj-item {
|
||||
flex-direction: column;
|
||||
@ -662,6 +719,8 @@ const handleLike = () => {
|
||||
font-size: 12px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
// justify-content: space-between;
|
||||
|
||||
.mj-avatar {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
@ -716,6 +775,7 @@ const handleLike = () => {
|
||||
.mj-header {
|
||||
line-height: 22px;
|
||||
font-size: 13px;
|
||||
justify-content: space-between;
|
||||
.mj-avatar {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
@ -729,6 +789,16 @@ const handleLike = () => {
|
||||
.time {
|
||||
color: #aaaaaa;
|
||||
}
|
||||
|
||||
.mj-header-right {
|
||||
.eye-icon {
|
||||
width: 13px;
|
||||
height: 8px;
|
||||
margin-right: 5px;
|
||||
}
|
||||
font-size: 12px;
|
||||
color: #aaaaaa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1116,6 +1186,7 @@ const handleLike = () => {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100vw;
|
||||
min-width: 1200px;
|
||||
height: 70px;
|
||||
z-index: 1;
|
||||
background-color: rgba(255, 255, 255, 1);
|
||||
|
@ -15,7 +15,6 @@
|
||||
</div>
|
||||
<div class="in-end" v-if="page == 0 && list.length > 0">- 到底了 -</div>
|
||||
|
||||
<MyPopup v-if="false"></MyPopup>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
Loading…
Reference in New Issue
Block a user