Authored by zhangxiaoru

share

... ... @@ -7,7 +7,6 @@
'use strict';
const _ = require('lodash');
const cookie = global.yoho.cookie;
const camelCase = global.yoho.camelCase;
const config = global.yoho.config;
const mcHandler = require('../models/menu-crumb-handler');
... ... @@ -18,7 +17,7 @@ const favorite = {
goods(req, res, next) {
let q = req.query;
let page = parseInt(q.page || 1, 10);
let uid = cookie.getUid(req);
let uid = req.user.uid;
let sort = q.sort ? parseInt(q.sort, 10) : '';
let ret = {
module: 'me',
... ... @@ -97,7 +96,7 @@ const favorite = {
brand(req, res, next) {
let q = req.query;
let page = parseInt(q.page || 1, 10);
let uid = cookie.getUid(req);
let uid = req.user.uid;
let limit = 5;
let ret = {
module: 'me',
... ... @@ -159,7 +158,7 @@ const favorite = {
editorial(req, res, next) {
let q = req.query;
let page = parseInt(q.page || 1, 10);
let uid = cookie.getUid(req);
let uid = req.user.uid;
let limit = 5;
let ret = {
module: 'me',
... ... @@ -209,7 +208,7 @@ const favorite = {
cancel(req, res, next) {
let type = req.body.type;
let ids = req.body.ids;
let uid = cookie.getUid(req);
let uid = req.user.uid;
FavoriteData.cancelFavorite(uid, ids, type).then(result => {
if (result && result.code === 200) {
... ... @@ -223,7 +222,7 @@ const favorite = {
// 取消资讯收藏
editorialCancel(req, res, next) {
let ids = req.body.ids;
let uid = cookie.getUid(req);
let uid = req.user.uid;
FavoriteData.cancelEditorialFavorite(uid, ids).then(result => {
if (result && result.code === 200) {
... ...
... ... @@ -10,8 +10,6 @@
const _ = require('lodash');
const camelCase = global.yoho.camelCase;
const cookie = global.yoho.cookie;
const Search = require('../models/search');
const DataHelper = require('../models/helpers');
const ShopData = require('../models/shop-service');
... ... @@ -21,7 +19,7 @@ const shop = {
// 店铺首页
index(req, res, next) {
let domain = req.params.domain;
let uid = cookie.getUid(req);
let uid = req.user.uid;
let data = {
module: 'product',
page: 'shop',
... ... @@ -92,7 +90,7 @@ const shop = {
let nav = [DataHelper.getChannelNav()];
let domain = req.params.domain;
let uid = cookie.getUid(req);
let uid = req.user.uid;
let q = req.query;
q.order = q.order || 's_n_desc';
... ...
... ... @@ -103,17 +103,6 @@ function chooseColor(index) {
}
function arrivalNotice() {
// $.ajax({
// type: 'POST',
// url: '/shopping/cart/add',
// data: {
// productSku: sku,
// buyNumber: 1
// }
// }).then(function(data) {
// if (data.code === 200) {
// }
// });
var tip = new Dialog({
className: 'arr-notice-dialog',
content: noticeSuccFn(),
... ... @@ -123,6 +112,7 @@ function arrivalNotice() {
btnClass: ['sure'],
name: '确定',
cb: function() {
// 目前没有到货通知接口,前端只有展示逻辑
tip.close();
}
}
... ... @@ -235,21 +225,24 @@ $('.arr-notice').click(function() {
$addToBag.click(function() {
var sku = getBuyProduct();
if (sku) {
$.ajax({
type: 'POST',
url: '/shopping/cart/add',
data: {
productSku: sku,
buyNumber: 1
}
}).then(function(data) {
if (data.code === 200) {
$tradeWrapper.slideUp(SLIDETIME);
$balanceWrapper.slideDown(SLIDETIME);
}
});
if (!sku) {
$sizeText.html('<em class="blue">请选择尺码</em>');
return;
}
$.ajax({
type: 'POST',
url: '/shopping/cart/add',
data: {
productSku: sku,
buyNumber: 1
}
}).then(function(data) {
if (data.code === 200) {
$tradeWrapper.slideUp(SLIDETIME);
$balanceWrapper.slideDown(SLIDETIME);
}
});
});
// 继续购物
... ...