• 换一换 功能


    <!--  -->
    <template>
        <div class="">
            <div class="lun-top clearfix">
                {{lunData.title}}
                <div class="l-top-right" @click="exchange">
                    <em>换一换</em>
                    <i ></i>
                </div>
            </div>
            <div v-show="flag==1">
                <ul class="text-list" v-if="(lunData.bidList).length>0" >
                    <li v-for="(item3,index) in lunData.bidList.slice(0,3)" :key="index" :id="addId(index)" v-if="index<3">
                        <el-row :gutter="20">
                            <el-col :span="17">
                                <div class="grid-content bg-purple">
                                    <nuxt-link :to="/recrt/+item3.id">
                                        {{FILTER_FORMATER.wordNum(item3.bidTitle,15)}}
                                    </nuxt-link>
                                    <p class="xm-details" v-if="item3.bidInfo!=undefined&&item3.bidInfo!=''">
                                        {{FILTER_FORMATER.wordNum(item3.bidInfo,20)}}
                                    </p>
                                </div>
                            </el-col>
                            <el-col :span="7"><div class="grid-content bg-purple">
                                <p class="text-time">截止时间</p>
                                <h5 v-if="item3&&item3.ycgBidTime!=undefined&&item3.ycgBidTime!=undefined!=''&&item3.ycgBidTime.bidEvaluationDeadlineTime!=undefined&&item3.ycgBidTime.bidEvaluationDeadlineTime!=''">{{formatDateTime(item3.ycgBidTime.bidEvaluationDeadlineTime).slice(0,10)}}</h5>
                            </div></el-col>
                        </el-row>
                    </li>
                </ul>
                <ul class="text-list no-data" style="min-height: 309px; padding: 0" v-else>
                    <img src="~static/img/error/no_data.png" alt="" style="margin-top: 80px">
                </ul>
            </div>
            <div v-show="flag==2">
                <ul class="text-list" v-if="(lunData.bidList).length>0 && (lunData.bidList).length>3">
                    <li v-for="(item3,index) in lunData.bidList.slice(3,6)" :key="index" :id="addId(index)" v-if="index<3">
                        <el-row :gutter="20">
                            <el-col :span="17">
                                <div class="grid-content bg-purple">
                                    <nuxt-link :to="/recrt/+item3.id">
                                        {{FILTER_FORMATER.wordNum(item3.bidTitle,15)}}
                                    </nuxt-link>
                                    <p class="xm-details" v-if="item3.bidInfo!=undefined&&item3.bidInfo!=''">
                                        {{FILTER_FORMATER.wordNum(item3.bidInfo,20)}}
                                    </p>
                                </div>
                            </el-col>
                            <el-col :span="7"><div class="grid-content bg-purple">
                                <p class="text-time">截止时间</p>
                                <h5 v-if="item3&&item3.ycgBidTime!=undefined&&item3.ycgBidTime!=undefined!=''&&item3.ycgBidTime.bidEvaluationDeadlineTime!=undefined&&item3.ycgBidTime.bidEvaluationDeadlineTime!=''">{{formatDateTime(item3.ycgBidTime.bidEvaluationDeadlineTime).slice(0,10)}}</h5>
                            </div></el-col>
                        </el-row>
                    </li>
                </ul>
                <ul class="text-list no-data" style="min-height: 309px; padding: 0" v-else>
                    <img src="~static/img/error/no_data.png" alt="" style="margin-top: 80px">
                </ul>
            </div>
            <div v-show="flag==3">
                <ul class="text-list" v-if="(lunData.bidList).length>0 && (lunData.bidList).length>6" >
                    <li v-for="(item3,index) in lunData.bidList.slice(6,9)" :key="index" :id="addId(index)" v-if="index<3">
                        <el-row :gutter="20">
                            <el-col :span="17">
                                <div class="grid-content bg-purple">
                                    <nuxt-link :to="/recrt/+item3.id">
                                        {{FILTER_FORMATER.wordNum(item3.bidTitle,15)}}
                                    </nuxt-link>
                                    <p class="xm-details" v-if="item3.bidInfo!=undefined&&item3.bidInfo!=''">
                                        {{FILTER_FORMATER.wordNum(item3.bidInfo,20)}}
                                    </p>
                                </div>
                            </el-col>
                            <el-col :span="7"><div class="grid-content bg-purple">
                                <p class="text-time">截止时间</p>
                                <h5 v-if="item3&&item3.ycgBidTime!=undefined&&item3.ycgBidTime!=undefined!=''&&item3.ycgBidTime.bidEvaluationDeadlineTime!=undefined&&item3.ycgBidTime.bidEvaluationDeadlineTime!=''">{{formatDateTime(item3.ycgBidTime.bidEvaluationDeadlineTime).slice(0,10)}}</h5>
                            </div></el-col>
                        </el-row>
                    </li>
                </ul>
                <ul class="text-list no-data" style="min-height: 309px; padding: 0" v-else>
                    <img src="~static/img/error/no_data.png" alt="" style="margin-top: 80px">
                </ul>
            </div>
        </div>
    </template>
    
    <script>
    export default {
        props: ['lunData'],
        components: {},
        data () {
            return {
                pageNumber: 1,
                pageSize: 3,
                total: 0,
                flag: 1,
                count: 1
            }
        },
        watch: {},
        computed: {},
        methods: {
            exchange () { // 备注
                this.count++
                if (this.count > 3) {
                    this.count = 1
                }
                this.flag = this.count
            },
    
            addId (index) {
                return 'listId_' + index
            },
    
            replaceHtml (params) { //  去掉html 标签
                return params.replace(/</?.+?>/g, '').replace(/ /ig, '')
            },
            formatDateTime (unix) { // 转换时间戳
                var date = new Date(unix)// 时间戳为10位需*1000,时间戳为13位的话不需乘1000
                var Y = date.getFullYear() + '-'
                var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-'
                var D = date.getDate() + ' '
                var h = date.getHours() + ':'
                var m = date.getMinutes() + ':'
                var s = date.getSeconds()
                return Y + M + D + h + m + s
            }
        },
        created () {
        },
        mounted () {
        }
    }
    </script>
    
    <style lang="scss">
        .lun-top{
            padding: 0 10px;
            height: 50px;
            //padding-top: 13px;
            line-height: 50px;
            background: $leftBgColor;
            color: $white;
            font-size: $max-font-size;
            .l-top-right{
                float: right;
                font-size: $default-font-size;
                color: $huanyihuan;
                cursor: pointer;
                em,i{
                    display: inline-block;
                    vertical-align: middle;
                    cursor: pointer;
                }
                i{
                     20px;
                    height: 15px;
                    background: url("~static/img/ycg_icon.png") 2px -20px no-repeat;
                }
                button{
                    i{
                        margin-top: 17px;
                    }
                }
            }
        }
        .text-list{
            height: 309px;
            border: 1px solid $inputBor;
            border-top: none;
            //border-bottom: none;
            li{
                padding: 20px 10px;
                border-bottom: 1px solid $inputBor;
                a{
                    color: $titleColor;
                }
                a:hover{
                    color: $leftBgColor;
                }
                .xm-details{
                    margin-top: 10px;
                    font-size: $min-font-size;
                    min-height: 32.75px;
                }
                h5{
                    margin-top: 10px;
                    font-size: $default-font-size;
                    color: $titleColor;
                }
            }
            #listId_2{
                border-bottom: none;
            }
        }
    </style>
    

      

  • 相关阅读:
    Python3基础 str """ 多行字符串
    Python3基础 str *运算 重复拼接字符串
    Python3基础 time.localtime 当前系统的年月日 时分秒
    Python3基础 time 索引值访问元组中的年月日时分秒
    Python3基础 sys.path 查看搜索路径变量
    Python3基础 sys.path.append 增加模块的搜索路径
    C#中ListView的简单使用方法
    C#的注释和快速开启工具的命令
    sql server2008安装错误(无法处理异常)
    启动计算机总弹出页面配置问题
  • 原文地址:https://www.cnblogs.com/taochengyong/p/10690926.html
Copyright © 2020-2023  润新知