From bcfaa0b2609927983157ff945293574fb7e93c49 Mon Sep 17 00:00:00 2001 From: A1300399510 <A1300399510> Date: Mon, 22 May 2023 19:19:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/index.html | 51 +++++++++++----- src/assets/emojiList.json | 9 +++ src/views/detail/detailIndex.vue | 91 ++++++++++++++++++++++------- src/views/index/collect/Collect.vue | 3 +- src/views/user/UserIndex.vue | 7 ++- 5 files changed, 120 insertions(+), 41 deletions(-) create mode 100644 src/assets/emojiList.json diff --git a/public/index.html b/public/index.html index f012ac9..04fdd63 100755 --- a/public/index.html +++ b/public/index.html @@ -1,18 +1,37 @@ <!DOCTYPE html> <html lang=""> - <head> - <meta charset="utf-8"> - <meta http-equiv="X-UA-Compatible" content="IE=edge"> - <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/> - <link rel="icon" href="<%= BASE_URL %>/img/favicon.ico"> - <!-- <title><%= htmlWebpackPlugin.options.title %></title> --> - <title>寄托论坛</title> - </head> - <body> - <noscript> - <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> - </noscript> - <div id="app"></div> - <!-- built files will be auto injected --> - </body> -</html> + +<head> + <meta charset="utf-8"> + <meta http-equiv="X-UA-Compatible" content="IE=edge"> + <meta content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0" + name="viewport" /> + <link rel="icon" href="<%= BASE_URL %>/img/favicon.ico"> + <!-- <title><%= htmlWebpackPlugin.options.title %></title> --> + <title>寄托论坛</title> +</head> + +<body> + <noscript> + <strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. + Please enable it to continue.</strong> + </noscript> + <div id="app"></div> + <div style="display:none;"> + <script type="text/javascript" src="//v1.cnzz.com/z_stat.php?id=1281224882&web_id=1281224882"></script> + <script type="text/javascript"> + var _hmt = _hmt || []; + (function () { + var hm = document.createElement("script"); + hm.src = "//hm.baidu.com/hm.js?4bd66cbe45a640b607fe46c48f658746"; + var s = document.getElementsByTagName("script")[0]; + s.parentNode.insertBefore(hm, s); + })(); + </script> + </div> + + <!-- 这个统计代码 明天加在H5论坛页面 --> + <!-- built files will be auto injected --> +</body> + +</html> \ No newline at end of file diff --git a/src/assets/emojiList.json b/src/assets/emojiList.json new file mode 100644 index 0000000..ae4ab99 --- /dev/null +++ b/src/assets/emojiList.json @@ -0,0 +1,9 @@ +{ + "{:1_1:}": "https://bbs.gter.net/static/image/smiley/default/smile.gif", + ":(": "https://bbs.gter.net/static/image/smiley/default/frown.gif", + ":@": "https://bbs.gter.net/static/image/smiley/default/default.gif", + ":O": "https://bbs.gter.net/static/image/smiley/default/shocked.gif", + ":p": "https://bbs.gter.net/static/image/smiley/default/frown.gif", + ":(": "https://bbs.gter.net/static/image/smiley/default/frown.gif", + ":(": "https://bbs.gter.net/static/image/smiley/default/frown.gif" +} \ No newline at end of file diff --git a/src/views/detail/detailIndex.vue b/src/views/detail/detailIndex.vue index 8b0a44b..3e23ff9 100755 --- a/src/views/detail/detailIndex.vue +++ b/src/views/detail/detailIndex.vue @@ -226,7 +226,7 @@ import DetailReply from '@/components/DetailReply' import Coins from '@/components/unlock/Coins' import { coinNo } from '@/utils/bizarreUrl' - +import emojiList from '@/assets/emojiList.json' export default { name: 'detailIndex', data() { @@ -369,6 +369,8 @@ export default { message: "" }, + isloginBtnState: false, + }; @@ -390,11 +392,15 @@ export default { } }, immediate: true - } + }, + isloginBtnState(newV, oldV) { + if (newV) this.$goTologin() + }, }, mounted() { window.scrollTo(0, 0); + }, methods: { @@ -418,7 +424,8 @@ export default { }) // 回复和投币可见解锁前的html - let replyVisibleHtml = `<div class="flexcenter content-unlock content-unlock-no replyVisible" @click="setValue('popState', 'discussionSingle')"><img class="unlock-icom" src="./img/unlock.png"/>作者设置了${this.islogin ? '回复' : '登录'}可见</div>` + // let replyVisibleHtml = `<div class="flexcenter content-unlock content-unlock-no replyVisible" @click="setValue('popState', 'discussionSingle')"><img class="unlock-icom" src="./img/unlock.png"/>作者设置了${this.islogin ? '回复' : '登录'}可见</div>` + let replyVisibleHtml = `<div class="flexcenter content-unlock content-unlock-no ${this.islogin ? 'replyVisible' : 'registerVisible'} " @click="setValue('popState', ${this.islogin ? 'discussionSingle' : 'isloginBtnState'})"><img class="unlock-icom" src="./img/unlock.png"/>作者设置了${this.islogin ? '回复' : '登录'}可见</div>` let coinVisibleHtml = `<div class="flexcenter content-unlock content-unlock-no coinVisible"><img class="unlock-icom" src="./img/unlock.png"/>作者设置了投币可见</div>` // 回复和投币可见解锁后的html @@ -530,6 +537,18 @@ export default { this.popState = data.mybalance > price ? "coindisplayuser" : "coinNo" }) } + let registerVisibleList = document.getElementsByClassName("registerVisible") + if (!Array.isArray(registerVisibleList)) { + for (let i = 0; i < registerVisibleList.length; i++) { + registerVisibleList[i].addEventListener('click', () => { + this.$emit("registerVisibleClick") + }) + } + this.$on('registerVisibleClick', () => { + console.log("fkfkfkf"); + this.isloginBtnState = true + }) + } this.info = info this.type = data.type @@ -665,6 +684,13 @@ export default { }).then(res => { if (res.code != 200) return let data = res.data + + data.data.forEach(el => { + for (const key in emojiList) { + el.message = el.message.replaceAll(key, `<img class="gif" src="${emojiList[key]}" />`) + } + }) + this.postList.list = data.data this.postList.page = data.page this.postList.limit = data.limit @@ -718,29 +744,42 @@ export default { pid: this.editCommentPid || (this.twoCommentData && this.twoCommentData.pid) }).then(res => { if (res.code != 200) return + + this.$Message.success("发布成功") + this.popState = "" this.twoCommentData = null - if (this.editCommentPid) this.$router.go(0) + if (this.editCommentPid) { // 编辑 状态 + setTimeout(() => { + this.$router.go(0) + }, 800); + return + } this.editCommentPid = null - - let { count, limit } = this.postList let page = Math.ceil((count + 1) / limit) - if (page == this.postList.page) { - this.$router.go(0) - return - } + setTimeout(() => { + + if (page == this.postList.page) { + this.$router.go(0) + clearTimeout(timer) + return + } + + let query = { + page, + tid: this.tid + } + + this.$router.push({ path: `/detailIndex`, query }) + + }, 800); - let query = { - page, - tid: this.tid - } - this.$router.push({ path: `/detailIndex`, query }) }) }, @@ -832,7 +871,6 @@ export default { components: { DetailReply, Coins - } }; </script> @@ -907,7 +945,7 @@ export default { color: #000; font-size: .56rem; font-weight: 650; - line-height: .56rem; + line-height: .86rem; .detail-title-item { font-size: .32rem; @@ -932,8 +970,8 @@ export default { padding: 0 .16rem; display: inline-flex; border-radius: .16rem; - // vertical-align: middle; - vertical-align: top; + vertical-align: middle; + // vertical-align: top; } } @@ -1019,6 +1057,10 @@ export default { img { width: 100% !important; height: auto !important; + + &.gif { + width: auto !important; + } } .quote { @@ -1027,10 +1069,8 @@ export default { font-size: .32rem; border-radius: .16rem; background: rgb(246, 246, 246) url(@/assets/img/detail/quotation-left.png) no-repeat .32rem .2666rem; - padding: .1333rem .1333rem .1333rem 1rem; - // padding: .36rem .24rem; box-sizing: border-box; margin-bottom: .48rem; @@ -1444,5 +1484,14 @@ export default { } + .loginBtn { + position: absolute; + top: 0; + left: 0; + height: 100%; + width: 100%; + // background: #50e3c2; + } + } </style> \ No newline at end of file diff --git a/src/views/index/collect/Collect.vue b/src/views/index/collect/Collect.vue index 283db02..b7b80c3 100755 --- a/src/views/index/collect/Collect.vue +++ b/src/views/index/collect/Collect.vue @@ -303,7 +303,8 @@ export default { } .setting-container { - position: absolute; + // position: absolute; + position: fixed; bottom: 0; left: 0; background-color: #fff; diff --git a/src/views/user/UserIndex.vue b/src/views/user/UserIndex.vue index 00f942f..0719505 100755 --- a/src/views/user/UserIndex.vue +++ b/src/views/user/UserIndex.vue @@ -177,10 +177,11 @@ export default { this.$store.commit('setFavoriteList', []) this.$store.commit('setHomeRequestState', false) - this.$clearCookies(); - - this.$router.push("/") + this.$http.post("/api/user/Logout").then(res => { + this.$clearCookies(); + this.$router.push("/") + })