<view id="head" />
<swiper class='swiper' style="height: {{height}}px;" current='{{ content.datatype -1 }}' circular bindchange='swiperChange'>
    <swiper-item class='swiper-item' wx:for='{{list}}' item-id='{{item.datatype}}' wx:key="type">
        <Yl_ListBox id='ListBox{{item.datatype}}' bind:getlist='getList'>
            <view style="width: 100vw;">
                <view class="global-card panel">
                    <view class="head">
                        <view class="item" catch:tap="openAction">{{language[item.type]||item.type}}<text class="iconfont icon-webxialaxuanxiangjiantou"></text></view>
                        <view class="item" catch:tap="openDateType" style="margin-left: 40rpx;">{{language[content.dateType]||content.dateType}}<text class="iconfont icon-webxialaxuanxiangjiantou"></text></view>
                    </view>
                    <view class="iconfont icon-wenhao explain" catch:tap="showExplain" />
                    <view class="chart">
                        <view class="circle">
                            <view class="circle_left ab" style="{{render.leftRate(item.wcamount)}}" />
                            <view class="circle_right ab" style="{{render.rightRate(item.wcamount)}}" />
                            <view class="circle_text">
                                <text class="name">{{language['目标达成率']||'目标达成率'}}</text>
                                <text class="value">{{item.wcamount}}%</text>
                            </view>
                        </view>
                    </view>
                    <view class="card" bind:tap="toDetail">
                        <view class="title">{{language['实际金额']||'实际金额'}}</view>
                        <view class="price">
                            ￥<text>{{item.amount}}</text>{{language['万']||'万'}}
                        </view>
                        <view class="row">
                            {{language[content.dateType]||content.dateType}}{{language['同比']||'同比'}}：{{item.tbxsje}}%
                            <view wx:if="{{item.tbxsje!=0}}" class="{{item.tbxsje>=0?'increase':'decrease'}}" />
                        </view>
                        <view class="row">
                            {{language[content.dateType]||content.dateType}}{{language['环比']||'环比'}}：{{item.hbxsje}}%
                            <view wx:if="{{item.hbxsje!=0}}" class="{{item.hbxsje>=0?'increase':'decrease'}}" />
                        </view>
                    </view>
                    <view class="card">
                        <view class="title">{{language['目标金额']||'目标金额'}}</view>
                        <view class="price">
                            ￥<text>{{item.target_l}}</text>{{language['万']||'万'}}
                        </view>
                        <view class="row">
                            {{language['目标达成率']||'目标达成率'}}：{{item.wcamount}}%
                        </view>
                        <view class="row">
                            {{language['实际与目标差额']||'实际与目标差额'}}：{{item.unamount}}{{language['万']||'万'}}
                        </view>
                    </view>
                    <view class="card">
                        <view class="title">{{language['累计目标金额']||'累计目标金额'}}</view>
                        <view class="price">
                            ￥<text>{{item.nowTarget_l}}</text>{{language['万']||'万'}}
                        </view>
                        <view class="row">
                            {{language['目标达成率']||'目标达成率'}}：{{item.wcnowTarget_l}}%
                        </view>
                        <view class="row">
                            {{language['实际与目标差额']||'实际与目标差额'}}：{{item.unnowTarget_l}}{{language['万']||'万'}}
                        </view>
                    </view>
                </view>
            </view>
        </Yl_ListBox>
    </swiper-item>
</swiper>

<wxs module="render">
    module.exports = {
        rightRate: function (rate) {
            if (rate - 0 < 50) {
                return 'transform: rotate(' + 3.6 * (rate - 0) + 'deg);';
            } else {
                return 'transform: rotate(0);border-color: var(--assist);';
            }
        },
        leftRate: function (rate) {
            if (rate - 0 >= 50) {
                return 'transform: rotate(' + 3.6 * (rate - 50) + 'deg);';
            }
        }
    }
</wxs>

<van-action-sheet show="{{  actionShow }}" actions="{{ list }}" bind:select='onSelect' bind:cancel='onCancel' bind:click-overlay='onCancel' cancel-text="{{language['取消']||'取消'}}" />
<van-action-sheet show="{{  detaShow }}" actions="{{ dates }}" bind:select='dateOnSelect' bind:cancel='onCancel' bind:click-overlay='onCancel' cancel-text="{{language['取消']||'取消'}}" />