提交测试

This commit is contained in:
xiaoronghao 2023-04-17 15:47:08 +08:00
parent 1ecc639410
commit 34d052255f
21 changed files with 165 additions and 151 deletions

21
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,21 @@
{
"version": "2.0.0",
"tasks": [{
"label": "save",
"command": "git",
"type": "shell",
"args": [
"commit",
"-a",
"-m",
"auto commit",
"&&",
"git",
"push",
"origin",
"master"
],
"problemMatcher": []
}],
"preShutdownTask": "save"
}

3
package-lock.json generated
View File

@ -25,7 +25,8 @@
"postcss": "^8.4.21",
"sass-loader": "^13.2.0",
"vue-template-compiler": "^2.6.14",
"vue2-svg-icon": "^1.3.2"
"vue2-svg-icon": "^1.3.2",
"webpack-bundle-analyzer": "^4.8.0"
}
},
"node_modules/@achrinza/node-ipc": {

View File

@ -24,7 +24,8 @@
"postcss": "^8.4.21",
"sass-loader": "^13.2.0",
"vue-template-compiler": "^2.6.14",
"vue2-svg-icon": "^1.3.2"
"vue2-svg-icon": "^1.3.2",
"webpack-bundle-analyzer": "^4.8.0"
},
"browserslist": [
"> 1%",

View File

@ -1,6 +1,5 @@
// 热门版块标签
.hot-box {
// padding: .34rem 0 0.3rem;
padding: .34rem 0 0;
display: flex;
justify-content: flex-start;
@ -13,7 +12,6 @@
font-size: 0.3rem;
margin: 0 .16rem .24rem 0;
padding: 0 0.15rem;
// height: 0.72rem;
line-height: 0.72rem;
text-align: center;
word-break: break-word;
@ -103,7 +101,7 @@ section {
justify-content: flex-start;
align-items: center;
&:first-of-type{
&:first-of-type {
margin-right: .2rem;
}
@ -123,10 +121,8 @@ section {
display: flex;
flex-direction: row;
align-items: center;
// padding-left: 0.25rem;
&:last-child {
// margin-left: 0.133333rem;
margin-left: .4rem;
}
@ -170,7 +166,6 @@ section {
transform: rotate(45deg);
transform-origin: bottom;
margin-top: 0.05rem;
// margin-top: 0.01rem;
margin-left: 0.25rem;
width: 0.9rem;
font-size: 0.3rem;
@ -183,15 +178,10 @@ section {
// 广告
.banner-box {
margin-bottom: 0.32rem;
width: 100%;
display: block;
border-radius: 0.32rem;
margin-bottom: 0.2rem;
// 广告图
.banner {
width: 100%;
display: block;
border-radius: 0.32rem;
}
}
// 分页
@ -258,7 +248,7 @@ section {
.el-pagination.is-background.el-pagination--small .btn-prev,
.el-pagination.is-background.el-pagination--small .el-pager li {
border-radius: 50%;
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1011 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -33,7 +33,8 @@
<div class="head-more-right">
<!-- 消息 -->
<div class="information-box" v-if="userInfo.messagenum">
<img class="information-icon" src="@/assets/img/headerNav/information.png" />
<!-- <img class="information-icon" src="@/assets/img/headerNav/information.png" /> -->
<img class="information-icon" src="@/assets/img/icon/email.png" />
<div class="red-dot flexcenter">{{ userInfo.messagenum }}</div>
</div>
<!-- 登录按钮 -->

View File

@ -1,37 +1,44 @@
<template>
<div>
<!-- 帖子 -->
<div class="card-box" v-for="(item,index) in list" :key="index" @click.stop="toDetail(item.tid)">
<div class="top moreEllipsis">
<div class="top-label">{{ item.typename }}</div>
<div class="top-title">{{ item.subject }}</div>
</div>
<div class="center">
<div class="center-text moreEllipsis">{{ item.message }}</div>
</div>
<div class="bottom">
<div class="bottom-box">
<!-- <svg-icon icon-class="test-head" class-name="icon-head"></svg-icon> -->
<img class="icon-head" :src="item.avatar">
<div class="bottom-name">{{ item.author }}</div>
<div v-for="(item, index) in list" :key="index">
<template v-if="item.type == 'ad'">
<a :href="item.url"><img class="banner-box" :src="item.image"></a>
</template>
<div class="card-box" v-else @click.stop="toDetail(item.tid)">
<div class="top moreEllipsis">
<div class="top-label">{{ item.typename }}</div>
<div class="top-title">{{ item.subject }}</div>
</div>
<div class="bottom-box">
<div class="bottom-right">
<svg-icon icon-class="look" class-name="icon-look"></svg-icon>
<div>{{ item.views }}</div>
<div class="center">
<div class="center-text moreEllipsis">{{ item.message }}</div>
</div>
<div class="bottom">
<div class="bottom-box">
<img class="icon-head" :src="item.avatar">
<div class="bottom-name">{{ item.author }}</div>
</div>
<div class="bottom-right">
<svg-icon icon-class="msg" class-name="icon-msg"></svg-icon>
<div>{{ item.replies }}</div>
<div class="bottom-box">
<div class="bottom-right">
<svg-icon icon-class="look" class-name="icon-look"></svg-icon>
<div>{{ item.views }}</div>
</div>
<div class="bottom-right">
<svg-icon icon-class="msg" class-name="icon-msg"></svg-icon>
<div>{{ item.replies }}</div>
</div>
</div>
</div>
</div>
<!-- 精华 -->
<div class="rightTop" v-if="item.digest>0">
<img class="rightTop-img" src="@/assets/img/icon/topRight .png">
<span>精华</span>
<!-- 精华 -->
<div class="rightTop" v-if="item.digest > 0">
<img class="rightTop-img" src="@/assets/img/icon/topRight .png">
<span>精华</span>
</div>
</div>
</div>
<!-- <div class="card-box">
<div class="top moreEllipsis">
<div class="top-label">经验</div>
@ -81,10 +88,9 @@ export default {
},
methods: {
//
toDetail(tid){
this.$router.push(`/detail?tid=${tid}`)
toDetail(tid) {
this.$router.push(`/detail?tid=${tid}`)
},
},
};

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,15 +2,11 @@ import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI, { Message, Pagination, loading } from 'element-ui';
import { Message, Pagination, Alert, Loading } from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import { skipUrl, pageStop, pageMove, goTologin, copy, startupUnderLoading, closeUnderLoading, formattedDate, updateURLSearchParams, clearCookies } from "@/utils/common.js"
import http from "@/utils/request"
import hintBox from '@/components/Hintbox'
Vue.config.productionTip = false
Vue.prototype.$loginUrl = "https://passport.gter.net/" // 跳转登录的url
@ -23,7 +19,7 @@ Vue.prototype.$goTologin = goTologin // 跳转登录页面的方法
Vue.prototype.$pageStop = pageStop // 页面禁止滑动
Vue.prototype.$pageMove = pageMove // 页面可以滑动
Vue.prototype.$Message = Message // 消息提示框
Vue.prototype.$loading = loading // 消息提示框
Vue.prototype.$loading = Loading // 消息提示框
Vue.prototype.$copy = copy // 复制
Vue.prototype.$startupUnderLoading = startupUnderLoading // 开启加载提示 element的
Vue.prototype.$closeUnderLoading = closeUnderLoading // 关闭加载提示 element的
@ -31,14 +27,11 @@ Vue.prototype.$formattedDate = formattedDate // 时间戳转格式
Vue.prototype.$updateURLSearchParams = updateURLSearchParams // 不刷新的情况下修改url
Vue.prototype.$clearCookies = clearCookies // 清空Cookies
//svg文件引入
//svg文件引入
import './icons'
//动态设置fontsize
import './utils/fontSize.js'
// 判断是否是数组的 ,兼容操作
if (!Array.isArray) {
Array.isArray = function (arg) {
@ -46,10 +39,10 @@ if (!Array.isArray) {
}
}
//ElementUI
Vue.use(ElementUI);
// Vue.use(ElementUI);
Vue.use(Pagination);
Vue.use(Alert);
Vue.use(Loading);
// v-focus
Vue.directive('focus', {

View File

@ -91,7 +91,6 @@ export default new Vuex.Store({
getUserInfo({ state, commit }, that) {
if (state.getUserInfoState) return
commit('setgetUserInfoState', true)
// that.$startupUnderLoading(that)
that.$http.post("/api/home").then(res => {
if (res.code != 200) return;
let data = res.data

View File

@ -27,21 +27,20 @@ function goTologin() {
// 点击复制
function copy(value, message) {
let copyInput = document.createElement('input');//创建input元素
document.body.appendChild(copyInput);//向页面底部追加输入框
copyInput.setAttribute('value', value);//添加属性将url赋值给input元素的value属性
copyInput.select();//选择input元素
document.execCommand("Copy");//执行复制命令
//复制之后再删除元素,否则无法成功赋值
copyInput.remove();//删除动态创建的节点
if (message) this.$message.success(message);
let copyInput = document.createElement('input');//创建input元素
document.body.appendChild(copyInput);//向页面底部追加输入框
copyInput.setAttribute('value', value);//添加属性将url赋值给input元素的value属性
copyInput.select();//选择input元素
document.execCommand("Copy");//执行复制命令
//复制之后再删除元素,否则无法成功赋值
copyInput.remove();//删除动态创建的节点
if (message) this.$Message.success(message);
}
// 启动加载中
function startupUnderLoading(that) {
that.loading = that.$loading({
that.loading = this.$loading({
lock: true,
text: '加载中...',
background: 'rgba(0, 0, 0, 0.7)'
@ -50,7 +49,7 @@ function startupUnderLoading(that) {
// 关闭加载中
function closeUnderLoading(that) {
that.loading && that.loading.close();
that.loading && this.loading.close();
that.loading = null
}

View File

@ -28,7 +28,7 @@ const service = axios.create({
service.interceptors.request.use(config => {
//发请求前做的一些处理数据转化配置请求头设置token,设置loading等根据需求去添加
//注意使用token的时候需要引入cookie方法或者用本地localStorage等方法推荐js-cookie
config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
// config['headers']['authorization'] = "qj2q1qk1on0curclipghjtv5ja1g9eq2"
// config['headers']['authorization'] = "661aiz52k5e6vqgmkxnz0wvbv8nciz8h"
return config
}, error => {

View File

@ -16,9 +16,6 @@
<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>
{{ info.subject }}
<!-- {{ info.subject }} -->
</div>
<!-- -->
@ -219,8 +216,8 @@
<div class="alert" :class="{ 'alertState' : alertState }">
<el-alert title="消息提示的文案" type="info" center show-icon :closable="false"></el-alert>
<div class="alert" :class="{ 'alertState': alert.state }">
<el-alert :title="alert.message" type="info" center show-icon :closable="false"></el-alert>
</div>
</div>
</template>
@ -367,7 +364,12 @@ export default {
islogin: false, //
alertState: false,
alert: {
state: false,
message: ""
},
};
},
@ -391,24 +393,6 @@ export default {
}
},
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);
},
@ -595,7 +579,6 @@ export default {
})
offerinfo['useperformanceStr'] = useperformanceStr
this.offerinfo = offerinfo
})
},
@ -776,9 +759,6 @@ export default {
this.getPostList()
this.$updateURLSearchParams(query)
// this.$router.push({ path: `/detailIndex`, query })
},
//
@ -797,7 +777,8 @@ export default {
if (key == "like") this.info.islike = 1, this.info.recommends + 1
if (key == "collect") this.info.isfav = 1
if (key == "uncollect") this.info.isfav = 0
this.$message(res.message)
// this.$message(res.message)
this.openHintBox(res.message)
}).finally(() => {
this.operateState = false
@ -827,6 +808,7 @@ export default {
this.commentContent = item.message
},
//
postCoin() {
console.log("点击解锁");
@ -835,12 +817,26 @@ export default {
}).then(res => {
if (res.code != 200) return
this.$message.success(res.message)
// this.$message.success(res.message)
this.openHintBox(res.message)
// return
this.popState = ""
this.$router.go(0)
})
},
//
openHintBox(message) {
this.alert.state = true
this.alert.message = message
setTimeout(() => {
this.alert.state = false
}, 1500)
}
},
@ -854,18 +850,16 @@ export default {
<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;
border-radius: .2rem;
width: 50%;
opacity: 0;
transition: opacity .5s;
transition: opacity .3s;
&.alertState {
opacity: 1;

View File

@ -241,24 +241,39 @@ export default {
margin: .64rem 0.35rem;
height: calc(100vh - 3rem);
// overflow: auto;
position: relative;
&::after {
content: "";
top: 0;
left: .17rem;
width: 3.4rem;
// width: 100%;
height: 100%;
border-radius: 0.32rem 0 0 0.32rem;
// background: #62b1ff;
border-left: 0.013333rem solid #ddd;
background-color: rgba(235, 235, 235, 0.556862745098039);
position: absolute;
z-index: -1;
}
}
.allSections-left {
width: 3.4rem;
border-left: 0.013333rem solid #ddd;
background-color: rgba(235, 235, 235, 0.556862745098039);
width: 3.57rem;
border-radius: 0.32rem 0 0 0.32rem;
display: flex;
flex-direction: column;
text-align: center;
// overflow-y: auto;
// overflow-x: hidden;
-ms-overflow-style: none;
overflow: -moz-scrollbars-none;
-webkit-overflow-scrolling: touch;
position: relative;
overflow: auto;
&::-webkit-scrollbar {
display: none;
@ -316,7 +331,6 @@ export default {
}
.allSections-right {
// width: 65%;
flex: 1;
background-color: #fff;
border-radius: 0 0.32rem 0.32rem 0;

View File

@ -61,7 +61,7 @@
<section>
<template v-if="favorite.list.length != 0 || loading">
<index-list :list="favorite.list"></index-list>
<div class="paging flexcenter">
<div class="paging flexcenter" v-if="!loading">
<el-pagination small background layout="prev, pager, next" @current-change="currentChange"
:current-page.sync="favorite.page" :page-size="favorite.limit" :total="favorite.count">
</el-pagination>

View File

@ -12,7 +12,7 @@
<template v-if="list.length != 0 || loading">
<index-list :list="list"></index-list>
<div class="paging flexcenter">
<div class="paging flexcenter" v-if="!loading">
<el-pagination small background layout="prev, pager, next" @current-change="currentChange"
:current-page.sync="page" :page-size="limit" :total="count">
</el-pagination>

View File

@ -26,7 +26,8 @@
<div class="operation-box shadow">
<a class="operation-item flexacenter" href="https://www.gter.net/bbs/user/pm.html?mobile=yes">
<div class="operation-left flexacenter">
<img class="operation-icom" mode="widthFix" src="@/assets/img/user/information.png">消息
<img class="operation-icom" mode="widthFix" src="@/assets/img/icon/email.png">消息
<!-- <img class="operation-icom" mode="widthFix" src="@/assets/img/user/information.png">消息 -->
</div>
<div class="operation-right flexacenter">
<div v-if="user.messagenum == 0" class="operation-data flexcenter">{{ count.message }}</div>

View File

@ -1,4 +1,6 @@
const { defineConfig } = require('@vue/cli-service')
const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
const path = require('path')
function resolve(dir) {
@ -18,6 +20,26 @@ module.exports = defineConfig({
publicPath: process.env.NODE_ENV === 'production' ? './' : '/',
configureWebpack: {
optimization: {
splitChunks: {
chunks: 'all',
minSize: 20000,
maxSize: 50000,
minChunks: 1,
maxAsyncRequests: 30,
maxInitialRequests: 30,
automaticNameDelimiter: '~',
enforceSizeThreshold: 50000,
cacheGroups: {
vendors: {
test: /[\\/]node_modules[\\/]/,
priority: -10,
filename: 'js/chunk-vendors.[contenthash].js',
},
},
},
},
resolve: {
alias: {
'assets': '@/assets',
@ -26,7 +48,10 @@ module.exports = defineConfig({
'network': '@/network',
'views': '@/views'
}
}
},
plugins: [
// new BundleAnalyzerPlugin(),
],
},
// svg图片配置
lintOnSave: false,
@ -47,5 +72,6 @@ module.exports = defineConfig({
})
.end()
}
},
productionSourceMap: false,
})