Authored by htoooth

Merge remote-tracking branch 'origin/release/1.0' into release/1.0

... ... @@ -28,7 +28,7 @@ const favorite = {
},
getFavoriteEditoreial(param) {
return ServiceAPI.get('/guang/api/*/favorite/getUserFavArticleList', param);
return ServiceAPI.get('guang/api/*/favorite/getUserFavArticleList', param);
},
cancelFavorite(uid, ids, type) {
... ... @@ -43,7 +43,7 @@ const favorite = {
},
cancelEditorialFavorite(uid, ids) {
return ServiceAPI.get('/guang/api/*/favorite/cancelFavorite', {
return ServiceAPI.get('guang/api/*/favorite/cancelFavorite', {
article_id: ids,
uid: uid
});
... ...
... ... @@ -9,6 +9,7 @@
{{> icon/checkbox}}
</div>
<div class="editorial-cover">
<div class="editorial-cate">{{categoryName}}</div>
<a href="/editorial/{{id}}.html" target="_blank">
<img src="{{image src 240 160 1}}" alt="">
</a>
... ...
... ... @@ -29,7 +29,7 @@ $('#prise-btn').click(function() {
if (prising) {
return;
}
$this.toggleClass('liked');
if ($this.hasClass('liked')) {
// 点赞
... ... @@ -49,6 +49,7 @@ $('#prise-btn').click(function() {
}).then(function(data) {
if (data.code === 200) {
$this.find('.like-num').html(data.data);
$this.toggleClass('liked');
} else {
new _alert(data.message).show();
}
... ...
... ... @@ -19,8 +19,6 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
var $this = $(this),
// prising = false,
// num = parseInt($this.next().html(), 10),
msgId = $this.closest('.msg-content').data('id'),
url;
... ... @@ -30,7 +28,6 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
// prising = msgId;
$this.toggleClass('liked');
if ($this.hasClass('liked')) {
url = '/editorial/info/cancelPraise';
} else {
... ... @@ -45,7 +42,7 @@ $('.editorial-index-page').on('click', '.like-icon', function() {
}
}).then(function(data) {
if (data.code === 200) {
console.log(data);
$this.toggleClass('liked');
$this.next('b').html(data.data);
} else {
new _alert(data.message).show();
... ...
... ... @@ -15,7 +15,6 @@ $('.editorial-list-page').on('click', '.like-icon', function() {
msgId = $this.closest('.msg-content').data('id'),
url;
$this.toggleClass('liked');
if ($this.hasClass('liked')) {
url = '/editorial/info/cancelPraise';
} else {
... ... @@ -30,6 +29,7 @@ $('.editorial-list-page').on('click', '.like-icon', function() {
}
}).then(function(data) {
if (data.code === 200) {
$this.toggleClass('liked');
$this.next('b').removeClass('num-0').children('.num').html(data.data);
}
if (data.code === 500) {
... ...
... ... @@ -43,6 +43,17 @@
.editorial-cover {
width: 240px;
height: 160px;
position: relative;
.editorial-cate {
position: absolute;
top: 0;
left: 0;
padding: 5px 10px;
background-color: #000;
color: #fff;
font-size: 14px;
}
}
.editorial-info {
... ...