picker.wxml 4.46 KB
<template name="Picker">
    <view class="picker-bg" id="picker-bg" catchtap="hidePicker" 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">
                            <view id="{{index}}" class="{{item.selected?'selectedItem':'normalItem'}}"
                                  bindtap="chooseColor"
                                  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="chooseSize" 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 ? "../../static/images/jian_h@2x.png" : "../../static/images/jian_disable@2x.png"}}'></image>
                        </view>
                        <view class='buyNumberText'>
                            {{pickerData.view.buyNumber}}
                        </view>
                        <view bindtap="bindPlus" class='addNumberBtn'>
                            <image class='addImage'
                                   src='{{pickerData.view.plusButtonEnable ? "../../static/images/and_normal@2x.png" : "../../static/images/and_h@2x.png"}}'></image>
                        </view>
                    </view>
                    <view wx:if="{{pickerData.view.isSoldOutSoon}}" class='soldSoonOut'>
                        即将售罄
                    </view>
                    <view wx:if="{{pickerData.view.buy_limit_number}}" class='soldSoonOut'>
                        限购{{pickerData.view.buy_limit_number}}件
                    </view>
                    <view wx:if="{{pickerData.view.bundle_count}}" class='soldSoonOut'>
                        {{pickerData.view.bundle_count}}件起售
                    </view>
                </view>
            </scroll-view>

            <view wx:if="{{pickerData.sourceType == 'goodsDetail' && pickerData.view.buyButtonEnable}}"
                  class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}" bindtap="confirmChoose"
                  data-type='{{pickerData}}'>
                <text class="title">确定</text>
            </view>
            <view wx:if="{{pickerData.sourceType == 'goodsDetail' && !pickerData.view.buyButtonEnable}}"
                  class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}" data-type='{{pickerData}}'>
                <text class="title">已售罄</text>
            </view>
        </view>
    </view>
</template>