123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <!--pages/cart/index.wxml-->
- <n-pop-right open="{{true}}" bind:disagree="handleAuthDisagree" bind:ok="handleAuthOK" />
- <view>
- <!-- <view wx:if="{{loading}}">
- <t-loading t-class="page-loading" theme="circular" size="40rpx" loading t-class-indicator="t-class-indicator">
- <span slot="text" class="loading-text">加载中...</span>
- </t-loading>
- </view> -->
- <view class="d-flex flex-column" style="min-height: 800rpx;">
- <block wx:if="{{cartData.isNotEmpty}}">
- <template is="address" data="{{address: addr.name}}" />
- <template is="cartlist" data="{{cart: cartData, cartGoods: cartGoods, invalids: _invalidGoods, container: container }}" />
- </block>
- <template is="cartempty" wx:else />
- </view>
- <view class="pt-4 text-md gray-2" wx:if="{{favList && favList.length > 0}}" style="background-color: #f5f5f5;">
- <view class="px-4 pb-4">猜你喜欢</view>
- <view class="d-flex align-items-start pb-5">
- <t-icon name="chevron-left" style="margin-top: 160rpx;" />
- <view class="flex-1 overflow-hidden">
- <scroll-view scroll-x style="white-space: nowrap;" bindscrolltolower="handleReachBottom">
- <view class="d-flex pb-2" style="column-gap: 30rpx;">
- <view wx:for="{{favList}}" wx:for-item="item" wx:key="index">
- <n-good-card id="fav-gd-{{index}}" data="{{item}}" currency="{{item.currency || '¥'}}" thresholds="{{thresholds}}" class="goods-card-inside" data-index="{{index}}" bind:thumb="onClickGoodsThumb" bind:click="gotoGoodsDetail" bind:add-cart="onAddCart" />
- </view>
- <view style="padding-top: 150rpx;" wx:if="{{loadMoreStatus !== 2}}">
- <t-loading />
- </view>
- </view>
- </scroll-view>
- </view>
- <t-icon name="chevron-right" style="margin-top: 160rpx;" />
- </view>
- </view>
- </view>
- <n-goods-specs-popup id="goodsSpecsPopup" show="{{isSpuSelectPopupShow}}" title="{{details.title || ''}}" src="{{specImg ? specImg : primaryImage}}" specList="{{details.specList || []}}" skuList="{{skuArray}}" limitBuyInfo="{{details.limitInfo[0].text || ''}}" limitMaxCount="{{limitMaxCount}}" limitMinCount="{{limitMinCount}}" limitBuyInfo="{{limitBuyInfo}}" bind:closeSpecsPopup="handlePopupHide" bind:change="chooseSpecItem" bind:specsConfirm="specsConfirm" isStock="{{isStock}}" outEditStatus="{{outEditStatus}}">
- <view slot="goods-price">
- <view class="popup-sku__price">
- <n-price price="{{isAllSelectedSku ? selectSkuSellPrice : minSalePrice }}" wr-class="goods-price" symbol-class="popup-sku__price-symbol" class="mr-2" />
- <n-price price="{{isAllSelectedSku ? selectSkuLinePrice : minLinePrice}}" wr-class="goods-del" type="delthrough" />
- </view>
- </view>
- </n-goods-specs-popup>
- <t-toast id="t-toast" />
- <n-wait loading="{{wait}}" />
- <template name="address">
- <view class="d-flex px-3 py-2 text-sm gray-3">
- <view class="pr-2 shrink-0">配送至</view>
- <view class="flex-1 text-single">
- {{address && address.length > 0 ? address : "未设置"}}
- </view>
- <view class="ml-2 linkbtn d-flex align-items-center shrink-0" hover-class="linkbtn-active" catchtap="gotoAddr">
- <t-icon name="edit" />
- <view class="pl-1">管理</view>
- </view>
- <view class="ml-2 linkbtn d-flex align-items-center shrink-0" hover-class="linkbtn-active" catchtap="reload">
- <t-icon name="refresh" />
- <view class="pl-1">刷新</view>
- </view>
- </view>
- </template>
- <template name="cartempty">
- <view class="pt-7">
- <image src="/assets/cart/empty.jpg" mode="aspectFit" style="width: 750rpx;" bindtap="gotoList" />
- </view>
- </template>
- <template name="cartlist">
- <view class="cartwrap">
- <view class="flex-1">
- <template is="cartgroup" data="{{goods: cartGoods, invalids: invalids}}" />
- </view>
- <t-sticky container="{{ container }}">
- <n-cart-bar is-all-selected="{{cart.isAllSelected}}" total-amount="{{cart.totalAmount}}" total-goods-num="{{cart.selectedGoodsCount || 0}}" total-discount-amount="{{cart.totalDiscountAmount}}" fixed="{{false}}" bottomHeight="{{114}}" bindhandleSelectAll="onSelectAll" bindhandleToSettle="onToSettle" />
- </t-sticky>
- </view>
- </template>
- <template name="cartgroup">
- <view class="cart-group">
- <view class="goods-wrap">
- <!-- <block wx:for="{{goods}}" wx:for-item="good" wx:for-index="goodindex" wx:key="goodindex"> -->
- <!-- <view class="promotion-wrap" wx:if="{{handlePromotion.hasPromotion(promotion.promotionCode)}}" bindtap="gotoBuyMore" data-promotion="{{promotion}}">
- <view class="promotion-title">
- <view class="promotion-icon">{{promotion.tag}}</view>
- <view class="promotion-text">{{promotion.description}}</view>
- </view>
- <view class="promotion-action action-btn" hover-class="action-btn--active">
- <view class="promotion-action-label">
- {{promotion.isNeedAddOnShop == 1 ? '去凑单' : '再逛逛'}}
- </view>
- <t-icon name="chevron-right" size="32rpx" color="#BBBBBB" />
- </view>
- </view> -->
- <view class="goods-item" wx:for="{{goods}}" wx:for-item="goods" wx:for-index="gi" wx:key="extKey">
- <n-swipe-out right-width="{{ 72 }}">
- <view class="goods-item-info">
- <view class="check-wrap" catchtap="selectGoods" data-goods="{{goods}}" data-gi="{{gi}}" data-promoindex="{{promoindex}}">
- <t-icon size="40rpx" color="{{goods.isSelected ? 'rgba(0, 0, 0, 0.8)' : '#BBBBBB'}}" name="{{goods.isSelected ? 'check-circle-filled' : 'circle'}}" class="check" />
- </view>
- <view class="goods-sku-info">
- <view class="imageWrap" data-goods="{{goods}}" catchtap="gotoGoods">
- <view class="stock-mask" wx:if="{{goods.shortageStock || goods.stockQuantity <= 3}}">
- 仅剩{{goods.stockQuantity}}件
- </view>
- <t-image class="imgfix" t-class="thumb" src="{{goods.skuImage && goods.skuImage.length < 0 ? goods.skuImage : goods.goodImage}}" mode="aspectFit" />
- </view>
- <view class="flex-1 px-3 d-flex flex-column">
- <view class="flex-1 pb-2">
- <view class="text-sm thumb-title"><text>{{goods.title}}
- </text></view>
- <view class="thumb-tag" catchtap="onChangeSpec" data-gi="{{gi}}" data-goods="{{goods}}">
- <view> {{goods.skuTitle}}</view>
- <t-icon name="chevron-down" />
- </view>
- </view>
- <view>
- <n-price price="{{goods.price || '0'}}" fill="{{false}}" decimalSmaller />
- </view>
- </view>
- <view class="goods-stepper">
- <t-stepper classname="stepper-info" value="{{goods.buyNum}}" min="{{1}}" max="{{999}}" data-goods="{{goods}}" data-gi="{{gi}}" data-si="{{si}}" catchchange="onChangeStepper" catchblur="onBlurStepper" catchoverlimit="overlimit" theme="grey" />
- </view>
- </view>
- </view>
- <view slot="right" class="swiper-right-del" catchtap="onDeleteGoods" data-gi="{{gi}}" data-goods="{{goods}}">
- 删除
- </view>
- </n-swipe-out>
- </view>
- <!-- </block> -->
- </view>
- </view>
- </template>
- <wxs module="sw">
- var stringify = function (v) {
- return JSON.stringify(v)
- }
- var join = function (v) {
- return v.join(",")
- }
- module.exports = {
- stringify: stringify,
- join: join
- }
- </wxs>
|