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
Email Patches
Plain Diff
Browse Files
Authored by
沈志敏
9 years ago
Commit
540aa0694a3133f1742e4ccdc605f11c7136e359
1 parent
ebe281f6
代码格式化
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
76 additions
and
73 deletions
apps/home/controllers/favorite.js
apps/home/controllers/index.js
apps/home/controllers/refund.js
apps/home/models/favorite.js
apps/home/models/refund.js
public/js/home/favorite-brand.page.js
public/js/home/favorite.page.js
public/js/home/logistics.page.js
public/scss/home/_fav.css
public/scss/home/_home.css
public/scss/home/_index.css
public/scss/home/_logistics.css
public/vue/home/fav-product-list.vue
apps/home/controllers/favorite.js
View file @
540aa06
...
...
@@ -24,6 +24,7 @@ const fav = {
},
favpaging
:
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
uid
=
20000134
;
// 测试uid
const
tab
=
req
.
query
.
tab
;
...
...
@@ -33,6 +34,7 @@ const fav = {
if
(
tab
===
'brand'
)
{
const
gender
=
'1,2,3'
;
// todo 获取频道的性别
favModel
.
getFavBrandData
(
uid
,
gender
,
page
,
10
).
then
(
data
=>
{
if
(
data
&&
page
<=
data
.
page_total
)
{
data
.
brand_list
.
forEach
(
function
(
d
)
{
...
...
@@ -41,7 +43,7 @@ const fav = {
link
:
''
,
// todo
imgUrl
:
d
.
brand_ico
?
helpers
.
image
(
d
.
brand_ico
,
160
,
125
)
:
''
,
brandName
:
d
.
brand_name
,
down
:
d
.
status
==
0
down
:
d
.
status
==
=
0
});
});
...
...
@@ -63,6 +65,7 @@ const fav = {
}
let
link
=
''
;
if
(
d
.
goodsId
&&
d
.
cnAlphabet
)
{
link
=
helpers
.
urlFormat
(
`
/
product
/
pro_$
{
d
.
product_id
}
_$
{
d
.
goodsId
}
/${d.cnAlphabet}.html`
)
;
}
...
...
@@ -75,7 +78,7 @@ const fav = {
price
:
'¥'
+
Number
(
Math
.
max
(
d
.
market_price
,
0
)).
toFixed
(
2
),
discountPrice
:
(
Number
(
d
.
market_price
)
-
Number
(
d
.
sales_price
)
>
0
)
?
'¥'
+
Number
(
Math
.
max
(
d
.
sales_price
,
0
)).
toFixed
(
2
)
:
false
,
sellOut
:
d
.
storage
<
0
,
invalidGoods
:
d
.
status
==
0
invalidGoods
:
d
.
status
==
=
0
});
});
...
...
@@ -92,14 +95,16 @@ const fav = {
},
deletefav
:
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
uid
=
20000134
;
// 测试uid
const
favId
=
req
.
body
.
favId
;
const
type
=
req
.
body
.
type
;
favModel
.
favoriteDelete
(
uid
,
favId
,
type
).
then
(
data
=>
{
return
res
.
json
(
data
);
}).
catch
(
next
);
}
}
}
;
module
.
exports
=
fav
;
\ No newline at end of file
module
.
exports
=
fav
;
...
...
apps/home/controllers/index.js
View file @
540aa06
...
...
@@ -16,6 +16,7 @@ const helpers = global.yoho.helpers;
const
component
=
{
index
:
(
req
,
res
,
next
)
=>
{
let
uid
=
req
.
user
.
uid
;
uid
=
8050378
;
// 测试uid
if
(
!
uid
&&
req
.
xhr
)
{
...
...
@@ -27,7 +28,7 @@ const component = {
homeModel
.
getUserHomeData
(
uid
).
then
(
data
=>
{
const
proData
=
data
[
0
];
le
t
result
=
{
cons
t
result
=
{
module
:
'home'
,
page
:
'index'
,
head_ico
:
proData
&&
proData
.
head_ico
?
helpers
.
image
(
proData
.
head_ico
,
200
,
200
)
:
''
,
...
...
@@ -36,6 +37,7 @@ const component = {
refer
:
req
.
originalUrl
}),
};
res
.
render
(
'index'
,
_
.
merge
(
result
,
data
[
1
]));
}).
catch
(
next
);
},
...
...
@@ -104,6 +106,7 @@ const component = {
}
}).
catch
(
next
);
},
// 关于我们
aboutUs
:
(
req
,
res
)
=>
{
res
.
render
(
'about-us'
,
{
...
...
@@ -141,4 +144,4 @@ const component = {
}
};
module
.
exports
=
component
;
\ No newline at end of file
module
.
exports
=
component
;
...
...
apps/home/controllers/refund.js
View file @
540aa06
...
...
@@ -39,16 +39,15 @@ const refund = {
res
.
json
(
result
);
}).
catch
(
next
);
},
saveLogistics
(
req
,
res
,
next
)
{
const
company_id
=
req
.
body
.
company_id
;
const
company_name
=
req
.
body
.
company_name
;
const
num
=
req
.
body
.
num
;
saveLogistics
(
req
,
res
)
{
// todo 调用保存物流信息接口
// const companyId = req.body.company_id;
// const companyName = req.body.company_name;
// const num = req.body.num;
res
.
json
({
code
:
200
});
}
};
module
.
exports
=
refund
;
\ No newline at end of file
module
.
exports
=
refund
;
...
...
apps/home/models/favorite.js
View file @
540aa06
...
...
@@ -38,8 +38,8 @@ exports.getFavBrandData = (uid, gender, page, limit) => {
limit
:
limit
}).
then
(
result
=>
{
return
result
.
data
;
})
}
});
};
/**
* 取消收藏的商品/品牌数据
...
...
@@ -56,4 +56,4 @@ exports.favoriteDelete = (uid, favId, type) => {
type
:
type
,
fav_id
:
favId
});
}
\ No newline at end of file
};
\ No newline at end of file
...
...
apps/home/models/refund.js
View file @
540aa06
...
...
@@ -32,4 +32,4 @@ const refund = {
}
};
module
.
exports
=
refund
;
\ No newline at end of file
module
.
exports
=
refund
;
...
...
public/js/home/favorite-brand.page.js
View file @
540aa06
const
Vue
=
require
(
'yoho-vue'
);
const
infiniteScroll
=
require
(
'yoho-vue-infinite-scroll'
);
const
BrandList
=
require
(
'home/fav-brand-list.vue'
);
const
fav
BrandList
=
require
(
'home/fav-brand-list.vue'
);
Vue
.
use
(
infiniteScroll
);
new
Vue
({
el
:
'#fav-content'
,
components
:
{
'favBrandList'
:
BrandList
fav
BrandList
}
});
\ No newline at end of file
});
...
...
public/js/home/favorite.page.js
View file @
540aa06
const
Vue
=
require
(
'yoho-vue'
);
const
infiniteScroll
=
require
(
'yoho-vue-infinite-scroll'
);
const
ProductList
=
require
(
'home/fav-product-list.vue'
);
const
fav
ProductList
=
require
(
'home/fav-product-list.vue'
);
Vue
.
use
(
infiniteScroll
);
new
Vue
({
el
:
'#fav-content'
,
components
:
{
'favProductList'
:
ProductList
fav
ProductList
}
});
\ No newline at end of file
});
...
...
public/js/home/logistics.page.js
View file @
540aa06
...
...
@@ -23,4 +23,4 @@ new Vue({
this
.
company_name
=
obj
.
company_name
;
}
}
});
\ No newline at end of file
});
...
...
public/scss/home/_fav.css
View file @
540aa06
...
...
@@ -30,14 +30,14 @@
margin-right
:
15px
;
margin-top
:
80px
;
background
:
resolve
(
"home/fav/fav-del.png"
);
background-size
:
100%
;
background-size
:
100%
;
}
}
.delshow
{
display
:
block
;
}
.fav-img-box
{
width
:
152px
;
height
:
203px
;
...
...
@@ -71,18 +71,18 @@
.fav-price
{
margin-top
:
20px
;
}
.new-price
{
color
:
#d1021c
;
font-size
:
24px
;
}
.price-underline
{
text-decoration
:
line-through
;
margin-left
:
15px
;
color
:
#b0b0b0
;
font-size
:
24px
;
}
.new-price
{
color
:
#d1021c
;
font-size
:
24px
;
}
.price-underline
{
text-decoration
:
line-through
;
margin-left
:
15px
;
color
:
#b0b0b0
;
font-size
:
24px
;
}
.save-price
{
...
...
@@ -91,16 +91,14 @@
left
:
0
;
width
:
100%
;
min-height
:
24px
;
}
span
{
&.sell-out
{
float
:
right
;
padding
:
5px
18px
;
color
:
#b0b0b0
;
border-radius
:
20px
;
font-size
:
22px
;
}
}
.sell-out
{
float
:
right
;
padding
:
5px
18px
;
color
:
#b0b0b0
;
border-radius
:
20px
;
font-size
:
22px
;
}
}
}
...
...
@@ -113,13 +111,13 @@
text-align
:
center
;
&:before
{
content
:
''
;
content
:
""
;
display
:
block
;
width
:
188px
;
height
:
171px
;
background
:
resolve
(
"home/fav/fav-null.png"
);
background-size
:
100%
100%
;
margin
:
0
auto
45px
auto
;
margin
:
0
auto
45px
;
}
}
...
...
@@ -127,13 +125,13 @@
width
:
472px
;
height
:
88px
;
line-height
:
88px
;
margin
:
80px
auto
0
auto
;
margin
:
80px
auto
0
;
background
:
#444
;
text-align
:
center
;
color
:
#fff
;
display
:
block
;
font-size
:
26px
;
border-radius
:
.2rem
;
border-radius
:
0
.2rem
;
}
}
}
...
...
@@ -178,7 +176,7 @@
.delshow
{
display
:
block
;
}
.fav-img-box
{
width
:
160px
;
height
:
125px
;
...
...
@@ -232,13 +230,13 @@
text-align
:
center
;
&:before
{
content
:
''
;
content
:
""
;
display
:
block
;
width
:
188px
;
height
:
171px
;
background
:
resolve
(
"home/fav/fav-null.png"
);
background-size
:
100%
100%
;
margin
:
0
auto
45px
auto
;
margin
:
0
auto
45px
;
}
}
...
...
@@ -246,13 +244,13 @@
width
:
472px
;
height
:
88px
;
line-height
:
88px
;
margin
:
80px
auto
0
auto
;
margin
:
80px
auto
0
;
background
:
#444
;
text-align
:
center
;
color
:
#fff
;
display
:
block
;
font-size
:
26px
;
border-radius
:
.2rem
;
border-radius
:
0
.2rem
;
}
}
}
\ No newline at end of file
}
...
...
public/scss/home/_home.css
View file @
540aa06
...
...
@@ -14,9 +14,9 @@
font-size
:
34px
;
line-height
:
138px
;
height
:
469px
;
background-size
:
cover
;
background
:
resolve
(
"home/header-bg.png"
);
text-align
:
center
;
background
:
resolve
(
"home/header-bg.png"
);
background-size
:
cover
;
.user-avatar
{
display
:
inline-block
;
...
...
public/scss/home/_index.css
View file @
540aa06
...
...
@@ -6,6 +6,4 @@
@import
"order"
;
@import
"coin"
;
@import
"logistics"
;
/*@import "order-detail";*/
/* @import "order-detail"; */
...
...
public/scss/home/_logistics.css
View file @
540aa06
...
...
@@ -13,7 +13,7 @@
background
:
#fff
;
font-size
:
30px
;
line-height
:
88px
;
label
{
display
:
block
;
position
:
relative
;
...
...
@@ -25,15 +25,16 @@
content
:
none
;
}
.company-val
{
.company-val
{
direction
:
rtl
;
margin-right
:
10px
;
}
.icon
{
}
.icon
{
margin-top
:
27px
;
margin-right
:
10px
;
float
:
right
;
}
}
}
input
{
...
...
@@ -41,14 +42,13 @@
top
:
0
;
right
:
40px
;
width
:
360px
;
height
:
8
8
px
;
height
:
8
6
px
;
color
:
#444
;
padding
:
0
;
border
:
none
;
-webkit-appearance
:
none
;
}
.num
{
width
:
440px
;
text-align
:
right
;
...
...
@@ -80,15 +80,15 @@
.search-input
{
position
:
relative
;
text-align
:
center
;
padding
:
16px
16px
;
padding
:
16px
;
border-bottom
:
1px
solid
#e6e6e6
;
input
{
height
:
56px
;
width
:
100%
;
padding-left
:
1
5px
;
padding-left
:
2
5px
;
border-radius
:
20px
;
font-size
:
36
px
;
font-size
:
22
px
;
color
:
#b0b0b0
;
background
:
#eee
;
border
:
none
;
...
...
@@ -97,6 +97,7 @@
input
::-webkit-input-placeholder
{
/* WebKit browsers */
text-align
:
center
;
}
input
:-ms-input-placeholder
{
/* Internet Explorer 10+ */
text-align
:
center
;
}
...
...
@@ -107,7 +108,6 @@
margin-left
:
30px
;
.company-item
{
h2
{
height
:
50px
;
line-height
:
50px
;
...
...
@@ -122,7 +122,7 @@
font-size
:
30px
;
border-bottom
:
1px
solid
#f3f3f3
;
}
}
}
}
}
}
...
...
public/vue/home/fav-product-list.vue
View file @
540aa06
...
...
@@ -14,7 +14,7 @@
<br/>
<div class="fav-price">
<span class="new-price" v-if="item.discountPrice">{{item.discountPrice}}</span>
<span class="
fav-price
{{ item.discountPrice ? 'price-underline' : ''}}">{{item.price}}</span>
<span class="{{ item.discountPrice ? 'price-underline' : ''}}">{{item.price}}</span>
</div>
<br/>
<div class="save-price">
...
...
Please
register
or
login
to post a comment