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
郝肖肖
8 years ago
Commit
3342b4d8e1206dcc50d9dfd5a78b294e91f20168
2 parents
009a5af9
637338a7
merage feature balancePage
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
349 additions
and
151 deletions
apps/me/controllers/address.js
apps/me/models/address.js
apps/me/models/order.js
apps/me/views/partial/order/detail/info-box.hbs
apps/shopping/controllers/order.js
apps/shopping/models/order.js
apps/shopping/router.js
apps/shopping/views/action/order.hbs
apps/shopping/views/partial/cart/cart-list-body.hbs
apps/shopping/views/partial/order/yoho-coin.hbs
config/common.js
public/js/shopping/cart/cart.js
public/js/shopping/order.page.js
public/js/shopping/order/invoice.js
public/scss/me/order/_detail.css
public/scss/shopping/_cart-products.css
public/scss/shopping/_order.css
public/scss/shopping/_statement.css
public/tpl/shopping/address-list.hbs
public/tpl/shopping/cart-content.hbs
public/tpl/shopping/checked-invoice-show.hbs
public/tpl/shopping/yoho-coin.hbs
apps/me/controllers/address.js
View file @
3342b4d
...
...
@@ -65,6 +65,8 @@ const getAddressList = (req, res, next) => {
_
.
each
(
result
.
data
,
(
d
)
=>
{
d
.
address_id
=
crypto
.
encryption
(
config
.
crypto
.
common
,
d
.
address_id
+
''
);
d
.
address
=
cleanHtml
.
htmlDecode
(
d
.
address
);
d
.
complete_mobile
=
d
.
mobile
;
d
.
mobile
=
d
.
mobile
.
substr
(
0
,
3
)
+
'****'
+
d
.
mobile
.
substr
(
7
);
});
defaultAd
&&
(
defaultAd
.
focus
=
true
);
...
...
apps/me/models/address.js
View file @
3342b4d
...
...
@@ -17,7 +17,7 @@ const api = global.yoho.API;
*/
const
getAddressDataAsync
=
(
uid
,
limit
)
=>
{
return
api
.
get
(
''
,
{
method
:
'app.address.get
hidden
'
,
method
:
'app.address.get'
,
uid
:
uid
,
limit
:
limit
}).
then
(
result
=>
{
...
...
apps/me/models/order.js
View file @
3342b4d
...
...
@@ -68,8 +68,8 @@ const btnMap = {
};
const
invoiceText
=
{
1
:
'纸质'
,
2
:
'电子'
1
:
'纸质发票'
,
2
:
'电子发票'
};
...
...
@@ -525,7 +525,7 @@ const getOrderDetail = (uid, code) => {
_
.
forEach
(
detail
.
btns
,
btn
=>
{
if
(
btn
.
isPayBtn
)
{
btn
.
payUrl
=
helpers
.
urlFormat
(
'/shopping/pay/online'
,
{
code
:
detail
.
order
C
ode
code
:
detail
.
order
_c
ode
});
}
});
...
...
@@ -548,6 +548,7 @@ const getOrderDetail = (uid, code) => {
if
(
detail
.
invoice
)
{
detail
.
invoice
.
typeText
=
invoiceText
[
detail
.
invoice
.
type
];
detail
.
invoice
.
pdfUrl
=
detail
.
invoice
.
showInvoice
&&
detail
.
invoice
.
pdfUrl
?
detail
.
invoice
.
pdfUrl
:
''
;
}
else
{
detail
.
invoice
=
false
;
}
...
...
apps/me/views/partial/order/detail/info-box.hbs
View file @
3342b4d
...
...
@@ -19,7 +19,12 @@
<h4
class=
"status-title"
>
发票信息
</h4>
{{#
invoice
}}
{{#if
typeText
}}
<p
class=
"text"
>
发票类型:
{{
typeText
}}
</p>
<p
class=
"text"
>
发票类型:
{{
typeText
}}
{{#if
pdfUrl
}}
<a
class=
"btn white invoice-down"
href=
"
{{
pdfUrl
}}
"
>
电子发票下载
</a>
{{/if}}
</p>
{{/if}}
{{#if
title
}}
<p
class=
"text"
>
发票抬头:
{{
title
}}
</p>
...
...
apps/shopping/controllers/order.js
View file @
3342b4d
...
...
@@ -83,7 +83,7 @@ const index = (req, res, next) => {
// 订单金额计算
const
compute
=
(
req
,
res
,
next
)
=>
{
orderModel
.
compute
(
req
.
user
.
uid
,
req
.
quer
y
.
coin
).
then
(
result
=>
{
orderModel
.
compute
(
req
.
user
.
uid
,
req
.
bod
y
.
coin
).
then
(
result
=>
{
res
.
send
(
result
);
}).
catch
(
next
);
};
...
...
apps/shopping/models/order.js
View file @
3342b4d
...
...
@@ -23,6 +23,29 @@ const _orderApi = uid => api.get('', {
});
/**
* 计算有货币可用数量
* @param uid [int] user id
*/
const
_yohoCoinPayRule
=
data
=>
{
if
(
!
data
.
total_yoho_coin_num
)
{
return
data
;
}
data
.
yoho_coin_num
=
_
.
round
(
data
.
yoho_coin
*
100
);
data
.
yoho_coin
=
data
.
yoho_coin
.
toFixed
(
2
);
data
.
yoho_msg
=
''
;
if
(
data
.
total_yoho_coin_num
<
100
)
{
data
.
yoho_msg
=
`抱歉,您的有货币不足,有货币满
$
{
data
.
yoho_coin_pay_rule
.
num_limit
}
个方可使用`
;
}
else
if
(
data
.
yoho_coin_num
<=
0
)
{
data
.
yoho_msg
=
'抱歉,您的订单实付款不满足有货币使用条件'
;
}
return
data
;
};
/**
* 结算页面
* @param uid [int] user id
*/
...
...
@@ -54,7 +77,8 @@ const index = uid => {
}
});
theData
.
yoho_coin
=
_
.
round
(
theData
.
yoho_coin
*
100
);
// 有货币稀释(round浮点精度问题)
// 计算有货币使用
Object
.
assign
(
theData
,
_yohoCoinPayRule
(
theData
));
shopping
.
balanceCoin
=
theData
.
use_yoho_coin
;
...
...
@@ -115,7 +139,14 @@ const compute = (uid, yohoCoin) => {
coin
=
yohoCoin
/
100
;
}
return
_computeApi
(
uid
,
deliveryWay
,
paymentType
,
coin
).
then
(
result
=>
result
);
return
_computeApi
(
uid
,
deliveryWay
,
paymentType
,
coin
).
then
(
result
=>
{
if
(
result
.
code
===
200
)
{
Object
.
assign
(
result
.
data
,
_yohoCoinPayRule
(
result
.
data
));
}
return
result
;
});
};
/**
...
...
@@ -146,10 +177,17 @@ const _submit = (uid, other) => {
payment_type
:
other
.
payment_type
};
if
(
other
.
invoices_type
&&
parseInt
(
other
.
invoices_type
,
10
)
===
2
)
{
Object
.
assign
(
apiParms
,
{
receiverMobile
:
other
.
invoices_mobile
});
}
if
(
other
.
invoices_title
)
{
Object
.
assign
(
apiParms
,
{
invoices_type
:
other
.
invoices_type
,
invoices_title
:
other
.
invoices_title
,
invoice
s_type_id
:
other
.
invoices_type_id
invoice
_content
:
other
.
invoice_content
});
}
...
...
apps/shopping/router.js
View file @
3342b4d
...
...
@@ -27,7 +27,7 @@ router.get('/cart/data', cartCtrl.getCartData);
// 结算
router
.
get
(
'/order'
,
auth
,
order
.
index
);
router
.
ge
t
(
'/order/compute'
,
auth
,
order
.
compute
);
router
.
pos
t
(
'/order/compute'
,
auth
,
order
.
compute
);
router
.
post
(
'/order/submit'
,
auth
,
order
.
orderSub
);
// 支付
...
...
apps/shopping/views/action/order.hbs
View file @
3342b4d
...
...
@@ -135,21 +135,7 @@
<span
class=
"coin-ctrl"
>
使用有货币
</span>
</p>
<div
class=
"content hide"
>
<div
class=
"using-coin"
>
本次使用有货币
<input
id=
"input-coin"
class=
"input coin-input"
type=
"text"
data-max=
"
{{
yoho_coin
}}
"
>
个
您当前共有有货币
<em
class=
"blue"
>
{{
yoho_coin
}}
</em>
个
<span
id=
"coin-tip"
class=
"coin-tip block blue vhide"
>
抵扣¥
<em
class=
"balance-coin"
></em></span>
<span
id=
"coin-sure"
class=
"btn disable"
>
确定
</span>
</div>
<div
class=
"used-coin hide"
>
本次使用有货币
<em
id=
"coin-used"
class=
"blue"
></em>
个,本次抵扣
<span
class=
"blue"
>
¥
<em
id=
"coin-deduction"
></em></span>
<span
class=
"btn white modify"
>
修改
</span>
<span
class=
"btn white cancel"
>
取消使用
</span>
</div>
{{>
order
/
yoho-coin
}}
</div>
</div>
<div
class=
"remark"
>
...
...
@@ -215,10 +201,20 @@
<script
id=
"invoice-dialog-tpl"
type=
"text/html"
>
<p class="dialog-title">发票信息</p>
<ul class="invoice-tab">
<li class="btn paper-invoice">纸质发票</li>
<li class="btn paper-invoice" data-type=2>电子发票</li>
<li class="btn paper-invoice white" data-type=1>纸质发票</li>
</ul>
<div class="invoice-entity el">
<div class="row clearfix electron-group receipt-depict electron-group">
<div>
※ 电子发票是税务局认可的有效凭证,其法律效力、基本用途及使用规定同纸质发票,<br />
如需纸质发票可自行下载打印。
</div>
<div class="receipt-desc">
<a href="/help?category_id=99" target="_blank">什么是电子发票</a>
</div>
</div>
<div class="row clearfix">
<span class="label">
<em class="required-mark">*</em>
...
...
@@ -258,8 +254,24 @@
</div>
</div>
</div>
<div class="row clearfix electron-group">
<span class="label">
<em class="required-mark">*</em>
收票人手机:
</span>
<div class="row-content">
<div class="invoice-content-radio-group">
<input value="
{{
invoice_mobile
}}
" class='input invoice-mobile' type="
text
" maxlength="
11
" placeholder="
请填写收票人手机
">
<span class="
input
-
tip
invoice
-
mobile
-
tip
blue
hide
">
<span class="
iconfont
"
>&
#
xe60c
;
<
/span
>
请输入正确的手机号
<
/span
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
</script>
</div>
{{/
content
}}
</div>
...
...
apps/shopping/views/partial/cart/cart-list-body.hbs
View file @
3342b4d
...
...
@@ -108,10 +108,13 @@
{{#
if
invalidPros
}}
<div
class=
"cart-pro-list invalid-pros"
>
<div
class=
"title"
>
<span
class=
"main"
>
失效商品
</span>
</div>
<div
class=
"pro-list"
>
{{#
each
invalidPros
}}
<ul>
<li
class=
"chk"
data-product_info=
'{"goods_type": "invalid", "buy_number":
{{
buy_number
}}
, "selected": "
{{
selected
}}
", "product_sku": "
{{
product_sku
}}
", "promotion_id": 0}'
>
<li
class=
"chk"
data-product_info=
'{"goods_type": "invalid", "buy_number":
{{
buy_number
}}
, "selected": "
{{
selected
}}
", "product_sku": "
{{
product_sku
}}
", "promotion_id": 0}'
title=
"失效"
>
<span
class=
"iconfont warning"
>

</span>
</li>
<li>
...
...
apps/shopping/views/partial/order/yoho-coin.hbs
0 → 100644
View file @
3342b4d
<p
id=
"coin-tip"
class=
"blue"
>
{{
yoho_msg
}}
</p>
<div>
有货币满
<em
class=
"blue"
>
{{
yoho_coin_pay_rule
.
num_limit
}}
</em>
个即可使用,每次使用有货币为
<em
class=
"blue"
>
{{
yoho_coin_pay_rule
.
num_limit
}}
</em>
的整数倍
<span
class=
"yoho-coin-help"
>
?
<span
class=
"coin-help-dialog hide"
>
<span
class=
"arrow-left"
></span>
<div
class=
"coin-dialog-title"
>
有货币使用条件:
</div>
<div
class=
"coin-dialog-content"
>
<p>
(1)订单金额大于20元(含20元)
</p>
<p>
(2)有货币数量大于
{{
yoho_coin_pay_rule
.
num_limit
}}
个(含
{{
yoho_coin_pay_rule
.
num_limit
}}
个)
</p>
<p>
(3)每笔支付不得超过应付金额的
{{
yoho_coin_pay_rule
.
max_pay_rate_desc
}}
</p>
<p>
备注:使用有货币数量为
{{
yoho_coin_pay_rule
.
num_limit
}}
的整数倍,
<br
/>
100个有货币抵1元。
</p>
</div>
</span>
</span>
</div>
<div>
您当前共有有货币
<em
class=
"blue"
>
{{
total_yoho_coin_num
}}
</em>
个,可用
<em
class=
"blue"
>
{{
yoho_coin_num
}}
</em>
个
</div>
<div>
本次使用有货币
<em
class=
"blue"
>
{{
yoho_coin_num
}}
</em>
个 抵扣
<em
class=
"blue"
>
¥
{{
yoho_coin
}}
</em></div>
<div>
<span
id=
"coin-sure"
class=
"btn
{{#
unless
yoho_coin_num
}}
disable
{{/
unless
}}
"
data-yoho_coin_num=
"
{{
yoho_coin_num
}}
"
>
确定
</span>
<span
class=
"btn white cancel"
>
取消
</span>
</div>
\ No newline at end of file
...
...
config/common.js
View file @
3342b4d
...
...
@@ -23,25 +23,14 @@ module.exports = {
cookieDomain
:
'yohoblk.com'
,
domains
:
{
// singleApi: 'http://single.yoho.cn/',
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// search: 'http://search.yohoops.org/yohosearch/'
// singleApi: 'http://single.yoho.cn/',
// api: 'http://api.yoho.yohoops.org/',
// service: 'http://service.yoho.yohoops.org/',
// search: 'http://search.yohoops.org/yohosearch/'
// api: 'http://dev-api.yohops.com:9999/',
// service: 'http://dev-service.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test1.yohops.com:9999/'
api
:
'http://api-test3.yohops.com:9999/'
,
service
:
'http://service-test3.yohops.com:9999/'
,
liveApi
:
'http://testapi.live.yohops.com:9999/'
,
singleApi
:
'http://api-test3.yohops.com:9999/'
,
liveApi
:
'http://testapi.live.yohops.com:9999/'
,
search
:
'http://search.yohoops.org/yohosearch/'
},
useOneapm
:
false
,
...
...
public/js/shopping/cart/cart.js
View file @
3342b4d
...
...
@@ -584,7 +584,7 @@ Cart = {
var
invalidEles
;
var
products
=
[];
var
dialog
=
new
_confirm
({
content
:
'
您确定要清除失效商品吗?
'
,
content
:
'
<p style="font-size:25px;margin-bottom:20px;">清除失效商品</p><p>确定要清除失效商品吗?</p>
'
,
cb
:
function
()
{
dialog
.
close
();
...
...
public/js/shopping/order.page.js
View file @
3342b4d
...
...
@@ -14,26 +14,14 @@ var minusPlus = {
plus
:
''
};
var
$coin
=
$
(
'#input-coin'
),
$coinTip
=
$
(
'#coin-tip'
),
$coinSure
=
$
(
'#coin-sure'
),
$coinUsed
=
$
(
'#coin-used'
),
$coinDeduction
=
$
(
'#coin-deduction'
),
coinMax
=
+
$coin
.
data
(
'max'
),
coinStatus
=
{
err
:
'请输入一个正整数'
,
max
:
'您的有货币不足'
,
success
:
'抵扣¥'
,
maxUse
:
'您最多使用'
,
muPostfix
:
'个有货币'
};
var
$balanceCost
=
$
(
'#balance-cost'
);
var
$printPrice
=
$
(
'#print-price'
);
var
$invoice
=
$
(
'#invoice-content'
);
var
balanceTpl
=
require
(
'../../tpl/shopping/balance.hbs'
);
var
$coinRemarkContent
=
$
(
'.coin-and-remark .coin .content'
);
var
balanceTpl
=
require
(
'../../tpl/shopping/balance.hbs'
),
yohoCoinTpl
=
require
(
'../../tpl/shopping/yoho-coin.hbs'
);
var
pkgCache
=
{};
...
...
@@ -140,57 +128,9 @@ $('.coin-ctrl, .remark-ctrl').click(function() {
$this
.
parent
(
'.title'
).
siblings
(
'.content'
).
toggleClass
(
'hide'
);
});
// 使用有货币输入框联动
$coin
.
on
(
'propertychange input'
,
function
()
{
var
c
=
$
.
trim
(
$coin
.
val
());
var
err
=
true
;
if
(
c
===
''
)
{
// 输入框为空,确定按钮不可点
$coinTip
.
addClass
(
'vhide'
);
$coinSure
.
addClass
(
'disable'
);
return
;
}
else
if
(
!
/^
[
1-9
]\d
*$/
.
test
(
c
))
{
// 验证输入不为正整数
$coinTip
.
text
(
coinStatus
.
err
);
}
else
if
(
+
c
>
coinMax
)
{
// 有货币不足
$coinTip
.
text
(
coinStatus
.
max
);
}
else
if
(
+
c
>
$balanceCost
.
data
(
'cost'
)
*
100
)
{
// 输入的有货币大于订单额度
$coinTip
.
text
(
coinStatus
.
maxUse
+
(
$balanceCost
.
data
(
'cost'
)
*
100
)
+
coinStatus
.
muPostfix
);
}
else
{
err
=
false
;
$coinTip
.
text
(
coinStatus
.
success
+
(
c
/
100
).
toFixed
(
2
));
// 已使用面板的数据显示更新
$coinUsed
.
html
(
c
);
$coinDeduction
.
html
((
c
/
100
).
toFixed
(
2
));
}
if
(
err
)
{
$coinSure
.
addClass
(
'disable'
);
$coinTip
.
removeClass
(
'vhide'
);
}
else
{
$coinSure
.
removeClass
(
'disable'
);
$coinTip
.
addClass
(
'vhide'
);
}
});
/**
* 切换使用有货币面板显示
*/
function
toggleCoinPanel
()
{
$
(
'.using-coin, .used-coin'
).
toggleClass
(
'hide'
);
}
function
compute
(
coin
)
{
$
.
ajax
({
type
:
'
GE
T'
,
type
:
'
POS
T'
,
url
:
'/shopping/order/compute'
,
data
:
{
coin
:
coin
...
...
@@ -204,46 +144,18 @@ function compute(coin) {
cost
=
cost
.
toFixed
(
2
);
$
(
'#balance-list'
).
html
(
balanceTpl
(
data
.
data
));
$coinRemarkContent
.
html
(
yohoCoinTpl
(
data
.
data
));
}
});
}
// 获取已使用的有货币
function
getCoinUsed
()
{
var
coin
=
$
coinUsed
.
text
()
;
var
coin
=
$
(
'.coin-and-remark'
).
find
(
'#coin-sure'
).
data
(
'yoho_coin_num'
)
||
0
;
return
coin
===
''
?
0
:
parseInt
(
coin
,
10
);
// 使用parseInt可以排除异常情况的转化影响
}
$coinSure
.
click
(
function
()
{
if
(
$coinSure
.
hasClass
(
'disable'
))
{
return
;
}
suredCoin
=
getCoinUsed
();
// 切换显示
compute
(
suredCoin
);
toggleCoinPanel
();
});
$
(
'.used-coin'
).
on
(
'click'
,
'.modify'
,
function
()
{
toggleCoinPanel
();
}).
on
(
'click'
,
'.cancel'
,
function
()
{
$coin
.
val
(
''
).
trigger
(
'input'
);
// reset used coin panel show
$coinUsed
.
html
(
'0'
);
$coinDeduction
.
html
(
'0'
);
compute
(
0
);
// 隐藏有货币面板并重置子面板显示
$
(
'.coin-ctrl.iconfont'
).
trigger
(
'click'
);
toggleCoinPanel
();
});
// 添加备注-是否打印价格
$printPrice
.
printPrice
=
'N'
;
// 默认为false
...
...
@@ -273,8 +185,10 @@ $('#balance-list').on('click', '#submit-order', function() {
$invoiceDetail
=
$invoice
.
find
(
'.invoice-detail'
);
$
.
extend
(
reqParam
,
{
invoices_type
:
$invoiceDetail
.
data
(
'type'
),
invoices_mobile
:
$invoiceDetail
.
data
(
'mobile'
),
invoices_title
:
$invoiceDetail
.
data
(
'title'
),
invoice
s_type_id
:
$invoiceDetail
.
data
(
'content'
)
invoice
_content
:
$invoiceDetail
.
data
(
'content'
)
});
}
...
...
@@ -290,3 +204,33 @@ $('#balance-list').on('click', '#submit-order', function() {
}
});
});
$coinRemarkContent
.
on
(
'mouseover mouseout'
,
'.yoho-coin-help'
,
function
(
event
)
{
if
(
event
.
type
===
'mouseover'
)
{
$
(
'.coin-help-dialog'
).
removeClass
(
'hide'
);
}
else
if
(
event
.
type
===
'mouseout'
)
{
$
(
'.coin-help-dialog'
).
addClass
(
'hide'
);
}
}).
on
(
'click'
,
'#coin-sure'
,
function
()
{
// 确定有货币按钮
if
(
$
(
this
).
hasClass
(
'disable'
))
{
return
;
}
suredCoin
=
getCoinUsed
();
// 切换显示
compute
(
suredCoin
);
// 隐藏有货币面板并重置子面板显示
$
(
'.coin-ctrl.iconfont'
).
trigger
(
'click'
);
}).
on
(
'click'
,
'.cancel'
,
function
()
{
// 取消有货币按钮
suredCoin
=
0
;
compute
(
suredCoin
);
// 隐藏有货币面板并重置子面板显示
$
(
'.coin-ctrl.iconfont'
).
trigger
(
'click'
);
});
...
...
public/js/shopping/order/invoice.js
View file @
3342b4d
...
...
@@ -11,7 +11,8 @@ var checkedInvoiceTpl = require('../../../tpl/shopping/checked-invoice-show.hbs'
var
$invoiceContent
=
$
(
'#invoice-content'
);
var
$invoiceTitleInput
;
var
$invoiceTitleInput
,
$invoiceMobile
;
require
(
'yoho-jquery-placeholder'
);
...
...
@@ -19,6 +20,7 @@ require('yoho-jquery-placeholder');
function
validateInvoice
(
$el
)
{
var
pass
=
true
;
var
name
=
$
.
trim
(
$el
.
find
(
'.invoice-title-input'
).
val
());
var
mobile
=
$
.
trim
(
$invoiceMobile
.
val
());
// 发票抬头为单位
if
(
$el
.
invoiceTitleType
===
2
&&
name
===
''
)
{
...
...
@@ -26,6 +28,13 @@ function validateInvoice($el) {
$el
.
find
(
'.invoice-title-tip'
).
removeClass
(
'hide'
);
}
if
(
$el
.
invoiceType
===
2
&&
$
(
'#address-list li.address.focus'
).
data
(
'mobile'
)
!==
mobile
)
{
if
(
!
/
[
1
][
34578
][
0-9
]{9}
/
.
test
(
mobile
))
{
pass
=
false
;
$el
.
find
(
'.invoice-mobile-tip'
).
removeClass
(
'hide'
);
}
}
return
pass
;
}
...
...
@@ -40,10 +49,26 @@ function invoiceDialogFactory() {
btnClass
:
[
'save-invoice'
],
name
:
'保存发票信息'
,
cb
:
function
()
{
var
$el
=
invoice
.
$el
;
var
$el
=
invoice
.
$el
,
$addressFocus
;
var
mobile
=
''
,
invoiceMobile
;
if
(
validateInvoice
(
$el
))
{
if
(
$el
.
invoiceType
===
2
)
{
$addressFocus
=
$
(
'#address-list li.address.focus'
);
invoiceMobile
=
$invoiceMobile
.
val
();
mobile
=
$addressFocus
.
data
(
'mobile'
)
!==
invoiceMobile
?
invoiceMobile
:
$addressFocus
.
data
(
'complete-mobile'
);
}
$invoiceContent
.
html
(
checkedInvoiceTpl
({
invoiceType
:
$el
.
invoiceType
,
invoiceMobile
:
mobile
,
invoiceTypeName
:
$el
.
invoiceTypeName
,
invoiceTitle
:
$el
.
invoiceTitleType
===
1
?
'个人'
:
$invoiceTitleInput
.
val
(),
content
:
$el
.
invoiceContent
,
invoiceContent
:
$el
.
find
(
'.invoice-content-radio .checked'
).
next
(
'label'
).
text
(),
...
...
@@ -81,28 +106,62 @@ function showInvoiceDialog() {
var
invoiceTitleType
=
1
,
invoiceContent
=
$
(
'.invoice-content-radio'
).
first
().
data
(
'value'
);
var
title
;
var
title
,
mobile
=
$
(
'#address-list li.address.focus'
).
data
(
'complete-mobile'
)
||
''
,
invoiceTypeName
=
'电子发票'
,
invoiceType
=
2
;
$invoiceTitleInput
=
$
(
'.yoho-dialog.invoice .invoice-title-input'
);
$invoiceMobile
=
$
(
'.yoho-dialog.invoice .invoice-mobile'
);
// 电子、纸质发票切换
$
(
'.invoice-tab li'
).
unbind
(
'click'
).
bind
(
'click'
,
function
()
{
var
$electronGroup
=
$
(
'.electron-group'
);
$
(
this
).
removeClass
(
'white'
).
siblings
(
'li'
).
addClass
(
'white'
);
dialog
.
$el
.
invoiceType
=
$
(
this
).
data
(
'type'
);
dialog
.
$el
.
invoiceTypeName
=
$
(
this
).
text
();
// 纸质
if
(
$
(
this
).
data
(
'type'
)
===
1
)
{
$electronGroup
.
addClass
(
'hide'
);
}
else
{
$electronGroup
.
removeClass
(
'hide'
);
}
});
if
(
isEditInvoice
)
{
title
=
$invoceDetail
.
data
(
'title'
);
invoiceType
=
$invoceDetail
.
data
(
'type'
)
||
2
;
invoiceTitleType
=
title
===
'个人'
?
1
:
2
;
invoiceContent
=
$invoceDetail
.
data
(
'content'
);
if
(
invoiceTitleType
===
2
)
{
$invoiceTitleInput
.
removeClass
(
'hide'
).
val
(
title
);
}
// 初始化电子、纸质tab
if
(
invoiceType
===
1
)
{
$
(
'.invoice-tab li:eq(1)'
).
trigger
(
'click'
);
invoiceType
=
1
;
invoiceTypeName
=
'纸质发票'
;
}
else
{
$
(
'.invoice-tab li:eq(0)'
).
trigger
(
'click'
);
mobile
=
$invoceDetail
.
data
(
'mobile'
);
}
}
// 设置默认收货地址手机号
$invoiceMobile
.
val
(
mobile
.
toString
().
substr
(
0
,
3
)
+
'****'
+
mobile
.
toString
().
substr
(
7
));
// 设置radio选中
$
(
'[data-value='
+
invoiceTitleType
+
'].invoice-title-radio'
).
find
(
'.radio'
).
addClass
(
'checked'
);
$
(
'[data-value='
+
invoiceContent
+
'].invoice-content-radio'
).
find
(
'.radio'
).
addClass
(
'checked'
);
// 存储发票参数
$
.
extend
(
dialog
.
$el
,
{
invoiceType
:
invoiceType
,
invoiceTypeName
:
invoiceTypeName
,
invoiceTitleType
:
invoiceTitleType
,
invoiceContent
:
invoiceContent
});
...
...
@@ -160,3 +219,4 @@ $invoiceContent.on('click', '.invoice-radio', function() {
}).
on
(
'click'
,
'.modify-invoice'
,
function
()
{
showInvoiceDialog
();
});
...
...
public/scss/me/order/_detail.css
View file @
3342b4d
...
...
@@ -5,7 +5,6 @@
line-height
:
40px
;
text-align
:
center
;
background
:
#f4fbff
;
margin-bottom
:
$
space
;
border
:
1px
solid
$
borderColor
;
...
...
@@ -67,6 +66,7 @@
.order-status
{
$
basicHeight
:
90px
;
border-top
:
1px
solid
$
borderColor
;
border-bottom
:
1px
solid
$
borderColor
;
position
:
relative
;
...
...
@@ -191,6 +191,7 @@
width
:
$
normalWidth
;
text-align
:
center
;
}
.first
{
width
:
calc
(
$
goodImgWidth
+
2
*
$
space
+
$
w
-
$
normalWidth
+
$
space
/
2
);
text-align
:
left
;
...
...
@@ -203,7 +204,6 @@
}
.goods-container
{
width
:
calc
(
$
w
+
3
*
$
normalWidth
);
.special-column
{
...
...
@@ -272,6 +272,17 @@
min-width
:
100px
;
}
}
.invoice-down
{
color
:
#d0021b
;
width
:
90px
;
margin-top
:
-24px
;
margin-left
:
170px
;
position
:
absolute
;
font-size
:
12px
;
font-weight
:
700
;
border
:
1px
solid
#e0e0e0
;
}
}
.status-title
{
...
...
@@ -285,7 +296,6 @@
.header
{
padding-right
:
$
space
;
}
.table-body
{
...
...
@@ -317,12 +327,13 @@
&
.time
{
width
:
30%
!important
;
}
&
.city
{
width
:
30%
!important
;
}
&
.action
{
width
:
40%
!important
;
}
}
}
...
...
public/scss/shopping/_cart-products.css
View file @
3342b4d
...
...
@@ -256,8 +256,6 @@ $hoverColor: #379ed6;
}
.invalid-pros
{
margin-top
:
80px
;
border-top
:
1px
solid
#eee
;
color
:
#999
;
input
{
...
...
public/scss/shopping/_order.css
View file @
3342b4d
...
...
@@ -602,6 +602,77 @@
padding
:
15px
20px
;
margin
:
20px
0
;
font-size
:
14px
;
>
div
{
margin-top
:
20px
;
&.first-child
{
margin-top
:
0
;
}
}
.yoho-coin-help
{
display
:
inline-block
;
background-color
:
#000
;
border-radius
:
16px
;
width
:
16px
;
height
:
16px
;
line-height
:
20px
;
text-align
:
center
;
color
:
#fff
;
font-size
:
14px
;
cursor
:
pointer
;
margin-left
:
20px
;
padding-right
:
1px
;
}
.coin-help-dialog
{
width
:
280px
;
position
:
absolute
;
background-color
:
#fff
;
margin-left
:
15px
;
color
:
#000
;
text-align
:
left
;
padding
:
10px
;
line-height
:
22px
;
border
:
1px
solid
#bbb
;
cursor
:
auto
;
margin-top
:
-10px
;
font-size
:
12px
;
}
.coin-dialog-title
{
font-weight
:
bold
;
}
.arrow-left
{
position
:
absolute
;
left
:
-9px
;
width
:
0
;
height
:
0
;
border-top
:
6px
solid
transparent
;
border-bottom
:
6px
solid
transparent
;
border-right
:
8px
solid
#bbb
;
&:before
{
content
:
""
;
border-top
:
6px
solid
transparent
;
border-bottom
:
6px
solid
transparent
;
border-right
:
8px
solid
#fff
;
left
:
2px
;
top
:
-6px
;
position
:
absolute
;
}
}
em
.blue
{
padding
:
0
2px
;
}
.btn
{
display
:
inline-block
;
margin-right
:
20px
;
}
}
.coin-input
{
...
...
@@ -773,6 +844,23 @@
width
:
520px
;
}
}
.receipt-depict
{
background-color
:
#f5f5f5
;
color
:
#444
;
font-size
:
14px
;
line-height
:
20px
;
width
:
100%
;
padding
:
20px
;
.receipt-desc
{
margin-top
:
20px
;
a
{
color
:
#3a3a3a
;
}
}
}
}
.address-confirm-dialog
{
...
...
public/scss/shopping/_statement.css
View file @
3342b4d
...
...
@@ -73,7 +73,7 @@
font-size
:
14px
;
color
:
#1b1b1b
;
font-weight
:
bold
;
margin
:
0
60px
0
224
px
;
margin
-left
:
85
px
;
}
.checkout-total
{
...
...
public/tpl/shopping/address-list.hbs
View file @
3342b4d
{{#
each
address
}}
<li
class=
"address
{{#
isY
is_default
}}
default
{{/
isY
}}{{#if
focus
}}
focus
{{/if}}
"
data-id=
"
{{
address_id
}}
"
data-name=
"
{{
consignee
}}
"
data-mobile=
"
{{
mobile
}}
"
data-phone=
"
{{
phone
}}
"
data-areacode=
"
{{
area_code
}}
"
data-area=
"
{{
area
}}
"
data-address=
"
{{
address
}}
"
>
data-phone=
"
{{
phone
}}
"
data-areacode=
"
{{
area_code
}}
"
data-area=
"
{{
area
}}
"
data-address=
"
{{
address
}}
"
data-complete-mobile=
"
{{
complete_mobile
}}
"
>
<div
class=
"address-header"
></div>
<div
class=
"address-content"
>
<p
class=
"default-or-not"
>
...
...
public/tpl/shopping/cart-content.hbs
View file @
3342b4d
...
...
@@ -221,6 +221,7 @@
</div>
<div
id=
"remove_selected"
class=
"action hoverable"
>
删除选中的商品
</div>
<div
id=
"send_favorite"
class=
"action hoverable"
>
移入收藏夹
</div>
<div
id=
"clear_invalid_all"
class=
"action hoverable"
>
清除失效商品
</div>
<div
class=
"selected-num"
>
已选
<span>
{{
selectedNum
}}
</span>
件
</div>
<div
class=
"checkout-total"
>
<div
class=
"total-title"
>
商品金额:
</div>
...
...
public/tpl/shopping/checked-invoice-show.hbs
View file @
3342b4d
...
...
@@ -7,8 +7,10 @@
<label>
发票开具
</label>
</div>
{{#if
invoiceTitle
}}
<p
class=
"invoice-detail"
data-title=
"
{{
invoiceTitle
}}
"
data-content=
"
{{
content
}}
"
>
<em>
{{
invoiceTitle
}}
</em><em>
{{
invoiceContent
}}
</em>
<p
class=
"invoice-detail"
data-title=
"
{{
invoiceTitle
}}
"
data-content=
"
{{
content
}}
"
data-type=
"
{{
invoiceType
}}
"
data-mobile=
"
{{
invoiceMobile
}}
"
>
<em>
{{
invoiceTypeName
}}
</em>
<em>
{{
invoiceTitle
}}
</em>
<em>
{{
invoiceContent
}}
</em>
<span
class=
"modify-invoice btn white"
>
修改
</span>
</p>
{{/if}}
\ No newline at end of file
...
...
public/tpl/shopping/yoho-coin.hbs
0 → 100644
View file @
3342b4d
<p
id=
"coin-tip"
class=
"blue"
>
{{
yoho_msg
}}
</p>
<div
data-yoho_coin_num=
"
{{
yoho_coin_num
}}
"
>
有货币满
<em
class=
"blue"
>
{{
yoho_coin_pay_rule
.
num_limit
}}
</em>
个即可使用,每次使用有货币为
<em
class=
"blue"
>
{{
yoho_coin_pay_rule
.
num_limit
}}
</em>
的整数倍
<span
class=
"yoho-coin-help"
>
?
<span
class=
"coin-help-dialog hide"
>
<span
class=
"arrow-left"
></span>
<div
class=
"coin-dialog-title"
>
有货币使用条件:
</div>
<div
class=
"coin-dialog-content"
>
<p>
(1)订单金额大于20元(含20元)
</p>
<p>
(2)有货币数量大于
{{
yoho_coin_pay_rule
.
num_limit
}}
个(含
{{
yoho_coin_pay_rule
.
num_limit
}}
个)
</p>
<p>
(3)每笔支付不得超过应付金额的
{{
yoho_coin_pay_rule
.
max_pay_rate_desc
}}
</p>
<p>
备注:使用有货币数量为
{{
yoho_coin_pay_rule
.
num_limit
}}
的整数倍,
<br
/>
100个有货币抵1元。
</p>
</div>
</span>
</span>
</div>
<div>
您当前共有有货币
<em
class=
"blue"
>
{{
total_yoho_coin_num
}}
</em>
个,可用
<em
class=
"blue"
>
{{
yoho_coin_num
}}
</em>
个
</div>
<div>
本次使用有货币
<em
class=
"blue"
>
{{
yoho_coin_num
}}
</em>
个 抵扣
<em
class=
"blue"
>
¥
{{
yoho_coin
}}
</em></div>
<div>
<span
id=
"coin-sure"
class=
"btn
{{#
unless
yoho_coin_num
}}
disable
{{/
unless
}}
"
data-yoho_coin_num=
"
{{
yoho_coin_num
}}
"
>
确定
</span>
<span
class=
"btn white cancel"
>
取消
</span>
</div>
\ No newline at end of file
...
...
Please
register
or
login
to post a comment