no message

This commit is contained in:
A1300399510
2024-01-25 19:29:12 +08:00
parent 89020a40b7
commit bd7c792cbe
970 changed files with 119575 additions and 101 deletions

View File

@@ -60,7 +60,7 @@
</div>
</div>
<div class="option-area" v-else>
<div class="option-item flexflex" :class="{ 'pitch': item.selected }" v-for="(item, index) in option" :key="item.id" @click="handleUnvoteVote(index, item.selected)">
<div class="option-item flexflex" :class="{ 'pitch': item.selected, 'cursor-no': info.status == 0 }" v-for="(item, index) in option" :key="item.id" @click="handleUnvoteVote(index, item.selected)">
<div class="flexflex" style="padding: 2px 0px;">
<div class="option-number flexcenter">{{ index + 1 }}</div>
<img class="tick-icon" src="@/assets/img/tick-black.svg" />
@@ -129,11 +129,53 @@ provide("qrcode", qrcode)
provide("isLoaded", isLoaded)
provide("haveVotedValue", haveVotedValue)
const getDetails = () => {
const getDetails = async () => {
// const { data1, pending1, error1, refresh1 } = await useAsyncData("mountains", () =>
// $fetch("https://vote.gter.net/api/details", {
// params: {
// uniqid: id,
// },
// })
// )
// const { data, pending, error, refresh } = await useFetch(`https://vote.gter.net/api/details`, {
// key: "details",
// body: {
// uniqid: id,
// },
// method: "post",
// })
// const { data, pending, error, refresh } = await useFetch(`https://vote.gter.net/api/details`, {
// method: "post",
// body: {
// uniqid: id,
// },
// })
// let datadata = data.value.data
// info.value = datadata["info"]
// isvote.value = datadata["isvote"]
// iscollection.value = datadata["iscollection"]
// islike.value = datadata["islike"]
// ismyself.value = datadata["ismyself"]
// option.value = datadata["option"]
// qrcode.value = datadata.share?.qrcode
// token.value = datadata["token"]
// seo.value = datadata.seo
// isLoaded.value = true
// datadata["option"].forEach(element => {
// if (element.selected) haveVotedValue.value = element.value
// })
// return
detailsHttp({ uniqid: id }).then(res => {
if (res.code != 200) {
ElMessage.error(res.message)
router.push("/index.html")
goToURL("/index.html", false)
return
}
@@ -154,10 +196,26 @@ const getDetails = () => {
data["option"].forEach(element => {
if (element.selected) haveVotedValue.value = element.value
})
// haveVotedValue
})
}
// watch(
// () => route.path,
// (newValue, oldValue) => {
// // 在这里处理route.path的变化
// if (typeof window !== "undefined" && route.path) {
// if (window._hmt) window._hmt.push(["_trackPageview", route.fullPath])
// if (window._czc) {
// let location = window.location
// let contentUrl = location.pathname + location.hash
// let refererUrl = "/"
// window._czc.push(["_trackPageview", contentUrl, refererUrl])
// window._czc.push(["_setAutoPageview", false])
// }
// }
// }
// )
provide("getDetails", getDetails)
// 点击发送信息
@@ -237,7 +295,7 @@ const handleUnvoteVote = (index, selected) => {
goLogin()
return
}
if (selected == 0) return
if (selected == 0 || info.value.status == 0) return
cancelPopoverState.value = true
unvoteVoteIndex = index
}
@@ -332,9 +390,38 @@ const floorCommentBtn = type => {
provide("floorCommentInput", floorCommentInput)
provide("floorCommentBtn", floorCommentBtn)
// 只刷新数据
const refreshDataOnly = () => {
clearAllData()
getDetails()
}
provide("refreshDataOnly", refreshDataOnly)
try {
if (process.server) {
// // const { data, pending, error, refresh } = await useFetch("https://vote.gter.net/api/details", {
// // query: { uniqid: id },
// // method: "post",
// // server: true,
// // })
// // const { data, pending, error, refresh } = await useFetch(`https://vote.gter.net/api/details`, {
// // method: "post",
// // body: {
// // uniqid: id + "111",
// // },
// // })
// const { data, pending, error, refresh } = await useFetch(`https://vote.gter.net/api/details`, {
// key: "details",
// body: {
// uniqid: id,
// },
// method: "post",
// })
// console.log("-------------分割线-------------------")
await detailsHttp({ uniqid: id }).then(res => {
// console.log("res", res)
if (res.code != 200) {
ElMessage.error(res.message)
router.push("/index.html")
@@ -559,6 +646,10 @@ try {
}
}
&.cursor-no {
cursor: no-drop;
}
.serial {
display: none;
}