Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yoho-blk
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
1
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
zhangxiaoru
9 years ago
Commit
7c8029e67e0fe565a49279c4178631f6ea6f9b2b
2 parents
61b42c21
6862152a
editorial
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
78 additions
and
43 deletions
apps/me/controllers/favorite.js
apps/me/models/order.js
apps/me/views/partial/order/detail/order-express.hbs
apps/me/views/partial/returns-list.hbs
apps/product/models/shop-service.js
apps/shopping/views/partial/cart/cart-list-body.hbs
public/js/me/order-detail.page.js
public/js/me/order/countdown.js
public/js/product/list/favorite.js
public/js/shopping/cart/cart.js
public/js/shopping/order/address.js
public/scss/components/_round-color.css
public/scss/me/_index.css
public/scss/me/order/_express.css
public/scss/shopping/_removed-products.css
public/tpl/me/express.hbs
public/tpl/shopping/edit-color-size.hbs
apps/me/controllers/favorite.js
View file @
7c8029e
...
...
@@ -82,7 +82,7 @@ const favorite = {
p
.
stateText
=
'已售罄'
;
}
p
.
url
=
`
/
product
/
pro_$
{
p
.
productId
}
_$
{
p
.
goodsId
}
/${p.cnAlphabet}.html`
;
p
.
imageUrl
=
p
.
image
;
p
.
imageUrl
=
p
.
image
.
replace
(
'imageMogr2'
,
'imageMogr1'
)
;
});
ret
.
content
.
favorite
.
data
=
retData
;
...
...
apps/me/models/order.js
View file @
7c8029e
...
...
@@ -178,6 +178,8 @@ const _convertAddress = (addressList, createTime) => {
// 增加一个默认初始状态
addrList
.
push
({
time
:
createTime
,
city
:
'默认 '
,
hide
:
true
,
action
:
'您的订单已提交,等待付款'
});
...
...
@@ -228,7 +230,7 @@ const _getDetail = (uid, code) => {
uid
:
uid
,
order_code
:
code
},
{
cache
:
true
cache
:
100
});
};
...
...
@@ -248,7 +250,7 @@ const _getUserOrder = (uid, type, page) => {
page
:
page
,
limit
:
pageSize
},
{
cache
:
true
cache
:
100
}).
then
(
result
=>
{
let
orderList
=
[];
let
total
=
false
;
...
...
@@ -436,11 +438,13 @@ const getOrderData = (uid, type, page) => {
2
:
{
emptyMsg
:
'没有待付款的订单哦~'
,
btnText
:
'查看全部订单'
,
showEmptyEn
:
true
,
url
:
'/me/'
},
3
:
{
emptyMsg
:
'没有待收货的订单哦~'
,
btnText
:
'查看全部订单'
,
showEmptyEn
:
true
,
url
:
'/me/'
}
};
...
...
apps/me/views/partial/order/detail/order-express.hbs
View file @
7c8029e
...
...
@@ -22,7 +22,7 @@
</ul>
<ul
class=
"column city"
>
{{#
addressList
}}
<li
class=
"text
"
>
{{
city
}}
</li>
<li
class=
"text
{{#if
hide
}}
vhide
{{/if}}
"
>
{{
city
}}
</li>
{{/
addressList
}}
</ul>
<ul
class=
"column action"
>
...
...
apps/me/views/partial/returns-list.hbs
View file @
7c8029e
...
...
@@ -2,7 +2,6 @@
<div
class=
"order"
>
{{#
returnsList
}}
{{>
common
/
subtitle
}}
{{#if
list
}}
<div
class=
"table"
>
<ul
class=
"header"
>
<li
class=
"info"
>
商品信息
</li>
...
...
@@ -10,6 +9,7 @@
<li
class=
"op"
>
操作
</li>
</ul>
</div>
{{#if
list
}}
{{#
list
}}
<div
class=
"table"
>
{{>
order
/
order-header
}}
...
...
apps/product/models/shop-service.js
View file @
7c8029e
...
...
@@ -127,16 +127,18 @@ const ShopService = {
brandId
:
domainInfo
.
id
,
shopId
:
''
};
let
brandId
=
domainInfo
.
id
;
if
(
domainInfo
.
shopId
)
{
let
shopId
=
domainInfo
.
shopId
;
let
shopIntro
=
yield
ShopService
.
getShopIntro
(
shopId
,
uid
);
let
brandInfo
=
yield
BrandService
.
getBrandInfo
(
brandId
,
uid
);
info
.
shopId
=
shopId
;
info
.
name
=
shopIntro
.
shopName
;
info
.
info
=
shopIntro
.
shopIntro
;
info
.
btnName
=
'品牌介绍'
;
info
.
isFavorite
=
shopIntr
o
.
isFavorite
===
'Y'
;
info
.
isFavorite
=
brandInf
o
.
isFavorite
===
'Y'
;
let
shopData
=
yield
Promise
.
all
([
ShopService
.
getShopDecorator
(
shopId
),
ShopService
.
getShopSecondSorts
(
domainInfo
.
id
,
shopId
)]);
...
...
@@ -152,7 +154,6 @@ const ShopService = {
info
.
resources
=
resources
;
info
.
menus
=
shopMenu
(
domain
,
resources
.
navigationBar
);
}
else
{
let
brandId
=
domainInfo
.
id
;
let
brandInfo
=
yield
BrandService
.
getBrandInfo
(
brandId
,
uid
);
info
.
name
=
brandInfo
.
brandName
;
...
...
apps/shopping/views/partial/cart/cart-list-body.hbs
View file @
7c8029e
...
...
@@ -79,7 +79,7 @@
</a>
</li>
<li
class=
"pro-info"
>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
>
{{
brand_name
}}
</a>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
target=
"_blank"
>
{{
brand_name
}}
</a>
<div
class=
"pro-name"
><a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank"
>
{{
product_name
}}
</a></div>
<div
class=
"color-size editable"
data-productId=
"
{{
product_id
}}
"
id=
"edit_
{{
product_id
}}
"
data-productSkn=
"
{{
product_skn
}}
"
>
{{#if
color_name
}}
...
...
@@ -124,7 +124,7 @@
</a>
</li>
<li
class=
"pro-info"
>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
>
{{
brand_name
}}
</a>
<a
class=
"brand-name"
href=
"/product/shop/
{{
brand_domain
}}
"
target=
"_blank"
>
{{
brand_name
}}
</a>
<div
class=
"pro-name"
><a
href=
"javascript:void(0)"
>
{{
product_name
}}
</a></div>
<div>
{{#if
color_name
}}
...
...
public/js/me/order-detail.page.js
View file @
7c8029e
...
...
@@ -54,6 +54,17 @@ if ($('.left-time').length) {
countDown
.
start
();
}
$
(
'body'
).
on
(
'click'
,
function
(
e
)
{
if
(
$
(
e
.
target
).
hasClass
(
'show-package'
))
{
return
false
;
}
e
.
preventDefault
();
if
(
!
$
(
'.package-list'
).
hasClass
(
'hide'
))
{
$
(
'.package-list'
).
addClass
(
'hide'
);
}
});
$
(
'.show-package'
).
on
(
'click'
,
function
()
{
$
(
this
).
next
(
'.package-list'
).
toggleClass
(
'hide'
);
...
...
public/js/me/order/countdown.js
View file @
7c8029e
...
...
@@ -29,7 +29,7 @@ module.exports = {
var
timeStr
=
min
+
'分'
;
if
(
src
<=
0
)
{
if
(
parseInt
(
src
,
10
)
<=
0
)
{
timeStr
=
'已失效'
;
$
(
'.hide-when-invalid'
).
hide
();
$
(
'.user-order .table .common-column .pay-operation .left-time'
).
css
(
'margin-left'
,
'0'
);
...
...
@@ -44,8 +44,6 @@ module.exports = {
timeStr
=
hour
+
'时'
+
timeStr
;
}
timeStr
=
'剩余'
+
timeStr
;
if
(
this
.
addtionalMsg
.
length
>
0
)
{
timeStr
+=
this
.
addtionalMsg
;
}
...
...
public/js/product/list/favorite.js
View file @
7c8029e
...
...
@@ -12,11 +12,11 @@ function _favBack(data) {
}
}
function
_favShop
(
shopId
,
isAdd
)
{
$
.
post
(
'/product/shop/togglecollect'
,
{
shopId
:
shopId
,
type
:
isAdd
?
''
:
'add'
},
function
(
data
)
{
_favBack
(
data
);
});
}
// function _favShop(shopId, isAdd) {
// $.post('/product/shop/togglecollect', {shopId: shopId, type: isAdd ? '' : 'add'}, function(data) {
// _favBack(data);
// });
// }
function
_favBrand
(
brandId
,
isAdd
)
{
$
.
post
(
'/product/brand/togglecollect'
,
{
brandId
:
brandId
,
type
:
isAdd
?
''
:
'add'
},
function
(
data
)
{
...
...
@@ -26,13 +26,8 @@ function _favBrand(brandId, isAdd) {
$
(
'#brand-fav'
).
click
(
function
()
{
var
$banner
=
$
(
this
).
parents
(
'.brand-banner'
);
var
shopId
=
$banner
.
data
(
'shop'
);
var
brandId
=
$banner
.
data
(
'brand'
);
var
isAdd
=
$
(
this
).
hasClass
(
'coled'
);
if
(
shopId
)
{
_favShop
(
shopId
,
isAdd
);
}
else
if
(
brandId
)
{
_favBrand
(
brandId
,
isAdd
);
}
_favBrand
(
brandId
,
isAdd
);
});
...
...
public/js/shopping/cart/cart.js
View file @
7c8029e
...
...
@@ -474,7 +474,7 @@ Cart = {
return
false
;
});
editTarget
.
find
(
'.
current-sizes .
size-item'
).
click
(
function
()
{
editTarget
.
find
(
'.size-item'
).
click
(
function
()
{
var
$this
=
$
(
this
);
if
(
$this
.
hasClass
(
'current'
))
{
...
...
@@ -484,6 +484,13 @@ Cart = {
$
(
this
).
addClass
(
'current'
).
siblings
(
'.current'
).
removeClass
(
'current'
);
newProductSku
=
$
(
this
).
attr
(
'data-sku'
);
});
// 初始化size list选中项(其他颜色中第一个尺码)
editTarget
.
find
(
'.sizes-list.mb10'
).
each
(
function
()
{
if
(
$
(
this
).
find
(
'.current'
).
length
===
0
)
{
$
(
this
).
find
(
'.size-item'
).
first
().
addClass
(
'current'
);
}
});
},
fail
:
function
()
{
new
_alert
(
'此商品无法编辑颜色和尺寸'
).
show
();
...
...
public/js/shopping/order/address.js
View file @
7c8029e
...
...
@@ -50,7 +50,7 @@ addressDialogTpl = require('../../../tpl/shopping/address-dialog.hbs');
addressTpl
=
require
(
'../../../tpl/shopping/address-list.hbs'
);
// address dialog 数据验证
function
validateAddress
(
$el
)
{
function
validateAddress
(
$el
,
isUpdate
)
{
var
field
=
{
name
:
[
{
...
...
@@ -72,10 +72,6 @@ function validateAddress($el) {
{
noEmpty
:
true
,
err
:
'手机号码不能为空'
},
{
regx
:
/^
\d{3}(\d
|
\*){4}\d{4}
$/
,
// 验证正常数字或者****
err
:
'手机号码格式不正确'
}
],
phone
:
[
...
...
@@ -95,6 +91,19 @@ function validateAddress($el) {
var
pass
=
true
;
// 新增情况下须验证正确的手机号;编辑情况下可通过****的验证
if
(
isUpdate
)
{
field
.
mobile
.
push
({
regx
:
/^
\d{3}(\d
|
\*){4}\d{4}
$/
,
// 验证正常数字或者****
err
:
'手机号码格式不正确'
});
}
else
{
field
.
mobile
.
push
({
regx
:
/^
\d{11}
$/
,
err
:
'手机号码格式不正确'
});
}
for
(
key
in
field
)
{
if
(
field
.
hasOwnProperty
(
key
))
{
$cur
=
$el
.
find
(
'.address-'
+
key
);
...
...
@@ -160,7 +169,7 @@ function addressDialogFactory(opt, $the) {
areaCode
;
// 验证输入
if
(
validateAddress
(
address
.
$el
))
{
if
(
validateAddress
(
address
.
$el
,
opt
&&
opt
.
id
))
{
// form value
consignee
=
$el
.
find
(
'.address-name'
).
val
();
...
...
public/scss/components/_round-color.css
View file @
7c8029e
...
...
@@ -22,6 +22,7 @@
width
:
100%
;
height
:
100%
;
margin-top
:
-1px
;
margin-left
:
0.1px
;
}
}
...
...
public/scss/me/_index.css
View file @
7c8029e
...
...
@@ -110,7 +110,7 @@
}
.error-msg
{
color
:
#c71814
;
@extend
.blue
;
}
.correct-msg
{
...
...
@@ -119,7 +119,7 @@
.error-msg
,
.correct-msg
{
font-size
:
1
4
px
;
font-size
:
1
2
px
;
padding-left
:
5px
;
.iconfont
{
...
...
public/scss/me/order/_express.css
View file @
7c8029e
...
...
@@ -69,4 +69,8 @@
left
:
3px
;
}
}
.check-all
:hover
{
@extend
.blue;
}
}
...
...
public/scss/shopping/_removed-products.css
View file @
7c8029e
...
...
@@ -26,9 +26,19 @@
margin-right
:
20px
;
}
span
{
span
:hover
{
cursor
:
pointer
;
color
:
#379ed6
;
}
a
{
display
:
block
;
width
:
100%
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
&:hover
{
cursor
:
pointer
;
color
:
#379ed6
;
}
}
...
...
public/tpl/me/express.hbs
View file @
7c8029e
...
...
@@ -14,7 +14,7 @@
{{#
sub_express_deatil
}}
{{#if
@first
}}
<div
class=
"tip"
>
<p>
以上为最新跟踪信息
<a
href=
'/me/order/detail?orderCode=
{{
order_code
}}
'
target=
"_blank"
>
查看全部
</a></p>
<p>
以上为最新跟踪信息
<a
class=
"check-all"
href=
'/me/order/detail?orderCode=
{{
order_code
}}
'
target=
"_blank"
>
查看全部
</a></p>
</div>
{{/if}}
{{/
sub_express_deatil
}}
...
...
public/tpl/shopping/edit-color-size.hbs
View file @
7c8029e
...
...
@@ -12,7 +12,7 @@
style=
"background:
{{
rgb
}}
"
data-imageurl=
"
{{
image
pic
100
134
}}
"
data-target=
"
{{
proId
}}
-color-
{{
@index
}}
"
data-title=
"
{{
color
}}
"
>
data-title=
"
{{
color
}}
"
title=
"
{{
color
}}
"
>
<span
class=
"inner"
></span>
</span>
{{/
each
}}
...
...
@@ -26,13 +26,8 @@
<div
class=
"sizes-list mb10"
>
{{#
each
sizes
}}
{{#
isEqual
..
/
..
/
defaultSize
name
}}
<span
class=
"size-item mr10 mb10 current
{{#
isEqual
num
0
}}
disabled
{{/
isEqual
}}
"
data-sku=
"
{{
sku
}}
"
>
{{
name
}}
</span>
{{^}}
<span
class=
"size-item mr10 mb10
{{#
isEqual
num
0
}}
disabled
{{/
isEqual
}}
"
data-sku=
"
{{
sku
}}
"
>
{{
name
}}
</span>
{{/
isEqual
}}
<span
class=
"size-item mr10 mb10
{{#
isEqual
..
/
..
/
defaultSize
name
}}
current
{{/
isEqual
}}{{#
isEqual
num
0
}}
disabled
{{/
isEqual
}}
"
data-sku=
"
{{
sku
}}
"
>
{{
name
}}
</span>
{{/
each
}}
</div>
</div>
...
...
Please
register
or
login
to post a comment