<template>
	<view class="se-m-10">
		<view class="se-px-20 se-pt-10 se-zi-s">
			<u-search height="40" placeholder="搜索" :showAction="true" v-model="keyword"></u-search>
		</view>
		<view class="se-m-20 se-br-20 se-bs-b se-bgc-white se-py-20 se-px-30" v-for="(items,indexs) in tList" :key="indexs" @click="onMasterDetail(items)">
			<view class="se-flex se-flex-h-sb">
				<view class="se-flex">
					<text class="se-fw-6 se-c-black se-fs-30">{{items.title}}</text>
				</view>
				<view class="se-c-orange se-fs-32 se-fw-6">
					{{items.moneymin}}-{{items.moneymin}}k
				</view>
			</view>
			<view class="se-py-10">
				<text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5" v-if="items.payType_dictText">{{items.payType_dictText}}</text>
				<text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5" v-if="items.industryName">{{items.industryName}}</text>
				<text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5" v-if="items.companyName">{{items.companyName}}</text>
				<!-- 	<text class="se-c-text-sub se-fs-22 se-mr-10 se-py-5 se-px-20 se-br-5 se-bgc-f5">水泥搬运</text> -->
			</view>
			<view class="se-flex se-flex-h-sb">
				<view class="se-flex">
					<u-icon class="se-ml-10" name="map"></u-icon>
					<text class="se-c-text-sub se-fs-24 se-pr-10">{{items.distances}}km</text>
					<text class="se-c-text-sub se-fs-24 se-pl-10 se-b-l">{{items.workAddress}}</text>
				</view>
				<!-- <view class="se-c-text se-c-text-sub se-fs-24">
					09月23日 16:20
				</view> -->
				<view class="se-flex se-flex-h-c se-py-10 se-px-20 se-br-12 se-fs-22 se-c-orange se-bgc-ffd se-fw-6">
					<text class="se-ml-5">立即接单</text>
				</view>
			</view>
		</view>
		<u-empty v-if="tList && tList.length==0" mode="list"></u-empty>
	</view>
</template>

<script>
	import {
		bannerList,
		taskList,
		rolelist,
		industryList,
		getSysText
	} from "@/common/api.js"
	export default{
		data(){
			return{
				tpageNo:1,
				tpageSize:20,
				tList:[],
				id:null,
				keyword:""
			}
		},
		onLoad(options) {
			this.id=options.id
			this.onTaskList()
		},
		onReachBottom() {
			let that = this
			that.rpageNo = that.rpageNo + 1
			that.onTaskList()
		},
		methods:{
			onTaskList(){
				taskList({
					latitude:uni.getStorageSync("latitude"),
					longitude:uni.getStorageSync("longitude"),
					pageNo:this.tpageNo,
					pageSize:this.tpageSize
				}).then(response=>{
					if(this.tpageNo==1){
						this.tList = response.result.records
					}else{
						this.tList = this.tList.concat(response.result.records)
					}
				}).catch(error=>{
					
				})
			},
			onMasterDetail(event){
				console.info(event)
				uni.navigateTo({
					url:"/pages_subpack/work-detail/index?id="+event.id
				})
			}
		}
	}
</script>

<style>
</style>