radioTemp.vue 3.8 KB
<template>
	<view class="wrap">
		<view class="radioTemp" :class="{margBottom:item.last}" v-for="(item,index) in keyList" :key="index">
			<view class="radioTop">
				{{item.titleDesc}}{{item.title}}
				<image v-if="item.moreBtn" src="../static/image/icon_add.png" mode="" @click="showRecordMore(index)"></image>
			</view>
			<view class="radioBottom" :class="{padBottom: item.moreInfo.LAT && item.moreInfo.NOTE && item.moreInfo.IMGS}">
				<view class="radioItem" @click="radioCheck(index,subIndex)" :class="{yc:item.check == subItem.check && item.check == 0,yz:item.check == subItem.check && item.check == 1}" v-for="(subItem,subIndex) in item.subKeyList" :key="subIndex">
					{{subItem.title}}
				</view>
			</view>
			<view v-if="item.moreInfo">
				<view class="address" v-if="item.moreInfo.LAT">
					<image src="../static/image/icon_loc2.png" mode=""></image>
					<view class="lang">
						经度: {{item.moreInfo.LAT}}  纬度: {{item.moreInfo.LON}}
						<image class="clearBtn" src="../static/image/icon_clear2.png" mode="" @click="delAddress(index)"></image>
					</view>
				</view>
				<view class="desc" v-if="item.moreInfo.NOTE">
					{{item.moreInfo.NOTE}}
				</view>
				<view class="imgList" v-if="item.moreInfo.IMGS">
					<view class="imgItem" v-for="(item,imgIndex) in item.moreInfo.IMGS" :key="imgIndex">
						<image class="img" :src="item" mode=""></image>
						<image class="clearBtn" src="../static/image/icon_clear2.png" mode="" @click="del(index,imgIndex)"></image>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				lan:196.299099,
				lon:12.49693,
				imgList:[1,2]
			}
		},
		props:{
			keyList:{
				type:Array
			},
			checkIndex:{
				type:Number
			},
			moreInfo:{
				type:Object
			}
		},
		methods: {
			delAddress(index){
				this.keyList[index].moreInfo.LAT = ''
				this.keyList[index].moreInfo.LON = ''
			},
			del(index,imgIndex){
				this.keyList[index].moreInfo.IMGS.splice(imgIndex,1)
			},
			radioCheck(index,subIndex){
				this.keyList[index].check = this.keyList[index].subKeyList[subIndex].check
			},
			showRecordMore(index){
				/* this.keyList[index].moreInfo.LON = '111'
				this.keyList[index].moreInfo.LAT = '222' */
				this.$emit('showRecordMore',{checkIndex:this.checkIndex,keyIndex:index})
			}
		}
	}
</script>

<style lang="scss">
	.radioTemp{padding: 40rpx 32rpx;background: #fff;margin-top: 16rpx;}
	.radioTemp.margBottom{margin-bottom: 32rpx;}
	.radioTemp:nth-child(1){margin-top:0}
	.radioTemp .radioTop{display: flex;justify-content: space-between;align-items: center;font-size: 30rpx;}
	.radioTop image{width: 44rpx;height: 44rpx;}
	.radioTemp .radioBottom{padding-top: 24rpx;display: flex;justify-content: space-between;}
	.radioBottom.padBottom{border-bottom: 2rpx solid #f2f3f5;padding-bottom: 32rpx;}
	.radioBottom .radioItem{width: 328rpx;height: 72rpx;border-radius: 86rpx;border: 1rpx solid #dcdee0;text-align: center;line-height: 72rpx;color: #646566;font-size: 28rpx;}
	.radioItem.yz{color: $theme-color;background: #e8fff2;border: 1rpx solid #4bb377;}
	.radioItem.yc{background: #ffeeec;border: 1rpx solid #f2485a;color: #f2485a;}
	
	.address{display: flex;padding-top: 33rpx;}
	.address image{width: 48rpx;height: 48rpx;}
	.address .lang{padding: 0 16rpx;height: 48rpx;line-height: 48rpx;background: #f7f8fa;font-size: 24rpx;color: #646566;position: relative;}
	.lang .clearBtn{width: 28rpx;height: 28rpx;position: absolute;right: -10rpx;top: -10rpx;}
	.desc{font-size: 28rpx;padding: 48rpx 0 44rpx 0;}
	.imgList{display: flex;flex-wrap: wrap;}
	.imgList .imgItem{position: relative;width: 160rpx;height: 160rpx;margin: 10rpx 10rpx 0 0;}
	.imgItem .img{width: 160rpx;height: 160rpx;}
	.imgItem .clearBtn{width: 28rpx;height: 28rpx;position: absolute;right: -10rpx;top: -10rpx;}
</style>