renew.vue 2.83 KB
<template>
	<view>
		<view class="searchbar">
			<uni-easyinput placeholderStyle="font-size:30rpx" :input-border="false" prefixIcon="search" v-model="query.name" placeholder="搜索姓名或证件号码" @iconClick="iconClick">
			</uni-easyinput>
			<view class="invertedbtn-red" @click="goVipList">+ 添加会员</view>
		</view>
		
		<uni-swipe-action>
						<uni-swipe-action-item class="personitem" v-for="n in choseList">
							<view class="content-box">
								<view class="flexbox">
									<view class="colorful">{{n.name.slice(0,1)}}</view>
									{{n.name}}
								</view>
								<view class="flexbox">
									<uni-number-box :min="1" v-model="n.year" :max="5"></uni-number-box>
								</view>
								    
							</view>
							<template v-slot:right>
								<view class="slot-button">
									<view>
										<uni-icons type="trash-filled" color="#fff" size="20"></uni-icons>
											<text class="slot-button-text">删除</text>
									</view>
								</view>
							</template>
						</uni-swipe-action-item>
		</uni-swipe-action>
		
		<view class="nodata" v-if="choseList.length==0">
			<image mode="aspectFit" src="/static/nodata.png"></image>
			<button class="btn-red" @click="goVipList">+ 添加会员</button>
		</view>
	</view>
</template>

<script setup>
	import {
		ref
	} from 'vue'
	const query = ref({})
	const choseList = ref([{name:'张三',year:'1'},{name:'李三',year:'1'}])
	const yearlist = ref([{text:'一年',value:'1'},{text:'2年',value:'2'}])
	
	function goVipList(){
		let path = '/pages/personalVip/vipList';
		uni.navigateTo({
			url: path
		});
	}
	function changeYear(){
		
	}
</script>

<style scoped lang="scss">
.searchbar{display: flex;align-items: center;padding: 25rpx;box-sizing: border-box;
	.invertedbtn-red{margin-left: 15rpx;font-size: 30rpx;
	padding: 16rpx 20rpx;box-sizing: border-box;border-radius: 50rpx;background-color: #fff;}
	:deep(.uni-easyinput .uni-easyinput__content){border-radius: 35rpx;border: none;
	height: 70rpx;}
	:deep(.uni-easyinput__content-input){
	font-size: 26rpx;}
}

	.slot-button {display: flex;align-items: center;
		padding: 0 20px;text-align: center;
		background-color: #E60012;
	}

	.slot-button-text {
		color: #ffffff;display: block;
		font-size: 14px;
	}
.personitem{background: #fff;box-sizing: border-box;
margin-bottom: 30rpx;
	.content-box{display: flex;align-items: center;padding:16rpx;border-radius: 15rpx;
		justify-content: space-between;
		.noborder{border: none;
			:deep(.uni-select){border: none;text-align: right;}
		}
	}
	.flexbox{align-items: center;}
	&:nth-child(3n) .colorful{background: #014A9F;}
	&:nth-child(3n+1) .colorful{background: #AD181F;}
	&:nth-child(3n+2) .colorful{background: #D3B267;}
}
.colorful{width: 100rpx;margin-right: 14rpx;
height: 100rpx;line-height: 100rpx;
font-size: 44rpx;
color: #fff;text-align: center;
border-radius: 50%;}
</style>