Toggle navigation
Toggle navigation
This project
Loading...
Sign in
wangshusheng
/
YOHOBUYPC
·
Commits
Go to a project
GitLab
Go to dashboard
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
梁志锋
9 years ago
Commit
ab27f3c03e060f94d40a590ca6f01a1edd3b7aeb
2 parents
82da3e32
7426bebf
Merge branch 'develop/wap' of
http://git.dev.yoho.cn/web/yohobuy
into develop/wap
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
70 additions
and
46 deletions
library/Plugin/Helpers.php
static/js/home/home.js
static/sass/home/_side-nav.scss
template/m.yohobuy.com/partials/me/order/order.phtml
yohobuy/m.yohobuy.com/application/models/Home/Order.php
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
library/Plugin/Helpers.php
View file @
ab27f3c
...
...
@@ -583,7 +583,7 @@ class Helpers
foreach
(
$orderGoods
as
$key
=>
$vo
)
{
$arr
[
$key
][
'thumb'
]
=
Helpers
::
getImageUrl
(
$vo
[
'goods_image'
],
90
,
120
);
$arr
[
$key
][
'name'
]
=
$vo
[
'product_name'
]
;
$arr
[
$key
][
'name'
]
=
isset
(
$vo
[
'product_name'
])
?
$vo
[
'product_name'
]
:
''
;
$arr
[
$key
][
'color'
]
=
$vo
[
'color_name'
];
$arr
[
$key
][
'size'
]
=
$vo
[
'size_name'
];
$arr
[
$key
][
'price'
]
=
$vo
[
'goods_price'
];
...
...
static/js/home/home.js
View file @
ab27f3c
...
...
@@ -49,18 +49,13 @@ $('.overlay').on('touchstart', function(e) {
return
false
;
});
//禁止在侧边栏可以上下滚动
$
(
'.side-nav'
).
on
(
'touchmove'
,
function
()
{
return
false
;
});
//点击一级导航,弹出二级导航
$sideNav
.
on
(
'touchstart'
,
'li'
,
function
(
e
)
{
if
(
$
(
this
).
find
(
'.sub-nav'
).
size
()
>
0
)
{
$
(
'.sub-nav'
).
removeClass
(
'show'
);
$
(
this
).
find
(
'.sub-nav'
).
addClass
(
'show'
);
}
e
.
stopPropagation
();
if
(
e
.
target
.
pathname
===
location
.
pathname
)
{
hideSideBar
();
return
false
;
...
...
@@ -69,9 +64,8 @@ $sideNav.on('touchstart', 'li', function(e) {
//返回一级导航,收起二级导航
$subNav
.
each
(
function
()
{
$
(
this
).
find
(
'li'
).
eq
(
0
).
on
(
'touchstart'
,
function
(
e
)
{
$
(
this
).
find
(
'li'
).
eq
(
0
).
on
(
'touchstart'
,
function
()
{
$
(
'.sub-nav'
).
removeClass
(
'show'
);
e
.
stopPropagation
();
return
false
;
});
}).
on
(
'touchstart'
,
function
(
e
)
{
...
...
@@ -81,12 +75,16 @@ $subNav.each(function() {
});
// 侧边栏点击背景色变化
$sideNav
.
children
(
'ul'
).
children
(
'li'
).
on
(
'touchstart'
,
function
()
{
$sideNav
.
children
(
'ul'
).
children
(
'li'
).
css
(
'background'
,
'#fff'
);
$
(
this
).
css
(
'background'
,
'#eee'
);
}).
on
(
'touchend touchcancel'
,
function
()
{
$
(
this
).
css
(
'background'
,
'#fff'
);
});
function
highlight
(
$elem
)
{
$elem
.
find
(
'li'
).
on
(
'touchstart'
,
function
()
{
$
(
this
).
addClass
(
'highlight'
);
}).
on
(
'touchend touchcancel'
,
function
()
{
$
(
this
).
removeClass
(
'highlight'
);
});
}
highlight
(
$sideNav
);
highlight
(
$subNav
);
//头部banner轮播
if
(
$
(
'.banner-swiper'
).
find
(
'li'
).
size
()
>
1
)
{
...
...
static/sass/home/_side-nav.scss
View file @
ab27f3c
...
...
@@ -8,6 +8,7 @@
right
:
100rem
/
$pxConvertRem
;
width
:
540rem
/
$pxConvertRem
;
background
:
#f0f0f0
;
z-index
:
4
;
overflow
:
hidden
;
overflow-y
:
auto
;
@include
transition
(
all
.3s
);
...
...
@@ -46,25 +47,28 @@
height
:
100%
;
padding-left
:
110rem
/
$pxConvertRem
;
color
:
#444
;
font-size
:
24rem
/
$pxConvertRem
;
}
em
{
font-weight
:
bold
;
font-size
:
26rem
/
$pxConvertRem
;
}
.title
{
display
:
inline-block
;
padding-left
:
10rem
/
$pxConvertRem
;
font-size
:
30rem
/
$pxConvertRem
;
vertical-align
:
baseline
;
font-size
:
36rem
/
$pxConvertRem
;
vertical-align
:
bottom
;
// 此处字体小于 12px, 先扩大,再scale缩小
@include
transform
(
scale
(
0
.
7
5
));
@include
transform
(
scale
(
0
.5
));
}
.nav-icon
,
.nav-img
{
position
:
absolute
;
width
:
60rem
/
$pxConvertRem
;
height
:
60rem
/
$pxConvertRem
;
width
:
48rem
/
$pxConvertRem
;
height
:
48rem
/
$pxConvertRem
;
top
:
50%
;
margin-top
:
-30rem
/
$pxConvertRem
;
left
:
24rem
/
$pxConvertRem
;
margin-top
:
-24rem
/
$pxConvertRem
;
left
:
30rem
/
$pxConvertRem
;
background
:
no-repeat
left
center
;
background-size
:
100%
100%
;
}
...
...
@@ -79,10 +83,10 @@
font-weight
:
lighter
;
}
em
{
font-weight
:
bold
;
font-size
:
30rem
/
$pxConvertRem
;
&
.highlight
{
background
:
#eee
;
}
}
.first
{
...
...
@@ -100,17 +104,15 @@
content
:
none
;
}
a
{
font-size
:
40rem
/
$pxConvertRem
;
}
em
{
font-size
:
40
rem
/
$pxConvertRem
;
font-size
:
36
rem
/
$pxConvertRem
;
}
.title
{
font-size
:
24rem
/
$pxConvertRem
;
@include
transform
(
scale
(
1
));
}
.sub-nav
{
li
{
border-bottom
:
1px
solid
#e0e0e0
;
}
}
}
...
...
@@ -181,8 +183,8 @@
@include
transition
(
transform
0
.3s
);
li
{
height
:
80rem
/
$pxConvertRem
;
line-height
:
80rem
/
$pxConvertRem
;
height
:
80rem
/
$pxConvertRem
!
important
;
line-height
:
80rem
/
$pxConvertRem
!
important
;
border
:
none
;
border-bottom
:
1px
solid
#e0e0e0
;
...
...
@@ -215,9 +217,13 @@
color
:
#f0f0f0
;
}
&
.highlight
{
background
:
#eee
;
}
em
{
font-weight
:
normal
;
font-size
:
30rem
/
$pxConvertRem
;
font-size
:
30rem
/
$pxConvertRem
!
important
;
}
}
...
...
template/m.yohobuy.com/partials/me/order/order.phtml
View file @
ab27f3c
...
...
@@ -10,6 +10,7 @@
</section>
<footer class="footer">
共{{count}}件商品 实付<span class="sum-cost">¥{{sumCost}}</span>
{{#shippingCost}}(含运费¥{{.}}){{/shippingCost}}
</footer>
{{!-- 对应订单状态的操作逻辑 --}}
...
...
yohobuy/m.yohobuy.com/application/models/Home/Order.php
View file @
ab27f3c
...
...
@@ -82,6 +82,10 @@ class OrderModel
$result
[
$key
][
'orderNum'
]
=
$vo
[
'order_code'
];
$result
[
$key
][
'orderStatus'
]
=
$vo
[
'status_str'
];
$result
[
$key
][
'sumCost'
]
=
$vo
[
'amount'
];
// 如果运费大于0,会显示运费
if
(
floatval
(
$vo
[
'shipping_cost'
])
>
0
)
{
$result
[
$key
][
'shippingCost'
]
=
$vo
[
'shipping_cost'
];
}
//类内调用格式化订单商品数据方法
$result
[
$key
][
'goods'
]
=
Helpers
::
formatOrderGoods
(
$vo
[
'order_goods'
],
$count
);
$result
[
$key
][
'detailUrl'
]
=
Helpers
::
url
(
'/home/orderdetail'
,
array
(
'order_code'
=>
$vo
[
'order_code'
]));
...
...
@@ -327,13 +331,19 @@ class OrderModel
return
$result
;
}
/**
* 获取快递有关信息
* @param boolean $showLogistics 是否显示
* @param array $order 订单信息
* @param array $result
*/
private
static
function
assignExpressInfo
(
$showLogistics
,
$order
,
&
$result
)
{
$result
[
'logisticsUrl'
]
=
Helpers
::
url
(
'/home/logistic'
,
array
(
'order_code'
=>
$order
[
'order_code'
]));
if
(
$showLogistics
&&
isset
(
$order
[
'express_company'
][
'caption'
]))
{
$result
[
'logisticsCompany'
]
=
$order
[
'express_company'
][
'caption'
];
$result
[
'logisticsNum'
]
=
$order
[
'express_number'
]
;
$result
[
'logisticsNum'
]
=
isset
(
$order
[
'express_number'
])
?
$order
[
'express_number'
]
:
''
;
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/Cart.php
View file @
ab27f3c
...
...
@@ -447,7 +447,7 @@ class CartModel
}
// 有货币
$result
[
'yohoCoin'
]
=
$payReturn
[
'yoho_coin'
]
;
$result
[
'yohoCoin'
]
=
Helpers
::
transPrice
(
$payReturn
[
'yoho_coin'
])
;
/*
* 默认使用有货币
* $result['useYohoCoin'] = isset($orderCompute['use_yoho_coin']) ? $orderCompute['use_yoho_coin'] : $payReturn['use_yoho_coin'];
...
...
@@ -511,6 +511,8 @@ class CartModel
$compute
=
CartData
::
orderCompute
(
$uid
,
$cartType
,
$deliveryWay
,
$paymentType
,
$couponCode
,
$yohoCoin
);
if
(
$compute
&&
isset
(
$compute
[
'code'
])
&&
$compute
[
'code'
]
===
200
)
{
// 有货币添加.00后缀
$compute
[
'data'
][
'use_yoho_coin'
]
=
Helpers
::
transPrice
(
$compute
[
'data'
][
'use_yoho_coin'
]);
$result
=
$compute
[
'data'
];
}
...
...
@@ -631,8 +633,15 @@ class CartModel
$data
=
array
();
$data
[
'name'
]
=
$productData
[
'product_name'
];
$data
[
'price'
]
=
$productData
[
'format_market_price'
];
$data
[
'salePrice'
]
=
$productData
[
'format_sales_price'
];
if
(
isset
(
$productData
[
'special_price'
]))
{
// 加价购或者赠品的销售价字段
$data
[
'price'
]
=
$productData
[
'format_market_price'
];
$data
[
'salePrice'
]
=
$productData
[
'format_sales_price'
];
}
else
{
// 购物车商品的销售价字段
$data
[
'price'
]
=
$productData
[
'market_price'
]
>
$productData
[
'sales_price'
]
?
$productData
[
'format_market_price'
]
:
false
;
$data
[
'salePrice'
]
=
'¥'
.
Helpers
::
transPrice
(
$productData
[
'sales_price'
]);
}
if
(
isset
(
$productData
[
'storage_sum'
]))
{
$data
[
'storage'
]
=
$productData
[
'storage_sum'
];
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
ab27f3c
...
...
@@ -188,7 +188,7 @@ class UserModel
$favProduct
=
UserData
::
favoriteProductData
(
$uid
,
$page
,
$limit
);
// 处理用户收藏的商品数据
if
(
isset
(
$favProduct
[
'data'
])
&&
!
empty
(
$favProduct
[
'data'
][
'product_list'
])
)
{
if
(
isset
(
$favProduct
[
'data'
])
&&
$page
<=
$favProduct
[
'data'
][
'page_total'
]
)
{
$datas
=
array
();
$product
=
array
();
foreach
(
$favProduct
[
'data'
][
'product_list'
]
as
$val
)
{
...
...
@@ -210,7 +210,7 @@ class UserModel
$datas
[]
=
$product
;
}
!
empty
(
$datas
)
&&
$result
[
'hasFavProduct'
]
=
$datas
;
}
else
if
(
$page
>
1
&&
!
isset
(
$favProduct
[
'data'
][
'product_list'
])
)
{
}
else
if
(
(
$page
>
1
&&
!
$favProduct
)
||
$page
>
$favProduct
[
'data'
][
'page_total'
]
)
{
$result
[
'end'
]
=
true
;
}
...
...
@@ -234,7 +234,7 @@ class UserModel
$favBrand
=
UserData
::
favoriteBrandData
(
$uid
,
$gender
,
$page
,
$limit
);
// 处理用户收藏的品牌数据
if
(
isset
(
$favBrand
[
'data'
])
&&
!
empty
(
$favBrand
[
'data'
][
'brand_list'
])
)
{
if
(
isset
(
$favBrand
[
'data'
])
&&
$page
<=
$favBrand
[
'data'
][
'page_total'
]
)
{
$datas
=
array
();
$brand
=
array
();
foreach
(
$favBrand
[
'data'
][
'brand_list'
]
as
$val
)
{
...
...
@@ -265,7 +265,7 @@ class UserModel
$datas
[]
=
$brand
;
}
!
empty
(
$datas
)
&&
$result
[
'hasFavBrand'
]
=
$datas
;
}
else
if
(
$page
>
1
&&
!
isset
(
$favBrand
[
'code'
][
'brand_list'
])
)
{
}
else
if
(
(
$page
>
1
&&
!
$favBrand
)
||
$page
>
$favBrand
[
'data'
][
'page_total'
]
)
{
$result
[
'end'
]
=
true
;
}
...
...
Please
register
or
login
to post a comment