Authored by Rock Zhang

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

... ... @@ -23,16 +23,17 @@ class Yohobuy
// const SERVICE_URL = 'http://service.api.yohobuy.com/';
// const YOHOBUY_URL = 'http://www.yohobuy.com/';
// const API_URL = 'http://apih5.yoho.cn/';
// 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 API_URL = 'http://testapi.yoho.cn:28078/';
const SERVICE_URL = 'http://testservice.yoho.cn:28077/';
const YOHOBUY_URL = 'http://www.yohobuy.com/';
/**
* 私钥列表
*
... ...
... ... @@ -81,17 +81,21 @@ class BindData
* @param string $area 国别码
* @param string $password 密码
*/
public static function bindMobile($openId, $nickname, $sourceType, $mobile, $area, $password = '')
public static function bindMobile($openId, $sourceType, $mobile, $area, $password = '', $nickname = '')
{
$param = Yohobuy::param();
$param['method'] = 'app.passport.bind';
$param['mobile'] = $mobile;
$param['open_id'] = $openId;
$param['nickname'] = $nickname;
$param['source_type'] = $sourceType;
$param['area'] = $area;
if (!empty($password)) {
if (!empty($nickname))
{
$param['nickname'] = $nickname;
}
if (!empty($password))
{
$param['password'] = $password;
}
$param['client_secret'] = Sign::getSign($param);
... ... @@ -99,7 +103,6 @@ class BindData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 换绑手机检验
* @param string $mobile 手机号
... ... @@ -116,7 +119,6 @@ class BindData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 换绑手机
* @param string $uid 用户Id
... ... @@ -138,5 +140,4 @@ class BindData
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
No preview for this file type
... ... @@ -2,7 +2,7 @@
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>
Created by FontForge 20120731 at Thu Dec 17 13:53:30 2015
Created by FontForge 20120731 at Mon Dec 21 17:16:11 2015
By Ads
</metadata>
<defs>
... ... @@ -16,10 +16,10 @@ Created by FontForge 20120731 at Thu Dec 17 13:53:30 2015
ascent="896"
descent="-128"
x-height="792"
bbox="-0.75 -224 3943 833"
bbox="-0.75 -224 3943 893"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E640"
unicode-range="U+0078-E641"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -263,5 +263,10 @@ q0 -2 2 -5l15 -32q9 -30 39 -38v-3h392l18 1v2q14 4 24.5 14t14.5 24l98 217q40 77 1
q0 7 3 12.5t9 9t12 3.5h119l3 -1h2q1 0 2 -1l4 -2q2 -1 4 -3q1 -1 2 -1.5t1 -1.5l4 -6l38 -83h619q8 0 10 -3q3 -6 1 -19t-7.5 -29.5t-13.5 -31.5zM470 107q-33 0 -56.5 -23t-23.5 -56q0 -22 10.5 -40.5t29 -29t40.5 -10.5q33 0 56.5 23.5t23.5 56.5t-23.5 56t-56.5 23z
M470 -23q-21 0 -36 15t-15 36t15 36t36 15q14 0 25.5 -7t18.5 -19t7 -25q0 -22 -15 -36.5t-36 -14.5zM747 107q-33 0 -56.5 -23t-23.5 -56q0 -22 10.5 -40.5t29 -29t40.5 -10.5q33 0 56.5 23.5t23.5 56.5t-23.5 56t-56.5 23zM747 -23q-14 0 -26 6.5t-18.5 18.5t-6.5 25.5
t6.5 25.5t18.5 19t26 7q21 0 36 -15t15 -36t-15 -36t-36 -15z" />
<glyph glyph-name="uniE641" unicode="&#xe641;" horiz-adv-x="1045"
d="M522 893q-103 0 -197 -40t-162 -108t-108.5 -162t-40.5 -197.5t40.5 -197.5t108.5 -162t162 -108t197.5 -40t197.5 40t162 108t108 162t40 197.5t-40 197.5t-108 162t-162 108t-198 40zM522 -49q-88 0 -168.5 34.5t-138.5 93t-92.5 138.5t-34.5 168.5t34.5 169
t92.5 138.5t138.5 92.5t169 34.5t168.5 -34.5t138.5 -92.5t93 -138.5t34.5 -169t-34.5 -168.5t-93 -138.5t-138.5 -93t-169 -34.5zM775 268l-105 61q-11 4 -21 6.5t-18 2.5t-15 -0.5t-13 -4t-10 -5.5t-9 -6l-6 -7q-2 -2 -6 -7l-3 -4l-6 -10q-34 -4 -59 21l-51 50
q-24 25 -20 60l9 4q3 5 16 16t17 18t4 25t-11 43h-1l-60 105q-8 13 -20.5 20t-26 7t-27.5 -7l-62 -36q-3 -1 -6 -4l-6 -6l-6 -6q-3 -3 -5.5 -6t-4.5 -5t-3 -4l-1 -1q-14 -87 24.5 -183.5t121.5 -174.5q72 -68 157 -101.5t165 -29.5q4 1 10.5 2.5t20.5 10t21 20.5l36 62
q11 20 5.5 41.5t-25.5 32.5z" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -16,7 +16,7 @@ var $cartContent = $('.cart-content');
var navHammer,
cartType = $('#cartType').val();
var hasChecked = $('.cart-goods .icon-cb-checked').length > 0 ? true : false; //是否有选中商品
var hasChecked = $('.cart-content:not(.hide) .icon-cb-checked').length > 0 ? true : false; //是否有选中商品
require('./good');
... ...
... ... @@ -206,6 +206,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
// 当前颜色块 切换勾选样式
$this.toggleClass('chosed');
curColorIndex = index;
$('#good-num').val(1);
// 设置按钮的样式和文字
updateConformButtonClassAndText();
... ... @@ -257,6 +258,7 @@ $yohoPage.on('touchstart', '.color-list .block', function() {
$this.toggleClass('chosed');
curSizeIndex = index;
$curSizeBlock = $this;
$('#good-num').val(1);
// 设置按钮的样式和文字
updateConformButtonClassAndText();
... ... @@ -275,10 +277,11 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
}
if (num === 1 || 0 === leftNum - 0) {
tip.show('您选择的数量不能为零~');
return;
}
if (num < 1) {
$num.val(1);
if (num < 0) {
tip.show('您选择的数量不能为零~');
return;
}
... ... @@ -299,7 +302,7 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
//TODO:库存数验证
if (num > leftNum - 1) {
$num.val(leftNum);
tip.show('您选择的数量超过了最大库存量~');
return;
}
$num.val(num + 1);
... ... @@ -316,10 +319,6 @@ $yohoPage.on('touchstart', '.btn-minus', function() {
if (!checkColorSizeNum()) {
return;
}
if (isNaN(num)) {
tip.show('您选择的数量不是一个数字~');
return;
}
//TODO status change
if ($('#chose-btn-sure').html() === '已售罄') {
... ...
... ... @@ -41,25 +41,14 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
id = $good.data('id');
var goodsList = [],
goodInfo = {},
isSelected = true;
if ($this.hasClass('icon-cb-checked')) {
isSelected = true;
} else {
isSelected = false;
}
goodInfo = {};
goodInfo.goods_type = cartType;
goodInfo.selected = isSelected ? 'N' : 'Y';
goodInfo.selected = $this.hasClass('icon-cb-checked') ? 'N' : 'Y';
goodInfo.product_sku = id;
goodInfo.buy_number = $good.find('.count').eq(0).text().trim().replace('×', '');
goodsList.push(new GoodInfo(goodInfo));
$.ajax({
type: 'post',
url: 'select',
... ... @@ -92,8 +81,8 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
rightBtnText: '确定'
}
}, function() {
var id = $this.closest('.shopping-cart-good').data('id');
var count = $this.data('count');
var id = $this.closest('.shopping-cart-good').data('id'),
count = $this.data('count');
$.ajax({
method: 'post',
... ... @@ -119,7 +108,6 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
tip.show('网络异常');
});
});
});
function requestUpdateAllGoodsCheckStatus(theGoods, successHandeler) {
... ... @@ -140,7 +128,7 @@ function requestUpdateAllGoodsCheckStatus(theGoods, successHandeler) {
tip.show(res.message);
}
},
error: function(err) {
error: function() {
tip.show('网络异常');
},
complete: function() {
... ... @@ -196,26 +184,9 @@ function bottomCheckBoxHandeler(isSelected, type, handlerAfterTouch) {
requestUpdateAllGoodsCheckStatus(goodsList, handlerAfterTouch);
}
//是否要全选
function willBeSelected($this) {
var isSelected = true;
if ($this.hasClass('icon-cb-checked')) {
isSelected = true;
} else {
isSelected = false;
}
return isSelected;
}
//全选按钮点击事件
$selectAllBtn.on('touchend', function() {
var $this = $(this);
bottomCheckBoxHandeler(willBeSelected($this), cartType, didUpdateAllGoodsCheckStatus);
bottomCheckBoxHandeler($(this).hasClass('icon-cb-checked'), cartType, didUpdateAllGoodsCheckStatus);
});
$('.down').on('touchend', function() {
... ...
... ... @@ -20,14 +20,14 @@ var api = require('../api'),
var trim = $.trim;
var showErrTip = tip.show;
var requesting = false;
var requested = false;
function nextStep(url, mobileNo, areaCode) {
if (requesting) {
if (requested) {
return false;
}
requesting = true;
requested = true;
$.ajax({
type: 'POST',
... ... @@ -39,13 +39,10 @@ function nextStep(url, mobileNo, areaCode) {
success: function(res) {
console.log(res.data);
location.href = url;
requesting = false;
},
error: function() {
tip.show('出错了,请重试!');
requesting = false;
requested = false;
}
});
}
... ...
... ... @@ -16,6 +16,8 @@ var tip = require('../../plugin/tip');
var trim = $.trim;
var showErrTip = tip.show;
var requested = false;
api.selectCssHack($('#country-select'));
api.bindClearEvt();
... ... @@ -40,7 +42,15 @@ $btnNext.on('touchstart', function() {
return;
}
if (requested) {
return false;
}
if (api.phoneRegx[areaCode].test(pn)) {
requested = true;
$.ajax({
url: '/passport/reg/verifymobile',
type: 'POST',
... ... @@ -53,10 +63,15 @@ $btnNext.on('touchstart', function() {
location.href = data.data;
} else {
showErrTip(data.message);
requested = false;
}
},
error: function(err) {
showErrTip('出错了,请重试');
requested = false;
}
});
} else {
showErrTip('手机号格式不正确,请重新输入');
}
});
\ No newline at end of file
});
... ...
... ... @@ -32,6 +32,9 @@ function showFooter() {
}, 200);
}
if ($('#goodsDiscount h1').length < 1) {
$('.dropdown').remove();
}
showFooter();
lazyLoad($('img.lazy'));
... ...
... ... @@ -9,11 +9,14 @@
margin-top: -14rem / $pxConvertRem;
margin-left: 20rem / $pxConvertRem;
font-size: 28rem / $pxConvertRem;
color: #f0f0f0;
&.icon-cb-checked {
color: #000;
}
&.disabled {
color: #f0f0f0;
}
}
.few-tag{
... ... @@ -54,6 +57,10 @@
padding-right: 20rem / $pxConvertRem;
}
.fixed-height {
height: 2.7rem;
}
.thumb {
float: left;
width: 180rem / $pxConvertRem;
... ... @@ -65,54 +72,49 @@
.deps {
position: relative;
width: 380rem / $pxConvertRem;
height: 5.3rem;
margin-left: 4.7rem;
border-bottom: 1px solid #e0e0e0;
padding-top: 0.5rem;
padding: 0.5rem 0;
}
.name {
font-size: 18px;
color: #5a5a5a;
width: 80%;
display: inline-block;
width: 80%;
color: #5a5a5a;
font-size: 0.6rem;
}
.color-size-row {
margin: 0.2rem 0;
> span {
margin-right: 15rem / $pxConvertRem;
}
.color-size-row > span {
margin-right: 15rem / $pxConvertRem;
}
.color, .size {
font-size: 16px;
font-size: 0.6rem;
color: #b6b6b6;
}
.appear-date {
float: left;
color: $cartRed;
display: block;
margin-top: 4rem / $pxConvertRem;
font-size: 0.5rem;
}
.price {
font-size: 16px;
font-size: 0.6rem;
color: $cartRed;
}
.count {
font-size: 32rem / $pxConvertRem;
color: #999;
//margin-left: 22rem / $pxConvertRem;
display: inline-block;
width: 19%;
position: absolute;
text-align: center;
}
.sold-out, .low-stocks {
.low-stocks {
display: inline-block;
width: 100rem / $pxConvertRem;
height: 30rem / $pxConvertRem;
... ... @@ -122,20 +124,31 @@
color: #fff;
text-align: center;
float: right;
margin-top: 20rem / $pxConvertRem;
margin-right: 16rem / $pxConvertRem;
border-radius: 20rem / $pxConvertRem;
padding: 4rem / $pxConvertRem;
}
.sold-out {
background: #999;
border-radius: 20rem / $pxConvertRem;
}
.low-stocks {
background: #7f7f7f;
}
.vip {
display: inline-block;
color: #fff;
background: #d1021c;
border: 1px solid #9d0000;
@include border-radius(0.5rem);
padding: 4rem / $pxConvertRem 0.5rem;
margin-left: 0.2rem;
}
.la-tag {
margin-top: 0.3rem;
min-height: 1rem;
}
.icon-del,
.icon-edit {
position: absolute;
... ...
... ... @@ -7,6 +7,15 @@
.shopping-cart-page {
padding-bottom: 120rem / $pxConvertRem;
overflow-x: hidden;
background: #f0f0f0;
.yoho-tip {
z-index: 4;
}
.cart-content > * {
background: #fff;
}
.cart-nav {
color: #c6c6c6;
... ... @@ -111,23 +120,29 @@
.cart-goods {
border-bottom: 1px solid #e0e0e0;
margin-bottom: 0.75rem;
.shopping-cart-good:last-child .info {
border-bottom: none;
}
}
.invalid-goods {
border-top: 1px solid #e0e0e0;
border-bottom: 1px solid #e0e0e0;
margin: 0.75rem 0;
}
.freebie-and-advance-buy {
padding: 20rem / $pxConvertRem;
font-size: 24rem / $pxConvertRem;
//border-bottom: 1px solid #e0e0e0;
border-top: 1px solid #e0e0e0;
> li {
box-sizing: border-box;
height: 90rem / $pxConvertRem;
line-height: 90rem / $pxConvertRem;
margin-bottom: 10rem / $pxConvertRem;
background: #f8f8f8;
padding: 0 20rem / $pxConvertRem;
&:last-child {
... ...
... ... @@ -2,13 +2,16 @@
{{# goods}}
{{> cart/good}}
{{/ goods}}
{{# notValidGoods}}
{{> cart/good}}
{{/ notValidGoods}}
</div>
{{#if notValidGoods}}
<div class="invalid-goods">
{{# notValidGoods}}
{{> cart/good}}
{{/ notValidGoods}}
</div>
{{/if}}
{{#if freebieOrAdvanceBuy}}
<ul class="freebie-and-advance-buy">
{{# freebie}}
... ...
... ... @@ -52,7 +52,7 @@
<a class="btn btn-minus" href="javascript:void(0);">
<span class="iconfont {{#if promotionId}}disabled{{/if}}">&#xe625;</span>
</a>
<input id="good-num" class="good-num {{#if promotionId}}disabled{{/if}}" type="text" value="1" {{#if promotionId}}disabled="true"{{/if}}>
<input id="good-num" class="good-num disabled" type="text" value="1" disabled="true">
<a class="btn btn-plus" href="javascript:void(0);">
<span class="iconfont {{#if promotionId}}disabled{{/if}}">&#xe624;</span>
</a>
... ...
... ... @@ -4,7 +4,7 @@
{{/if}}
{{#if showCheckbox}}
<span class="checkbox{{#if checked}} icon-cb-checked{{^}} icon-checkbox{{/if}} iconfont"></span>
<span class="checkbox{{#if checked}} icon-cb-checked{{^}} icon-checkbox {{#if lowStocks}}disabled{{/if}}{{/if}} iconfont"></span>
{{/if}}
<div class="info">
... ... @@ -19,51 +19,53 @@
{{/if}}
<div class="deps show">
<a href="{{link}}" class="name row">{{name}}</a>
<span class="count">
×{{count}}
</span>
<p class="row color-size-row">
{{#if color}}
<span class="color">
颜色:{{color}}
</span>
{{/if}}
<div class="fixed-height">
<a href="{{link}}" class="name row">{{name}}</a>
<span class="count">
×{{count}}
</span>
<p class="row color-size-row">
{{#if color}}
<span class="color">
颜色:{{color}}
</span>
{{/if}}
{{#if size}}
<span class="size">
尺码:{{size}}
</span>
{{/if}}
{{#if size}}
<span class="size">
尺码:{{size}}
</span>
{{/if}}
</p>
</p>
</div>
<p class="row">
<span class="price">
¥{{price}}
</span>
{{#if soldOut}}
<span class="sold-out">
已售罄
{{#if isVipPrice}}
<span class="vip">
VIP
</span>
{{/if}}
{{#unless isGift}}
<span class="iconfont icon-del" data-count="{{count}}">&#xe621;</span>
{{/unless}}
</p>
{{#if lowStocks}}
<p class="row">
<p class="la-tag row clearfix">
{{#if lowStocks}}
<span class="low-stocks">
库存不足
</span>
</p>
{{/if}}
{{#if appearDate}}
<p class="row">
{{/if}}
{{#if appearDate}}
<span class="appear-date">
上市期:{{appearDate}}
</span>
</p>
{{/if}}
{{/if}}
</p>
</div>
</div>
</div>
... ...
... ... @@ -7,7 +7,7 @@
<a href="{{.}}" class="iconfont nav-home">&#xe611;</a>
{{/navHome}}
{{#navPhone}}
<a href="{{.}}" class="iconfont nav-home">&#xe63e;</a>
<a href="{{.}}" class="iconfont nav-home">&#xe641;</a>
{{/navPhone}}
{{#navTitle}}
<p class="nav-title">{{.}}</p>
... ...
... ... @@ -785,7 +785,7 @@ class HomeController extends AbstractAction
$this->auditJumpLogin();
$this->setTitle('支付中心');
$this->setNavHeader('支付中心');
$this->setNavHeader('支付中心', Helpers::url('/cart/index/index'));
$orderCode = $this->get('order_code');
if (empty($orderCode)) {
... ...
... ... @@ -225,14 +225,14 @@ class BindController extends AbstractAction
$openId = $this->post('openId');
$areaCode = $this->post('areaCode', '86');
$sourceType = $this->post('sourceType');
$nickname = $this->post('nickname');
$password = $this->post('password');
// $nickname = $this->post('nickname');//nickname不同步信息
$password = !empty($this->post('password'))?$this->post('password'):'';
if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) {
break;
}
$res = BindData::bindMobile($openId, $nickname, $sourceType, $phoneNum, $areaCode, $password);
$res = BindData::bindMobile($openId,$sourceType, $phoneNum, $areaCode, $password);
if (!isset($res['code'])) {
break;
}
... ...
... ... @@ -227,8 +227,7 @@ class LoginController extends AbstractAction
}
//判定是否需要绑定手机号
$isBind = $result['data']['is_bind'];
if ($isBind == 'N') {
if (isset($result['data']['is_bind']) && $result['data']['is_bind'] == 'N') {
$this->go(Helpers::url('/passport/bind/index', array('openId' => $access['openid'], 'sourceType' => 'qq', 'nickname' => $partnerInfo['nickname'])));
}
... ... @@ -264,8 +263,7 @@ class LoginController extends AbstractAction
$result = LoginData::signinByOpenID($partnerInfo['screen_name'], $access['uid'], 'sina');
}
//判定是否需要绑定手机号
$isBind = $result['data']['is_bind'];
if ($isBind == 'N') {
if (isset($result['data']['is_bind']) && $result['data']['is_bind'] == 'N') {
$this->go(Helpers::url('/passport/bind/index', array('openId' => $access['uid'], 'sourceType' => 'sina', 'nickname' => $partnerInfo['screen_name'])));
}
... ...