<template>
    <view class="inquiry_wrap">
        <u-navbar class="nav-bar" :title="type == '1' ? '询价中心' : '核价中心'" :autoBack="true" :placeholder="true"
            v-hideNav></u-navbar>
        <scroll-view class="list_wrap" scroll-y @scrolltolower="loadMore" enable-back-to-top>
            <view class="list_item" v-for="(item, index) in list" :key="index" @click="handleClick(item)">
                <view class="list_item_top">
                    <view class="top_left">
                        <view class="name">
                            <view>{{ item.dictLabel }}</view>
                            &nbsp;&nbsp;
                            <view v-if="item.myPrice != null && item.myPrice !== ''" class="my-price">
                                我的报价：<u-icon name="rmb-circle"></u-icon>{{ item.myPrice }}
                            </view>
                        </view>
                        <text class="desc">{{ type == '1' ? '意向' : item.model }}</text>
                    </view>
                    <view class="top_right">
                        <u-tag plain plainFill :text="formtterStatus(item.status)" :type="item.status == '1' ? 'warning' : item.status == '2' ? 'primary' : 'success'"></u-tag>
                    </view>
                </view>
                <view class="imgs">
                    <imgs-row-scroll :images="item.imgsUrl" :previewEnabled="true" :showIndicator="false"
                        :imageWidth="140" :imageHeight="140"></imgs-row-scroll>
                </view>
                <view class="list_item_bottom">
                    <view class="bottom">
                        <u-icon name="bookmark" size="16" color="#9ca3af"></u-icon>
                        <text class="code">编码：{{ item.code }}</text>
                    </view>
                    <view class="bottom">
                        <u-icon name="clock" size="16" color="#9ca3af"></u-icon>
                        <text class="time">{{ item.updateTime }}</text>
                    </view>
                </view>
            </view>
        </scroll-view>

        <add-inquiry-dialog ref="addInquiryDialog" editOrAdd="edit" :editInfo="editInfo" :type="type" :title="type == '1' ? '询价' : '核价'" @submitSuccess="onRefresh" />
    </view>
</template>
<script>
import imgsRowScroll from '@/components/imgs-row-scroll/index.vue'
import addInquiryDialog from '@/components/add-inquiry-dialog/index.vue'
import inquiryVerificationList from "./mixins/inquiryVerificationList.js";
export default {
    components: {
        imgsRowScroll,
        addInquiryDialog
    },
    mixins: [inquiryVerificationList]
}
</script>

<style lang="scss">
@import "./styles/index.scss";
</style>