<template>
	<view :class="['cu-modal',show ? 'show' : '']">
	  <view class="cu-dialog">
	    <view class="cu-bar bg-white justify-end">
	      <view class="content">{{title || '提示'}}</view>
	      <view class="action" @click="()=>{$emit('update:show',false);$emit('cancel')}">
	        <text class="cuIcon-close text-red"></text>
	      </view>
	    </view>
	    <view class="padding-xl">
	      {{content}} <slot v-if="!content" />
	    </view>
	    <view class="cu-bar bg-white justify-end">
	      <view class="action">
	        <button v-if="cancelShow" class="cu-btn line-green text-green" @click="()=>{$emit('update:show',false);$emit('cancel')}">{{cancelText}}</button>
	        <button v-if="openType=='getPhoneNumber'" open-type="getPhoneNumber" class="cu-btn bg-green margin-left" @getphonenumber="(e)=>{$emit('update:show',false);$emit('confirm',e)}">{{confirmText}}</button>
	        <button v-else class="cu-btn bg-green margin-left" @click="()=>{$emit('update:show',false);$emit('confirm')}">{{confirmText}}</button>
	      </view>
	    </view>
	  </view>
	</view>
</template>

<script>
	export default{
		props:{
			show:{type:Boolean,default:()=>false},
			title:{type:String,default:''},
			content:{type:String,default:""},
			cancelShow:{type:Boolean,default:()=>true},
		    confirmText:{type:String,default:"确定"},
		    cancelText:{type:String,default:"取消"},
			openType:{type:String,default:""}
		}
	}
</script>

<style>
</style>