添加标题

This commit is contained in:
pplokijuhyg 2019-12-19 09:12:50 +08:00
parent d41465615d
commit 62c0426cc5
8 changed files with 225 additions and 143 deletions

View File

@ -82,7 +82,7 @@
})(750, 1024);
</script>
<script src="./jquery-3.4.1.min.js"></script>
<title>falv</title>
<title>Lawpro社区</title>
</head>
<body>

View File

@ -197,6 +197,8 @@ window.$(window).scrollTop(window.$(window).scrollTop)
.then(res => {
// window.console.log(res)
this.list = res.data.data;
document.title=this.list.data.title
});
this.axios
.post("http://lawpro.earnest.pro/api/login_main/answerList", {

View File

@ -84,6 +84,8 @@ export default {
indedfinduser
},
mounted() {
document.title=this.$route.query.word + "-搜索"
this.getlist1();
},
watch: {

View File

@ -13,7 +13,7 @@
<span>{{myfollow}}</span>
我关注的
</p>
</div> -->
</div>-->
</div>
</div>
<div class="classification">
@ -26,15 +26,88 @@
</div>
<div class="list">
<div v-for="(item,index) in dynamiclist" :key="index">
<follow v-if="item.status == 3 " :operation="type[item.type] + '了该' + status[item.status]" :day="item.time + '前'" :title="item.title" :nickname="item.nickname" :userimg="'http://lawpro.earnest.pro' + item.img" :num="item.islike" :img="'http://lawpro.earnest.pro' + item.avatar" :text="item.text" :comment="item.comment" :sid="item.id" :type="item.status"></follow>
<answer v-if="item.status == 1 || item.status == 2" :operation="type[item.type] + '了该' + status[item.status]" :day="item.time + '前'" :title="item.title" :types="item.status" :id="item.id" :sid="item.id" :type="item.status"></answer>
<follow v-if="types == 3" operation="我发布了该回答" :day="item.time" :title="item.title" :nickname="item.nickname" :userimg="'http://lawpro.earnest.pro' + userimg" :num="item.islike" :img="'http://lawpro.earnest.pro' + item.avatar" :text="item.text" :comment="item.comment" :sid="item.id" :type="item.status"></follow>
<answer v-if="types==1" operation="我发布了该文章" :day="item.time" :title="item.title" types="1" :sid="item.id" :type="item.status"></answer>
<answer v-if="types==2" operation="我发布了该问题" :day="item.time" :title="item.title" types="2" :sid="item.id" :type="item.status"></answer>
<follow v-if="types == 5 && item.type==2" operation="我收藏了该回答" :day="item.time" :title="item.title" :nickname="item.nickname" :userimg="'http://lawpro.earnest.pro' + userimg" :num="item.islike" :img="'http://lawpro.earnest.pro' + item.avatar" :text="item.text" :comment="item.comment" :sid="item.id" :type="item.status"></follow>
<answer v-if="types==5 && item.type ==1" operation="我收藏了该文章" :day="item.time" :title="item.title" types="1" :sid="item.id" :type="item.status"></answer>
<follow
v-if="item.status == 3 "
:operation="type[item.type] + '了该' + status[item.status]"
:day="item.time + '前'"
:title="item.title"
:nickname="item.nickname"
:userimg="'http://lawpro.earnest.pro' + item.avatar"
:num="item.islike"
:img="'http://lawpro.earnest.pro' + item.img"
:text="item.text"
:comment="item.comment"
:sid="item.id"
:type="item.status"
></follow>
<answer
v-if="item.status == 1 || item.status == 2"
:operation="type[item.type] + '了该' + status[item.status]"
:day="item.time + '前'"
:title="item.title"
:types="item.status"
:id="item.id"
:sid="item.id"
:type="item.status"
></answer>
<follow
v-if="types == 3"
operation="我发布了该回答"
:day="item.time"
:title="item.title"
:nickname="item.nickname"
:userimg="'http://lawpro.earnest.pro' + userimg"
:num="item.islike"
:img="'http://lawpro.earnest.pro' + item.avatar"
:text="item.text"
:comment="item.comment"
:sid="item.id"
:type="item.status"
></follow>
<answer
v-if="types==1"
operation="我发布了该文章"
:day="item.time"
:title="item.title"
types="1"
:sid="item.id"
:type="item.status"
></answer>
<answer
v-if="types==2"
operation="我发布了该问题"
:day="item.time"
:title="item.title"
types="2"
:sid="item.id"
:type="item.status"
></answer>
<follow
v-if="types == 5 && item.type==3"
:operation="'我收藏了该'+ status[item.type]"
:day="item.time"
:title="item.title"
:nickname="item.nickname"
:userimg="'http://lawpro.earnest.pro' + userimg"
:num="item.islike"
:img="'http://lawpro.earnest.pro' + item.avatar"
:text="item.text"
:comment="item.comment"
:sid="item.id"
:type="item.type"
:types="item.type"
></follow>
<answer
v-if="types==5 && item.type ==1|| item.type == 2"
:operation="'我收藏了该'+ status[item.type]"
:day="item.time"
:title="item.title"
:types="item.type"
:sid="item.id"
:type="item.type"
></answer>
</div>
</div>
</div>
</div>
@ -102,164 +175,166 @@
width: 100%;
font-size: 32px;
text-align: center;
}
.select{
border-bottom: 4px solid #6B9147;
.select {
border-bottom: 4px solid #6b9147;
}
}
.list{
width: 100%;
.list {
width: 100%;
}
}
}
</style>
<script>
import follow from "./components/PersonafFollow"
import follow from "./components/PersonafFollow";
// import follows from "./components/PersonafFollows"
import answer from "./components/PersonalAnswer"
import answer from "./components/PersonalAnswer";
// import { log } from 'util';
export default {
name: "Personal-homepage",
data() {
return {
userimg:"",
username:"",
myfollow:"",
attention:"",
dynamiclist:[],
status:['','文章','问题','回答'],
type:['','我点赞','我收藏','我关注','我评论','我回答'],
types:4,
page:1,
lock:false
userimg: "",
username: "",
myfollow: "",
attention: "",
dynamiclist: [],
status: ["", "文章", "问题", "回答"],
type: ["", "我点赞", "我收藏", "我关注", "我评论", "我回答"],
types: 4,
page: 1,
lock: false
};
},
components:{
follow,
answer
components: {
follow,
answer
},
methods:{
wzs(a,b){
methods: {
wzs(a, b) {
// console.log(a,b,12)
// this.$router.replace('/')
this.$router.push({
path:'/articledetail?id=' + b
})
this.$router.push({
path: "/articledetail?id=" + b
});
},
getlist(){
if(this.lock){
return ;
getlist() {
if (this.lock) {
return;
}
this.lock = true
this.page += 1
this.axios.post("http://lawpro.earnest.pro/api/login_main/getUserListDetails",{
token:localStorage.getItem("token"),
type:this.types,
page:this.page
}).then((res)=>{
window.console.log(res)
if(res.data.code == 200){
if(res.data.data.length == 0){
// alert(1)
this.lock = true;
this.page += 1;
this.axios
.post("http://lawpro.earnest.pro/api/login_main/getUserListDetails", {
token: localStorage.getItem("token"),
type: this.types,
page: this.page
})
.then(res => {
window.console.log(res);
if (res.data.code == 200) {
if (res.data.data.length == 0) {
// alert(1)
return ;
}
this.dynamiclist = res.data.data
this.lock = false
}
})
},
getlists(){
if(this.lock){
return ;
}
this.lock = true
this.page += 1
this.axios.post("http://lawpro.earnest.pro/api/login_main/getCollectList",{
token:localStorage.getItem("token"),
page:this.page
}).then((res)=>{
window.console.log(res)
if(res.data.code == 200){
// if(res.data.data.length == 0){
// return ;
// }
// alert(1)
this.dynamiclist = res.data.data
this.lock = false
}
})
}
},
mounted(){
if(localStorage.getItem('token') == ""){
this.$router.push({path:"/login"})
}
this.axios.post('http://lawpro.earnest.pro/api/login_main/getUserDetails',{
token:localStorage.getItem("token")
}).then((res)=>{
// window.console.log(res.data)
if(res.data.code == 200){
this.userimg = res.data.data.user.avatar,
this.username = res.data.data.user.nickname,
this.myfollow = res.data.data.myfollow,
this.attention = res.data.data.user.attention
}
})
this.axios.post("http://lawpro.earnest.pro/api/login_main/getUserListDetails",{
token:localStorage.getItem("token"),
type:4,
page:1
}).then((res)=>{
window.console.log(res)
if(res.data.code == 200){
this.dynamiclist = res.data.data
}
})
var t = this
window.$(window).scroll(() => {
var windowH = window.$(window).height(); //
var documentH = window.$(document).height(); //
var scrollH = window.$(window).scrollTop(); //
// scrollH = $(document).scrollTop();
if (windowH + scrollH >= documentH) {
// do something
// alert(2);
window.console.log(1)
if(this.types == 5){
t.getlists(0)
}else{
t.getlist()
}
return;
}
});
},
watch:{
types(){
this.page = 0
this.dynamiclist = []
this.lock = false;
if(this.types == 5){
this.getlists(0)
}else{
this.getlist()
this.dynamiclist = res.data.data;
this.lock = false;
}
});
},
getlists() {
if (this.lock) {
return;
}
this.lock = true;
this.page += 1;
this.axios
.post("http://lawpro.earnest.pro/api/login_main/getCollectList", {
token: localStorage.getItem("token"),
page: this.page
})
.then(res => {
window.console.log(res);
if (res.data.code == 200) {
// if(res.data.data.length == 0){
// return ;
// }
// alert(1)
this.dynamiclist = res.data.data;
this.lock = false;
}
});
}
},
mounted() {
document.title= "个人中心"
if (localStorage.getItem("token") == "") {
this.$router.push({ path: "/login" });
}
this.axios
.post("http://lawpro.earnest.pro/api/login_main/getUserDetails", {
token: localStorage.getItem("token")
})
.then(res => {
// window.console.log(res.data)
if (res.data.code == 200) {
(this.userimg = res.data.data.user.avatar),
(this.username = res.data.data.user.nickname),
(this.myfollow = res.data.data.myfollow),
(this.attention = res.data.data.user.attention);
}
});
this.axios
.post("http://lawpro.earnest.pro/api/login_main/getUserListDetails", {
token: localStorage.getItem("token"),
type: 4,
page: 1
})
.then(res => {
window.console.log(res);
if (res.data.code == 200) {
this.dynamiclist = res.data.data;
}
});
var t = this;
window.$(window).scroll(() => {
var windowH = window.$(window).height(); //
var documentH = window.$(document).height(); //
var scrollH = window.$(window).scrollTop(); //
// scrollH = $(document).scrollTop();
if (windowH + scrollH >= documentH) {
// do something
// alert(2);
window.console.log(1);
if (this.types == 5) {
t.getlists(0);
} else {
t.getlist();
}
}
});
},
watch: {
types() {
this.page = 0;
this.dynamiclist = [];
this.lock = false;
if (this.types == 5) {
this.getlists(0);
} else {
this.getlist();
}
}
},
beforeRouteLeave(a,b,c){
window.$(window).scroll(() => {
});
c()
beforeRouteLeave(a, b, c) {
window.$(window).scroll(() => {});
c();
}
};
</script>

View File

@ -209,6 +209,8 @@ window.$(window).scrollTop(window.$(window).scrollTop)
.then(res => {
window.console.log(res);
this.list = res.data.data;
document.title=this.list.data.title
});
}
};

View File

@ -15,7 +15,7 @@
</div>
<div class="agree">{{num}}人赞同了该回答</div>
<div class="content">
<img :src="img" alt srcset />
<img :src="img" v-if="!img" alt srcset />
<p>
{{text}}
</p>

View File

@ -10,7 +10,7 @@
<list
:title="item.title"
:id="item.id"
:num="item.comment"
:num="item.type == 1 ?item.comment:item.answer"
:img="item.img"
:text="item.text"
:type="item.type"
@ -92,6 +92,7 @@ export default {
heads
},
mounted() {
document.title="Lawpro社区"
var t = this;
this.axios
.post("http://lawpro.earnest.pro/api/Login_main/articleList", {

View File

@ -55,7 +55,7 @@ const router=new Router({
},
{
path: '/',
component: index
component: index,
},
{
path: '/IndexArticleDetaill',