picker.wxml 4.39 KB
<template name="Picker">
    <view class="picker-bg" id="picker-bg" catchtap="pickerTap" disable-scroll='true' catchtouchmove="catchtouchmove" style="display:{{pickerData.view.isShow ? 'block':'none'}}">
        <view class="picker-view">
            <view class="pickerGoodsInfo">
                <image class="img" src="{{pickerData.view.image}}">
                </image>
                <image class="placeholder"></image>
                <view class="goodPrice">
                    <text class="realPrice">{{pickerData.view.goodPrice==='0'?pickerData.view.price:pickerData.view.goodPrice}}</text>
                    <text class="price" style="display:{{pickerData.view.goodPrice==='0'?'none':''}}">{{pickerData.view.price}}</text>
                </view>
            </view>
            <view class="seperatorLine"></view>
            <scroll-view scroll-y="true" style="height: 450rpx;">
            <view class="goodsColor">
                <text class="title">颜色</text>
                <view class="list">
                    <block wx:for="{{pickerData.view.goodsList}}" wx:key="unique">
                    <!--pickerData.view.availableColor[index]?'normalItem':'disableItem'-->
                        <view id="{{index}}" class="{{item.selected?'selectedItem':'normalItem'}}" bindtap="colorTap" data-key="{{item}}">{{item.factory_goods_name}}</view>
                    </block>
                </view>
            </view>
            <view class="seperatorLine"></view>
            <view class="goodsSize">
                <text class="title">尺码</text>
                <view class="list">
                    <block wx:for="{{pickerData.view.sizeList}}" wx:key="unique">
                        <view id="{{index}}" class="{{ item.enable?(item.selected?'selectedItem':'normalItem'):'disableItem'}}" bindtap="sizeTap" data-key="{{item}}" >{{item.size_name}}</view>
                    </block>
                </view>
            </view>
            <view class="seperatorLine"></view>
            <view wx:if='{{!pickerData.view.should_hidden_number_view}}' class="goodsCount">
                <text class="title">数量</text>
	              <view class="stepper">
                    <view bindtap="bindMinus" class='reduceNumberBtn'>
                        <image class='reduceImage' src='{{pickerData.view.minusButtonEnable ? "../shopCart/images/jian_h@2x.png" : "../shopCart/images/jian_disable@2x.png"}}' />
                    </view>
                    <view class='buyNumberText'>
                        {{pickerData.view.buyNumber}}
                    </view>
                    <view bindtap="bindPlus" class='addNumberBtn'>
                        <image class='addImage' src='{{pickerData.view.plusButtonEnable ? "../shopCart/images/and_normal@2x.png" : "../shopCart/images/and_h@2x.png"}}'/>
                    </view>
			          </view>
                <view wx:if="{{pickerData.view.isSoldOutSoon}}" class='soldSoonOut'>
                    即将售罄
                </view>
            </view>
          </scroll-view>

            <view wx:if="{{pickerData.sourceType == 'goodsDetail'}}" class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}" bindtap="{{isloadingForPayment?'':'goPayment'}}" data-type='{{pickerData}}'>
                <text class="title">{{pickerData.view.buyButtonEnable?'确定':'已售罄'}}</text>
            </view>
            
            <view class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}" bindtap='{{pickerData.view.buyButtonEnable?"chooseSizeColorCompleted" : ""}}' wx:elif="{{pickerData.sourceType == 'shopCart'}}">
                <text class="title">{{pickerData.view.buyButtonEnable?'确定':'已售罄'}}</text>
            </view> 
            <view class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}" bindtap='{{pickerData.view.buyButtonEnable?"addShopCart" : ""}}' wx:elif="{{pickerData.sourceType == 'gift'}}">
                <text class="title">{{pickerData.view.buyButtonEnable?'加入购物车':'已售罄'}}</text>
            </view> 
            <view class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}" bindtap='{{pickerData.view.buyButtonEnable?"addShopCart" : ""}}' wx:elif="{{pickerData.sourceType == 'promotionProductList'}}">
                <text class="title">{{pickerData.view.buyButtonEnable?'加入购物车':'已售罄'}}</text>
            </view>    
         </view>
    </view>
</template>