<template>
	<view class="app">
		<u-navbar :is-back="false" :background="background" class="u-navbar">
			<image src="@/static/pagesB/fanhui.png" mode="" @tap="goprevious"></image>
			<view class="title" @tap="goprevious">
				服务预约
			</view>
			<view class="inputs">
				<i class="icon"></i>
				<input v-model="projectName" type="text" name="" id="" class="input" placeholder="搜索服务"
					placeholder-class="placeholder">
			</view>
		</u-navbar>
		<view class="content" v-for="(item ,index) in listinfo" :key="index">
			<view class="big">{{item.projectName}}

			</view>
			<view class="servename">
				{{item.packageName}}
			</view>
			<view class="appoint" @tap="goapponint(item)">
				预约
			</view>
		</view>

	</view>
</template>

<script>
	import {
		getForm,

	} from '@/api/pagesC/ServiceAppointment/ServiceAppointment.js'
	export default {
		data() {
			return {
				background: {
					backgroundColor: '#26A888',
				},
				projectName: '',
				identity: '372431196910127051',
				region: '',
				listinfo: [],
				appointlist:[],
				packageNo:'',
				formName:'',
				formNo:'',

			};
		},
		onShow() {
			this.getlist()
		},
		watch: { //监听
			projectName(e) {
				this.getlist()
			},
		},
		methods: {
			getlist() {
				this.userinfo = uni.getStorageSync('userinfo');
				// this.identity=this.userinfo.cardNo
				this.region = this.userinfo.cityCode;
				getForm(this.identity, this.region, this.projectName).then(res => {
					// console.log(res, '555')
					this.listinfo = res.data
				})
			},
			goprevious() {
				uni.navigateBack({
					delta: 1
				})
			},
			goapponint(item) {

			console.log(item,'56')
						uni.navigateTo({
							// url: '/pagesC/appointmenttime/appointmenttime',
							url: `/pagesC/appointmenttime/appointmenttime?item=${JSON.stringify(item)}`
						})
					// }



			}
		},
	}
</script>

<style lang="scss">
	@import './ServiceAppointment.scss'
</style>
