<template>
	<view class="page">
		<navBar title="售后保障" :back="true" color="black" background="white" />

		<view class="content" v-if="list.length!=0">
			<view class="item" v-for="(item,index) in list">
				<view class="line t1">
					质保到期还剩：<text> {{item.dayCount}}天</text>
				</view>
				<view class="line">
					<view class="left">
						产品名称
					</view>
					<view class="right">
						{{item.product}}
					</view>
				</view>
				<view class="line">
					<view class="left">
						产品型号
					</view>
					<view class="right">
						{{item.model_number}}
					</view>
				</view>
				<view class="line">
					<view class="left">
						业主姓名
					</view>
					<view class="right">
						{{item.name}}
					</view>
				</view>
				<view class="line">
					<view class="left">
						联系电话
					</view>
					<view class="right">
						{{item.phone}}
					</view>
				</view>
				<view class="line">
					<view class="left">
						项目地址
					</view>
					<view class="right">
						{{item.address}}
					</view>
				</view>
			</view>
			<u-loadmore v-if="list.length!=0" style="" loadmoreText="已经到底啦" color="#CCCCCC" lineColor="#CCCCCC" line />
		</view>
		<view class="con" v-else style="justify-content: center;">
			<u-empty mode="data" text="暂无数据" width="160" height="160" :icon="picUrl+'/static/other/empty.png'">
			</u-empty>
		</view>

		<u-loading-page :loading="loading" image="/static/index/logo.png" loading-text="页面加载中..."></u-loading-page>
	</view>
</template>

<script>
	import {
		getSerBackReq,
	} from '@/api/test/index.js'
	export default {
		components: {

		},
		data() {
			return {
				list: [],
				picUrl: this.$picUrl,

				loading: true
			}
		},
		async onLoad(options) {
			let res = await getSerBackReq()
			if (res.code == 0) {
				console.log('获取我的售后保障返回值: ', res);
				this.list = res.data.data
				this.loading = false
			} else {
				this.loading = false
				uni.showToast({
					title: res.message,
					icon: 'none'
				})
			}
		},
		methods: {

		}
	}
</script>

<style lang="scss" scoped>
	@import "./index.scss";
</style>