|
@@ -28,7 +28,71 @@ function directory(container, flag = true) {
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
+/相关阅读
|
|
|
+var articleRelated = new Vue({
|
|
|
+ el: "#articleRelated",
|
|
|
+ mixins: [cmSysVitaMixins],
|
|
|
+ data: {
|
|
|
+ infoId: $("#articleId").val()?$("#articleId").val()*1:0,
|
|
|
+ articleLabels: $("#articleLabels").val()?$("#articleLabels").val():"",
|
|
|
+ related: {},
|
|
|
+ relatedLabels:''
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // getRelatedList: function () {
|
|
|
+ // var _self = this;
|
|
|
+ // if(this.infoId ===0){return;}
|
|
|
+ // $.getJSON("/article/related",{
|
|
|
+ // id: this.infoId,
|
|
|
+ // labels: this.articleLabels
|
|
|
+ // }).done(function (r) {
|
|
|
+ // if (r.code === 0 && r.data) {
|
|
|
+ // _self.related = r.data;
|
|
|
+ // }
|
|
|
+ // });
|
|
|
+ // },
|
|
|
|
|
|
+ },
|
|
|
+ created: function () {
|
|
|
+ const pageLabelArray = []
|
|
|
+ this.cmSysParams.pageType = 11;
|
|
|
+ this.infoId = this.handlearticleId = $("#articleId").val() ? $("#articleId").val()*1 : 0;
|
|
|
+ this.articleLabels = $("#articleLabels").val()?$("#articleLabels").val():"";
|
|
|
+ this.relatedLabels = $("#relatedLabels").val()?$("#relatedLabels").val():"";
|
|
|
+ console.log('relatedLabels',this.relatedLabels)
|
|
|
+ if(this.relatedLabels){
|
|
|
+ this.cmSysParams.pageLabel = this.relatedLabels
|
|
|
+ }else{
|
|
|
+ $('.dea-tag-li').each(function(){
|
|
|
+ pageLabelArray.push($(this).find('a').text());
|
|
|
+ })
|
|
|
+ this.cmSysParams.pageLabel = pageLabelArray.join('/');
|
|
|
+ }
|
|
|
+ console.log('pageLabel', this.cmSysParams.pageLabel)
|
|
|
+ // 获取相关阅读
|
|
|
+ // this.getRelatedList();
|
|
|
+ },
|
|
|
+ mounted: function () {
|
|
|
+ var _self = this;
|
|
|
+ var thisUri = window.location.href;
|
|
|
+ $('#qrcode').qrcode({
|
|
|
+ "render": "canvas",
|
|
|
+ "width": '120',
|
|
|
+ "height": '120',
|
|
|
+ "color": "#3a3",
|
|
|
+ "text": thisUri
|
|
|
+ });
|
|
|
+ // 文章浏览量+1
|
|
|
+ $.get("/article/pv", {id: this.infoId}, function(res){
|
|
|
+ if(res.code === 0){
|
|
|
+ // 更新文章索引
|
|
|
+ $.post(coreServer + "/commodity/search/index/update/article", {articleId: _self.infoId}, function(res){
|
|
|
+ console.log(res.msg);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+});
|
|
|
$(function () {
|
|
|
directory('#bk-directory-pc', true)
|
|
|
directory('#bk-directory-mobile', false)
|
|
@@ -67,3 +131,27 @@ $(function () {
|
|
|
$(this).parents('#video-popup').hide();
|
|
|
});
|
|
|
})
|
|
|
+var bkPage = new Vue({
|
|
|
+ el: "#bk-page-container",
|
|
|
+ mixins: [cmSysVitaMixins],
|
|
|
+ data: {
|
|
|
+ relatedLabels:''
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+
|
|
|
+ },
|
|
|
+ created: function () {
|
|
|
+ this.cmSysParams.pageType = 68;
|
|
|
+ this.relatedLabels = $("#relatedLabels").val()?$("#relatedLabels").val():"";
|
|
|
+ console.log('relatedLabels',this.relatedLabels)
|
|
|
+ if(this.relatedLabels){
|
|
|
+ this.cmSysParams.pageLabel = this.relatedLabels
|
|
|
+ }else{
|
|
|
+ this.cmSysParams.pageLabel = $('.bk-name').text();
|
|
|
+ }
|
|
|
+ console.log('pageLabel',this.cmSysParams.pageLabel)
|
|
|
+ },
|
|
|
+ mounted: function () {
|
|
|
+
|
|
|
+ }
|
|
|
+});
|