全部板块左边需要溢出,详情页的提示框需要页面居中
This commit is contained in:
parent
bb952fc553
commit
1ecc639410
17108
package-lock.json
generated
17108
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -14,7 +14,6 @@
|
|||||||
"svg-sprite-loader": "^6.0.11",
|
"svg-sprite-loader": "^6.0.11",
|
||||||
"vue": "^2.6.14",
|
"vue": "^2.6.14",
|
||||||
"vue-router": "^3.5.1",
|
"vue-router": "^3.5.1",
|
||||||
"vue-sanitize": "^0.2.3",
|
|
||||||
"vuex": "^3.6.2"
|
"vuex": "^3.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
@ -22,6 +21,7 @@
|
|||||||
"@vue/cli-plugin-router": "~5.0.0",
|
"@vue/cli-plugin-router": "~5.0.0",
|
||||||
"@vue/cli-plugin-vuex": "~5.0.0",
|
"@vue/cli-plugin-vuex": "~5.0.0",
|
||||||
"@vue/cli-service": "~5.0.0",
|
"@vue/cli-service": "~5.0.0",
|
||||||
|
"postcss": "^8.4.21",
|
||||||
"sass-loader": "^13.2.0",
|
"sass-loader": "^13.2.0",
|
||||||
"vue-template-compiler": "^2.6.14",
|
"vue-template-compiler": "^2.6.14",
|
||||||
"vue2-svg-icon": "^1.3.2"
|
"vue2-svg-icon": "^1.3.2"
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 2.2 KiB |
@ -5,7 +5,8 @@
|
|||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<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"/>
|
<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 %>favicon.ico">
|
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
|
||||||
<title><%= htmlWebpackPlugin.options.title %></title>
|
<!-- <title><%= htmlWebpackPlugin.options.title %></title> -->
|
||||||
|
<title>寄托论坛</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<noscript>
|
<noscript>
|
||||||
|
103
src/App.vue
103
src/App.vue
@ -13,18 +13,113 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: null,
|
loading: null,
|
||||||
|
pathname: "",
|
||||||
|
parameterObject: {},
|
||||||
|
isPc: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$store.dispatch('fetchHistoricalSearch') // 获取历史搜索记录
|
this.$store.dispatch('fetchHistoricalSearch') // 获取历史搜索记录
|
||||||
this.$store.dispatch('getAllForum', this) // 获取全部板块
|
this.$store.dispatch('getAllForum', this) // 获取全部板块
|
||||||
// this.$store.dispatch('getUserInfo', this) /// 获取用户信息
|
|
||||||
|
this.isJudgePc()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
aaa1() {
|
||||||
|
console.log("dfgk;dfg;dfgk;");
|
||||||
|
},
|
||||||
|
isJudgePc() {
|
||||||
|
const userAgentInfo = navigator.userAgent;
|
||||||
|
const Agents = ["Android", "iPhone", "SymbianOS", "Windows Phone", "iPad", "iPod"];
|
||||||
|
let flag = true;
|
||||||
|
for (let i = 0; i < Agents.length; i++) {
|
||||||
|
if (userAgentInfo.indexOf(Agents[i]) > 0) {
|
||||||
|
flag = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag) {
|
||||||
|
let pathname = window.location.pathname
|
||||||
|
|
||||||
|
const queryString = window.location.search;
|
||||||
|
const parameters = queryString.substring(1);
|
||||||
|
let parameterObject = Object.fromEntries(new URLSearchParams(parameters));
|
||||||
|
this.pathname = pathname
|
||||||
|
this.parameterObject = parameterObject
|
||||||
|
|
||||||
|
if (this.pathname.indexOf("allSections") != -1 && this.parameterObject['fid']) {
|
||||||
|
this.handleNeedAllSkipPc()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if (this.pathname.indexOf("userIndex") != -1) {
|
||||||
|
this.handleNeedInfo()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let url = ""
|
||||||
|
|
||||||
|
if (pathname.indexOf("detailIndex") != -1) url = `https://bbs.gter.net/thread-${parameterObject['tid']}-${parameterObject['page'] || 1}-1.html`
|
||||||
|
if (pathname.indexOf("searchResult") != -1) url = `https://search.gter.net/index.html?type=forum${parameterObject['kw'] ? `&kw=${parameterObject['kw']}` : ''}`
|
||||||
|
if (pathname.indexOf("allSections") != -1 && !parameterObject['fid']) url = `https://bbs.gter.net/forum.php`
|
||||||
|
if (pathname.indexOf("recommend") != -1) url = `https://bbs.gter.net/forum.php`
|
||||||
|
if (pathname.indexOf("collect") != -1) url = `https://bbs.gter.net/forum.php`
|
||||||
|
|
||||||
|
this.$skipUrl(url, false)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// 处理需要user信息的跳转PC端
|
||||||
|
handleNeedInfo() {
|
||||||
|
let user = this.$store.state.user || {}
|
||||||
|
let url = ""
|
||||||
|
if (JSON.stringify(user) != "{}") {
|
||||||
|
url = `https://bbs.gter.net/home.php?mod=space&uid=${user.uin}`
|
||||||
|
this.$skipUrl(url, false)
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.handleNeedInfo()
|
||||||
|
}, 300);
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
// 处理需要全部板块的跳转PC端
|
||||||
|
handleNeedAllSkipPc() {
|
||||||
|
let allForumList = this.$store.state.allForumList || []
|
||||||
|
|
||||||
|
let url = ""
|
||||||
|
let fid = this.parameterObject['fid'] || null
|
||||||
|
|
||||||
|
if (allForumList.length != 0) {
|
||||||
|
allForumList.forEach((element, index) => {
|
||||||
|
if (element.fid == fid) url = `https://bbs.gter.net/forum.php?gid=${element.fid}`
|
||||||
|
element.data.forEach((el, i) => {
|
||||||
|
if (el.fid == fid) url = `https://bbs.gter.net/forum-${el.fid}-${this.parameterObject['page'] || 1}.html`
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.$skipUrl(url, false)
|
||||||
|
} else {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.handleNeedAllSkipPc()
|
||||||
|
}, 300)
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@ -136,4 +231,4 @@ textarea {
|
|||||||
background: transparent;
|
background: transparent;
|
||||||
resize: none;
|
resize: none;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -1,6 +1,7 @@
|
|||||||
// 热门版块标签
|
// 热门版块标签
|
||||||
.hot-box {
|
.hot-box {
|
||||||
padding: .34rem 0 0.3rem;
|
// padding: .34rem 0 0.3rem;
|
||||||
|
padding: .34rem 0 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
@ -12,9 +13,10 @@
|
|||||||
font-size: 0.3rem;
|
font-size: 0.3rem;
|
||||||
margin: 0 .16rem .24rem 0;
|
margin: 0 .16rem .24rem 0;
|
||||||
padding: 0 0.15rem;
|
padding: 0 0.15rem;
|
||||||
height: 0.72rem;
|
// height: 0.72rem;
|
||||||
line-height: 0.72rem;
|
line-height: 0.72rem;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
word-break: break-word;
|
||||||
|
|
||||||
&.active {
|
&.active {
|
||||||
border: 0.02rem solid #62B1FF;
|
border: 0.02rem solid #62B1FF;
|
||||||
@ -93,12 +95,18 @@ section {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bottom-box {
|
.bottom-box {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: flex-start;
|
justify-content: flex-start;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
&:first-of-type{
|
||||||
|
margin-right: .2rem;
|
||||||
|
}
|
||||||
|
|
||||||
.icon-head {
|
.icon-head {
|
||||||
width: 0.64rem;
|
width: 0.64rem;
|
||||||
height: 0.64rem;
|
height: 0.64rem;
|
||||||
@ -108,6 +116,7 @@ section {
|
|||||||
.bottom-name {
|
.bottom-name {
|
||||||
margin-left: 0.15rem;
|
margin-left: 0.15rem;
|
||||||
font-size: 0.32rem;
|
font-size: 0.32rem;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom-right {
|
.bottom-right {
|
||||||
|
@ -48,7 +48,7 @@
|
|||||||
v-for="(item, index) in menu" :key="index">{{ item.name }}</a>
|
v-for="(item, index) in menu" :key="index">{{ item.name }}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="head-more-post flexcenter" @click.stop="$skipUrl('https://www.gter.net/bbs/post.html', false)">
|
<div class="head-more-post flexcenter" @click.stop="$skipUrl(invitationPost, false)">
|
||||||
<div class="head-more-post-icon flexcenter">
|
<div class="head-more-post-icon flexcenter">
|
||||||
<svg-icon icon-class="addyellow" class-name="head-more-post-img"></svg-icon>
|
<svg-icon icon-class="addyellow" class-name="head-more-post-img"></svg-icon>
|
||||||
</div>
|
</div>
|
||||||
@ -70,6 +70,8 @@
|
|||||||
<script>
|
<script>
|
||||||
import SearchBox from "../components/SearchBox.vue";
|
import SearchBox from "../components/SearchBox.vue";
|
||||||
|
|
||||||
|
import { invitationPost } from '@/utils/bizarreUrl'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "HeaderNav",
|
name: "HeaderNav",
|
||||||
data() {
|
data() {
|
||||||
@ -81,6 +83,7 @@ export default {
|
|||||||
userInfo: {}, // 注意 userInfo 写I 是否是大写 ,, 因为 user 已经改为全局,后面要删除传值的 user
|
userInfo: {}, // 注意 userInfo 写I 是否是大写 ,, 因为 user 已经改为全局,后面要删除传值的 user
|
||||||
menu: [],
|
menu: [],
|
||||||
hotSearchkeywords: [], // 热门搜索
|
hotSearchkeywords: [], // 热门搜索
|
||||||
|
invitationPost,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["issearch", "needgetuser", "userinfo"],
|
props: ["issearch", "needgetuser", "userinfo"],
|
||||||
@ -111,21 +114,6 @@ export default {
|
|||||||
this.$skipUrl(`${this.$loginUrl}?referer=${url}`, false);
|
this.$skipUrl(`${this.$loginUrl}?referer=${url}`, false);
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取用户信息
|
|
||||||
getUserInfoData() {
|
|
||||||
return
|
|
||||||
// this.$http.post("/widget/getUser").then((res) => {
|
|
||||||
this.$http.post("/api/index",).then((res) => {
|
|
||||||
if (res.code != 200) return;
|
|
||||||
this.userInfo = res.data.user;
|
|
||||||
this.islogin = res.data.user.uid > 0 ? true : false;
|
|
||||||
this.hotSearchkeywords = res.data.hotSearchkeywords
|
|
||||||
|
|
||||||
}).catch(err => {
|
|
||||||
this.$message.error(err.message)
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
collapseClick() {
|
collapseClick() {
|
||||||
if (this.collapseShow == true) this.collapseShow = false;
|
if (this.collapseShow == true) this.collapseShow = false;
|
||||||
else this.collapseShow = true;
|
else this.collapseShow = true;
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
<!-- 板块导航 头部 点击板块后的头部导航 -->
|
<!-- 板块导航 头部 点击板块后的头部导航 -->
|
||||||
<template>
|
<template>
|
||||||
<router-link class="path-box" :to="path">
|
<router-link class="path-box" :to="`/allSections?fid=${fid}`">
|
||||||
<div>论坛</div>
|
<div>论坛</div>
|
||||||
<span class="path-slash">/</span>
|
<span class="path-slash">/</span>
|
||||||
<div class="oneEllipsis">{{ stairname }}</div>
|
<div class="oneEllipsis">{{ stairname }}</div>
|
||||||
<span class="path-slash">/</span>
|
<span class="path-slash">/</span>
|
||||||
<div class="oneEllipsis">{{ subsectionsname }}</div>
|
<div class="oneEllipsis">{{ subsectionsname }}</div>
|
||||||
<!-- <router-link v-if="!isskip" class="path-box-a" :to="path"></router-link> -->
|
|
||||||
</router-link>
|
</router-link>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -19,7 +18,7 @@ export default {
|
|||||||
path: "/allSections",
|
path: "/allSections",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
props: ["stairname", "subsectionsname"],
|
props: ["stairname", "subsectionsname", "fid"],
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -37,8 +36,7 @@ export default {
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
height: 1.28rem;
|
height: 1.28rem;
|
||||||
line-height: 1.28rem;
|
line-height: 1.28rem;
|
||||||
margin: 0.2rem 0.35rem 0;
|
margin: 0.5rem 0.35rem 0;
|
||||||
// padding: 0 0.25rem;
|
|
||||||
padding: 0 .4rem;
|
padding: 0 .4rem;
|
||||||
border-radius: 1.68rem 1.68rem 0 1.68rem;
|
border-radius: 1.68rem 1.68rem 0 1.68rem;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
@ -47,14 +45,6 @@ export default {
|
|||||||
box-shadow: 0 0 0.16rem rgba(0, 0, 0, 0.1);
|
box-shadow: 0 0 0.16rem rgba(0, 0, 0, 0.1);
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.path-box-a {
|
|
||||||
position: absolute;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.path-slash {
|
.path-slash {
|
||||||
color: #D7D7D7;
|
color: #D7D7D7;
|
||||||
font-size: .32rem;
|
font-size: .32rem;
|
||||||
@ -65,22 +55,11 @@ export default {
|
|||||||
color: #7F7F7F;
|
color: #7F7F7F;
|
||||||
max-width: 2.5rem;
|
max-width: 2.5rem;
|
||||||
|
|
||||||
// &::before {
|
|
||||||
// content: "/";
|
|
||||||
// width: 0.2rem;
|
|
||||||
// padding: 0 0.07rem;
|
|
||||||
// color: #7F7F7F;
|
|
||||||
// }
|
|
||||||
|
|
||||||
&:last-child {
|
&:last-child {
|
||||||
max-width: 50%;
|
max-width: 50%;
|
||||||
color: #000;
|
color: #000;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
// &:first-child::before {
|
|
||||||
// content: "";
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&::after {
|
&::after {
|
||||||
@ -97,6 +76,4 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
@ -12,7 +12,7 @@
|
|||||||
<div class="form flexacenter">
|
<div class="form flexacenter">
|
||||||
<img class="search-icon" src="@/assets/img/headerNav/search.png">
|
<img class="search-icon" src="@/assets/img/headerNav/search.png">
|
||||||
<input class="flex1" ref="searchInput" v-model="searchText" type="text" placeholder="请输入搜索关键词"
|
<input class="flex1" ref="searchInput" v-model="searchText" type="text" placeholder="请输入搜索关键词"
|
||||||
@keydown.enter="toSearchResult(searchText)" />
|
@keydown.enter="toSearchResult(searchText)" maxlength="20" />
|
||||||
<img v-if="searchText" @click.stop="clearText()" class="clear-text" src="@/assets/img/icon/clear.png">
|
<img v-if="searchText" @click.stop="clearText()" class="clear-text" src="@/assets/img/icon/clear.png">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
input {
|
input {
|
||||||
font-size: 0.36rem;
|
font-size: 0.40rem;
|
||||||
border: none;
|
border: none;
|
||||||
outline: 0;
|
outline: 0;
|
||||||
color: #000;
|
color: #000;
|
||||||
@ -187,7 +187,7 @@ export default {
|
|||||||
|
|
||||||
span {
|
span {
|
||||||
padding: 0 0.2rem;
|
padding: 0 0.2rem;
|
||||||
height: 0.96rem;
|
// height: 0.96rem;
|
||||||
line-height: 0.96rem;
|
line-height: 0.96rem;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
border-radius: 0.16rem;
|
border-radius: 0.16rem;
|
||||||
@ -196,6 +196,7 @@ export default {
|
|||||||
font-size: 0.36rem;
|
font-size: 0.36rem;
|
||||||
margin-right: .2rem;
|
margin-right: .2rem;
|
||||||
margin-bottom: .24rem;
|
margin-bottom: .24rem;
|
||||||
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
10
src/main.js
10
src/main.js
@ -6,13 +6,13 @@ import ElementUI, { Message, Pagination, loading } from 'element-ui';
|
|||||||
import 'element-ui/lib/theme-chalk/index.css';
|
import 'element-ui/lib/theme-chalk/index.css';
|
||||||
import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate, updateURLSearchParams, clearCookies } from "@/utils/common.js"
|
import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate, updateURLSearchParams, clearCookies } from "@/utils/common.js"
|
||||||
import http from "@/utils/request"
|
import http from "@/utils/request"
|
||||||
import VueSanitize from 'vue-sanitize'
|
|
||||||
|
|
||||||
import hintBox from '@/components/Hintbox'
|
import hintBox from '@/components/Hintbox'
|
||||||
|
|
||||||
|
|
||||||
Vue.config.productionTip = false
|
Vue.config.productionTip = false
|
||||||
|
|
||||||
Vue.prototype.$baseURL = "https://forum.gter.net/api" // 请求接口的共 url
|
|
||||||
Vue.prototype.$loginUrl = "https://passport.gter.net/" // 跳转登录的url
|
Vue.prototype.$loginUrl = "https://passport.gter.net/" // 跳转登录的url
|
||||||
|
|
||||||
Vue.prototype.$http = http // 跳转登录页面的方法
|
Vue.prototype.$http = http // 跳转登录页面的方法
|
||||||
@ -31,12 +31,14 @@ Vue.prototype.$formattedDate = formattedDate // 时间戳转格式
|
|||||||
Vue.prototype.$updateURLSearchParams = updateURLSearchParams // 不刷新的情况下修改url
|
Vue.prototype.$updateURLSearchParams = updateURLSearchParams // 不刷新的情况下修改url
|
||||||
Vue.prototype.$clearCookies = clearCookies // 清空Cookies
|
Vue.prototype.$clearCookies = clearCookies // 清空Cookies
|
||||||
|
|
||||||
|
|
||||||
//svg文件引入
|
//svg文件引入
|
||||||
import './icons'
|
import './icons'
|
||||||
//动态设置fontsize
|
//动态设置fontsize
|
||||||
import './utils/fontSize.js'
|
import './utils/fontSize.js'
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// 判断是否是数组的 ,兼容操作
|
// 判断是否是数组的 ,兼容操作
|
||||||
if (!Array.isArray) {
|
if (!Array.isArray) {
|
||||||
Array.isArray = function (arg) {
|
Array.isArray = function (arg) {
|
||||||
@ -48,10 +50,6 @@ if (!Array.isArray) {
|
|||||||
Vue.use(ElementUI);
|
Vue.use(ElementUI);
|
||||||
Vue.use(Pagination);
|
Vue.use(Pagination);
|
||||||
|
|
||||||
// 不要的
|
|
||||||
Vue.use(VueSanitize);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// v-focus
|
// v-focus
|
||||||
Vue.directive('focus', {
|
Vue.directive('focus', {
|
||||||
|
@ -107,6 +107,7 @@ const routes = [
|
|||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
mode: 'history',
|
mode: 'history',
|
||||||
|
// mode: 'hash',
|
||||||
base: process.env.BASE_URL,
|
base: process.env.BASE_URL,
|
||||||
routes
|
routes
|
||||||
})
|
})
|
||||||
|
@ -73,7 +73,7 @@ export default new Vuex.Store({
|
|||||||
// 获取全部板块的数据
|
// 获取全部板块的数据
|
||||||
getAllForum({ commit }, that) {
|
getAllForum({ commit }, that) {
|
||||||
// getAllForum(commit, that) {
|
// getAllForum(commit, that) {
|
||||||
that.$startupUnderLoading(that)
|
// that.$startupUnderLoading(that)
|
||||||
that.$http.get("/api/home/allForum").then(res => {
|
that.$http.get("/api/home/allForum").then(res => {
|
||||||
if (res.code != 200) return;
|
if (res.code != 200) return;
|
||||||
let allForumList = res.data
|
let allForumList = res.data
|
||||||
@ -82,7 +82,7 @@ export default new Vuex.Store({
|
|||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
that.$message.error(err.message)
|
that.$message.error(err.message)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
that.$closeUnderLoading(that)
|
// that.$closeUnderLoading(that)
|
||||||
})
|
})
|
||||||
|
|
||||||
},
|
},
|
||||||
|
11
src/utils/bizarreUrl.js
Normal file
11
src/utils/bizarreUrl.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// 稀奇古怪的url 都是一些写固定的 url 不确定什么时候修改
|
||||||
|
|
||||||
|
// 帖子发布的链接 在头部弹出栏 首页上下角使用
|
||||||
|
const invitationPost = "https://www.gter.net/bbs/post.html"
|
||||||
|
|
||||||
|
// 投币帖子不够寄托币的
|
||||||
|
const coinNo = "https://bbs.gter.net/thread-2543548-1-1.html"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export { invitationPost, coinNo }
|
@ -22,25 +22,18 @@ function pageMove() {
|
|||||||
// 跳转登录
|
// 跳转登录
|
||||||
function goTologin() {
|
function goTologin() {
|
||||||
let url = encodeURIComponent(location.href);
|
let url = encodeURIComponent(location.href);
|
||||||
console.log(skipUrl);
|
|
||||||
skipUrl(`https://passport.gter.net/?referer=${url}`, false);
|
skipUrl(`https://passport.gter.net/?referer=${url}`, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 点击复制
|
// 点击复制
|
||||||
function copy(value, message) {
|
function copy(value, message) {
|
||||||
// 创建一个新的输入元素
|
let copyInput = document.createElement('input');//创建input元素
|
||||||
let copyInput = document.createElement('input');
|
document.body.appendChild(copyInput);//向页面底部追加输入框
|
||||||
// 将输入元素添加到文档的主体中
|
copyInput.setAttribute('value', value);//添加属性,将url赋值给input元素的value属性
|
||||||
document.body.appendChild(copyInput);
|
copyInput.select();//选择input元素
|
||||||
// 将输入元素的值设置为需要复制的URL
|
document.execCommand("Copy");//执行复制命令
|
||||||
copyInput.setAttribute('value', value);
|
//复制之后再删除元素,否则无法成功赋值
|
||||||
// 选择输入元素
|
copyInput.remove();//删除动态创建的节点
|
||||||
copyInput.select();
|
|
||||||
// 使用clipboard API将所选文本复制到剪贴板
|
|
||||||
navigator.clipboard.writeText(copyInput.value);
|
|
||||||
// 向用户显示成功消息
|
|
||||||
// 从文档中删除动态创建的输入元素
|
|
||||||
copyInput.remove();
|
|
||||||
if (message) this.$message.success(message);
|
if (message) this.$message.success(message);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,9 @@
|
|||||||
<div class="detail-title-item detail-title-jinghua flexcenter" v-if="info.digest > 0">精华</div>
|
<div class="detail-title-item detail-title-jinghua flexcenter" v-if="info.digest > 0">精华</div>
|
||||||
<div class="detail-title-item detail-title-label flexcenter" v-if="info.typename">{{ info.typename }}</div>
|
<div class="detail-title-item detail-title-label flexcenter" v-if="info.typename">{{ info.typename }}</div>
|
||||||
{{ info.subject }}
|
{{ info.subject }}
|
||||||
|
|
||||||
|
|
||||||
|
<!-- {{ info.subject }} -->
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- -->
|
<!-- -->
|
||||||
@ -24,7 +27,7 @@
|
|||||||
<div class="card-head flexacenter">
|
<div class="card-head flexacenter">
|
||||||
<img class="card-head-icon" :src="info.avatar" />
|
<img class="card-head-icon" :src="info.avatar" />
|
||||||
<div class="card-head-content flex1 flexflex">
|
<div class="card-head-content flex1 flexflex">
|
||||||
<div class="card-head-name flexflex">{{ info.author }}</div>
|
<div class="card-head-name flexflex">{{ info.author || '匿名用户' }}</div>
|
||||||
<div class="card-head-time">{{ $formattedDate(info.dateline || '') }}</div>
|
<div class="card-head-time">{{ $formattedDate(info.dateline || '') }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-head-fool">楼主</div>
|
<div class="card-head-fool">楼主</div>
|
||||||
@ -136,7 +139,7 @@
|
|||||||
<div class="card-head flexacenter">
|
<div class="card-head flexacenter">
|
||||||
<img class="card-head-icon" :src="item.avatar" />
|
<img class="card-head-icon" :src="item.avatar" />
|
||||||
<div class="card-head-content flex1 flexflex">
|
<div class="card-head-content flex1 flexflex">
|
||||||
<div class="card-head-name flexflex">{{ item.author }}
|
<div class="card-head-name flexflex">{{ item.author || '匿名用户' }}
|
||||||
<div class="landlord flexcenter" v-if="item.isauthor == 1">楼主</div>
|
<div class="landlord flexcenter" v-if="item.isauthor == 1">楼主</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-head-time">{{ $formattedDate(item.dateline) }}</div>
|
<div class="card-head-time">{{ $formattedDate(item.dateline) }}</div>
|
||||||
@ -200,7 +203,8 @@
|
|||||||
<img v-else class="bottom-operation-icom" src="@/assets/img/detail/collect-c.png">
|
<img v-else class="bottom-operation-icom" src="@/assets/img/detail/collect-c.png">
|
||||||
<div class="bottom-operation-text">收藏</div>
|
<div class="bottom-operation-text">收藏</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom-operation-item flex1 flexcolumn flexcenter" @click="transmit()">
|
<div class="bottom-operation-item flex1 flexcolumn flexcenter transmit"
|
||||||
|
data-clipboard-text="Text to copy" @click="transmit()">
|
||||||
<img class="bottom-operation-icom bottom-transmit-icom" src="@/assets/img/detail/share.png" />
|
<img class="bottom-operation-icom bottom-transmit-icom" src="@/assets/img/detail/share.png" />
|
||||||
<div class="bottom-operation-text">转发</div>
|
<div class="bottom-operation-text">转发</div>
|
||||||
</div>
|
</div>
|
||||||
@ -212,12 +216,19 @@
|
|||||||
:pop-state="popState"></detail-reply>
|
:pop-state="popState"></detail-reply>
|
||||||
|
|
||||||
<coins :coin-config="coinConfig" :mybalance="mybalance" :pop-state="popState" :info="info"></coins>
|
<coins :coin-config="coinConfig" :mybalance="mybalance" :pop-state="popState" :info="info"></coins>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div class="alert" :class="{ 'alertState' : alertState }">
|
||||||
|
<el-alert title="消息提示的文案" type="info" center show-icon :closable="false"></el-alert>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import DetailReply from '@/components/DetailReply'
|
import DetailReply from '@/components/DetailReply'
|
||||||
import Coins from '@/components/unlock/Coins'
|
import Coins from '@/components/unlock/Coins'
|
||||||
|
import { coinNo } from '@/utils/bizarreUrl'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'detailIndex',
|
name: 'detailIndex',
|
||||||
@ -230,7 +241,7 @@ export default {
|
|||||||
strategy: {
|
strategy: {
|
||||||
button: "攒币指南",
|
button: "攒币指南",
|
||||||
tips: "你的寄托币不够,快去发帖挣币吧",
|
tips: "你的寄托币不够,快去发帖挣币吧",
|
||||||
url: "https://bbs.gter.net/thread-2543548-1-1.html",
|
url: coinNo,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -356,6 +367,8 @@ export default {
|
|||||||
|
|
||||||
islogin: false, // 登录状态
|
islogin: false, // 登录状态
|
||||||
|
|
||||||
|
alertState: false,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -379,7 +392,25 @@ export default {
|
|||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.alertState = true
|
||||||
|
console.log(this.alertState);
|
||||||
|
}, 3000)
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
this.alertState = false
|
||||||
|
console.log(this.alertState);
|
||||||
|
}, 6000)
|
||||||
|
|
||||||
|
// this.tid = this.$route.query['tid']
|
||||||
|
// this.page = this.$route.query['page'] || 1
|
||||||
|
// let url = `https://bbs.gter.net/thread-${tid}-${page}-1.html`
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
window.scrollTo(0, 0);
|
window.scrollTo(0, 0);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
@ -667,12 +698,12 @@ export default {
|
|||||||
// 打开编辑评论
|
// 打开编辑评论
|
||||||
openEditPop(item) {
|
openEditPop(item) {
|
||||||
let message = item.message
|
let message = item.message
|
||||||
// message = message.replace(/<div[^>]*>[\s\S]*?<\/div>/gi, ''); // 清除掉引有的结构
|
message = message.replace(/<div[^>]*>[\s\S]*?<\/div>/gi, ''); // 清除掉引有的结构
|
||||||
message = message.replace(/<[^>]*>/g, ''); // 清除掉引有的结构
|
// message = message.replace(/<[^>]*>/g, ''); // 清除掉引有的结构
|
||||||
// htmlContent.replace(/<[^>]*>/g, '');
|
|
||||||
// clean_content = re.sub('<.*?>', '', content)
|
|
||||||
|
|
||||||
message = message.trim()
|
message = message.trim()
|
||||||
|
|
||||||
|
console.log("message", message);
|
||||||
this.commentContent = message
|
this.commentContent = message
|
||||||
this.editCommentPid = item.pid
|
this.editCommentPid = item.pid
|
||||||
|
|
||||||
@ -766,7 +797,7 @@ export default {
|
|||||||
if (key == "like") this.info.islike = 1, this.info.recommends + 1
|
if (key == "like") this.info.islike = 1, this.info.recommends + 1
|
||||||
if (key == "collect") this.info.isfav = 1
|
if (key == "collect") this.info.isfav = 1
|
||||||
if (key == "uncollect") this.info.isfav = 0
|
if (key == "uncollect") this.info.isfav = 0
|
||||||
this.$message.success(res.message)
|
this.$message(res.message)
|
||||||
|
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.operateState = false
|
this.operateState = false
|
||||||
@ -822,6 +853,26 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.alert {
|
||||||
|
|
||||||
|
position: fixed;
|
||||||
|
top: 50%;
|
||||||
|
left: 50%;
|
||||||
|
transform: translate(-50%, -50%);
|
||||||
|
background: #f4f4f5;
|
||||||
|
border: 1px solid #ebeef5;
|
||||||
|
// padding: .2rem .2rem .2rem .2667rem;
|
||||||
|
// border-radius: .9533rem;
|
||||||
|
width: 50%;
|
||||||
|
opacity: 0;
|
||||||
|
transition: opacity .5s;
|
||||||
|
|
||||||
|
&.alertState {
|
||||||
|
opacity: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
margin-top: 1.3rem;
|
margin-top: 1.3rem;
|
||||||
padding-bottom: 2.8rem;
|
padding-bottom: 2.8rem;
|
||||||
@ -873,6 +924,7 @@ export default {
|
|||||||
color: #000;
|
color: #000;
|
||||||
font-size: .56rem;
|
font-size: .56rem;
|
||||||
font-weight: 650;
|
font-weight: 650;
|
||||||
|
line-height: .56rem;
|
||||||
|
|
||||||
.detail-title-item {
|
.detail-title-item {
|
||||||
font-size: .32rem;
|
font-size: .32rem;
|
||||||
@ -882,10 +934,14 @@ export default {
|
|||||||
margin-right: .16rem;
|
margin-right: .16rem;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
|
|
||||||
|
line-height: .56rem;
|
||||||
|
|
||||||
&.detail-title-jinghua {
|
&.detail-title-jinghua {
|
||||||
width: 1rem;
|
width: 1rem;
|
||||||
border-radius: .5rem .5rem 0;
|
border-radius: .5rem .5rem 0;
|
||||||
background: linear-gradient(-57.3808deg, rgb(178, 152, 232) 0%, rgb(88, 70, 195) 100%);
|
background: linear-gradient(-57.3808deg, rgb(178, 152, 232) 0%, rgb(88, 70, 195) 100%);
|
||||||
|
vertical-align: middle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.detail-title-label {
|
&.detail-title-label {
|
||||||
@ -893,7 +949,7 @@ export default {
|
|||||||
padding: 0 .16rem;
|
padding: 0 .16rem;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
border-radius: .16rem;
|
border-radius: .16rem;
|
||||||
|
vertical-align: middle;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -929,6 +985,8 @@ export default {
|
|||||||
color: #333;
|
color: #333;
|
||||||
font-size: .32rem;
|
font-size: .32rem;
|
||||||
margin-bottom: .08rem;
|
margin-bottom: .08rem;
|
||||||
|
word-break: break-word;
|
||||||
|
margin-right: .2667rem;
|
||||||
|
|
||||||
.landlord {
|
.landlord {
|
||||||
color: rgb(127, 127, 127);
|
color: rgb(127, 127, 127);
|
||||||
@ -985,7 +1043,7 @@ export default {
|
|||||||
color: #333;
|
color: #333;
|
||||||
font-size: .32rem;
|
font-size: .32rem;
|
||||||
border-radius: .16rem;
|
border-radius: .16rem;
|
||||||
background: rgb(246, 246, 246) url(@/assets/img/detail/quotation-left.png) no-repeat .4rem .2666rem;
|
background: rgb(246, 246, 246) url(@/assets/img/detail/quotation-left.png) no-repeat .32rem .2666rem;
|
||||||
|
|
||||||
padding: .1333rem .1333rem .1333rem 1rem;
|
padding: .1333rem .1333rem .1333rem 1rem;
|
||||||
|
|
||||||
@ -1350,6 +1408,7 @@ export default {
|
|||||||
.bottom-operation-item {
|
.bottom-operation-item {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 0 0.4rem;
|
padding: 0 0.4rem;
|
||||||
|
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
.bottom-transmit-icom {
|
.bottom-transmit-icom {
|
||||||
|
@ -23,8 +23,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div v-else style="margin:.64rem 0;">
|
<div v-else style="margin:.64rem 0;">
|
||||||
<plate-navigation @click.native="flybackAll()" :stairname="plate.stairname"
|
<plate-navigation @click.native="flybackAll()" :stairname="plate.stairname"
|
||||||
:subsectionsname="plate.subsectionsname" :fid="fid"></plate-navigation>
|
:subsectionsname="plate.subsectionsname" :fid="plate.fid"></plate-navigation>
|
||||||
|
|
||||||
|
|
||||||
<div style="margin:.4rem 0.35rem">
|
<div style="margin:.4rem 0.35rem">
|
||||||
<template v-if="invitationList.length != 0">
|
<template v-if="invitationList.length != 0">
|
||||||
@ -63,6 +62,7 @@ export default {
|
|||||||
plate: {
|
plate: {
|
||||||
stairname: "",// 一级版块名称
|
stairname: "",// 一级版块名称
|
||||||
subsectionsname: "",// 子版块名称
|
subsectionsname: "",// 子版块名称
|
||||||
|
fid: 0,
|
||||||
},
|
},
|
||||||
loading: null, // 加载状态
|
loading: null, // 加载状态
|
||||||
|
|
||||||
@ -131,12 +131,12 @@ export default {
|
|||||||
this.plate = {
|
this.plate = {
|
||||||
stairname: el.name,
|
stairname: el.name,
|
||||||
subsectionsname: element.name,
|
subsectionsname: element.name,
|
||||||
|
fid: el.fid,
|
||||||
}
|
}
|
||||||
this.getInvitationList()
|
this.getInvitationList()
|
||||||
this.isPlateListState = false
|
this.isPlateListState = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@ -235,26 +235,26 @@ export default {
|
|||||||
.allSections {
|
.allSections {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
border-radius: 0.32rem;
|
// border-radius: 0.32rem;
|
||||||
margin-top: 0.666667rem;
|
margin-top: 0.666667rem;
|
||||||
filter: drop-shadow(0.05rem 0 0.09rem rgba(0, 0, 0, 0.1));
|
filter: drop-shadow(0.05rem 0 0.09rem rgba(0, 0, 0, 0.1));
|
||||||
margin: .64rem 0.35rem;
|
margin: .64rem 0.35rem;
|
||||||
|
|
||||||
height: calc(100vh - 3rem);
|
height: calc(100vh - 3rem);
|
||||||
overflow: auto;
|
// overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
.allSections-left {
|
.allSections-left {
|
||||||
width: 35%;
|
width: 3.4rem;
|
||||||
border-left: 0.013333rem solid #ddd;
|
border-left: 0.013333rem solid #ddd;
|
||||||
background-color: rgba(235, 235, 235, 0.556862745098039);
|
background-color: rgba(235, 235, 235, 0.556862745098039);
|
||||||
// border-radius: 0.32rem 0 0 0.32rem;
|
border-radius: 0.32rem 0 0 0.32rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
|
|
||||||
overflow-y: auto;
|
// overflow-y: auto;
|
||||||
overflow-x: hidden;
|
// overflow-x: hidden;
|
||||||
|
|
||||||
-ms-overflow-style: none;
|
-ms-overflow-style: none;
|
||||||
overflow: -moz-scrollbars-none;
|
overflow: -moz-scrollbars-none;
|
||||||
@ -316,9 +316,10 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.allSections-right {
|
.allSections-right {
|
||||||
width: 65%;
|
// width: 65%;
|
||||||
|
flex: 1;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
// border-radius: 0 0.32rem 0.32rem 0;
|
border-radius: 0 0.32rem 0.32rem 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
@ -351,6 +352,7 @@ export default {
|
|||||||
margin: 0.266667rem 0;
|
margin: 0.266667rem 0;
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
font-size: 0.28rem;
|
font-size: 0.28rem;
|
||||||
|
word-wrap: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.item-star {
|
.item-star {
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
<div class="setting-sections">
|
<div class="setting-sections">
|
||||||
<div v-for="(item, index) in favoriteHeadList" :key="index">
|
<div v-for="(item, index) in favoriteHeadList" :key="index">
|
||||||
<div class="setting-item" @click.stop="cancelFavoritesSection(item.fid, index)">
|
<div class="setting-item" @click.stop="cancelFavoritesSection(item.fid, index)">
|
||||||
<div class="setting-item-title">{{ item.name }}</div>
|
<div class="setting-item-title one-line">{{ item.name }}</div>
|
||||||
<div class="setting-star"></div>
|
<div class="setting-star"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -53,7 +53,8 @@
|
|||||||
|
|
||||||
<!-- 路径 -->
|
<!-- 路径 -->
|
||||||
<template v-if="fid != 0">
|
<template v-if="fid != 0">
|
||||||
<plate-navigation :stairname="plate.stairname" :subsectionsname="plate.subsectionsname"></plate-navigation>
|
<plate-navigation :fid="plate.fid" :stairname="plate.stairname"
|
||||||
|
:subsectionsname="plate.subsectionsname"></plate-navigation>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- 内容区域 -->
|
<!-- 内容区域 -->
|
||||||
@ -83,12 +84,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
allForumList: [], // 所有板块得数据
|
allForumList: [], // 所有板块得数据
|
||||||
favoriteHeadList: [],
|
favoriteHeadList: [],
|
||||||
// {
|
|
||||||
// name: "全部",
|
|
||||||
// fid: 0
|
|
||||||
// }],
|
|
||||||
favoriteHeadIdList: [],
|
favoriteHeadIdList: [],
|
||||||
// favoriteHeadIdList: this.$store.state.favoriteList,
|
|
||||||
fid: 0, // 选中的收藏板块
|
fid: 0, // 选中的收藏板块
|
||||||
collect: [1],
|
collect: [1],
|
||||||
settingShow: false, //弹窗显示
|
settingShow: false, //弹窗显示
|
||||||
@ -96,6 +92,7 @@ export default {
|
|||||||
plate: {
|
plate: {
|
||||||
stairname: "",// 一级版块名称
|
stairname: "",// 一级版块名称
|
||||||
subsectionsname: "",// 子版块名称
|
subsectionsname: "",// 子版块名称
|
||||||
|
fid: 0, // 一级板块的id
|
||||||
},
|
},
|
||||||
favorite: { // 收藏板块
|
favorite: { // 收藏板块
|
||||||
list: [],
|
list: [],
|
||||||
@ -153,8 +150,12 @@ export default {
|
|||||||
|
|
||||||
// 获取收藏列表数据
|
// 获取收藏列表数据
|
||||||
getCollectList() {
|
getCollectList() {
|
||||||
|
|
||||||
if (this.favoriteHeadIdList.length == 0) return
|
if (this.favoriteHeadIdList.length == 0) return
|
||||||
|
let favoriteHeadIdList = this.favoriteHeadIdList
|
||||||
|
|
||||||
|
if (!favoriteHeadIdList.includes(Number(this.fid))) {
|
||||||
|
this.fid = 0
|
||||||
|
}
|
||||||
this.$startupUnderLoading(this)
|
this.$startupUnderLoading(this)
|
||||||
this.$http.get("/api/home/threadList", {
|
this.$http.get("/api/home/threadList", {
|
||||||
limit: this.favorite.limit,
|
limit: this.favorite.limit,
|
||||||
@ -179,10 +180,6 @@ export default {
|
|||||||
handleFavoriteHeadList() {
|
handleFavoriteHeadList() {
|
||||||
let allForumList = this.allForumList
|
let allForumList = this.allForumList
|
||||||
let favoriteHeadIdList = this.favoriteHeadIdList
|
let favoriteHeadIdList = this.favoriteHeadIdList
|
||||||
// let favoriteHeadList = [{
|
|
||||||
// name: "全部",
|
|
||||||
// fid: 0
|
|
||||||
// }]
|
|
||||||
|
|
||||||
let favoriteHeadList = []
|
let favoriteHeadList = []
|
||||||
|
|
||||||
@ -194,6 +191,7 @@ export default {
|
|||||||
if (elememt.fid == this.fid) {
|
if (elememt.fid == this.fid) {
|
||||||
this.plate.stairname = el.name
|
this.plate.stairname = el.name
|
||||||
this.plate.subsectionsname = elememt.name
|
this.plate.subsectionsname = elememt.name
|
||||||
|
this.plate.fid = el.fid
|
||||||
}
|
}
|
||||||
|
|
||||||
if (favoriteHeadIdList.includes(elememt.fid)) {
|
if (favoriteHeadIdList.includes(elememt.fid)) {
|
||||||
@ -243,8 +241,15 @@ export default {
|
|||||||
if (res.code != 200) return
|
if (res.code != 200) return
|
||||||
|
|
||||||
let list = this.$store.state.allForumList
|
let list = this.$store.state.allForumList
|
||||||
|
|
||||||
this.$store.commit('setAllForumList', list)
|
this.$store.commit('setAllForumList', list)
|
||||||
|
|
||||||
|
if (this.fid == fid) {
|
||||||
|
this.fid = 0
|
||||||
|
this.getCollectList()
|
||||||
|
this.$updateURLSearchParams({ page: 1, fid: 0 })
|
||||||
|
}
|
||||||
|
|
||||||
this.favoriteHeadList.splice(index, 1)
|
this.favoriteHeadList.splice(index, 1)
|
||||||
|
|
||||||
this.$Message.success(res.message)
|
this.$Message.success(res.message)
|
||||||
@ -398,6 +403,7 @@ export default {
|
|||||||
height: 0.48rem;
|
height: 0.48rem;
|
||||||
background-size: contain;
|
background-size: contain;
|
||||||
background-image: url("assets/img/allSections/star.png");
|
background-image: url("assets/img/allSections/star.png");
|
||||||
|
background-repeat: no-repeat;
|
||||||
margin-right: 0.4rem;
|
margin-right: 0.4rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
<!-- <router-link to="/allSections" exact>全部版块</router-link> -->
|
<!-- <router-link to="/allSections" exact>全部版块</router-link> -->
|
||||||
</nav>
|
</nav>
|
||||||
<!-- 发帖子 -->
|
<!-- 发帖子 -->
|
||||||
<div class="publish flexcolumn flexcenter">
|
<div class="publish flexcolumn flexcenter" @click.stop="$skipUrl(invitationPost)">
|
||||||
<svg-icon icon-class="add" class-name="icon-publish"></svg-icon>
|
<svg-icon icon-class="add" class-name="icon-publish"></svg-icon>
|
||||||
发帖
|
发帖
|
||||||
</div>
|
</div>
|
||||||
@ -20,17 +20,19 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import HeaderNav from "@/components/HeaderNav";
|
import HeaderNav from "@/components/HeaderNav";
|
||||||
|
import { invitationPost } from '@/utils/bizarreUrl'
|
||||||
export default {
|
export default {
|
||||||
name: "Index",
|
name: "Index",
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
favorite: [], // 收藏
|
favorite: [], // 收藏
|
||||||
recommend: [], // 推荐
|
recommend: [], // 推荐
|
||||||
query: { fid: 1125 },
|
|
||||||
fid: null,
|
fid: null,
|
||||||
allSections: "/allSections",
|
allSections: "/allSections",
|
||||||
collect: "/collect",
|
collect: "/collect",
|
||||||
recommendURl: "/recommend",
|
recommendURl: "/recommend",
|
||||||
|
invitationPost, // 发布帖子
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -107,12 +109,12 @@ nav {
|
|||||||
// 发帖按钮
|
// 发帖按钮
|
||||||
.publish {
|
.publish {
|
||||||
background-color: rgba(253, 223, 109, 1);
|
background-color: rgba(253, 223, 109, 1);
|
||||||
width: 1.6rem;
|
width: 1.4667rem;
|
||||||
height: 1.6rem;
|
height: 1.4667rem;
|
||||||
border-radius: 2.56rem;
|
border-radius: 2.56rem;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
right: 0.4rem;
|
right: 0.4rem;
|
||||||
bottom: 20%;
|
bottom: 10%;
|
||||||
font-size: 0.32rem;
|
font-size: 0.32rem;
|
||||||
z-index: 6;
|
z-index: 6;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
@click="hotLabelClick(item.fid)">{{ item.name }}</div>
|
@click="hotLabelClick(item.fid)">{{ item.name }}</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- 路径 -->
|
<!-- 路径 -->
|
||||||
<plate-navigation v-if="fid != 0" :stairname="plate.stairname"
|
<plate-navigation v-if="fid != 0" :fid="plate.fid" :stairname="plate.stairname"
|
||||||
:subsectionsname="plate.subsectionsname"></plate-navigation>
|
:subsectionsname="plate.subsectionsname"></plate-navigation>
|
||||||
<section>
|
<section>
|
||||||
<template v-if="list.length != 0 || loading">
|
<template v-if="list.length != 0 || loading">
|
||||||
@ -41,8 +41,8 @@ export default {
|
|||||||
plate: {
|
plate: {
|
||||||
stairname: "",// 一级版块名称
|
stairname: "",// 一级版块名称
|
||||||
subsectionsname: "",// 子版块名称
|
subsectionsname: "",// 子版块名称
|
||||||
|
fid: 0, // 一级板块id
|
||||||
},
|
},
|
||||||
|
|
||||||
loading: null,
|
loading: null,
|
||||||
allForumList: this.$store.state.allForumList || [],
|
allForumList: this.$store.state.allForumList || [],
|
||||||
}
|
}
|
||||||
@ -117,6 +117,7 @@ export default {
|
|||||||
if (element['fid'] == this.fid) {
|
if (element['fid'] == this.fid) {
|
||||||
this.plate.subsectionsname = element.name
|
this.plate.subsectionsname = element.name
|
||||||
this.plate.stairname = el.name
|
this.plate.stairname = el.name
|
||||||
|
this.plate.fid = el.fid
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -149,7 +150,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.path-box {
|
.path-box {
|
||||||
margin-bottom: 0.2rem;
|
// margin-bottom: 0.2rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.paging {
|
.paging {
|
||||||
@ -184,7 +185,8 @@ export default {
|
|||||||
|
|
||||||
|
|
||||||
section {
|
section {
|
||||||
padding-top: 0;
|
// padding-top: 0;
|
||||||
height: 10.3333rem;
|
padding-top: 0.45rem;
|
||||||
|
// height: 10.3333rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
@ -5,7 +5,7 @@
|
|||||||
<div class="search-input flexacenter">
|
<div class="search-input flexacenter">
|
||||||
<img class="search-input-icon" src="@/assets/img/headerNav/search.png">
|
<img class="search-input-icon" src="@/assets/img/headerNav/search.png">
|
||||||
<input class="search-input-input flex1" @keyup.enter="handleSearchResult()" placeholder="请输入搜索关键词"
|
<input class="search-input-input flex1" @keyup.enter="handleSearchResult()" placeholder="请输入搜索关键词"
|
||||||
v-model="kw" />
|
v-model="kw" maxlength="20" />
|
||||||
<img class="search-input-cross" @click.stop="emptyKw()" src="@/assets/img/icon/clear.png">
|
<img class="search-input-cross" @click.stop="emptyKw()" src="@/assets/img/icon/clear.png">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -127,6 +127,8 @@ export default {
|
|||||||
page: this.page,
|
page: this.page,
|
||||||
limit: this.limit
|
limit: this.limit
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
||||||
|
if (res.code != 200) return
|
||||||
let data = res.data
|
let data = res.data
|
||||||
|
|
||||||
this.list = data.data
|
this.list = data.data
|
||||||
@ -135,9 +137,10 @@ export default {
|
|||||||
|
|
||||||
document.documentElement.scrollTop = 0;
|
document.documentElement.scrollTop = 0;
|
||||||
document.body.scrollTop = 0;
|
document.body.scrollTop = 0;
|
||||||
this.searchResultState = false
|
// this.searchResultState = false
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
this.$store.commit('setHistoricalSearch', this.kw)
|
this.$store.commit('setHistoricalSearch', this.kw)
|
||||||
|
this.searchResultState = false
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -193,6 +196,7 @@ export default {
|
|||||||
|
|
||||||
.search-input-input {
|
.search-input-input {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
font-size: 0.40rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,13 @@ module.exports = defineConfig({
|
|||||||
// proxy: 'https://forum.gter.net'
|
// proxy: 'https://forum.gter.net'
|
||||||
// },
|
// },
|
||||||
|
|
||||||
|
// devServer: {
|
||||||
|
// publicPath: './'
|
||||||
|
// },
|
||||||
|
|
||||||
transpileDependencies: true,
|
transpileDependencies: true,
|
||||||
|
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
|
||||||
|
|
||||||
configureWebpack: {
|
configureWebpack: {
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user