<template>
	<view class="page scoped-box">
		<view class="buystep-info u-p-32 box-shadow u-skeleton-fillet">
			<view class="name">跟进记录:{{custTips || ''}}</view>
			<u-empty v-if="stepsLogList.length == 0" mode="list" text="暂无流水记录"></u-empty>
			<u-time-line>
				<u-time-line-item v-for="(item, index) in stepsLogList" :key="index">
					<template v-slot:node>
						<view class="u-node"><u-icon name="checkmark-circle" size="28" color="#2080f0"></u-icon></view>
					</template>
					<template v-slot:content>
						<view>
							<view class="u-order-title">日常维护:</view>
							<view class="u-order-desc">{{item.record_remark}}</view>
							<view class="u-order-time">{{ item.create_at}}</view>
						</view>
					</template>
				</u-time-line-item>
			</u-time-line>
		</view>
		
		<u-button class="f-btn bwin-btn-80 u-m-b-10" type="primary" @click="addHandle">添加跟进记录</u-button>
	</view>
</template>
<script>
export default {
	data() {
		return {
			curId: '',
			custTips: '',
			detail: {
			}, // 客户详情
			stepsLogList: [] // 进展
		};
	},
	onLoad(params) {
		this.curId = params.id
		this.custTips = params.str
	},
	onShow() {
		this.getData()
	},
	methods: {
		getData () {
			uni.api.cust.apiprivaterecordlist({customer_id:this.curId, page_size: 100}).then(res =>{
				this.stepsLogList = res.list || []
			})
		},
		addHandle () {
			uni.navigateTo({
				url: `/pages/cust/myrecordedit?id=${this.curId}`
			})
		},
	}
};
</script>
<style lang="scss">

.buystep-info {
	width: 100%;
	padding: 32rpx 0rpx;
	background-color: #fff;
	margin-bottom: 20rpx;
	border-radius: 10rpx;
	.name {
		font-weight: bold;
		margin-bottom: 20rpx;
	}
	.u-order-title {
		color: $u-main-color;
		font-size: $u-p2;
	}
	.u-order-desc {
		// color: $u-content-color;
		color: #777;
		font-size: $u-p2;
		margin-bottom: 6rpx;
	}
	.u-order-time {
		color: rgb(200, 200, 200);
		font-size: $u-p2;
	}
}

.scoped-box {
	padding-bottom: 100rpx;
	.f-btn {
		position: fixed;
		bottom: 0;
		left: 20rpx;
		right: 20rpx;
	}
}



</style>