From b5c0993eb8043882eae85ce9ab1d860ff8bebf17 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 28 三月 2024 13:52:56 +0800
Subject: [PATCH] #
---
components/z-data-list/z-data-list.vue | 92 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 70 insertions(+), 22 deletions(-)
diff --git a/components/z-data-list/z-data-list.vue b/components/z-data-list/z-data-list.vue
index a3e3aef..b01db95 100644
--- a/components/z-data-list/z-data-list.vue
+++ b/components/z-data-list/z-data-list.vue
@@ -2,18 +2,27 @@
<view >
<view class="main">
<view class="main-left" >
- <view class="main-list" v-for="it in dataList" style="width: 100%;">
- <view style="flex: 1;padding-left: 8rpx;">{{it.key}}</view>
- <view>:</view>
- <view style="flex: 3;padding-left: 8rpx;">{{it.value}}</view>
+ <view class="main-list" v-for="it in lable" style="width: 100%;">
+ <view class="left-key">{{it.label}}</view>
+ <view>锛�</view>
+ <view class="left-val">
+ <text :class="it.valText">{{fields[it.attribute]}}</text>
+ </view>
</view>
</view>
- <view class="main-right" @click="goDetail">
- <view class="list-options">
- <view class="list-number">1</view>
- <uni-icons class="opt-icon" type="right" size="20" color="#707070"></uni-icons>
+ <uni-badge
+ class="main-right uni-badge-left-margin"
+ :text="index"
+ absolute="rightTop"
+ size="small"
+ type="primary"
+ >
+ <view style="height: 100%;display: flex;align-items: center;" @click="goDetail">
+ <view class="list-options">
+ <uni-icons class="opt-icon" type="right" size="20" color="#b9b9b9"></uni-icons>
+ </view>
</view>
- </view>
+ </uni-badge>
</view>
</view>
</template>
@@ -32,7 +41,8 @@
{key: '鏁伴噺',value: '200'}
],
detailList: [],
- dataKey: {}
+ dataKey: {},
+ valText: 'val-text'
};
},
methods: {
@@ -41,10 +51,16 @@
}
},
created() {
- this.dataList = this.list.detl
+ // this.dataList = this.list.detl
},
props: {
- list: {
+ lable: {
+ type: Array,
+ default() {
+ return {}
+ }
+ },
+ fields: {
type: Object,
default() {
return {}
@@ -55,6 +71,10 @@
default() {
return {}
}
+ },
+ index: {
+ type: Number,
+ default: 2
}
}
}
@@ -65,31 +85,37 @@
<style scoped>
.main {
position: relative;
- min-height: 70rpx;
- background-color: #ebe7e6;
+ min-height: 35px;
+ background-color: #f5f5f5;
display: flex;
align-items: stretch;
- margin: 8px 8px 8px 8px;
- border-radius: 16rpx;
+ margin: 8px 12px 8px 12px;
+ border-radius: 8px;
}
.main-left {
flex: 7;
- background-color: #005500;
display: flex;
flex-direction: column;
- padding-top: 8rpx;
- padding-bottom: 8rpx;
+ padding-top: 4px;
+ padding-bottom: 4px;
+ color: #606164;
+ font-size: 14px;
}
.main-right {
- background-color: #ffaaff;
- flex: 1;
+ width: 30px;
display: flex;
align-items: center;
- /* flex-direction: column; */
+ justify-content: center;
+ border-left: 1px solid #ffffff;
+ }
+ .main-right:active {
+ background-color: #e3e5e7;
+ color: #FFF;
}
.main-list {
display: flex;
align-items: center;
+ margin: 2px 0;
}
.list-options {
display: flex;
@@ -103,4 +129,26 @@
.opt-icon {
display: flex;
}
+ .left-key {
+ width: 65px;
+ padding-right: 4px;
+ text-align: end;
+ font-weight: 700;
+ }
+ .left-val {
+ flex: 1;
+ padding-left: 4px;
+ color: #606266;
+ }
+ .val-text {
+ background-color: #00aeec;
+ padding: 2px 4px;
+ border-radius: 4px;
+ color: #FFF;
+ }
+ .val-num {
+ font-weight: 900;
+ color: #d19a66;
+ font-size: 16px;
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.1