Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
郭成尧
9 years ago
Commit
1ff592d49d2b6a1ddb95882a60f5485bb25c2c4c
2 parents
5c93ae37
5323bf97
Merge branch 'feature/brand' into develop
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
18 deletions
apps/channel/controllers/brand.js
apps/channel/controllers/index.js
apps/channel/models/brand-api.js
apps/channel/router.js
package.json
public/vue/channel/brand-box.vue
public/vue/channel/brand-cate.vue
public/vue/channel/brand-share-box.vue
public/vue/channel/cate-resources.vue
apps/channel/controllers/brand.js
View file @
1ff592d
...
...
@@ -37,9 +37,21 @@ module.exports = {
/* 获取商品列表 */
getBrandShopGoods
:
(
req
,
res
)
=>
{
let
params
=
req
.
query
;
brandModel
.
getBrandShopGoodsData
(
params
).
then
(
result
=>
{
brandModel
.
getBrandShopGoodsData
({
sort
:
req
.
body
.
sort
,
page
:
req
.
body
.
page
,
channel
:
req
.
body
.
filter
.
channel
||
'men'
,
gender
:
req
.
body
.
filter
.
gender
||
'1,2,3'
,
brand
:
req
.
body
.
filter
.
brand
,
shopId
:
req
.
body
.
filter
.
shopId
,
order
:
req
.
body
.
filter
.
order
||
's_t_desc'
,
limit
:
req
.
body
.
filter
.
limit
||
'60'
,
color
:
req
.
body
.
filter
.
color
,
price
:
req
.
body
.
filter
.
price
,
size
:
req
.
body
.
filter
.
size
,
pd
:
req
.
body
.
filter
.
pd
,
tagsFilter
:
req
.
body
.
filter
.
tagsFilter
}).
then
(
result
=>
{
res
.
json
(
result
);
});
},
...
...
apps/channel/controllers/index.js
View file @
1ff592d
...
...
@@ -4,7 +4,6 @@
* @date: 2016/05/09
*/
'use strict'
;
const
brand
=
require
(
'./brand'
);
/**
* 频道选择页
...
...
@@ -18,4 +17,4 @@ const component = {
}
};
module
.
exports
=
Object
.
assign
(
component
,
brand
)
;
module
.
exports
=
component
;
...
...
apps/channel/models/brand-api.js
View file @
1ff592d
...
...
@@ -65,7 +65,20 @@ module.exports = {
*/
getBrandShopGoodsOriginData
(
params
)
{
return
api
.
get
(
''
,
{
method
:
''
method
:
'app.search.brand'
,
yh_channel
:
params
.
channel
?
yhChannel
[
params
.
channel
].
channel
:
'1'
,
brand
:
params
.
brand
,
shop_id
:
params
.
shopId
,
order
:
params
.
order
,
limit
:
params
.
limit
,
page
:
params
.
page
,
gender
:
params
.
gender
,
color
:
params
.
color
,
price
:
params
.
price
,
size
:
params
.
size
,
p_d
:
params
.
pd
,
sort
:
params
.
sort
,
tags_filter
:
params
.
tagsFilter
});
},
...
...
@@ -82,7 +95,7 @@ module.exports = {
type
:
params
.
type
};
if
(
isFav
)
{
if
(
params
.
isFav
)
{
Object
.
assign
(
finalParams
,
{
method
:
'app.favorite.add'
});
...
...
apps/channel/router.js
View file @
1ff592d
...
...
@@ -17,7 +17,7 @@ router.get('/', channel.index); // 首页
router
.
get
(
'/resources'
,
channel
.
resources
);
// 资源位接口
router
.
get
(
'/brand'
,
brand
.
index
);
// 店铺首页
router
.
get
(
'/get-brand-intro'
,
brand
.
getBrandIntro
);
// 店铺介绍
router
.
ge
t
(
'/get-brand-shop-goods'
,
brand
.
getBrandShopGoods
);
// 店铺介绍
router
.
pos
t
(
'/get-brand-shop-goods'
,
brand
.
getBrandShopGoods
);
// 店铺介绍
router
.
get
(
'/brand-list'
,
brand
.
brandList
);
// 品牌列表页
router
.
get
(
'/get-brand-list'
,
brand
.
getBrandList
);
// 获取品牌列表数据
router
.
get
(
'/brand-share'
,
brand
.
brandShare
);
// 获取品牌列表数据
...
...
package.json
View file @
1ff592d
...
...
@@ -14,7 +14,7 @@
"debug"
:
"DEBUG=\"express:*\" nodemon -e js,hbs -i public/ app.js"
,
"lint-js"
:
"eslint -c .eslintrc --cache --fix ."
,
"lint-css"
:
"stylelint --config .stylelintrc public/scss/**/*.css"
,
"lint-vue"
:
"stylelint --extract --config .stylelintrc public/vue/**/*.vue
;
eslint -c .eslintrc --cache --fix public/vue/**/*.vue"
,
"lint-vue"
:
"stylelint --extract --config .stylelintrc public/vue/**/*.vue
||
eslint -c .eslintrc --cache --fix public/vue/**/*.vue"
,
"precommit"
:
"node lint.js"
},
"license"
:
"MIT"
,
...
...
public/vue/channel/brand-box.vue
View file @
1ff592d
...
...
@@ -31,8 +31,8 @@
filterConfig: global.filterConfig,
// query
url: '/product/list',
sort: 3,
url: '/get-brand-shop-goods',
sort: '',
filter: {},
page: 0, // page= 0 未搜索, 1 并且productList.length =0 没有数据, page = page_total 全部加载完
totalPage: 3,
...
...
@@ -58,11 +58,10 @@
let data = {};
$.ajax({
method: 'post',
url: '/product/list',
url: this.url,
data: data
}).done(result => {
this.
$set('productList', this.productList.concat(result.data.productList))
;
this.
productList = result.data.productList
;
}).fail(() => {
tip('网络错误');
});
...
...
@@ -83,8 +82,8 @@
sort: this.sort,
filter: this.filter,
page: this.page
}).done(res => {
self.$set('productList', self.productList.concat(res.data.productList));
}).done(result => {
this.productList = result.data.productList;
}).fail(error => {
self.page--;
console.log(error);
...
...
public/vue/channel/brand-cate.vue
View file @
1ff592d
...
...
@@ -30,7 +30,8 @@
font-size: 36px;
font-family: helvetica, Arial, "黑体";
ul, li {
ul,
li {
margin: 0;
padding: 0;
list-style: none;
...
...
public/vue/channel/brand-share-box.vue
View file @
1ff592d
...
...
@@ -57,6 +57,8 @@
const shareBottom = require('channel/share-bottom.vue');
module.exports = {
/* TODO 数据需要从接口获取 */
data() {
return {
brandName: 'COLORMAD',
...
...
public/vue/channel/cate-resources.vue
View file @
1ff592d
...
...
@@ -22,7 +22,8 @@
.cate-resource {
width: 100%;
ul, li {
ul,
li {
margin: 0;
padding: 0;
}
...
...
Please
register
or
login
to post a comment