<template>
	<view class="se-p-40">
		<view v-if="list.length>0">
			<view class="se-px-40 se-mb-30 se-py-30 se-bgc-white se-br-40 se-bs-b" v-for="(items,indexs) in list"
				:key="indexs">
				<view class="se-flex">
					<view class=" se-flex se-flex-v-sa se-flex-ai-fs">
						<view class="se-fw-6 se-c-black se-fs-30 se-display-ib">车辆型号：{{items.model}}</view>
						<view class="se-fs-24 se-c-text-third se-display-ib">联系人:{{items.name}}</view>
						<view class="se-fs-24 se-c-text-third se-display-ib">公里数:{{items.mileage}}</view>
						<view class="se-fs-24 se-c-text-third se-display-ib">备注:{{items.remark}}</view>
					</view>
				</view>
				<view class="se-flex se-flex-h-sb se-w-p-100 se-pt-20">
					<view class="se-fs-24 se-display-ib"></view>
					<view @click="onCustomerService(items.phone)"
						class="se-display-ib se-px-20 se-br-40 se-flex-h-c se-h-50 se-lh-50 se-bgc-green se-ta-c se-fs-24 se-fs-24 se-c-white se-b">
						<text>电话联系</text>
					</view>
				</view>
			</view>
		</view>
		<view v-else>
			<u-empty mode="list" ></u-empty>
		</view>
		<view class="se-h-200"></view>
		<view class="se-pos-fixed se-flex-h-c se-bs-t se-w-750 se-h-200" style="background-color: #fff;bottom: 0;left: 0;">
			<view @click="onApply()" class="se-mb-20 se-br-20 se-w-400 se-ml-20 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-white se-bgc-green">
				<text class="se-ml-10">申请寻车</text>
			</view>
		</view>
	</view>
</template>

<script>
	import { queryApplyList } from "@/common/api.js"
	export default{
		data(){
			return{
				pageNo:1,
				pageSize:10,
				list:[]
			}
		},
		onLoad(options) {
			
		},
		onShow() {
			let that = this
			that.pageNo =  1
			that.list = []
			that.onPageList()
		},
		onPullDownRefresh() {
			let that = this
			that.pageNo =  1
			that.list = []
			that.onPageList()
		},
		onReachBottom() {
			let that = this
			that.pageNo = that.pageNo + 1
			that.onPageList()
		},
		methods:{
			onApply(){
				uni.navigateTo({
					url:"/pages_subpack/apply/index"
				})
			},
			onPageList(){
				let that = this
				let params={
					pageNo:that.pageNo,
					pageSize:that.pageSize
				}
				queryApplyList(params).then(response=>{
					console.info("queryApplyList",response)
					that.list = that.list.concat(response.result.records) 
				}).catch(error=>{
					
				})
			},
			onCustomerService(phone){
				let that = this
				// let obj = that.$utils.getkeyContent('phone')
				if (uni.canIUse('makePhoneCall')) {
					uni.makePhoneCall({
					  phoneNumber: String(phone),
					  success: function () {
						console.log('拨打电话成功');
					  },
					  fail: function () {
						console.log('拨打电话失败');
					  }
					});
				} else {
					console.log('你的设备不支持拨打电话功能');
				}
				
			}
		}
	}
</script>

<style>
</style>