Authored by ccbikai

拷贝改为深度拷贝

... ... @@ -45,7 +45,7 @@ const processPublicData = (req, title) => {
*/
exports.index = (req, res) => {
starModel.getIndexData().then((result) => {
const pageHeadTab = _.clone(headTab);
const pageHeadTab = _.cloneDeep(headTab);
pageHeadTab[0].cur = true;
res.render('star/index', _.assign({
... ... @@ -71,7 +71,7 @@ exports.index = (req, res) => {
*/
exports.special = (req, res) => {
starModel.getSpecialData().then((result) => {
const pageHeadTab = _.clone(headTab);
const pageHeadTab = _.cloneDeep(headTab);
pageHeadTab[1].cur = true;
res.render('star/special', _.assign({
... ... @@ -91,7 +91,7 @@ exports.special = (req, res) => {
* @return {[type]}
*/
exports.collocation = (req, res) => {
const pageHeadTab = _.clone(headTab);
const pageHeadTab = _.cloneDeep(headTab);
pageHeadTab[2].cur = true;
res.render('star/collocation', _.assign({
... ... @@ -153,4 +153,3 @@ exports.detailList = (req, res) => {
}));
});
};
... ...
... ... @@ -10,14 +10,12 @@ var $ = require('yoho-jquery'),
require('../common/common');
// 星搭配收藏请求
$(document).on('touchstart', '.collection', function(event) {
$(document).on('click', '.collection', function() {
var $that = $(this),
$icon = $that.find('.collected-ico');
var type;
event.stopPropagation();
if ($icon.hasClass('collected')) {
type = 'del';
} else {
... ...