Commit e5a6829e by 冷斌

fix bug

parent 65bb2a17
......@@ -17,12 +17,8 @@
</small>
</div>
<div class="view-stop">
<i class="icon" style="margin-top: 0.8rem;font-size: 16px;">
<php>if($paper['iscollect']){</php>
<img src="__THEME__/img/share_star.png" class="van-icon__image">
<php>}else{</php>
<img src="__THEME__/img/share_unstar.png" class="van-icon__image">
<php>}</php>
<i class="icon" onclick="changeCollect()" style="margin-top: 0.8rem;font-size: 16px;">
<img id = "collectImage" src="" class="van-icon__image">
</i>
<neq name="Think.get.joinType" value="2"><i class="icon icon-zanting"></i></neq>
<a href="javascript:;" id="show-answer-card"><i class="icon icon-datiqia"></i></a>
......@@ -255,5 +251,31 @@
});
}
var isCollect = "{$paper['iscollect']}";
function changeCollect() {
console.log(isCollect);
if (isCollect) {
isCollect = 0;
} else {
isCollect = 1;
}
iscollect(isCollect);
}
function iscollect(type)
{
var image = '';
if (type) {
image = "__THEME__/img/share_star.png";
} else {
image = "__THEME__/img/share_unstar.png";
}
$('#collectImage').attr('src', image);
}
$(function () {
iscollect(isCollect);
});
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment