Authored by xuqi

plus star prise

... ... @@ -14,6 +14,10 @@ var $intro = $('#intro'),
var info = require('../info');
var tip = require('../../plugin/tip');
var brandId = $('#brand-info').data('id');
var mIntro, aIntro;
ellipsis.init();
... ... @@ -53,5 +57,31 @@ $('#more-intro').bind('touchstart', function() {
//品牌收藏
$('#brand-like').bind('touchstart', function(e) {
var opt = 'ok',
$this = $(this);
e.preventDefault();
if ($this.hasClass('like')) {
opt = 'cancel';
}
$.ajax({
type: 'POST',
url: '/guang/opt/favoriteBrand',
data: {
id: brandId,
opt: opt
},
success: function(data) {
if (data.code === 200) {
$this.toggleClass('like');
} else if (data.code === 400) {
tip.show('未登录');
}
},
error: function() {
tip.show('网络断开连接了~');
}
});
});
\ No newline at end of file
... ...
{{>layout/header}}
<div class="ps-detail-page ps-page yoho-page">
{{# ps}}
<div class="header brand-info ps-block" data-id="{{id}}">
<div id="brand-info" class="header brand-info ps-block" data-id="{{id}}">
<img class="banner lazy" data-original="{{banner}}">
<img class="logo lazy" data-original="{{logo}}">
<div class="header-content clearfix">
... ...