Authored by uedxwg

update

Showing 33 changed files with 510 additions and 305 deletions
... ... @@ -27,10 +27,10 @@ class Yohobuy
const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
const YOHOBUY_ORDER = 'http://192.168.102.205:8084/order/'; //我的订单
const API_URL_MYCENTER = 'http://192.168.102.205:8081/users/'; // 我的个人中心接口URL
const YOHOBUY_ORDER = 'http://192.168.102.209:8084/order/'; //我的订单
const API_URL_MYCENTER = 'http://192.168.102.207:8081/users/'; // 我的个人中心接口URL
const API_URL_SHOPINGCART = 'http://192.168.102.213:8080/api-gateway-web/'; // 我的购物车接口URL
const API_URL_PRODUCTDETAIL = 'http://192.168.102.205:8083/product/'; // 商品详情页
const API_URL_PRODUCTDETAIL = 'http://192.168.102.212:8083/product/'; // 商品详情页
const API_URL_LOGISTICS = 'http://192.168.102.205:8080/gateway'; //查看物流接口URL
/**
... ...
... ... @@ -18,7 +18,7 @@ class OrderData
* and open the template in the editor.
*/
static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid)
public static function getOrderData($type, $page, $limit, $gender, $yh_channel, $uid)
{
//构建必传参数
$param = Yohobuy::param();
... ... @@ -40,7 +40,7 @@ class OrderData
* and open the template in the editor.
*/
static function cancelOrderData($order_code, $uid, $gender, $yh_channel)
public static function cancelOrderData($order_code, $uid, $gender, $yh_channel)
{
//构建必传参数
$param = Yohobuy::param();
... ... @@ -60,7 +60,7 @@ class OrderData
* and open the template in the editor.
*/
static function deleteOrderData($order_code, $uid, $gender, $yh_channel)
public static function deleteOrderData($order_code, $uid, $gender, $yh_channel)
{
//构建必传参数
$param = Yohobuy::param();
... ... @@ -76,17 +76,18 @@ class OrderData
/*
* 我的订单-查看物流
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*
* @param int $orderCode 订单号
* @param int $uid 用户ID
* @return array
*/
static function LogisticsData()
public static function LogisticsData($orderCode, $uid)
{
//构建必传参数
$param = Yohobuy::param();
$param['method'] = 'app.express.li';
//$param['gender'] = $gender;
//$param['yh_channel'] = $yh_channel;
$param['order_code'] = $orderCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
//调用接口获得数据
return Yohobuy::get(Yohobuy::API_URL, $param);
... ... @@ -96,7 +97,7 @@ class OrderData
* 支付url
* To change this template file, choose Tools | Templates
*/
static function paymentData($gender, $yh_channel, $code)
public static function paymentData($gender, $yh_channel, $code)
{
//构建必传参数
$param = Yohobuy::param();
... ... @@ -109,10 +110,11 @@ class OrderData
}
/*
* 随便逛逛url
* To change this template file, choose Tools | Templates
* 随便逛逛url
*
* 备注:暂不使用
*/
static function strollData($gender, $yh_channel, $code)
public static function strollData($gender, $yh_channel, $code)
{
//构建必传参数
$param = Yohobuy::param();
... ...
... ... @@ -21,6 +21,7 @@ class UserData
* 个人详情数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array 个人详情接口返回的数据
*/
public static function userData($uid)
... ... @@ -39,11 +40,12 @@ class UserData
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function infoNum($uid)
public static function infoNum($uid, $udid)
{
$param = Yohobuy::param();
$param['method'] = 'app.home.getInfoNum';
$param['uid'] = $uid;
$param['udid'] = $udid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ... @@ -189,7 +191,23 @@ class UserData
}
/**
* YOHO币数据
* YOHO币总数
*
* @param int $uid 用户ID
* @return array YOHO币接口返回的数据
*/
public static function yohoCoinTotal($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.yohocoin.total';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* YOHO币列表数据
*
* @param int $uid 用户ID
* @param int $page 第几页,默认1
... ...
... ... @@ -16,7 +16,7 @@ use Api\Sign;
*/
class SearchData
{
/**
* 获取搜索的服务地址
*
... ... @@ -29,9 +29,9 @@ class SearchData
defined('APPLICATION_ENV') || define('APPLICATION_ENV', 'developer');
switch (APPLICATION_ENV) {
case 'release':
case 'test':
case 'preview':
return 'http://100.98.132.63/yohosearch/search.json';
case 'test':
case 'preview':
case 'developer':
default:
return 'http://101.200.31.165/yohosearch/search.json';
... ... @@ -148,7 +148,7 @@ class SearchData
if (!isset($condition['order'])) {
$param['order'] = $orderMaps['s_t_desc'];
} else {
$param['order'] = $orderMaps[ $condition['order'] ];
$param['order'] = $orderMaps[$condition['order']];
}
if (!isset($condition['page'])) {
$param['page'] = 1;
... ...
... ... @@ -9,6 +9,7 @@ use Plugin\Helpers;
*/
class FloorProcess
{
/**
* 频道参数
*
... ... @@ -34,6 +35,10 @@ class FloorProcess
$build = array();
foreach ($data['list'] as $v) {
if (empty($v)) {
continue;
}
$fun = $v['template_name'];
if (empty($v['data']) || !is_callable("self::$fun")) {
continue;
... ... @@ -203,7 +208,7 @@ class FloorProcess
foreach ($data['list'] as &$one) {
if (isset($one['url'])) {
$one['url'] = Helpers::getFilterUrl($one['url']);
isset(self::$channel[$type]) && $one['url'] .= '?gender='.self::$channel[$type];
isset(self::$channel[$type]) && $one['url'] .= '?gender=' . self::$channel[$type];
}
$one['img'] = Helpers::getImageUrl($one['src'], 158, 174);
unset($one['src']);
... ... @@ -299,11 +304,11 @@ class FloorProcess
unset($one['src']);
}
// 区别多张图与一张图
if (count($data['big_image']) > 1) {
$result['big_image']['big_list'] = $data['big_image'];
unset($data['big_image']);
}
// 区别多张图与一张图
if (count($data['big_image']) > 1) {
$result['big_image']['big_list'] = $data['big_image'];
unset($data['big_image']);
}
foreach ($data['list'] as $kk => &$one) {
if ($kk == 0) {
... ...
... ... @@ -203,7 +203,7 @@ class Helpers
$result['product_id'] = $productData['product_id'];
$result['thumb'] = Images::getImageUrl($productData['default_images'], $width, $height);
$result['name'] = $productData['product_name'];
$result['price'] = empty($productData['market_price']) ? false : $productData['market_price'];
$result['price'] = empty($productData['market_price']) ? false : $productData['market_price'];
$result['salePrice'] = $productData['sales_price'];
if ($showPoint) {
$result['price'] && $result['price'] .= '.00';
... ... @@ -211,12 +211,12 @@ class Helpers
}
$result['is_soon_sold_out'] = ($productData['is_soon_sold_out'] === 'Y');
$result['url'] = SITE_MAIN . '/product/pro_' . $productData['product_id'] . '_'
. $productData['goods_list'][0]['goods_id']
. '/' . $productData['cn_alphabet'] . '.html';
. $productData['goods_list'][0]['goods_id']
. '/' . $productData['cn_alphabet'] . '.html';
// APP访问需要加附加的参数
// 备注:如果以后APP的接口太多,可以把这边参数提取出来,变成一个公共的方法来生成,便于以后管理维护
if ($isApp) {
$result['url'] .= '?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":'.$productData['product_skn'].'}}';
$result['url'] .= '?openby:yohobuy={"action":"go.productDetail","params":{"product_skn":' . $productData['product_skn'] . '}}';
}
if ($showTags) {
... ... @@ -228,21 +228,19 @@ class Helpers
$result['tags']['midYear'] = isset($productData['mid-year']) && $productData['mid-year'] === 'Y'; // 年中
$result['tags']['yearEnd'] = isset($productData['year-end']) && $productData['year-end'] === 'Y'; // 年末
$result['tags']['is_advance'] = isset($productData['is_advance']) && $productData['is_advance'] === 'Y'; // 再到着
// 打折与即将售完组合显示打折
if ($result['is_soon_sold_out'] && $result['tags']['is_discount']) {
$result['tags']['is_new'] = false;
}
// 打折与其它组合则隐藏打折
elseif ($result['tags']['is_discount'] &&
($result['tags']['is_new'] || $result['tags']['is_limited'] || $result['tags']['is_yohood'] || $result['tags']['is_advance']) ) {
elseif ($result['tags']['is_discount'] &&
($result['tags']['is_new'] || $result['tags']['is_limited'] || $result['tags']['is_yohood'] || $result['tags']['is_advance'])) {
$result['tags']['is_discount'] = false;
}
}
// YOHOOD和新品组合显示YOHOOD
elseif ($result['tags']['is_yohood'] && $result['tags']['is_new']) {
$result['tags']['is_new'] = false;
}
}
return $result;
... ... @@ -287,7 +285,7 @@ class Helpers
$result['like']['count'] = $articleData['praise_num'];
$result['like']['isLiked'] = isset($articleData['isPraise']) && $articleData['isPraise'] === 'Y';
}
// 分享链接
$result['share'] = $isApp && isset($articleData['share']['url']) ? $articleData['share']['url'] : false;
... ... @@ -493,4 +491,25 @@ class Helpers
return false;
}
//格式化订单商品
public static function formatOrderGoods($orderGoods)
{
$arr = array();
foreach ($orderGoods as $key => $vo) {
$arr[$key]['thumb'] = Helpers::getImageUrl($vo['goods_image'], 90, 120);
$arr[$key]['name'] = $vo['product_name'];
$arr[$key]['color'] = $vo['color_name'];
$arr[$key]['size'] = $vo['size_name'];
$arr[$key]['price'] = $vo['goods_price'];
$arr[$key]['count'] = $vo['buy_number'];
//gift=>是否赠品,advanceBuy=>是否加价购;
if ($vo['goods_type'] == 'gift') {
$arr[$key]['gift'] = true;
} elseif ($vo['goods_type'] == 'price_gift') {
$arr[$key]['advanceBuy'] = true;
}
}
return $arr;
}
}
... ...
... ... @@ -52,6 +52,7 @@ function getOrders(option) {
data: opt,
success: function(data) {
var num;
if (data !== ' ') {
order.page = opt.page;
... ...
/**
* 支付页面
* @author: 赵彪<bill.zhao@yoho.cn>
* @date: 2015/12/03
*/
function isWXOpen() {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) === 'micromessenger') {
return true;
} else {
return false;
}
}
function hideWeChatPay() {
var payApps = document.getElementsByClassName('app');
[].forEach.call(payApps, function(app, index) {
if (app.innerHTML.indexOf('微信') !== -1) {
app.parentNode.style.display = 'none';
return false;
}
});
}
function handleForWX() {
if (isWXOpen()) {
hideWeChatPay();
}
}
window.onload = handleForWX;
... ...
... ... @@ -5,9 +5,8 @@
* @date: 2015/10/19
*/
var $ = require('jquery');
// Hammer = require('yoho.hammer');
var $ = require('jquery'),
Hammer = require('yoho.hammer');
var $filter;
... ... @@ -113,8 +112,7 @@ function subClassifyTapEvt($this) {
//初始化筛选
function initFilter(opt) {
// var filterHammer;
var filterHammer;
//注册回调
fCbFn = opt.fCbFn;
... ... @@ -127,8 +125,8 @@ function initFilter(opt) {
$filter = $('.filter-mask');
// filterHammer = new Hammer($filter[0]);
$filter.on('touchend', function(e) {
filterHammer = new Hammer($filter[0]);
filterHammer.on('tap', function(e) {
var $this = $(e.target),
$cur;
... ... @@ -147,7 +145,7 @@ function initFilter(opt) {
//tap classify
$cur = $this.closest('.classify-item');
e.stopPropagation();
e.srcEvent.stopPropagation();
classifyTapEvt($cur);
}
... ... @@ -183,4 +181,4 @@ exports.showFilter = showFilter;
exports.hideFilter = hideFilter;
exports.resetFilter = resetFilter;
\ No newline at end of file
exports.resetFilter = resetFilter;
... ...
/**
* 我要咨询提交页面
* @author: liangzhifeng<zhifeng.liang@yoho.cn>
* @date: 2015/12/01
*/
var $ = require('jquery'),
tip = require('../../plugin/tip'),
loading = require('../../plugin/loading');
var $consultForm = $('.consult-form'),
$submit = $('#submit'),
$content = $('#content'),
productId = $('#product_id').val(),
isSubmiting;
$submit.on('touchend', function() {
$content.blur();
$consultForm.submit();
return false;
}).on('touchstart', function() {
$(this).addClass('highlight');
}).on('touchend touchcancel', function() {
$(this).removeClass('highlight');
});
$content.on('focus', function() {
if ($content.val() === '请输入咨询内容') {
$content.val('');
}
}).on('blur', function() {
if ($content.val() === '') {
$content.val('请输入咨询内容');
}
});
// 提交表单请求
$consultForm.on('submit', function() {
var content;
if (isSubmiting) {
return false;
}
// 简单的表单校验
content = $content.val();
if (!content || content === '请输入咨询内容') {
tip.show('咨询内容不能为空');
return false;
}
isSubmiting = true;
loading.showLoadingMask();
$.ajax({
method: 'POST',
url: '/product/detail/consultsubmit',
data: {
product_id: productId,
content: content
}
}).then(function(res) {
if ($.type(res) !== 'object') {
res = {};
}
if (res.code !== 200) {
tip.show(res.message || '网络出了点问题~');
isSubmiting = false;
loading.hideLoadingMask();
} else {
window.history.go(-1);
}
}).fail(function() {
tip.show('网络出了点问题~');
isSubmiting = false;
});
return false;
});
... ...
... ... @@ -9,10 +9,9 @@ var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../../plugin/tip');
var likeHammer = new Hammer(document.getElementById('likeBtn'));
var addToCartHammer = new Hammer(document.getElementById('addtoCart'));
var productId = $('#productId').val();
var likeHammer = new Hammer(document.getElementById('likeBtn')),
addToCartHammer = new Hammer(document.getElementById('addtoCart')),
productId = $('#productId').val();
likeHammer.on('tap', function(e) {
var opt,
... ...
... ... @@ -8,4 +8,5 @@ require('./newsale/newarrival');
require('./newsale/discount');
require('./list');
require('./detail/detail');
require('./detail/desc');
\ No newline at end of file
require('./detail/loadmore');
require('./detail/consultform');
\ No newline at end of file
... ...
... ... @@ -157,6 +157,9 @@
margin-top: -$height / 2;
}
.del-fav {
text-indent: 0;
}
}
span {
... ...
.pay-page {
padding: (40rem / $pxConvertRem) (20rem / $pxConvertRem) 0;
.box {
border: 1px solid #eee;
border-radius: 10rem / $pxConvertRem;
padding: (12rem / $pxConvertRem) (20rem / $pxConvertRem);
display: flex;
align-items: center;
margin-bottom: 20rem / $pxConvertRem;
> div {
min-height: 40rem / $pxConvertRem;
display: flex;
align-items: center;
}
.icon {
flex-grow: 0.3;
img {
width: 60rem / $pxConvertRem;
margin: 0;
}
}
.app {
flex-grow: 3;
font-size: 32rem / $pxConvertRem;
color: #414141;
//padding-left: 20rem/$pxConvertRem
}
.hint {
flex-grow: 4;
font-size: 24rem / $pxConvertRem;
color: #4b4b4b;
}
.iconfont {
flex-grow: 1;
justify-content: flex-end;
color: #e0e0e0;
font-size: 28rem / $pxConvertRem;
}
}
}
... ...
... ... @@ -261,7 +261,13 @@
height: pxToRem(200px);
line-height: pxToRem(200px);
color: #e0e0e0;
font-size: 20px;
text-align: center;
span{
display: inline-block;
font-size: 20px;
padding-right: 5px;
}
}
}
}
... ...
... ... @@ -33,11 +33,8 @@ $basicBtnC:#eb0313;
line-height: pxToRem(36px);
&.table {
width: 100%;
// .row {
// display: table-row;
.column {
box-sizing: border-box;
display: table-cell;
padding: pxToRem(20px) pxToRem(12px);
width: 50%;
border-bottom: 1px solid #fff;
... ... @@ -45,9 +42,6 @@ $basicBtnC:#eb0313;
font-size: pxToRem(24px);
background-color: $tableCellC;
float: left;
// &:nth-child(even) {
// border-right: none;
// }
}
}
}
... ... @@ -89,7 +83,6 @@ $basicBtnC:#eb0313;
left: pxToRem(108px);
top: pxToRem(40px);
height: pxToRem(35px);
// width: pxToRem(70px);
color: #fff;
font-size: pxToRem(20px);
line-height: pxToRem(35px);
... ... @@ -121,6 +114,10 @@ $basicBtnC:#eb0313;
background-color: #000;
color: #fff;
}
.yohood-tag {
background-color: #000;
color: #fff;
}
.limit-tag {
border: 1px solid #000;
background-color: #fff;
... ... @@ -137,6 +134,12 @@ $basicBtnC:#eb0313;
background-color: #fff;
// overflow: hidden;
}
.banner-top-single{
width: pxToRem(448px);
margin:pxToRem(30px) pxToRem(72px);
overflow: hidden;
}
.banner-top {
// width: 100%;
min-height: 660rem / $pxConvertRem;
... ... @@ -163,14 +166,12 @@ $basicBtnC:#eb0313;
min-height: pxToRem(600px);
min-width: pxToRem(448px);
margin: pxToRem(30px) pxToRem(96px);
// position: relative;
overflow: hidden;
ul {
position: relative;
height: 100%;
li {
float: left;
// height: 100%;
}
}
}
... ...
... ... @@ -130,9 +130,10 @@
div {
text-align: center;
&.cell {
line-height: pxToRem(53px);
font-size: pxToRem(24px);
background-color: $tableCellC;
padding: pxToRem(15px) pxToRem(40px);
padding: 0 pxToRem(40px);
border: 1px solid #fff;
}
}
... ... @@ -143,14 +144,15 @@
#reference-swiper-container {
.first-group {
width: pxToRem(70px);
margin-top: pxToRem(66px);
.avatar {
// line-height: pxToRem(40px);
display: inline-block;
width: pxToRem(40px);
border-radius: 50%;
height: pxToRem(40px);
margin: pxToRem(12px) 0;
margin-top: pxToRem(55px);
div{
height: pxToRem(55px);
.avatar {
display: inline-block;
width: pxToRem(40px);
border-radius: 50%;
margin-top:pxToRem(7px);
}
}
}
}
... ...
{{> layout/header}}
<div class="pay-page yoho-page">
{{# payAppInfo}}
<div class="box">
<div class="icon">
<img src="{{appIcon}}" alt="app图标">
</div>
<div class="app">{{app}}</div>
<div class="hint">
{{hint}}
{{#if subHint}}
<br>
{{subHint}}
{{/if}}
</div>
<div class="iconfont">&#xe604</div>
</div>
{{/ payAppInfo}}
</div>
{{> layout/footer}}
... ...
... ... @@ -3,7 +3,7 @@
<form class="consult-form" url="{{formUrl}}">
<textarea id="content" name="content">请输入咨询内容</textarea>
<input type="hidden" id="product_id" value="{{productId}}">
<a type="submit">提交</a>
<a type="submit" id="submit">提交</a>
</form>
</div>
{{> layout/footer}}
\ No newline at end of file
... ...
... ... @@ -2,10 +2,9 @@
<div class="good-detail-page yoho-page">
<div class="banner-container">
<div class="tag-container">
<p class="good-tag new-tag">NEW</p>
{{# tags}}
{{# is_new}}
<!-- <p class="good-tag new-tag">NEW</p> -->
<p class="good-tag new-tag">NEW</p>
{{/ is_new}}
{{# is_advance}}
<p class="good-tag renew-tag">再到着</p>
... ... @@ -14,7 +13,7 @@
<p class="good-tag sale-tag">SALE</p>
{{/ is_discount}}
{{# is_yohoood}}
<div class="good-tag yohood-tag"></div>
<div class="good-tag yohood-tag">新品节</div>
{{/ is_yohoood}}
{{# is_limited}}
<p class="good-tag limit-tag">限量商品</p>
... ... @@ -96,7 +95,7 @@
{{else}}
<div class="nodata">
<span>暂无商品评价和咨询</span>
<a href="/product/detail/consultform" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
<a href="{{link}}" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
{{/if}}
... ... @@ -132,10 +131,10 @@
</div>
{{/cartInfo}}
{{#if introUrl}}
<input id="introUrl" type="hidden" value={{introUrl}}>
<input id="introUrl" type="hidden" value='{{introUrl}}'>
{{/if}}
{{#if id}}
<input id="productId" type="hidden" value={{id}}>
<input id="productId" type="hidden" value='{{id}}'>
{{/if}}
</div>
... ...
{{> layout/header}}
<div class="newarrival-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
... ...
{{> layout/header}}
<div class="discount-page yoho-page">
{{# headerBanner}}
{{> product/banner_swipe_and_single}}
{{> product/banner-swipe-and-single}}
{{/ headerBanner}}
<ul id="list-nav" class="list-nav clearfix">
... ...
... ... @@ -22,7 +22,10 @@
<ul class="swiper-wrapper swiper-wrapper-{{id}}">
{{# productList}}
<li class="swiper-slide">
<img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/>
<a href="{{link}}">
<img class="swiper-lazy" data-src="{{imgUrl}}" alt=""/>
</a>
<div class="brand-product">
<div class="{{# discount}}price-discount{{/ discount}}">
{{# discount}}<span>{{.}}<span>{{/ discount}}
... ...
<script>
seajs.use('js/common');
</script>
{{!-- 逛(PLUS+STAR) --}}
{{!-- 逛(PLUS+STAR) --}}
{{#if psList}}
<script>
seajs.use('js/guang/plus-star/list');
... ... @@ -175,6 +175,12 @@
seajs.use('js/product/detail/loadmore');
</script>
{{/if}}
{{!-- 商品详情我要咨询 --}}
{{#if consultformPage}}
<script>
seajs.use('js/product/detail/consultform');
</script>
{{/if}}
{{!-- 品类 --}}
{{#if categoryPage}}
<script>
... ...
... ... @@ -44,7 +44,7 @@
</div>
<div class="answer">
<span class="iconfont">&#xe63c;</span>
<span class="iconfont">&#xe63d;</span>
<p>{{answer}}</p>
</div>
{{/ consults}}
... ... @@ -56,10 +56,10 @@
</div>
{{else}}
<div class="consult-content-main content-main no-item">
<span class="iconfont">&#xe63c;</span>暂无咨询
<span class="iconfont">&#xe63d;</span>暂无咨询
</div>
<div class="consult-content-footer">
<a href="/product/detail/consultform">
<a href="{{link}}">
我要咨询
<span class="iconfont">&#xe604;</span></a>
</div>
... ...
... ... @@ -72,7 +72,9 @@
{{#params}}
{{#if @first}}
{{else}}
<img class="avatar lazy" data-original="{{param}}" alt="">
<div>
<img class="avatar lazy" data-original="{{param}}" alt="">
</div>
{{/if}}
{{/params}}
</div>
... ...
... ... @@ -585,6 +585,7 @@ class HomeController extends AbstractAction
$channel = Helpers::getChannelByCookie();
$data = GradeModel::getGrade($gender, $channel, $this->_uid);
$data['pageFooter'] = true;
$this->_view->display('vip-grade', $data);
}
... ...
... ... @@ -16,8 +16,7 @@ class GradeModel
* 获取个人中心-会员等级数据
*/
public static function getGrade($gender, $channel, $uid)
{
public static function getGrade($channel, $uid) {
$result = array();
if (USE_CACHE) {
... ... @@ -27,9 +26,9 @@ class GradeModel
return $result;
}
}
//调用接口获取数据
$data = GradeData::getGradeData($channel, $uid);
if (!empty($data['grade'])) {
switch (intval($data['grade']['current_vip_level'])) {
case 0://普通会员
... ... @@ -47,25 +46,23 @@ class GradeModel
}
//今年总消费
$result['vipGrade']['costOfThisYear'] = $data['grade']['current_year_cost'];
//升级下一等级会员的进度;
if ($data['grade']['next_need_cost'] == 0) {
$result['vipGrade']['costOfThisYear'] = sprintf("%.2f", $data['grade']['current_year_cost']);
//升级下一等级会员的进度;
if($data['grade']['next_need_cost'] == 0){
//当vip等级升至顶级时,进度条满格
$result['vipGrade']['percent'] = 100;
} else {
$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']['costGap'] = sprintf("%.2f", $data['grade']['upgrade_need_cost']);
}
//消费总计
$result['vipGrade']['sumCost'] = $data['grade']['current_total_cost'];
//username 调用获取用户基本信息数据,获得username;
//$userProfile = GradeData::getUserProfileData($gender,$uid,$channel);
$result['vipGrade']['name'] = !empty($data['userProfile']) ? $data['userProfile']['username'] : '';
$result['vipGrade']['sumCost'] = sprintf("%.2f", $data['grade']['current_total_cost']);
//username 调用获取用户基本信息数据,获得nikename昵称;
$result['vipGrade']['name'] = !empty($data['userProfile']) ? $data['userProfile']['nickname'] : '';
//跳转url(会员特权详情)
$result['vipGrade']['allUrl'] = Helpers::url('/home/preferential', null);
//当前vip等级享受的特权
... ... @@ -85,13 +82,12 @@ class GradeModel
return $result;
}
/*
* 获取个人中心-会员特权详情页
*/
public static function getPreferential($channel, $uid)
{
public static function getPreferential($channel, $uid) {
$result = array();
if (USE_CACHE) {
... ... @@ -101,17 +97,17 @@ class GradeModel
return $result;
}
}
//调取接口获得数据
$data = GradeData::getPreferentialData($channel, $uid);
if (isset($data['code']) && $data['code'] == 200) {
$result['vipGrade']['privilege'] = $data['data'];
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_GRADE, 'slave');
$result = Cache::get(CacheConfig::KEY_ACTION_HOME_PREFERENTIAL, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
... ...
... ... @@ -4,14 +4,6 @@ namespace Home;
use LibModels\Wap\Home\OrderData;
use Plugin\Helpers;
use Plugin\Cache;
use Configs\CacheConfig;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
* Description of Order
... ... @@ -19,7 +11,6 @@ use Configs\CacheConfig;
*/
class OrderModel
{
/* 频道选择页取背景图片的位置码 */
const CODE_PAYMENT = '04cf5abaa7c20178325a07c4a833782c'; //支付订单资源码
const CODE_STROLL = 'a7989369aa86681c678bc40f171b8f1d'; //随便逛逛url地址资源码
... ... @@ -28,29 +19,25 @@ class OrderModel
* 订单相关数据处理
*/
static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid)
public static function getOrder($type, $page, $limit, $gender, $yh_channel, $uid)
{
$result = array();
if (USE_CACHE) {
$key = CacheConfig::KEY_ACTION_HOME_ORDER_ORDER;
// 先尝试获取一级缓存(master), 有数据则直接返回.
$result = Cache::get($key, 'master');
if (!empty($result)) {
return $result;
}
}
//调用接口获得数据
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
// 判断是否还有数据, 没有数据则返回空
if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) {
return $result;
}
//检查数据返回是否正常,正常则处理数据
if ($data['code'] == 200 && isset($data['data'])) {
if (!empty($data['data']['order_list'])) {
foreach ($data['data']['order_list'] as $key => $vo) {
//订单号,支付状态,订单商品数量,订单总价格(订单总价加上运费)
//订单号,支付状态,订单商品数量,订单总价格
$result[$key]['orderNum'] = $vo['order_code'];
$result[$key]['orderStatus'] = $vo['status_str'];
$result[$key]['count'] = count($vo['order_goods']);
$result[$key]['sumCost'] = $vo['amount'] + $vo['shipping_cost'];
$result[$key]['sumCost'] = $vo['amount'];
//类内调用格式化订单商品数据方法
$result[$key]['goods'] = self::formatOrderGoods($vo['order_goods']);
$result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods']);
//根据订单status判断订单处于什么状态。
do {
//订单取消状态 = Y 时,跳出判断订单状态循环,并设置订单状态为已取消。
... ... @@ -59,8 +46,8 @@ class OrderModel
break;
}
/* 先判断订单付款方式,根据不同的付款方式计算订单状态。(注:货到付款没有待付款状态)
* 付款方式:1 => 在线支付,2 => 货到付款,3 => 现金支付,4 => 抵消支付;
*/
* 付款方式:1 => 在线支付,2 => 货到付款,3 => 现金支付,4 => 抵消支付;
*/
//支付方式为非货到付款时,计算订单状态。
if ($vo['payment_type'] != 2) {
switch ($vo['status']) {
... ... @@ -71,25 +58,14 @@ class OrderModel
case 1:
case 2:
case 3:
case 4:
case 5:
//已付款状态不给查看物流URL
$result[$key]['unreceived'] = true;
//待收货状态,给查看物流url
$result[$key]['logisticsUrl'] = "暂无logisticsUrl数据";
break;
case 6:
$result[$key]['completed'] = true;
break;
default:
break;
}
} elseif ($vo['payment_type'] == 2) {
//订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态)
switch ($vo['status']) {
case 0 || 1 || 2 || 3 || 4 || 5:
case 4:
case 5:
//已发货状态,给查看物流URL
$result[$key]['unreceived'] = true;
//待收货状态,给查看物流url
$resault[$key]['logisticsUrl'] = "备注:暂无logisticsUrl数据";
$result[$key]['logisticsUrl'] = Helpers::url('/home/logistic', array('order_code' => $vo['order_code']));
break;
case 6:
$result[$key]['completed'] = true;
... ... @@ -97,123 +73,99 @@ class OrderModel
default:
break;
}
break;
}
//订单为货到付款订单时,计算订单状态。(货到付款没有待付款状态)
switch ($vo['status']) {
case 0:
case 1:
case 2:
case 3:
//备货中、已付款状态不给查看物流链接
$result[$key]['unreceived'] = true;
break;
case 4:
case 5:
//待收货状态,给查看物流url
$result[$key]['unreceived'] = true;
$result[$key]['logisticsUrl'] = Helpers::url('/home/logistic', array('order_code' => $vo['order_code']));
break;
case 6:
$result[$key]['completed'] = true;
break;
default:
break;
}
} while (false);
}
}
if (USE_CACHE) {
// 接口调用异常时, 不害怕,从我们的二级缓存(slave)里再取数据.
if (empty($result)) {
$result = Cache::get($key, 'slave');
}
// 接口调用正常,数据封装完成, 则设置一级(master)和二级(slave)数据缓存
else {
Cache::set($key, $result);
}
}
return $result;
}
//格式化订单商品
static function formatOrderGoods($orderGoods)
/**
* 获得支付链接
*/
public static function payment($gender, $yh_channel)
{
$arr = array();
foreach ($orderGoods as $key => $vo) {
$arr[$key]['thumb'] = Helpers::getImageUrl($vo['goods_image'], 90, 120);
$arr[$key]['name'] = $vo['product_name'];
$arr[$key]['color'] = $vo['color_name'];
$arr[$key]['size'] = $vo['size_name'];
$arr[$key]['price'] = $vo['goods_price'];
$arr[$key]['count'] = $vo['buy_number'];
//gift=>是否赠品,advanceBuy=>是否加价购;
if ($vo['goods_type'] == 'gift') {
$arr[$key]['gift'] = true;
} elseif ($vo['goods_type'] == 'price_gift') {
$arr[$key]['advanceBuy'] = true;
}
}
return $arr;
$code = self::CODE_PAYMENT;
$data = OrderData::paymentData($gender, $yh_channel, $code);
return $data;
}
//根据type值设置nav属性
static function getNavs($type)
/**
* 查看物流
*
* @param int $orderCode 订单编号
* @param int $uid 用户ID
* @return array
*/
public static function Logistics($orderCode, $uid)
{
$nav = array(
array(
'name' => '全部',
'typeId' => '1',
'url' => '/home/order?type=1'
),
array(
'name' => '待付款',
'typeId' => '2',
'url' => '/home/order?type=2'
),
array(
'name' => '待发货',
'typeId' => '3',
'url' => '/home/order?type=3'
),
array(
'name' => '待收货',
'typeId' => '4',
'url' => '/home/order?type=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;
$result = array();
if (isset($orderCode) && is_numeric($uid)) {
$logistics = OrderData::LogisticsData($orderCode, $uid);
if (!empty($logistics['data'])) {
$result['logisticUrl'] = $logistics['data']['url'];
$result['logisticImg'] = $logistics['data']['logo'];
$result['logisticCompany'] = $logistics['data']['caption'];
$result['logisticNumber'] = $logistics['data']['express_number'];
$build = array();
foreach ($logistics['data']['express_detail'] as $value) {
$build['status'] = $value['accept_address'];
$build['date'] = $value['acceptTime'];
$result['logisticDetail'][] = $build;
}
}
}
return $nav;
}
//获得支付链接
static function payment($gender, $yh_channel)
{
$code = self::CODE_PAYMENT;
$data = OrderData::paymentData($gender, $yh_channel, $code);
return $result;
}
//查看物流
// static function Logistics(){
// OrderData::LogisticsData();
// }
//随便逛逛url获取
static function stroll($gender, $yh_channel)
/**
* 根据type值设置nav属性
*/
public static function getNavs($type)
{
//获取随便逛逛url资源码
$code = self::CODE_STROLL;
//调用接口获得数据
$data = OrderData::strollData($gender, $yh_channel, $code);
$stroll = 1;
//检查数据返回是否正常,正常则处理数据
if ($data['code'] == 200) {
$strollUrl = $data['data'][0]['data'][0]['url'];
$navType = array(1 => '全部', 2 => '待付款', 3 => '待发货', 4 => '待收货');
$nav = array();
foreach ($navType as $key => $value) {
$act = false;
if ($type == $key) {
$act = true;
}
$nav[] = array(
'name' => $value,
'typeId' => $key,
'active' => $act,
'url' => Helpers::url('/home/order', array('type' => $key))
);
}
return $strollUrl;
return $nav;
}
}
... ...
... ... @@ -46,9 +46,9 @@ class HomeModel
const COOKIE_NAME_LIFESTYLE = 'lifestyle';
/* COOKIE标识访问的是男生频道底部Banner */
const CODE_NAME_BOYS_BOTTOM_BANNER = '8c48745a39373d621bf5fd80edf59b5e';
const CODE_NAME_BOYS_BOTTOM_BANNER = 'a2ec977c027d0cd9cdccb356ddf16b08';
/* COOKIE标识访问的是女生频道频道底部Banner */
const CODE_NAME_GIRLS_BOTTOM_BANNER = 'c63939b2ad458e9cb51147940c1da2e5';
const CODE_NAME_GIRLS_BOTTOM_BANNER = '8c8bd1b89a22e5895f05882e0825b493';
/**
* 选择频道
... ...
... ... @@ -46,14 +46,15 @@ class UserModel
* 处理个人中心页面优惠券,收藏的商品等的数目数据
*
* @param int $uid 用户ID
* @param int $udid 客户端唯一标识
* @return array|mixed 处理之后的个人中心页面优惠券,收藏的商品等的数目数据
*/
public static function getInfoNumData($uid)
public static function getInfoNumData($uid, $udid)
{
$result = array();
// 调用接口获取个人中心页面优惠券,收藏的商品等的数目数据
$infoNumData = UserData::infoNum($uid);
$infoNumData = UserData::infoNum($uid, $udid);
// 处理个人中心页面优惠券,收藏的商品等的数目数据
if (isset($infoNumData['data']) && !empty($infoNumData['data'])) {
... ... @@ -181,9 +182,9 @@ class UserModel
$product['imgUrl'] = Helpers::getImageUrl($val['image'], 447, 596);
;
$product['title'] = $val['product_name'];
$product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0;
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false;
$product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false;
$product['price'] = !empty($val['market_price']) ? '¥' . $val['market_price'] . '.00' : 0;
$product['discountPrice'] = ($val['market_price'] - $val['sales_price'] > 0) ? '¥' . $val['sales_price'] . '.00' : false;
$product['savePrice'] = ($val['price_down'] > 0) ? '¥' . $val['price_down'] . '.00' : false;
$product['sellOut'] = ($val['storage'] <= 0);
$datas[] = $product;
... ... @@ -236,7 +237,8 @@ class UserModel
$product = array();
foreach ($val['new_product'] as $one) {
$product = array();
$product['imgUrl'] = Images::getImageUrl($one['default_images'], 235, 314);
$product['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$product['imgUrl'] = (isset($one['default_images']) && !empty($one['default_images'])) ? Images::getImageUrl($one['default_images'], 235, 314) : '';
$product['price'] = !empty($one['market_price']) ? '¥' . $one['market_price'] . '.00' : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] . '.00' : 0;
... ... @@ -299,9 +301,10 @@ class UserModel
} else {
$data = $records['data']['product_list'];
foreach ($data as &$val) {
$val['image'] = Helpers::getImageUrl($val['image'], 140, 140);
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 140, 140) : '';
$val['sales_price'] = !empty($val['sales_price']) ? $val['sales_price'] . '.00' : 0;
$val['market_price'] = !empty($val['market_price']) ? $val['market_price'] . '.00' : 0;
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
}
!empty($data) && $result['browseRecord'] = $data;
}
... ... @@ -333,7 +336,7 @@ class UserModel
}
/**
* 处理YOHO币数据
* 处理YOHO币总数数据
*
* @param int $uid 用户ID
* @return array|mixed 处理之后的YOHO币数据
... ... @@ -343,7 +346,7 @@ class UserModel
$result = array();
// 调用接口获取YOHO币
$yohoCoin = UserData::yohoCoinData($uid);
$yohoCoin = UserData::yohoCoinTotal($uid);
// 处理YOHO币数据
if (isset($yohoCoin['data']) && !empty($yohoCoin['data'])) {
... ...
... ... @@ -31,8 +31,8 @@ class DetailModel
if (is_numeric($productId) && is_numeric($goodsId)) {
// 调用服务
$baseInfo = DetailData::baseInfo($productId, $uid);
$baseInfo = DetailData::baseInfo($productId, $uid);
// 判断商品是否在架
if (empty($baseInfo['status'])) {
return $result;
... ... @@ -41,7 +41,7 @@ class DetailModel
// 商品名称
if (isset($baseInfo['productName'])) {
$result['goodsName'] = $baseInfo['productName'];
}
}
// 商品标签
if (!empty($baseInfo['productTagBoList'])) {
... ... @@ -50,10 +50,10 @@ class DetailModel
case 'is_soon_sold_out': // 即将售磬
$result['tags']['is_soon_sold_out'] = true;
break;
case 'is_new': // 新品
case 'is_new': // 新品NEW
$result['tags']['is_new'] = true;
break;
case 'is_discount': // 在售
case 'is_discount': // SALE
$result['tags']['is_discount'] = true;
break;
case 'is_limited': // 限量
... ... @@ -68,7 +68,7 @@ class DetailModel
}
}
}
// 商品价格
if (isset($baseInfo['productPriceBo'])) {
$result['goodsPrice'] = array();
... ... @@ -88,10 +88,10 @@ class DetailModel
}
// 上市期
if (isset($baseInfo['expectArrivalTime'])) {
$result['periodOfMarket'] = date('n', $baseInfo['firstShelveTime']) . '月';
if (isset($baseInfo['expectArrivalTime']) && !empty($baseInfo['expectArrivalTime'])) {
$result['periodOfMarket'] = date('n', $baseInfo['expectArrivalTime']) . '月';
}
// 促销信息
if (isset($baseInfo['promotionBoList'])) {
$build = array();
... ... @@ -103,7 +103,7 @@ class DetailModel
}
$result['feedbacks'] = array();
// 商品咨询
$result['feedbacks']['consultsNum'] = 0;
if (!empty($baseInfo['consultBoWrapper'])) {
... ... @@ -118,7 +118,11 @@ class DetailModel
}
$result['feedbacks']['link'] = Helpers::url('/product/detail/consults', array('product_id' => $productId, 'total' => $result['feedbacks']['consultsNum']));
}
// 暂无咨询
else {
$result['feedbacks']['link'] = Helpers::url('/product/detail/consultform', array('product_id' => $productId));
}
// 商品评价
$result['feedbacks']['commentsNum'] = 0;
if (!empty($baseInfo['commentBoWrapper'])) {
... ... @@ -127,7 +131,7 @@ class DetailModel
$build = array();
foreach ($baseInfo['commentBoWrapper']['commentBoList'] as $value) {
$build['userName'] = $value['nickName'];
$build['desc'] = $value['colorName'] . $value['sizeName'];
$build['desc'] = $value['colorName'] . '/' . $value['sizeName'];
$build['content'] = $value['content'];
$build['time'] = $value['createTime'];
$result['feedbacks']['comments'][] = $build;
... ... @@ -155,7 +159,7 @@ class DetailModel
$colorId = intval($value['colorId']);
// 商品按颜色进行分类分组
foreach ($value['goodsImagesList'] as $goods) {
$goodsList[ $goods['goodsId'] ] = $colorId;
$goodsList[$goods['goodsId']] = $colorId;
$goodsGroup[$colorId][] = array(
'goodsId' => $goods['goodsId'],
'img' => $goods['imageUrl'],
... ... @@ -168,14 +172,14 @@ class DetailModel
}
// 商品的尺码列表
foreach ($value['goodsSizeBoList'] as $size) {
$sizeGroup[ $colorId ] = array(
$sizeGroup[$colorId] = array(
'sizeName' => $size['sizeName'],
'sizeSku' => $size['goodsSizeSkuId'],
'sizeStorage' => $size['goodsSizeStorageNum'],
);
}
}
// 商品图
$goodsId = intval($goodsId);
if (isset($goodsList[$goodsId])) {
... ... @@ -199,17 +203,17 @@ class DetailModel
// 悬浮的购物车信息
$result['cartInfo'] = array(
'cartUrl' => Helpers::url('/shoppingCart'),
'cartUrl' => Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'),
'numInCart' => 0,
'goodsInstore' => $baseInfo['storage'],
);
// 是否收藏
$result['isCollect'] = false;
if (isset($baseInfo['isCollect']) && $baseInfo['isCollect'] === 'Y') {
$result['isCollect'] = true;
}
// 底部简介的URL链接
$result['introUrl'] = Helpers::url('/product/intro_' . $baseInfo['erpProductId'] . '/' . $baseInfo['cnAlphabet'] . '.html');
$result['id'] = $productId;
... ... @@ -227,11 +231,11 @@ class DetailModel
public static function getSizeInfo($productSkn)
{
$result = array();
if (is_numeric($productSkn)) {
// 调用服务
$sizeInfo = DetailData::sizeInfo($productSkn);
// 商品信息
if (isset($sizeInfo['productDescBo']['erpProductId'])) {
$sex = '通用';
... ... @@ -245,7 +249,7 @@ class DetailModel
}
$result['goodsDescription'] = array(
'title' => '商品信息',
'enTitle' => 'PRODUCT INFO',
'enTitle' => 'DESCRIPTION',
'detail' => array(
'list' => array(
array('param' => '编号:' . $sizeInfo['productDescBo']['erpProductId']),
... ... @@ -263,7 +267,7 @@ class DetailModel
if (isset($sizeInfo['phrase'])) {
$result['goodsDescription']['desc'] = $sizeInfo['phrase'];
}
// 尺码信息
if (!empty($sizeInfo['sizeInfoBo'])) {
$result['sizeInfo'] = array(
... ... @@ -271,25 +275,25 @@ class DetailModel
'enTitle' => 'SIZE INFO',
'detail' => array('list' => array()),
);
$sizeNameList = array(0 => array('param' => '吊牌尺码')) ; // 尺码名称
$sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
$sizeBoGroup = array(); // 尺码按ID分组
foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) {
$sizeBoGroup[ $attr['id'] ][0] = array('param' => $attr['attributeName']);
$sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']);
}
foreach ($sizeInfo['sizeInfoBo']['sizeBoList'] as $value) {
$sizeNameList[] = array('param' => $value['sizeName']);
foreach ($value['sortAttributes'] as $attr) {
$sizeBoGroup[ $attr['id'] ][] = array('param' => $attr['sizeValue']);
$sizeBoGroup[$attr['id']][] = array('param' => $attr['sizeValue']);
}
}
// 根据模板页面的显示,按表格一列一列来显示
$result['sizeInfo']['detail']['list'][0]['params'] = $sizeNameList;
foreach ($sizeBoGroup as $value) {
$result['sizeInfo']['detail']['list'][]['params'] = $value;
}
}
// 测量方式
if (!empty($sizeInfo['sizeImage'])) {
$result['measurementMethod'] = array(
... ... @@ -298,7 +302,7 @@ class DetailModel
'img' => $sizeInfo['sizeImage'],
);
}
// 模特试穿, 竖着输出排列显示
if (!empty($sizeInfo['modelBos'])) {
$result['reference'] = array(
... ... @@ -306,11 +310,11 @@ class DetailModel
'enTitle' => 'REFERENCE',
'detail' => array('list' => array()),
);
// 控制是否显示备注
$showRemark = false;
$remarkList = array(0 => array('param' => '备注'));
$result['reference']['detail']['list'][0]['params'] = array(0 => array('param' => '')); // 头像列表
$result['reference']['detail']['list'][1]['params'] = array(0 => array('param' => '模特')); // 模特名字列表
$result['reference']['detail']['list'][2]['params'] = array(0 => array('param' => '身高')); // 身高列表
... ... @@ -318,7 +322,7 @@ class DetailModel
$result['reference']['detail']['list'][4]['params'] = array(0 => array('param' => '三围')); // 三围列表
$result['reference']['detail']['list'][5]['params'] = array(0 => array('param' => '吊牌尺码')); // 吊牌尺码
$result['reference']['detail']['list'][6]['params'] = array(0 => array('param' => '试穿描述')); // 试穿描述
foreach ($sizeInfo['modelBos'] as $value) {
$result['reference']['detail']['list'][0]['params'][] = array('param' => $value['avatar']);
$result['reference']['detail']['list'][1]['params'][] = array('param' => $value['modelName']);
... ... @@ -334,13 +338,13 @@ class DetailModel
$remarkList[] = array('param' => '');
}
}
// 显示模特备注
if ($showRemark) {
$result['reference']['detail']['list'][7]['params'] = $remarkList;
}
}
// 商品材质
if (!empty($sizeInfo['productMaterialList'])) {
$result['materials'] = array(
... ... @@ -355,7 +359,7 @@ class DetailModel
);
}
}
// 洗涤提示
if (!empty($sizeInfo['washTipsBoList'])) {
$result['washTips']['list'] = array();
... ... @@ -363,7 +367,7 @@ class DetailModel
$result['washTips']['list'][] = $value;
}
}
// 详情配图
if (isset($sizeInfo['productIntroBo']['productIntro'])) {
$productIntro = $sizeInfo['productIntroBo']['productIntro'];
... ... @@ -380,7 +384,6 @@ class DetailModel
);
}
}
}
return $result;
... ... @@ -392,7 +395,7 @@ class DetailModel
public static function getComments($productId, $pageNum = 1, $pageSize = 100)
{
$result = array();
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$commentList = DetailData::commentList($productId, $pageNum, $pageSize);
if (!empty($commentList)) {
... ... @@ -406,10 +409,10 @@ class DetailModel
}
}
}
return $result;
}
/**
* 获取咨询列表
*
... ... @@ -421,7 +424,7 @@ class DetailModel
public static function getConsults($productId, $pageNum = 1, $pageSize = 100)
{
$result = array();
if (is_numeric($productId) && is_numeric($pageNum) && is_numeric($pageSize)) {
$consultList = DetailData::consultList($productId, $pageNum, $pageSize);
if (!empty($consultList)) {
... ... @@ -435,10 +438,10 @@ class DetailModel
}
$consultList = array();
}
return $result;
}
/**
* 获取为你优选的商品
*
... ... @@ -448,7 +451,7 @@ class DetailModel
public static function getPreference($productSkn)
{
$result = array();
if (is_numeric($productSkn)) {
$preference = DetailData::preference($productSkn);
if (!empty($preference['data'])) {
... ... @@ -457,8 +460,8 @@ class DetailModel
}
}
}
return $result;
}
}
... ...
... ... @@ -184,12 +184,12 @@ class NewsaleModel
$newsale = NewsaleData::getNewsaleFocus($codeKey);
// 调用接口获取数据并封装
if (isset($newsale['code']) && isset($newsale['data'][0]['data'])) {
if(count($newsale['data'][0]['data']) === 1) {
$result = Helpers::formatBanner($newsale['data'][0]['data'][0], 640, 240);
if (isset($newsale['code']) && isset($newsale['data']['list'])) {
if(count($newsale['data']['list']) === 1) {
$result = Helpers::formatBanner($newsale['data']['list'][0]['data'][0], 640, 240);
} else {
foreach ($newsale['data'][0]['data'] as $one) {
$result['list'][] = Helpers::formatBanner($one, 640, 240);
foreach ($newsale['data']['list'] as $one) {
$result['list'][] = Helpers::formatBanner($one['data'], 640, 240);
}
}
}
... ...