-
发布
+
发布
@@ -57,7 +65,8 @@ export default {
show: false,
content: "",
biaoqing: false,
- list:[]
+ list: [],
+ plist: []
};
},
components: {
@@ -73,19 +82,56 @@ export default {
handleEmotion(i) {
this.content += i;
},
- pl(){
- this.show = true
+ pfb() {
+ if (localStorage.getItem("token") == "") {
+ this.$router.push("/login");
+ } else {
+ window.console.log(this.content);
+ if (this.content != "") {
+ this.axios
+ .post("http://lawpro.earnest.pro/api/login_main/appendComment", {
+ text: this.content,
+ token: localStorage.getItem("token"),
+ type_id: this.$route.query.id,
+ type: 3
+ })
+ .then(res => {
+ if (res.data.code == 200) {
+ this.pinglu(this.$route.query.id);
+
+ this.content = "";
+ }
+ });
+ }
+ }
+ },
+ pinglu() {
+ // this.pid = id;
+ this.axios
+ .post("http://lawpro.earnest.pro/api/login_main/CommentList", {
+ token: localStorage.getItem("token"),
+ type: 2,
+ type_id: this.$route.query.id
+ })
+ .then(res => {
+ window.console.log(res);
+ this.plist = res.data.data.data;
+ // this.list = res.data.data;
+ this.show = true;
+ });
}
},
mounted() {
- this.axios.post("http://lawpro.earnest.pro/api/login_main/mainDetails", {
- token: localStorage.getItem("token"),
- id: 1688,
- type: 1
- }).then((res)=>{
- window.console.log(res)
- this.list = res.data.data
- })
+ this.axios
+ .post("http://lawpro.earnest.pro/api/login_main/mainDetails", {
+ token: localStorage.getItem("token"),
+ id: this.$route.query.id,
+ type: 1
+ })
+ .then(res => {
+ window.console.log(res);
+ this.list = res.data.data;
+ });
}
};
diff --git a/src/components/indexFollow1.vue b/src/components/indexFollow1.vue
index 70a1688..528b818 100644
--- a/src/components/indexFollow1.vue
+++ b/src/components/indexFollow1.vue
@@ -169,6 +169,7 @@
.right {
width: 143px;
height: 62px;
+ line-height: 62px;
background: rgba(247, 247, 247, 1);
border-radius: 10px;
margin: auto 0;
diff --git a/src/components/indexhead.vue b/src/components/indexhead.vue
index f7c16d3..cdac6f7 100644
--- a/src/components/indexhead.vue
+++ b/src/components/indexhead.vue
@@ -133,6 +133,7 @@ export default {
});
break;
case 2:
+ localStorage.setItem("toekn","")
this.$router.push({
path: '/login'
});
diff --git a/src/index.vue b/src/index.vue
index 2209707..ce0c842 100644
--- a/src/index.vue
+++ b/src/index.vue
@@ -2,19 +2,16 @@
-
-
+
+
-
+
{{text}}
@@ -42,37 +39,42 @@ export default {
return {
list: [],
page: 1,
- lock:false,
- text:"加载中"
+ lock: false,
+ text: "加载中"
};
},
methods: {
- getlist(){
- if(this.lock){
- return 'lock'
+ getlist() {
+ if (this.lock) {
+ return "lock";
}
- this.lock = true
- var t = this
+ this.lock = true;
+ var t = this;
this.page += 1;
this.axios
- .post("http://lawpro.earnest.pro/api/login_main/articleList", {
- page: t.page
- })
- .then(res => {
- if (res.data.code == 200) {
- t.list = t.list.concat(res.data.data);
- t.lock = false
- }else{
- t.text = "暂无更多"
- }
-
- })
+ .post("http://lawpro.earnest.pro/api/login_main/articleList", {
+ page: t.page
+ })
+ .then(res => {
+ if (res.data.code == 200) {
+ t.list = t.list.concat(res.data.data);
+ t.lock = false;
+ } else {
+ t.text = "暂无更多";
+ }
+ });
},
- todetail(e){
- window.console.log(e)
- this.$router.push({
- path: `/IndexArticleDetaill?id=`+e
- });
+ todetail(e, type) {
+ window.console.log(e);
+ if (type == 2) {
+ this.$router.push({
+ path: `/IndexArticleDetaill?id=` + e
+ });
+ } else {
+ this.$router.push({
+ path: `/articledetail?id=` + e
+ });
+ }
}
},
components: {
@@ -97,12 +99,12 @@ export default {
if (windowH + scrollH >= documentH) {
// do something
// alert(2);
- window.console.log(1)
- t.getlist()
+ window.console.log(1);
+ t.getlist();
}
});
- }else{
- t.text = "暂无数据"
+ } else {
+ t.text = "暂无数据";
}
});
}