列表组件样式调整

master
FCD 1 week ago
parent bac08f72eb
commit 5c749cca9f

@ -1,6 +1,18 @@
<template> <template>
<view class="row-list"> <view class="row-list">
<view> <view v-if="type === 'input'" class="row-input">
<label class="row-label"> {{ label }}:</label>
<input :disabled="disabled" class="row-input-item" v-model="localValue" :placeholder="'请填写'+label" />
</view>
<view v-else-if="type === 'picker'" class="row-input">
<label class="row-label"> {{ label }}</label>
<view class="row-input-item">
<jPicker :disabled="disabled" @bindpicker="bindPicker" sureColor="#ff0000" showKey="label" valKey="value" :val="localValue" :options="pickerOptions" />
</view>
</view>
<view v-else>
<label class="row-label"> {{ label }}</label> <label class="row-label"> {{ label }}</label>
<label class="row-value"> {{ value }}</label> <label class="row-value"> {{ value }}</label>
</view> </view>
@ -8,22 +20,88 @@
</template> </template>
<script> <script>
import jPicker from "@/components/J-Picker/jPicker.vue";
export default { export default {
name: 'ljListRow', name: 'ljListRow',
props: ['label', 'value'], components: {jPicker},
data() { props: {
return {}; label: {
type: String,
default: ''
},
value: {
type: [Number, String],
default: ''
},
type: {
type: String,
default: ''
},
disabled: {
type: Boolean,
default: false
},
pickerOptions: {
type: Array,
default () {
return []
}
},
}, },
data() {
return {
localValue:this.value
};
},
methods:{
bindPicker(e) {
this.localValue = e.pickerVal
}
},
watch: {
localValue(newVal) {
this.$emit('update:value', newVal);
},
value(newVal) {
this.localValue = newVal;
}
}
}; };
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.row-list { .row-list {
font-size: 28rpx !important;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
margin-bottom: 7rpx;
.row-label { .row-label {
margin-right: 30rpx; margin-right: 10rpx;
} }
.row-input{
display: flex ;
width: 100%;
align-items: center;
.row-label {
flex-shrink: 0;
}
.row-input-item{
font-size: 28rpx;
border: black 1rpx solid;
border-radius: 8rpx;
flex-grow: 0;
flex-shrink: 1;
width: 100%;
box-sizing: border-box;
}
}
} }
</style> </style>

@ -6,6 +6,19 @@
min-height: 100%; min-height: 100%;
} }
//
.queryFrom {
background-color: #fff;
margin-top: 10px;
padding: 20rpx;
border-radius: 10rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.u-form-item {
line-height: 35rpx;
}
}
// //
.page-form { .page-form {
background-color: #fff; background-color: #fff;
@ -19,6 +32,30 @@
} }
} }
//
.page-list {
margin-top: 20rpx;
box-shadow: 0 0 20rpx 0 rgba(128, 128, 128, 0.2);
.page-list-item {
margin-bottom: 20rpx;
background-color: #fff;
padding: 20rpx 20rpx 25rpx;
border-radius: 10rpx;
}
/* 奇数行背景色 */
.page-list-item:nth-child(odd) {
background-color: #ffffff;
}
/* 偶数行背景色 */
.page-list-item:nth-child(even) {
background-color: #f5f5f5;
}
}
// //
.bottom-bar { .bottom-bar {

Loading…
Cancel
Save