diff --git a/src/IndexArticleDetail.vue b/src/IndexArticleDetail.vue index 7e2865d..c83c9af 100644 --- a/src/IndexArticleDetail.vue +++ b/src/IndexArticleDetail.vue @@ -13,7 +13,10 @@ :nickname="item.nickname" :text="item.articlecontent" :comment="item.comment" - :num="item.islike" + :like="item.islike" + :collect="item.collect" + :islike="item.isClick" + :iscllect="item.isCollect" > diff --git a/src/IndexFind.vue b/src/IndexFind.vue index 5d06d82..96d63c8 100644 --- a/src/IndexFind.vue +++ b/src/IndexFind.vue @@ -6,7 +6,18 @@
- +
{{text}}
@@ -73,8 +84,8 @@ export default { indedfinduser }, mounted() { - this.getlist1() - }, + this.getlist1(); + }, watch: { no() { this.page = 0; @@ -82,7 +93,7 @@ export default { this.list = []; this.lock = false; // this.getlist1(); - this.text="加载中" + this.text = "加载中"; } }, beforeRouteLeave(a, b, c) { @@ -90,41 +101,39 @@ export default { c(); }, methods: { - getlist1(){ - let t=this; - t.list=[] + getlist1() { + let t = this; + t.list = []; t.axios .post("http://lawpro.earnest.pro/api/login_main/indexsearch", { where: t.$route.query.word, type: t.no, - }).then((res)=>{ - if(res.data.data){ - - t.list=res.data.data - window.console.log(t.list.length,"hfihaifohog") - if(t.list.length<5){ - t.text="暂无数据" + token: localStorage.getItem("token") + }) + .then(res => { + if (res.data.data) { + t.list = res.data.data; + window.console.log(t.list.length, "hfihaifohog"); + if (t.list.length < 5) { + t.text = "暂无数据"; } 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); - t.getlist(); - } - }); - - }else{ - window.console.log("errir") - t.text="暂无数据" + 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); + t.getlist(); + } + }); + } else { + window.console.log("errir"); + t.text = "暂无数据"; } - - - }) + }); }, getlist() { if (this.lock) { @@ -142,36 +151,34 @@ export default { .then(res => { window.console.log(res); if (res.data.code == 200) { - if(res.data.data){ - t.list = t.list.concat(res.data.data); - + if (res.data.data) { + t.list = t.list.concat(res.data.data); } t.lock = false; - 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); - t.getlist(); - } - }); + 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); + t.getlist(); + } + }); } else { t.text = "暂无更多"; } // t.list=res.data.data }); - }, getno(e) { window.console.log(e); this.no = e; this.list = []; - this.getlist1() - window.console.log(this.list.length,"list") + this.getlist1(); + window.console.log(this.list.length, "list"); }, todetail(e, type) { window.console.log(e); @@ -198,21 +205,21 @@ export default { // // res.data.data[i].avatar= "http://lawpro.earnest.pro/"+res.data.data[i].avatar // // } // // t.list=res.data.data - // if (res.data.code == 200) { - // t.list = res.data.data; - // 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); - // t.getlist(); - // } - // }); - // } else { + // if (res.data.code == 200) { + // t.list = res.data.data; + // 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); + // t.getlist(); + // } + // }); + // } else { // t.text = "暂无数据"; // } // }) diff --git a/src/PersonalHomepage.vue b/src/PersonalHomepage.vue index b9a7b6a..c4627af 100644 --- a/src/PersonalHomepage.vue +++ b/src/PersonalHomepage.vue @@ -22,7 +22,7 @@
回答
文章
提问
- +
收藏
@@ -31,7 +31,8 @@ - + +
@@ -165,7 +166,7 @@ export default { return ; } - this.dynamiclist = this.dynamiclist.concat(res.data.data) + this.dynamiclist = res.data.data this.lock = false } @@ -183,12 +184,13 @@ export default { }).then((res)=>{ window.console.log(res) if(res.data.code == 200){ - if(res.data.data.length == 0){ + // if(res.data.data.length == 0){ + + // return ; + // } // alert(1) - return ; - } - this.dynamiclist = this.dynamiclist.concat(res.data.data) + this.dynamiclist = res.data.data this.lock = false } diff --git a/src/articledetail.vue b/src/articledetail.vue index 13fb5fd..20dc2cf 100644 --- a/src/articledetail.vue +++ b/src/articledetail.vue @@ -13,6 +13,10 @@ :text="list.data.articlecontent" :title="list.data.title" :guanzhu="ifgz" + :like = "list.data.islike" + :collect = "list.data.comment" + :islike="list.data.isClick" + :iscllect="list.data.isCollect" @pinglun="pinglu" @guanzhu="gz" > @@ -45,6 +49,7 @@ :img="'http://lawpro.earnest.pro/' + item.avatar" :name="item.nickname" :text="item.text" + >
{{msg}}
diff --git a/src/assets/collect.png b/src/assets/collect.png new file mode 100644 index 0000000..9cb4b22 Binary files /dev/null and b/src/assets/collect.png differ diff --git a/src/assets/collects.png b/src/assets/collects.png new file mode 100644 index 0000000..404c297 Binary files /dev/null and b/src/assets/collects.png differ diff --git a/src/assets/like.png b/src/assets/like.png new file mode 100644 index 0000000..614de52 Binary files /dev/null and b/src/assets/like.png differ diff --git a/src/assets/likes.png b/src/assets/likes.png new file mode 100644 index 0000000..fa36268 Binary files /dev/null and b/src/assets/likes.png differ diff --git a/src/components/IndexList.vue b/src/components/IndexList.vue index 1f547b4..2dfe47e 100644 --- a/src/components/IndexList.vue +++ b/src/components/IndexList.vue @@ -13,14 +13,22 @@

{{text}}

-
+
{{num}}回答
+
+ + {{like}}点赞 +
+
+ + {{collect}}收藏 +
@@ -177,14 +185,22 @@ } \ No newline at end of file diff --git a/src/components/indexfindall.vue b/src/components/indexfindall.vue index 435939f..524e65b 100644 --- a/src/components/indexfindall.vue +++ b/src/components/indexfindall.vue @@ -6,14 +6,22 @@

{{content}}

-
+

{{num}}条评论

+
+ +

{{like}}点赞

+
+
+ +

{{collect}}收藏

+
@@ -22,11 +30,19 @@ @@ -54,7 +109,7 @@ export default { font-size: 34px; font-weight: 500; padding: 0 41px; - text-indent:0; + text-indent: 0; padding-top: 34px; padding-bottom: 23px; } @@ -88,9 +143,13 @@ export default { > div { display: flex; > p { - margin-right: 60px; + margin-right: 10px; margin-left: 10px; } + >img{ + width: 18px; + height: 18px; + } } // justify-content: space-between; diff --git a/src/index.vue b/src/index.vue index 1d1b4f0..dc24c02 100644 --- a/src/index.vue +++ b/src/index.vue @@ -2,7 +2,11 @@
-
+
@@ -45,7 +53,6 @@ export default { }; }, methods: { - getlist() { if (this.lock) { return "lock"; @@ -54,7 +61,8 @@ export default { var t = this; this.page += 1; this.axios - .post("http://lawpro.earnest.pro/api/login_main/articleList", { + .post("http://lawpro.earnest.pro/api/Login_main/articleList", { + token: localStorage.getItem("token"), page: t.page }) .then(res => { @@ -66,7 +74,7 @@ export default { } }); }, - todetail(e, type,userid) { + todetail(e, type, userid) { window.console.log(e); if (type == 2) { this.$router.push({ @@ -74,7 +82,7 @@ export default { }); } else { this.$router.push({ - path: `/articledetail?id=` + e+`&userid=`+userid + path: `/articledetail?id=` + e + `&userid=` + userid }); } } @@ -86,8 +94,9 @@ export default { mounted() { var t = this; this.axios - .post("http://lawpro.earnest.pro/api/login_main/articleList", { - page: t.page + .post("http://lawpro.earnest.pro/api/Login_main/articleList", { + page: t.page, + token: localStorage.getItem("token") }) .then(res => { window.console.log(res.data); @@ -110,11 +119,9 @@ export default { } }); }, - beforeRouteLeave(a,b,c){ - window.$(window).scroll(() => { - - }); - c() + beforeRouteLeave(a, b, c) { + window.$(window).scroll(() => {}); + c(); } }; \ No newline at end of file