Authored by 沈志敏

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -33,20 +33,20 @@ module.exports = {
/* 获取商品列表 */
getBrandShopGoods: (req, res, next) => {
shopModel.getBrandShopGoodsData({
domain: req.body.domain,
sort: req.body.sort,
page: req.body.page,
channel: req.body.channel || 'men',
gender: req.body.gender || '1,2,3',
brand: req.body.brand,
shopId: req.body.shopId,
order: req.body.order || 's_t_desc',
limit: req.body.limit || '60',
color: req.body.color,
price: req.body.price,
size: req.body.size,
pd: req.body.pd,
tagsFilter: req.body.tagsFilter
domain: req.query.domain,
sort: req.query.sort,
page: req.query.page,
channel: req.query.channel || 'men',
gender: req.query.gender || '1,2,3',
brand: req.query.brand,
shopId: req.query.shopId,
order: req.query.order || 's_t_desc',
limit: req.query.limit || '60',
color: req.query.color,
price: req.query.price,
size: req.query.size,
pd: req.query.pd,
tagsFilter: req.query.tagsFilter
}).then(result => {
res.json(result);
}).catch(next);
... ...
... ... @@ -35,7 +35,7 @@ const shop = require(`${cRoot}/shop`);
router.get(/\/brand\/share\/(.*)/, shop.shopShare); // 品牌店铺分享页面
router.get(/\/brand\/(.*)/, shop.index); // 店铺首页
router.get('/product/shop/info.json', shop.getShopInfo); // 店铺介绍
router.post('/product/shop/goods.json', shop.getBrandShopGoods); // 店铺商品列表
router.get('/product/shop/goods.json', shop.getBrandShopGoods); // 店铺商品列表
router.post('/product/shop/collect.json', shop.collectShop); // 收藏品牌店铺
// 商品详情controller
... ...
... ... @@ -26,7 +26,7 @@
{{/unless}}
{{/if}}
</head>
<body class="{{#if isApp}}app{{/if}} {{#if isiOS}}ios{{/if}} {{#if isAndroid}}android{{/if}}">
<body class="{{#if isApp}}app{{/if}} {{#if isiOS}}ios{{/if}} {{#if isAndroid}}android{{/if}} {{#if noLocalJS}}no-local-js{{/if}}">
<div class="main-wrap">
{{{body}}}
</div>
... ...
... ... @@ -15,10 +15,26 @@
* 2. 查询字符串读取 请使用 yoho-qs
*/
const $ = require('jquery');
const yoho = require('yoho');
const Vue = require('vue');
const interceptClick = require('common/intercept-click');
// 隐藏 App 默认显示的 loading
Vue.mixin({
ready() {
if (this === this.$root && location.pathname !== '/sidebar') {
yoho.showLoading(false);
}
}
});
$(() => {
$('body').on('click', 'a[href]', function() {
const $body = $('body');
if ($body.hasClass('no-local-js')) {
yoho.showLoading(false); // 隐藏 App 默认显示的 loading
}
$body.on('click', 'a[href]', function() {
// 拦截跳转
if (!$(this).hasClass('no-intercept')) {
interceptClick($(this).attr('href'));
... ...
... ... @@ -8,7 +8,7 @@ if (!yoho.isLogin) {
return false;
});
} else {
// 地址管理
// 地址管理
$('#address').on('click', function() {
yoho.goAddress({
type: '2'
... ... @@ -22,3 +22,7 @@ $('#setting').on('click', function() {
yoho.goSetting();
return false;
});
$(() => {
yoho.showLoading(false);
});
... ...
... ... @@ -294,19 +294,22 @@ const yoho = {
},
/**
* 设置频道
* @param args {"channel": "men"}
* 显示 loading
* @param args Boolen
* @param success
* @param fail
*/
goSetChannel(args, success, fail) {
showLoading(args, success, fail) {
if (this.isApp) {
window.yohoInterface.triggerEvent(success || function() {}, fail || function() {}, {
method: 'go.setChannel',
arguments: args
method: 'go.loading',
arguments: {
show: args ? 'yes' : 'no'
}
});
} else {
tip(tipInfo);
// tip(tipInfo);
}
},
... ...
... ... @@ -170,7 +170,7 @@
<button class="button control-button">
<span @click="yoho.goShopingCart()" style="position: relative;">
<i class="icon icon-bag"></i>
<span v-if="cartCount > 0" class="badge badge-tr">{{cartCount}}</span>
<span v-if="isApp && cartCount > 0" class="badge badge-tr">{{cartCount}}</span>
</span>
</button>
<button class="button control-button" @click="toggleFavorite()">
... ... @@ -541,11 +541,13 @@
});
// 读取购物车数量
$.get('/product/cart-count.json').then(result=> {
if (result.code === 200) {
this.cartCount = result.data.cart_goods_count;
}
});
if (this.isApp) {
$.get('/product/cart-count.json').then(result=> {
if (result.code === 200) {
this.cartCount = result.data.cart_goods_count;
}
});
}
}
};
</script>
... ...
... ... @@ -108,7 +108,7 @@
}
this.inSearching = true;
$.post(this.url, Object.assign({
$.get(this.url, Object.assign({
page: this.page
}, this.filter, locationQuery)).done(result => {
if (result.code === 200) {
... ...