| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109 |
- <template>
- <view class="list" @click="bindClick">
- <view class="list-cell" v-if="cellType == ''" :class="done ? 'done' : 'info'">
- <view class="status" v-if="status" :class="statusClass" v-text="status"></view>
- <view class="title" v-text="title"></view>
- <view class="time" v-text="more"></view>
- </view>
- <!-- slot more -->
- <view class="list-cell list-cell-more" v-if="cellType == 'more'" >
- <view class="title" v-text="title"></view>
- <slot name="more"></slot>
- </view>
- <slot></slot>
- </view>
- </template>
- <script>
- export default {
- name:"cell",
- props:{
- done:{
- type:Boolean,
- default: false
- },
- status:{
- type:String,
- default: ''
- },
- title:{
- type:String,
- default: ''
- },
- more:{
- type:[String, Number],
- default: ''
- },
- statusClass:{
- type:[String, Array],
- default:'status-span'
- },
- cellType:{
- type: String,
- default:''
- }
- },
- data() {
- return {
-
- };
- },
- methods:{
- bindClick(){
- this.$emit('click')
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .list{
- color: $uni-text-color;
- line-height: 1.5;
- border-bottom: 2rpx solid #d8d8d8;
- font-size: $uni-font-size-base;
- .list-cell{
- position: relative;
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 20rpx;
-
- .title {
- flex-grow: 1;
- }
-
- .time {
- font-size: 12px;
- color: #AAAAAA;
- }
-
- }
-
-
- .list-cell.list-cell-more{
- padding: 20rpx 30rpx;
- }
- }
- .done{
- color: $uni-text-color-grey !important;
- }
- .status {
- padding: 2rpx 8rpx;
- margin-right: 20rpx;
- color: #D7D7D7;
- background-color: #f2f2f2;
- border-radius: 10rpx;
- font-size: $uni-font-size-sm;
- &.status-check{
- color: #FFFFFF;
- background-color: $uni-color-success;
- }
- }
- </style>
|