<template>
	<view class="cust_detail">
		<view class="record_item" v-for="(item,index) in opera_list" :key="index">
			<image :src="item.staff.img ? item.staff.img : BASE_IMG_URL +'headImg.png'"  mode="scaleToFill"></image>
			<view class="record_info">
				<view class="record_time">
					<view>{{item.staff.name}}</view>
					<view>{{item.createtime}}</view>
				</view>
				<view style="padding: 30rpx 0;">{{item.content}}</view>
			</view>
		</view>
	</view>
</template>

<script>
	import { netOperationList } from '@/api/kehu.js'
	import { BASE_IMG_URL } from '@/util/api.js'
	export default {
		data() {
			return {
				opera_list: [], //操作记录
				contactid: '',
				type:'',
				BASE_IMG_URL : BASE_IMG_URL
			}
		},
		onLoad(options) {
			this.contactid = options.id
			this.type = options.relation_type
			//操作记录
			this.getOperalist()
		},
		onShow() {
			
		},
		created() {

		},
		methods: {
			//操作 记录
			getOperalist() {
				let params = {
					relation_type: this.type, //1客户  2联系人   3合同
					relation_id: this.contactid
				}
				netOperationList(params).then(res => {
					this.opera_list = res.data
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.cust_detail {
		.record_item{
			margin-top: 20rpx;
			background: #fff;
			image{
				width: 80rpx;
				height: 80rpx;
				border-radius: 50%;
				margin: 30rpx;
				float: left;
			}
			.record_info{
				font-size: 30rpx;
				color: #999;
				.record_time{
					padding-top: 30rpx;
					display: flex;
					justify-content: space-between;
					padding-right:30rpx ;
				}
			}
		}
	}
</style>
