Authored by whb

pc的购物车代码

Showing 100 changed files with 73 additions and 36 deletions

Too many changes to show.

To preserve performance only 100 of 100+ files are displayed.

... ... @@ -57,12 +57,13 @@ class CartData
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @param string $shoppingKey 未登录用户唯一识别码
* @param bool $hasPromotion 是否有促销ID
* @return array 购物车接口返回的数据
*/
public static function selectGoods($uid, $sku, $shoppingKey)
public static function selectGoods($uid, $sku, $shoppingKey, $hasPromotion = false)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.selected';
$param['method'] = $hasPromotion ? 'app.Shopping.selectedAndCart' : 'app.Shopping.selected';
$param['product_sku_list'] = $sku;
if (!empty($uid)) {
$param['uid'] = $uid;
... ... @@ -103,12 +104,13 @@ class CartData
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @param string $shoppingKey 未登录用户唯一识别码
* @param bool $hasPromotion 是否有促销ID
* @return array 接口返回的数据
*/
public static function removeFromCart($uid, $sku, $shoppingKey)
public static function removeFromCart($uid, $sku, $shoppingKey, $hasPromotion = false)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.remove';
$param['method'] = $hasPromotion ? 'app.Shopping.removeAndCart' : 'app.Shopping.remove';
$param['product_sku_list'] = $sku;
if (!empty($uid)) {
$param['uid'] = $uid;
... ... @@ -126,12 +128,13 @@ class CartData
*
* @param int $uid 用户ID
* @param string $sku 商品sku列表
* @param bool $hasPromotion 是否有促销ID
* @return array 接口返回的数据
*/
public static function addToFav($uid, $sku)
public static function addToFav($uid, $sku, $hasPromotion = false)
{
$param = Yohobuy::param();
$param['method'] = 'app.Shopping.addfavorite';
$param['method'] = $hasPromotion ? 'app.Shopping.addfavoriteAndCart' : 'app.Shopping.addfavorite';
$param['product_sku_list'] = $sku;
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
... ... @@ -283,6 +286,8 @@ class CartData
if (!empty($redEnvelopes)) {
$param['use_red_envelopes'] = $redEnvelopes;
}
// 控制是否判断YOHO币超出订单金额
$param['check_yohocoin_amount'] = 'Y';
$param['uid'] = $uid;
$param['client_secret'] = Sign::getSign($param);
... ... @@ -377,10 +382,10 @@ class CartData
if (!empty($yohoCoin)) {
$param['use_yoho_coin'] = $yohoCoin;
}
if (!empty($isPreContact)) {
if (!empty($isPreContact) && $isPreContact == 'true') {
$param['is_pre_contact'] = 'Y';
}
if (!empty($isPrintPrice)) {
if (!empty($isPrintPrice) && $isPrintPrice == 'true') {
$param['is_print_price'] = 'Y';
}
$param['remark'] = $remark;
... ...
... ... @@ -92,16 +92,16 @@
</td>
</tr>
{{# productItem}}
<tr class="pre-sell-box" {{#if pid}}data-pid="{{pid}}"{{/if}} {{#if id}}data-id="{{id}}"{{/if}} {{#if skn}}data-skn="{{skn}}"{{/if}} {{#if sku}}data-sku="{{sku}}"{{/if}} {{#if productNum}}data-productnum="{{productNum}}"{{/if}}>
<tr class="pre-sell-box" {{#if pid}}data-pid="{{pid}}"{{/if}} {{#if id}}data-id="{{id}}"{{/if}} {{#if skn}}data-skn="{{skn}}"{{/if}} {{#if sku}}data-sku="{{sku}}"{{/if}} {{#if productNum}}data-productnum="{{productNum}}"{{/if}} {{#if goodsType}}data-goodstype="{{goodsType}}"{{/if}}>
<td>
<div class="pay-pro">
<input class="cart-item-check" type="checkbox" name="" id="" {{#if isChecked}}checked{{/if}}/>
<a class="pay-pro-icon" href="{{link}}">
<input class="cart-item-check" type="checkbox" name="" id="" data-goodstype="{{goodsType}}" {{#if isChecked}}checked{{/if}}/>
<a class="pay-pro-icon" href="{{link}}" target="_blank">
<img src="{{imgCover}}">
<span class="incentive">预售</span>
</a>
<p class="pay-pro-info">
<a href="{{link}}">{{productTitle}}</a>
<a href="{{link}}" target="_blank">{{productTitle}}</a>
<span>颜色:{{productColor}} 尺码:{{productSize}}</span>
<span class="presell">上市期:{{preSellDate}}</span>
</p>
... ... @@ -110,9 +110,18 @@
<td class="productPrice">¥{{productPrice}}</td>
<td>{{yohoIcon}}</td>
<td class="adjust-cart-num">
{{#if isGift}}
<div>{{productNum}}</div>
{{^}}
{{#if isPriceGift}}
<div>{{productNum}}</div>
{{^}}
<span class="minus"></span>
<input type="text" value="{{productNum}}" readonly="readonly"/>
<span class="plus"></span>
<p class="tip-message {{#isTipNoStore}}tipNoStore{{/isTipNoStore}}">{{tipMessage}}</p>
{{/if}}
{{/if}}
</td>
<td class="sub-total">¥{{productSubtotal}}</td>
<td class="cart-operation">
... ... @@ -130,12 +139,10 @@
</td>
</tr>
{{# productItem}}
<tr class="common-sell-box" {{#if pid}}data-pid="{{pid}}"{{/if}} {{#if id}}data-id="{{id}}"{{/if}} {{#if skn}}data-skn="{{skn}}"{{/if}} {{#if sku}}data-sku="{{sku}}"{{/if}} {{#if productNum}}data-productnum="{{productNum}}"{{/if}}>
<tr class="common-sell-box" {{#if pid}}data-pid="{{pid}}"{{/if}} {{#if id}}data-id="{{id}}"{{/if}} {{#if skn}}data-skn="{{skn}}"{{/if}} {{#if sku}}data-sku="{{sku}}"{{/if}} {{#if productNum}}data-productnum="{{productNum}}"{{/if}} {{#if promotionId}}data-promotionid="{{promotionId}}"{{/if}} {{#if goodsType}}data-goodstype="{{goodsType}}"{{/if}}>
<td>
<div class="pay-pro">
{{#unless isGift}}
<input class="cart-item-check" data-goodstype="{{goodsType}}" type="checkbox" name="" id="" {{#if isChecked}}checked{{/if}}/>
{{/unless}}
<input class="cart-item-check {{#if isGift}}none{{/if}}" type="checkbox" name="" id="" {{#if isChecked}}checked{{/if}}/>
<a class="pay-pro-icon {{#if isGift}}giftInfo{{/if}}" href="{{link}}" target="_blank">
<img src="{{imgCover}}">
{{#isPriceGift}}
... ... @@ -248,10 +255,13 @@
</p>
</div>
</td>
<td style="width:13%;"><del style="margin-right: 5px;">{{marketPrice}}</del><span>¥{{subjoinPrice}}</span></td>
<td style="width:13%;">
<del class="wapper-price" style="margin-right: 5px;"{{marketPrice}}</del>
<span class="subjoin-price"{{subjoinPrice}}</span>
</td>
<td style="width:7%;">{{yohoIcon}}</td>
<td style="width:10%;">1</td>
<td class="subjoin-price" style="width:10%;">¥{{subjoinPrice}}</td>
<td style="width:10%;">¥{{subjoinPrice}}</td>
<td style="width:20%; border-right: none;">
{{#isPriceGift}}
<a href="javascript:void(0);" data-id="{{id}}" class="cart-add-btn order"><span></span></a>
... ... @@ -271,7 +281,7 @@
<div class="dev-revocation {{#unless deleteShop}}none{{/unless}}">
<table>
{{#deleteShop}}
<tr data-productnum="{{productNum}}" data-productsku="{{productSku}}">
<tr data-productnum="{{productNum}}" data-productsku="{{productSku}}" data-promotionid="{{promotionId}}">
<td style="width:40%; text-align: left;">成功删除<a class="title" href="{{link}}" target="_blank">{{productTitle}}</a></td>
<td style="width:10%;"><span class="productPrice">{{productPrice}}</span></td>
<td style="width:10%;"></td>
... ...
... ... @@ -31,12 +31,21 @@
<span class="type-s">新品</span>
</div>
<div class="price">
{{#if salePrice}}
<span class="oldprice">原价:<del>{{marketPrice}}</del></span>
<span class="newprice">现价:<b class="promotion-price">{{salePrice}}</b></span>
<span class="oldprice">原价:<del>¥{{marketPrice}}</del></span>
<span class="newprice">现价:<b class="promotion-price">¥{{salePrice}}</b></span>
{{^}}
<span class="newprice">原价:<b class="promotion-price">{{marketPrice}}</b></span>
<span class="newprice {{#presalePrice}}none{{/presalePrice}}">原价:<b class="promotion-price">¥{{marketPrice}}</b></span>
{{/if}}
{{#if presalePrice}}
<span class="oldprice">原价:<del>¥{{marketPrice}}</del></span>
<span class="newprice">预售价:<b class="promotion-price">¥{{presalePrice}}</b></span>
{{/if}}
{{#arrivalDate}}
<span class="arrivalDate">上市期:{{arrivalDate}}</span>
{{/arrivalDate}}
</div>
<div class="order">
<dl>
... ... @@ -109,3 +118,4 @@
</div>
</div>
</div>
<input value="{{addToCart}}" id="addToCart" type="hidden" />
\ No newline at end of file
... ...
... ... @@ -10,7 +10,7 @@
</ul>
</div>
<div class="order-edit-main" id="order-edit-main" cartType="{{cartType}}">
<div class="order-edit-main" id="order-edit-main" {{#isNewUser}}data-new="new"{{/isNewUser}} cartType="{{cartType}}">
<h2 class="title">请填写并核对以下信息
<a href="{{cartUrl}}" class="btn_backcart"></a>
</h2>
... ... @@ -167,7 +167,7 @@
{{/each}}
<div class="express-list express-tips">注:配送会由于天气,交通等不可抗拒的客观因素造成您收货时间延迟,请您知悉。
</div>
<div class="express-list hide is-sup"><a class="sf" target="_blank" href="sfUrl">您所选择的区域暂不在顺风派送范围内</a>,点击查看详情</div>
<div class="express-list hide is-sup"><span class="sf">您所选择的区域暂不在顺风派送范围内,</span><a style="text-decoration: none;" target="_blank" href="{{sfUrl}}">点击查看详情</a></div>
<div class="express-list sf hide">如您购买的商品为航空禁运品顺丰会用陆运的方式给你派送,预计3-5天送达,请您见谅</div>
</div>
</div>
... ... @@ -193,7 +193,15 @@
<tr>
<td>
<div class="pay-pro">
<a class="pay-pro-icon" href="{{link}}"><img src="{{imgCover}}" /></a>
<a class="pay-pro-icon" href="{{link}}">
<img src="{{imgCover}}" />
{{#isPriceGift}}
<span class="incentive">加价购</span>
{{/isPriceGift}}
{{#isGift}}
<span class="gift">赠品</span>
{{/isGift}}
</a>
<p class="pay-pro-info">
<a href="{{link}}" target="_blank">{{productTitle}}</a>
<span>颜色:{{productColor}} 尺码:{{productSize}}</span>
... ... @@ -268,7 +276,7 @@
{{#if showCouponPay}}
<dl class="play-juan-pan pan">
<dt>使用优惠卷支付</dt>
<dt>使用优惠券支付</dt>
<dd>
<div class="play-pan">
<p class="strong">请选择您要使用的优惠券: </p>
... ... @@ -313,14 +321,14 @@
</dd>
</dl>
{{# redEnvelopes}}
{{#if redEnvelopes}}
<div class="red-envelopes active">
<div class="use-envelopes">
<input checked value="0" data-use="{{.}}" type="checkbox" />使用现金红包支付:<span>-¥{{.}}</span>
<input checked value="0" data-all="{{redEnvelopes}}" data-use="{{useRedEnvelopes}}" type="checkbox" />使用现金红包支付:<span>-¥{{useRedEnvelopes}}</span>
</div>
<div class="has-envelopes">您的现金红包余额:<span>0.00</span></div>
<div class="has-envelopes">您的现金红包余额:<span></span></div>
</div>
{{/ redEnvelopes}}
{{/if}}
</div>
</div>
</div>
... ...
... ... @@ -24,7 +24,8 @@ spm_modules
.cache
dist
coverage
css/
# 只忽略当前目录下的css目录,子目录的不忽略
css/*
.sass-cache/
script/nginx/logs/
*.DS_Store
... ...
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
... ... @@ -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 Wed Mar 2 13:38:33 2016
Created by FontForge 20120731 at Wed Mar 9 20:06:33 2016
By Ads
</metadata>
<defs>
... ... @@ -161,10 +161,9 @@ l-531 -530l-70 70zM748 686z" />
<glyph glyph-name="uniE62E" unicode="&#xe62e;" horiz-adv-x="1025"
d="M491 6q9 -10 21.5 -10t21.5 10l357 407q4 5 5.5 9.5t0 8t-6 5.5t-11.5 2h-133q-14 0 -23.5 9.5t-9.5 22.5v261q0 9 -4.5 16.5t-12.5 11.5t-17 4h-333q-14 0 -24 -9.5t-10 -22.5v-261q0 -13 -9.5 -22.5t-23.5 -9.5h-133q-14 0 -17.5 -7.5t5.5 -17.5z" />
<glyph glyph-name="uniE62F" unicode="&#xe62f;"
d="M512 832v-1v1q-51 0 -99 -11t-92.5 -33.5t-71 -38.5t-67.5 -45v-396q0 -50 17 -97t42.5 -82t60.5 -66.5t66.5 -52.5t64.5 -38t50.5 -24.5t28.5 -11.5q7 3 17 7t29 12.5t39 19.5t44.5 26t47.5 33.5t46 40t42 47.5t34 54.5t23 62t8 69.5v396q-23 16 -36.5 25t-38.5 24.5
t-43.5 24.5t-46 20.5t-51.5 18t-54 11t-60 4.5zM772 308q0 -128 -130 -223q-65 -47 -130 -72q-65 25 -130 72q-44 32 -72.5 66.5t-43 73.5t-14.5 83v371q76 46 128.5 65t131.5 20q79 -1 131.5 -20t128.5 -65v-371zM512 710q-59 0 -99 -11t-105 -43v-351q0 -28 8 -53.5
t22.5 -46t30 -37.5t36.5 -31t36 -23.5t33.5 -18t24.5 -11t13 -4.5q9 3 16.5 6t30 14t40.5 22.5t41 31t38.5 40.5t26.5 50.5t11 60.5v351q-27 13 -46 21.5t-38 15.5t-37 10.5t-38 5t-45 1.5v0zM648 573v-42h-92v-58h81v-54h-81v-67h102v-50h-292v50h37v147h57v-147h39v179
h-121v54h270v-12z" />
d="M512 809v0q-58 0 -112.5 -12t-105.5 -38t-80.5 -44t-77.5 -51v-450q0 -57 19.5 -110.5t49 -93.5t69 -76t75.5 -59.5t73.5 -43t57 -28t32.5 -12.5q13 4 32.5 12.5t57 28t73.5 43t75.5 59.5t69 76t49 93.5t19.5 110.5v450q-48 33 -77.5 51t-80.5 44t-105.5 38t-112.5 12z
M808 214q0 -76 -36.5 -138t-112.5 -117q-39 -28 -78.5 -49.5t-68.5 -32.5q-74 29 -147 82q-76 55 -112.5 117t-36.5 138v421q87 53 146.5 75t149.5 23q90 -1 149.5 -23t146.5 -75v-421zM512 671q-46 0 -81.5 -6t-67.5 -18.5t-83 -37.5v-399q0 -35 12.5 -68.5t30 -57.5
t44 -46t47 -35.5t46 -26t34 -16t18.5 -6.5q10 3 18.5 6.5t34 16t46 26t47 35.5t44 46t30 57.5t12.5 68.5v399q-74 37 -119.5 49.5t-112.5 12.5v0zM667 515v-47h-105v-67h92v-61h-92v-77h116v-57h-332v57h42v168h64v-168h46v205h-138v61h307v-14z" />
<glyph glyph-name="uniE630" unicode="&#xe630;" horiz-adv-x="1163"
d="M295 196q67 0 114 -47t47 -113.5t-47 -114t-114 -47.5t-114 47.5t-47 113.5q0 44 21.5 81t58.5 58.5t81 21.5zM917 196q67 0 114 -47t47 -114q0 -32 -12.5 -62t-34 -51.5t-51.5 -34.5t-63 -13q-66 0 -113.5 47.5t-47.5 113.5q0 79 62 127q44 34 99 34zM400 894v-99h-210
v0l-187 -294v-372h95q27 56 80 90.5t117 34.5q43 0 82 -16t68.5 -44t46.5 -65h228q27 56 80 90.5t117 34.5q22 0 43 -4.5t39.5 -12t36 -18.5t32 -25t26.5 -30.5t20 -34.5h46v765h-760zM400 452h-283l159 250l124 1v-251v0zM893 701l-131 -276l-63 31l101 206h-105v68h198
... ... @@ -178,6 +177,10 @@ d="M1020 810q0 34 -24 58t-59 24h-851q-34 0 -58.5 -24t-24.5 -58v-852q0 -34 24.5 -
q16 16 38.5 16t38.5 -16l153 -152l264 264q16 16 39 16t39 -16t16 -38.5t-16 -38.5z" />
<glyph glyph-name="uniE634" unicode="&#xe634;"
d="M637 610l-45 46l-272 -272l272 -272l45 46l-226 226z" />
<glyph glyph-name="uniE635" unicode="&#xe635;"
d="M0 896h1024v-1024h-1024v1024zM85 -43h854v854h-854v-854z" />
<glyph glyph-name="uniE636" unicode="&#xe636;"
d="M1024 -128h-1024v1024h1024v-1024zM947 674l-34 34q-13 13 -30 13t-30 -13l-486 -495l-196 205q-13 13 -30 13t-30 -13l-34 -34q-5 -5 -8.5 -11t-4 -12.5t0 -13t4 -12.5t8.5 -11l256 -256q23 -22 51 -8l6 2l3 6l546 546q18 13 20 30.5t-12 29.5z" />
<glyph glyph-name="uniE637" unicode="&#xe637;"
d="M0 812v-1024h1024v1024h-1024zM983 -171h-942v942h942v-942zM288 280h448q6 0 10.5 2.5t7.5 7t3 10.5q0 8 -6 14t-15 6h-448q-9 0 -15 -6t-6 -14t6 -14t15 -6z" />
<glyph glyph-name="uniE638" unicode="&#xe638;"
... ...