fix: 功能优化完善,样式相关。
This commit is contained in:
@@ -1,67 +1,66 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<u-sticky offsetTop="8rpx" customNavHeight="8rpx">
|
||||
<u-sticky offsetTop="-10rpx" customNavHeight="0rpx">
|
||||
<view class="search-view">
|
||||
<u--input v-model="queryParams.name" border="false" placeholder="请输入理财账户名称" class="search-input"
|
||||
@blur="searchBlur" suffixIcon="search" suffixIconStyle="color: #909399">
|
||||
</u--input>
|
||||
<view class="add-btn" @click="handleAdd()">
|
||||
<uni-icons type="plus-filled" size="18" color="#ffffff"></uni-icons>
|
||||
<uni-icons type="plusempty" size="18" color="#667eea"></uni-icons>
|
||||
<text>新增</text>
|
||||
</view>
|
||||
</view>
|
||||
</u-sticky>
|
||||
<u-list @scrolltolower="loadmore" :spaceHeight="116" lowerThreshold="100">
|
||||
<u-list-item v-for="(item, index) in listData" :key="index">
|
||||
<view class="card" @click="enterDetails(item)">
|
||||
<view class="card-header">
|
||||
<view class="card-title">
|
||||
<uni-icons type="wallet" size="20" color="#fff"></uni-icons>
|
||||
<text class="card-name">{{ item.name }}</text>
|
||||
<view class="list-item" @click="enterDetails(item)">
|
||||
<view class="item-header">
|
||||
<view class="card-name-section">
|
||||
<view class="card-icon">
|
||||
<uni-icons type="wallet-filled" size="20" color="#ffffff"></uni-icons>
|
||||
</view>
|
||||
<view class="card-info">
|
||||
<text class="card-name">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="status-badge" :class="getStatusClass(item.status, dictStr(item.status, statusList))">
|
||||
<text>{{ dictStr(item.status, statusList) }}</text>
|
||||
<view class="balance-section">
|
||||
<text class="balance-value"><text class="balance-label">余额</text>{{ item.balance || '0' }}元</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-content">
|
||||
|
||||
<view class="card-body">
|
||||
<view class="info-row">
|
||||
<view class="info-item">
|
||||
<text class="info-label">余额</text>
|
||||
<text class="info-value orange">{{ item.balance || '0' }}</text>
|
||||
<view class="info-item" v-if="dictStr(item.status, statusList) || true">
|
||||
<text class="info-label">账户状态</text>
|
||||
<text class="info-value" :class="getStatusClass(item.status, dictStr(item.status, statusList))">{{ dictStr(item.status, statusList) || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
<text class="info-label">佣金费率</text>
|
||||
<text class="info-value orange">{{ item.commission || '-' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-row">
|
||||
<view class="info-item">
|
||||
<text class="info-label">关联储蓄卡</text>
|
||||
<text class="info-value">{{ item.bankNameCode || '-' }}</text>
|
||||
</view>
|
||||
<view class="info-item">
|
||||
|
||||
<view class="info-item" v-if="item.activationDate || true">
|
||||
<text class="info-label">开户日期</text>
|
||||
<text class="info-value">{{ item.activationDate || '-' }}</text>
|
||||
<text class="info-value">{{ item.activationDate || '--' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="info-row" v-if="item.remark">
|
||||
<view class="info-item full-width">
|
||||
<view class="info-item" v-if="item.bankNameCode || true">
|
||||
<text class="info-label">关联储蓄卡</text>
|
||||
<text class="info-value">{{ item.bankNameCode || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item" v-if="item.commission || true">
|
||||
<text class="info-label">佣金费率</text>
|
||||
<text class="info-value">{{ item.commission || '--' }}</text>
|
||||
</view>
|
||||
<view class="info-item info-item-full" v-if="item.remark">
|
||||
<text class="info-label">备注</text>
|
||||
<text class="info-value">{{ item.remark }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-footer">
|
||||
<view class="action-btn edit-btn" @click.stop="handleEdit(item)">
|
||||
|
||||
<view class="operate" @click.stop>
|
||||
<view class="btn-edit" @click="handleEdit(item)">
|
||||
<uni-icons type="compose" size="16" color="#667eea"></uni-icons>
|
||||
<text>编辑</text>
|
||||
<text>修改</text>
|
||||
</view>
|
||||
<view class="action-btn delete-btn" @click.stop="handleDelete(item)">
|
||||
<uni-icons type="trash" size="16" color="#ff4d4f"></uni-icons>
|
||||
<view class="btn-delete" @click="handleDelete(item)">
|
||||
<uni-icons type="trash" size="16" color="#f5576c"></uni-icons>
|
||||
<text>删除</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -199,30 +198,39 @@ function dictStr(val, arr) {
|
||||
}
|
||||
function handleDelete(item) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '你确定要删除吗',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
delFutureStocks(item.id)
|
||||
uni.navigateTo({ url: `/pages/work/base/financials/list` })
|
||||
} else if (res.cancel) {
|
||||
console.log('取消');
|
||||
}
|
||||
}
|
||||
});
|
||||
title: '确认删除',
|
||||
content: '确定要删除这条记录吗?',
|
||||
confirmText: '删除',
|
||||
cancelText: '取消',
|
||||
confirmColor: '#f5576c',
|
||||
cancelColor: '#909399',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
delFutureStocks(item.id).then(() => {
|
||||
uni.showToast({
|
||||
title: '删除成功',
|
||||
icon: 'success'
|
||||
})
|
||||
pageNum.value = 1
|
||||
listData.value = []
|
||||
getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.btnAdd {
|
||||
width: 146rpx;
|
||||
height: 56rpx;
|
||||
line-height: 56rpx;
|
||||
border-radius: 8rpx;
|
||||
display:float;
|
||||
text-align: center;
|
||||
}
|
||||
page {
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.container {
|
||||
background: #f5f7fa;
|
||||
}
|
||||
|
||||
.search-view {
|
||||
padding: 12rpx 32rpx;
|
||||
@@ -231,15 +239,19 @@ function dictStr(val, arr) {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
margin-bottom: 24rpx;
|
||||
z-index: 100;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05);
|
||||
|
||||
.search-input {
|
||||
background: #f5f7fa;
|
||||
background: rgba(102, 126, 234, 0.08);
|
||||
color: #333333;
|
||||
flex: 1;
|
||||
margin-right: 16rpx;
|
||||
border-radius: 24rpx;
|
||||
border: 1rpx solid #e8edf3;
|
||||
border: 2rpx solid rgba(102, 126, 234, 0.3);
|
||||
height: 66rpx !important;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.add-btn {
|
||||
@@ -247,144 +259,192 @@ function dictStr(val, arr) {
|
||||
align-items: center;
|
||||
gap: 6rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
background: rgba(102, 126, 234, 0.08);
|
||||
border-radius: 24rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(102, 126, 234, 0.3);
|
||||
border: 2rpx solid rgba(102, 126, 234, 0.3);
|
||||
transition: all 0.3s ease;
|
||||
flex-shrink: 0;
|
||||
margin-left: 10rpx;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.95);
|
||||
box-shadow: 0 2rpx 8rpx rgba(102, 126, 234, 0.3);
|
||||
background: rgba(102, 126, 234, 0.15);
|
||||
}
|
||||
|
||||
text {
|
||||
color: #ffffff;
|
||||
color: #667eea;
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card {
|
||||
margin: 0 24rpx 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
.list-item {
|
||||
margin: 10rpx 24rpx;
|
||||
background: #ffffff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
|
||||
.card-header {
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.item-header {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
padding: 24rpx 32rpx;
|
||||
padding: 20rpx 24rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.card-title {
|
||||
|
||||
.card-name-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12rpx;
|
||||
|
||||
.card-name {
|
||||
color: #fff;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.status-badge {
|
||||
padding: 8rpx 20rpx;
|
||||
border-radius: 24rpx;
|
||||
font-size: 24rpx;
|
||||
font-weight: 600;
|
||||
|
||||
&.status-default {
|
||||
background: #f0f0f0;
|
||||
color: #666666;
|
||||
}
|
||||
|
||||
&.status-normal {
|
||||
background: #fa8c16;
|
||||
color: #ffffff;
|
||||
box-shadow: 0 2rpx 8rpx rgba(250, 140, 22, 0.3);
|
||||
}
|
||||
|
||||
&.status-error {
|
||||
background: #ff4d4f;
|
||||
color: #ffffff;
|
||||
box-shadow: 0 2rpx 8rpx rgba(255, 77, 79, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-content {
|
||||
padding: 24rpx 32rpx;
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.info-item {
|
||||
flex: 1;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.card-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
background: rgba(255, 255, 255, 0.2);
|
||||
border-radius: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8rpx;
|
||||
|
||||
&.full-width {
|
||||
flex: none;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 12rpx;
|
||||
flex-shrink: 0;
|
||||
backdrop-filter: blur(10rpx);
|
||||
}
|
||||
|
||||
.card-info {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
|
||||
.card-name {
|
||||
color: #ffffff;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
|
||||
&.orange {
|
||||
color: #fa8c16;
|
||||
font-weight: bold;
|
||||
}
|
||||
font-weight: 600;
|
||||
line-height: 1.2;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.balance-section {
|
||||
flex-shrink: 0;
|
||||
text-align: right;
|
||||
|
||||
.balance-value {
|
||||
color: #fa8c16;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
line-height: 1;
|
||||
|
||||
.balance-label {
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 24rpx;
|
||||
margin-right: 8rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.card-footer {
|
||||
.card-body {
|
||||
padding: 24rpx;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.info-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 24rpx;
|
||||
margin-bottom: 0;
|
||||
|
||||
.info-item {
|
||||
flex: 0 0 calc(50% - 12rpx);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4rpx;
|
||||
min-width: 0;
|
||||
margin-bottom: -5rpx;
|
||||
|
||||
&.info-item-full {
|
||||
flex: 0 0 100%;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
line-height: 1.2;
|
||||
padding: 4rpx 12rpx;
|
||||
background: rgba(102, 126, 234, 0.08);
|
||||
border-radius: 8rpx;
|
||||
align-self: flex-start;
|
||||
}
|
||||
|
||||
.info-value {
|
||||
font-size: 26rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
line-height: 1.2;
|
||||
|
||||
&.status-normal {
|
||||
color: #52c41a;
|
||||
}
|
||||
|
||||
&.status-error {
|
||||
color: #ff4d4f;
|
||||
}
|
||||
|
||||
&.status-default {
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.operate {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
gap: 24rpx;
|
||||
padding: 20rpx 32rpx;
|
||||
border-top: 1rpx solid #f0f0f0;
|
||||
gap: 16rpx;
|
||||
padding: 16rpx 24rpx 24rpx;
|
||||
|
||||
.action-btn {
|
||||
.btn-edit,
|
||||
.btn-delete {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8rpx;
|
||||
padding: 12rpx 24rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 28rpx;
|
||||
transition: all 0.3s;
|
||||
|
||||
&.edit-btn {
|
||||
background-color: rgba(102, 126, 234, 0.1);
|
||||
color: #667eea;
|
||||
justify-content: center;
|
||||
gap: 6rpx;
|
||||
padding: 0 24rpx;
|
||||
height: 64rpx;
|
||||
border-radius: 12rpx;
|
||||
font-size: 26rpx;
|
||||
font-weight: 500;
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.95);
|
||||
}
|
||||
}
|
||||
|
||||
&.delete-btn {
|
||||
background-color: rgba(255, 77, 79, 0.1);
|
||||
color: #ff4d4f;
|
||||
}
|
||||
.btn-edit {
|
||||
background: rgba(102, 126, 234, 0.1);
|
||||
color: #667eea;
|
||||
border: 1rpx solid rgba(102, 126, 234, 0.3);
|
||||
}
|
||||
|
||||
.btn-delete {
|
||||
background: rgba(245, 87, 108, 0.1);
|
||||
color: #f5576c;
|
||||
border: 1rpx solid rgba(245, 87, 108, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user