typeRadioTemp.vue 2.4 KB
<template>
	<view>
		<view style="margin-top: 16rpx;" v-for="(item,index) in keyList" :key="index">
			<view class="bottomWrap">
				<view class="bottomItem">
					<view class="bottomLeft">
						{{item.title}}
					</view>
					<view class="bottomRight">
						{{item.subTitle}}
						<image src="../static/image/icon_arrow_up.png" mode=""></image>
					</view>
				</view>
			</view>
			<view class="subCheckWrap" v-for="(subItem,subIndex) in item.subKeyList" :key="subIndex">
				<view class="subCheckItem">
					{{subItem.title}}
					<br v-if="subItem.unit != ''">{{subItem.unit}}</br>
					<view class="subCheckRight">
						{{subItem.name}}
						<view class="yc" :class="{active:subItem.choose == 0}" @click="choose('yc',index,subIndex)">
							异常
						</view>
						<view class="yz" :class="{active:subItem.choose == 1}" @click="choose('yz',index,subIndex)">
							一致
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		props:{
			keyList:{
				type:Array
			}
		},
		methods: {
			choose(type,index,subIndex){
				if(type == 'yc'){
					this.keyList[index].subKeyList[subIndex].choose = 0
				}else{
					this.keyList[index].subKeyList[subIndex].choose = 1
				}
			}
		}
	}
</script>

<style>
	.bottomWrap{padding: 0 32rpx;background: #fff;}
	.bottomWrap .bottomItem{display: flex;justify-content: space-between;align-items: center;height: 104rpx;font-size: 30rpx;}
	.bottomItem .bottomLeft{display: flex;align-items: center;}
	.bottomItem .bottomRight{color: #969799;display: flex;align-items: center;}
	.bottomRight image{width: 32rpx;height: 32rpx;}
	.subCheckWrap{padding: 0 32rpx 0 64rpx;}
	.subCheckWrap .subCheckItem{display: flex;justify-content: space-between;align-items: center;height: 96rpx;color: #646566;font-size: 28rpx;}
	.subCheckItem .subCheckRight{display: flex;align-items: center;}
	.subCheckRight .yc{width: 104rpx;height: 48rpx;background: #ffffff;border: 1rpx solid #dcdee0;border-radius: 48rpx 0 0 48rpx;text-align: center;line-height: 48rpx;color: #969799;font-size: 28rpx;margin: 0 10rpx 0 32rpx;}
	.yc.active{background: #ffeeec;border: 1rpx solid #f2485a;color: #f2485a;}
	.subCheckRight .yz{width: 104rpx;height: 48rpx;background: #ffffff;border: 1rpx solid #dcdee0;border-radius: 0 48rpx 48rpx 0;text-align: center;line-height: 48rpx;color: #969799;font-size: 28rpx;}
	.yz.active{background: #e8fff2;border: 1rpx solid #a1ddba;color: #58b981;}
</style>