Authored by Rock Zhang

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

... ... @@ -1242,11 +1242,45 @@
'cartUrl':'购物车url',
'addToCartUrl':'添加购物车url',
'soldOut':'已售罄',
'notForSale':'非卖品'
'notForSale':'非卖品',
thumb: [
{
id:1,
url : ''
},
...
],
name: '',
price: '',
salePrice: '',
colors: [
{
id: 1,
chosed: true,
name: '黄色',
colorNum:10,
shortUrl:'',
},
...
],
sizes: [
{
id: 2,
chosed: true,
name: 'X',
sizeNum: 2
},
...
],
totalNum: 20
},
'introUrl' : '',
'id' : '',
'preferenceUrl' :''
'preferenceUrl' :'',
}
### 评价列表页面
{
... ...
... ... @@ -42,12 +42,13 @@ class BindData
* @param string $mobile 手机号
*
*/
public static function sendBindMsg($mobile)
public static function sendBindMsg($area,$mobile)
{
$param = Yohobuy::param();
$param['method'] = 'app.passport.smsbind';
$param['mobile'] = $mobile;
$param['area'] = $area;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ... @@ -57,13 +58,14 @@ class BindData
* 验证验证码是否正确
*
*/
public static function checkBindCode($mobile, $code)
public static function checkBindCode($area,$mobile, $code)
{
$param = Yohobuy::param();
$param['method'] = 'app.register.validRegCode';
$param['mobile'] = $mobile;
$param['code'] = $code;
$param['area'] = $area;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
... ...
... ... @@ -7,7 +7,8 @@
var $ = require('jquery'),
Hammer = require('yoho.hammer'),
tip = require('../../plugin/tip');
tip = require('../../plugin/tip'),
chosePanel = require('../../shopping-cart/chose-panel');
var likeEle = document.getElementById('likeBtn'),
likeHammer = likeEle && new Hammer(likeEle);
... ... @@ -70,14 +71,17 @@ if (likeHammer) {
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
// }, false);
// }
});
}
... ...
... ... @@ -5,36 +5,45 @@
* @date: 2015/10/21
*/
var $ = require('jquery'),
Handlebars = require('yoho.handlebars');
var $ = require('jquery');
var $page = $('.yoho-page');
// Handlebars = require('yoho.handlebars');
// var $page = $('.yoho-page');
var $num;
var tpl;
// var tpl;
//读取partials
$.ajax({
type: 'GET',
url: '/shoppingCart/tpl',
success: function(data) {
tpl = Handlebars.compile(data);
}
});
// $.ajax({
// type: 'GET',
// url: '/shoppingCart/tpl',
// success: function(data) {
// tpl = Handlebars.compile(data);
// }
// });
//显示
function show(data) {
var html = tpl(data);
$page.append(html);
//显示
// function show(data) {
// // var html = tpl(data);
// $('.chose-panel').show();
// // $page.append(html);
// $('.chose-panel')
// $num = $('#good-num');
// }
function show() {
$('.chose-panel').show();
$('body').css('overflow', 'hidden');
$num = $('#good-num');
}
//移除当前Panel
function remove() {
$('.chose-panel').remove();
$('.chose-panel').hide();
$('body').css('overflow', 'auto');
}
$('.yoho-page').on('touchstart', '.chose-panel', function(e) {
... ... @@ -75,4 +84,5 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
$num.val(num + 1);
});
exports.show = show;
\ No newline at end of file
... ...
.chose-panel {
position: absolute;
position: fixed;
display: none;
height: 100%;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0,0,0,.3);
z-index:3;
.main {
position: absolute;
height: 610rem / $pxConvertRem;
height: pxToRem(610px);
bottom: 0;
left: 0;
right: 0;
... ... @@ -18,7 +21,7 @@
.infos {
height: 460rem / $pxConvertRem;
padding: 0 22rem / $pxConvertRem;
padding-top: 30rem / $pxConvertRem;
// padding-top: 30rem / $pxConvertRem;
}
.chose-items {
... ... @@ -27,7 +30,10 @@
}
.basic-info {
margin-bottom: 30rem / $pxConvertRem;
overflow: hidden;
position: relative;
margin-bottom: pxToRem(30px);
margin-top: pxToRem(30px);
}
.thumb {
... ... @@ -37,12 +43,18 @@
}
.text-info {
margin-left: 102rem / $pxConvertRem;
position: absolute;
height: auto;
left: pxToRem(95px);
top:50%;
transform: translateY(-50%);
.name {
font-size: 28rem / $pxConvertRem;
}
.price{
font-size: pxToRem(24px);
}
.sale-price {
color: #e10;
... ...
... ... @@ -114,6 +114,7 @@
<div id="productDesc"> </div>
{{> product/recommend-for-you}}
{{> shopping-cart/chose-panel}}
{{#cartInfo}}
<div class="cart-bar">
... ... @@ -121,7 +122,8 @@
<a href="{{cartUrl}}" class="num-incart iconfont">&#xe62c;</a>
{{#if addToCartUrl}}
<a id="addtoCart" href="{{addToCartUrl}}" class="addto-cart">加入购物车</a>
<!-- <a id="addtoCart" href="{{addToCartUrl}}" class="addto-cart">加入购物车</a> -->
<a id="addtoCart" href="javascript:;" class="addto-cart">加入购物车</a>
{{/if}}
{{#if soldOut}}
... ...
{{#cartInfo}}
<div class="chose-panel">
<div class="main">
<div class="infos">
... ... @@ -26,7 +27,7 @@
</div>
<div class="size-list">
<span>尺码</span>
<ul class="clearfix" data-type="size">
<ul class="clearfix {{#if @first}}{{^}}hide{{/if}}" data-type="size" >
{{# sizes}}
<li class="block {{#if chosed}}chosed{{/if}}" data-id={{id}}>
{{name}}
... ... @@ -49,7 +50,8 @@
</div>
</div>
<div class="btn-wrap">
<button id="chose-btn-sure" class="btn btn-sure">确定</button>
<button id="chose-btn-sure" class="btn btn-sure">加入购物车</button>
</div>
</div>
</div>
{{/cartInfo}}
\ No newline at end of file
... ...
... ... @@ -48,7 +48,7 @@ class HomeController extends AbstractAction
'showDownloadApp' => true,
'pageFooter' => true,
'cartUrl' => Helpers::url('/cart/index/index', null),
'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home')) ),
'signinUrl' => Helpers::url('/signin.html', array('refer' => Helpers::url('/home'))),
);
$uid = $this->getUid(false);
if ($uid) {
... ... @@ -832,43 +832,21 @@ class HomeController extends AbstractAction
*/
public function orderDetailAction()
{
$data = array(
'name' => '毛毛莉Lydia',
'phoneNum' => '18600001133',
'address' => '南京市建邺区嘉陵江东街18号国家广告产业园5栋17楼',
'orderStatus' => '订单取消',
'orderNum' => '418358063',
'orderTime' => '2014-03-10 17:25:10',
'orderCancel' => true,
'goods' => array(
array(
'id' => 1,
'thumb' => 'http://img11.static.yhbimg.com/goodsimg/2015/11/04/05/01ce2aff32fc3c90584f516167cd526d91.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'Adidas Originals ZX FLUXM22508',
'color' => '黄',
'size' => '43',
'price' => '699.00',
'count' => '2'
),
array(
'id' => 1,
'thumb' => 'http://img10.static.yhbimg.com/goodsimg/2015/11/04/05/0188f1aca49ac478a565ec029b5d2d4a6c.jpg?imageMogr2/thumbnail/235x314/extent/235x314/background/d2hpdGU=/position/center/quality/90',
'name' => 'B.Duck浴室玩伴mini浮水鸭',
'gift' => true,
'color' => '黄',
'size' => '43',
'price' => '0.00',
'count' => '1'
)
),
'sumPrice' => 799,
'salePrice' => 80,
'freight' => 5,
'coupon' => 0,
'yohoCoin' => 5,
'price' => 719
);
$this->_view->display('order-detail', array('orderDetail' => $data, 'orderDetailPage' => true));
// 审判跳转登录页
$this->auditJumpLogin();
$orderCode = $this->get('order_code');
if (empty($orderCode)) {
$this->error();
}
$this->setTitle('订单详情');
$this->setNavHeader('订单详情');
$this->_view->display('order-detail', array(
'orderDetailPage' => true,
'orderDetail' => OrderModel::orderDetail($orderCode, $this->_uid, $this->_session),
));
}
/**
... ... @@ -876,11 +854,10 @@ class HomeController extends AbstractAction
*/
public function helpAction()
{
$service = Home\HelpModel::serviceInfo();
$this->setTitle('帮助中心');
$this->setNavHeader('帮助中心');
$data = array(
'iHelp' =>$service,
'iHelp' => Home\HelpModel::serviceInfo(),
);
$this->_view->display('i-help', $data);
}
... ... @@ -899,4 +876,5 @@ class HomeController extends AbstractAction
);
$this->_view->display('helpDetail', $data);
}
}
... ...
... ... @@ -80,7 +80,7 @@ class OrderModel
$result[$key]['sumCost'] = $vo['amount'];
//类内调用格式化订单商品数据方法
$result[$key]['goods'] = Helpers::formatOrderGoods($vo['order_goods'], $count);
$result[$key]['detailUrl'] = Helpers::url('/home/orders/detail', array('order_code' => $vo['order_code'], 't' => time()));
$result[$key]['detailUrl'] = Helpers::url('/home/orderDetail', array('order_code' => $vo['order_code']));
$result[$key]['count'] = $count;
}
}
... ...
... ... @@ -237,7 +237,6 @@ 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']['name'] = isset($result['goodsName']) ? $result['goodsName'] : '';
... ...
... ... @@ -2,6 +2,7 @@
use Action\AbstractAction;
use LibModels\Wap\Passport\BindData;
use LibModels\Wap\Passport\RegData;
use Plugin\Helpers;
/**
... ... @@ -15,14 +16,28 @@ class BindController extends AbstractAction
*/
public function indexAction()
{
$refer = $this->get('refer');
if (!empty($refer))
{
$this->setCookie('refer', $refer);
}
$this->setTitle('绑定手机号');
$openId = $this->get('openId');
$sourceType = $this->get('sourceType');
$nickName = $this->get('nickName');
$nickname = $this->get('nickname');
$data = array(
'bindIndex'=>true,//js标识
'backUrl' => '/', // 返回的URL链接
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
'sourceType' => $sourceType, // 第三方登录来源
'platform'=>$sourceType,
'openId' => $openId, // openId
'nickname' => $nickName, //昵称
'areaCode'=>'+86',//默认区号
'countrys'=>RegData::getAreasData(),//国别码
'nickname' => $nickname, //昵称
);
// 渲染模板
... ... @@ -38,16 +53,22 @@ class BindController extends AbstractAction
$this->setTitle('验证手机');
$openId = $this->get('openId');
$sourceType = $this->get('sourceType');
$nickName = $this->get('nickName');
$area = $this->get('areaCode', '86');
$nickname = $this->get('nickname');
$areaCode = $this->get('areaCode', '86');
$isReg = $this->get('isReg');
$mobile=$this->get('mobile');
$data = array(
'bindIndex'=>true,//js标识
'backUrl' => '/', // 返回的URL链接
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
'sourceType' => $sourceType, // 第三方登录来源
'openId' => $openId, // openId
'nickname' => $nickName, //昵称
'nickname' => $nickname, //昵称
'isReg' => $isReg, //是否是已注册过的手机号
'area' => $area //国别码
'areaCode' => $areaCode, //国别码
'phoneNum'=>$mobile,//手机号码
);
// 渲染模板
... ... @@ -63,13 +84,17 @@ class BindController extends AbstractAction
$this->setTitle('重新设置登录密码');
$openId = $this->get('openId');
$sourceType = $this->get('sourceType');
$nickName = $this->get('nickName');
$area = $this->get('areaCode', '86');
$nickname = $this->get('nickname');
$areaCode = $this->get('areaCode', '86');
$data = array(
'bindIndex'=>true,//js标识
'backUrl' => '/', // 返回的URL链接
'showHeaderImg' => true, // 控制显示头部图片
'isPassportPage' => true, // 模板中模块标识
'sourceType' => $sourceType, // 第三方登录来源
'openId' => $openId, // openId
'nickname' => $nickName, //昵称
'area' => $area //国别码
'nickname' => $nickname, //昵称
'areaCode' => $areaCode //国别码
);
// 渲染模板
... ... @@ -91,12 +116,12 @@ class BindController extends AbstractAction
$mobile = $this->post('mobile');
$openId = $this->post('openId');
$area = $this->post('areaCode', '86');
$areaCode = $this->post('areaCode', '86');
$sourceType = $this->post('sourceType');
$nickName = $this->post('nickName');
$nickname = $this->post('nickname');
if (!is_numeric($mobile) || !$openId || !$area || !$sourceType)
if (!is_numeric($mobile) || !$openId || !$areaCode || !$sourceType)
{
break;
}
... ... @@ -108,7 +133,7 @@ class BindController extends AbstractAction
}
if ($res['code'] == 200)
{
$next = Helpers::url('/passport/bind/code', array('isReg' => $res['data']['is_register'], 'openId' => $openId, 'sourceType' => $sourceType, 'nickName' => $nickName, 'areaCode' => $area, 'mobile' => $mobile));
$next = Helpers::url('/passport/bind/code', array('isReg' => $res['data']['is_register'], 'openId' => $openId, 'sourceType' => $sourceType, 'nickname' => $nickname, 'areaCode' => $areaCode, 'mobile' => $mobile));
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('is_register' => $res['data']['is_register'], 'next' => $next));
}
else
... ... @@ -135,13 +160,14 @@ class BindController extends AbstractAction
}
$mobile = $this->post('mobile');
$areaCode = $this->post('areaCode');
if (!is_numeric($mobile))
{
break;
}
$data = BindData::sendBindMsg($mobile);
$data = BindData::sendBindMsg($areaCode,$mobile);
if (!isset($data['code']))
{
break;
... ... @@ -167,13 +193,14 @@ class BindController extends AbstractAction
$mobile = $this->post('mobile');
$msgCode = $this->post('msgCode');
$areaCode = $this->post('areaCode');
if (!is_numeric($mobile) || !$msgCode)
{
break;
}
$data = BindData::checkBindCode($mobile, $msgCode);
$data = BindData::checkBindCode($areaCode,$mobile, $msgCode);
if (!isset($data['code']))
{
break;
... ... @@ -199,17 +226,17 @@ class BindController extends AbstractAction
$mobile = $this->post('mobile');
$openId = $this->post('openId');
$area = $this->post('areaCode', '86');
$areaCode = $this->post('areaCode', '86');
$sourceType = $this->post('sourceType');
$nickName = $this->post('nickName');
$nickname = $this->post('nickname');
$password = $this->post('password');
if (!is_numeric($mobile) || !$openId || !$sourceType || !$area)
if (!is_numeric($mobile) || !$openId || !$sourceType || !$areaCode)
{
break;
}
$res = BindData::bindMobile($openId, $nickName, $sourceType, $mobile, $area, $password);
$res = BindData::bindMobile($openId, $nickname, $sourceType, $mobile, $areaCode, $password);
if (!isset($res['code']))
{
break;
... ...