Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
YOHOBUYWAP
·
Commits
Go to a project
GitLab
Go to group
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
hf
9 years ago
Commit
bc5ac90344f88cd3d7d73fb2d07c85ce6a26b512
2 parents
74f21492
ae56491d
Merge branch 'develop' of
http://git.dev.yoho.cn/web/yohobuy
into develop
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
250 additions
and
219 deletions
library/LibModels/Wap/Home/GradeData.php
library/LibModels/Wap/Home/OrderData.php
static/js/me/order.js
static/js/product/newsale/hot-rank.js
template/m.yohobuy.com/actions/index/home/coupons.phtml
template/m.yohobuy.com/actions/index/home/order-content.phtml
template/m.yohobuy.com/actions/index/home/personal-details.phtml
template/m.yohobuy.com/actions/product/newsale/hotlist.phtml
template/m.yohobuy.com/partials/layout/not-footer.phtml
yohobuy/m.yohobuy.com/application/controllers/Home.php
yohobuy/m.yohobuy.com/application/models/Home/Grade.php
yohobuy/m.yohobuy.com/application/models/Home/Order.php
yohobuy/m.yohobuy.com/application/models/Index/User.php
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
library/LibModels/Wap/Home/GradeData.php
View file @
bc5ac90
...
...
@@ -19,7 +19,7 @@ class GradeData
* @param string $uid 用户id
* @return array 接口返回的会员等级数据
*/
public
function
getGradeData
(
$gender
,
$channel
,
$uid
)
{
public
static
function
getGradeData
(
$gender
,
$channel
,
$uid
)
{
$urlList
=
array
();
//获取会员等级数据
$param
=
Yohobuy
::
param
();
...
...
library/LibModels/Wap/Home/OrderData.php
View file @
bc5ac90
...
...
@@ -39,4 +39,39 @@ class OrderData
return
Yohobuy
::
get
(
Yohobuy
::
API_URL2
,
$param
);
}
/*
* 取消订单
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
public
function
cancelOrderData
(
$order_code
,
$uid
,
$gender
,
$yh_channel
,
$method
)
{
$param
=
Yohobuy
::
param
();
$param
[
'order_code'
]
=
$order_code
;
$param
[
'uid'
]
=
$uid
;
$param
[
'gender'
]
=
$gender
;
$param
[
'yh_channel'
]
=
$yh_channel
;
$param
[
'method'
]
=
$method
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
/*
* 删除订单
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
public
function
deleteOrderData
(
$order_code
,
$uid
,
$gender
,
$yh_channel
,
$method
)
{
$param
=
Yohobuy
::
param
();
$param
[
'order_code'
]
=
$order_code
;
$param
[
'uid'
]
=
$uid
;
$param
[
'gender'
]
=
$gender
;
$param
[
'yh_channel'
]
=
$yh_channel
;
$param
[
'method'
]
=
$method
;
$param
[
'client_secret'
]
=
Sign
::
getSign
(
$param
);
return
Yohobuy
::
get
(
Yohobuy
::
API_URL
,
$param
);
}
}
...
...
static/js/me/order.js
View file @
bc5ac90
...
...
@@ -81,7 +81,7 @@ lazyLoad();
$navLi
.
width
(
100
/
liCount
+
'%'
);
}());
loading
.
init
(
);
loading
.
init
(
$
(
'body'
));
//满屏loading
//导航切换
navHammer
=
new
Hammer
(
document
.
getElementById
(
'order-nav'
));
...
...
static/js/product/newsale/hot-rank.js
View file @
bc5ac90
var
$
=
require
(
'jquery'
),
Hammer
=
require
(
'yoho.hammer'
),
Swiper
=
require
(
'yoho.iswiper'
),
lazyLoad
=
require
(
'yoho.lazyload'
)
loading
=
require
(
'../../plugin/loading'
);;
lazyLoad
=
require
(
'yoho.lazyload'
),
loading
=
require
(
'../../plugin/loading'
);
var
page
=
1
,
winH
,
...
...
template/m.yohobuy.com/actions/index/home/coupons.phtml
View file @
bc5ac90
...
...
@@ -17,4 +17,4 @@
<p>有效期:
2014.07
.
28
-
2014.09
.
15
</p>
</div>
</div>
{
{>
layout/not-footer
}
}
\ No newline at end of file
{
{>
layout/footer
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/order-content.phtml
0 → 100644
View file @
bc5ac90
{
{>
me/order/orders
}
}
\ No newline at end of file
...
...
template/m.yohobuy.com/actions/index/home/personal-details.phtml
View file @
bc5ac90
...
...
@@ -3,7 +3,7 @@
<ul>
<li><span>头像</span><span><i
class=
"head-portrait"
><img
src=
"{{ head_ico }}"
></i></span></li>
<li><span>昵称</span><span>
{
{
username
}
}</span></li>
<li><span>性别</span><span></span></li>
<li><span>性别</span><span>
{
{
gender
}
}
</span></li>
<li><span>生日</span><span>
{
{
birthday
}
}</span></li>
<li><span>会员等级</span>
<span>
...
...
template/m.yohobuy.com/actions/product/newsale/hotlist.phtml
View file @
bc5ac90
...
...
@@ -2,10 +2,10 @@
<div
class=
"s-goods-nav goods-nav"
>
<ul
class=
"swiper-wrapper clearfix"
>
{
{#
tabs
}
}
{
{#
title
}
}
<li
class=
"swiper-slide nav-item"
>
<span
data-sort=
"{{ params}}"
data-id=
"{{ id}}"
>
{
{
name
}
}</span>
</li>
{
{#
title
}
}
<li
class=
"swiper-slide nav-item {{#if @first}} active{{/if}}"
>
<span
data-sort=
"{{ params}}"
data-id=
"{{ id}}"
>
{
{
name
}
}</span>
</li>
{
{/
title
}
}
{
{/
tabs
}
}
</ul>
...
...
template/m.yohobuy.com/partials/layout/not-footer.phtml
deleted
100644 → 0
View file @
74f2149
{
{#if
hasWxShare
}
}
<script
type=
"text/javascript"
charset=
"utf-8"
src=
"http://res.wx.qq.com/open/js/jweixin-1.0.0.js"
></script>
{
{/if
}
}
{
{#if
rlsEnv
}
}
<script
src=
"http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"
></script>
<script
src=
"http://cdn.yoho.cn/myohobuy/{{version}}/index.js"
></script>
{
{/if
}
}
{
{#if
preEnv
}
}
<script
src=
"http://cdn.yoho.cn/myohobuy/{{version}}/lib.js"
></script>
<script
src=
"http://cdn.yoho.cn/myohobuy/{{version}}/index.js"
></script>
{
{/if
}
}
{
{#if
testEnv
}
}
<script
src=
"http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/lib.js"
></script>
<script
src=
"http://static.buy.test.yoho.cn/dist/myohobuy/{{version}}/index-debug.js"
></script>
{
{/if
}
}
{
{#if
devEnv
}
}
<script
src=
"http://localhost:8000/static/js/sea.js?nowrap"
></script>
<script>seajs.config(
{
base:
'http://localhost:8000/'
}
);</script>
{
{/if
}
}
<script
type=
"text/javascript"
>
(function(w,d,s,j,f)
{
w['YohoAcquisitionObject']=f;
w[f]=function(){w[f].p=arguments;
}
;
var
a=d.createElement(s);
var
m=d.getElementsByTagName(s)
[
0
]
;
a.async=
1
;
a.src=j;
m.parentNode.insertBefore(a,m);
})(window,document,'script','http://cdn.yoho.cn/yas-jssdk/
1.0
.
13
/yas.js','_yas');
</script>
{
{>
layout/use
}
}
{
{>
layout/analysis
}
}
</body>
</html>
\ No newline at end of file
yohobuy/m.yohobuy.com/application/controllers/Home.php
View file @
bc5ac90
...
...
@@ -4,6 +4,7 @@ use Action\AbstractAction;
use
home\GradeModel
;
use
home\OrderModel
;
use
Plugin\Helpers
;
use
LibModels\Wap\Home\OrderData
;
/**
* 个人中心相关的控制器
...
...
@@ -25,10 +26,10 @@ class HomeController extends AbstractAction
$this
->
setTitle
(
'个人中心'
);
$this
->
setNavHeader
(
'个人中心'
,
true
,
SITE_MAIN
);
// $uid = $this->getUid();
$uid
=
8826435
;
$data
=
\Index\UserModel
::
getUserProfileData
(
$uid
);
$data
+=
\Index\UserModel
::
getInfoNumData
(
$uid
);
// $uid = $this->getUid();
$uid
=
8826435
;
$data
=
\Index\UserModel
::
getUserProfileData
(
$uid
);
$data
+=
\Index\UserModel
::
getInfoNumData
(
$uid
);
// 优选新品数据
$channel
=
Helpers
::
getChannelByCookie
();
...
...
@@ -41,57 +42,6 @@ class HomeController extends AbstractAction
$this
->
_view
->
display
(
'index'
,
$data
);
}
/**
* 用户订单
*/
public
function
ordersAction
()
{
// 设置网站标题
$this
->
setTitle
(
'我的订单'
);
$this
->
setNavHeader
(
'我的订单'
,
true
,
SITE_MAIN
);
$uid
=
$this
->
getUid
();
$uid
=
8826435
;
$type
=
$this
->
get
(
'type'
,
1
);
$order
=
\Index\UserModel
::
getUserOrderData
(
$uid
,
$type
);
$order
=
array
(
'orders'
=>
array
(
array
(
'orderNum'
=>
'408539077'
,
'tradingStatus'
=>
'交易成功'
,
'goods'
=>
array
(
array
(
'id'
=>
1
,
'thumb'
=>
'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'Adidas Originals ZX FLUXM22508'
,
'color'
=>
'黄'
,
'size'
=>
'43'
,
'price'
=>
'699.00'
,
'count'
=>
'2'
),
array
(
'id'
=>
1
,
'thumb'
=>
'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
,
'name'
=>
'B.Duck浴室玩伴mini浮水鸭'
,
'gift'
=>
true
,
'color'
=>
'黄'
,
'size'
=>
'43'
,
'price'
=>
'0.00'
,
'count'
=>
'1'
)
),
'count'
=>
2
,
'sumCost'
=>
'699.00'
,
'unpaid'
=>
true
,
)
)
);
$this
->
_view
->
display
(
'order'
,
array
(
'order'
=>
$order
,
'orderPage'
=>
true
));
}
/**
* 用户收藏的商品
*/
...
...
@@ -131,7 +81,7 @@ class HomeController extends AbstractAction
),
'hasFavBrand'
=>
array
(
'0'
=>
array
(
'id'
=>
'1'
,
'id'
=>
'1'
,
'brandImg'
=>
'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
,
'brandName'
=>
'VANS'
,
'update'
=>
12
,
...
...
@@ -161,7 +111,7 @@ class HomeController extends AbstractAction
)
),
'1'
=>
array
(
'id'
=>
'2'
,
'id'
=>
'2'
,
'brandImg'
=>
'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
,
'brandName'
=>
'VANS'
,
'update'
=>
12
,
...
...
@@ -191,7 +141,7 @@ class HomeController extends AbstractAction
)
),
'2'
=>
array
(
'id'
=>
'3'
,
'id'
=>
'3'
,
'brandImg'
=>
'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90'
,
'brandName'
=>
'VANS'
,
'update'
=>
12
,
...
...
@@ -237,26 +187,14 @@ class HomeController extends AbstractAction
* YOHO币
*/
public
function
currencyAction
()
{
// $uid = $this->getUid();
$this
->
setNavHeader
(
'YOHO币'
,
true
,
false
);
$this
->
setTitle
(
'YOHO币'
);
$this
->
setNavHeader
(
'优惠券'
,
true
,
SITE_MAIN
);
$uid
=
967016
;
$currency
=
\Index\UserModel
::
getYohoCoinData
(
$uid
);
$this
->
setTitle
(
'优惠券'
);
$this
->
setNavHeader
(
'优惠券'
,
true
,
SITE_MAIN
);
// $uid = $this->getUid();
$uid
=
8826435
;
$coupons
=
array
(
'couponsUrl'
=>
array
(
\Index\UserModel
::
getCouponData
(
$uid
,
0
),
\Index\UserModel
::
getCouponData
(
$uid
,
1
),
),
'couponsPage'
=>
true
);
print_r
(
$coupons
);
$this
->
_view
->
display
(
'coupons'
,
$coupons
);
$currency
[
'pageFooter'
]
=
true
;
$this
->
_view
->
display
(
'currency'
,
$currency
);
}
/**
...
...
@@ -403,19 +341,19 @@ class HomeController extends AbstractAction
* 意见反馈
*/
public
function
suggestAction
()
{
// 设置网站标题
$this
->
setTitle
(
'意见反馈'
);
$this
->
setNavHeader
(
'意见反馈'
,
true
,
SITE_MAIN
);
$udid
=
$this
->
getUdid
();
$page
=
$this
->
get
(
'page'
,
1
);
$limit
=
$this
->
get
(
'limit'
,
30
);
$suggest
=
\Index\UserModel
::
getSuggestData
(
$udid
,
$page
,
$limit
);
//
print_r($suggest);
print_r
(
$suggest
);
$this
->
_view
->
display
(
'suggest'
,
array
(
'suggestPage'
=>
true
,
//加载js
'pageHeader'
=>
array
(
'navBack'
=>
true
,
'navTitle'
=>
'意见反馈'
),
'pageFooter'
=>
true
,
'suggest'
=>
true
,
'suggestContent'
=>
array
(
...
...
@@ -441,12 +379,10 @@ class HomeController extends AbstractAction
));
}
/**
* 意见反馈-提交表单
*/
public
function
suggest_subAction
()
{
public
function
suggest_subAction
()
{
$udid
=
$this
->
getUdid
();
$page
=
$this
->
get
(
'page'
,
1
);
$limit
=
$this
->
get
(
'limit'
,
30
);
...
...
@@ -464,18 +400,16 @@ class HomeController extends AbstractAction
'suggestSub'
=>
true
,
'pageFooter'
=>
true
));
}
/**
* 异步保存意见反馈数据
*/
public
function
savesuggestAction
()
{
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
();
$content
=
$this
->
post
(
'content'
,
''
);
$suggest_type
=
$this
->
get
(
'suggest_type'
,
2
);
/**
* 异步保存意见反馈数据
*/
public
function
savesuggestAction
()
{
if
(
$this
->
isAjax
())
{
$uid
=
$this
->
getUid
();
$content
=
$this
->
post
(
'content'
,
''
);
$suggest_type
=
$this
->
get
(
'suggest_type'
,
2
);
$result
=
\Index\UserModel
::
saveSuggestData
(
$uid
,
$content
,
$suggest_type
);
$this
->
echoJson
(
$result
);
...
...
@@ -503,6 +437,7 @@ class HomeController extends AbstractAction
/*
* 会员特权查看页
*/
public
function
preferentialAction
()
{
//设置网站seo信息
$this
->
setTitle
(
'会员等级'
);
...
...
@@ -519,7 +454,32 @@ class HomeController extends AbstractAction
/*
* 我的订单页面
*/
public
function
orderAction
()
{
//获得type值
$type
=
$this
->
get
(
'type'
,
1
);
$this
->
setTitle
(
'我的订单'
);
$this
->
setNavHeader
(
'我的订单'
);
$data
=
OrderModel
::
getNavs
(
$type
);
if
(
!
empty
(
$data
))
{
$order
[
'navs'
]
=
$data
;
$order
[
'orderPage'
]
=
true
;
}
else
{
$this
->
error
();
}
$this
->
_view
->
display
(
'order'
,
array
(
'order'
=>
$order
,
'pageFooter'
=>
true
));
}
//ajax请求订单页面
public
function
getOrderAction
()
{
//判断是不是ajax请求
if
(
!
$this
->
isAjax
())
{
$this
->
error
();
}
//获取基本参数:type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
$type
=
$this
->
get
(
'type'
,
1
);
$page
=
$this
->
get
(
'page'
,
1
);
...
...
@@ -528,58 +488,68 @@ class HomeController extends AbstractAction
$yh_channel
=
$this
->
get
(
'yh_channel'
,
1
);
$uid
=
$this
->
getUid
();
$uid
=
'7566245'
;
//测试用
$this
->
setTitle
(
'我的订单'
);
$this
->
setNavHeader
(
'我的订单'
);
//调用模型层getOrder方法获得并处理数据
$data
=
OrderModel
::
getOrder
(
$type
,
$page
,
$limit
,
$gender
,
$yh_channel
,
$uid
);
//如果没有订单数据,就给一个随便逛逛链接
$order
=
array
();
// if (!empty($data)) {
// $order['orders'] = $data;
// } else {
// $order['walkwayUrl'] = 'http://www.baidu.com';
// }
$order
[
'navs'
]
=
array
(
array
(
'name'
=>
'全部'
,
'active'
=>
true
,
'typeId'
=>
'1'
),
array
(
'name'
=>
'待付款'
,
'typeId'
=>
'2'
),
array
(
'name'
=>
'待发货'
,
'typeId'
=>
'3'
),
array
(
'name'
=>
'待收货'
,
'typeId'
=>
'4'
)
);
if
(
!
empty
(
$data
))
{
$order
[
'orders'
]
=
$data
;
}
else
{
$order
[
'walkwayUrl'
]
=
'http://www.baidu.com'
;
}
//渲染模板
$this
->
_view
->
display
(
'order'
,
array
(
'order'
=>
$order
,
'orderPage'
=>
true
,
'pageFooter'
=>
true
));
$this
->
_view
->
display
(
'order-content'
,
$order
);
}
/*
* 我的订单-
处理ajax请求页面(切换订单状态)
* 我的订单-
取消订单
*/
public
function
getOrdersAction
()
{
public
function
cancelOrderAction
()
{
//判断是不是ajax请求
if
(
!
$this
->
isAjax
())
{
$this
->
error
();
}
self
::
orderAction
();
//传入order_code和uid以取消订单
$order_code
=
$this
->
get
(
'orderCode'
);
$uid
=
$this
->
getUid
();
$uid
=
'10267443'
;
//测试用
$gender
=
Helpers
::
getGenderByCookie
();
$yh_channel
=
$this
->
get
(
'yh_channel'
,
1
);
$method
=
'app.SpaceOrders.close'
;
$data
=
OrderData
::
cancelOrderData
(
$order_code
,
$uid
,
$gender
,
$yh_channel
,
$method
);
if
(
$data
[
'code'
]
==
200
)
{
echo
$data
[
'message'
];
}
}
public
function
orderDetailAction
()
{
/*
* 我的订单-删除订单
*/
public
function
deleteOrderAction
()
{
//判断是不是ajax请求
if
(
!
$this
->
isAjax
())
{
$this
->
error
();
}
//传入order_code和uid以删除订单
$order_code
=
$this
->
get
(
'orderCode'
);
$uid
=
$this
->
getUid
();
$uid
=
'10267443'
;
//测试用
$gender
=
Helpers
::
getGenderByCookie
();
$yh_channel
=
$this
->
get
(
'yh_channel'
,
1
);
$method
=
'app.SpaceOrders.delOrderByCode'
;
$data
=
OrderData
::
deleteOrderData
(
$order_code
,
$uid
,
$gender
,
$yh_channel
,
$method
);
if
(
$data
[
'code'
]
==
200
)
{
echo
$data
[
'message'
];
}
}
/**
* 订单详情页
*/
public
function
orderDetailAction
()
{
$data
=
array
(
'name'
=>
'毛毛莉Lydia'
,
'phoneNum'
=>
'18600001133'
,
...
...
@@ -587,9 +557,7 @@ class HomeController extends AbstractAction
'orderStatus'
=>
'订单取消'
,
'orderNum'
=>
'418358063'
,
'orderTime'
=>
'2014-03-10 17:25:10'
,
'orderCancel'
=>
true
,
'goods'
=>
array
(
array
(
'id'
=>
1
,
...
...
@@ -611,7 +579,6 @@ class HomeController extends AbstractAction
'count'
=>
'1'
)
),
'sumPrice'
=>
799
,
'salePrice'
=>
80
,
'freight'
=>
5
,
...
...
@@ -621,4 +588,5 @@ class HomeController extends AbstractAction
);
$this
->
_view
->
display
(
'order-detail'
,
array
(
'orderDetail'
=>
$data
,
'orderDetailPage'
=>
true
));
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Home/Grade.php
View file @
bc5ac90
...
...
@@ -15,7 +15,7 @@ class GradeModel
* 获取个人中心-会员等级数据
*/
public
function
getGrade
(
$gender
,
$channel
,
$uid
)
{
public
static
function
getGrade
(
$gender
,
$channel
,
$uid
)
{
$result
=
array
();
if
(
USE_CACHE
)
{
...
...
@@ -27,40 +27,42 @@ class GradeModel
}
//调用接口获取数据
$data
=
GradeData
::
getGradeData
(
$gender
,
$channel
,
$uid
);
switch
(
intval
(
$data
[
'grade'
][
'current_vip_level'
]))
{
case
0
://
普通会员
$result
[
'vipGrade'
][
'vip0'
]
=
true
;
break
;
case
1
://
银卡会员
$result
[
'vipGrade'
][
'vip1'
]
=
true
;
break
;
case
2
://
金卡会员
$result
[
'vipGrade'
][
'vip2'
]
=
true
;
break
;
case
3
://
白金会员
$result
[
'vipGrade'
][
'vip3'
]
=
true
;
break
;
}
//今年总消费
$result
[
'vipGrade'
][
'costOfThisYear'
]
=
$data
[
'grade'
][
'current_year_cost'
];
//升级下一等级会员的进度;
$result
[
'vipGrade'
][
'percent'
]
=
100
*
(
round
(
$data
[
'grade'
][
'current_total_cost'
]
/
$data
[
'grade'
][
'next_need_cost'
],
2
));
//距离升级所需消费金额
if
(
$data
[
'grade'
][
'current_vip_level'
]
!=
3
)
{
$result
[
'vipGrade'
][
'costGap'
]
=
$data
[
'grade'
][
'upgrade_need_cost'
];
}
//消费总计
$result
[
'vipGrade'
][
'sumCost'
]
=
$data
[
'grade'
][
'current_total_cost'
];
//username 调用获取用户基本信息数据,获得username;
//$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result
[
'vipGrade'
][
'name'
]
=
$data
[
'userProfile'
][
'username'
];
//跳转url(会员特权详情)
$result
[
'vipGrade'
][
'allUrl'
]
=
Helpers
::
url
(
'/Home/preferential'
,
null
);
//当前vip等级享受的特权
$result
[
'vipGrade'
][
'privilege'
]
=
$data
[
'grade'
][
'enjoy_preferential'
];
if
(
!
empty
(
$data
[
'grade'
]))
{
switch
(
intval
(
$data
[
'grade'
][
'current_vip_level'
]))
{
case
0
://
普通会员
$result
[
'vipGrade'
][
'vip0'
]
=
true
;
break
;
case
1
://
银卡会员
$result
[
'vipGrade'
][
'vip1'
]
=
true
;
break
;
case
2
://
金卡会员
$result
[
'vipGrade'
][
'vip2'
]
=
true
;
break
;
case
3
://
白金会员
$result
[
'vipGrade'
][
'vip3'
]
=
true
;
break
;
}
//今年总消费
$result
[
'vipGrade'
][
'costOfThisYear'
]
=
$data
[
'grade'
][
'current_year_cost'
];
//升级下一等级会员的进度;
$result
[
'vipGrade'
][
'percent'
]
=
100
*
(
round
(
$data
[
'grade'
][
'current_total_cost'
]
/
$data
[
'grade'
][
'next_need_cost'
],
2
));
//距离升级所需消费金额
if
(
$data
[
'grade'
][
'current_vip_level'
]
!=
3
)
{
$result
[
'vipGrade'
][
'costGap'
]
=
$data
[
'grade'
][
'upgrade_need_cost'
];
}
//消费总计
$result
[
'vipGrade'
][
'sumCost'
]
=
$data
[
'grade'
][
'current_total_cost'
];
//username 调用获取用户基本信息数据,获得username;
//$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result
[
'vipGrade'
][
'name'
]
=
$data
[
'userProfile'
][
'username'
];
//跳转url(会员特权详情)
$result
[
'vipGrade'
][
'allUrl'
]
=
Helpers
::
url
(
'/Home/preferential'
,
null
);
//当前vip等级享受的特权
$result
[
'vipGrade'
][
'privilege'
]
=
$data
[
'grade'
][
'enjoy_preferential'
];
}
if
(
USE_CACHE
)
{
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
...
...
yohobuy/m.yohobuy.com/application/models/Home/Order.php
View file @
bc5ac90
...
...
@@ -121,5 +121,55 @@ class OrderModel
}
return
$arr
;
}
//根据type值设置nav属性
public
function
getNavs
(
$type
){
$nav
=
array
(
array
(
'name'
=>
'全部'
,
'typeId'
=>
'1'
),
array
(
'name'
=>
'待付款'
,
'typeId'
=>
'2'
),
array
(
'name'
=>
'待发货'
,
'typeId'
=>
'3'
),
array
(
'name'
=>
'待收货'
,
'typeId'
=>
'4'
)
);
foreach
(
$nav
as
$key
=>
$vo
){
switch
(
$type
)
{
case
1
:
if
(
$vo
[
'typeId'
]
==
1
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
2
:
if
(
$vo
[
'typeId'
]
==
2
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
3
:
if
(
$vo
[
'typeId'
]
==
3
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
case
4
:
if
(
$vo
[
'typeId'
]
==
4
){
$nav
[
$key
][
'active'
]
=
true
;
}
break
;
default
:
break
;
}
}
return
$nav
;
}
}
...
...
yohobuy/m.yohobuy.com/application/models/Index/User.php
View file @
bc5ac90
...
...
@@ -33,6 +33,7 @@ class UserModel
// 处理个人详情数据
if
(
isset
(
$userData
[
'data'
])
&&
!
empty
(
$userData
[
'data'
]))
{
$result
=
$userData
[
'data'
];
$result
[
'gender'
]
=
$result
[
'gender'
]
==
1
?
'男'
:
'女'
;
$result
[
'head_ico'
]
=
Images
::
getImageUrl
(
$result
[
'head_ico'
],
128
,
128
);
}
...
...
@@ -291,10 +292,10 @@ class UserModel
}
else
if
(
empty
(
$consignee
))
{
$result
[
'code'
]
=
403
;
$result
[
'message'
]
=
'请输入收件人姓名'
;
}
else
if
(
!
empty
(
$email
)
&&
Helpers
::
verifyEmail
(
$email
))
{
}
else
if
(
!
empty
(
$email
)
&&
!
Helpers
::
verifyEmail
(
$email
))
{
$result
[
'code'
]
=
404
;
$result
[
'message'
]
=
'输入的邮箱地址格式不正确'
;
}
else
if
(
!
empty
(
$mobile
)
&&
Helpers
::
verifyMobile
(
$mobile
))
{
}
else
if
(
!
empty
(
$mobile
)
&&
!
Helpers
::
verifyMobile
(
$mobile
))
{
$result
[
'code'
]
=
404
;
$result
[
'message'
]
=
'输入的手机号码格式不正确'
;
}
else
{
...
...
@@ -302,7 +303,8 @@ class UserModel
$address
=
UserData
::
saveAddressData
(
$uid
,
$address
,
$area_code
,
$consignee
,
$email
,
$id
,
$mobile
,
$zip_code
);
// 处理返回结果
if
(
isset
(
$address
[
'code'
])
&&
$address
[
'code'
]
==
200
)
{
$result
=
$address
[
'data'
];
$result
[
'code'
]
=
$address
[
'code'
];
$result
[
'message'
]
=
$address
[
'message'
];
}
}
...
...
@@ -348,7 +350,20 @@ class UserModel
// 处理意见反馈数据
if
(
isset
(
$suggest
[
'data'
])
&&
!
empty
(
$suggest
[
'data'
]))
{
$result
=
$suggest
[
'data'
];
$one
=
array
();
foreach
(
$suggest
[
'data'
][
'list'
]
as
$val
)
{
$one
=
array
();
$one
[
'hasImage'
]
=
$val
[
'has_image'
];
$one
[
'imgUrl'
]
=
Helpers
::
getImageUrl
(
$val
[
'cover_image'
],
640
,
240
);
$one
[
'title'
]
=
$val
[
'filter_content'
];
$one
[
'content'
]
=
$val
[
'reply_content'
];
$one
[
'good'
]
=
$val
[
'is_reliable'
];
$one
[
'bad'
]
=
!
$val
[
'is_reliable'
];
$one
[
'goodNum'
]
=
$val
[
'reliable'
];
$one
[
'badNum'
]
=
$val
[
'unreliable'
];
$result
[]
=
$one
;
}
}
return
$result
;
...
...
yohobuy/m.yohobuy.com/application/modules/Product/controllers/Newsale.php
View file @
bc5ac90
...
...
@@ -112,7 +112,6 @@ class NewsaleController extends AbstractAction
$gender
=
Helpers
::
getGenderByCookie
();
$result
=
\Product\NewsaleModel
::
selectTopData
(
$gender
,
$sort
,
$tab_id
,
$notab
,
$limit
,
$page
);
}
if
(
empty
(
$result
))
{
echo
' '
;
}
else
{
...
...
Please
register
or
login
to post a comment