//添加绑定
<template>
	<view class="center">
		<view class="form_data">
			<view class="flex row">
				<view class="left-text">车队长名字</view>
				<u--input placeholder="请输入车队长名字" inputAlign='right' border="none" v-model="fleet.name" maxlength="6">
				</u--input>
			</view>
			<view class="flex row">
				<view class="left-text">车队长账号</view>
				<u--input placeholder="请输入车队长账号" inputAlign='right' border="none" v-model="fleet.name" maxlength="11">
				</u--input>
			</view>
		</view>
		<view class="btn_css">
			<u-button type="primary" text="绑定" @click="submit"></u-button>
		</view>
		<u-toast ref="uToast"></u-toast>
		<u-modal :show="tipsShow" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
			confirmColor='#2772FB' @confirm="$u.throttle(confirmClick, 5000)" @close="cancelClick" @cancel="cancelClick"></u-modal>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				fleet: {},
				tipsShow:false,
				alertTitle:"确定绑定后请及时联系车队长接受绑定，避免造成您的财产损失"
			}
		},
		onLoad() {

		},
		onShow() {

		},
		methods: {
			submit(){
				this.tipsShow = true
			},
			confirmClick() {
				this.tipsShow =false
				uni.showLoading({
					mask: true,
					title: '加载中'
				})
				this.$request.baseRequest('post', '', this.dataDetails).then(res => {
						if (res.code == 200) {
							uni.hideLoading()
							this.$refs.uToast.show({
								type: 'success',
								message: "绑定成功！",
								complete() {
									uni.navigateBack({
										delta: 1
									});
								}
							})
						} else {
							uni.hideLoading()
							uni.$u.toast(res.message);
						}
					})
					.catch(res => {
						uni.hideLoading()
						uni.$u.toast(res.message);
					});
			}
		},
		cancelClick(){
			this.tipsShow = false
		}
	}
</script>

<style lang="scss" scoped>
	.center {
		padding: 20rpx 30rpx;
	}

	.form_data {
		.row {
			border-bottom: 1px solid #EEEEEE;
			padding-bottom: 28rpx;
			margin-top: 26rpx;

			.ch-style {}
		}

	}

	.btn_css {
		margin-top: 30rpx;
	}
</style>
