|
@@ -10,8 +10,22 @@ const handleFileUrl = (id) => {
|
|
// window.open(fileUrl, '_blank')
|
|
// window.open(fileUrl, '_blank')
|
|
// }
|
|
// }
|
|
}
|
|
}
|
|
|
|
+const advertisement = new Vue({
|
|
|
|
+ el: "#advertisement",
|
|
|
|
+ mixins: [cmSysVitaMixins],
|
|
|
|
+ data: {
|
|
|
|
+ advertisList: [
|
|
|
|
+ 'https://www.caimei365.com/img/ross/ross-image@1x.jpg',
|
|
|
|
+ 'https://img.caimei365.com/group1/M00/00/A4/rB-lF2TxdE-AAOcgAAGPzubpUIU968.jpg',
|
|
|
|
+ 'https://img.caimei365.com/group1/M00/04/92/rB-lGGT32GiAbNIMAANwZbKVhEE875.jpg'
|
|
|
|
+ ]
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
|
|
-var articleSide = new Vue({
|
|
|
|
|
|
+ },
|
|
|
|
+ methods: {}
|
|
|
|
+});
|
|
|
|
+const articleSide = new Vue({
|
|
el: '#articleSide',
|
|
el: '#articleSide',
|
|
data: {
|
|
data: {
|
|
typeId: 0,
|
|
typeId: 0,
|
|
@@ -19,7 +33,7 @@ var articleSide = new Vue({
|
|
labelTxt: '',
|
|
labelTxt: '',
|
|
labelList: [],
|
|
labelList: [],
|
|
recommend: {},
|
|
recommend: {},
|
|
- adList: [],
|
|
|
|
|
|
+ adList: []
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
// getLabels: function(){
|
|
// getLabels: function(){
|
|
@@ -36,15 +50,15 @@ var articleSide = new Vue({
|
|
// }
|
|
// }
|
|
// });
|
|
// });
|
|
// },
|
|
// },
|
|
- getRecommend: function(typeId, pageNum){
|
|
|
|
|
|
+ getRecommend: function (typeId, pageNum) {
|
|
console.log(typeId, pageNum);
|
|
console.log(typeId, pageNum);
|
|
var _self = this;
|
|
var _self = this;
|
|
- $.getJSON("/article/recommend",{
|
|
|
|
|
|
+ $.getJSON("/article/recommend", {
|
|
typeId: typeId,
|
|
typeId: typeId,
|
|
pageNum: pageNum
|
|
pageNum: pageNum
|
|
}, function (r) {
|
|
}, function (r) {
|
|
if (r.code === 0 && r.data) {
|
|
if (r.code === 0 && r.data) {
|
|
- _self.recommend= r.data;
|
|
|
|
|
|
+ _self.recommend = r.data;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -56,7 +70,7 @@ var articleSide = new Vue({
|
|
// }
|
|
// }
|
|
// });
|
|
// });
|
|
// },
|
|
// },
|
|
- clickAD: function(id, link){
|
|
|
|
|
|
+ clickAD: function (id, link) {
|
|
debugger;
|
|
debugger;
|
|
$.getJSON("/article/ad/click", {id: id}, function (r) {
|
|
$.getJSON("/article/ad/click", {id: id}, function (r) {
|
|
window.open(link);
|
|
window.open(link);
|
|
@@ -65,24 +79,24 @@ var articleSide = new Vue({
|
|
},
|
|
},
|
|
mounted: function () {
|
|
mounted: function () {
|
|
const _self = this;
|
|
const _self = this;
|
|
- this.typeId = $("#typeId").val()*1;
|
|
|
|
- this.labelId = $("#labelId").val()*1;
|
|
|
|
|
|
+ this.typeId = $("#typeId").val() * 1;
|
|
|
|
+ this.labelId = $("#labelId").val() * 1;
|
|
// this.getLabels();
|
|
// this.getLabels();
|
|
if (isPC) {
|
|
if (isPC) {
|
|
// this.getAds();
|
|
// this.getAds();
|
|
this.getRecommend(this.typeId, 1);
|
|
this.getRecommend(this.typeId, 1);
|
|
//换一批15秒请求一次
|
|
//换一批15秒请求一次
|
|
- setInterval(function(){
|
|
|
|
|
|
+ setInterval(function () {
|
|
if (_self.recommend.hasNextPage) {
|
|
if (_self.recommend.hasNextPage) {
|
|
_self.getRecommend(_self.typeId, _self.recommend.nextPage);
|
|
_self.getRecommend(_self.typeId, _self.recommend.nextPage);
|
|
} else {
|
|
} else {
|
|
_self.getRecommend(_self.typeId, 1);
|
|
_self.getRecommend(_self.typeId, 1);
|
|
}
|
|
}
|
|
- },15000);
|
|
|
|
|
|
+ }, 15000);
|
|
}
|
|
}
|
|
- if (this.labelId>0) {
|
|
|
|
|
|
+ if (this.labelId > 0) {
|
|
// 添加一个标签点击量
|
|
// 添加一个标签点击量
|
|
- $.get("/article/label/click", {id: this.labelId}, function(res){
|
|
|
|
|
|
+ $.get("/article/label/click", {id: this.labelId}, function (res) {
|
|
console.log(res);
|
|
console.log(res);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -90,7 +104,7 @@ var articleSide = new Vue({
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
|
|
-var drawerFooter = new Vue({
|
|
|
|
|
|
+const drawerFooter = new Vue({
|
|
el: "#drawer-footer",
|
|
el: "#drawer-footer",
|
|
data: {
|
|
data: {
|
|
recommend: [],
|
|
recommend: [],
|
|
@@ -98,8 +112,8 @@ var drawerFooter = new Vue({
|
|
labelId: 0,
|
|
labelId: 0,
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
- this.typeId = $("#typeId").val()*1;
|
|
|
|
- this.labelId = $("#labelId").val()*1;
|
|
|
|
|
|
+ this.typeId = $("#typeId").val() * 1;
|
|
|
|
+ this.labelId = $("#labelId").val() * 1;
|
|
this.getRecommend(this.typeId, 1);
|
|
this.getRecommend(this.typeId, 1);
|
|
//换一批15秒请求一次
|
|
//换一批15秒请求一次
|
|
setInterval(() => {
|
|
setInterval(() => {
|
|
@@ -108,10 +122,10 @@ var drawerFooter = new Vue({
|
|
} else {
|
|
} else {
|
|
this.getRecommend(this.typeId, 1);
|
|
this.getRecommend(this.typeId, 1);
|
|
}
|
|
}
|
|
- },15000);
|
|
|
|
- if (this.labelId>0) {
|
|
|
|
|
|
+ }, 15000);
|
|
|
|
+ if (this.labelId > 0) {
|
|
// 添加一个标签点击量
|
|
// 添加一个标签点击量
|
|
- $.get("/article/label/click", {id: this.labelId}, function(res){
|
|
|
|
|
|
+ $.get("/article/label/click", {id: this.labelId}, function (res) {
|
|
console.log(res);
|
|
console.log(res);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
@@ -121,17 +135,17 @@ var drawerFooter = new Vue({
|
|
handlerTramp($event) {
|
|
handlerTramp($event) {
|
|
window.location.href = "/info/articlerecommendation.html"
|
|
window.location.href = "/info/articlerecommendation.html"
|
|
},
|
|
},
|
|
- getRecommend: function(typeId, pageNum){
|
|
|
|
|
|
+ getRecommend: function (typeId, pageNum) {
|
|
console.log(typeId, pageNum);
|
|
console.log(typeId, pageNum);
|
|
var _self = this;
|
|
var _self = this;
|
|
- $.getJSON("/article/recommend",{
|
|
|
|
|
|
+ $.getJSON("/article/recommend", {
|
|
typeId: typeId,
|
|
typeId: typeId,
|
|
pageNum: pageNum
|
|
pageNum: pageNum
|
|
}, function (r) {
|
|
}, function (r) {
|
|
if (r.code === 0 && r.data) {
|
|
if (r.code === 0 && r.data) {
|
|
- _self.recommend= r.data;
|
|
|
|
|
|
+ _self.recommend = r.data;
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
}
|
|
}
|
|
-})
|
|
|
|
|
|
+});
|