<template> 
 | 
    <view class="policy"> 
 | 
        <Search :list="cate" @search="getValue" label="保险生效起期" /> 
 | 
        <view class="policy_list"> 
 | 
            <view class="policy_list_item" v-for="(item, index) in list" :key="index" @click="jump(item.id)"> 
 | 
                <view class="item_top" :style="{ background: returnStyle(item.statusCollect) }"> 
 | 
                    <view class="item_top_info"> 
 | 
                        <text>{{item.solutionsName}}</text> 
 | 
                        <text>保单号:{{item.code ? item.code : '-'}}</text> 
 | 
                    </view> 
 | 
                    <view class="item_top_img"> 
 | 
                        <image v-if="item.statusCollect === 2" src="@/static/icon/progress_baozhangzhong@2x.png" mode="widthFix"></image> 
 | 
                        <image v-if="item.statusCollect === 0" src="@/static/icon/progress_daishenhe@2x.png" mode="widthFix"></image> 
 | 
                        <image v-if="item.statusCollect === 7" src="@/static/icon/progress_daiqianshu@2x.png" mode="widthFix"></image> 
 | 
                        <image v-if="item.statusCollect === 1" src="@/static/icon/progress_daichudan@2x.png" mode="widthFix"></image> 
 | 
                        <image v-if="item.statusCollect === 5" src="@/static/icon/progress_shenqingtuihui@2x.png" mode="widthFix"></image> 
 | 
                        <image v-if="item.statusCollect === 4" src="@/static/icon/progress_yituihui@2x.png" mode="widthFix"></image> 
 | 
                        <image v-if="item.statusCollect === 6" src="@/static/icon/progress_yiguanbi@2x.png" mode="widthFix"></image> 
 | 
                        <image v-if="item.statusCollect === 3" src="@/static/icon/progress_yiguoqi@2x.png" mode="widthFix"></image> 
 | 
                    </view> 
 | 
                </view> 
 | 
                <view class="item_center"> 
 | 
                    <view class="item_center_x"></view> 
 | 
                </view> 
 | 
                <view class="item_list"> 
 | 
                    <view class="item_list_item"> 
 | 
                        <view class="item_list_item_label">投保人数:</view> 
 | 
                        <view class="item_list_item_val">{{item.insureNum}}人</view> 
 | 
                    </view> 
 | 
                    <view class="item_list_item"> 
 | 
                        <view class="item_list_item_label">在保时长:</view> 
 | 
                        <view class="item_list_item_val">{{(item.serviceDays - item.loseEfficacyDays) < 0 ? `-` : item.serviceDays - item.loseEfficacyDays + '天'}}</view> 
 | 
                    </view> 
 | 
                    <view class="item_list_item" style="width: 100%;"> 
 | 
                        <view class="item_list_item_label">总费用:</view> 
 | 
                        <view class="item_list_item_val">{{item.fee}}元</view> 
 | 
                    </view> 
 | 
                    <view class="item_list_item" style="width: 100%;"> 
 | 
                        <view class="item_list_item_label">保障日期:</view> 
 | 
                        <view class="item_list_item_val">{{item.startTime}}-{{item.endTime}}</view> 
 | 
                    </view> 
 | 
                </view> 
 | 
            </view> 
 | 
        </view> 
 | 
    </view> 
 | 
</template> 
 | 
  
 | 
<script> 
 | 
    import Search from '@/components/search/search.vue' 
 | 
    export default { 
 | 
        components: { Search }, 
 | 
        data() { 
 | 
            return { 
 | 
                list: [], 
 | 
                next: false, 
 | 
                cate: [ 
 | 
                    { name: '全部', id: '' }, 
 | 
                    { name: '保障中', id: '2' }, 
 | 
                    { name: '待审核', id: '0' }, 
 | 
                    { name: '待签署', id: '7' }, 
 | 
                    { name: '待出单', id: '1' }, 
 | 
                    { name: '已退回', id: '4' }, 
 | 
                    { name: '申请退回', id: '5' }, 
 | 
                    { name: '已关闭', id: '6' }, 
 | 
                    { name: '已过期', id: '3' } 
 | 
                ], 
 | 
                form: { 
 | 
                    solutionName: '', 
 | 
                    startTimeE: '', 
 | 
                    startTimeS: '', 
 | 
                    statusCollect: '' 
 | 
                }, 
 | 
                page: 1 
 | 
            }; 
 | 
        }, 
 | 
        onLoad() { 
 | 
            this.getList() 
 | 
        }, 
 | 
        onReachBottom() { 
 | 
            this.getList() 
 | 
        }, 
 | 
        methods: { 
 | 
            jump(id) { 
 | 
                uni.navigateTo({ 
 | 
                    url: `/pages/policyDetails/policyDetails?orderId=${id}` 
 | 
                }) 
 | 
            }, 
 | 
            getValue(obj) { 
 | 
                this.next = false 
 | 
                this.page = 1 
 | 
                this.list = [] 
 | 
                this.form.solutionName = obj.name 
 | 
                this.form.startTimeE = obj.startTime 
 | 
                this.form.startTimeS = obj.endTime 
 | 
                this.form.statusCollect = obj.status 
 | 
                this.getList() 
 | 
            }, 
 | 
            returnStyle(type) { 
 | 
                if ([2].includes(type)) { 
 | 
                    return 'linear-gradient( 180deg, #E5F7F1 0%, rgba(255,255,255,0) 100%);' 
 | 
                } else if ([0,7,1].includes(type)) { 
 | 
                    return 'linear-gradient( 180deg, #FFF2E3 0%, rgba(255,255,255,0) 100%);' 
 | 
                } else if ([5,4,6,3].includes(type)) { 
 | 
                    return '#ffffff' 
 | 
                } 
 | 
            }, 
 | 
            getList() { 
 | 
                if (this.next) return 
 | 
                this.$u.api.insuranceApplyPage({ 
 | 
                    capacity: 10, 
 | 
                    page: this.page, 
 | 
                    model: this.form 
 | 
                }).then(res => { 
 | 
                    if (res.code === 200) { 
 | 
                        if (res.data.records.length > 0) { 
 | 
                            this.page++ 
 | 
                            this.list.push(...res.data.records) 
 | 
                        } else { 
 | 
                            this.next = true 
 | 
                        } 
 | 
                    } 
 | 
                }) 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
</script> 
 | 
<style> 
 | 
    page { 
 | 
        background-color: #F7F7F7; 
 | 
    } 
 | 
</style> 
 | 
<style lang="scss" scoped> 
 | 
    .policy { 
 | 
        width: 100%; 
 | 
        .policy_list { 
 | 
            width: 100%; 
 | 
            padding: 20rpx 30rpx; 
 | 
            box-sizing: border-box; 
 | 
            .policy_list_item { 
 | 
                margin-top: 20rpx; 
 | 
                width: 100%; 
 | 
                background: #ffffff; 
 | 
                border-radius: 16rpx; 
 | 
                overflow: hidden; 
 | 
                &:first-child { 
 | 
                    margin-top: 0 !important; 
 | 
                } 
 | 
                .item_top { 
 | 
                    width: 100%; 
 | 
                    height: 144rpx; 
 | 
                    padding: 30rpx; 
 | 
                    box-sizing: border-box; 
 | 
                    display: flex; 
 | 
                    align-items: center; 
 | 
                    justify-content: space-between; 
 | 
                    .item_top_info { 
 | 
                        flex: 1; 
 | 
                        height: 100rpx; 
 | 
                        display: flex; 
 | 
                        flex-direction: column; 
 | 
                        text { 
 | 
                            &:nth-child(1) { 
 | 
                                font-weight: 500; 
 | 
                                font-size: 32rpx; 
 | 
                                color: #222222; 
 | 
                            } 
 | 
                            &:nth-child(2) { 
 | 
                                font-weight: 400; 
 | 
                                font-size: 26rpx; 
 | 
                                color: #777777; 
 | 
                                font-style: normal; 
 | 
                                margin-top: 8rpx; 
 | 
                            } 
 | 
                        } 
 | 
                    } 
 | 
                    .item_top_img { 
 | 
                        width: 100rpx; 
 | 
                        height: 100rpx; 
 | 
                        image { 
 | 
                            width: 100%; 
 | 
                            height: 100%; 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
                .item_center { 
 | 
                    width: 100%; 
 | 
                    padding: 0 30rpx; 
 | 
                    box-sizing: border-box; 
 | 
                    .item_center_x { 
 | 
                        width: 100%; 
 | 
                        border-top: 1rpx dashed #E5E5E5; 
 | 
                    } 
 | 
                } 
 | 
                .item_list { 
 | 
                    width: 100%; 
 | 
                    display: flex; 
 | 
                    align-items: center; 
 | 
                    flex-wrap: wrap; 
 | 
                    padding: 30rpx; 
 | 
                    box-sizing: border-box; 
 | 
                    .item_list_item { 
 | 
                        width: 50%; 
 | 
                        display: flex; 
 | 
                        align-items: flex-start; 
 | 
                        margin-bottom: 20rpx; 
 | 
                        background: #ffffff; 
 | 
                        &:last-child { 
 | 
                            margin-bottom: 0 !important; 
 | 
                        } 
 | 
                        .item_list_item_label { 
 | 
                            flex-shrink: 0; 
 | 
                            font-weight: 400; 
 | 
                            font-size: 26rpx; 
 | 
                            color: #777777; 
 | 
                            font-style: normal; 
 | 
                        } 
 | 
                        .item_list_item_val { 
 | 
                            font-weight: 400; 
 | 
                            font-size: 26rpx; 
 | 
                            color: #222222; 
 | 
                            font-style: normal; 
 | 
                        } 
 | 
                    } 
 | 
                } 
 | 
            } 
 | 
        } 
 | 
    } 
 | 
</style> 
 |