Authored by Niall

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

... ... @@ -266,11 +266,12 @@ class CartData
* @param int $deliveryWay 配送方式,1表示普通快递,2表示顺丰速运
* @param int $paymentType 支付方式,1表示在线支付,2表示货到付款
* @param string $couponCode 优惠券码
* @param string $promotionCode 优惠码
* @param mixed $yohoCoin 使用的YOHO币数量
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin, $redEnvelopes)
public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode,$promotionCode,$yohoCoin, $redEnvelopes)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.compute';
... ... @@ -280,6 +281,9 @@ class CartData
if (!empty($couponCode)) {
$param['coupon_code'] = $couponCode;
}
if (!empty($promotionCode)) {
$param['promotion_code'] = $promotionCode;
}
if (!empty($yohoCoin)) {
$param['use_yoho_coin'] = $yohoCoin;
}
... ...
... ... @@ -180,6 +180,7 @@ class HelperSearch
if (isset($data['shopData']) && !empty($data['shopData'])) {
$result['shopEntry'] = array();
foreach ($data['shopData'] as $val) {
$val['shop']['shop_id'] = empty($val['shop']['shop_id']) ? '' : $val['shop']['shop_id'];
$shopSort = self::shop($val['shop'], $val['shopSort']);
if (empty($shopSort)) {
continue;
... ...
... ... @@ -114,3 +114,17 @@
{{#if node}}
<div id="brand-card" class="brand-card" data-node="{{node}}"></div>
{{/if}}
{{!-- 水牌广告-基础模板 --}}
{{#signboard}}
<div class="sell-signboard left-modular">
<h2 class="title">{{title}}</h2>
<ul class="left-list">
{{#each list}}
<li>
<a target="_blank" href="{{url}}"><img src="{{img}}" alt="{{title}}" /></a>
</li>
{{/each}}
</ul>
</div>
{{/signboard}}
... ...
... ... @@ -15108,16 +15108,19 @@ var Order = {
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
var biVal = $('#biprice.is-select').val();
var codeVal = $juangroupInput.val();
var promotionVal = $juangroupInput.closest('li').find('#juancode').val();
var cartType = $('.address-manage').attr('cart-type');
var redEnvelopes = $('.use-envelopes input:checked').attr('data-use');
var resultData;
codeVal = !!codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val();
codeVal = codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val();
resultData = {
cartType: cartType,
deliveryWay: expressVal,
couponCode: codeVal,
promotionCode: promotionVal,
yohoCoin: biVal
//redEnvelopes: e.$useEnvelopesInput.length > 0 ? ~~e.$hasEnvelopes.text().substring(1) : '0'
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -370,16 +370,19 @@ var Order = {
var expressVal = $('.express-list input[name="carriagegroup"]:checked').val();
var biVal = $('#biprice.is-select').val();
var codeVal = $juangroupInput.val();
var promotionVal = $juangroupInput.closest('li').find('#juancode').val();
var cartType = $('.address-manage').attr('cart-type');
var redEnvelopes = $('.use-envelopes input:checked').attr('data-use');
var resultData;
codeVal = !!codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val();
codeVal = codeVal ? codeVal : $juangroupInput.closest('li').find('#juancode').val();
resultData = {
cartType: cartType,
deliveryWay: expressVal,
couponCode: codeVal,
promotionCode: promotionVal,
yohoCoin: biVal
//redEnvelopes: e.$useEnvelopesInput.length > 0 ? ~~e.$hasEnvelopes.text().substring(1) : '0'
... ...
... ... @@ -108,6 +108,19 @@
}
}
}
.sell-signboard {
.left-list li {
padding-left: 0;
height: auto;
margin-bottom: 10px;
line-height: inherit;
img {
width: 100%;
}
}
}
}
.min-screen .product-list-page .sort-intro {
... ...
... ... @@ -176,6 +176,7 @@ class ShopModel
$urlList['product'] = SearchData::getProductUrl($searchCondition['condition']);
// 组合搜索分类url
$sortCondition = array();
$sortCondition = $searchCondition['sortCondition'];
if (isset($searchCondition['condition']['misort']) && !empty($searchCondition['condition']['misort'])) {
$sortCondition['needSmallSort'] = 1;
}
... ... @@ -192,13 +193,16 @@ class ShopModel
// 组织模板数据
$result = HelperSearch::getList($res, $searchCondition['options'], $searchCondition['userInput']);
$data['pathNav'] = $result['pathNav'];
$data['goods'] = $result['goods'];
$data['opts'] = $result['opts'];
$data['leftContent'] = isset($result['leftContent']) ? $result['leftContent'] : '';
$data['filters'] = $result['filters'];
$data['pathNav'] = $result['pathNav'];
$data['pathNav'] = array_merge(
$result['pathNav'],
array(
array('href'=> '', 'name' => $data['brandIntro']['brandName'], 'title' => $data['brandIntro']['brandName'])
)
);
// $data['name'] = '全部商品 ALL';
// $sort = self::getSort($res['sort']);
// $data['goodsMenu']['menuList'] = $sort;
... ... @@ -411,7 +415,31 @@ class ShopModel
return $result;
}
/**
* 水牌
* @param type $data
* @return type []
*/
public static function signboard($data)
{
$result = array();
foreach ($data['resource_data'] as $resource) {
if (empty($resource['data'])) {
continue;
}
foreach ($resource['data'] as $val) {
$result[] = array(
'img'=> self::imageView2($val['src'], 160, 240),
'url'=> $val['url'],
);
}
}
return $result;
}
/**
* 品牌一览
* @param type $data
... ... @@ -533,6 +561,39 @@ class ShopModel
return $result;
}
/**
* 基础模板
* @param type int $shopId 店铺id
* @return type []
*/
public static function basisTemplate($shopId)
{
$data = array('signboard' => array());
$parameters['shopId'] = $shopId;
$shopList = ShopData::shopsDecoratorList($shopId);
if (isset($shopList['data']['list']) && $shopList['code'] === 200) {
foreach ($shopList['data']['list'] as $list) {
$fun = $list['resource_name'];
if (is_callable("self::$fun")) {
$list = self::$fun(self::getResourceData($list), $parameters);
switch ($fun) {
case 'shopTopBanner':
$data[$fun] = $list;
break;
case 'signboard':
$data[$fun] = array(
'title' => isset($list[0]['title']) ? $list[0]['title'] : '',
'list'=> $list
);
break;
}
}
}
}
return $data;
}
/**
* 潮流资讯
* @param type string $tag 搜索内容
... ...
... ... @@ -778,7 +778,8 @@ class CartModel
if ($isMulti) {
$packageList = $cartInfo['package_list'];
foreach ($packageList as $pk => $pv) {
$packages[$pk]['title'] = ($pv['supplier_id'] == 0) ? '包裹1:总仓库' : '包裹2:异地调拨'; //仓库
$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);
... ... @@ -803,11 +804,12 @@ class CartModel
* @param int $deliveryWay 配送方式,1表示普通快递,2表示顺丰速运
* @param int $paymentType 支付方式,1表示在线支付,2表示货到付款
* @param string $couponCode 优惠券码
* @param string $promotionCode 优惠码
* @param mixed $yohoCoin 使用的YOHO币数量
* @param int $redEnvelopes 红包
* @return array 接口返回的数据
*/
public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $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());
... ... @@ -815,7 +817,7 @@ class CartModel
if (!empty($yohoCoin)) {
$yohoCoin = intval($yohoCoin) / 100;
}
$compute = CartData::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $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'])) {
... ...
... ... @@ -388,10 +388,13 @@ class IndexController extends WebAction
$deliveryWay = $this->post('deliveryWay', 1);
$paymentType = $this->post('paymentType', 1);
$couponCode = $this->post('couponCode', null);
$promotionCode = $this->post('promotionCode', null);
$yohoCoin = $this->post('yohoCoin', null);
$redEnvelopes = $this->post('redEnvelopes', null);
$uid = $this->getUid(false);
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin, $redEnvelopes);
//优先取优惠码
$couponCode = $promotionCode ? null : $couponCode;
$result = CartModel::orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $promotionCode, $yohoCoin, $redEnvelopes);
}
$this->echoJson($result);
... ...
... ... @@ -27,7 +27,7 @@ class IndexController extends WebAction
if (!$result) {
$this->go(SITE_MAIN);
}
$type = intval(isset($result['type']) ? $result['type'] : '');
switch ($type) {
case 1:
... ... @@ -47,6 +47,16 @@ class IndexController extends WebAction
$this->shopHome($result['shopId']);
exit(0);
}
//基础模板
if ($result['shopTemplateType'] === 1 && !empty($result['shopId'])) {
$basisData = ShopModel::basisTemplate($result['shopId']);
$result['brandBanner'] = empty($basisData['shopTopBanner']['banner']) ?
$result['brandBanner'] : $basisData['shopTopBanner']['banner'];
$result['signboard'] = $basisData['signboard'];
if (isset($result['node'])) {
unset($result['node']);
}
}
break;
}
... ... @@ -81,6 +91,8 @@ class IndexController extends WebAction
//调用模型获得品牌页数据
$data = BrandsModel::getBrandSearchData($condition, $options);
//水牌位
$data['signboard'] = isset($result['signboard']) ? $result['signboard'] : '';
$seo = $data['seo'];
$data = array(
//初始化js
... ...