Authored by 郭成尧

'rcmnd4umerge'

... ... @@ -31,8 +31,8 @@ class Yohobuy
// const SERVICE_NOTIFY = 'http://service.yoho.cn/';
// 测试环境 */
const API_URL = 'http://testapi.yoho.cn:28078/'; // 'http://192.168.102.205:8080/gateway/'
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const API_URL = 'http://testapi.yoho.cn:28078/'; // http://testapi.yoho.cn:28078/ http://devapi.yoho.cn:58078/
const SERVICE_URL = 'http://testservice.yoho.cn:28077/'; // http://testservice.yoho.cn:28077/ http://devservice.yoho.cn:58077/
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_OLD = 'http://test2.open.yohobuy.com/';
// 支付回调地址
... ...
... ... @@ -217,13 +217,23 @@ class UserData
* 个人中心页面优选新品数据
*
* @param int $channel 频道,1代表男生,2代表女生,3代表潮童,4代表创意生活
* @param $uid 用户ID
* @param $udid 设备ID
* @param $rec_pos 位置码
* @param $limit 数量限制
* @return array 接口返回的数据
*/
public static function preference($channel)
public static function newPreference($channel, $uid, $udid, $rec_pos, $limit)
{
$param = Yohobuy::param();
$param['method'] = 'app.home.preference';
$param['method'] = 'app.home.newPreference';
$param['yh_channel'] = $channel;
if ($uid != 0 && $uid != null) {
$param['uid'] = $uid;
}
$param['udid'] = $udid;
$param['rec_pos'] = $rec_pos;
$param['limit'] = $limit;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ... @@ -492,8 +502,7 @@ class UserData
if (!empty($id)) { // 修改
$param['id'] = $id;
$param['method'] = 'app.address.update';
}
else { // 添加
} else { // 添加
$param['method'] = 'app.address.add';
}
... ...
... ... @@ -76,9 +76,40 @@
</div>
{{/if}}
{{{banner}}}
{{/ content}}
</div>
<!--recommend-for-you-->
{{#if recommend}}
<div class="recommend block">
<h2 class="title">
<p class="na-pager-wrap">
<span class="rc-pager pre no-visible">
<i class="iconfont">&#xe622;</i>
</span>
<span class="rc-pager next">
<i class="iconfont">&#xe621;</i>
</span>
</p>
</h2>
<ul class="clearfix">
{{# recommend}}
<li>
<a href="{{href}}">
<img class="thumb" src="{{thumb}}">
<p class="name">{{name}}</p>
<span class="price">¥{{price}}</span>
</a>
</li>
{{/ recommend}}
</ul>
</div>
{{/if}}
<!--recommend-for-you-->
<div class="ho-btm">
{{{banner}}}
{{> home/help-us}}
</div>
{{/ me}}
... ...
... ... @@ -201,8 +201,8 @@ function getTogetherProduct($obj, url, page) {
});
}
// 最近浏览
getTogetherProduct($histroy, '/cart/index/getHistroyProduct');
// 为你优选
getTogetherProduct($histroy, '/cart/index/getRecommendProduct');
// 凑单商品
getTogetherProduct($together, '/cart/index/getTogetherProduct');
... ... @@ -215,7 +215,7 @@ $together.on('click', '.pagenext, .pageprev', function() {
});
//凑单商品,历史商品商品折叠
//凑单商品,为你优选商品商品折叠
$shopCart.on('click', '.icon-minus, .icon-add', function() {
if ($(this).hasClass('icon-minus')) {
$(this).parents('.title').next('.main').hide();
... ... @@ -236,7 +236,7 @@ $histroy.on('click', '.pagenext, .pageprev', function() {
} else {
--pageNum > 0 || (pageNum = 1);
}
getTogetherProduct($histroy, '/cart/index/getHistroyProduct', {
getTogetherProduct($histroy, '/cart/index/getRecommendProduct', {
page: pageNum
});
... ... @@ -290,6 +290,7 @@ function productInfo(data) {
return false;
}
});
});
}
... ... @@ -314,7 +315,7 @@ $payWapper.on('click', '.cart-add-btn', function() {
});
});
//凑单商品,历史商品商品记录
//凑单商品,为你优选商品商品记录
$('.clearfix').on('click', '.btn_view_s', function() {
productId = $(this).data('id');
promotionId = $(this).parents('table').data('promotion');
... ...
... ... @@ -13,55 +13,92 @@ $('#close-message').click(function() {
$('.message-tip').slideUp(200);
});
//新品上架
(function() {
var $naPager = $('.na-pager'),
$naUl = $('.new-arrival ul'),
naPage = Math.ceil($naUl.children('li').length / 5),
naItemWith = $naUl.children('li:last-child').outerWidth(),
naCurPage = 1;
$naUl.width($naUl.width() * naPage);
//最新上架翻页
$naPager.click(function() {
var $this = $(this),
/**
*
* @param self 点击的控件
* @param $ul 列表父
* @param page 总共页数
* @param itemWith 子元素宽
* @param curPage 当前页码
* @param num 一页商品数量
*/
function pageChange(self, $ul, page, itemWith, curPage, num) {
var $this = self,
left;
if ($this.hasClass('next')) {
//后翻
++naCurPage;
//第2页显示前翻按钮
if (naCurPage === 2) {
if (curPage === 2) {
$this.siblings().removeClass('no-visible');
}
//最后一页隐藏后翻按钮
if (naCurPage === naPage) {
if (curPage === page) {
$this.addClass('no-visible');
}
} else {
//前翻
--naCurPage;
//倒数第2页显示后翻按钮
if (naCurPage === naPage - 1) {
if (curPage === page - 1) {
$this.siblings().removeClass('no-visible');
}
//第1页隐藏前翻按钮
if (naCurPage === 1) {
if (curPage === 1) {
$this.addClass('no-visible');
}
}
left = -5 * (naCurPage - 1) * naItemWith;
left = -num * (curPage - 1) * itemWith;
$naUl.animate({
$ul.animate({
marginLeft: left
}, 400);
}
//新品上架
(function() {
var $naPager = $('.na-pager'),
$rcPager = $('.rc-pager'),
$naUl = $('.new-arrival ul'),
$rcUl = $('.recommend ul'),
naPage = Math.ceil($naUl.children('li').length / 5),
rcPage = Math.ceil($rcUl.children('li').length / 6),
naItemWith = $naUl.children('li:last-child').outerWidth(),
rcItemWith = $rcUl.children('li:last-child').outerWidth(),
naCurPage = 1,
rcCurPage = 1;
$naUl.width($naUl.width() * naPage);
$rcUl.width($rcUl.width() * rcPage);
//最新上架翻页
$naPager.click(function() {
var $this = $(this);
if (naPage > 1) {
if ($this.hasClass('next')) {
++naCurPage;
} else {
--naCurPage;
}
pageChange($this, $naUl, naPage, naItemWith, naCurPage, 5);
}
});
//为你推荐翻页
$rcPager.click(function() {
var $this = $(this);
if (rcPage > 1) {
if ($this.hasClass('next')) {
++rcCurPage;
} else {
--rcCurPage;
}
pageChange($this, $rcUl, rcPage, rcItemWith, rcCurPage, 6);
}
});
}());
\ No newline at end of file
... ...
... ... @@ -81,7 +81,7 @@
}
}
.new-arrival {
.new-arrival,.recommend {
overflow: hidden;
.na-pager-wrap {
... ... @@ -144,6 +144,25 @@
}
}
.recommend {
margin-bottom: 10px;
ul {
width: 990px;
}
li {
width: 106px;
}
}
.ho-btm{
float: right;
width: 800px;
}
.banner {
display: block;
width: 800px;
... ... @@ -161,4 +180,8 @@
.new-arrival .title {
background-image: resolve(/home/new-arrival.png);
}
.recommend .title {
background-image: resolve(/home/recommend.png);
}
}
\ No newline at end of file
... ...
... ... @@ -139,6 +139,7 @@
.me-main {
float: left;
width: 800px;
min-height: 945px;
}
.me-pager {
... ...
... ... @@ -3,6 +3,7 @@
namespace Home;
use Home\UserModel;
use LibModels\Web\Home\UserData;
use LibModels\Web\Product\BrandData;
use WebPlugin\Helpers;
use WebPlugin\HelperHome;
... ... @@ -75,6 +76,25 @@ class IndexModel
}
/**
* @param $channel
* @param $uid
* @param $udid
* @param $recPos
* @param $limit
* @return array
*/
public static function preferenceData($channel, $uid, $udid, $recPos, $limit)
{
$response = UserData::newPreference($channel, $uid, $udid, $recPos, $limit);
if ($response['code'] === 200) {
return HelperHome::formatNew($response['data']['product_list']);
} else {
return array();
}
}
/**
* 底部banner
* @param string $code
* @return mixed
... ...
... ... @@ -59,7 +59,7 @@ class CartModel
$result['isEmpty'] = true;
$result['guangUrl'] = Helpers::url('', null, 'list');
$result['viewOrderUrl'] = Helpers::url('/home/orders', array('t' => time()));
UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'shoppingKey:'.$shoppingKey);
UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'shoppingKey:' . $shoppingKey);
break;
}
... ... @@ -107,16 +107,14 @@ class CartModel
$result['productAllA'] = Helpers::transPrice($advanceCartData['shopping_cart_data']['last_order_amount']);
// 获赠YOHO币个数
$result['getYoho'] = $advanceCartData['shopping_cart_data']['gain_yoho_coin'];
}
// 普通的
} // 普通的
elseif ($ordinaryCount !== 0 && $advanceCount === 0) {
//$result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount']);
$result['productAmmount'] = self::genProductAmount($ordinaryCartData['shopping_cart_data']['promotion_formula_list'], $ordinaryCartData['shopping_cart_data']['order_amount']);
$result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount']);
$result['productAllA'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['last_order_amount']);
$result['getYoho'] = $ordinaryCartData['shopping_cart_data']['gain_yoho_coin'];
}
// 所有的
} // 所有的
else {
$result['productAmmount'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['order_amount'] + $advanceCartData['shopping_cart_data']['order_amount']);
$result['activeSale'] = Helpers::transPrice($ordinaryCartData['shopping_cart_data']['discount_amount'] + $advanceCartData['shopping_cart_data']['discount_amount']);
... ... @@ -185,8 +183,7 @@ class CartModel
// 普通的
if (!empty($ordinaryCartData['promotion_info'])) {
$result['salesPromotion'] = self::buildPromotionData($ordinaryCartData['promotion_info']);
}
// 预售的
} // 预售的
elseif (!empty($advanceCartData['promotion_info'])) {
//$result['salesPromotion'] = array_merge($result['salesPromotion'], self::buildPromotionData($advanceCartData['promotion_info']));
$result['salesPromotion'] = self::buildPromotionData($advanceCartData['promotion_info']);
... ... @@ -227,8 +224,8 @@ class CartModel
$addCart = CartData::addToCart($productSku, $buyNumber, $goodsType, $isEdit, $promotionId, $uid, $shoppingKey);
if ($addCart && isset($addCart['code'])) {
$result = $addCart;
}else{
UdpLog::info('【购物车】校验参数传递auth','productSku:'.$productSku.'buyNumber:'.$buyNumber.'goodsType:'.$goodsType,'isEdit:'.$isEdit.'promotionId:'.$promotionId.'uid:'.$uid.'shoppingKey:'.$shoppingKey);
} else {
UdpLog::info('【购物车】校验参数传递auth', 'productSku:' . $productSku . 'buyNumber:' . $buyNumber . 'goodsType:' . $goodsType, 'isEdit:' . $isEdit . 'promotionId:' . $promotionId . 'uid:' . $uid . 'shoppingKey:' . $shoppingKey);
}
return $result;
... ... @@ -249,7 +246,7 @@ class CartModel
do {
if (empty($skuList)) {
UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList);
UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
break;
}
... ... @@ -257,8 +254,8 @@ class CartModel
if ($select && isset($select['code'])) {
$result['code'] = $select['code'];
$result['message'] = $select['message'];
}else{
UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion);
} else {
UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'shoppingKey:' . $shoppingKey . 'hasPromotion:' . $hasPromotion);
}
} while (false);
... ... @@ -281,7 +278,7 @@ class CartModel
do {
if (empty($skuList)) {
UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList);
UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
break;
}
... ... @@ -292,8 +289,8 @@ class CartModel
if (isset($remove['data']['goods_count'])) {
$result['total_goods_num'] = $remove['data']['goods_count'];
}
}else{
UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'shoppingKey:'.$shoppingKey.'hasPromotion:'.$hasPromotion);
} else {
UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'shoppingKey:' . $shoppingKey . 'hasPromotion:' . $hasPromotion);
}
} while (false);
... ... @@ -321,7 +318,7 @@ class CartModel
}
if (empty($skuList)) {
UdpLog::info('【购物车】校验参数传递auth','skuList:'.$skuList);
UdpLog::info('【购物车】校验参数传递auth', 'skuList:' . $skuList);
break;
}
... ... @@ -329,8 +326,8 @@ class CartModel
if ($add && isset($add['code'])) {
$result['code'] = $add['code'];
$result['message'] = $add['message'];
}else{
UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'skuList:'.$skuList.'hasPromotion:'.$hasPromotion);
} else {
UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'skuList:' . $skuList . 'hasPromotion:' . $hasPromotion);
}
} while (false);
... ... @@ -353,7 +350,7 @@ class CartModel
do {
if (empty($sku)) {
UdpLog::info('【购物车】校验参数传递auth','sku:'.$sku);
UdpLog::info('【购物车】校验参数传递auth', 'sku:' . $sku);
break;
}
... ... @@ -361,8 +358,8 @@ class CartModel
if ($modify && isset($modify['code'])) {
$result['code'] = $modify['code'];
$result['message'] = $modify['message'];
}else{
UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'sku:'.$sku,'increaseNum:'.$increaseNum.'decreaseNum:'.$decreaseNum.'shoppingKey:'.$shoppingKey);
} else {
UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'sku:' . $sku, 'increaseNum:' . $increaseNum . 'decreaseNum:' . $decreaseNum . 'shoppingKey:' . $shoppingKey);
}
} while (false);
... ... @@ -420,6 +417,113 @@ class CartModel
}
/**
* 获取为你优选商品 待处理
*
* @param $channel 频道
* @param $uid 用户id
* @param $udid 设备id
* @param int $page 分页页码
* @return array
* @internal param $rec_pos
* @internal param $limit
*/
public static function getRecommendProduct($channel, $uid, $udid, $page)
{
$result = array('code' => 200, 'message' => '', 'data' => array('header' => '为你优选', 'hasPrev' => false, 'hasNext' => false, 'item' => array()));
do {
if (!is_numeric($page)) {
break;
}
$channelNum = 1;
switch ($channel) {
case 'boys':
$channelNum = 1;
break;
case 'girls':
$channelNum = 2;
break;
case 'kids':
$channelNum = 3;
break;
case 'lifestyle':
$channelNum = 4;
break;
default:
break;
}
$together = UserData::newPreference($channelNum, $uid, $udid, '100003', 30);
if (empty($together['data']['product_list'])) {
break;
}
$result['data']['hasNext'] = true;
$result['data']['hasPrev'] = true;
$build = array();
$begin = 0;
$end = 0;
switch ($page) {
case 1:
$begin = 0;
$end = 5;
break;
case 2:
$begin = 6;
$end = 11;
break;
case 3:
$begin = 12;
$end = 17;
break;
case 4:
$begin = 18;
$end = 23;
break;
case 5:
$begin = 18;
$end = 23;
break;
case 6:
$begin = 24;
$end = 30;
break;
default:
$begin = 0;
$end = 5;
break;
}
foreach ($together['data']['product_list'] as $key => $value) {
if ($key >= $begin && $key <= $end) {
$build = array();
$build['id'] = $value['product_id'];
$build['skn'] = $value['product_skn'];
$build['href'] = Helpers::getUrlBySkc($value['product_id'], $value['goods_list'][0]['product_skc'], $value['cn_alphabet']);;
$build['title'] = $value['product_name'];
$build['img'] = Helpers::getImageUrl($value['default_images'], 100, 100);
$build['alt'] = $value['product_name'];
$build['price'] = $value['price']['sales_price'];
if ($value['price']['sales_price'] !== $value['price']['market_price']) {
$build['marketPrice'] = $value['price']['market_price'];
}
$result['data']['item'][] = $build;
}
}
// 当数据量不足6个时,判定为没有下一页
if ($page == 1 && !isset($result['data']['item'][5])) {
$result['data']['hasPrev'] = false;
$result['data']['hasNext'] = false;
}
} while (false);
return $result;
}
/**
* 获取最近浏览商品
*
* @param int $page 分页页码
... ... @@ -436,7 +540,7 @@ class CartModel
$browse = CartData::browseRecord($uid, $udid, $page, 6);
if (empty($browse['data']['product_list'])) {
UdpLog::info('【购物车】校验参数传递auth','uid:'.$uid.'udid'.$udid.'page'.$page);
UdpLog::info('【购物车】校验参数传递auth', 'uid:' . $uid . 'udid' . $udid . 'page' . $page);
break;
}
... ... @@ -595,8 +699,7 @@ class CartModel
if ($value['payment_type'] == 1 && $value['is_support'] === 'Y') {
$result['onlinePay']['checked'] = $isDefault ? true : false;
$result['onlinePay']['paymentId'] = $value['payment_id'];
}
// 货到付款
} // 货到付款
elseif ($value['payment_type'] == 2 && $value['is_support'] === 'Y') {
$result['deliveryPay']['checked'] = $isDefault ? true : false;
$result['deliveryPay']['paymentId'] = $value['payment_id'];
... ... @@ -609,9 +712,9 @@ class CartModel
}
}
// tar add 1605061351 货到付款提示信息处理
if(isset($pay['data']['payment_way'])){
if (isset($pay['data']['payment_way'])) {
foreach ($pay['data']['payment_way'] as $item) {
if($item['payment_type'] === 2){
if ($item['payment_type'] === 2) {
$result['paymentInCashInfo'] = $item['is_support_message'];
}
}
... ... @@ -778,8 +881,7 @@ class CartModel
//JIT拆单需求 package
$result['packages'] = self::getPackageInfo($pay['data']['shopping_cart_data']);
}
while (false);
} while (false);
return $result;
}
... ... @@ -797,17 +899,17 @@ class CartModel
if ($isMulti) {
$packageList = $cartInfo['package_list'];
foreach ($packageList as $pk => $pv) {
$pIndex = $pk+1;
$packages[$pk]['title'] = ($pv['supplier_id'] == 0) ? '包裹'.$pIndex.':总仓发货' : '包裹'.$pIndex.':异地调拨'; //仓库
$pIndex = $pk + 1;
$packages[$pk]['title'] = ($pv['supplier_id'] == 0) ? '包裹' . $pIndex . ':总仓发货' : '包裹' . $pIndex . ':异地调拨'; //仓库
$goodList = $pv['goods_list'];
foreach ($goodList as $glk => $glv) {
$packages[$pk]['goodlist'][$glk]['src'] = Images::getImageUrl($glv['goods_images'], 90, 90);
$tagInfo= isset(ChannelConfig::$orderTagArr[$glv['goods_type']])?ChannelConfig::$orderTagArr[$glv['goods_type']]:'';
$packages[$pk]['goodlist'][$glk]['goodsType'] =!empty($tagInfo['name'])?$tagInfo['name']:false;
$packages[$pk]['goodlist'][$glk]['classname'] =!empty($tagInfo['classname'])?$tagInfo['classname']:false;
$tagInfo = isset(ChannelConfig::$orderTagArr[$glv['goods_type']]) ? ChannelConfig::$orderTagArr[$glv['goods_type']] : '';
$packages[$pk]['goodlist'][$glk]['goodsType'] = !empty($tagInfo['name']) ? $tagInfo['name'] : false;
$packages[$pk]['goodlist'][$glk]['classname'] = !empty($tagInfo['classname']) ? $tagInfo['classname'] : false;
$packages[$pk]['goodlist'][$glk]['link'] = 'javascript:void(0)';
}
$packages[$pk]['fee'] = ($pv['shopping_cost']=='0.00')?false:$pv['shopping_cost'];
$packages[$pk]['fee'] = ($pv['shopping_cost'] == '0.00') ? false : $pv['shopping_cost'];
$packages[$pk]['orign'] = $pv['shopping_orig_cost'];
$packages[$pk]['count'] = $pv['shopping_cut_cost'];
}
... ... @@ -828,7 +930,7 @@ class CartModel
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode,$promotionCode,$yohoCoin, $redEnvelopes)
public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes)
{
$result = array('code' => 400, 'message' => self::ERROR_400_MESSAGE, 'data' => array());
... ... @@ -836,7 +938,7 @@ class CartModel
if (!empty($yohoCoin)) {
$yohoCoin = intval($yohoCoin) / 100;
}
$compute = CartData::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode,$promotionCode,$yohoCoin, $redEnvelopes);
$compute = CartData::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes);
if ($compute && isset($compute['code'])) {
/* 商品价格明细 */
if (!empty($compute['data']['promotion_formula_list'])) {
... ... @@ -904,19 +1006,19 @@ class CartModel
do {
if (empty($addressId)) {
UdpLog::info('【结算信息】配送地址参数校验','addressId为空');
UdpLog::info('【结算信息】配送地址参数校验', 'addressId为空');
$result['code'] = 401;
$result['message'] = '配送地址不能为空';
break;
}
if (empty($deliveryTimeId)) {
UdpLog::info('【结算信息】配送时间参数校验','deliveryTime为空');
UdpLog::info('【结算信息】配送时间参数校验', 'deliveryTime为空');
$result['code'] = 402;
$result['message'] = '请选择配送时间';
break;
}
if (empty($deliveryWayId)) {
UdpLog::info('【结算信息】配送方式参数校验','deliveryWay为空');
UdpLog::info('【结算信息】配送方式参数校验', 'deliveryWay为空');
$result['code'] = 403;
$result['message'] = '请选择配送方式';
break;
... ... @@ -1132,8 +1234,7 @@ class CartModel
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
} // 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result, 3600); // 缓存1小时
}
... ...
... ... @@ -176,6 +176,25 @@ class IndexController extends WebAction
}
/**
* 为你优选商品异步请求
*/
public function getRecommendProductAction()
{
$result = array('code' => 200, 'data' => array(), 'message' => '为你优选');
if ($this->isAjax()) {
$channel = Helpers::getChannelNameByCookie();
$uid = $this->getUid(false);
$udid = $uid . $this->getUdid();
$page = $this->get('page', 1);
$result = CartModel::getRecommendProduct($channel, $uid, $udid, $page);
}
$this->echoJson($result);
}
/**
* 最近浏览的商品异步请求
*/
public function getHistroyProductAction()
... ... @@ -183,7 +202,8 @@ class IndexController extends WebAction
$result = array('code' => 200, 'data' => array(), 'message' => '浏览记录');
// 按照产品把明扬的指示,去掉最近浏览记录
$this->echoJson($result); exit();
$this->echoJson($result);
exit();
do {
if (!$this->isAjax()) {
... ... @@ -204,8 +224,7 @@ class IndexController extends WebAction
}
$sknList = explode(',', rawurldecode($sknList));
$result = CartModel::getNamedBrowseProduct($page, 6, $sknList);
}
while (false);
} while (false);
$this->echoJson($result);
}
... ... @@ -458,14 +477,13 @@ class IndexController extends WebAction
$paymentId, $paymentType, $remark, $couponCode, $promotionCode, $yohoCoin, $isPreContact, $isPrintPrice, $redEnvelopes);
// 判断是否下单成功
if (empty($result['data']['order_code'])) {
UdpLog::info('【结算信息】判断是否下单成功','order_code'.$result['data']['order_code']);
UdpLog::info('【结算信息】判断是否下单成功', 'order_code' . $result['data']['order_code']);
break;
}
// 跳转到支付的URL链接
$result['data']['payUrl'] = Helpers::url('/shopping/pay', array('ordercode' => $result['data']['order_code']));
}
while (false);
} while (false);
$this->echoJson($result);
}
... ... @@ -523,10 +541,10 @@ class IndexController extends WebAction
$uid = $this->getUid();
$vipLevel = -1;
$data = array();
if(!empty($this->_vip)) {
if (!empty($this->_vip)) {
$vipLevel = Helpers::getVipLevel($this->_vip);
}
if(!empty($productId)) {
if (!empty($productId)) {
$data = Product\ItemModel::getCartProductInfo($productId, $uid, $vipLevel);
}
$this->_view->display('goods-detail', $data);
... ...
... ... @@ -31,9 +31,30 @@ class IndexController extends WebAction
'name' => '个人中心'
),
);
$leftNav = UserModel::getCenterLeftNav('',$uid);
$leftNav = UserModel::getCenterLeftNav('', $uid);
$data = IndexModel::homeData();
$udid = $uid . $this->getUdid();
$channelNum = 1;
switch ($channel) {
case 'boys':
$channelNum = 1;
break;
case 'girls':
$channelNum = 2;
break;
case 'kids':
$channelNum = 3;
break;
case 'lifestyle':
$channelNum = 4;
break;
default:
break;
}
// 为你优选 tar add 160701
$data['recommend'] = IndexModel::preferenceData($channelNum, $uid, $udid, '100004', 30);
//取消订单原因列表
$resons = OrderData::closeReasons();
$cancelReason = isset($resons['data']) ? $resons['data'] : '';
... ... @@ -54,10 +75,11 @@ class IndexController extends WebAction
'more' => '/brands',
'brands' => $data['brand']
),
'newArrival' => $data['new'],
'banner' => IndexModel::getFooterBanner()
'newArrival' => $data['new']
)
),
'recommend' => $data['recommend'], //待处理
'banner' => IndexModel::getFooterBanner(),
'helpUsUrl' => ''
);
$this->_view->display('index', array('meIndexPage' => true, 'me' => $data));
... ...