Authored by 陈轩

Merge remote-tracking branch 'origin/develop' into develop

... ... @@ -29,7 +29,7 @@ const handleBrandList = origin => {
_.forEach(value, (subValue) => {
brands.push({
name: subValue.brand_name,
link: '/product/shop?domain=' + subValue.brand_domain,
link: '/brand/' + subValue.brand_domain,
logo: subValue.brand_ico
});
});
... ...
... ... @@ -69,7 +69,7 @@ const component = {
uid: req.user.uid || 0
};
if (!req.user.id) {
if (!req.user.uid) {
res.json({
code: 403
});
... ...
... ... @@ -58,7 +58,7 @@ const exchange = {
*/
cancelApply(req, res, next) {
let id = req.body.id;
let uid = req.user.id;
let uid = req.user.uid;
exchangeModel.cancelApply(uid, id).then(result => {
return res.json(result);
... ...
... ... @@ -109,7 +109,7 @@ const order = {
});
},
coin: (req, res, next) => {
let uid = req.user.id;
let uid = req.user.uid;
orderModel.getCoins(uid).then(result => {
res.render('coin', {
... ... @@ -127,7 +127,7 @@ const order = {
* @returns {*|{read, write}}
*/
getCoinDetail: (req, res) => {
let uid = req.user.id;
let uid = req.user.uid;
let page = req.query.page;
let limit = req.query.limit;
... ...
... ... @@ -133,7 +133,7 @@ const refund = {
* @param res
*/
cancelApply(req, res) {
let uid = req.user.id;
let uid = req.user.uid;
let id = req.body.id;
uid = testUid;
... ...
... ... @@ -23,8 +23,8 @@ module.exports = {
// api: 'http://testapi.yoho.cn:28078/',
// service: 'http://testservice.yoho.cn:28077/'
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/'
api: 'http://dev-api.yohops.com:9999/',
service: 'http://dev-service.yohops.com:9999/'
},
subDomains: {
host: '.m.yohoblk.com',
... ... @@ -92,8 +92,8 @@ if (isProduction) {
Object.assign(module.exports, {
appName: 'm.yohoblk.com for test',
domains: {
api: 'http://devapi.yoho.cn:58078/',
service: 'http://devservice.yoho.cn:58077/'
api: 'http://dev-api.yohops.com:9999/',
service: 'http://dev-service.yohops.com:9999/'
// api: 'http://testapi.yoho.cn:28078/',
// service: 'http://testservice.yoho.cn:28077/'
... ...
... ... @@ -51,7 +51,7 @@ const yoho = {
},
/**
* 跳转至登页面
* 跳转至登页面
* @param args 传递给 APP 的参数 {""}
* @param success 调用成功的回调方法
* @param fail 调用失败的回调方法
... ...
... ... @@ -52,7 +52,7 @@
> label {
width: 100%;
height: 100%;
line-height: 90px;
line-height: 80px;
font-size: 34px;
margin-right: 8%;
text-overflow: ellipsis;
... ... @@ -63,8 +63,11 @@
.nickname {
text-align: right;
float: right;
margin-top: 20px;
margin-right: 40px;
color: #b0b0b0;
height: 50px;
line-height: 50px;
}
.gender {
... ...
... ... @@ -78,11 +78,11 @@
if (result.code === 200) {
// TODO:
} if (result.code === 403) {
// 未登
// 未登
yoho.goLogin('', function() {
this.toggleFavorite();
}, function() {
tip('登失败');
tip('登失败');
});
}
... ...
... ... @@ -202,9 +202,33 @@
created: function() {
let _this = this;
yoho.addNativeMethod('editModel', function(action) {
yoho.addNativeMethod('editModel', function() {
_this.hideDelBth();
_this.editmodel = action;
_this.editmodel = !_this.editmodel;
if (yoho.isApp) {
yoho.goNewPage({
header: {
headerid: '5',
left: {
action: ''
},
ltitle: {
des: '商品',
action: origin + '/me/collection'
},
rtitle: {
des: '品牌',
action: origin + '/me/collection?tab=brand'
},
right: {
des: _this.editmodel ? '完成' : '编辑',
action: 'editModel'
},
defaultSelectedIndex: '1'
},
url: location.origin + '/me/collection?tab=brand'
});
}
});
}
};
... ...
... ... @@ -219,9 +219,33 @@
created: function() {
let _this = this;
yoho.addNativeMethod('editModel', function(action) {
yoho.addNativeMethod('editModel', function() {
_this.hideDelBth();
_this.editmodel = action;
_this.editmodel = !_this.editmodel;
if (yoho.isApp) {
yoho.goNewPage({
header: {
headerid: '5',
left: {
action: ''
},
ltitle: {
des: '商品',
action: origin + '/me/collection'
},
rtitle: {
des: '品牌',
action: origin + '/me/collection?tab=brand'
},
right: {
des: _this.editmodel ? '完成' : '编辑',
action: 'editModel'
},
defaultSelectedIndex: '0'
},
url: location.origin + '/me/collection?tab=brand'
});
}
});
}
};
... ...
... ... @@ -471,41 +471,20 @@
* 添加收藏
*/
toggleFavorite: function() {
if (this.entity.isCollect === 'Y') {
$.post('/product/favorite.json', {
operation: 'remove',
id: this.entity.productPriceBo.productId
}).then((result)=> {
if (result.code === 200) {
tip('取消收藏成功');
this.entity.isCollect = 'N';
} else if (result.code === 403) {
// 未登陆
yoho.goLogin('', function() {
this.toggleFavorite();
}, function() {
tip('登陆失败');
});
}
});
} else {
$.post('/product/favorite.json', {
operation: 'add',
id: this.entity.productPriceBo.productId
}).then((result)=> {
if (result.code === 200) {
tip('收藏成功');
this.entity.isCollect = 'Y';
} else if (result.code === 403) {
// 未登陆
yoho.goLogin('', function() {
this.toggleFavorite();
}, function() {
tip('登陆失败');
});
}
});
}
$.post('/product/favorite.json', {
operation: this.entity.isCollect === 'Y' ? 'remove' : 'add',
id: this.entity.productPriceBo.productId
}).then((result)=> {
if (result.code === 200) {
tip(this.entity.isCollect === 'Y' ? '取消收藏成功' : '收藏成功');
this.entity.isCollect = this.entity.isCollect === 'Y' ? 'N' : 'Y';
} else if (result.code === 403) {
// 未登录
yoho.goLogin('', () => {
this.toggleFavorite();
});
}
});
}
},
created() {
... ...