<template>
	<!-- 邀请师傅模态框 -->
	<view class="cu-modal" :class="isShow?'show':''">
		<view class="cu-dialog bg-white">
			<view class="cu-bar bg-white justify-end solid-bottom">
				<view class="content">邀请</view>
				<view class="action" @click="hideModal">
					<text class="cuIcon-close text-red"></text>
				</view>
			</view>
			<view class="padding-xl text-left bg-white">
				<!-- <view class="margin-top-sm">
					<text>团队成员师傅ID：</text>
					<input class="radius-input margin-top-sm" type="text" v-model="workerId"></input>
				</view> -->
				<!-- <view>
					<text>成员师傅备注：</text>
					<input class="radius-input margin-top-sm" type="text" v-model="workerName"></input>
				</view> -->
				<view>
					是否确认加入{{inviteMasterObj.name}}的团队？
				</view>
			</view>
			<view class="cu-bar bg-white solid-top">
				<view class="action margin-0 flex-sub text-black" @tap="hideModal">取消</view>
				<view class="action margin-0 flex-sub text-main-color solid-left" @tap="hideModal"
					@click="confirm">确定</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		name: 'invite-master',
		emits: ['confirm'],
		props: {
			inviteMasterObj: {
				type: Object,
				default: {}
			}
		},
		data() {
			return {
				isShow: false,
				workerId: null,
				// workerName: ''
			}
		},
		methods: {
			showModal() {
				this.isShow = true
			},
			hideModal() {
				this.isShow = false;
				this.resetData();
			},
			resetData() {
				this.workerId = null
				// this.workerName = ''
			},
			confirm() {
				this.$emit('confirm', {
					leaderId: this.inviteMasterObj.workerId,
					workerId: this.$request.getCurUserInfo().workerId,
					// workerName: this.workerName
				});
			}
		}
	}
</script>

<style>
</style>
