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
xuqi
9 years ago
Commit
648bf252e9798d2b652b4a17097a3e527fec92d7
2 parents
ec629f75
06ca8b3b
Merge branch 'release/1.0' of
http://git.yoho.cn/fe/yoho-blk
into release/1.0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
38 additions
and
23 deletions
apps/me/models/order.js
apps/me/views/partial/order/detail/order-status.hbs
public/js/me/address.page.js
public/js/product/shop.page.js
public/scss/me/order/_table.css
public/tpl/product/shop-goods.hbs
apps/me/models/order.js
View file @
648bf25
...
...
@@ -34,6 +34,7 @@ const paymentTypeStr = {
const
btnMap
=
{
all
:
[
{
isPayBtn
:
true
,
name
:
'立即付款'
,
classStr
:
'btn red pay-btn mr'
},
...
...
@@ -502,6 +503,14 @@ const getOrderDetail = (uid, code) => {
detail
.
steps
=
_getStepByOrderStatus
(
st
);
detail
.
btns
=
statusMap
[
st
].
btns
;
_
.
forEach
(
detail
.
btns
,
btn
=>
{
if
(
btn
.
isPayBtn
)
{
btn
.
payUrl
=
helpers
.
urlFormat
(
'/shopping/pay/online'
,
{
code
:
detail
.
orderCode
});
}
});
if
(
parseInt
(
detail
.
paymentType
,
10
)
===
2
&&
(
statusMap
[
st
].
valueStr
===
'备货中'
||
detail
.
statusStr
===
'备货中'
))
{
...
...
apps/me/views/partial/order/detail/order-status.hbs
View file @
648bf25
...
...
@@ -6,7 +6,13 @@
<ul>
{{#
btns
}}
<li>
{{#if
isPayBtn
}}
<a
href=
"
{{
payUrl
}}
"
>
<span
class=
"
{{
classStr
}}
"
>
{{
name
}}
</span>
</a>
{{^}}
<span
class=
"
{{
classStr
}}
"
>
{{
name
}}
</span>
{{/if}}
</li>
{{/
btns
}}
</ul>
...
...
public/js/me/address.page.js
View file @
648bf25
...
...
@@ -25,7 +25,7 @@ require('yoho-jquery-placeholder');
$
(
'[placeholder]'
).
placeholder
();
$
(
function
()
{
$
(
function
()
{
var
address
=
cascadingAddress
({
el
:
'#address'
});
/**
...
...
@@ -33,7 +33,7 @@ $(function () {
*/
var
Bll
=
{
// 获取输入框输入的值
getInfo
:
function
()
{
getInfo
:
function
()
{
return
{
id
:
$addressId
.
val
(),
...
...
@@ -45,7 +45,7 @@ $(function () {
},
// 清空输入框
clearInput
:
function
()
{
clearInput
:
function
()
{
$consignee
.
val
(
''
);
$address
.
val
(
''
);
$mobile
.
val
(
''
);
...
...
@@ -54,7 +54,7 @@ $(function () {
},
// 校验
check
:
function
(
info
)
{
check
:
function
(
info
)
{
var
flag
=
true
;
info
.
consignee
===
''
?
$consignee
.
next
().
show
()
:
$consignee
.
next
().
hide
();
...
...
@@ -72,7 +72,7 @@ $(function () {
},
// 拼接一条数据的html
getHtml
:
function
(
info
)
{
getHtml
:
function
(
info
)
{
var
html
=
'<tr class="table-body">'
;
html
+=
'<input type="hidden" id="tr_'
+
info
.
address_id
+
'" value="'
+
info
.
address_id
+
'">'
+
...
...
@@ -90,7 +90,7 @@ $(function () {
},
// 获取一条数据
setInfo
:
function
(
id
,
td
)
{
setInfo
:
function
(
id
,
td
)
{
$addressId
.
val
(
id
);
$consignee
.
val
(
td
.
eq
(
0
).
text
());
$address
.
val
(
td
.
eq
(
2
).
text
());
...
...
@@ -99,7 +99,7 @@ $(function () {
},
// 设置表格头部
setTableTile
:
function
()
{
setTableTile
:
function
()
{
$
(
'.table-title'
).
text
(
'已保存了'
+
currentLength
+
'条地址,还能保存'
+
leftLength
+
'条地址'
);
}
...
...
@@ -107,7 +107,7 @@ $(function () {
// 保存收货地址
$
(
document
).
on
(
'click'
,
'#save-address'
,
function
()
{
$
(
document
).
on
(
'click'
,
'#save-address'
,
function
()
{
var
info
,
area
,
areaInfo
;
...
...
@@ -132,7 +132,7 @@ $(function () {
url
:
'/me/address/add'
,
dataType
:
'json'
,
data
:
info
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
var
html
;
if
(
data
.
code
===
200
)
{
...
...
@@ -154,7 +154,7 @@ $(function () {
url
:
'/me/address/update'
,
dataType
:
'json'
,
data
:
info
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
===
200
)
{
info
.
mobile
=
info
.
mobile
.
substring
(
0
,
3
)
+
'****'
+
info
.
mobile
.
substring
(
7
,
11
);
info
.
address_id
=
info
.
id
;
...
...
@@ -171,7 +171,7 @@ $(function () {
});
// 修改收货地址
$
(
document
).
on
(
'click'
,
'.update-address'
,
function
()
{
$
(
document
).
on
(
'click'
,
'.update-address'
,
function
()
{
var
id
=
$
(
this
).
data
(
'id'
);
var
tr
=
$
(
this
).
parents
(
'.table-body'
);
var
td
=
tr
.
find
(
'td'
);
...
...
@@ -185,13 +185,13 @@ $(function () {
});
// 删除收货地址
$
(
document
).
on
(
'click'
,
'.del-address'
,
function
()
{
$
(
document
).
on
(
'click'
,
'.del-address'
,
function
()
{
var
id
=
$
(
this
).
data
(
'id'
);
var
tr
=
$
(
this
).
parents
(
'.table-body'
);
var
a
=
new
_confirm
({
content
:
'您确定要删除收货地址吗?'
,
cb
:
function
()
{
cb
:
function
()
{
$
.
ajax
({
type
:
'POST'
,
url
:
'/me/address/del'
,
...
...
@@ -199,7 +199,7 @@ $(function () {
data
:
{
id
:
id
},
success
:
function
()
{
success
:
function
()
{
currentLength
--
;
leftLength
++
;
tr
.
remove
();
...
...
@@ -214,7 +214,7 @@ $(function () {
});
// 设置默认收货地址
$
(
document
).
on
(
'click'
,
'.set-default'
,
function
()
{
$
(
document
).
on
(
'click'
,
'.set-default'
,
function
()
{
var
tr
=
$
(
this
).
parents
(
'.table-body'
);
var
tbody
=
tr
.
parent
();
var
id
=
$
(
this
).
data
(
'id'
);
...
...
@@ -227,7 +227,7 @@ $(function () {
data
:
{
id
:
id
},
success
:
function
()
{
success
:
function
()
{
$
(
'.current-default'
).
removeClass
(
'current-default'
).
text
(
'设为默认'
);
$
(
self
).
addClass
(
'current-default'
).
text
(
'默认地址'
);
tbody
.
find
(
'.table-body'
).
eq
(
0
).
before
(
'<tr class=\'table-body\'>'
+
tr
.
html
()
+
'</tr>'
);
...
...
public/js/product/shop.page.js
View file @
648bf25
...
...
@@ -2,9 +2,8 @@ var lazyload = require('yoho-jquery-lazyload');
var
tplFn
=
require
(
'../../tpl/product/shop-goods.hbs'
);
// require('../common/header');
// require('./list/favorite');
require
(
'../common/header'
);
require
(
'./list/favorite'
);
lazyload
();
...
...
public/scss/me/order/_table.css
View file @
648bf25
...
...
@@ -23,7 +23,8 @@
color
:
#fff
;
}
.good-name-text
:hover
{
.good-name-text
:hover
,
.check-detail
:hover
{
text-decoration
:
underline
;
}
...
...
public/tpl/product/shop-goods.hbs
View file @
648bf25
{{#
each
products
}}
<div
class=
"goods-info"
data-skn=
"
{{
productSkn
}}
"
>
<a
href=
"
{{
url
}}
"
target=
"_blank"
>
<img
class=
"lazy thumb"
src=
"
{{
defaultImages
}}
"
style=
"display: block;"
>
<a
href=
"
{{
this
.
url
}}
"
target=
"_blank"
>
<img
class=
"lazy thumb"
src=
"
{{
defaultImages
}}
"
>
</a>
<div
class=
"desc"
>
<a
class=
"name"
href=
"
{{
url
}}
"
target=
"_blank"
>
{{
productName
}}
</a>
<a
class=
"name"
href=
"
{{
this
.
url
}}
"
target=
"_blank"
>
{{
productName
}}
</a>
<p
class=
"price"
>
¥
{{
salesPrice
}}
</p>
</div>
</div>
...
...
Please
register
or
login
to post a comment