lincl 3 years ago
parent
commit
7571be7aa0
3 changed files with 32 additions and 11 deletions
  1. 2 1
      src/components/Form/index.vue
  2. 28 10
      src/components/List/css/index.scss
  3. 2 0
      src/components/List/index.vue

+ 2 - 1
src/components/Form/index.vue

@ -6,9 +6,10 @@
                    {{g.groupTitle}}
                </div>
                <template v-for="(item, i) in g.children">
                    <slot v-if="$slots[item.id]" :name="item.id" :config="item" />
                    <van-field 
                        :class="{'has-tips': $slots[item.id+'-tips']}"
                        v-if="item.type=='text'||item.type=='textarea'"
                        v-else-if="item.type=='text'||item.type=='textarea'"
                        :type="item.type"
                        :key="i"
                        v-model="form[item.id]" 

+ 28 - 10
src/components/List/css/index.scss

@ -1,8 +1,8 @@
.custom-list{
    display: flex;
    flex-direction: column;
    height: 100vh;
    .search{
        position: fixed;
        top: 0;
        width: 100%;
        z-index: 2;
        border-bottom: 1px solid #e1e1e1;
@ -15,12 +15,15 @@
        }
    }
    .filter{
        position: fixed;
        top: 54px;
        width: 100%;
        z-index: 2;
        border-bottom: 1px solid #e1e1e1;
    }
    &.has-search{
        .custom-van-list{
            // margin-top: 54px;
            margin-top: 54px;
        }
    }
    
@ -29,20 +32,35 @@
            margin-top: 99px;
        }
    }
    .van-pull-refresh{
        display: flex;
        min-height: 100%;
        flex-direction: column;
        ::v-deep .van-pull-refresh__track{
            width: 100%;
            flex: 1;
        }
    }
}
.has-top{
.mainNobotHasTop{
    .custom-list{
        height: calc(100vh - 45px);
        height: calc(100vh - 46px);
        .search{
            top: 45px;
            top: 46px;
        }
        .filter{
            top: 99px;
        }
        
    }
}
.van-pull-refresh { 
    flex-grow: 1;
.app-wrapper-1.has-top{
    .custom-list{
        height: calc(100vh - 46px);
        .search{
            top: 46px;
        }
        .filter{
            top: 99px;
        }
    }
}

+ 2 - 0
src/components/List/index.vue

@ -29,6 +29,8 @@
                v-model="loading"
                :finished="finished"
                finished-text="没有更多了"
                :error.sync="isError"
                error-text="请求失败,点击重新加载"
                @load="onLoad"
                >
                <div class="custom-van-list">