Authored by 沈志敏

product部分

... ... @@ -5,11 +5,7 @@
*/
'use strict';
// const _ = require('lodash');
// const helpers = global.yoho.helpers;
const model = require('../models/detail');
const camelCase = global.yoho.camelCase;
/**
* 商品详情
... ... @@ -99,7 +95,7 @@ const component = {
};
model.misc(params).then(result => {
res.json(camelCase(result));
res.json(result);
}).catch(next);
}
};
... ...
... ... @@ -6,7 +6,6 @@
'use strict';
const serviceAPI = global.yoho.ServiceAPI;
const Promise = require('bluebird');
const camelCase = global.yoho.camelCase;
/**
* 资讯详情
... ... @@ -30,7 +29,7 @@ const model = {
res.push(other);
return res;
});
}).then(camelCase);
});
},
/**
... ...
... ... @@ -7,7 +7,6 @@
'use strict';
const editorialListApi = require('./list-api');
const camelCase = global.yoho.camelCase;
/**
* 资讯列表数据
... ... @@ -28,7 +27,7 @@ const editorialList = params => {
});
}
return camelCase(finalResult);
return finalResult;
});
};
... ...
'use strict';
const api = global.yoho.API;
const camelCase = global.yoho.camelCase;
const prettyFilter = require(`${global.utils}/beautify/filters`);
const processProductList = require(`${global.utils}/beautify/product`);
... ... @@ -19,8 +18,9 @@ exports.getNewData = (params) => {
return api.get('', params).then(result => {
if (result.data) {
prettyFilter(result.data.filter);
result = camelCase(result);
result.data.productList = processProductList(result.data.productList, {gender: params.gender});
result.data.product_list = processProductList(result.data.product_list, {
gender: params.gender
});
}
return result;
... ...
... ... @@ -2,7 +2,6 @@
const _ = require('lodash');
const api = global.yoho.API;
const camelCase = global.yoho.camelCase;
const prettyFilter = require(`${global.utils}/beautify/filters`);
const processProductList = require(`${global.utils}/beautify/product`);
... ... @@ -37,8 +36,7 @@ const search = {
}
prettyFilter(result.data.filter);
result = camelCase(result);
result.data.productList = processProductList(result.data.productList, {
result.data.product_list = processProductList(result.data.product_list, {
gender: params.gender
});
}
... ...
... ... @@ -8,7 +8,6 @@
const logger = global.yoho.logger;
const shopApi = require('./shop-api');
const processProductList = require(`${global.utils}/beautify/product`);
const camelCase = global.yoho.camelCase;
const _ = require('lodash');
const prettyFilter = require(`${global.utils}/beautify/filters`);
... ... @@ -93,7 +92,7 @@ const _getGoodsList = params => {
code: 200
};
}
return camelCase(finalResult);
return finalResult;
});
};
... ...
... ... @@ -168,7 +168,7 @@ module.exports = (Vue) => {
size: '尺寸',
brand: '品牌',
priceRange: '价格',
groupSort: '品类',
group_sort: '品类',
discount: '折扣',
style: '风格',
ageLevel: '年龄'
... ... @@ -180,7 +180,7 @@ module.exports = (Vue) => {
size: 'Size',
brand: 'Brand',
priceRange: 'Price',
groupSort: 'Category',
group_sort: 'Category',
discount: 'Sale',
style: 'Style',
ageLevel: 'Age'
... ...
... ... @@ -33,7 +33,7 @@
// filter 字段 对应 的 查询 字段
const aliasMap = {
groupSort: 'sort',
group_sort: 'sort',
priceRange: 'price',
discount: 'p_d'
};
... ... @@ -46,7 +46,7 @@
},
data: function() {
return {
itemArr: ['gender', 'ageLevel', 'brand', 'groupSort', 'color', 'size', 'priceRange', 'discount', 'style'],
itemArr: ['gender', 'ageLevel', 'brand', 'group_sort', 'color', 'size', 'priceRange', 'discount', 'style'],
params: {}, // 选择的值
selected: {}, // 确定的值
... ... @@ -77,10 +77,10 @@
},
// 只显示 可选值 大于 1的 筛选项
// groupSort 特殊处理
// group_sort 特殊处理
showCate: function(cateName, cateVals) {
if (toString.call(cateVals) === '[object Array]') {
if (cateName === 'groupSort') {
if (cateName === 'group_sort') {
return !hasSort;
} else if (cateVals.length >= 1) {
return true;
... ...
... ... @@ -5,8 +5,8 @@
</c-header>
<div class="filter-sub-select">
<brand-filter v-if="type === 'brand'" :data="data" @select="selectItem"></brand-filter>
<normal-filter v-if="type !== 'brand' && type !== 'groupSort'" :data="data" :type="type" @select="selectItem"></normal-filter>
<sort-filter class="filter-detail filter-sort" v-if="type === 'groupSort'" :category="data" @select="selectItem"></sort-filter>
<normal-filter v-if="type !== 'brand' && type !== 'group_sort'" :data="data" :type="type" @select="selectItem"></normal-filter>
<sort-filter class="filter-detail filter-sort" v-if="type === 'group_sort'" :category="data" @select="selectItem"></sort-filter>
</div>
</div>
</template>
... ...
... ... @@ -2,9 +2,9 @@
<top-nav :id="id" :article="article" v-if="isApp"></top-nav>
<div class="show-box no-padding first-box">
<div class="editorial-box">
<h1 class="editorial-article-title">{{article.articleTitle}}</h1>
<h1 class="editorial-article-title">{{article.article_title}}</h1>
<div class="status-bar">
<span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span>
<span class="icon icon-timeshare"></span><span class="label">{{article.publishTime}}</span>
<span class="icon icon-read"></span><span class="label">{{article.pageViews}}</span>
</div>
</div>
... ... @@ -45,7 +45,7 @@
</div>
<h3><a class="line-clamp-2" :href="'/editorial/' + item.id + '.html'">{{item.title}}</a></h3>
<div class="sub-time">
<span class="icon icon-timeshare"></span><span class="label">{{article.publishTime | formatUnixTime 'MM.DD HH:mm'}}</span>
<span class="icon icon-timeshare"></span><span class="label">{{item.publishTime}}</span>
</div>
<div class="clearfix"></div>
</div>
... ... @@ -262,7 +262,7 @@
}).join(',')
}).then((data) => {
if (data.data) {
this.$set('recommendProducts', data.data.productList);
this.$set('recommendProducts', data.data.product_list);
}
});
});
... ...
... ... @@ -16,7 +16,7 @@
<hr>
<div class="bottom clearfix">
<span class="icon icon-timeshare"></span>
<span class="time">{{editorial.publishTime}}</span>
<span class="time">{{editorial.publish_time}}</span>
<span class="icon icon-share share" @click="share(editorial.title, editorial.intro, editorial.src, editorial.id)"></span>
</div>
</div>
... ...
... ... @@ -97,14 +97,14 @@
});
},
share: function() {
let title = this.article.articleTitle;
let title = this.article.article_title;
title = title.length > 15 ? title.substr(0, 15) + '...' : title;
yoho.goShare({
title,
des: '优质精选,BLK潮流资讯为你呈现',
img: location.protocol + util.getImgUrl(this.article.coverImage, 300, 300, 2),
img: location.protocol + util.getImgUrl(this.article.cover_image, 300, 300, 2),
url: `${location.origin}/editorial/${this.article.id}.html?shareTitle=${title}`
});
}
... ...
... ... @@ -103,8 +103,8 @@
.done(res => {
if (res.data) {
self.page = res.data.page;
self.totalPage = res.data.pageTotal;
self.$set('productList', self.productList.concat(res.data.productList));
self.totalPage = res.data.page_total;
self.$set('productList', self.productList.concat(res.data.product_list));
if (!self.filterConfig) {
self.$set('filterConfig', res.data.filter);
... ...
... ... @@ -93,8 +93,8 @@
.done(res => {
if (res.code === 200) {
self.page = res.data.page;
self.totalPage = res.data.pageTotal;
self.$set('productList', self.productList.concat(res.data.productList));
self.totalPage = res.data.page_total;
self.$set('productList', self.productList.concat(res.data.product_list));
if (!self.filterConfig) {
self.$set('filterConfig', res.data.filter);
... ...
... ... @@ -91,8 +91,8 @@
.done(res => {
if (res.data) {
self.page = res.data.page;
self.totalPage = res.data.pageTotal;
self.$set('productList', self.productList.concat(res.data.productList));
self.totalPage = res.data.page_total;
self.$set('productList', self.productList.concat(res.data.product_list));
}
})
.fail(() => {
... ...