Authored by 梁志锋

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

... ... @@ -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);
}
}
... ...
... ... @@ -595,9 +595,13 @@ class Helpers
$oneGoods['inValid'] = true;
} elseif ($value['goods_type'] == 'gift' && !isset($value['isAdvanceBuy'])) {
$oneGoods['isGift'] = true;
$oneGoods['salesPrice'] = self::transPrice($value['sales_price']);
$oneGoods['price'] = self::transPrice($value['sale_price']);
} elseif ($value['goods_type'] == 'price_gift') {
$oneGoods['showCheckbox'] = true;
$oneGoods['isAdvanceBuy'] = true;
$oneGoods['salesPrice'] = self::transPrice($value['sales_price']);
$oneGoods['price'] = self::transPrice($value['sale_price']);
} else {
$oneGoods['showCheckbox'] = true;
}
... ... @@ -634,6 +638,7 @@ class Helpers
$gift['promotionTitle'] = $value['promotion_title'];
foreach ($value['goods_list'] as $single) {
$oneGoods = array();
$oneGoods['id'] = $single['product_skn'];
$oneGoods['name'] = $single['product_name'];
$oneGoods['thumb'] = !empty($single['goods_images']) ? Images::getImageUrl($single['goods_images'], 120, 160) : '';
... ...
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
... ... @@ -93,7 +93,7 @@ function orderCompute() {
}).then(function(res) {
var priceHtml;
if (!res.length) {
if ($.type(res) !== 'object') {
window.location.reload();
} else {
/*if (res.order_amount) {
... ...
... ... @@ -70,6 +70,16 @@ $('#coupon-list').on('touchend', '.employ-main', function() {
orderInfo('couponCode', $this.data('coupon-code'));
orderInfo('couponName', $this.data('coupon-name'));
}).on('touchstart', '.employ-main', function() {
var $this = $(this);
$this.siblings().removeClass('focus');
$this.addClass('focus');
}).on('touchend touchcancel', '.employ-main', function() {
var $this = $(this);
$this.siblings().removeClass('focus');
$this.removeClass('focus');
});
$('body').on('touchend', '.not-use', function() {
... ...
... ... @@ -42,13 +42,10 @@ optHammer.on('tap', function(e) {
}).then(function(res) {
$('#dialog-wrapper').hide();
if (!res) {
tip.show('网络错误');
return;
}
if (res.code === 200) {
tip.show('删除成功');
} else {
tip.show(res.message || '网络错误');
if (res.message) {
tip.show(res.message);
}
window.location.href = '/home/orders';
}).fail(function() {
... ... @@ -74,13 +71,10 @@ optHammer.on('tap', function(e) {
}).then(function(res) {
$('#dialog-wrapper').hide();
if (!res) {
tip.show('网络错误');
return;
}
if (res.code === 200) {
tip.show('取消成功');
} else {
tip.show(res.message || '网络错误');
if (res.message) {
tip.show(res.message);
}
window.location.href = '/home/orders';
}).fail(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'));
... ...
... ... @@ -105,6 +105,8 @@
right: 20rem / $pxConvertRem;
top: 71rem / $pxConvertRem;
font-size: 26rem / $pxConvertRem;
line-height: 58rem / $pxConvertRem;
text-align: center;
}
.title {
... ...
... ... @@ -3,6 +3,14 @@
position: relative;
padding-left: 16rem / $pxConvertRem;
.prevent-img-click {
width: 20rem / $pxConvertRem;
height: 200rem / $pxConvertRem;
position: absolute;
background-color: transparent;
z-index: 99;
}
.checkbox {
position: absolute;
top: 50%;
... ...
... ... @@ -234,9 +234,9 @@
}
}
.price-cal {
font-family: monospace;
}
// .price-cal {
// font-family: monospace;
// }
.cost {
border-top: 1px solid #f7f7f7;
... ...
... ... @@ -40,6 +40,9 @@
background-size: 100% 100%;
color: #fff;
position: relative;
&.focus {
background-image: image-url('me/employ/employ-red.jpg');
}
span{
width: 34.482759%;
height: 100%;
... ...
... ... @@ -12,7 +12,7 @@
{{else}}
{{# freebie}}
<div class="advance-block gift-block" data-promotion-id="{{promotionId}}">
<p class="title">{{title}}</p>
<p class="title">{{promotionTitle}}</p>
{{#goods}}
{{> cart/gift-advance-good}}
{{/goods}}
... ...
... ... @@ -20,7 +20,7 @@
<span class="iconfont">&#xe620;</span>
赠品
<span class="iconfont icon-right-arrow">&#xe614;</span>
<span class="count">{{count}}</span>
<span class="count">{{giftCount}}</span>
</a>
</li>
{{/ freebie}}
... ...
... ... @@ -11,7 +11,7 @@
<span class="price market-price">&yen;{{marketPrice}}</span>
{{/if}}
</p>
<button class="chose">选择</button>
<span class="chose">选择</span>
</div>
... ...
... ... @@ -8,6 +8,7 @@
{{/if}}
<div class="info">
<div class="prevent-img-click"></div>
<a href="{{link}}">
<img class="thumb lazy" data-original="{{thumb}}">
</a>
... ...
... ... @@ -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>
... ...
... ... @@ -5,11 +5,11 @@
<a class="swiper-slide" href="{{url}}">
<img class="swiper-lazy img-box" data-src="{{thumb}}">
<div class="price">
<span class="sale-price {{^price}}no-price{{/price}}">&yen;{{salePrice}}</span>
{{#price}}<span class="old-price">&yen;{{.}}</span>{{/price}}
<span class="sale-price {{^price}}no-price{{/price}}">¥{{salePrice}}</span>
{{#price}}<span class="old-price">¥{{.}}</span>{{/price}}
</div>
<div class="swiper-lazy-preloader"></div>
</a>
{{/recommendList}}
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -46,7 +46,7 @@ class CartModel
*
* @param integer $uid 用户ID
* @param string $shoppingKey 未登录用户唯一识别码
* @param string $cartType 购物车类型
* @param string $cartType 购物车类型,默认是是所有购物车,ordinary为普通购物车,advance为预售购物车
* @param bool $onlyGift 只获取赠品的商品数据
* @param bool $onlyAdvanceBuy 只获取加价购的商品数据
* @return array|mixed 处理之后的购物车数据
... ... @@ -73,7 +73,7 @@ class CartModel
$cart = $cartData['data'];
if ($cartType !== 'all') { // 加价购或者赠品数据
if ($onlyGift || $onlyAdvanceBuy) { // 加价购或者赠品数据
$result = self::procCartData($cart['ordinary_cart_data'], $onlyGift, $onlyAdvanceBuy);
break;
}
... ... @@ -99,7 +99,7 @@ class CartModel
// 以上两个购物车中都有数据, 默认显示普通购物车
else {
$result['cartNav'] = true;
$result['cartType'] = 'ordinary';
$result['cartType'] = $cartType !== 'all' ? $cartType : 'ordinary';
}
/* 普通购物车 */
... ...
... ... @@ -40,10 +40,11 @@ class IndexController extends AbstractAction
$shoppingKey = Helpers::getShoppingKeyByCookie();
$uid = $this->getUid(true);
$cartType = $this->get('cartType', 'all');
$data = array(
'shoppingCartPage' => true,
'shoppingCart' => CartModel::getCartData($uid, $shoppingKey)
'shoppingCart' => CartModel::getCartData($uid, $shoppingKey, $cartType)
);
// 渲染模板
... ...
... ... @@ -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;
}
... ...