Authored by yangyang

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

... ... @@ -21,3 +21,23 @@ DATA:
---------------
{"code":200,"message":"Last Search List.","data":{"product_list":[{"brand_id":144,"market_price":590,"vip_price":0,"sales_price":590,"vip_discount_type":1,"product_id":"150783","max_sort_id":3,"storage_num":38,"product_name":"VANS M JT CARGO\t ","cn_alphabet":"VANSMJTCARGOVN02NJCMA","product_skn":51088175,"brand_name":"VANS","is_new":"Y","is_discount":"N","is_advance":"N","is_soon_sold_out":"N","is_limited":"N","is_yohood":"N","sales_phrase":"","goods_list":[{"goods_id":"207531","color_name":"\u7eff\u8272","color_id":"6","color_code":"#47ba17","color_value":"","images_url":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02b2ed1aad22f35ed07f7d98a9de5d6ebf.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90","product_skc":"202881","is_default":"N"}],"tags":[],"default_images":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02b2ed1aad22f35ed07f7d98a9de5d6ebf.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90"},{"brand_id":144,"market_price":490,"vip_price":0,"sales_price":490,"vip_discount_type":1,"product_id":"150781","max_sort_id":3,"storage_num":3,"product_name":"VANS M WARRICK\t ","cn_alphabet":"VANSMWARRICKVN02NIBHH","product_skn":51088174,"brand_name":"VANS","is_new":"Y","is_discount":"N","is_advance":"N","is_soon_sold_out":"N","is_limited":"N","is_yohood":"N","sales_phrase":"","goods_list":[{"goods_id":"207529","color_name":"\u9ed1\u8272","color_id":"2","color_code":"#333333","color_value":"","images_url":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02f401305cc7af370a894d7a094bd6f64c.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90","product_skc":"202880","is_default":"N"}],"tags":[],"default_images":"http:\/\/img13.static.yhbimg.com\/goodsimg\/2015\/09\/25\/10\/02f401305cc7af370a894d7a094bd6f64c.jpg?imageMogr2\/thumbnail\/{width}x{height}\/extent\/{width}x{height}\/background\/d2hpdGU=\/position\/center\/quality\/90"}],"page_total":2,"total":52,"page":1,"content_code":""},"md5":"b66258633f505562a520e0fccf0b8803"}
## 检测是否嵌入APP, APP里直接使用浏览器打开HTML5页面
URL:
---------------
正式: http://m.yohobuy.com/appembed
测试: http://buy.test.yoho.cn/appembed
DATA:
---------------
{
"open": "Y",
"url": "http://m.yohobuy.com"
}
{
"open": "N",
"url": "http://m.yohobuy.com"
}
\ No newline at end of file
... ...
... ... @@ -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();
... ...
... ... @@ -70,7 +70,7 @@ class NewSaleProcess
$tabItem = array();
$tabItem['title'] = $one;
$tabItem['dataId'] = $key;
if ($key === 1) {
if ($key === 0) {
$tabItem['focus'] = true;
}
$result['tabs'][] = $tabItem;
... ...
... ... @@ -17,6 +17,12 @@ server
allow 172.16.0.0/16;
deny all;
#检测是否嵌入APP
location = /appembed {
default_type application/json;
return 200 '{"open":"Y","url":"http://m.yohobuy.com"}';
}
#账号相关
location = /reg.html {
root /Data/code/git/yohobuy/assets;
... ...
... ... @@ -37,7 +37,7 @@ function getOrders() {
}
inAjax = true;
loading.show();
loading.showLoadingMask();
$.ajax({
type: 'GET',
... ... @@ -62,7 +62,7 @@ function getOrders() {
}
inAjax = false;
loading.hide();
loading.hideLoadingMask();
}
});
}
... ...
... ... @@ -20,7 +20,7 @@ goodsSwiper = new Swiper('.banner-swiper', {
lazyLoadingInPrevNext: true,
loop: true,
paginationClickable: true,
pagination: '.swiper-pagination',
pagination: '.banner-top .pagination-inner',
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev'
});
... ...
$vip: sprite-map("me/vip/*.png");
.my-page {
background: #f0f0f0;
... ... @@ -27,8 +26,8 @@ $vip: sprite-map("me/vip/*.png");
.vip-icon {
display: inline-block;
width: pxToRem(70px);
height: pxToRem(30px);
width: pxToRem(72px);
height: pxToRem(32px);
vertical-align: middle;
}
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
@import "home", "vip-grade", "order", "order-detail", "coupons", "personal-details", "yoho-coin", "fav", "suggest", "address", "online-service";
... ...
... ... @@ -2,6 +2,7 @@
background: #f0f0f0;
.order {
position: relative;
display: block;
background: #fff;
margin: 30rem / $pxConvertRem 0;
... ... @@ -64,17 +65,38 @@
}
.no-order {
position: absolute;
background: #fff;
text-align: center;
color: #f0f0f0;
top: 50%;
margin-top: -220rem / $pxConvertRem;
width: 100%;
.iconfont {
font-size: 50px;
.icon {
width: 153rem / $pxConvertRem;
height: 196rem / $pxConvertRem;
background: image-url('me/no-order.png') no-repeat;
background-size: 100%;
margin: 0 auto;
}
span {
display: block;
color: #b0b0b0;
font-size: 24rem / $pxConvertRem;
margin: 30rem / $pxConvertRem 0 110rem / $pxConvertRem;
}
.walk-way {
display: block;
height: 80rem / pxConvertRem;
line-height: 80rem / $pxConvertRem;
width: 70%;
margin: 0 auto;
text-align: center;
font-size: 30rem / $pxConvertRem;
color: #fff;
background: #fff;
background: #444;
@include border-radius(5px);
}
}
... ...
$vip: sprite-map("me/vip/*.png", $spacing: 10px);
.vip-grade-page {
background: #f0f0f0;
padding-bottom: 30rem / $pxConvertRem;
... ...
{{#if walkwayUrl}}
<div class="no-order">
<span class="iconfont">&#xe632;</span>
<div class="icon"></div>
<span>你还没有订单</span>
<a class="walk-way" href="{{walkwayUrl}}">随便逛逛</a>
</div>
... ...
... ... @@ -353,19 +353,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(
... ...
... ... @@ -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)里再取数据.
... ...
... ... @@ -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;
... ...