Authored by hf

Merge branch 'develop' into test

Showing 33 changed files with 683 additions and 648 deletions
... ... @@ -299,7 +299,7 @@ class AbstractAction extends Controller_Abstract
if (!$this->_useSession) {
$useSession = false;
}
$useSession = false;
//$useSession = false;
if (!$this->_uid) {
$cookie = $this->getCookie('_UID');
... ...
... ... @@ -17,186 +17,186 @@ use Api\Yohobuy;
class CartData
{
/**
* 加入购物车接口
*
* @param int $productSku 商品SKU
* @param int $buyNumber 购买数量
* @param int $goodsType 商品类型,0表示普通商品,1表示加价购商品
* @param int $isEdit 是否是编辑商品SKU,0表示不是编辑
* @param null|int $promotionId 促销id,默认null(加价购有关)
* @param null|int $uid 用户UID,可以不传
/**
* 加入购物车接口
*
* @param int $productSku 商品SKU
* @param int $buyNumber 购买数量
* @param int $goodsType 商品类型,0表示普通商品,1表示加价购商品
* @param int $isEdit 是否是编辑商品SKU,0表示不是编辑
* @param null|int $promotionId 促销id,默认null(加价购有关)
* @param null|int $uid 用户UID,可以不传
* @param string $shoppingKey 未登录用户唯一识别码,可以不传
* @return array 加入购物车接口返回的数据
*/
public static function addToCart($productSku, $buyNumber, $goodsType, $isEdit = 0, $promotionId = null, $uid = null, $shoppingKey = null)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.add';
$param['product_sku'] = $productSku;
$param['buy_number'] = $buyNumber;
$param['goods_type'] = $goodsType;
$param['edit_product_sku'] = $isEdit;
$param['selected'] = 'Y';
$param['promotion_id'] = $promotionId;
if ($uid !== null) {
$param['uid'] = $uid;
}
if ($shoppingKey !== null) {
$param['shoppingKey'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车商品选择与取消接口
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 购物车接口返回的数据
*/
public static function selectGoods($uid, $sku, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.selected';
$param['product_sku_list'] = $sku;
if (!empty($uid)) {
$param['uid'] = $uid;
}
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车数据
*
* @param int $uid 用户ID
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 购物车接口返回的数据
*/
public static function cartData($uid, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.cart';
if (!empty($uid)) {
$param['uid'] = $uid;
}
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 移出购物车
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 接口返回的数据
*/
public static function removeFromCart($uid, $sku, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.remove';
$param['product_sku_list'] = $sku;
if (!empty($uid)) {
$param['uid'] = $uid;
}
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 移入收藏夹
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @return array 接口返回的数据
*/
public static function addToFav($uid, $sku)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.addfavorite';
$param['product_sku_list'] = $sku;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取购物车商品数据
*
* @param int $uid 用户ID
* @param int $skn 商品skn
* @return array 接口返回的数据
*/
public static function cartProductData($uid, $skn)
{
$param = Yohobuy::param();
$param['method'] = 'app.product.data';
$param['product_skn'] = $skn;
$param['showcomment'] = 'N';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取加价购商品数据
*
* @param int $skn 商品skn
* @param int $promotionId 加价购商品促销ID
* @return array 接口返回的数据
*/
public static function giftProductData($skn, $promotionId)
{
$param = Yohobuy::param();
$param['method'] = 'app.product.gift';
$param['product_skn'] = $skn;
$param['promotion_id'] = $promotionId;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 增减购物车商品数量
*
* @param int $uid 用户ID
* @param string $sku 商品SKU
* @param int $increaseNum 增加的数目
* @param int $decreaseNum 减少的数目
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 接口返回的数据
*/
public static function modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.increase';
$param['product_sku'] = $sku;
* @return array 加入购物车接口返回的数据
*/
public static function addToCart($productSku, $buyNumber, $goodsType, $isEdit = 0, $promotionId = null, $uid = null, $shoppingKey = null)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.add';
$param['product_sku'] = $productSku;
$param['buy_number'] = $buyNumber;
$param['goods_type'] = $goodsType;
$param['edit_product_sku'] = $isEdit;
$param['selected'] = 'Y';
$param['promotion_id'] = $promotionId;
if ($uid !== null) {
$param['uid'] = $uid;
}
if ($shoppingKey !== null) {
$param['shoppingKey'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车商品选择与取消接口
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 购物车接口返回的数据
*/
public static function selectGoods($uid, $sku, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.selected';
$param['product_sku_list'] = $sku;
if (!empty($uid)) {
$param['uid'] = $uid;
}
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车数据
*
* @param int $uid 用户ID
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 购物车接口返回的数据
*/
public static function cartData($uid, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.cart';
if (!empty($uid)) {
$param['uid'] = $uid;
}
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 移出购物车
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 接口返回的数据
*/
public static function removeFromCart($uid, $sku, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.remove';
$param['product_sku_list'] = $sku;
if (!empty($uid)) {
$param['uid'] = $uid;
}
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 移入收藏夹
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @return array 接口返回的数据
*/
public static function addToFav($uid, $sku)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.addfavorite';
$param['product_sku_list'] = $sku;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取购物车商品数据
*
* @param int $uid 用户ID
* @param int $skn 商品skn
* @return array 接口返回的数据
*/
public static function cartProductData($uid, $skn)
{
$param = Yohobuy::param();
$param['method'] = 'app.product.data';
$param['product_skn'] = $skn;
$param['showcomment'] = 'N';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 获取加价购商品数据
*
* @param int $skn 商品skn
* @param int $promotionId 加价购商品促销ID
* @return array 接口返回的数据
*/
public static function giftProductData($skn, $promotionId)
{
$param = Yohobuy::param();
$param['method'] = 'app.product.gift';
$param['product_skn'] = $skn;
$param['promotion_id'] = $promotionId;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 增减购物车商品数量
*
* @param int $uid 用户ID
* @param string $sku 商品SKU
* @param int $increaseNum 增加的数目
* @param int $decreaseNum 减少的数目
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 接口返回的数据
*/
public static function modifyProductNum($uid, $sku, $increaseNum, $decreaseNum, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.increase';
$param['product_sku'] = $sku;
if (!empty($increaseNum)) {
$param['increase_number'] = $increaseNum;
... ... @@ -205,175 +205,199 @@ class CartData
$param['decrease_number'] = $decreaseNum;
}
if (!empty($uid)) {
$param['uid'] = $uid;
}
if ($shoppingKey !== null) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 修改购物车商品数据
*
* @param int $uid 用户ID
* @param string $swapData 商品数据
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 接口返回的数据
*/
public static function modifyCartProduct($uid, $swapData, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.swap';
$param['swap_data'] = $swapData;
if (!empty($uid)) {
$param['uid'] = $uid;
}
if ($shoppingKey !== null) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算
*
* @param int $uid 用户ID
* @param string $cartType 购物车类型,ordinary表示普通购物车
* @return array 接口返回的数据
*/
public static function cartPay($uid, $cartType)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.payment';
$param['cart_type'] = $cartType;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算--支付方式和配送方式选择
*
* @param int $uid 用户ID
* @param string $cartType 购物车类型,ordinary表示普通购物车
* @param int $deliveryWay 配送方式,1表示普通快递,2表示顺丰速运
* @param int $paymentType 支付方式,1表示在线支付,2表示货到付款
* @param string $couponCode 优惠券码
* @param mixed $yohoCoin 使用的YOHO币数量
* @return array 接口返回的数据
*/
public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.compute';
$param['cart_type'] = $cartType;
$param['delivery_way'] = $deliveryWay;
$param['payment_type'] = $paymentType;
if (!empty($couponCode)) {
$param['coupon_code'] = $couponCode;
}
if (!empty($yohoCoin)) {
$param['use_yoho_coin'] = $yohoCoin;
}
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算--使用优惠券
*
* @param int $uid 用户ID
* @param string $couponCode 优惠券代码
* @return array 接口返回的数据
*/
public static function searchCoupon($uid, $couponCode)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.useCoupon';
$param['coupon_code'] = $couponCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算--获取优惠券列表
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function getCouponList($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.coupons.lists';
$param['type'] = 'notuse';
$param['page'] = 1;
$param['limit'] = 1000;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算--提交结算信息
*
* @param int $uid 用户ID
* @param int $addressId 地址ID
* @param int $cartType 购物车类型ID
* @param int $deliveryTime 寄送时间ID
* @param int $deliveryWay 寄送方式ID
* @param string $invoiceTitle 发票说明
* @param int $invoiceId 发票类型ID
* @param int $paymentId 支付方式ID
* @param int $paymentType 支付类型ID
* @param string $remark 留言
* @param string $couponCode 优惠券码
* @param mixed $yohoCoin 使用的YOHO币数量或为空
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.submit';
$param['address_id'] = $addressId;
$param['cart_type'] = $cartType;
$param['delivery_time'] = $deliveryTime;
$param['delivery_way'] = $deliveryWay;
if (!empty($invoiceTitle)) {
$param['invoices_title'] = $invoiceTitle;
}
if (!empty($invoiceId)) {
$param['invoices_type_id'] = $invoiceId;
}
$param['payment_id'] = $paymentId;
$param['payment_type'] = $paymentType;
$param['remark'] = $remark;
if (!empty($couponCode)) {
$param['coupon_code'] = $couponCode;
}
if (!empty($yohoCoin)) {
$param['use_yoho_coin'] = $yohoCoin;
}
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
if (!empty($uid)) {
$param['uid'] = $uid;
}
if ($shoppingKey !== null) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 修改购物车商品数据
*
* @param int $uid 用户ID
* @param string $swapData 商品数据
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 接口返回的数据
*/
public static function modifyCartProduct($uid, $swapData, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.swap';
$param['swap_data'] = $swapData;
if (!empty($uid)) {
$param['uid'] = $uid;
}
if ($shoppingKey !== null) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算
*
* @param int $uid 用户ID
* @param string $cartType 购物车类型,ordinary表示普通购物车
* @return array 接口返回的数据
*/
public static function cartPay($uid, $cartType)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.payment';
$param['cart_type'] = $cartType;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算--支付方式和配送方式选择
*
* @param int $uid 用户ID
* @param string $cartType 购物车类型,ordinary表示普通购物车
* @param int $deliveryWay 配送方式,1表示普通快递,2表示顺丰速运
* @param int $paymentType 支付方式,1表示在线支付,2表示货到付款
* @param string $couponCode 优惠券码
* @param mixed $yohoCoin 使用的YOHO币数量
* @return array 接口返回的数据
*/
public static function orderCompute($uid, $cartType, $deliveryWay, $paymentType, $couponCode, $yohoCoin)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.compute';
$param['cart_type'] = $cartType;
$param['delivery_way'] = $deliveryWay;
$param['payment_type'] = $paymentType;
if (!empty($couponCode)) {
$param['coupon_code'] = $couponCode;
}
if (!empty($yohoCoin)) {
$param['use_yoho_coin'] = $yohoCoin;
}
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算--使用优惠券
*
* @param int $uid 用户ID
* @param string $couponCode 优惠券代码
* @return array 接口返回的数据
*/
public static function searchCoupon($uid, $couponCode)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.useCoupon';
$param['coupon_code'] = $couponCode;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算--获取优惠券列表
*
* @param int $uid 用户ID
* @return array 接口返回的数据
*/
public static function getCouponList($uid)
{
$param = Yohobuy::param();
$param['method'] = 'app.coupons.lists';
$param['type'] = 'notuse';
$param['page'] = 1;
$param['limit'] = 1000;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车结算--提交结算信息
*
* @param int $uid 用户ID
* @param int $addressId 地址ID
* @param int $cartType 购物车类型ID
* @param int $deliveryTime 寄送时间ID
* @param int $deliveryWay 寄送方式ID
* @param string $invoiceTitle 发票说明
* @param int $invoiceId 发票类型ID
* @param int $paymentId 支付方式ID
* @param int $paymentType 支付类型ID
* @param string $remark 留言
* @param string $couponCode 优惠券码
* @param mixed $yohoCoin 使用的YOHO币数量或为空
* @return array 接口返回的数据
*/
public static function orderSub($uid, $addressId, $cartType, $deliveryTime, $deliveryWay, $invoiceTitle, $invoiceId, $paymentId, $paymentType, $remark, $couponCode, $yohoCoin)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.submit';
$param['address_id'] = $addressId;
$param['cart_type'] = $cartType;
$param['delivery_time'] = $deliveryTime;
$param['delivery_way'] = $deliveryWay;
if (!empty($invoiceTitle)) {
$param['invoices_title'] = $invoiceTitle;
}
if (!empty($invoiceId)) {
$param['invoices_type_id'] = $invoiceId;
}
$param['payment_id'] = $paymentId;
$param['payment_type'] = $paymentType;
$param['remark'] = $remark;
if (!empty($couponCode)) {
$param['coupon_code'] = $couponCode;
}
if (!empty($yohoCoin)) {
$param['use_yoho_coin'] = $yohoCoin;
}
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
/**
* 购物车数量
*
* @param int $uid 用户ID
* @param string $shoppingKey 未登录用户唯一识别码
* @return array 购物车接口返回的数据
*/
public static function cartCount($uid, $shoppingKey)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.count';
if (!empty($uid)) {
$param['uid'] = $uid;
}
if (!empty($shoppingKey)) {
$param['shopping_key'] = $shoppingKey;
}
$param['client_secret'] = Sign::getSign($param);
return Yohobuy::get(Yohobuy::API_URL, $param);
}
}
... ...
... ... @@ -129,7 +129,7 @@ class Helpers
*/
public static function getShoppingKeyByCookie()
{
$cookie = isset($_COOKIE['_spk']) ? $_COOKIE['_spk'] : '';
$cookie = isset($_COOKIE['_Spk']) ? $_COOKIE['_Spk'] : '';
return $cookie;
}
... ... @@ -576,30 +576,31 @@ class Helpers
$oneGoods['thumb'] = !empty($value['goods_images']) ? Images::getImageUrl($value['goods_images'], 90, 100) : '';
$oneGoods['color'] = $value['color_name'];
$oneGoods['size'] = $value['size_name'];
$oneGoods['isSelected'] = $value['selected'] === 'Y';
$oneGoods['checked'] = $value['selected'] === 'Y';
$oneGoods['price'] = self::transPrice($value['sales_price']);
$oneGoods['count'] = $value['buy_number'];
if ($isValid) {
if ($isValid) { // 库存不足
$oneGoods['lowStocks'] = ($value['buy_number'] > $value['storage_number']);
}
//gift=>是否赠品,advanceBuy=>是否加价购,soldOut=>失效商品;
if (!isset($value['goods_type'])) {
$oneGoods['isSoldOut'] = true;
$oneGoods['inValid'] = true;
} elseif ($value['goods_type'] == 'gift' && !isset($value['isAdvanceBuy'])) {
$oneGoods['isGift'] = true;
} elseif ($value['goods_type'] == 'price_gift') {
$oneGoods['isAdvanceBuy'] = true;
} else {
$oneGoods['showCheckbox'] = true;
}
// 上市期
if ($isAdvanceCart && !empty($value['expect_arrival_time'])) {
$oneGoods['appearDate'] = $value['expect_arrival_time'];
}
// 商品链接
if (isset($value['cn_alphabet'])) {
$oneGoods['url'] = self::url('/product/pro_' . $value['product_id'] . '_' . $value['goods_id'] . '/' . $value['cn_alphabet'] . '.html');
}
$oneGoods['link'] = self::url('/product/show_' . $value['product_skn'] . '.html');
$arr[$key] = $oneGoods;
}
... ... @@ -629,7 +630,7 @@ class Helpers
$oneGoods['id'] = $single['product_skn'];
$oneGoods['name'] = $single['product_name'];
$oneGoods['thumb'] = !empty($single['goods_images']) ? Images::getImageUrl($single['goods_images'], 120, 160) : '';
$oneGoods['price'] = self::transPrice($single['last_price']);
$oneGoods['price'] = self::transPrice($single['sales_price']);
$oneGoods['marketPrice'] = self::transPrice($single['market_price']);
$oneGoods['count'] = $single['storage_number'];
... ...
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 Sat Dec 5 16:26:44 2015
Created by FontForge 20120731 at Thu Dec 17 13:53:30 2015
By Ads
</metadata>
<defs>
... ... @@ -19,7 +19,7 @@ Created by FontForge 20120731 at Sat Dec 5 16:26:44 2015
bbox="-0.75 -224 3943 833"
underline-thickness="50"
underline-position="-100"
unicode-range="U+0078-E63F"
unicode-range="U+0078-E640"
/>
<missing-glyph horiz-adv-x="374"
d="M34 0v682h272v-682h-272zM68 34h204v614h-204v-614z" />
... ... @@ -257,5 +257,11 @@ d="M512 -66q-10 0 -24.5 -0.5t-25 -1t-24 0t-24.5 1.5l-222 -146q0 227 5 243q-164 1
q-91 0 -176.5 -31.5t-148.5 -83.5t-100.5 -124.5t-37.5 -150.5q0 -95 53 -179t142 -138v-170l146 97q16 -3 35.5 -4t49 0t37.5 1q41 0 81 6.5t77 18.5t72 29.5t65 39.5t56.5 47.5t47 55t35 61t22 66t7.5 69.5q0 104 -63.5 194.5t-170.5 143t-229 52.5zM768 300
q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM512 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5zM256 300q-27 0 -45.5 18.5t-18.5 45.5t18.5 45.5t45.5 18.5
t45.5 -18.5t18.5 -45.5t-18.5 -45.5t-45.5 -18.5z" />
<glyph glyph-name="uniE640" unicode="&#xe640;"
d="M957 510q-5 8 -14 13.5t-24 5.5h-598l-29 62l-4 7q-1 3 -4 7t-8 8q-4 3 -7 6l-2 1l-8 4h-2q-5 2 -9 2l-4 1h-5h-118q-23 0 -40 -16.5t-17 -40.5q0 -6 1.5 -12.5t4.5 -12.5t7 -10.5t8.5 -8.5t10.5 -7t12.5 -4.5t12.5 -1.5h81l33 -71q3 -10 8 -21t8 -17l3 -5l81 -181
q0 -2 2 -5l15 -32q9 -30 39 -38v-3h392l18 1v2q14 4 24.5 14t14.5 24l98 217q40 77 19 112zM909 413l-93 -207l-3 1l-4 -15q-5 -19 -25 -19l-19 1v-1h-340h-18q-8 0 -15 5t-9 14l-4 15l-3 -1l-93 208q-1 1 -3.5 5.5t-7 14.5t-7.5 20l-42 92h-102q-10 0 -17 7t-7 17
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" />
</font>
</defs></svg>
... ...
No preview for this file type
No preview for this file type
... ... @@ -56,6 +56,10 @@ if ($('.cart-nav').length > 0) {
}, 3000);
}
$('.advance-buy').on('touchend', function() {
window.location.href = '/cart/index/advanceBuy?cartType=' + cartType;
});
$('.btn-balance').on('touchend', function() {
if (hasChecked) {
window.location.href = '/cart/index/orderEnsure?cartType=' + cartType;
... ...
... ... @@ -16,8 +16,8 @@ var $ = require('jquery'),
var $chosePanel = $('#chose-panel'),
$num,
$chosed,
// re = /\d+/,
$imgsThumb,
$leftNum,
leftNum,
confirming,
curColorIndex,
... ... @@ -26,7 +26,11 @@ var $chosePanel = $('#chose-panel'),
hasChooseColor,
hasChooseSize,
$curSizeBlock,
$sizeRowList;
$sizeRowList,
cbFn,
$allChoseItems,
queryString,
$yohoPage = $('.yoho-page');
//初始化购物车面板显示
function init() {
... ... @@ -35,12 +39,15 @@ function init() {
hasChooseColor = false;
hasChooseSize = false;
$curSizeBlock = null;
queryString = $.queryString();
$imgsThumb = $('.chose-panel').find('.thumb');
$allChoseItems = $('.chose-items');
$sizeRowList = $('.size-list ul');
$leftNum = $('#left-num');
$firstRow = $sizeRowList.eq(0);
$firstRow.toggleClass('hide');
$curSizeRow = $firstRow;
}
init();
function checkColorSizeNum() {
if (!hasChooseColor && !hasChooseSize) {
... ... @@ -56,32 +63,28 @@ function checkColorSizeNum() {
return true;
}
function show(html) {
function show(html, cb) {
if (html) {
$chosePanel.html(html);
init();
}
$('.chose-panel').show();
$('body').css('overflow', 'hidden');
$num = $('#good-num');
cbFn = cb;
}
//隐藏当前Panel
function hide() {
$('.chose-panel').hide();
$('body').css('overflow', 'auto');
}
//修改加入购物车的文字和背景
function updateConformButtonClassAndText() {
$chosed = $('.chose-items').find('.chosed');
$chosed = $allChoseItems.find('.chosed');
if (2 === $chosed.closest('.zero-stock').length) {
$('#chose-btn-sure').css('background-color', '#c0c0c0');
$('#chose-btn-sure').html('已售罄');
$('#chose-btn-sure').css('background-color', '#c0c0c0').html('已售罄');
} else {
$('#chose-btn-sure').css('background-color', '#eb0313');
$('#chose-btn-sure').html('确定');
$('#chose-btn-sure').css('background-color', '#eb0313').html('确定');
}
}
... ... @@ -92,11 +95,11 @@ function resetColorZeroStock($siblingBlock) {
if (!hasChooseSize) {
$siblingBlock.find('ul>li').each(function() {
$(this).removeClass('zero-stock');
if ('0' === $(this).data('num')) {
$(this).addClass('zero-stock');
}
});
$(this).removeClass('zero-stock');
if ('0' === $(this).data('num')) {
$(this).addClass('zero-stock');
}
});
} else {
for (i = 0; i < numArray.length; i++) {
... ... @@ -110,13 +113,13 @@ function resetColorZeroStock($siblingBlock) {
// 选择了颜色切换商品图片
function changeGoodImgWhenClickColor() {
if (hasChooseColor && curColorIndex) {
$('.chose-panel').find('.thumb').addClass('hide').eq(curColorIndex).removeClass('hide');
$imgsThumb.addClass('hide').eq(curColorIndex).removeClass('hide');
}
}
init();
$('.yoho-page').on('touchstart', '.chose-panel', function(e) {
$yohoPage.on('touchstart', '.chose-panel', function(e) {
var $cur = $(e.target);
if ($cur.closest('.main').length > 0) {
... ... @@ -127,12 +130,11 @@ $('.yoho-page').on('touchstart', '.chose-panel', function(e) {
hide();
});
$('.color-list').on('touchstart', '.block', function(e) {
$yohoPage.on('touchstart', '.color-list .block', function(e) {
var $this = $(this),
$that = $(e.target).closest('.chose-items'),
index,
curSelectedSizeBlock,
$sizeChosed,
curSizeBlock,
$preSiblingBlock,
scindex,
curGoodNum;
... ... @@ -141,16 +143,16 @@ $('.color-list').on('touchstart', '.block', function(e) {
$this.siblings('.chosed').removeClass('chosed');
index = $this.index();
$sizeChosed = $siblingBlock.find('.chosed');
scindex = $sizeChosed.index();
$preSiblingBlock = $siblingBlock.find('.chosed');
scindex = $preSiblingBlock.index();
$curSizeRow = $sizeRowList.eq(index);
// 当前颜色已经是选中状态,再点击时
if ($this.hasClass('chosed')) {
//颜色原来已经是勾选时,要清空剩余件数的提示
$that.find('.num .left-num').html('');
$('#left-num').val(0);
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
hasChooseColor = false;
// 当前颜色不是选中状态,选中时
... ... @@ -162,24 +164,23 @@ $('.color-list').on('touchstart', '.block', function(e) {
$curSizeRow.removeClass('hide').addClass('show');
// 之前选中的尺码去掉勾选样式
if ($sizeChosed.length > 0) {
$sizeChosed.removeClass('chosed');
curSelectedSizeBlock = $curSizeRow.children().get(scindex);
if ($preSiblingBlock.length > 0) {
$preSiblingBlock.removeClass('chosed');
curSizeBlock = $curSizeRow.children().get(scindex);
}
// 当前选中颜色对应的尺码行,其对应的尺码加上勾选样式 (前提是要判断下这个尺码是否存在)
if (curSelectedSizeBlock) {
curGoodNum = $(curSelectedSizeBlock).data('num');
$(curSelectedSizeBlock).addClass('chosed');
if (curSizeBlock) {
curGoodNum = $(curSizeBlock).data('num');
$(curSizeBlock).addClass('chosed');
//如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式
if (curGoodNum > 0) {
$that.find('.num .left-num').html('剩余' + curGoodNum + '件');
$('#left-num').val(curGoodNum);
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
$leftNum.val(curGoodNum);
} else {
$(curSelectedSizeBlock).removeClass('zero-stock').addClass('zero-stock');
$that.find('.num .left-num').html('');
$('#left-num').val(0);
$allChoseItems.find('.num .left-num').html('');
$leftNum.val(0);
}
}
}
... ... @@ -195,9 +196,8 @@ $('.color-list').on('touchstart', '.block', function(e) {
changeGoodImgWhenClickColor();
});
$('.size-list').on('touchstart', '.block', function(e) {
$yohoPage.on('touchstart', '.size-list .block', function(e) {
var $this = $(this),
$that = $(e.target).closest('.chose-items'),
index,
curGoodNum;
... ... @@ -211,7 +211,7 @@ $('.size-list').on('touchstart', '.block', function(e) {
if ($this.hasClass('chosed')) {
//尺码原来已经是勾选时,要清空剩余件数的提示
$that.find('.num .left-num').html('');
$allChoseItems.find('.num .left-num').html('');
$('#left-num').val(0);
hasChooseSize = false;
... ... @@ -226,12 +226,12 @@ $('.size-list').on('touchstart', '.block', function(e) {
$curSizeBlock.removeClass('chosed');
}
// 如果当前有尺码被选中,且数量等于0,则颜色块添加数量为0的样式, 否则显示剩余件数
// 如果当前有尺码被选中,且数量等于0, 否则显示剩余件数
if (curGoodNum > 0 && hasChooseColor) {
$that.find('.num .left-num').html('剩余' + curGoodNum + '件');
$allChoseItems.find('.num .left-num').html('剩余' + curGoodNum + '件');
$('#left-num').val(curGoodNum);
} else {
$that.find('.num .left-num').html('');
$allChoseItems.find('.num .left-num').html('');
$('#left-num').val(0);
}
... ... @@ -249,8 +249,8 @@ $('.size-list').on('touchstart', '.block', function(e) {
});
$('.btn-minus').on('touchstart', function() {
var num = $num.val();
$yohoPage.on('touchstart', '.btn-minus', function() {
var num = parseInt($num.val(), 10);
leftNum = $('#left-num').val();
... ... @@ -263,10 +263,8 @@ $('.btn-minus').on('touchstart', function() {
}
$num.val(num - 1);
});
$('.btn-plus').on('touchstart', function() {
var num = $num.val();
}).on('touchstart', '.btn-plus', function() {
var num = parseInt($num.val(), 10);
leftNum = $('#left-num').val();
... ... @@ -281,9 +279,7 @@ $('.btn-plus').on('touchstart', function() {
//TODO:库存数验证
$num.val(num + 1);
});
$('#chose-btn-sure').on('touchstart', function() {
}).on('touchstart', '#chose-btn-sure', function() {
var productSku,
buyNumber = $('#good-num').val() - 0,
... ... @@ -298,6 +294,7 @@ $('#chose-btn-sure').on('touchstart', function() {
return;
}
//TODO status change
if ($('#chose-btn-sure').html() === '已售罄') {
return;
}
... ... @@ -327,15 +324,19 @@ $('#chose-btn-sure').on('touchstart', function() {
productSku: productSku,
buyNumber: buyNumber,
promotionId: promotionId,
isEdit: isEdit
isEdit: isEdit,
cartType: queryString.cartType
}
}).done(function(res) {
loading.hideLoadingMask();
if (res.code === 200) {
$('.num-tag').html(numInCart + buyNumber);
$('.num-tag').removeClass('hide');
$('.num-tag').html(numInCart + buyNumber).removeClass('hide');
confirming = false;
hide();
if (cbFn) {
cbFn();
}
}
if (res.message) {
tip.show(res.message);
... ...
... ... @@ -10,7 +10,8 @@ var $ = require('jquery'),
loading = require('../plugin/loading'),
chosePanel = require('./chose-panel');
var $page = $('.gift-advance-page');
var $page = $('.gift-advance-page'),
queryString = $.queryString();
lazyLoad($('.lazy'));
... ... @@ -24,7 +25,9 @@ function getProductInfo(skn, promotionId) {
tip.show('网络错误');
return;
}
chosePanel.show(html);
chosePanel.show(html, function() {
window.location.href = '/cart/index/index?cartType=' + queryString.cartType;
});
}, function() {
tip.show('网络错误');
}).always(function() {
... ...
... ... @@ -10,7 +10,8 @@ var $ = require('jquery'),
lazyLoad = require('yoho.lazyload');
var dialog = require('../me/dialog'),
tip = require('../plugin/tip');
tip = require('../plugin/tip'),
orderInfo = require('./order-info').orderInfo;
var $selectAllBtn = $('.balance .checkbox'),
cartType = $('#cartType').val(),
... ... @@ -106,6 +107,8 @@ $('.cart-goods').on('touchstart', '.checkbox', function() {
autoHide: true,
fast: true
});
orderInfo('couponCode', null);
orderInfo('couponName', null);
history.go(0);
} else {
tip.show(data.message);
... ... @@ -223,5 +226,3 @@ $selectAllBtn.on('touchend', function() {
$('.down').on('touchend', function() {
chosePanel.show();
});
... ...
... ... @@ -28,11 +28,13 @@ if (window.getUid() !== orderInfo('uid')) {
order.init();
}
if ($couponUse.data('value') !== orderInfo('couponValue')) {
if ($couponUse.data('name') !== orderInfo('couponName')) {
orderInfo('couponCode', null);
orderInfo('couponValue', null);
orderInfo('couponName', null);
}
orderInfo('cartType', queryString.cartType || queryString.carttype || 'ordinary');
function dispacthTapEvt(e) {
var $cur = $(e.target).closest('li');
... ... @@ -78,7 +80,7 @@ function orderCompute() {
method: 'POST',
url: '/cart/index/orderCompute',
data: {
cartType: queryString.cartType || queryString.carttype || 'ordinary',
cartType: orderInfo('cartType') || 'ordinary',
deliveryId: orderInfo('deliveryId'),
paymentTypeId: orderInfo('paymentTypeId'),
couponCode: orderInfo('couponCode'),
... ... @@ -139,11 +141,12 @@ function submitOrder() {
url: '/cart/index/orderSub',
data: {
addressId: orderInfo('addressId'),
cartType: queryString.cartType || queryString.carttype || 'ordinary',
cartType: orderInfo('cartType') || 'ordinary',
deliveryId: orderInfo('deliveryId'),
deliveryTimeId: orderInfo('deliveryTimeId'),
invoiceText: invoiceText,
invoiceType: $invoice.find('.invoice-type').val() || orderInfo('invoiceType'),
invoiceText: orderInfo('invoice') ? invoiceText : null,
invoiceType: orderInfo('invoice') ? ($invoice.find('.invoice-type').val() ||
orderInfo('invoiceType')) : null,
msg: msg,
paymentTypeId: orderInfo('paymentTypeId'),
paymentType: orderInfo('paymentType'), //支付方式
... ...
... ... @@ -15,11 +15,12 @@ function init() {
yohoCoin: $('.coin').data('yoho-coin') || 0,
addressId: null,
couponCode: null,
couponValue: null,
couponName: null,
invoice: null,
invoiceText: null,
invoiceType: null,
msg: null
msg: null,
cartType: 'ordinary'
};
window.setCookie('order-info', JSON.stringify(info));
}
... ...
... ... @@ -37,7 +37,7 @@ $newCoupon.on('submit', function() {
if (res.code === 200) {
tip.show('优惠券可用');
orderInfo('couponCode', res.data.coupon_code);
orderInfo('couponValue', res.data.coupon_value);
orderInfo('couponName', res.data.coupon_title);
window.location.href = '/cart/index/orderEnsure';
} else {
tip.show(res.message || '网络错误');
... ... @@ -52,12 +52,12 @@ $('#coupon-list').on('touchend', '.employ-main', function() {
var $this = $(this);
orderInfo('couponCode', $this.data('coupon-code'));
orderInfo('couponValue', $this.data('coupon-value'));
orderInfo('couponName', $this.data('coupon-name'));
});
$('body').on('touchend', '.not-use', function() {
orderInfo('couponCode', null);
orderInfo('couponValue', null);
orderInfo('couponName', null);
});
... ...
... ... @@ -20,7 +20,15 @@ var api = require('../api'),
var trim = $.trim;
var showErrTip = tip.show;
var requesting = false;
function nextStep(url, mobileNo, areaCode) {
if (requesting) {
return false;
}
requesting = true;
$.ajax({
type: 'POST',
url: '/passport/bind/sendBindMsg',
... ... @@ -31,9 +39,13 @@ function nextStep(url, mobileNo, areaCode) {
success: function(res) {
console.log(res.data);
location.href = url;
requesting = false;
},
error: function() {
tip.show('出错了,请重试!');
requesting = false;
}
});
}
... ...
... ... @@ -65,7 +65,7 @@ if (navtabHammer) {
if (gotoConsultHammer) {
gotoConsultHammer.on('tap', function() {
location.href = $(gotoConsultEle).data('href');
location.href = $(gotoConsultEle).find('a').attr('href');
});
}
... ...
... ... @@ -40,7 +40,6 @@
.thumb {
float: left;
width: 80rem / $pxConvertRem;
height: 106rem / $pxConvertRem;
}
.text-info {
... ...
... ... @@ -118,14 +118,14 @@
margin-left: 20rem / $pxConvertRem;
}
.coupon-use,
.coin-check {
.coupon-use {
float: right;
color: #999;
&.used {
color: #f00;
}
text-align: right;
width: 360rem / $pxConvertRem;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
.iconfont {
color: #999;
... ... @@ -141,6 +141,10 @@
color: #000;
}
&.used {
color: #f00;
}
em {
color: #f00;
}
... ...
... ... @@ -161,11 +161,18 @@
color: #fff;
text-align: center;
font-size: 12px;
&:before {
display: block;
line-height: 1;
@include transform(scale(0.833));
}
}
.gift-tag {
height: 25rem / $pxConvertRem;
background: #a1ce4e;
&:before {
content: '赠品';
}
... ... @@ -174,6 +181,7 @@
.advance-buy-tag {
height: 25rem / $pxConvertRem;
background: #eb76aa;
&:before {
content: '加价购';
}
... ... @@ -228,4 +236,4 @@
.appear-date {
color: #f00;
}
}
\ No newline at end of file
}
... ...
... ... @@ -49,9 +49,9 @@
{{count}}张可用
</span>
{{#if value}}
<span class="used coupon-use" data-value="{{value}}">
{{value}}
{{#if couponName}}
<span class="used coupon-use" data-name="{{couponName}}">
{{couponName}}
<i class="iconfont">&#xe614;</i>
</span>
{{^}}
... ... @@ -119,6 +119,7 @@
<ul class="pay-mode">
{{# paymentWay}}
{{#if isSupport}}
<li class="{{#if recommend}}default{{/if}}" data-pay-type="{{paymentType}}" data-pay-id="{{id}}">
<span class="iconfont">
{{#if recommend}}
... ... @@ -129,6 +130,7 @@
</span>
{{name}}
</li>
{{/if}}
{{/ paymentWay}}
</ul>
{{/ orderEnsure}}
... ...
... ... @@ -13,7 +13,7 @@
<script id="tmpl-coupon" type="text/tmpl">
\{{#coupons}}
\{{^ notAvailable}}
<a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-value="\{{ couponValue}}" href="/cart/index/orderEnsure">
<a class="employ-main" data-coupon-code="\{{ couponCode}}" data-coupon-name="\{{ couponDetailInfomation}}" href="/cart/index/orderEnsure">
<span>\{{ couponValue}}</span>
<p class="coupon-name">\{{ couponDetailInfomation}}</p>
<p>有效期:\{{ couponValidity}}</p>
... ...
... ... @@ -93,9 +93,9 @@
{{#if consultsNum}}
{{> product/feedback-tab}}
{{else}}
<div class="nodata tap-hightlight">
<div class="nodata tap-hightlight" id="goto-consult">
<span>暂无商品评价和咨询</span>
<a href="{{link}}" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
<a href="{{consultsUrl}}" class="go-consult">我要咨询<span class="iconfont">&#xe604;</span></a>
</div>
{{/if}}
{{/if}}
... ...
... ... @@ -25,7 +25,7 @@
<li class="advance-buy">
<span class="iconfont">&#xe61b;</span>
加价购
<a href="/cart/index/advanceBuy">
<a href="">
<span class="count">{{advanceBuyCount}}</span>
<span class="iconfont icon-right-arrow">&#xe614;</span>
</a>
... ...
... ... @@ -37,7 +37,7 @@
<ul class="size-row clearfix hide">
{{# size}}
<li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id={{id}} data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}">
<li class="block {{#if chosed}}chosed{{/if}} {{#unless sizeNum}}zero-stock{{/unless}}" data-id="{{id}}" data-colorid="{{colorId}}" data-num="{{sizeNum}}" data-numstr="{{colorNumStr}}" data-skuid="{{skuId}}" data-goodid="{{goodsId}}">
{{name}}
</li>
{{/ size}}
... ...
... ... @@ -4,11 +4,13 @@
{{/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}} iconfont"></span>
{{/if}}
<div class="info">
<img class="thumb lazy" data-original="{{thumb}}">
<a href="{{link}}">
<img class="thumb lazy" data-original="{{thumb}}">
</a>
{{#if isAdvanceBuy}}
<p class="few-tag plus-tag">加价购</p>
{{/if}}
... ... @@ -17,7 +19,7 @@
{{/if}}
<div class="deps show">
<p class="name row">{{name}}</p>
<a href="{{link}}" class="name row">{{name}}</a>
<span class="count">
×{{count}}
</span>
... ...
... ... @@ -123,20 +123,7 @@ class CartModel
*/
public static function getCartCount($uid, $shoppingKey)
{
$result = array(
'code' => 200,
'data' => array(
'cart_goods_count' => 0
)
);
$carData = self::getCartData($uid, $shoppingKey);
if (isset($carData['commonGoodsCount'])) {
$result['data']['cart_goods_count'] = $carData['commonGoodsCount'] + $carData['presellGoodsCount'];
}
return $result;
return CartData::cartCount($uid, $shoppingKey);
}
/**
... ... @@ -424,6 +411,13 @@ class CartModel
$oneGoods['price'] = Helpers::transPrice($single['sales_price']);
$oneGoods['count'] = $single['buy_number'];
//gift=>是否赠品,advanceBuy=>是否加价购;
if ($single['goods_type'] == 'gift' && !isset($single['isAdvanceBuy'])) {
$oneGoods['gift'] = true;
} elseif ($single['goods_type'] == 'price_gift') {
$oneGoods['advanceBuy'] = true;
}
$result['goods'][] = $oneGoods;
}
}
... ... @@ -436,6 +430,7 @@ class CartModel
$onePay['id'] = $pay['payment_id'];
$onePay['paymentType'] = $pay['payment_type'];
$onePay['name'] = $pay['payment_type_name'];
$onePay['isSupport'] = $pay['is_support'] === 'Y';
// $onePay['default'] = ($pay['default'] === 'Y');
if ($onePay['paymentType'] == 1) {
$onePay['recommend'] = true;
... ... @@ -453,24 +448,6 @@ class CartModel
$result['cartPayData'] = isset($orderCompute['promotion_formula_list']) ? $orderCompute['promotion_formula_list'] : $payReturn['shopping_cart_data']['promotion_formula_list'];
$price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
$result['price'] = Helpers::transPrice($price);
/*$sumPrice = isset($orderCompute['order_amount']) ? $orderCompute['order_amount'] : $payReturn['shopping_cart_data']['order_amount'];
$freight = '¥0';
if (isset($orderCompute['promotion_formula_list'][1]['promotion_amount'])) {
$freight = $orderCompute['promotion_formula_list'][1]['promotion_amount'];
} elseif(isset($payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'])) {
$freight = $payReturn['shopping_cart_data']['promotion_formula_list'][1]['promotion_amount'];
}
$couponPrice = isset($orderCompute['coupon_amount']) ? $orderCompute['coupon_amount'] : false;
$salePrice = isset($orderCompute['discount_amount']) ? $orderCompute['discount_amount'] : $payReturn['shopping_cart_data']['discount_amount'];
$price = isset($orderCompute['last_order_amount']) ? $orderCompute['last_order_amount'] : $payReturn['shopping_cart_data']['last_order_amount'];
$result['sumPrice'] = Helpers::transPrice($sumPrice);
$result['salePrice'] = Helpers::transPrice($salePrice);
$result['price'] = Helpers::transPrice($price);
$result['freight'] = $freight;
$result['couponPrice'] = $couponPrice;*/
}
// 发票有关数据
... ... @@ -498,7 +475,7 @@ class CartModel
// 优惠券数据
$coupons = array();
!empty($orderCompute['coupon_amount']) && $coupons['value'] = $orderInfo['couponValue'];
!empty($orderCompute['coupon_amount']) && $coupons['couponName'] = $orderInfo['couponName'];
$coupons += self::getCouponList($uid, true);
$result['coupon'] = $coupons;
}
... ...
... ... @@ -316,7 +316,7 @@ class UserModel
} else {
$data = $records['data']['product_list'];
foreach ($data as &$val) {
$val['link'] = isset($val['goodsId']) ? Helpers::url('/product/pro_' . $val['product_skn'] . '_' . $val['goodsId'] . '/' . $val['cnAlphabet'] . '.html') : '';
$val['link'] = Helpers::url('/product/show_' . $val['product_skn'] . '.html');
$val['image'] = !empty($val['image']) ? Helpers::getImageUrl($val['image'], 447, 596) : '';
$val['sales_price'] = Helpers::transPrice($val['sales_price']);
$val['market_price'] = ($val['market_price'] - $val['sales_price'] > 0) ? $val['market_price'] . '.00' : false;
... ...
... ... @@ -186,7 +186,7 @@ class DetailModel
// 商品的尺码列表
if (isset($value['goodsSizeBoList'])) {
foreach ($value['goodsSizeBoList'] as $size) {
$sizeList[$value['colorId']][] = array(
$sizeList[$value['productSkc']][] = array(
'id' => $size['id'],
'skuId' => $size['goodsSizeSkuId'],
'goodsId' => $size['goodsId'],
... ... @@ -214,9 +214,9 @@ class DetailModel
$thumbImageList[] = array('img' => Helpers::getImageUrl($value['colorImage'], 60, 60));
// 添加尺码对应的各个颜色的库存量
foreach ($sizeList as $colorId => $sizeArr) {
foreach ($sizeList as $skc => $sizeArr) {
foreach ($sizeArr as $key => $value) {
$sizeList[$colorId][$key]['colorNumStr'] = implode('/', array_values($colorStorageGroup[$value['name']]));
$sizeList[$skc][$key]['colorNumStr'] = implode('/', array_values($colorStorageGroup[$value['name']]));
}
}
... ... @@ -226,7 +226,7 @@ class DetailModel
// 格式化尺码对应的各个颜色分组
foreach ($colorGroup as $value) {
$sizeGroup[]['size'] = $sizeList[ $value['id'] ];
$sizeGroup[]['size'] = $sizeList[ $value['skcId'] ];
}
// 商品图: 多个
... ...
... ... @@ -79,7 +79,7 @@ class IndexController extends AbstractAction
$result = array();
if ($this->isAjax()) {
$uid = $this->getUid(true);
$uid = $this->getUid(false);
$shoppingKey = Helpers::getShoppingKeyByCookie();
$result = CartModel::getCartCount($uid, $shoppingKey);
}
... ... @@ -149,7 +149,7 @@ class IndexController extends AbstractAction
$shoppingKey = Helpers::getShoppingKeyByCookie();
$uid = $this->getUid(true);
$cartType = $this->get('cartType', 'ordinary');
$data = array('giftPage' => true);
$data = array('giftPage' => true, 'cartType' => $cartType);
$data += CartModel::getCartData($uid, $shoppingKey, $cartType, true);
// 渲染模板
... ... @@ -167,7 +167,7 @@ class IndexController extends AbstractAction
$shoppingKey = Helpers::getShoppingKeyByCookie();
$uid = $this->getUid(true);
$cartType = $this->get('cartType', 'ordinary');
$data = array('advanceBuyPage' => true);
$data = array('advanceBuyPage' => true, 'cartType' => $cartType);
$data += CartModel::getCartData($uid, $shoppingKey, $cartType, false, true);
// 渲染模板
... ... @@ -271,7 +271,7 @@ class IndexController extends AbstractAction
$this->auditJumpLogin();
$this->setTitle('确认订单');
$this->setNavHeader('确认订单', true, false); // 不显示右上角home按钮
$this->setNavHeader('确认订单', Helpers::url('/cart/index/index'), false); // 不显示右上角home按钮
// 购物车商品为空跳转到购物车页面
$shoppingKey = Helpers::getShoppingKeyByCookie();
... ...
... ... @@ -11,19 +11,22 @@ use Plugin\Helpers;
class BackController extends AbstractAction
{
/**
* 通过邮箱找回密码
*/
public function emailAction()
{
$this->setTitle('找回密码-通过邮箱');
$data = array(
'backUrl' => '/signin.html',
'backUrl' => Helpers::url('/signin.html'),
'headerText' => '找回密码',
'isPassportPage' => true,
'backEmail' => true
);
// 生成HTML (emailback.html)
$this->_view->html('emailback');
//$this->_view->html('emailback');
$this->_view->display('email', $data);
}
... ... @@ -33,30 +36,26 @@ class BackController extends AbstractAction
public function sendemailAction()
{
$result = array('code' => 400, 'message' => '邮箱格式不正确,请重新输入', 'data' => '');
do
{
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
if (!$this->isAjax()) {
break;
}
$email = $this->post('email', '');
// 判断邮箱是否有效
if(!Helpers::verifyEmail($email))
{
if (!Helpers::verifyEmail($email)) {
break;
}
// 发送邮箱验证码
$result = BackData::sendCodeToEmail($email);
if($result['code'] === 200)
{
$result['data'] = '/passport/back/success?email='.$email;
if ($result['code'] === 200) {
$result['data'] = Helpers::url('/passport/back/resendemail', array(
'email' => $email,
));
}
}
while (false);
} while (false);
$this->echoJson($result);
}
... ... @@ -67,10 +66,8 @@ class BackController extends AbstractAction
public function resendemailAction()
{
$result = array('code' => 400, 'message' => '重发邮件失败');
do
{
if(!$this->isAjax())
{
do {
if (!$this->isAjax()) {
break;
}
... ... @@ -79,17 +76,17 @@ class BackController extends AbstractAction
// 发送邮箱验证码
$return = BackData::sendCodeToEmail($email);
if(!empty($return))
{
if (!empty($return)) {
$result = $return;
}
}
while(false);
} while (false);
$this->echoJson($result);
}
/**
* 邮箱找回密码-成功
*/
public function successAction()
{
$email = $this->get('email', '');
... ... @@ -97,18 +94,20 @@ class BackController extends AbstractAction
if (!Helpers::verifyEmail($email)) {
$this->error();
}
// 获取到邮箱域名
list($name, $domain) = explode('@', $email);
$domain_name = 'http://' . (($domain == 'gmail.com') ? 'mail.google.com' : 'mail.' . $domain);
$data = array(
'backUrl' => '/emailback.html',
'backUrl' => Helpers::url('/emailback.html'),
'headerText' => '找回密码',
'isPassportPage' => true,
'backEmailSuccess' => true,
'goEmail' => $domain_name,
'resendUrl' => '/passport/back/resendemail?email='.$email
'resendUrl' => Helpers::url('/passport/back/resendemail', array(
'email' => $email,
)),
);
$this->setTitle('找回密码-通过邮箱');
... ... @@ -122,32 +121,28 @@ class BackController extends AbstractAction
*/
public function passwordByEmailAction()
{
if($this->isAjax())
{
if ($this->isAjax()) {
$pwd = $this->post('password', '');
$code = $this->post('code', '');
$data = BackData::modifyPasswordByEmail($pwd, $code);
$result = array('code'=>200, 'data' => '/signin.html');
print_r($data);
if(strpos($data, 'history.back') !== false)
{
$result = array('code' => 200, 'data' => Helpers::url('/signin.html') );
if (strpos($data, 'history.back') !== false) {
$result['code'] = 400;
$result['message'] = '修改失败';
}
$this->echoJson($result);// 前端不需要判断结果
$this->echoJson($result); // 前端不需要判断结果
}
}
public function mobileAction()
{
$this->setTitle('找回密码-通过手机号');
$data = array(
'backUrl' => '/signin.html',
'backUrl' => Helpers::url('/signin.html'),
'headerText' => '找回密码',
'isPassportPage' => true,
'backMobile' => true,
... ... @@ -157,7 +152,7 @@ class BackController extends AbstractAction
// 生成HTML (phoneback.html)
// $this->_view->html('phoneback');
$this->_view->display('mobile', $data);
}
... ... @@ -167,35 +162,31 @@ class BackController extends AbstractAction
public function sendcodeAction()
{
$result = array('code' => 400, 'message' => '密码只能使用数字、字母和半角标点符号,请重新输入', 'data' => '');
do
{
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
if (!$this->isAjax()) {
break;
}
$phoneNum = $this->post('phoneNum', '');
$areaCode = $this->post('areaCode', 86);
if(!Helpers::verifyMobile($phoneNum))
{
if (!Helpers::verifyMobile($phoneNum)) {
break;
}
// 发送手机验证码
$result = BackData::sendCodeToMobile($phoneNum, $areaCode);
if(empty($result))
{
if (empty($result)) {
break;
}
if($result['code'] === 200)
{
$result['data'] = '/passport/back/mobilecode?phoneNum='.$phoneNum.'&areaCode='.$areaCode;
}
}
while (false);
if ($result['code'] === 200) {
$result['data'] = Helpers::url('/passport/back/mobilecode', array(
'phoneNum' => $phoneNum,
'areaCode' => $areaCode,
));
}
} while (false);
$this->echoJson($result);
}
... ... @@ -207,10 +198,10 @@ class BackController extends AbstractAction
{
$phoneNum = $this->get('phoneNum', '');
$areaCode = $this->get('areaCode', 86);
$areaCode = '+'.$areaCode;
$areaCode = '+' . $areaCode;
$data = array(
'backUrl' => '/phoneback.html',
'backUrl' => Helpers::url('/phoneback.html'),
'headerText' => '找回密码',
'isPassportPage' => true,
'backCode' => true,
... ... @@ -229,23 +220,28 @@ class BackController extends AbstractAction
*/
public function verifycodeAction()
{
if($this->isAjax())
{
if ($this->isAjax()) {
$phoneNum = $this->post('phoneNum', '');
$code = $this->post('code', '');
$areaCode = $this->post('areaCode', 86);
// 校验手机验证码
$result = BackData::validateMobileCode($phoneNum, $code, $areaCode);
if($result['code'] === 200)
{
$result['data'] = '/passport/back/backcode?phoneNum='.$phoneNum.'&token='.$result['data']['token'].'&areaCode='.$areaCode;
if ($result['code'] === 200) {
$result['data'] = Helpers::url('/passport/back/backcode', array(
'phoneNum' => $phoneNum,
'token' => $result['data']['token'],
'areaCode' => $areaCode,
));
}
$this->echoJson($result);
}
}
/**
* 找回密码
*/
public function backcodeAction()
{
$phoneNum = $this->get('phoneNum', '');
... ... @@ -260,9 +256,9 @@ class BackController extends AbstractAction
if ((!$token || !Helpers::verifyMobile($phoneNum)) && !$code) {
$this->error();
}
$data = array(
'backUrl' => '/signin.html',
'backUrl' => Helpers::url('/signin.html'),
'headerText' => '找回密码',
'isPassportPage' => true,
'backNewPwd' => true,
... ... @@ -283,8 +279,7 @@ class BackController extends AbstractAction
*/
public function passwordByMobileAction()
{
if($this->isAjax())
{
if ($this->isAjax()) {
$phoneNum = $this->post('phoneNum', '');
$token = $this->post('token', '');
$newpwd = $this->post('password', '');
... ... @@ -292,12 +287,12 @@ class BackController extends AbstractAction
// 根据手机验证码修改密码
$result = BackData::modifyPasswordByMobile($phoneNum, $token, $newpwd, $areaCode);
if($result['code'] === 200)
{
$result['data'] = '/';
if ($result['code'] === 200) {
$result['data'] = Helpers::url('/signin.html');
}
$this->echoJson($result);
}
}
}
\ No newline at end of file
}
... ...
... ... @@ -17,8 +17,7 @@ class BindController extends AbstractAction
public function indexAction()
{
$refer = $this->get('refer');
if (!empty($refer))
{
if (!empty($refer)) {
$this->setCookie('refer', $refer);
}
... ... @@ -50,6 +49,7 @@ class BindController extends AbstractAction
public function codeAction()
{
$this->setTitle('验证手机');
$openId = $this->get('openId');
$sourceType = $this->get('sourceType');
$nickname = $this->get('nickname');
... ... @@ -101,16 +101,16 @@ class BindController extends AbstractAction
$this->_view->display('password', $data);
}
//绑定前手机号校验
/**
* 绑定前手机号校验
*/
public function bindCheckAction()
{
$data = array('code' => 400, 'message' => '', 'data' => '');
do
{
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
if (!$this->isAjax()) {
break;
}
... ... @@ -121,73 +121,73 @@ class BindController extends AbstractAction
$nickname = $this->post('nickname');
if (!is_numeric($phoneNum) || !$openId || !$areaCode || !$sourceType)
{
if (!is_numeric($phoneNum) || !$openId || !$areaCode || !$sourceType) {
break;
}
$res = BindData::bindCheck($phoneNum, $openId, $sourceType);
if (!isset($res['code']))
{
if (!isset($res['code'])) {
break;
}
if ($res['code'] == 200)
{
$next = Helpers::url('/passport/bind/code', array('isReg' => $res['data']['is_register'], 'openId' => $openId, 'sourceType' => $sourceType, 'nickname' => $nickname, 'areaCode' => $areaCode, 'phoneNum' => $phoneNum));
if ($res['code'] == 200) {
$next = Helpers::url('/passport/bind/code', array(
'isReg' => $res['data']['is_register'],
'openId' => $openId,
'sourceType' => $sourceType,
'areaCode' => $areaCode,
'phoneNum' => $phoneNum,
'nickname' => $nickname,
));
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('isReg' => $res['data']['is_register'], 'next' => $next));
}
else
{
}
else {
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => isset($res['data']) ? $res['data'] : '');
}
}
while (false);
} while (false);
$this->echoJson($data);
}
//发送验证码
/**
* 发送验证码
*/
public function sendBindMsgAction()
{
$data = array('code' => 400, 'message' => '', 'data' => '');
do
{
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
if (!$this->isAjax()) {
break;
}
$phoneNum = $this->post('phoneNum');
$areaCode = $this->post('areaCode');
if (!is_numeric($phoneNum) || !$areaCode)
{
if (!is_numeric($phoneNum) || !$areaCode) {
break;
}
$data = BindData::sendBindMsg($areaCode, $phoneNum);
if (!isset($data['code']))
{
if (!isset($data['code'])) {
break;
}
}
while (false);
} while (false);
$this->echoJson($data);
}
//校验短信验证码
/**
* 校验短信验证码
*/
public function checkBindMsgAction()
{
$data = array('code' => 400, 'message' => '', 'data' => '');
do
{
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
if (!$this->isAjax()) {
break;
}
... ... @@ -195,32 +195,29 @@ class BindController extends AbstractAction
$code = $this->post('code');
$areaCode = $this->post('areaCode');
if (!is_numeric($phoneNum) || !$code || !$areaCode)
{
if (!is_numeric($phoneNum) || !$code || !$areaCode) {
break;
}
$data = BindData::checkBindCode($areaCode, $phoneNum, $code);
if (!isset($data['code']))
{
if (!isset($data['code'])) {
break;
}
}
while (false);
} while (false);
$this->echoJson($data);
}
//绑定手机号
/**
* 绑定手机号
*/
public function bindMobileAction()
{
$data = array('code' => 400, 'message' => '', 'data' => '');
do
{
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
if (!$this->isAjax()) {
break;
}
... ... @@ -231,88 +228,78 @@ class BindController extends AbstractAction
$nickname = $this->post('nickname');
$password = $this->post('password');
if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode)
{
if (!is_numeric($phoneNum) || !$openId || !$sourceType || !$areaCode) {
break;
}
$res = BindData::bindMobile($openId, $nickname, $sourceType, $phoneNum, $areaCode, $password);
if (!isset($res['code']))
{
if (!isset($res['code'])) {
break;
}
//绑定成功,跳转页面
$refer = $this->getCookie('refer');
if (empty($refer))
{
if (empty($refer)) {
$refer = SITE_MAIN . '/?go=1';
}
else
{
}
else {
$refer = rawurldecode($refer);
}
if (isset($res['code']) && $res['code'] == 200 && !empty($res['data']['uid']))
{
if (isset($res['code']) && $res['code'] == 200 && !empty($res['data']['uid'])) {
$token = Helpers::makeToken($res['data']['uid']);
$this->setCookie('_TOKEN', $token);
$this->setSession('_TOKEN', $token);
$refer = Helpers::syncUserSession($res['data']['uid'], $refer);
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('refer' => $refer));
}
else
{
}
else {
$data = array('code' => $res['code'], 'message' => $res['message'], 'data' => array('refer' => $refer));
}
}
while (false);
} while (false);
$this->echoJson($data);
}
//换绑check
/**
* 换绑check
*/
public function changeCheckAction()
{
$data = array('code' => 400, 'message' => '', 'data' => '');
do
{
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
if (!$this->isAjax()) {
break;
}
$phoneNum = $this->post('phoneNum');
$areaCode = $this->post('areaCode');
if (!is_numeric($phoneNum) || !$areaCode)
{
if (!is_numeric($phoneNum) || !$areaCode) {
break;
}
$data = BindData::changeCheck($phoneNum, $areaCode);
if (!isset($data['code']))
{
if (!isset($data['code'])) {
break;
}
}
while (false);
} while (false);
$this->echoJson($data);
}
//换绑mobile
/**
* 换绑mobile
*/
public function changeMobileAction()
{
$data = array('code' => 400, 'message' => '', 'data' => '');
do
{
do {
/* 判断是不是AJAX请求 */
if (!$this->isAjax())
{
if (!$this->isAjax()) {
break;
}
$uid = $this->getUid(true);
... ... @@ -320,18 +307,15 @@ class BindController extends AbstractAction
$areaCode = $this->post('areaCode');
$code = $this->post('code');
if (!is_numeric($phoneNum) || !$areaCode || !$code || !$uid)
{
if (!is_numeric($phoneNum) || !$areaCode || !$code || !$uid) {
break;
}
$data = BindData::changeMobile($uid, $phoneNum, $areaCode, $code);
if (!isset($data['code']))
{
if (!isset($data['code'])) {
break;
}
}
while (false);
} while (false);
$this->echoJson($data);
}
... ...
... ... @@ -61,6 +61,7 @@ class LoginController extends AbstractAction
$data['isPassportPage'] = true; // 模板中模块标识
$data['areaCode'] = '+86'; // 默认区号
$data['countrys'] = RegData::getAreasData(); // 地区信息列表
// 渲染模板
$this->_view->display('international', $data);
}
... ... @@ -146,6 +147,8 @@ class LoginController extends AbstractAction
*/
public function alipayAction()
{
$this->setSession('_TOKEN', '');
Factory::create('alipay')->getAuthorizeUrl();
exit();
... ... @@ -156,6 +159,8 @@ class LoginController extends AbstractAction
*/
public function qqAction()
{
$this->setSession('_TOKEN', '');
Factory::create('qqconnect')->getAuthorizeUrl();
exit();
... ... @@ -166,6 +171,8 @@ class LoginController extends AbstractAction
*/
public function sinaAction()
{
$this->setSession('_TOKEN', '');
$this->go(Factory::create('sinaweibo')->getAuthorizeUrl());
}
... ...
... ... @@ -81,7 +81,8 @@ class RegController extends AbstractAction
$area = $this->get('areaCode', '86');
// 判断是否允许访问, 不允许则跳转到错误页面
if (!is_string($token) || !is_numeric($mobile) || !is_numeric($area) || !Helpers::verifyToken($mobile, $token)) {
if (!is_string($token) || !is_numeric($mobile) || !is_numeric($area)
|| !Helpers::verifyToken($mobile, $token)) {
$this->error();
}
... ...