<!--packageF/debt/debtor/debtorShop/debtorShop.wxml-->
<wxs module="add">
    var addA = function addB(a, b) {
        return (a + b).toFixed(2)
    }
    module.exports.addM = addA
</wxs>
<view id="debtorShop">
    <view class="topHead">
        <view class="userbox">
            <view class="img">
                <image src="{{userInfo.avatar}}" alt="" />
            </view>
            <view class="userboxRight">
                <view class="userboxRight_left">
                    <view class="user">{{userInfo.name}}</view>
                </view>
                <view class="userboxRight_right" wx:if="{{jurisdiction}}" catchtap="shopShowTap">店铺切换</view>
            </view>
        </view>
        <view class="navBox">
            <view class="navSearch" catchtap="toSearch">
                <i class="iconfont icon-all_search_2"></i>
                搜索
            </view>
            <view class="navSelect">
                <view class="{{navInd == 0 ? 'home' : 'classView'}}" catchtap="tapNav" data-key="0">
                    首页
                    <view class="line" wx:if="{{navInd == 0}}"></view>
                </view>
                <view class="{{navInd == 1 ? 'home' : 'classView'}} classViewM" catchtap="tapNav" data-key="1">
                    分类
                    <view class="line" wx:if="{{navInd == 1}}"></view>
                </view>
                <view class="{{navInd == 2 ? 'home' : 'classView'}}" catchtap="tapNav" data-key="2" wx:if="{{kid && member_type == 1}}">
                    我的
                    <view class="line" wx:if="{{navInd == 2}}"></view>
                </view>
            </view>
        </view>
    </view>
    <view class="noneIcon" wx:if="{{!jurisdiction}}">
        <image src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/debt/isnone.png" alt="" />
        <view>暂无权限查看~</view>
    </view>
    <block wx:if="{{navInd == 0 && jurisdiction}}">
        <view class="navTab">
            <swiper class="my-swipe">
                <swiper-item wx:if="{{ClassTypeInfo}}">
                    <view class="navTabView_box">
                        <view class="navTabView" wx:for="{{ClassTypeInfo}}" wx:key="index" catchtap="toClassSearch" data-item='{{item}}'>
                            <view class="img">
                                <image src="{{item.thumb_url}}" alt="" />
                            </view>
                            <view class="txt">{{item.name}}</view>
                        </view>
                    </view>
                </swiper-item>
                <swiper-item wx:if="{{navArr.length > 0}}">
                    <view class="navTabView_box">
                        <view class="navTabView" wx:for="{{navArr}}" wx:key="index" catchtap="toClassSearch" data-item='{{item}}'>
                            <view class="img">
                                <image src="{{item.thumb_url}}" alt="" />
                            </view>
                            <view class="txt">{{item.name}}</view>
                        </view>
                    </view>
                </swiper-item>
            </swiper>
        </view>
        <c-sort bind:getSort="sortOut" id="sort" debtId="{{userInfo.debtor_id}}"></c-sort>
    </block>
    <block wx:if="{{navInd == 1 && jurisdiction}}">
        <classify wx:if="{{navInd == 1}}" debtId="{{userInfo.debtor_id}}"></classify>
    </block>
    <block wx:if="{{navInd == 2 && jurisdiction}}">
        <view class="myBox">
            <view class="topOne">
                <view>总提货券</view>
                <view>￥{{add.addM(ThrMemberArr.common_credit,ThrMemberArr.frozen_credit)}}</view>
            </view>
            <view class="topTwo">
                <view class="topTwo_left">
                    <view class="topTwo_left_price">￥{{ThrMemberArr.common_credit}}</view>
                    <view class="topTwo_left_Txt">{{plugin_setting.common_credit_name || '消费账户'}}</view>
                </view>
                <view class="topTwo_left">
                    <view class="topTwo_left_price">￥{{ThrMemberArr.frozen_credit}}</view>
                    <view class="topTwo_left_Txt">{{plugin_setting.frozen_credit_name || "锁定账户"}}</view>
                </view>
            </view>
            <view class="topThr"></view>
            <view class="top_for">
                <view class="top_for_lis" catchtap="toVIP">
                    <i class="iconfont icon-fontclass-huiyuantongbu"></i>
                    <view class="txt">VIP</view>
                </view>
                <view class="top_for_lis" catchtap="toMyorder">
                    <i class="iconfont icon-fontclass-wenzhang"></i>
                    <view class="txt">我的订单</view>
                </view>
                <view class="top_for_lis" catchtap="toDetail">
                    <i class="iconfont icon-fontclass-wenzhangzhongxin"></i>
                    <view class="txt">提货券明细</view>
                </view>
            </view>
        </view>
    </block>
    <van-popup show="{{shopShow}}" position="bottom" custom-style="max-height: 75vh" closeable bind:close='shopCloseTap'>
        <view class="maxShopListBox">
            <view class="shopShowTxt">切换店铺</view>
            <view class="btnlis">
                <view class="left">
                    <!-- <view class="image">
                        <image src="" alt="" />
                    </view> -->
                    <view class="leftTxt">进入主商城</view>
                </view>
                <view class="right" catchtap="goSwitchShopHome">进店</view>
            </view>
            <view class="btnlis_li" wx:for="{{shopListMember}}" wx:key="index" wx:if="{{kid}}">
                <view class="contenlis_top">
                    <view class="contenlis_topLeft">
                        <view class="img">
                            <image src="{{item.has_one_debtor_member.avatar}}" alt="" wx:if="{{item.has_one_debtor_member}}" />
                        </view>
                        <view class="user">
                            <view class="nameTxt" wx:if="{{item.has_one_debtor}}">{{item.has_one_debtor.name}}</view>
                            <view class="time">化债期：{{item.end_time_str}}</view>
                        </view>
                        <view class="shopBtn" catchtap="goSwitchShop" data-item="{{item}}">进店</view>
                    </view>
                </view>
                <view class="contenlis_lis">
                    <view class="contenlis_lisline">
                        <view>总提货券:</view>
                        <view class="contenlis_lisline_Price">￥{{item.sum_credit}}</view>
                    </view>
                    <view class="contenlis_lisline">
                        <view>{{plugin_setting.common_credit_name || '消费账户'}}:</view>
                        <view class="contenlis_lisline_Price">￥{{item.common_credit}}</view>
                    </view>
                    <view class="contenlis_lisline">
                        <view>{{plugin_setting.frozen_credit_name || "锁定账户"}}:</view>
                        <view class="contenlis_lisline_Price">￥{{item.frozen_credit}}</view>
                    </view>
                    <view class="contenlis_lisline">
                        <view>订单数：</view>
                        <view class="contenlis_lisline_Price">{{item.has_many_order_count}}</view>
                    </view>
                </view>
            </view>
            <view wx:if="{{shopListMemberLoadMore && kid}}" catchtap="getSwitchoverList" style="text-align: center;color: #999;padding-bottom: 30rpx;">加载更多</view>
        </view>
    </van-popup>
</view>