This commit is contained in:
pplokijuhyg 2019-12-27 15:13:48 +08:00
parent dec51c79cc
commit c92b25fa8a
6 changed files with 85 additions and 27 deletions

View File

@ -116,6 +116,12 @@
:type="item.type" :type="item.type"
></answer> ></answer>
</div> </div>
<div
style="width:100%;height:0.5rem;text-align:center;line-height:0.5rem;display:flex; flex-direction: column; align-items: center;font-size:0.2rem;"
>
<img :src="login" style="width:0.5rem" alt v-if="text == '加载中' " />
{{text}}
</div>
</div> </div>
</div> </div>
</div> </div>
@ -198,6 +204,7 @@
import follow from "./components/PersonafFollow"; import follow from "./components/PersonafFollow";
// import follows from "./components/PersonafFollows" // import follows from "./components/PersonafFollows"
import answer from "./components/PersonalAnswer"; import answer from "./components/PersonalAnswer";
import login from "./assets/login.gif";
import home from "./assets/home.png"; import home from "./assets/home.png";
// import { log } from 'util'; // import { log } from 'util';
export default { export default {
@ -214,7 +221,9 @@ export default {
type: ["", "我点赞", "我收藏", "我关注", "我评论", "我回答"], type: ["", "我点赞", "我收藏", "我关注", "我评论", "我回答"],
types: 4, types: 4,
page: 0, page: 0,
lock: false lock: false,
text: "加载中",
login
// imgurl:"" // imgurl:""
}; };
}, },
@ -240,6 +249,7 @@ export default {
if (this.lock) { if (this.lock) {
return; return;
} }
this.text = "加载中";
this.lock = true; this.lock = true;
this.page += 1; this.page += 1;
this.axios this.axios
@ -258,18 +268,23 @@ export default {
return; return;
} }
window.console.log(this.page,261) window.console.log(this.page, 261);
if (this.page == 1) { if (this.page == 1) {
this.dynamiclist = res.data.data; this.dynamiclist = res.data.data;
window.console.log(1,res.data.data.length) if (res.data.data.length < 20) {
this.text = "暂无更多数据";
}
window.console.log(1, res.data.data.length);
} else if (res.data.data.length > 0) { } else if (res.data.data.length > 0) {
this.dynamiclist.push(...res.data.data); this.dynamiclist.push(...res.data.data);
window.console.log(2) window.console.log(2);
if (res.data.data.length < 20) {
this.text = "暂无更多数据";
}
} else { } else {
this.lock = true; this.lock = true;
window.console.log(3,res.data.data.length > 0) window.console.log(3, res.data.data.length > 0);
this.text = "暂无更多数据";
} }
window.console.log(this.lock); window.console.log(this.lock);
} }
@ -279,6 +294,7 @@ export default {
if (this.lock) { if (this.lock) {
return; return;
} }
this.text = "加载中";
this.lock = true; this.lock = true;
this.page += 1; this.page += 1;
this.axios this.axios
@ -296,19 +312,24 @@ export default {
// return ; // return ;
// } // }
// alert(1) // alert(1)
window.console.log(this.page,299) window.console.log(this.page, 299);
if (this.page == 1) { if (this.page == 1) {
this.dynamiclist = res.data.data; this.dynamiclist = res.data.data;
window.console.log(1,res.data.data.length) window.console.log(1, res.data.data.length);
if (res.data.data.length < 20) {
this.text = "暂无更多数据";
}
} else if (res.data.data.length > 0) { } else if (res.data.data.length > 0) {
this.dynamiclist.push(...res.data.data); this.dynamiclist.push(...res.data.data);
window.console.log(2) if (res.data.data.length < 20) {
this.text = "暂无更多数据";
}
window.console.log(2);
} else { } else {
this.lock = true; this.lock = true;
window.console.log(3) window.console.log(3);
this.text = "暂无更多数据";
} }
window.console.log(this.lock); window.console.log(this.lock);
} }
@ -375,7 +396,7 @@ export default {
// } // }
this.page = 0; this.page = 0;
this.dynamiclist = []; this.dynamiclist = [];
// this.lock = false; this.lock = false;
if (this.types == 5) { if (this.types == 5) {
this.getlists(this.types); this.getlists(this.types);
} else { } else {

View File

@ -336,9 +336,9 @@ window.$(window).scrollTop(window.$(window).scrollTop)
width: 100%; width: 100%;
color: #333333; color: #333333;
font-size: 0.36rem; font-size: 0.36rem;
text-indent: 0.3rem; // text-indent: 0.3rem;
line-height: 1rem; line-height: 1rem;
font-weight: 500; font-weight: 600;
} }
.title { .title {
color: #333333; color: #333333;

View File

@ -63,6 +63,19 @@
color: #000; color: #000;
line-height: 46px; line-height: 46px;
font-weight: bold; font-weight: bold;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
overflow:hidden;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
} }
.answer { .answer {
.user { .user {
@ -223,7 +236,10 @@ export default {
type:this.type, type:this.type,
click_id:this.id, click_id:this.id,
status: 1 status: 1
}).then(()=>{ }).then((res)=>{
if(res.data.code != 200){
return ;
}
if(this.islike){ if(this.islike){
this.like = parseInt(this.like) - 1 this.like = parseInt(this.like) - 1
}else{ }else{
@ -238,7 +254,10 @@ export default {
token:localStorage.getItem("token"), token:localStorage.getItem("token"),
type:this.type, type:this.type,
id:this.id id:this.id
}).then(()=>{ }).then((res)=>{
if(res.data.code != 200){
return ;
}
if(this.iscllect){ if(this.iscllect){
this.collect = parseInt(this.collect) - 1 this.collect = parseInt(this.collect) - 1
}else{ }else{

View File

@ -204,7 +204,10 @@ export default {
type:3, type:3,
click_id:this.sid, click_id:this.sid,
status: 1 status: 1
}).then(()=>{ }).then((res)=>{
if(res.data.code != 200){
return ;
}
if(this.islike){ if(this.islike){
this.like = parseInt(this.like) - 1 this.like = parseInt(this.like) - 1
}else{ }else{
@ -219,7 +222,10 @@ export default {
token:localStorage.getItem("token"), token:localStorage.getItem("token"),
type:3, type:3,
id:this.sid id:this.sid
}).then(()=>{ }).then((res)=>{
if(res.data.code != 200){
return ;
}
if(this.iscllect){ if(this.iscllect){
this.collect = parseInt(this.collect) - 1 this.collect = parseInt(this.collect) - 1
}else{ }else{

View File

@ -67,9 +67,9 @@
width: 100%; width: 100%;
color: #333333; color: #333333;
font-size: 0.3rem; font-size: 0.3rem;
text-indent: 0.3rem; // text-indent: 0.3rem;
line-height: 0.45rem; line-height: 0.45rem;
font-weight: 500; font-weight: 600;
} }
.title { .title {
color: #333333; color: #333333;
@ -262,7 +262,10 @@ export default {
type:1, type:1,
click_id:this.$route.query.id, click_id:this.$route.query.id,
status: 1 status: 1
}).then(()=>{ }).then((res)=>{
if(res.data.code != 200){
return ;
}
if(this.islike){ if(this.islike){
this.like = parseInt(this.like) - 1 this.like = parseInt(this.like) - 1
}else{ }else{
@ -277,7 +280,10 @@ export default {
token:localStorage.getItem("token"), token:localStorage.getItem("token"),
type:1, type:1,
id:this.$route.query.id id:this.$route.query.id
}).then(()=>{ }).then((res)=>{
if(res.data.code != 200){
return ;
}
if(this.iscllect){ if(this.iscllect){
this.collect = parseInt(this.collect) - 1 this.collect = parseInt(this.collect) - 1
}else{ }else{

View File

@ -71,7 +71,10 @@ export default {
type:this.type, type:this.type,
click_id:this.id, click_id:this.id,
status: 1 status: 1
}).then(()=>{ }).then((res)=>{
if(res.data.code != 200){
return ;
}
if(this.islike){ if(this.islike){
this.like = parseInt(this.like) - 1 this.like = parseInt(this.like) - 1
}else{ }else{
@ -86,7 +89,10 @@ export default {
token:localStorage.getItem("token"), token:localStorage.getItem("token"),
type:this.type, type:this.type,
id:this.id id:this.id
}).then(()=>{ }).then((res)=>{
if(res.data.code != 200){
return ;
}
if(this.iscllect){ if(this.iscllect){
this.collect = parseInt(this.collect) - 1 this.collect = parseInt(this.collect) - 1
}else{ }else{