Authored by Lynnic

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

Conflicts:
	docs/data-structure.md
Showing 31 changed files with 800 additions and 426 deletions
... ... @@ -817,7 +817,7 @@
},
...
],
totalNum: 20
}
... ... @@ -1266,6 +1266,7 @@
},
...
],
sizes: [
{
id: 2,
... ... @@ -1283,7 +1284,7 @@
'id' : '',
'preferenceUrl' :'',
}
### 评价列表页面
### 评价列表页面
{
'comments':{
'list' : [
... ... @@ -1375,5 +1376,7 @@
'entitle' : 'LIFESTYLE',
}
],
'showYohood' : true/false
'showYohood' : true/false,
'yohoodHref' : '/yohood'
}
... ...
... ... @@ -25,6 +25,21 @@ class HelpData
return Yohobuy::post(Yohobuy::API_URL, $param, $param);
}
/*
* 获取帮助中心列表
*/
public static function serviceDetail($code)
{
//构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.help.detail';
$param['code'] = $code;
$param['return_type'] = 'html';
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::post(Yohobuy::API_URL, $param, true);
}
}
... ...
... ... @@ -67,5 +67,17 @@ class IndexData
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/resource/home', $param);
}
/**
* 获取频道选择页数据
*
* @return array
*/
public static function channelData()
{
$param = Yohobuy::param();
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::SERVICE_URL . 'operations/api/v5/entrance/getEntrance',$param,3600);
}
}
... ...
... ... @@ -190,7 +190,7 @@ class Helpers
*/
public static function transPrice($price)
{
return (!empty($price) && !is_float($price)) ? $price . '.00' : $price;
return (!empty($price) && !is_float($price)) ? $price . '.00' : number_format($price, 2, '.', '');
}
/**
... ...
... ... @@ -114,7 +114,7 @@ function search() {
}
function scrollHandler() {
if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
if (!end || $(window).scrollTop() + winH >= $(document).height() - 200) {
search();
}
}
... ...
... ... @@ -18,11 +18,6 @@ var goodsDiscountEl = document.getElementById('goodsDiscount'),
var $cart = $('.cart-bar');
require('./desc');
require('./comments-consults');
require('../recommend-for-you-product-desc');
//add extra marign-bottom for footer to show the yoho copyright
function showFooter() {
var $cartBar = $('.cart-bar');
... ... @@ -74,6 +69,10 @@ if (goodsDiscountHammer && $discountFolder.children().length > 0) {
});
}
require('./desc');
require('./comments-consults');
require('../recommend-for-you-product-desc');
//购物车商品数量
$.ajax({
type: 'GET',
... ...
... ... @@ -73,14 +73,13 @@ if (addToCartHammer) {
addToCartHammer.on('tap', function(e) {
chosePanel.show();
// 统计代码:用于统计用户加入购物车的动作
// if (window._yas) {
// window._yas.sendCustomInfo({
// pd: productId,
// by: 1
// }, false);
// }
//统计代码:用于统计用户加入购物车的动作
if (window._yas) {
window._yas.sendCustomInfo({
pd: productId,
by: 1
}, true);
}
});
}
... ...
... ... @@ -10,28 +10,51 @@ var Swiper = require('yoho.iswiper'),
var recommendSwiper,
$recommendForYou = $('.recommend-for-you'),
preferenceUrl = $('#preferenceUrl').val();
if (preferenceUrl) {
$.get(preferenceUrl).then(function(html) {
if (html.length < 5) {
$recommendForYou.css('display', 'none');
} else {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
preferenceUrl = $('#preferenceUrl').val(),
winH = $(window).height(),
end = false,
requesting = false;
function request() {
if (requesting || end) {
return;
}
requesting = true;
if (preferenceUrl) {
$.get(preferenceUrl).then(function(html) {
if (html.length < 5) {
$recommendForYou.css('display', 'none');
} else {
$recommendForYou.html(html).show();
if ($('#swiper-recommend').length) {
recommendSwiper = new Swiper('#swiper-recommend', {
slidesPerView: 'auto',
grabCursor: true,
slideElement: 'a',
lazyLoading: true,
watchSlidesVisibility: true
});
}
}
}
window.rePosFooter();
requesting = false;
end = true;
}).fail(function() {
$recommendForYou.hide();
});
}).fail(function() {
$recommendForYou.hide();
});
}
}
function scrollHandler() {
if (!end || $(window).scrollTop() + winH >= $(document).height() - 50) {
request();
}
}
$(window).scroll(function() {
window.requestAnimationFrame(scrollHandler);
});
... ...
... ... @@ -7,23 +7,23 @@
var $ = require('jquery'),
lazyLoad = require('yoho.lazyload');
var chosePanel = require('./chose-panel');
//var chosePanel = require('./chose-panel');
lazyLoad($('.lazy'));
$('.gift-advance-page').on('touchstart', '.chose', function() {
var id = $(this).closest('.gift-advance-good').data('id');
$.ajax({
type: 'GET',
url: '/shoppingCart/goodinfo',
data: {
id: id
},
success: function(data) {
if (data.code === 200) {
chosePanel.show(data.data);
}
}
});
});
\ No newline at end of file
//$('.gift-advance-page').on('touchstart', '.chose', function() {
// var id = $(this).closest('.gift-advance-good').data('id');
//
// $.ajax({
// type: 'GET',
// url: '/shoppingCart/goodinfo',
// data: {
// id: id
// },
// success: function(data) {
// if (data.code === 200) {
// chosePanel.show(data.data);
// }
// }
// });
//});
\ No newline at end of file
... ...
... ... @@ -9,7 +9,8 @@ var $ = require('jquery'),
lazyLoad = require('yoho.lazyload');
var dialog = require('../me/dialog'),
tip = require('../plugin/tip');
tip = require('../plugin/tip'),
chosePanel = require('./chose-panel');
var $names;
... ... @@ -156,4 +157,23 @@ $('.btn-balance').on('touchend', function() {
window.location.href = '/shoppingCart/orderEnsure?cartType=' + cartType;
});
$('.advance-buy').on('touchend', function() {
var $advanceBuy = $('#advanceBuy'),
$mainCart = $('#mainCart');
if ($advanceBuy.hasClass('hide')) {
$mainCart.removeClass('show').addClass('hide');
$advanceBuy.removeClass('hide').addClass('show');
} else {
$advanceBuy.removeClass('show').addClass('hide');
$mainCart.removeClass('hide').addClass('show');
}
});
$('.chose').on('touchend', function() {
//var id = $(this).closest('.gift-advance-good').data('id');
chosePanel.show();
});
... ...
... ... @@ -15,6 +15,7 @@ var dispatchModeHammer,
dispatchTimeHammer,
$invoice = $('.invoice'),
$price = $('.price-cal'),
payType,
priceTmpl = Handlebars.compile($('#tmpl-price').html());
lazyLoad();
... ... @@ -80,6 +81,7 @@ function orderCompute() {
sumPrice: res.order_amount,
salePrice: res.discount_amount,
freight: res.promotion_formula_list[1].promotion_amount,
couponPrice: res.coupon_amount,
yohoCoin: res.use_yoho_coin,
price: res.last_order_amount
});
... ... @@ -98,24 +100,34 @@ function submitOrder() {
data: {
addressId: orderInfo('addressId'),
cartType: orderInfo('cartType'),
deliveryId: orderInfo('deliveryId') || 1,
deliveryTimeId: orderInfo('deliveryTimeId') || 1,
invoiceText: orderInfo('invoiceText'),
invoiceType: orderInfo('invoiceType'),
msg: orderInfo('msg'),
deliveryId: orderInfo('deliveryId'),
deliveryTimeId: orderInfo('deliveryTimeId'),
invoiceText: $invoice.find('[name="invoice-title"]').val() || orderInfo('invoiceText'),
invoiceType: $invoice.find('.invoice-type').val() || orderInfo('invoiceType'),
msg: $('#msg').find('input').val() || orderInfo('msg'),
paymentTypeId: orderInfo('paymentTypeId'),
paymentType: orderInfo('paymentType'), //支付方式
couponCode: orderInfo('couponCode'),
yohoCoin: orderInfo('yohoCoin')
}
}).then(function(res) {
var url;
if (!res) {
tip.show('网络出错');
return;
}
if (res.code !== 200) {
tip.show(res.message || '网络出错');
if (res.code === 200) {
if (payType === 2) {
// 货到付款的进入订单页面
url = '/home/orderDetail?order_code=' + res.data.order_code;
} else {
url = '/home/pay?order_code=' + res.data.order_code;
}
window.location.href = url;
} else {
console.log(1);
tip.show(res.messege || '网络出错');
}
}).fail(function() {
tip.show('网络出错');
... ... @@ -124,7 +136,7 @@ function submitOrder() {
// 界面点击,状态存 cookie
if (!orderInfo('addressId')) {
orderInfo('addressId', $('.address-wrap').data('address-id'));
orderInfo('addressId', $('.address-wrap').data('id'));
}
$('.dispatch-mode').on('touchend', 'li', function() {
... ... @@ -166,7 +178,10 @@ $('#msg').find('input').on('blur', function() {
});
$('.pay-mode').on('click', 'li', function() {
orderInfo('paymentTypeId', $(this).data('pay-id'));
orderInfo('paymentType', $(this).data('pay-type'));
var $this = $(this);
orderInfo('paymentTypeId', $this.data('pay-id'));
orderInfo('paymentType', $this.data('pay-type'));
payType = $this.data('pay-type');
submitOrder();
});
... ...
... ... @@ -3,6 +3,7 @@
* @author: bikai<kai.bi@yoho.cn>
* @date: 2015/12/14
*/
var $ = require('jquery');
var info = window.cookie('order-info');
// info 必须是 JSON 字符串
... ... @@ -10,10 +11,10 @@ try {
info = JSON.parse(info);
} catch (e) {
info = {
deliveryId: null,
deliveryTimeId: null,
paymentTypeId: null,
yohoCoin: null,
deliveryId: 1,
deliveryTimeId: 1,
paymentTypeId: 1,
yohoCoin: $('.coin').data('yoho-coin') || 0,
addressId: null,
couponCode: null,
couponValue: null,
... ...
... ... @@ -30,6 +30,7 @@ $newCoupon.on('submit', function() {
if (res.code === 200) {
tip.show('优惠券可用');
orderInfo('couponCode', res.data.coupon_code);
orderInfo('couponValue', res.data.coupon_value);
window.location.href = '/shoppingCart/orderEnsure?coupon_code=' + res.data.coupon_code;
} else {
tip.show(res.message);
... ...
... ... @@ -21,7 +21,7 @@
"yoho.iswiper": "3.0.1",
"iscroll": "5.1.2",
"import-style": "1.0.0",
"yoho.lazyload": "1.1.3",
"yoho.lazyload": "1.1.4",
"yoho.handlebars": "3.0.3",
"yoho.hammer": "2.0.4"
},
... ...
... ... @@ -2,6 +2,16 @@
width: 100%;
overflow: hidden;
margin: 0 auto;
#yohood {
background-color: transparent;
background-image: image-url('yohood.png');
background-size: 40%;
background-repeat: no-repeat;
background-position-x: 26%;
background-position-y: 36%;
border: none;
border-bottom: 4px solid #fff;
}
.index-header {
box-sizing: border-box;
padding: 0 20rem / $pxConvertRem;
... ...
... ... @@ -177,6 +177,117 @@
font-size: 28rem / $pxConvertRem;
}
}
.gift-advance-good {
position: relative;
padding: 20rem / $pxConvertRem 0;
margin-left: 34rem / $pxConvertRem;
height: 160rem / $pxConvertRem;
border-bottom: 1px solid #e0e0e0;
&:last-child {
border-bottom: none;
}
}
.advance-block .gift-advance-good:last-child {
border-bottom: none;
}
.advance-block:last-child .gift-advance-good:last-child {
border-bottom: 1px solid #e0e0e0;
}
.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;
height: 25rem / $pxConvertRem;
color: #fff;
text-align: center;
background: #a1ce4e;
&:before {
content: '赠品';
}
}
.deps {
margin-left: 135rem / $pxConvertRem;
}
.name {
font-size: 28rem / $pxConvertRem;
}
.row:nth-child(2) {
font-size: 22rem / $pxConvertRem;
height: 45rem / $pxConvertRem;
line-height: 45rem / $pxConvertRem;
> span {
margin-right: 15rem / $pxConvertRem;
}
}
.row:nth-child(3) {
position: relative;
}
.color, .size {
color: #b6b6b6;
}
.price {
font-size: 24rem / $pxConvertRem;
color: #000;
}
.count {
font-size: 20rem / $pxConvertRem;
color: #999;
margin-left: 22rem / $pxConvertRem;
}
.chose {
position: absolute;
width: 88rem / $pxConvertRem;
height: 58rem / $pxConvertRem;
background: #f8f8f8;
border: 1px solid #ccc;
right: 20rem / $pxConvertRem;
top: 71rem / $pxConvertRem;
font-size: 26rem / $pxConvertRem;
}
.title {
height: 50rem / $pxConvertRem;
line-height: 50rem / $pxConvertRem;
padding-left: 20rem / $pxConvertRem;
font-size: 24rem / $pxConvertRem;
background: #f8f8f8;
}
.advance-block .tag {
background: #eb76aa;
&:before {
content: '加价购';
}
}
}
.shopping-cart-zero{
.cart-zero{
... ...
... ... @@ -93,7 +93,7 @@
}
.coupon-count {
padding: 5rem / $pxConvertRem;
padding: 5rem / $pxConvertRem 15rem / $pxConvertRem;
background: #f00;
color: #fff;
@include border-radius(10px);
... ... @@ -104,6 +104,14 @@
.coin-check {
float: right;
color: #999;
&.used {
color: #f00;
}
.iconfont {
color: #999;
}
}
.coin-check {
... ... @@ -115,6 +123,10 @@
color: #000;
}
em {
color: #f00;
}
}
.checkbox.icon-checkbox {
... ... @@ -187,6 +199,10 @@
}
}
.price-cal {
font-family: monospace;
}
.cost {
border-top: 1px solid #f7f7f7;
line-height: 100rem / $pxConvertRem;
... ...
{{> layout/header}}
{{ iHelp}}
{{{iHelp}}}
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<div class="iHelp">
<ul>
{{# iHelp}}
<li><a href="/home/helpDetail?code={{ code}}"><span>{{ name}}</span><i class="iconfont num">&#xe604;</i></a></li>
<li><a href="{{url}}"><span>{{ name}}</span><i class="iconfont num">&#xe604;</i></a></li>
{{/ iHelp}}
</ul>
</div>
... ...
... ... @@ -23,7 +23,7 @@
<a href="{{href}}" class="list-item">{{title}} <span class="lighter">{{entitle}}</span> <span class="iconfont right-icon">&#xe614;</span></a>
{{/channelList}}
{{#showYohood}}
<a href="/yohood" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a>
<a href="{{yohoodHref}}" id="yohood" class="list-item"> <span class="iconfont right-icon">&#xe614;</span></a>
{{/showYohood}}
</div>
</div>
... ...
{{> layout/header}}
<div class="shopping-cart-page yoho-page" style="display: none;">
<div id="mainCart" class="shopping-cart-page yoho-page">
{{# shoppingCart}}
{{#if cartNav}}
<ul class="cart-nav clearfix">
... ... @@ -44,7 +45,23 @@
{{/ shoppingCart}}
</div>
<div class="shopping-cart-zero yoho-page">
<div id="advanceBuy" class="shopping-cart-page yoho-page hide">
{{# shoppingCart}}
{{# commonCart}}
{{# advanceBuy}}
<span>
{{promotionTitle}}
</span>
{{# goods}}
{{> shopping-cart/gift-advance-good}}
{{/ goods}}
{{/ advanceBuy}}
{{/ commonCart}}
{{/ shoppingCart}}
</div>
<div class="shopping-cart-zero yoho-page hide">
<div class="cart-zero">
<i class="iconfont">&#xe62c</i>
<p>您的购物车暂无商品</p>
... ... @@ -52,4 +69,5 @@
</div>
{{> product/recommend-for-you}}
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
{{> layout/header}}
<div class="order-ensure-page yoho-page">
{{# orderEnsure}}
<a class="address-wrap block" href="/shoppingCart/selectAddress" data-address-id="{{addressId}}">
<a class="address-wrap block" data-id="{{addressId}}" href="/shoppingCart/selectAddress">
<p class="infos">
收货地址
<span class="per-info">{{name}} {{phoneNum}}</span>
... ... @@ -41,10 +41,9 @@
<section class="block">
<ul class="sale-invoice">
{{#if coupon}}
{{# coupon}}
<li class="coupon">
<a href="/shoppingCart/selectCoupon">
<!-- <a href="{{url}}"> -->
<span class="title">优惠券</span>
{{#if count}}
<span class="coupon-count">
... ... @@ -65,18 +64,16 @@
{{/if}}
</a>
</li>
{{/if}}
{{/coupon}}
{{# yohoCoin}}
<li class="coin" data-yoho-coin="{{.}}">
<span class="title">YOHO币</span>
<span class="desc">可抵用¥{{.}}</span>
<span class="coin-check">
<em>- ¥ {{.}}</em>
<i class="iconfont checkbox icon-cb-checked"></i>
</span>
</li>
{{/ yohoCoin}}
<li class="coin" data-yoho-coin="{{yohoCoin}}">
<span class="title">YOHO币</span>
<span class="desc">可抵用¥{{yohoCoin}}</span>
<span class="coin-check">
<em>- ¥ {{yohoCoin}}</em>
<i class="iconfont checkbox icon-cb-checked"></i>
</span>
</li>
{{#if invoice}}
<li class="invoice {{#if needInvoice}}focus{{/if}}">
... ... @@ -114,8 +111,14 @@
</li>
<li>
<span>运费</span>
+ ¥{{freight}}
+ {{freight}}
</li>
{{#couponPrice}}
<li>
<span>优惠券</span>
- ¥{{.}}
</li>
{{/couponPrice}}
<li>
<span>YOHO币</span>
- ¥{{yohoCoin}}
... ... @@ -156,6 +159,12 @@
<span>运费</span>
+ \{{freight}}
</li>
\{{#couponPrice}}
<li>
<span>优惠券</span>
- ¥\{{.}}
</li>
\{{/couponPrice}}
<li>
<span>YOHO币</span>
- ¥\{{yohoCoin}}
... ...
... ... @@ -16,16 +16,16 @@
</a>
</li>
{{/ freebie}}
{{# advanceBuy}}
{{#if advanceBuy}}
<li class="advance-buy">
<span class="iconfont">&#xe61b;</span>
加价购
<a href={{url}}>
<a>
<span class="count">{{count}}</span>
<span class="iconfont icon-right-arrow">&#xe614;</span>
</a>
</li>
{{/ advanceBuy}}
{{/if}}
</ul>
{{/if}}
... ... @@ -54,4 +54,4 @@
<a class="btn-balance">
结算
</a>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -845,37 +845,45 @@ class HomeController extends AbstractAction
$this->_view->display('order-detail', array(
'orderDetailPage' => true,
'orderDetail' => OrderModel::orderDetail($orderCode, $this->_uid, $this->_session),
'orderDetail' => OrderModel::orderDetail($orderCode, $this->_uid, $this->_usession),
));
}
/**
* 帮助列表页
*/
/**
* 帮助中心列表页
*/
public function helpAction()
{
{
$service = Home\HelpModel::serviceInfo();
$this->setTitle('帮助中心');
$this->setNavHeader('帮助中心');
$data = array(
'iHelp' => Home\HelpModel::serviceInfo(),
'iHelp' =>$service,
);
$this->_view->display('i-help', $data);
}
/**
* 帮助列表页
* 帮助中心列表详细信息
*/
public function helpDetailAction()
{
$this->setTitle('帮助中心');
$this->setNavHeader('帮助中心');
$data = array(
'iHelp' => array(
array('name' => '新用户注册'),
)
);
$this->_view->display('helpDetail', $data);
public function helpDetailAction() {
$caption = $this->get('caption', '帮助中心');
$code = $this->get('code', 0);
if (empty($code)) {
$this->error();
}
$this->setTitle($caption);
$this->setNavHeader($caption);
$service = Home\HelpModel::serviceDetail($code);
$this->_view->display('helpDetail', array(
'iHelp' => $service,
));
}
/**
* YOHO币详情 新版
*/
... ...
... ... @@ -23,16 +23,16 @@ class IndexController extends AbstractAction
// 设置浏览器缓存5分钟
$this->setExpires(300);
}
$result = Index\HomeModel::getChannel();
$result['background'] = Index\HomeModel::getBgImage();
$result['channelPage'] = true;
$result['showDownloadApp'] = true;
$result['searchUrl'] = Helpers::url('', null, 'search');
$result['pageFooter'] = true;
// 渲染模板
$this->_view->display('index', array(
'background' => Index\HomeModel::getBgImage(),
'channelPage' => true,
'showDownloadApp'=>true,
'searchUrl' => Helpers::url('', null, 'search'),
'pageFooter' => true,
));
$this->_view->display('index', $result);
}
/**
* 设置升级公告路由
*
... ...
... ... @@ -13,6 +13,7 @@ class ShoppingCartController extends AbstractAction
/*
* 购物车首页
*/
public function indexAction()
{
$this->setTitle('购物车');
... ... @@ -29,239 +30,243 @@ class ShoppingCartController extends AbstractAction
// 渲染模板
$this->_view->display('index', $data);
}
/*
* 异步获取购物车数据
*/
public function getCartDataAction()
{
$result = array();
$result = array();
if ($this->isAjax()) {
$shoppingKey = Helpers::getShoppingKeyByCookie();
$uid = $this->getUid(true);
$result = CartModel::getCartData($uid, $shoppingKey);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 购物车商品选择与取消
*/
public function selectAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->post('id', 0);
$uid = $this->getUid(true);
$shoppingKey = $this->getSession('shoppingKey');
$result = CartModel::selectGoods($uid, $productId, $shoppingKey);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 移出购物车
*/
public function delAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->post('id', 0);
$uid = $this->getUid(true);
$shoppingKey = $this->getSession('shoppingKey');
$result = CartModel::removeFromCart($uid, $productId, $shoppingKey);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 移入收藏夹
*/
public function colAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->post('id', 0);
$uid = $this->getUid(true);
$result = CartModel::addToFav($uid, $productId);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/*
* 获取购物车商品数据
*/
public function goodinfoAction()
{
$result = array();
if ($this->isAjax()) {
$num = $this->get('buy_num', 1);
$skn = $this->get('id', 1);
$uid = $this->getUid(true);
$result = CartModel::cartProductData($uid, $skn, $num); // 测试skn的ID为51172055
$result['num'] = $num;
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
if ($this->isAjax()) {
$shoppingKey = Helpers::getShoppingKeyByCookie();
$uid = $this->getUid(true);
/*
* 获取购物车加价购商品数据
*/
$result = CartModel::getCartData($uid, $shoppingKey);
}
public function giftinfoAction()
{
$result = array();
if ($this->isAjax()) {
$skn = $this->get('skn', null);
$promotionId = $this->get('promotionId', null);
$result = CartModel::giftProductData($skn, $promotionId);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
/**
* 修改购物车商品数据
*/
public function modifyAction()
{
$result = array();
if ($this->isAjax()) {
$shoppingKey = $this->getSession('shoppingKey');
$uid = $this->getUid(true);
$params = array();
$params['old_product_sku'] = $this->post('old_product_sku', 0);
$params['new_product_sku'] = $this->post('new_product_sku', 0);
$params['buy_number'] = $this->post('buy_number', 0);
$params['selected'] = $this->post('selected', null);
$result = CartModel::modifyCartProduct($uid, $params, $shoppingKey);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 购物车商品选择与取消
*/
public function selectAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->post('id', 0);
$uid = $this->getUid(true);
$shoppingKey = $this->getSession('shoppingKey');
$result = CartModel::selectGoods($uid, $productId, $shoppingKey);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 移出购物车
*/
public function delAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->post('id', 0);
$uid = $this->getUid(true);
$shoppingKey = $this->getSession('shoppingKey');
$result = CartModel::removeFromCart($uid, $productId, $shoppingKey);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 移入收藏夹
*/
public function colAction()
{
$result = array();
if ($this->isAjax()) {
$productId = $this->post('id', 0);
$uid = $this->getUid(true);
$result = CartModel::addToFav($uid, $productId);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/*
* 获取购物车商品数据
*/
public function goodinfoAction()
{
$result = array();
if ($this->isAjax()) {
$num = $this->get('buy_num', 1);
$skn = $this->get('id', 1);
$uid = $this->getUid(true);
$result = CartModel::cartProductData($uid, $skn, $num); // 测试skn的ID为51172055
$result['num'] = $num;
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/*
* 获取购物车加价购商品数据
*/
public function giftinfoAction()
{
$result = array();
if ($this->isAjax()) {
$skn = $this->get('skn', null);
$promotionId = $this->get('promotionId', null);
$result = CartModel::giftProductData($skn, $promotionId);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 修改购物车商品数据
*/
public function modifyAction()
{
$result = array();
if ($this->isAjax()) {
$shoppingKey = $this->getSession('shoppingKey');
$uid = $this->getUid(true);
$params = array();
$params['old_product_sku']= $this->post('old_product_sku', 0);
$params['new_product_sku']= $this->post('new_product_sku', 0);
$params['buy_number']= $this->post('buy_number', 0);
$params['selected']= $this->post('selected', null);
$result = CartModel::modifyCartProduct($uid, $params, $shoppingKey);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 购物车结算请求
*/
public function orderEnsureAction()
{
$this->setTitle('购物车');
$this->setNavHeader('购物车');
$cartType = $this->post('cartType', 'ordinary');
$cookieData = $this->getCookie('order-info', null);
$uid = $this->getUid(true);
$data = array(
'orderEnsurePage' => true,
'orderEnsure' => CartModel::cartPay($uid, $cartType, $cookieData)
);
/**
* 购物车结算请求
*/
public function orderEnsureAction()
{
$this->setTitle('购物车');
$this->setNavHeader('购物车');
$cartType = $this->post('cartType', 'ordinary');
$cookieData = $this->getCookie('order-info', null);
$uid = $this->getUid(true);
$data = array(
'orderEnsurePage' => true,
'orderEnsure' => CartModel::cartPay($uid, $cartType, $cookieData)
);
// var_dump($data);
$this->_view->display('order-ensure', $data);
}
/**
* 购物车选择改变字段,重新运算订单数据
*/
public function orderComputeAction()
{
$result = array();
if ($this->isAjax()) {
$cartType = $this->post('cartType', 'ordinary');
$deliveryWay = $this->post('deliveryId', 1);
$paymentType = $this->post('paymentTypeId', 1);
$couponCode = $this->post('couponCode', null);
$yohoCoin = $this->post('yohoCoin', null);
$uid = $this->getUid(true);
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 购物车输入优惠券码使用优惠券
*/
public function couponSearchAction()
{
$result = array();
if ($this->isAjax()) {
$couponCode = $this->get('couponCode', '');
$uid = $this->getUid(true);
$result = CartModel::searchCoupon($uid, $couponCode);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 购物车结算--获取优惠券列表
*/
public function couponListAction()
{
$result = array();
if ($this->isAjax()) {
$uid = $this->getUid(true);
$page = $this->get('page', 1);
$result = CartModel::getCouponList($uid);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
$this->_view->display('order-ensure', $data);
}
/**
* 购物车选择改变字段,重新运算订单数据
*/
public function orderComputeAction()
{
$result = array();
if ($this->isAjax()) {
$cartType = $this->post('cartType', 'ordinary');
$deliveryWay = $this->post('deliveryId', 1);
$paymentType = $this->post('paymentTypeId', 1);
$couponCode = $this->post('couponCode', null);
$yohoCoin = $this->post('yohoCoin', null);
$uid = $this->getUid(true);
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 购物车输入优惠券码使用优惠券
*/
public function couponSearchAction()
{
$result = array();
if ($this->isAjax()) {
$couponCode = $this->get('couponCode', '');
$uid = $this->getUid(true);
$result = CartModel::searchCoupon($uid, $couponCode);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 购物车结算--获取优惠券列表
*/
public function couponListAction()
{
$result = array();
if ($this->isAjax()) {
$uid = $this->getUid(true);
$page = $this->get('page', 1);
$result = CartModel::getCouponList($uid);
}
if (empty($result)) {
echo ' ';
} else {
$this->echoJson($result);
}
}
/**
* 下单流程 选择地址
... ... @@ -272,7 +277,7 @@ class ShoppingCartController extends AbstractAction
$this->setTitle('选择地址');
$this->setNavHeader('选择地址', Helpers::url('/shoppingCart/orderEnsure'));
$uid = $this->getUid(true);
$uid = $this->getUid(true);
$address = UserModel::getAddressData($uid);
$this->_view->display('select-address', array(
... ... @@ -296,36 +301,72 @@ class ShoppingCartController extends AbstractAction
));
}
/**
* 确认结算订单
*/
public function orderSubAction()
{
$result = array();
if ($this->isAjax()) {
$uid = $this->getUid(true);
$addressId = $this->post('addressId', null);
$cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车
$deliveryTime = $this->post('deliveryTimeId', 1); // 默认只工作日配送
$deliveryWay = $this->post('deliveryId', 1); // 默认普通快递
$invoiceTitle = $this->post('invoiceText', null);
$invoiceId = $this->post('invoiceType', null);
$paymentId = $this->post('paymentTypeId', 15);
$paymentType = $this->post('paymentType', 1); // 默认在线支付
$remark = $this->post('msg', null);
$couponCode = $this->post('couponCode', null);
$yohoCoin = $this->post('yohoCoin', 1);
$result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin);
}
if (empty($result)) {
echo ' ';
} else {
// 提交成功清除Cookie
$this->setCookie('order-info', null);
$this->echoJson($result);
}
}
/**
* 确认结算订单
*/
public function orderSubAction()
{
$result = array();
if ($this->isAjax()) {
$uid = $this->getUid(true);
$addressId = $this->post('addressId', null);
$cartType = $this->post('cartType', 'ordinary'); // 默认普通购物车
$deliveryTime = $this->post('deliveryTimeId', 1); // 默认只工作日配送
$deliveryWay = $this->post('deliveryId', 1); // 默认普通快递
$invoiceTitle = $this->post('invoiceText', null);
$invoiceId = $this->post('invoiceType', null);
$paymentId = $this->post('paymentTypeId', 15);
$paymentType = $this->post('paymentType', 1); // 默认在线支付
$remark = $this->post('msg', null);
$couponCode = $this->post('couponCode', null);
$yohoCoin = $this->post('yohoCoin', 1);
$result = CartModel::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin);
}
if (empty($result)) {
echo ' ';
} else {
// 提交成功清除Cookie
$this->setCookie('order-info', null);
$this->echoJson($result);
}
}
/**
* 加入购物车
*
* @param string productSku 商品的SKU
* @param int buyNumber 购买数量
* @param int promotionId 促销ID, 加价购有关
* @param int goodsType 商品类型,0表示普通商品,1表示加价购商品
* @param int isEdit 是否是编辑商品SKU,0表示不是编辑
* @return json
*/
public function addAction()
{
$result = array();
if ($this->isAjax()) {
$shoppingKey = Helpers::getShoppingKeyByCookie();
$productSku = $this->post('productSku');
$buyNumber = $this->post('buyNumber', 1);
$goodsType = $this->post('goodsType', 0);
$promotionId = $this->post('promotionId', 0);
$isEdit = $this->post('isEdit', 0);
$uid = $this->getUid(true);
// 执行加入购物车操作
$result = CartModel::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey);
// 设置加入购物车凭证到客户端浏览器
if (isset($result['data']['shopping_key'])) {
$this->setCookie('_spk', $shoppingKey);
}
}
$this->echoJson($result);
}
}
... ...
... ... @@ -8,14 +8,13 @@ use Plugin\Helpers;
/**
* 帮助中心相关数据处理
*/
class HelpModel
{
class HelpModel {
/*
* 获取帮助中心列表
*/
public static function serviceInfo()
{
public static function serviceInfo() {
//调用接口获取数据
$res = json_decode(HelpData::serviceInfo(), TRUE);
$cateInfo = $res['data'];
... ... @@ -25,12 +24,23 @@ class HelpModel
foreach ($cateInfo as $key => $value) {
$iHelp[$key]['name'] = $value['caption'];
$iHelp[$key]['code'] = $value['code'];
}
$iHelp[$key]['url'] = Helpers::url('/home/helpDetail', array('code' => $value['code'], 'caption' => $value['caption']) );
}
}
return $iHelp;
}
/*
* 获取帮助中心详细内容
*/
public static function serviceDetail($code) {
$res = HelpData::serviceDetail($code);
if (!empty($res)) {
if (false !== ($part = strstr($res,'<div class="deal_main">'))) {
$res = strstr($part,'</body>',TRUE);
}
}
return $res;
}
}
... ...
... ... @@ -23,7 +23,7 @@ class CartModel
* @param int $productSku 商品SKU
* @param int $buyNumber 购买数量
* @param int $goodsType 商品类型,0表示普通商品,1表示加价购商品
* @param int int $isEdit 是否是编辑商品SKU,0表示不是编辑
* @param int $isEdit 是否是编辑商品SKU,0表示不是编辑
* @param null|int $promotionId 促销id,默认null(加价购有关)
* @param null|int $uid 用户UID,可以不传
* @return array 加入购物车接口返回的数据
... ... @@ -406,7 +406,7 @@ class CartModel
$oneGoods['name'] = $single['product_name'];
$oneGoods['color'] = $single['color_name'];
$oneGoods['size'] = $single['size_name'];
$oneGoods['price'] = Helpers::transPrice($single['real_price']); // last_price有些带.00,有些不带,real_price都不带.00
$oneGoods['price'] = Helpers::transPrice($single['sales_price']);
$oneGoods['count'] = $single['buy_number'];
$result['goods'][] = $oneGoods;
... ... @@ -428,18 +428,20 @@ class CartModel
}
// 有货币
$result['yohoCoin'] = isset($orderCompute['use_yoho_coin']) ? isset($orderCompute['use_yoho_coin']) : $payReturn['yoho_coin'];
$result['yohoCoin'] = (isset($orderCompute['use_yoho_coin']) && !empty($orderCompute['use_yoho_coin'])) ? $orderCompute['use_yoho_coin'] : $payReturn['yoho_coin'];
// 订单数据
if (isset($payReturn['shopping_cart_data']) && !empty($payReturn['shopping_cart_data'])) {
$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];
$salePrice = isset($orderCompute['discount_amount']) ? $orderCompute['discount_amount'] : $payReturn['shopping_cart_data']['discount_amount'];
$freight = isset($orderCompute['promotion_formula_list']['promotion_amount']) ? $orderCompute['promotion_formula_list'][1]['promotion_amount'] : $payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'];
$couponPrice = isset($orderCompute['coupon_amount']) ? $orderCompute['coupon_amount'] : false;
$salePrice = isset($orderCompute['discount_amount']) ? $orderCompute['discount_amount'] : $payReturn['shopping_cart_data']['promotion_formula_list'][3]['promotion_amount'];
$price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
$freight = isset($orderCompute['promotion_formula_list']['promotion_amount']) ? $orderCompute['promotion_formula_list']['promotion_amount'] : $payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'];
$result['sumPrice'] = Helpers::transPrice($sumPrice);
$result['salePrice'] = Helpers::transPrice($salePrice);
$result['price'] = Helpers::transPrice($price);
$result['freight'] = strtr($freight, array('¥'=>'','¥'=>'')) . '.00';
$result['freight'] = $freight;
$result['couponPrice'] = $couponPrice;
}
// 发票有关数据
... ... @@ -468,7 +470,7 @@ class CartModel
// 优惠券数据
$coupons = array();
!empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue'];
$coupons += self::getCouponList($uid, 0, 1, true);
$coupons += self::getCouponList($uid, true);
$result['coupon'] = $coupons;
}
... ... @@ -535,7 +537,7 @@ class CartModel
if (isset($coupons['data'])) {
if ($onlyTotal) {
$result['count'] = $coupons['data']['total'];
$result['count'] = count($coupons['data']['couponList']);
} else {
$couponArr = array();
isset($coupons['data']['couponList']) && $couponArr = $coupons['data']['couponList'];
... ... @@ -586,7 +588,7 @@ class CartModel
$result['message'] = '请选择配送方式';
} else {
$orderSubRes = CartData::orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin);
if ($orderSubRes && isset($orderSubRes['code'])) {
if ($orderSubRes && isset($orderSubRes['code'])) {
$result = $orderSubRes;
}
}
... ... @@ -605,7 +607,6 @@ class CartModel
{
$result = array();
$oneGoods = array();
// 购买的可用商品列表
$validGoods = Helpers::formatCartGoods($data['goods_list']);
!empty($validGoods) && $result['goods'] = $validGoods;
... ...
... ... @@ -10,7 +10,7 @@ use Configs\CacheConfig;
/**
* 首页相关的模板数据模型
*
*
* @name HomeModel
* @package models
* @copyright yoho.inc
... ... @@ -52,7 +52,7 @@ class HomeModel
/**
* 选择频道
*
*
* @return void
*/
public static function goSwitchChannel()
... ... @@ -70,7 +70,7 @@ class HomeModel
/**
* 设置选择的频道保存到浏览器COOKIE
*
*
* @param string $cookie
* @return void
*/
... ... @@ -81,7 +81,7 @@ class HomeModel
/**
* 获取频道选择页的背景图片
*
*
* @return string | false
*/
public static function getBgImage()
... ... @@ -122,7 +122,7 @@ class HomeModel
/**
* 获取男生,女生底部banner
*
*
* @return string | false
*/
public static function getBottomBanner($channel)
... ... @@ -164,7 +164,7 @@ class HomeModel
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($cache, $result);
Cache::set($cache, $result);
}
}
... ... @@ -173,7 +173,7 @@ class HomeModel
/**
* 获取男生首页的楼层数据
*
*
* @return array | false
*/
public static function getBoysFloor()
... ... @@ -204,13 +204,13 @@ class HomeModel
Cache::set(CacheConfig::KEY_ACTION_BOYS_INDEX, $result);
}
}
return $result;
}
/**
* 获取女生首页的楼层数据
*
*
* @return array | false
*/
public static function getGirlsFloor()
... ... @@ -247,7 +247,7 @@ class HomeModel
/**
* 获取潮童首页的楼层数据
*
*
* @return array | false
*/
public static function getKidsFloor()
... ... @@ -284,7 +284,7 @@ class HomeModel
/**
* 获取创意生活首页的楼层数据
*
*
* @return array | false
*/
public static function getLifestyleFloor()
... ... @@ -319,4 +319,53 @@ class HomeModel
return $result;
}
/**
* 获取频道选择页数据
*
* @return array
*/
public static function getChannel(){
$result = array();
$result['showYohood'] = false;
$data = IndexData::channelData();
$channelList = array();
if(isset($data['data']['list'])){
foreach($data['data']['list'] as $key => $value){
switch ($value['channel_id']) {
case 5:
$result['showYohood'] = true;
$result['yohoodHref'] = '/yohood';
break;
case 1:
$channelList[$key]['href'] = '/boys';
$channelList[$key]['title'] = '男生';
$channelList[$key]['entitle'] = 'BOYS';
break;
case 2:
$channelList[$key]['href'] = '/girls';
$channelList[$key]['title'] = '女生';
$channelList[$key]['entitle'] = 'GIRLS';
break;
case 3:
$channelList[$key]['href'] = '/kids';
$channelList[$key]['title'] = '潮童';
$channelList[$key]['entitle'] = 'KIDS';
break;
case 4:
$channelList[$key]['href'] = '/lifestyle';
$channelList[$key]['title'] = '创意生活';
$channelList[$key]['entitle'] = 'LIFESTYLE';
break;
default:
break;
}
}
$result['channelList'] = $channelList;
}
return $result;
}
}
... ...
... ... @@ -160,17 +160,15 @@ class DetailModel
$colorGroup = array();
$sizeList = array();
$goodsGroup = array();
$coverImage = '';
$colorStorageNum = 0; // 颜色的库存总数
$thumbImageList = array();
$colorStorageGroup = array(); // 颜色分组的库存总数集合, 多个之间用/分隔
$sizeStorageStr = ''; // 尺码库存总数集合, 多个之间用/分隔
$colorStorageNum = 0;
$totalStorageNum = 0; // 总库存数
foreach ($baseInfo['goodsList'] as $i => $value) {
foreach ($baseInfo['goodsList'] as $value) {
$sizeList = array();
$colorStorageNum = 0;
// 获取默认的封面图
if ($i === 0) {
$coverImage = Helpers::getImageUrl($value['colorImage'], 60, 60);
}
$sizeStorageStr = ''; // clear to empty
// 商品分组
if (isset($value['goodsImagesList'])) {
... ... @@ -189,10 +187,13 @@ class DetailModel
'id' => $size['id'],
'skuId' => $size['goodsSizeSkuId'],
'goodsId' => $size['goodsId'],
'colorId' => $value['colorId'],
'name' => $size['sizeName'],
'sizeNum' => $size['goodsSizeStorageNum'],
);
$colorStorageNum += intval($size['goodsSizeStorageNum']);
$sizeStorageStr .= $size['goodsSizeStorageNum'] . '/';
$colorStorageGroup[ $size['sizeName'] ][ $value['colorName'] ] = $size['goodsSizeStorageNum'];
}
}
... ... @@ -202,11 +203,19 @@ class DetailModel
'skcId' => $value['productSkc'],
'name' => $value['colorName'],
'goodsName' => $value['goodsName'],
'shortUrl' => Helpers::getImageUrl($value['colorImage'], 60, 60),
'colorNum' => $colorStorageNum,
'sizes' => $sizeList,
'sizeNumStr' => rtrim($sizeStorageStr, '/'),
);
// 缩略图
$thumbImageList[] = array('img' => Helpers::getImageUrl($value['colorImage'], 60, 60) );
// 统计每个尺码对应的各个颜色的库存量
foreach ($sizeList as &$sizeArr) {
$sizeArr['colorNumStr'] = implode('/', array_values($colorStorageGroup[ $sizeArr['sizeName'] ]) );
}
// 商品库存总数
$totalStorageNum += $colorStorageNum;
}
... ... @@ -238,12 +247,13 @@ class DetailModel
if (!$soldOut && !$notForSale) {
$result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html');
$result['cartInfo']['productId'] = $productId;
$result['cartInfo']['thumb'] = $coverImage;
$result['cartInfo']['thumbs'] = $thumbImageList;
$result['cartInfo']['name'] = isset($result['goodsName']) ? $result['goodsName'] : '';
$result['cartInfo']['price'] = isset($result['goodsPrice']['currentPrice']) ? $result['goodsPrice']['currentPrice'] : '';
$result['cartInfo']['salePrice'] = isset($result['goodsPrice']['previousPrice']) ? $result['goodsPrice']['previousPrice'] : '';
$result['cartInfo']['totalNum'] = $totalStorageNum;
$result['cartInfo']['colors'] = $colorGroup;
$result['cartInfo']['sizes'] = $sizeList;
}
// 非卖品
elseif ($notForSale) {
... ... @@ -336,7 +346,7 @@ class DetailModel
$referenceList = array();
// 判断是否显示参考尺码
$showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']) && ($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == $gender || $sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == 3);
$showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']);
if ($showReference) {
$referenceList[0] = array('param' => $referenceName);
}
... ... @@ -351,7 +361,10 @@ class DetailModel
foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) {
$item = array();
$sizeNameList[] = array('param' => $value['sizeName']);
if (!empty($value['referenceSize']['gender']) && ($value['referenceSize']['gender'] == $gender || $value['referenceSize']['gender'] == 3)) {
if (!empty($value['referenceSize']['gender']) && $boyReference && ($value['referenceSize']['gender'] == 1 || $value['referenceSize']['gender'] == 3)) {
$referenceList[] = array('param' => empty($value['referenceSize']['referenceName']) ? ' ' : $value['referenceSize']['referenceName']);
}
elseif (!empty($value['referenceSize']['gender']) && $girlReference && ($value['referenceSize']['gender'] == 2 || $value['referenceSize']['gender'] == 3)) {
$referenceList[] = array('param' => empty($value['referenceSize']['referenceName']) ? ' ' : $value['referenceSize']['referenceName']);
}
foreach ($value['sortAttributes'] as $attr) {
... ...
... ... @@ -59,7 +59,7 @@ class BindController extends AbstractAction
$phoneNum=$this->get('phoneNum');
$data = array(
'bindIndex'=>true,//js标识
'bindCode'=>true,//js标识
'backUrl' => '/', // 返回的URL链接
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
... ... @@ -87,7 +87,7 @@ class BindController extends AbstractAction
$nickname = $this->get('nickname');
$areaCode = $this->get('areaCode', '86');
$data = array(
'bindIndex'=>true,//js标识
'bindPwd'=>true,//js标识
'backUrl' => '/', // 返回的URL链接
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
... ... @@ -138,7 +138,7 @@ class BindController extends AbstractAction
}
else
{
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => $res['data']);
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => isset($res['data'])?$res['data']:'');
}
}
while (false);
... ... @@ -192,15 +192,15 @@ class BindController extends AbstractAction
}
$phoneNum = $this->post('phoneNum');
$msgCode = $this->post('msgCode');
$code = $this->post('code');
$areaCode = $this->post('areaCode');
if (!is_numeric($phoneNum) || !$msgCode)
if (!is_numeric($phoneNum) || !$code)
{
break;
}
$data = BindData::checkBindCode($areaCode,$phoneNum, $msgCode);
$data = BindData::checkBindCode($areaCode,$phoneNum, $code);
if (!isset($data['code']))
{
break;
... ...