Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
2
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
uedxwg
9 years ago
Commit
89dd6a237fc5c1429866f79f099a4520a87eb4a8
1 parent
73485b3a
结算bug修改
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
180 additions
and
53 deletions
static/js/cart/order-ensure.js
static/sass/cart/_order-ensure.scss
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
static/js/cart/order-ensure.js
View file @
89dd6a2
...
...
@@ -20,7 +20,8 @@ var $invoice = $('.invoice'),
queryString
=
$
.
queryString
(),
orderInfo
=
order
.
orderInfo
,
isSubmiting
,
dispatchInfo
;
dispatchInfo
,
total
;
require
(
'../common'
);
...
...
@@ -78,16 +79,16 @@ if (queryString.cartType || queryString.carttype || !orderInfo('cartType')) {
orderInfo
(
'cartType'
,
queryString
.
cartType
||
queryString
.
carttype
||
'ordinary'
);
}
function
dispacthTapEvt
(
e
)
{
var
$cur
=
$
(
e
.
target
).
closest
(
'li'
);
// function dispacthTapEvt(e) {
// var $cur = $(e.target).closest('li');
if
(
$cur
.
length
===
0
||
$cur
.
hasClass
(
'chosed'
))
{
return
;
}
// if ($cur.length === 0 || $cur.hasClass('chosed')) {
// return;
// }
$cur
.
siblings
(
'li.chosed'
).
removeClass
(
'chosed'
);
$cur
.
addClass
(
'chosed'
);
}
// $cur.siblings('li.chosed').removeClass('chosed');
// $cur.addClass('chosed');
// }
$
(
'.checkbox'
).
on
(
'touchstart'
,
function
()
{
var
$this
=
$
(
this
);
...
...
@@ -128,7 +129,6 @@ function orderCompute() {
skuList
:
isLimitGood
()
?
orderInfo
(
'skuList'
)
:
undefined
}
}).
then
(
function
(
res
)
{
if
(
$
.
type
(
res
)
!==
'object'
)
{
window
.
location
.
reload
();
}
else
{
...
...
@@ -141,6 +141,18 @@ function orderCompute() {
$coinCheck
.
find
(
'em'
).
show
();
$coinUsed
.
show
();
}
total
=
''
;
if
(
res
.
promotion_formula_list
)
{
$
.
each
(
res
.
promotion_formula_list
,
function
(
index
,
value
)
{
total
+=
'<li>'
+
'<p>'
+
value
.
promotion
+
'</p>'
+
'<span>'
+
value
.
promotion_amount
+
'</span>'
+
'</li>'
;
});
$
(
'.price-cost span'
).
html
(
'¥'
+
res
.
last_order_amount
);
$
(
'.bill span'
).
html
(
'¥'
+
res
.
last_order_amount
);
$
(
'.total'
).
html
(
total
);
}
}
}).
fail
(
function
()
{
window
.
location
.
reload
();
...
...
@@ -231,17 +243,8 @@ if (!orderInfo('addressId')) {
}
$
(
'.dispatch-mode'
).
on
(
'touchend'
,
'li'
,
function
()
{
var
$defaultMode
=
$
(
'.dispatch-mode [data-id="1"]'
);
if
(
!
$addressWrap
.
data
(
'support'
)
&&
$
(
this
).
data
(
'id'
)
===
2
)
{
dispacthTapEvt
({
target
:
$defaultMode
});
tip
.
show
(
'当前地址不支持顺丰快递'
);
}
else
{
orderInfo
(
'deliveryId'
,
$
(
this
).
data
(
'id'
));
orderCompute
();
}
orderInfo
(
'deliveryId'
,
$
(
this
).
data
(
'id'
));
orderCompute
();
});
$
(
'.dispatch-time'
).
on
(
'touchend'
,
'li'
,
function
()
{
...
...
@@ -295,19 +298,23 @@ $('form').on('submit', function() {
// xwg 2016/3/21 13:22
$
(
'.dispatch'
).
on
(
'touchend'
,
'h3'
,
function
()
{
if
(
$
(
this
).
siblings
(
'ul'
).
find
(
'li'
).
length
===
1
)
{
return
false
;
}
if
(
$
(
this
).
siblings
(
'ul'
).
is
(
':hidden'
))
{
$
(
'.down'
).
removeClass
(
'hide'
);
$
(
'.up'
).
addClass
(
'hide'
);
$
(
'.up'
,
this
).
removeClass
(
'hide'
);
$
(
'.down'
,
this
).
addClass
(
'hide'
);
$
(
'.dispatch ul'
).
hide
();
$
(
this
).
siblings
(
'ul'
).
show
();
}
else
{
$
(
'.down'
,
this
).
removeClass
(
'hide'
);
$
(
'.up'
,
this
).
addClass
(
'hide'
);
$
(
this
).
siblings
(
'ul'
).
hide
();
}
});
$subBlock
.
on
(
'touchstart'
,
'li'
,
function
()
{
console
.
log
(
$
(
this
).
hasClass
(
'icon-radio'
));
$
.
each
(
$
(
this
).
parents
(
'ul'
).
find
(
'i'
),
function
()
{
$
(
this
).
parents
(
'ul'
).
find
(
'i'
).
removeClass
(
'icon-cb-radio'
).
addClass
(
'icon-radio'
);
});
...
...
@@ -323,7 +330,9 @@ $subBlock.on('touchstart', 'li', function() {
$
(
'.bill a'
).
on
(
'touchstart'
,
function
()
{
orderInfo
(
'paymentTypeId'
,
$
(
'.delivery-id .icon-cb-radio'
).
data
(
'id'
));
orderInfo
(
'paymentType'
,
$
(
'.delivery-time .icon-cb-radio'
).
data
(
'id'
));
orderInfo
(
'paymentType'
,
$
(
'.payment-type .icon-cb-radio'
).
data
(
'id'
));
payType
=
$
(
'.payment-type .icon-cb-radio'
).
data
(
'id'
);
submitOrder
();
});
...
...
static/sass/cart/_order-ensure.scss
View file @
89dd6a2
...
...
@@ -14,6 +14,14 @@
font-weight
:
bold
;
}
/*xwg 2016-3-19 10:53*/
.price-cost
{
span
{
color
:
#f00
;
}
}
.hide
{
display
:
none
!
important
;
}
.boys
{
background
:image-url
(
'shopping-cart/boys.png'
)
bottom
left
repeat-x
#fff
;
}
...
...
@@ -208,7 +216,7 @@
border-radius
:
10rem
/
$pxConvertRem
;
line-height
:
80rem
/
$pxConvertRem
;
text-align
:
center
;
font-size
:
4
0rem
/
$pxConvertRem
;
font-size
:
3
0rem
/
$pxConvertRem
;
}
}
...
...
@@ -256,28 +264,135 @@
// }
// }
.goods
{
margin-right
:
-20rem
/
$pxConvertRem
;
// .goods {
// margin-right: -20rem / $pxConvertRem;
.price-wrap
{
position
:
static
;
text-align
:
left
;
// .price-wrap {
// position: static;
// text-align: left;
.price
{
color
:
#444
;
}
// .price {
// color: #444;
// }
.count
{
display
:
inline
;
margin-left
:
20rem
/
$pxConvertRem
;
}
// .count {
// display: inline;
// margin-left: 20rem / $pxConvertRem;
// }
// }
// .name {
// max-width: pxToRem(400px);
// }
// }
.order-good
{
position
:
relative
;
padding
:
20rem
/
$pxConvertRem
0
;
margin-left
:
34rem
/
$pxConvertRem
;
height
:
160rem
/
$pxConvertRem
;
border-bottom
:
1px
solid
#e0e0e0
;
font-size
:
26rem
/
$pxConvertRem
;
&
:last-child
{
border-bottom
:
none
;
}
.thumb-wrap
{
position
:
relative
;
float
:
left
;
width
:
120rem
/
$pxConvertRem
;
height
:
160rem
/
$pxConvertRem
;
}
.thumb
{
width
:
100%
;
height
:
100%
;
}
.tag
{
position
:
absolute
;
bottom
:
0
;
left
:
0
;
right
:
0
;
color
:
#fff
;
text-align
:
center
;
font-size
:
12px
;
&
:before
{
display
:
block
;
line-height
:
1
;
@include
transform
(
scale
(
0
.833
));
}
}
.gift-tag
{
height
:
25rem
/
$pxConvertRem
;
background
:
#a1ce4e
;
&
:before
{
content
:
'赠品'
;
}
}
.advance-buy-tag
{
height
:
25rem
/
$pxConvertRem
;
background
:
#eb76aa
;
&
:before
{
content
:
'加价购'
;
}
}
.deps
{
margin-left
:
135rem
/
$pxConvertRem
;
}
.name
{
font-size
:
28rem
/
$pxConvertRem
;
max-width
:
70%
;
text-overflow
:
-
o-ellipsis-lastline
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
display
:
-
webkit-box
;
-webkit-line-clamp
:
2
;
-webkit-box-orient
:
vertical
;
}
.row
:nth-child
(
2
)
{
height
:
45rem
/
$pxConvertRem
;
line-height
:
45rem
/
$pxConvertRem
;
.name
{
max-width
:
pxToRem
(
400px
);
>
span
{
margin-right
:
15rem
/
$pxConvertRem
;
}
}
.color
,
.size
{
color
:
#b6b6b6
;
}
.price-wrap
{
position
:
absolute
;
top
:
20rem
/
$pxConvertRem
;
right
:
30rem
/
$pxConvertRem
;
text-align
:
right
;
}
.price
{
color
:
#e01
;
}
.count
{
display
:
block
;
color
:
#999
;
text-align
:
right
;
line-height
:
45rem
/
$pxConvertRem
;
}
.appear-date
{
color
:
#f00
;
}
}
.sale-invoice
{
margin-top
:
-20rem
/
$pxConvertRem
;
font-size
:
24rem
/
$pxConvertRem
;
...
...
template/m.yohobuy.com/actions/cart/index/order-ensure.phtml
View file @
89dd6a2
...
...
@@ -22,7 +22,8 @@
<h
3
>
<p>支付方式</p>
<span>在线支付
(推荐)</span>
<i
class=
"iconfont"
>
616
;</i>
<i
class=
"iconfont down"
>
616
;</i>
<i
class=
"iconfont hide up"
>
615
;</i>
</h
3
>
<ul>
{
{#each
paymentWay
}
}
...
...
@@ -36,14 +37,17 @@
<div
class=
"sub-block delivery-id"
>
<h
3
>
<p>配送方式</p>
<span>普通快递</span>
<i
class=
"iconfont"
>
616
;</i>
{
{#each
dispatchMode
}
}
{
{#if
isSelected
}
}<span>
{
{name
}
}</span>
{
{/if
}
}
{
{/each
}
}
<i
class=
"iconfont down"
>
616
;</i>
<i
class=
"iconfont hide up"
>
615
;</i>
</h
3
>
<ul>
<ul
class=
"dispatch-mode"
>
{
{#each
dispatchMode
}
}
<li
{
{#if
isSelected
}
}class=
"chosed"
{
{/if
}
}>
<li
{
{#if
isSelected
}
}class=
"chosed"
{
{/if
}
}
data-id=
"{{id}}"
>
<span>
{
{name
}
}</span>
<i
class=
"right iconfont {{#if isSelected}}icon-cb-radio{{else}}icon-radio{{/if}}"
data-id=
"{{id}}"
></i>
<i
class=
"right iconfont {{#if isSelected}}icon-cb-radio{{else}}icon-radio{{/if}}"
></i>
</li>
{
{/each
}
}
</ul>
...
...
@@ -52,7 +56,8 @@
<h
3
>
<p>送货时间</p>
<span>工作日、双休日和节假日均送货</span>
<i
class=
"iconfont"
>
616
;</i>
<i
class=
"iconfont down"
>
616
;</i>
<i
class=
"iconfont hide up"
>
615
;</i>
</h
3
>
<ul>
{
{#each
dispatchTime
}
}
...
...
@@ -65,11 +70,9 @@
</div>
</section>
<section
class=
"block"
style=
"margin-bottom: 0;"
>
<div
class=
"goods"
>
{
{#each
goods
}
}
{
{>
me/order/good
}
}
{
{/each
}
}
</div>
</section>
<div
class=
"goods-num"
>共
{
{num
}
}件商品
合计<span>¥
{
{price
}
}</span></div>
...
...
@@ -144,7 +147,7 @@
</form>
</section>
<section
class=
"price-cal block"
>
<ul>
<ul
class=
"total"
>
{
{#cartPayData
}
}
<li>
<p>
{
{promotion
}
}</p>
...
...
@@ -159,7 +162,7 @@
</section>
<div
class=
"bill"
>
您需要支付:<span>¥
{
{price
}
}</span>
<a
href=
"#"
>提交</a>
<a
href=
"#"
>提交
订单
</a>
</div>
{
{/
orderEnsure
}
}
</div>
...
...
Please
register
or
login
to post a comment