This commit is contained in:
landaiqing 2023-12-27 22:35:46 +08:00
parent f8f7249465
commit ca62bed9a0
5 changed files with 174 additions and 104 deletions

View File

@ -43,7 +43,7 @@
</div>
</div>
</div>
<div class="NavInfo" style="margin-top:35px;margin-left:50px;width:220px;">
<div id="网站信息" class="NavInfo" style="margin-top:35px;margin-left:50px;width:220px;">
<span style="font-size:30px;font-family: STHupo">{{ UrlObj.name }}</span><br/>
<div class="NavInfo">
<span style="width:200px">创建时间{{ Cdate }}</span><br/>
@ -91,7 +91,7 @@
</div>
</div>
<!-- 标签详情-->
<div class="JustBack" style="width:670px;display:flex; flex-direction: column; flex-wrap: nowrap;">
<div id="网站介绍" class="JustBack" style="width:670px;display:flex; flex-direction: column; flex-wrap: nowrap;">
<!--文章详情-->
<div style="width:670px;color: var(--theme-color)">
<div class="HeadLine">
@ -109,7 +109,7 @@
<!--导航评论-->
</div>
<!--热度趋势-->
<div class="JustBack" style="width:670px;display:flex; flex-direction: column; flex-wrap: nowrap;">
<div id="热度趋势" class="JustBack" style="width:670px;display:flex; flex-direction: column; flex-wrap: nowrap;">
<div style="width:670px;color: var(--theme-color)">
<div class="HeadLine" style="margin-top:50px">
<div class="HeadSquare"></div>
@ -121,7 +121,7 @@
</div>
</div>
<!--用户评论-->
<div class="JustBack" style="width:670px;height:auto;display:flex; flex-direction: column; flex-wrap: nowrap;">
<div id="用户评论" class="JustBack" style="width:670px;height:auto;display:flex; flex-direction: column; flex-wrap: nowrap;">
<div style="width:670px;color: var(--theme-color)">
<div class="HeadLine" style="margin-top:30px">
<div class="HeadSquare"></div>
@ -163,7 +163,20 @@ export default {
components: {LeftSide, HotRecomment, NewRecomment, RandomRecomment, UserComment},
data() {
return {
category: [],
category: [{
name:'网站信息',
childUC:[]
},{
name:'网站介绍',
childUC:[]
},{
name:'热度趋势',
childUC:[]
},
{
name:'用户评论',
childUC:[]
}],
visible: false,
//
TimeList: [],
@ -192,6 +205,9 @@ export default {
rootId_AllComment:{1:[],2:[]},
}
},
watch: {
'$route': 'getPath'
},
mounted() {
// this.GetAllComment();
@ -209,6 +225,15 @@ export default {
},
computed: {},
methods: {
getPath() {
if(this.$route.query.name){
document.querySelector(this.$route.query.name).scrollIntoView(true)
}else{
return false;
}
},
// iframe
// funFrame(){
// var iframe = document.getElementById("myframe");

View File

@ -75,7 +75,7 @@ export default {
}else if(this.$route.path==='/nav'){
if (node.name) {
this.$router.push({
path: '/home',
path: '/nav',
query: {
name: `#${node.name}`,
}

View File

@ -1,7 +1,11 @@
<template>
<div class="app-card" >
<div style="display: flex;flex-direction: row;align-items: center" @click="goToNavDetail">
<el-image v-if="nav.icon" :src="nav.icon" style="width: 30px;height: 30px"></el-image>
<el-image v-if="nav.icon" :src="nav.icon" style="width: 30px;height: 30px">
<div slot="error" class="image-slot">
<img style="width: 30px" :src="require('@/assets/img/null.png')" alt="图标">
</div>
</el-image>
<div class="content-card">
<el-tooltip v-if="nav.name" class="item" effect="dark" :content="nav.name" placement="top">

View File

@ -15,14 +15,12 @@
<span class="title">热搜榜</span>
<!-- <span class="clear" @click="clearHistory" v-show="isShowClearHistory"><i class="el-icon-circle-close"></i>清空</span>-->
</div>
<div v-if="hotSearchKeyWords.length===0" v-show="isShowClearHistory">
<div v-if="hotSearchKeyWords.length!==0" v-show="isShowClearHistory">
<el-tag
:v-if="hotSearchKeyWords.length!==0"
v-for="(tag,index) in hotSearchKeyWords"
:key="index"
size="small"
closable
@close="handleClose(tag)"
style="margin-right: 10px; margin-top: 10px; cursor: pointer"
@click="handleSearch(tag)"
>
@ -41,9 +39,9 @@
<div class="search-his">
<div>
<span class="title">搜索历史</span>
<span class="clear" @click="clearHistory" v-show="isShowClearHistory"><i class="el-icon-circle-close"></i>清空</span>
<!-- <span class="clear" v-show="isShowClearHistory"><i class="el-icon-circle-close"></i>清空</span>-->
</div>
<div v-if="historySearch.length===0" v-show="isShowClearHistory">
<div v-if="historySearch.length!==0" v-show="isShowClearHistory">
<el-tag
:v-if="historySearch.length!==0"
v-for="(tag,index) in historySearch"
@ -138,40 +136,27 @@ export default {
clearSearchResults(){
this.searchResults=[];
},
clearHistory() {
// var that=this;
// axios({
// method: 'post',
// //
// url: 'http://localhost:8082/helloGithub_war_exploded/deleteAllLabel',
// // URL
// params: {
// }
// }).then((res)=>{
// if (res.data.code === 200) {
// Vue.prototype.$notify({
// title: '',
// message: ('i', {style: 'color: teal'}, res.data.msg),
// type: 'success',
// offset: 50
// });
// setTimeout(()=>{
// that.gethistorySearch();
// })
// } else {
// Vue.prototype.$notify.error({
// title: '',
// message: res.data.msg,
// offset: 50
// });
// }
// }).catch((error)=>{
// Vue.prototype.$notify.error({
// title: '',
// message: error,
// offset: 50
// });
// })
getHotSearchKeyWords() {
var that=this;
axios({
method: 'post',
//
url: '/api/Search/getHotList',
// URL
params: {
searchKey:this.search,
}
}).then((res)=>{
if (res.data.code === 200) {
that.hotSearchKeyWords=res.data.data;
} else {
return false;
}
}).catch((error)=>{
})
},
// searchRequest() {
// const params = {
@ -182,60 +167,78 @@ export default {
// window.open(url, '_blank');
// },
gethistorySearch(){
// var that=this;
// axios({
// method: 'post',
// //
// url: 'http://localhost:8082/helloGithub_war_exploded/selectUserLabel',
// // URL
// params: {
// }
// }).then((res)=>{
// that.historySearch=res.data;
//
// }).catch((error)=>{
// Vue.prototype.$notify.error({
// title: '',
// message: error,
// offset: 50
// });
// })
var that=this;
if(localStorage.getItem('userId')&& localStorage.getItem('Authorization') ){
axios({
method: 'post',
//
url: '/api/Search/getSearchHistoryByUserId',
// URL
params: {
userId:localStorage.getItem('userId')
}
}).then((res)=>{
if(res.data.code===200){
that.historySearch=res.data.data;
}else{
return false;
}
}).catch((error)=>{
})
}else{
Vue.prototype.$notify.info({
title: '提示',
message: ('i', {style: 'color: teal'}, "登录状态失效,请重新登录!"),
offset: 50
});
}
},
handleClose(tag){
// var that=this;
// axios({
// method: 'post',
// //
// url: 'http://localhost:8082/helloGithub_war_exploded/deletelabel',
// // URL
// params: {
// tag:tag
// }
// }).then((res)=>{
// if(res.data.code===200){
// Vue.prototype.$notify({
// title: '',
// message: ('i', {style: 'color: teal'}, res.data.msg),
// type: 'success',
// offset: 50
// });
// setTimeout(()=>{
// that.gethistorySearch();
// })
// }else{
// Vue.prototype.$notify.error({
// title: '',
// message: res.data.msg,
// offset: 50
// });
// }
// }).catch((error)=>{
// Vue.prototype.$notify.error({
// title: '',
// message: error,
// offset: 50
// });
// })
var that=this;
if(localStorage.getItem('userId')&& localStorage.getItem('Authorization') ){
axios({
method: 'post',
//
url: '/api/Search/delSearchHistoryByUserId',
// URL
params: {
searchKey:tag,
userId:localStorage.getItem('userId')
}
}).then((res)=>{
if(res.data.code===200){
// Vue.prototype.$notify({
// title: '',
// message: ('i', {style: 'color: teal'}, ""),
// type: 'success',
// offset: 50
// });
that.gethistorySearch();
}else{
Vue.prototype.$notify.error({
title: '错误',
message: "删除失败!",
offset: 50
});
}
}).catch((error)=>{
})
}else{
Vue.prototype.$notify.info({
title: '提示',
message: ('i', {style: 'color: teal'}, "登录状态失效,请重新登录!"),
offset: 50
});
}
},
searchByInput(){
var that=this;
@ -265,6 +268,7 @@ export default {
type:"success",
offset: 50
});
that.getHotSearchKeyWords();
that.searchResults=res.data.data;
setTimeout(() => {
that.visible = true;

View File

@ -3,7 +3,7 @@
<div style="display: flex;align-items: center;">
<el-image style="width: 30px" :src="searchResults.icon">
<div slot="error" class="image-slot">
<img style="width: 28px" src="@/assets/img/null.png">
<img style="width: 28px" :src="require('@/assets/img/null.png')" alt="图标">
</div>
</el-image>
</div>
@ -13,23 +13,35 @@
{{ searchResults.name }}
</span>
</el-tooltip>
<el-tooltip effect="dark" content="详情" placement="right" @click="goToDetail(searchResults.id)">
<i style="margin-left: 10px" class="card-icon el-icon-d-arrow-right"></i>
</el-tooltip>
<el-tooltip effect="dark" :content="'【'+searchResults.name+'】'+'手机二维码'" placement="bottom">
<el-tooltip effect="dark" placement="bottom">
<div slot="content">
<span v-if="searchResults.name" style="font-size:12px !important;">{{ searchResults.name }}手机二维码</span><br/><br/>
<div style="width:100% ;text-align: center"><img v-if="searchResults.id" style="width:150px"
:src="getResultsQR(searchResults.id)"></div>
</div>
<i style="margin-left: 10px" class="qr el-icon-s-grid"></i>
</el-tooltip>
<el-tooltip effect="dark" content="详情" placement="right" >
<i style="margin-left: 10px" class="card-icon el-icon-d-arrow-right" @click="goToDetail(searchResults.id)"></i>
</el-tooltip>
</div>
</div>
</template>
<script>
import axios from "axios";
export default {
name: "SearchResults",
props: {
searchResults: Object,
},
data() {
return {}
return {
imageCode:'',
}
},
mounted() {
@ -39,6 +51,31 @@ export default {
},
computed: {},
methods: {
getResultsQR(url_id) {
let _this = this;
if(url_id!==''){
axios({
method: 'post',
url: '/api/qrcode/qrc_return',
params: {
url_id: url_id,
}
}).then(function (res) {
if (res.data!==''){
_this.imageCode = "data:image/jpg;base64," + res.data;
}
}).catch((error) => {
// Vue.prototype.$notify.error({
// title: '',
// message: error === null ? '' : error,
// offset: 0
// });
})
}else{
return false
}
return this.imageCode;
},
goToDetail(id){
if(id){
let pathInfo = this.$router.resolve({