index.wxml 6.33 KB
<wxs src="../../wxs/helper.wxs" module="helper" />

<view class="home-coupon-index">
    <view class="user-info-bar"  hidden='{{isBound}}'> <!--不需要显示用户信息了-->
        <view wx:if="{{!isBound}}">
            <image class="avatar" src="../../static/images/icons/avatar@2x.png"></image>
            <text class="to-login">{{loginText}}</text>
            <login-button class="login-area auto-btn" openType="{{loginButtonType}}"></login-button>
        </view>
        <view wx:if="{{isBound}}">
            <image wx:if="{{userInfo.avatarUrl == ''}}" class="avatar" src="../../static/images/icons/avatar@2x.png"></image>
            <image wx:if="{{userInfo.avatarUrl != '' && userInfo.defaultAvatar}}" class="avatar"
                    src="{{userInfo.avatarUrl}}"></image>
            <image wx:if="{{userInfo.avatarUrl != '' && !userInfo.defaultAvatar}}" class="avatar"
                    src="{{helper.image(userInfo.avatarUrl, 108, 108)}}"></image>
            <text class="phone">{{userInfo.nickName || userInfo.phoneNum}}</text>
            <text class="coin">积分:<text class="num">{{coinNum}}</text></text>
        </view>
    </view>
    <!-- 我的限购码 -->
        <view wx:if="{{isBound}}" class='container {{!limitCodes.invalidCodes.length && !limitCodes.codes.length ? "no-code" : ""}}' style='{{!limitCodes.invalidCodes.length && !limitCodes.codes.length ? "height:" + containerHeight : ""}}'>
            <!--限购码介绍-->
            <view class='desc-container'>
                <block wx:for='{{h5PageUrl}}' wx:key='item.title'>
                    <view class='link-menu' bindtap='navigateToh5Page' data-type='{{index}}'>
                        <text>{{item.title}}</text>
                        <view class='link-arrow'>
                            <image src='../../static/images/limit/arrow.png'></image>
                        </view>
                    </view>
                </block>
                <view class='gray-space'></view>
                <!--灰色的间隔-->
            </view>
            <view wx:if='{{isShow}}' class='limit-code-container'>
                <block wx:if='{{!limitCodes.invalidCodes.length && !limitCodes.codes.length}}'>
                    <view class='icon'>
                        <image src='../../static/images/limit/lock_b.png'></image>
                    </view>
                    <view class='text'>
                        <text>暂无限购码</text>
                    </view>
                    <button class='button' bindtap='navigateToLimitListPage'>随便看看</button>
                </block>
                <block wx:else>
                    <block wx:for='{{limitCodes.codes}}' wx:key='item.limitCode'>
                        <view class='limit-code-item'>
                            <view class='item-container' data-code="{{item.limitProductCode}}" bindtap='navigateToDetail'>
                                <view class='item-head'>
                                    <image src='../../static/images/limit/lock_s.png'></image>
                                    <text>限购码:{{item.limitCode}}</text>
                                </view>
                                <view class='item-content'>
                                    <image src='{{item.defaultUrl}}'></image>
                                    <view class='item-content-info'>
                                        <view class='info-title'>
                                            <text>{{item.productName}}</text>
                                        </view>
                                        <view class='info-uc'>
                                            <text></text>
                                        </view>
                                        <view class='info-price'>
                                            <text>{{item.price}}</text>
                                        </view>

                                    </view>
                                </view>
                            </view>
                        </view>
                        <view class='gray-space'></view>
                        <!--灰色的间隔-->
                    </block>
                    <block wx:if='{{limitCodes.invalidCodes.length}}'>
                        <view class='codes-spliter'>
                            <text>已失效</text>
                        </view>
                        <view class='gray-space'></view>
                    </block>
                    <block wx:for='{{limitCodes.invalidCodes}}' wx:key='item.limitCode'>
                        <view class='limit-code-item'>
                            <view class='item-container'  data-code="{{item.limitProductCode}}" bindtap='navigateToDetail'>
                                <view class='item-head'>
                                    <image src='../../static/images/limit/lock_s.png'></image>
                                    <text>限购码:{{item.limitCode}}</text>
                                    <view class='item-invalid-icon'>
                                        <text>失效</text>
                                    </view>
                                </view>
                                <view class='item-content'>
                                    <image src='{{item.defaultUrl}}'></image>
                                    <view class='item-content-info'>
                                        <view class='info-title'>
                                            <text>{{item.productName}}</text>
                                        </view>
                                        <view class='info-uc'>
                                            <text></text>
                                        </view>
                                        <view class='info-price'>
                                            <text>{{item.price}}</text>
                                        </view>

                                    </view>
                                </view>
                            </view>
                        </view>
                        <view class='gray-space'></view>
                        <!--灰色的间隔-->
                    </block>
                </block>
            </view>
        </view>
    <!--不用显示退出登录了-->
    <view class="out-login" bindtap="outLogin" wx:if="{{userInfo.uid}}" hidden='true'>退出登录</view> 
</view>