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
htoooth
9 years ago
Commit
c9f1404e1e1cf0955c00b70b0a7de6e947fae005
2 parents
db28d483
dbb4dafb
Merge remote-tracking branch 'origin/release/1.0' into release/1.0
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
176 additions
and
143 deletions
apps/me/models/order.js
apps/me/views/partial/order/table-body.hbs
apps/me/views/partial/refund-detail.hbs
apps/me/views/partial/refund.hbs
apps/me/views/partial/returns-list.hbs
apps/shopping/controllers/cart.js
doraemon/views/partial/footer.hbs
public/js/common/header.js
public/js/me/exchange.page.js
public/js/me/order/edit-order.js
public/js/me/order/validation.js
public/js/me/refund.page.js
public/js/shopping/order/address.js
public/scss/components/_header.css
public/scss/me/return/_index.css
public/scss/shopping/_cart-products.css
public/scss/shopping/_order.css
public/tpl/common/bag-goods.hbs
public/tpl/me/thumbnail.hbs
apps/me/models/order.js
View file @
c9f1404
...
...
@@ -322,6 +322,7 @@ const _getUserOrder = (uid, type, page) => {
item
.
refundUrl
=
helpers
.
urlFormat
(
'/me/return/refund/'
+
item
.
orderCode
);
item
.
exchangeUrl
=
helpers
.
urlFormat
(
'/me/return/exchange/'
+
item
.
orderCode
);
item
.
detailUrl
=
helpers
.
urlFormat
(
'/me/order/detail/'
+
item
.
orderCode
);
});
return
{
...
...
apps/me/views/partial/order/table-body.hbs
View file @
c9f1404
...
...
@@ -14,7 +14,7 @@
</div>
<div
class=
"common-column special-border status"
>
<p
class=
"bold status-str"
>
{{
statusStr
}}
</p>
<a
href=
"
/me/order/detail?code=
{{
orderCode
}}
"
>
<a
href=
"
{{
detailUrl
}}
"
target=
"_blank
"
>
<p
class=
"subtext check-detail"
>
查看详情
</p>
</a>
</div>
...
...
apps/me/views/partial/refund-detail.hbs
View file @
c9f1404
{{#
refundDetail
}}
<div
class=
"refund-datail-wrap"
data-id=
"
{{
id
}}
"
>
<a
href=
"/help?id=43"
class=
"refund-notice"
>
退货须知
</a>
<a
href=
"/help?id=43"
class=
"refund-notice"
target=
"_blank"
>
退货须知
</a>
{{>
returns
/
returns-status
}}
{{#
orderReview
}}
...
...
apps/me/views/partial/refund.hbs
View file @
c9f1404
{{#
refund
}}
<div
class=
"refund-wrap"
>
<a
href=
"/help?id=43"
class=
"refund-notice"
>
退货须知
</a>
<a
href=
"/help?id=43"
class=
"refund-notice"
target=
"_blank"
>
退货须知
</a>
{{>
returns
/
returns-status
}}
<h4
class=
"third-title"
>
选择退货商品
</h4>
...
...
apps/me/views/partial/returns-list.hbs
View file @
c9f1404
...
...
@@ -24,7 +24,7 @@
<p
class=
"subtext cancel-apply"
data-type=
"
{{
type
}}
"
data-apply-id=
"
{{
id
}}
"
>
取消申请
</p>
{{/
..
/
this
}}
{{/
isY
}}
<a
href=
"
{{
detailUrl
}}
"
>
<a
href=
"
{{
detailUrl
}}
"
target=
"_blank"
>
<p
class=
"subtext"
>
查看详情
</p>
</a>
</div>
...
...
apps/shopping/controllers/cart.js
View file @
c9f1404
...
...
@@ -24,9 +24,6 @@ exports.index = (req, res, next) => {
},
{
helpers
:
require
(
'../helpers'
)
},
cartModel
.
filterCartData
(
result
,
uid
)));
}
else
{
// code 500
res
.
send
(
result
);
}
}).
catch
(
next
);
};
...
...
doraemon/views/partial/footer.hbs
View file @
c9f1404
...
...
@@ -2,10 +2,10 @@
<div
class=
"center-content"
>
<ul
class=
"about-us clearfix"
>
<li><a
href=
"
{{
siteUrl
}}
"
>
BLK首页
</a></li>
<li><a
href=
"
{{
siteUrl
}}
/help"
>
客户服务
</a></li>
<li><a
href=
"
{{
siteUrl
}}
/help?id=2"
>
支付方式
</a></li>
<li><a
href=
"
{{
siteUrl
}}
/help?id=31"
>
配送方式
</a></li>
<li><a
href=
"
{{
siteUrl
}}
/help?id=41"
>
售后服务
</a></li>
<li><a
href=
"
{{
siteUrl
}}
/help"
target=
"_blank"
>
客户服务
</a></li>
<li><a
href=
"
{{
siteUrl
}}
/help?id=2"
target=
"_blank"
>
支付方式
</a></li>
<li><a
href=
"
{{
siteUrl
}}
/help?id=31"
target=
"_blank"
>
配送方式
</a></li>
<li><a
href=
"
{{
siteUrl
}}
/help?id=41"
target=
"_blank"
>
售后服务
</a></li>
</ul>
<div
class=
"record-info"
>
<p>
...
...
public/js/common/header.js
View file @
c9f1404
...
...
@@ -5,13 +5,67 @@
*/
var
$
=
require
(
'yoho-jquery'
);
var
$bagNum
=
$
(
'.bag-num'
),
$bagGoodsList
=
$
(
'.mini-goods-list'
);
var
$searchWrap
=
$
(
'.search-wrapper'
),
$searchForm
=
$
(
'#search-form'
),
$searchKey
=
$
(
'#search-key'
),
$clearInput
=
$
(
'.clear-input'
);
var
goodsTpl
=
require
(
'../../tpl/common/bag-goods.hbs'
);
var
delayer
;
function
handelProduct
(
data
)
{
var
goods
=
[],
list
=
[
'commonPros'
,
'preSalePros'
,
'noStorage'
];
var
i
,
total
=
0
;
for
(
i
=
0
;
i
<
list
.
length
;
i
++
)
{
if
(
data
[
list
[
i
]].
length
)
{
goods
=
goods
.
concat
(
data
[
list
[
i
]]);
}
}
$
.
each
(
goods
,
function
(
key
)
{
total
+=
+
goods
[
key
].
buy_number
||
0
;
});
return
{
total
:
total
,
goods
:
goods
};
}
function
refreshBag
()
{
$
.
ajax
({
type
:
'GET'
,
url
:
'/shopping/cart/data'
,
data
:
{},
success
:
function
(
result
)
{
var
data
;
if
(
result
.
code
===
200
)
{
data
=
handelProduct
(
result
);
if
(
data
.
total
)
{
$bagNum
.
text
(
data
.
total
);
$bagGoodsList
.
html
(
goodsTpl
(
data
));
$bagGoodsList
.
parent
().
removeClass
(
'bag-empty'
);
}
else
{
$bagNum
.
text
(
''
);
$bagGoodsList
.
empty
();
$bagGoodsList
.
parent
().
addClass
(
'bag-empty'
);
}
}
}
})
};
refreshBag
();
$
(
'.yoho-group a'
).
hover
(
function
()
{
var
data
=
$
(
this
).
data
();
...
...
@@ -89,3 +143,7 @@ $(document).click(function(e) {
$searchWrap
.
hide
();
}
});
module
.
exports
=
{
refreshBag
};
...
...
public/js/me/exchange.page.js
View file @
c9f1404
...
...
@@ -8,7 +8,6 @@ var addrSelector = require('../plugins/cascading-address');
var
addr
;
var
nameReg
=
/^
[\u
4e00-
\u
9fa5
]{2,5}
$/
;
var
addressReg
=
/^
[\s\S]{2,100}
$/
;
var
phoneReg
=
/^
(
13
[
0-9
]
|15
[
012356789
]
|17
[
678
]
|18
[
0-9
]
|14
[
57
])[
0-9
]{8}
$/
;
...
...
@@ -21,8 +20,10 @@ var validateMap = {
user
:
{
sl
:
'#user'
,
v
:
{
reg
:
nameReg
,
errMsg
:
'真实姓名至少2个中文,最多5个中文'
maxLength
:
12
,
minLength
:
2
,
necessary
:
true
,
errMsg
:
'真实姓名至少2个字符,最多12个字符'
}
},
addr
:
{
...
...
@@ -44,79 +45,6 @@ var validateMap = {
// 添加.check方法
require
(
'../plugins/check'
);
// var numCtrl = {
// valueEl: $('.number .value'),
// btn: {
// minus: $('.number .minus'),
// plus: $('.number .plus')
// },
// scope: {
// 1: {
// min: true,
// do: function(t) {
// t.btn.minus.addClass('disable');
// }
// }
// },
// initNumberScope: function() {
// var maxValue = this.valueEl.text();
//
// this.btn.plus.addClass('disable');
//
// this.scope[maxValue] = {
// max: true,
// do: function(t) {
// t.btn.plus.addClass('disable');
// }
// };
// },
// bindNumberEvent: function() {
// var $val = this.valueEl;
// var val = parseInt($val.text(), 10);
// var scope = this.scope;
// var that = this;
//
//
// this.btn.minus.on('click', function() {
// if ($(this).hasClass('disable')) {
// return;
// }
//
// if (that.btn.plus.hasClass('disable')) {
// that.btn.plus.removeClass('disable');
// }
//
// val -= 1;
// $val.text(val);
//
// if (scope[val] && scope[val].min) {
// scope[val].do(that);
// }
// });
//
// this.btn.plus.on('click', function() {
// if ($(this).hasClass('disable')) {
// return;
// }
//
// if (that.btn.minus.hasClass('disable')) {
// that.btn.minus.removeClass('disable');
// }
//
// val += 1;
// $val.text(val);
//
// if (scope[val] && scope[val].max) {
// scope[val].do(that);
// }
// });
// },
// init: function() {
// this.initNumberScope();
// this.bindNumberEvent();
// }
// };
function
setActive
(
$item
)
{
var
color
=
$item
.
find
(
'.color-text'
).
data
(
'color'
);
var
size
=
$item
.
find
(
'.size-text'
).
data
(
'size'
);
...
...
@@ -313,7 +241,7 @@ function validateData() {
var
k
=
input
.
id
;
if
(
k
&&
validateMap
[
k
])
{
if
(
!
validate
.
do
(
validateMap
[
k
].
sl
,
validateMap
[
k
].
v
))
{
if
(
!
validate
.
start
(
validateMap
[
k
].
sl
,
validateMap
[
k
].
v
))
{
pass
=
false
;
}
}
...
...
@@ -397,7 +325,7 @@ function bindBlurEvent() {
var
v
=
validateMap
[
this
.
id
];
if
(
$this
.
val
().
length
>
0
)
{
validate
.
do
(
v
.
sl
,
v
.
v
);
validate
.
start
(
v
.
sl
,
v
.
v
);
}
});
}
...
...
public/js/me/order/edit-order.js
View file @
c9f1404
...
...
@@ -6,7 +6,6 @@ var addr;
var
validate
=
require
(
'./validation'
);
var
nameReg
=
/^
[\u
4e00-
\u
9fa5
]{2,5}
$/
;
var
addressReg
=
/^
[\s\S]{2,100}
$/
;
var
phoneReg
=
/^
(
13
[
0-9
]
|15
[
012356789
]
|17
[
678
]
|18
[
0-9
]
|14
[
57
])[
0-9
]{8}
$/
;
...
...
@@ -14,8 +13,10 @@ var validateMap = {
name
:
{
sl
:
'#user-name'
,
v
:
{
reg
:
nameReg
,
errMsg
:
'真实姓名至少2个中文,最多5个中文'
maxLength
:
12
,
minLength
:
2
,
necessary
:
true
,
errMsg
:
'真实姓名至少2个字符,最多12个字符'
}
},
address
:
{
...
...
@@ -73,14 +74,14 @@ function validateData() {
var
k
=
getValidateKey
(
input
.
id
);
if
(
k
&&
validateMap
[
k
])
{
if
(
!
validate
.
do2
(
validateMap
[
k
].
sl
,
validateMap
[
k
].
v
))
{
if
(
!
validate
.
start
(
validateMap
[
k
].
sl
,
validateMap
[
k
].
v
))
{
pass
=
false
;
}
}
});
// 检查选填项
if
(
$phone
.
val
().
length
>
0
&&
!
validate
.
do2
(
validateMap
.
phone
.
sl
,
validateMap
.
phone
.
v
))
{
if
(
$phone
.
val
().
length
>
0
&&
!
validate
.
start
(
validateMap
.
phone
.
sl
,
validateMap
.
phone
.
v
))
{
pass
=
false
;
}
...
...
@@ -199,7 +200,7 @@ function showDiaglog(tpl, onEdit) {
var
v
=
validateMap
[
getValidateKey
(
$this
.
get
(
0
).
id
)];
if
(
$this
.
val
().
length
>
0
)
{
validate
.
do2
(
v
.
sl
,
v
.
v
);
validate
.
start
(
v
.
sl
,
v
.
v
);
}
});
}
...
...
public/js/me/order/validation.js
View file @
c9f1404
var
common
=
require
(
'../../common'
);
var
makeValidate
=
{
reg
:
function
(
val
,
reg
)
{
return
reg
.
test
(
val
);
},
minLength
:
function
(
val
,
l
)
{
return
val
.
length
>=
l
;
return
common
.
getStrLength
(
val
)
>=
l
;
},
maxLength
:
function
(
val
,
l
)
{
return
common
.
getStrLength
(
val
)
<=
l
;
},
isNumber
:
function
(
val
,
bl
)
{
return
bl
&&
!
isNaN
(
parseInt
(
val
,
10
));
},
necessary
:
function
(
val
,
bl
)
{
return
bl
&&
val
.
length
>
0
;
return
bl
&&
common
.
getStrLength
(
val
)
>
0
;
},
addr
:
function
(
val
)
{
// 完整的地址应该是长度为三的数组
...
...
@@ -58,11 +65,15 @@ function validate(selector, conditions) {
if
(
makeValidate
[
c
]
&&
!
makeValidate
[
c
].
call
(
null
,
$el
.
val
(),
conditions
[
c
]))
{
pass
=
false
;
showMsg
({
el
:
selector
,
err
:
true
,
msg
:
conditions
.
errMsg
});
return
false
;
}
else
if
(
c
!==
'errMsg'
)
{
showMsg
({
el
:
selector
...
...
@@ -93,7 +104,7 @@ function validateAddr(val, conditions) {
}
module
.
exports
=
{
do2
:
validate
,
start
:
validate
,
addr
:
validateAddr
};
...
...
public/js/me/refund.page.js
View file @
c9f1404
...
...
@@ -5,7 +5,6 @@
*/
var
$
=
require
(
'yoho-jquery'
),
lazyload
=
require
(
'yoho-jquery-lazyload'
),
handlebars
=
require
(
'yoho-handlebars'
),
upload
=
require
(
'../plugins/upload'
),
Alert
=
require
(
'../plugins/dialog'
).
Alert
;
...
...
@@ -23,14 +22,7 @@ var orderCode = $('#order-code').val() || 0,
type
:
$refundType
.
find
(
'.type-item.cur'
).
data
(
'id'
)
// 1--原卡返回 2--银行卡 3--支付宝 4--yoho币
};
var
tpl
=
'<div class="img-wrap" data-img="{{data}}">'
+
'<div class="img-opt">'
+
'<span class="review-upimg">查看</span>'
+
'<span class="cancel-upimg">删除</span>'
+
'</div>'
+
'<div class="img-view"><img src="{{data}}"></div>'
+
'</div>'
,
imgFn
=
handlebars
.
compile
(
tpl
);
var
imgBoxTpl
=
require
(
'../../tpl/me/thumbnail.hbs'
);
var
checked
;
...
...
@@ -139,7 +131,7 @@ function packApplyInfo() {
}
good
.
evidence_images
=
[];
$special
.
find
(
'.
img-wrap
'
).
each
(
function
()
{
$special
.
find
(
'.
thumb-box
'
).
each
(
function
()
{
var
img
=
$
(
this
).
data
(
'img'
);
if
(
img
)
{
...
...
@@ -237,21 +229,19 @@ $refundTable.on('change', '.refund-reason', function() {
}
$this
.
siblings
(
'.img-up-tip'
).
text
(
++
num
+
'/4'
);
$this
.
data
(
'num'
,
num
);
$this
.
before
(
img
Fn
(
result
));
$this
.
before
(
img
BoxTpl
({
src
:
result
.
data
}
));
}
}
});
}).
on
(
'click'
,
'.
img-opt > span
'
,
function
()
{
}).
on
(
'click'
,
'.
thumb-box .delete
'
,
function
()
{
var
$this
=
$
(
this
),
$wrap
=
$this
.
closest
(
'.
img-wrap
'
),
$wrap
=
$this
.
closest
(
'.
thumb-box
'
),
$upBtn
=
$wrap
.
siblings
(
'.img-upload'
),
num
=
$upBtn
.
data
(
'num'
)
||
0
;
if
(
$this
.
hasClass
(
'cancel-upimg'
))
{
$wrap
.
siblings
(
'.img-up-tip'
).
text
(
--
num
+
'/4'
);
$wrap
.
remove
();
$upBtn
.
data
(
'num'
,
num
);
}
$wrap
.
siblings
(
'.img-up-tip'
).
text
(
--
num
+
'/4'
);
$wrap
.
remove
();
$upBtn
.
data
(
'num'
,
num
);
});
$refundType
.
on
(
'click'
,
'.type-item'
,
function
()
{
...
...
public/js/shopping/order/address.js
View file @
c9f1404
...
...
@@ -20,6 +20,7 @@ var detailErr = '2-100字符。1个中文为2个字符';
var
addressDialogTpl
;
var
addressTpl
;
require
(
'yoho-jquery-placeholder'
);
require
(
'yoho-jquery-dotdotdot'
);
// dot someone
...
...
@@ -29,6 +30,11 @@ function dotYou($el) {
});
}
// place holder
function
placeHolderYou
(
$el
)
{
$el
.
placeholder
();
}
// set address-all show or not
function
setAllOfAddress
()
{
...
...
@@ -290,6 +296,9 @@ function initAddressContent($el, areaCode) {
$cur
.
siblings
(
'.error-tips'
).
hide
();
}
});
// place holder
placeHolderYou
(
$el
.
find
(
'[placeholder]'
));
}
/**
...
...
public/scss/components/_header.css
View file @
c9f1404
...
...
@@ -102,7 +102,7 @@
.icon-bag
{
background-image
:
url('/layout/bag.png')
;
line-height
:
2
2
px
;
line-height
:
2
4
px
;
text-align
:
center
;
}
...
...
@@ -166,6 +166,13 @@
background
:
#fff
;
}
.mini-goods-list
{
width
:
340px
;
max-height
:
350px
;
display
:
block
;
overflow-x
:
hidden
;
}
.go-bag-btn
{
font-size
:
20px
;
line-height
:
1
;
...
...
@@ -198,6 +205,15 @@
height
:
64px
;
}
.name
{
width
:
150px
;
overflow
:
hidden
;
white-space
:
nowrap
;
text-overflow
:
ellipsis
;
display
:
block
;
cursor
:
pointer
;
}
.info
{
width
:
160px
;
padding-left
:
10px
;
...
...
@@ -207,6 +223,10 @@
width
:
100px
;
text-align
:
right
;
}
.del-good-btn
{
cursor
:
pointer
;
}
}
}
}
...
...
public/scss/me/return/_index.css
View file @
c9f1404
...
...
@@ -93,17 +93,13 @@
margin-right
:
20px
;
}
.img-wrap
,
.img-upload
{
width
:
60px
;
height
:
60px
;
border
:
1px
dashed
#eee
;
line-height
:
60px
;
float
:
left
;
border
:
1px
dashed
#eee
;
margin-right
:
10px
;
}
.img-upload
{
line-height
:
60px
;
text-align
:
center
;
color
:
#dfdfdf
;
cursor
:
pointer
;
...
...
@@ -112,31 +108,35 @@
font-size
:
34px
;
}
}
}
.img-wrap
{
position
:
relative
;
}
.img-wrap
:hover
.img-opt
{
display
:
block
;
}
.thumb-box
{
position
:
relative
;
float
:
left
;
.img-opt
{
width
:
100%
;
height
:
20px
;
line-height
:
20px
;
background
:
#555
;
font-size
:
12px
;
color
:
#fff
;
opacity
:
0.7
;
.operation-box
{
display
:
none
;
width
:
60px
;
padding
:
5px
0
;
position
:
absolute
;
top
:
0
;
background-color
:
rgba
(
0
,
0
,
0
,
0.6
);
text-align
:
center
;
display
:
none
;
font-size
:
12px
;
>
*
{
display
:
inline-block
;
.delete
{
cursor
:
pointer
;
}
*
{
color
:
#fff
!important
;
}
}
&
:hover
{
.operation-box
{
display
:
block
;
}
}
}
...
...
public/scss/shopping/_cart-products.css
View file @
c9f1404
...
...
@@ -164,7 +164,7 @@ $hoverColor: #379ed6;
.editable
{
padding
:
5px
;
width
:
19
0px
;
width
:
20
0px
;
position
:
relative
;
.iconfont
{
...
...
public/scss/shopping/_order.css
View file @
c9f1404
...
...
@@ -130,6 +130,7 @@
.address-chosed
{
position
:
absolute
;
bottom
:
0
;
bottom
:
-1px
\
9
;
/* stylelint-disable-line */
right
:
0
;
}
...
...
public/tpl/common/bag-goods.hbs
0 → 100644
View file @
c9f1404
{{#
goods
}}
<dd
class=
"goods-item clearfix"
>
<div
class=
"thumb"
>
<a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
target=
"_blank"
>
<img
src=
"
{{
image
goods_images
48
64
}}
"
>
</a>
</div>
<div
class=
"info"
>
<a
href=
"/product/pro_
{{
product_id
}}
_
{{
goods_id
}}
/
{{
cn_alphabet
}}
.html"
class=
"name"
target=
"_blank"
>
{{
product_name
}}
</a>
<p>
颜色:
{{
color_name
}}
尺码:
{{
size_name
}}
</p>
</div>
<div
class=
"price"
>
<p>
¥
{{
round
sales_price
2
}}
X
{{
buy_number
}}
</p>
<span
class=
"del-good-btn"
>
删除
</span>
</div>
</dd>
{{/
goods
}}
\ No newline at end of file
...
...
public/tpl/me/thumbnail.hbs
View file @
c9f1404
<div
class=
"thumb-box"
>
<div
class=
"thumb-box"
data-img=
"
{{
src
}}
"
>
<img
class=
"envidence"
src=
"
{{
src
}}
"
alt=
"凭证图片"
>
<div
class=
"operation-box"
>
<a
href=
"
{{
src
}}
"
target=
"_blank"
>
查看
</a>
...
...
Please
register
or
login
to post a comment