picker.ttml 4.56 KB
<view class="picker-bg" id="picker-bg" catchtap="hide" disable-scroll='true' catchtouchmove="catchtouchmove"
     hidden="{{!_show}}">
    <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 tt:for="{{pickerData.view.goodsList}}" tt:key="{{index}}">
                        <!--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 tt:for="{{pickerData.view.sizeList}}" tt:key="{{index}}">
                        <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 tt: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 ? "../../images/jian_h@2x.png" : "../../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 ? "../../images/and_normal@2x.png" : "../../images/and_h@2x.png"}}'/>
                    </view>
                </view>
                <view tt:if="{{pickerData.view.isSoldOutSoon}}" class='soldSoonOut'>
                    即将售罄
                </view>
            </view>
        </scroll-view>

        <view tt: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" : ""}}'
              tt:elif="{{pickerData.sourceType == 'shopCart'}}">
            <text class="title">{{pickerData.view.buyButtonEnable?'确定':'已售罄'}}</text>
        </view>
        <view class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}"
              bindtap='{{pickerData.view.buyButtonEnable?"addShopCart" : ""}}'
              tt:elif="{{pickerData.sourceType == 'gift'}}">
            <text class="title">{{pickerData.view.buyButtonEnable?'加入购物车':'已售罄'}}</text>
        </view>
        <view class="{{pickerData.view.buyButtonEnable?'buyButton':'buyButtonDisable'}}"
              bindtap='{{pickerData.view.buyButtonEnable?"addShopCart" : ""}}'
              tt:elif="{{pickerData.sourceType == 'promotionProductList'}}">
            <text class="title">{{pickerData.view.buyButtonEnable?'加入购物车':'已售罄'}}</text>
        </view>
    </view>
</view>