Authored by biao

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

... ... @@ -370,7 +370,7 @@ class AbstractAction extends Controller_Abstract
* 设置网站导航头部信息
*
* @param string $title 头部标题
* @param string $backUrl 返回的链接
* @param mixed $backUrl 返回的链接
* @param string $homeUrl 返回首页的链接
* @return void
*/
... ... @@ -385,6 +385,9 @@ class AbstractAction extends Controller_Abstract
if ($backUrl) {
$header['navBack'] = true;
if (is_string($backUrl) && $backUrl != '') {
$header['backUrl'] = $backUrl;
}
}
if (!empty($title)) {
$header['navTitle'] = $title;
... ...
... ... @@ -18,17 +18,21 @@ class Yohobuy
{
/* 正式环境 */
// const API_URL = 'http://api2.open.yohobuy.com/';
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL_LOGINSESSION = 'http://m1.yohobuy.com/';
/* 测试环境 */
const API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const API_URL = 'http://api2.open.yohobuy.com/';
// const API_URL2 = 'http://api.open.yohobuy.com/';
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
const API_URL = 'http://apih5.yoho.cn/';
const API_URL2 = 'http://apih5.yoho.cn/';
const SERVICE_URL = 'http://serviceh5.yoho.cn/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
// /* 测试环境 */
// const API_URL = 'http://testapi.yoho.cn:28078/';
// const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
/**
* 私钥列表
*
... ... @@ -212,7 +216,6 @@ class Yohobuy
if (!empty($data)) {
$str = http_build_query($data, null, '&');
// 新加支持application/x-www-form-urlencoded调用方式
//curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_POSTFIELDS, $str);
}
... ...
... ... @@ -517,6 +517,52 @@ class Helpers
}
/**
* 订单状态,按订单支付类型和订单状态
* @var array
*/
public static function getOrderStatus()
{
return array(
'1' => array(//在线支付
0 => '待付款',
1 => '已付款',
2 => '已付款',
3 => '已付款',
4 => '已发货',
5 => '已发货',
6 => '交易成功'
),
'2' => array(//货到付款
0 => '备货中',
1 => '已付款',
2 => '已付款',
3 => '已付款',
4 => '已发货',
5 => '已发货',
6 => '交易成功'
),
'3' => array(//现金支付
0 => '待付款',
1 => '已付款',
2 => '已付款',
3 => '已付款',
4 => '已发货',
5 => '已发货',
6 => '交易成功'
),
'4' => array(//抵消支付
0 => '待付款',
1 => '已付款',
2 => '已付款',
3 => '已付款',
4 => '已发货',
5 => '已发货',
6 => '交易成功'
)
);
}
/**
* 获取会员的级别
*
* @param string $vipInfo
... ...
... ... @@ -2816,10 +2816,10 @@ $loginBtn.on('touchstart', function() {
dataType: 'jsonp'
});
//1s后跳转页面
//2s后跳转页面
setTimeout(function() {
location.href = res.href;
}, 1000);
}, 2000);
} else {
showErrTip(data.message);
}
... ... @@ -2948,10 +2948,10 @@ $loginBtn.on('touchstart', function() {
dataType: 'jsonp'
});
//1000ms后跳转页面
//2000ms后跳转页面
setTimeout(function() {
location.href = res.href;
}, 1000);
}, 2000);
} else {
showErrTip(data.message);
}
... ... @@ -5154,7 +5154,8 @@ $consultForm.on('submit', function() {
isSubmiting = false;
loading.hideLoadingMask();
} else {
window.history.go(-1);
tip.show('提交成功~');
setTimeout(window.history.go(-1), 3000);
}
}).fail(function() {
tip.show('网络出了点问题~');
... ...
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.
... ... @@ -73,6 +73,8 @@ $loginBtn.on('touchstart', function() {
return;
}
$loginBtn.text('正在登录...').addClass('disable');
if (api.phoneRegx[areaCode].test(pn) && api.pwdValidate(pwd)) {
$.ajax({
type: 'POST',
... ... @@ -83,7 +85,8 @@ $loginBtn.on('touchstart', function() {
password: pwd
},
success: function(data) {
var res;
var res,
time;
if (data.code === 200) {
res = data.data;
... ... @@ -91,19 +94,32 @@ $loginBtn.on('touchstart', function() {
$.ajax({
url: res.session,
dataType: 'jsonp'
dataType: 'jsonp',
success: function() {
clearTimeout(time);
//Cookie写入成功后,1s后跳转页面
setTimeout(function() {
location.href = res.href;
}, 1000);
}
});
//1000ms后跳转页面
setTimeout(function() {
//3秒后强制跳转
time = setTimeout(function() {
location.href = res.href;
}, 1000);
}, 3000);
showErrTip('登录成功');
} else {
showErrTip(data.message);
}
},
error: function() {
showErrTip('网络断开连接啦~');
},
complete: function() {
$loginBtn.text('登录').removeClass('disable');
}
});
} else {
... ...
... ... @@ -76,6 +76,8 @@ $loginBtn.on('touchstart', function() {
return;
}
$loginBtn.text('正在登录...').addClass('disable');
//验证账号(数字或者邮箱)和密码合理性
if ((/^[0-9]+$/.test(acc) || api.emailRegx.test(acc)) && api.pwdValidate(pwd)) {
$.ajax({
... ... @@ -86,28 +88,40 @@ $loginBtn.on('touchstart', function() {
password: pwd
},
success: function(data) {
var res;
var res,
time;
if (data.code === 200) {
res = data.data;
showErrTip('登录成功');
$.ajax({
url: res.session,
dataType: 'jsonp'
dataType: 'jsonp',
success: function() {
clearTimeout(time);
//Cookie写入成功后,1s后跳转页面
setTimeout(function() {
location.href = res.href;
}, 1000);
}
});
//1s后跳转页面
setTimeout(function() {
//3秒后强制跳转
time = setTimeout(function() {
location.href = res.href;
}, 1000);
}, 3000);
showErrTip('登录成功');
} else {
showErrTip(data.message);
}
},
error: function() {
showErrTip('网络断开连接啦~');
},
complete: function() {
$loginBtn.text('登录').removeClass('disable');
}
});
} else {
... ...
... ... @@ -67,7 +67,9 @@ $consultForm.on('submit', function() {
loading.hideLoadingMask();
} else {
tip.show('提交成功~');
setTimeout(window.history.go(-1), 3000);
setTimeout(function() {
window.history.go(-1);
}, 3000);
}
}).fail(function() {
tip.show('网络出了点问题~');
... ...
... ... @@ -636,14 +636,15 @@ class HomeController extends AbstractAction
* 我的订单页面,获得nav导航条焦点。并且异步请求订单详情列表页(getOrders)
*
*/
public function ordersAction()
{
// 审判跳转登录页
$this->auditJumpLogin();
$backUrl = Helpers::url('/home');
$this->setTitle('我的订单');
$this->setNavHeader('我的订单');
$this->setNavHeader('我的订单', $backUrl);
$order = array();
//获得type值,type:1=>全部,2=>待付款,3=>待发货,4=>待收货,5=>待评论
... ... @@ -772,14 +773,13 @@ class HomeController extends AbstractAction
/*
* 我的订单-付款跳转页
*/
public function payAction()
{
// 审判跳转登录页
$this->auditJumpLogin();
$this->setTitle('支付');
$this->setNavHeader('支付');
$this->setTitle('支付中心');
$this->setNavHeader('支付中心');
$orderCode = $this->get('order_code');
if (empty($orderCode)) {
... ... @@ -793,16 +793,16 @@ class HomeController extends AbstractAction
'payLink' => Helpers::url('/shopping/pay/index', array('order_code' => $orderCode, 'payment_type' => 18)),
'appId' => 'alipay',
'app' => '支付宝支付',
'hint' => '需下载支付宝客户端',
'subHint' => '推荐使用',
'hint' => '支付宝钱包支付',
'subHint' => '推荐支付宝用户使用',
),
1 => array(
'appIcon' => '',
'payLink' => '',
'appId' => 'weixin',
'app' => '微信支付',
'hint' => '需下载微信客户端',
'subHint' => '推荐使用',
'hint' => '需安装微信客户端',
'subHint' => '',
),
),
'orderCode' => $orderCode,
... ...
... ... @@ -61,17 +61,23 @@ class OrderModel
{
$result = array();
//调用接口获得数据
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
$data = OrderData::getOrderData($type, $page, $limit, $gender, $yh_channel, $uid);
// 判断是否还有数据, 没有数据则返回空
if (isset($data['data']['page_total']) && $page > $data['data']['page_total']) {
return $result;
}
//检查数据返回是否正常,正常则处理数据
if (!empty($data['data']['order_list'])) {
// 订单的状态列表
$orderStatus = Helpers::getOrderStatus();
foreach ($data['data']['order_list'] as $key => $vo) {
if ($vo['payment_status'] == 'Y' && $vo['status'] == 0) {
$vo['status'] = 1;
}
//订单号,支付状态,订单商品数量,订单总价格
$result[$key]['orderNum'] = $vo['order_code'];
$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $vo['status_str'];
$result[$key]['orderStatus'] = ($vo['is_cancel'] === 'Y') ? '已取消' : $orderStatus[ $vo['payment_type'] ][ $vo['status'] ];
$result[$key]['count'] = count($vo['order_goods']);
$result[$key]['sumCost'] = $vo['amount'];
//类内调用格式化订单商品数据方法
... ...
... ... @@ -27,7 +27,7 @@ class HomeModel
/* 女生楼层资源的位置码 */
const CODE_FLOOR_GIRLS = '189b6686065dbd6755dd6906cf03c002';
/* 潮童楼层资源的位置码 */
const CODE_FLOOR_KIDS = '66cad79d93e055ad6fc5c8744086066d'; // '66cad79d93e055ad6fc5c8744086066d';
const CODE_FLOOR_KIDS = 'b8c1bff53d4ea60f978926d538620636'; // '66cad79d93e055ad6fc5c8744086066d';
/* 创意生活楼层资源的位置码 */
const CODE_FLOOR_LIFESTYLE = '61cd852c6afcf60660196154f66a3a62';
... ...
... ... @@ -248,7 +248,7 @@ class UserModel
$product = array();
foreach ($val['new_product'] as $one) {
$product = array();
$product['link'] = isset($val['goodsList'][0]) ? Helpers::url('/product/pro_' . $val['product_id'] . '_' . $val['goodsList'][0]['id'] . '/' . $val['cnAlphabet'] . '.html') : '';
$product['link'] = isset($one['goods'][0]) ? Helpers::url('/product/pro_' . $one['product_id'] . '_' . $one['goods'][0]['id'] . '/' . $one['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'] : 0;
$product['discount'] = !empty($one['sales_price']) ? '¥' . $one['sales_price'] : 0;
... ...
... ... @@ -31,7 +31,7 @@ class DetailModel
if (is_numeric($productId) && is_numeric($goodsId)) {
// 调用服务
$baseInfo = DetailData::baseInfo($productId, $uid);
$baseInfo = DetailData::baseInfo($productId, $uid);
// 判断商品是否在架
if (empty($baseInfo['status'])) {
... ... @@ -42,7 +42,7 @@ class DetailModel
if (isset($baseInfo['productName'])) {
$result['goodsName'] = $baseInfo['productName'];
}
// 商品促销短语
if (!empty($baseInfo['salesPhrase'])) {
$result['goodsSubtitle'] = $baseInfo['salesPhrase'];
... ... @@ -141,7 +141,7 @@ class DetailModel
$build['time'] = $value['createTime'];
$result['feedbacks']['comments'][] = $build;
}
$result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
//$result['feedbacks']['link'] = Helpers::url('/product/detail/comments', array('product_id' => $productId, 'total' => $result['feedbacks']['commentsNum']));
}
// 品牌信息
... ... @@ -211,12 +211,14 @@ class DetailModel
// 悬浮的购物车信息
$result['cartInfo'] = array(
'cartUrl' => Helpers::url('/cart/index/index', null), // 购物车链接
'addToCartUrl' => Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'), // 加入购物车链接
'numInCart' => 0,
'goodsInstore' => $baseInfo['storage'], // 库存量
'soldOut' => $baseInfo['storage'] == 0, // 已售磬
'notForSale' => $baseInfo['attribute'] == 2, // 非卖品
);
if (!$result['cartInfo']['soldOut'] && !$result['cartInfo']['notForSale']) {
$result['cartInfo']['addToCartUrl'] = Helpers::url('/product/buy_' . $productId . '_' . $goodsId . '.html'); // 加入购物车链接
}
// 是否收藏
$result['isCollect'] = false;
... ... @@ -289,24 +291,23 @@ class DetailModel
$boyReference = !empty($sizeInfo['productExtra']['boyReference']);
$girlReference = !empty($sizeInfo['productExtra']['girlReference']);
$gender = isset($sizeInfo['gender']) ? $sizeInfo['gender'] : 3;
$referenceName = '参考尺码';
if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference) ) {
$referenceName = '参考尺码';
if (($gender == 1 && $boyReference) || ($gender == 2 && $girlReference)) {
$referenceName = '参考尺码';
}
elseif ($gender == 3 && $boyReference) {
} elseif ($gender == 3 && $boyReference) {
$referenceName = '参考尺码(男)';
}
elseif ($gender == 3 && $girlReference) {
} elseif ($gender == 3 && $girlReference) {
$referenceName = '参考尺码(女)';
}
$sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
$referenceList = array();
// 判断是否显示参考尺码
$showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']);
$showReference = !empty($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']) && ($sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == $gender || $sizeInfo['sizeInfoBo']['sizeBoList'][0]['referenceSize']['gender'] == 3);
if ($showReference) {
$sizeNameList[1] = array('param' => $referenceName);
$referenceList[0] = array('param' => $referenceName);
}
$referenceList = array();
$sizeNameList = array(0 => array('param' => '吊牌尺码')); // 尺码名称
$sizeBoGroup = array(); // 尺码按ID分组
foreach ($sizeInfo['sizeInfoBo']['sizeAttributeBos'] as $attr) {
$sizeBoGroup[$attr['id']][0] = array('param' => $attr['attributeName']);
... ... @@ -416,6 +417,7 @@ class DetailModel
'\r\n\t' => '',
'</p>' => '',
'<img src=' => "<img class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=",
'<img border="0" src=' => "<img border=\"0\" class=\"lazy\" src=\"data:image/gif;base64,R0lGODlhAQABAJEAAAAAAP///93d3f///yH5BAEAAAMALAAAAAABAAEAAAICVAEAOw==\" data-original=",
)),
);
}
... ...