<!--
based on 
 https://ext.dcloud.net.cn/plugin?id=672
 https://github.com/steffenx/uniapp_popup
  
 *数组形式传值
 *type,类型 success warn info fail loading（string），默认info
 *content,内容（string）
 *duration,消失时间（Number），默认2000
 *distance,弹窗间距，默认128，可设为0代表重叠
 *isClick,是否点击消失（Boolean），默认false
 -->
<template>
	<view class="popup_list">
		<view v-for="(toast,index) of popup_list" :id="toast.uuid" :key="toast.uuid" >
			<view class="mpopup" :style="{ background: toast.color ,top:index*toast.distance+50+'px'}" :class="[toast.animator,toast.typeClass]" @click="close(toast.uuid,index)">
				<view class="icon" :style="{ backgroundImage: `url(${toast.icon})` }" ></view>
				<text class="text" :style="{ color: toast.colortext }">{{ toast.content }}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return{
				popup_list:[],//弹窗数组
			}
		},
		props:{
		},
		methods:{
			init:function(toast){
				if (toast.type == 'success') {
					toast.icon = toast.icon || 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAATFUlEQVR4Xu1dCXhU5bl+vzOTkEzCEgQEBEmUPShiMjMBryLaR7EXt2Jxt3Bb27pcqxYSpLdtfHAhwaWb1qVq8WoVLGor94raC7gBORMWlSAgS+KCyBqBTBZmznef/yTBkGXOmZmzzEzOeR6ePA/z/9/yfu+c+Zfv/35CCj4PfnxGDjWl50ORxkhMY5h4NDH1ZWIPAR4GPAA8BOot3GfwtwCCBARZ/GUKMvFBYtqiEH8qEW8O92jcfM+ZnxxKNbgoFRwqqyyYgrBrMgHnMpBPhJPN8IsZ3xBQxcD7kqSsmuOtXGWGHitlJh0BSnflZmTtHTCJiScDEP+KAOphJWjf6eJGAGuZaZUgRF2//WtL86ob7LElNq1JQYBShpRV6b1AYcwg4EqA+sXmrtm9eD+AVxlYUu8NrCwlKGZrjFd+whJABN0T8J4L4IcApgM0MF5nre3PewAsBdPioE/+MFHJkJAEKK/wTQPxXIDOsTZo5mhjxgcsKQ/M9Va+aY6G2KUm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BNVxxgaW0IAYZdYOt4V8M4nQKSXWaY3Bkzs62LBK7+9c5YHYmGFbyIT/wmgs+1DOhE183piun2OX7a0brPlBFBnCQzJI/vEXaz3gdArEcNhmU2MwyD+TdAb+KMZo3wtP2whQKtR5bJXDAzFtvLVWoam3ucsKlEvAnBPsS+wxy7/bCVAq9MPBgonSEz3E+gSu4CwVi8vDxPP6+y0rrV2tKsRZLXy9vrE3QWQlN+kLhF4OSvSvV0d1LQD/4R4A7R3fGFlgZ8VaQFA2nfH2IFa1Dp5FUnK3DmF6yqi7mpyh4QkQJsxglg3KE1eIvAqYX+xL9D1ZQYmB1hLfEIToNV49WRSMPNSVqQbQPx9AqVrOWbH56IIMwFvkKS8WOepf7M0v0rfXTZ2GNuiMykI0Bafx6rys48ezfoeAVMh/tl47a1qF6MGxG8R03JPdt078WboWM2FpCNAe4AeqiwYHWaaCkUShJhsdsl78S0H8C4kZTkk5a2SgvWfWh00I/UlPQHag7GgsuBUKewaRsTDFCbxN5eZhhLQh4k9BHgYEHfGeQikXiLE4G8BBAkIsvjLJP7WErG4k66GiWuYqcbtDtXMPntDjZEBsFvW/wMrTeUeO6KNKAAAAABJRU5ErkJggg==' 
					toast.typeClass='mpopup-success';
					return toast;
				}
				if (toast.type == 'warn') {
					toast.icon = toast.icon || 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAAMlElEQVR4Xu2daZBcRR3Af/+dkKSSDUcUEikkJAVypBACEsLNEo6AAaHQJRyVzQyhELQU+GLwAyTF+UkRUaECMxsEy6yioimzMUoSCRoSjkgVZ4HJRsFEjtwxx+621T0zu7OzszNvZt6bmdevu2pqPrz3uv/H7/Xr89+ChUk9y2HsZTJNnIjiROAEYCzCKMj8FKMQDjHqK7Yj7IHMT5n/z4B3EN5GeIuDeEtuZKtt5hIbFFJP0UITFwDnoZiMMC4QvRRbEN4EXgRWSpyVgZRTw0xDB4BKMRLF2WAcrn/TEEbU0Gb9RSn2AWsQA4L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gSDJ4Yjpikx1TgzAAopXGMnlcgOf+JW7rwAYCJ5gFAexBKHFLyFdPtqwLKWZa6WV//lpD98BMBDo2cPdLAJm+SlshPP6FV3M8jK7V66NAgHAQKAQ9DoC4b5IHExdruW93d+DcC9tPCiC3tjhewoMgKykqp3zUSwGxvsuvd0Z6oM8rpM5posdWAocAFMbLGQcMRYjXBCYJjZlrL/3PcTlFrYErVZNAMi0C/TQ8X2IWV5Ws3KDNqDP+Qde5efLW3NHqEWcRQ+PIZzms/HCnZ3iNWJ8W9pqG7e55gCY2mA+TUxAx2K5Hzg43J6rWvodwD108eMgWvmlpKsLAH0NxBTjUTyiGzulBLXwum7V667y3RJnc730qysAfSAsYgo9PIBweb0MUeNyO2ni+4V269ZYjsZqjJmzCxT3WAxCJ6CjdBTcqFlr5+vyGqIGyFdcJTkT4WEgs2ivHqbxtcyVKOZJgpd9zdWHzBoSgL5PQ5ILEHOmUVhB0I6fLwlW+eCrQLJoaAD6QNBzC3u4EsVNwBXA8ECsUX2me4E/oHiWZpZKK/urzzLYHEIBQK4JVAfN7OZiYAaKGXU/9lbRpUNMo+hkDMurXaETrLsH5x46AAa1F1KckAODHmoOOuT9XhSrEDqJsUxm83atneZneaEHYBAQT3M0PUxAMcEMN/Wio0DoLe6HIoyCzE8xCiG9T1yxHWEPZH7K/OvzE/4FdCGZXzddMte88dak/wOb8wTHm1k+8AAAAABJRU5ErkJggg=='
					toast.typeClass='mpopup-warn';
					return toast;
				}
				if (toast.type == 'info') {
					toast.icon = toast.icon || 'data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTgyMjYwODY5MzA1IiBjbGFzcz0iaWNvbiIgdmlld0JveD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e8fzDL4uYP0/xnhSmrRChIUAAAAASUVORK5CYII='
					toast.typeClass='mpopup-fail';
					return toast;
				}
				if (toast.type == 'loading') {
					toast.icon = toast.icon || 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAYAAADDPmHLAAANfElEQVR4Xu1dTUxc1xX+zvOP7JAmkEiVkGIXL1q8C4M3rY0VWASriwbYxd0Y1jUySI3VnWFX2ZGC5VZd2tkUd8XQLqq4C4NinG7sgVXTduGxHQm1UgK0YLeOeac6b964GGY87/49mPfukywLzf0957vnnnvOuecS/BdRoOdP3MshBojQxYwOInTEpJmL/y8+38Tsn39M5SyRjLI0GZ25nLzFwwHwCYDWhPXnQJi88z5VgZGw2t4sllsAnLzFXQRcJ6BLhzXMmFo4Q+M6dfdSnVwCQMQ9GDMKq74mzxhY3DiAvsU+Wt1LTFUZS+4AICs/AG6bMr9KZAHBQj8VVIi+l8rmCgBdt7m15RlKWxQ8K7xg4MZCP41YaSzlRnIFgFOf8Q0inHNCY0JfMyqGuQHAD//IHfv34YET5lcanbvTT30O23fSdG4AcPIWTwXABSdUjBsNgcLdflp02YfttnMDgFOf8SIR3rVNwK3tMWF84X2actmH7bZzAYAUxH+VL/N3+qnXNpNctpcLAMTnfjn6Of2YUV44Q8ecdmK5cQ8AywS9009NRdNUB3v2Lg8y410K0cX0wvZeBqEcALO/PeVGgYrt/dct87pmcx4A28jy4RfcgU1cImC4EQMYKIuN/Xen6Wqjsiq/p7UFyJg8ALZw5uwCT4HVj14CBDBGbp6243FLEQBeCRT+y6qnzcjZouVpq2KICSM3T9ENldVer2zPLRaHzZs22qrXRghcvdtPYy77sN22dR0gYv5zlPD/Pd50zOPTPeZna6dm4HiGm4yhL85Q0XTCada3CoDBErce3og8bUYrfzsBmNFnuh243gYYeLjQT9UoojR5aNSXVQB8+DlPEOGS0YhqVWasPn0dx4oFM797zy2WKJ73rI8PQAiM3O23s125GF+9Nq0BwIHof2nMzJi8eZomTIgTxwKUTNqoiU/G0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XK4gS4dolShjzi+OXBJKUKcCcq8BPOfJB8T2dJKsyfB1tQxYjdJP0abtMagCwPXCV9mYfG0Xb1O0qBPpc2wZU5qlT1gNAh2pxHQ8AA+KlWdVLgPrUzocEeMTygEJjJVQRlV4CKBJst4r//iseY8V4+0ZjlZc3Bo/adU416tPF77mQADPL3BE8t/w4NmN24Kh6BI4LJpq0mQsACIFs6wFZEP9Cl9wAwLIxaH7giHoErslKdVU3NwCIpYCxQUj2fj6ArqF285u5rpiq0m6uABCBwMAjGDE/QO/QO+qxdypMSbNs7gAQSwJxUl1QIbSkxZe0+Vlifq50gO3Mjt3DAoQkLuvJ8HVMNbvdvxbgcykBthLiD494MCRETipmdBHhTVntkYOKUNzch2JW9vtaAPgfJ9PwVVAvMLMAAAAASUVORK5CYII='
					toast.typeClass='mpopup-loading';
					return toast;
				}
			},
			open:function(toast){
				//生成uuid
				let uuid=this.guid();
				toast.uuid=uuid;
				//添加动画
				toast.animator='fade_Down';
        
				toast.isClick = toast.isClick || false //判断是否可点击消失/可控制消失
        toast.duration = toast.duration || 1500
				toast.distance = toast.distance || 128 // 弹窗间距
        toast.type = toast.type || 'info'
        
				//初始化
				let newToast=this.init(toast);		
				//添加进数组
				this.popup_list.push(newToast);
		
				if(!newToast.isClick){
					this.disappear(newToast.uuid,newToast.duration);
				}//可点击消失
				else{
					this.$emit('uuidCallback',newToast.uuid);
				}
				
			},
			//自动消失
			disappear:function(uuid,duration){
				//退出动画之后，短暂延迟后移除本元素
				this.fade_out_animator(uuid,duration).then(res=>{
					setTimeout(()=>{
						for(let i=0;i<this.popup_list.length;i++){
							if(this.popup_list[i].uuid==res){
								//移除本元素
								this.popup_list.splice(i,1);
								this.$forceUpdate()
							}
						}
					},250)
				});
			},
			fade_out_animator:function(uuid,duration){
				//duration秒后退出
				if(!duration||typeof(duration)!='number'){duration=1500;}
				return new Promise(res=>{
					setTimeout(()=>{
						for(let i=0;i<this.popup_list.length;i++){
							if(this.popup_list[i].uuid==uuid){
								//添加退出动画
								this.popup_list[i].animator='fade_Top';
								res(uuid);
							}
						}
					},duration)
				})
			},
			//可控制关闭的弹出框
			close:function(uuid,ind){
				if(ind){
					if(!this.popup_list[ind].isClick){return}
				}
				this.remove_element(uuid).then((res)=>{
					setTimeout(()=>{
						for(let i=0;i<this.popup_list.length;i++){
							if(this.popup_list[i].uuid==res){
								//移除本元素
								this.popup_list.splice(i,1);
								this.$emit('closeCallback',uuid);
								this.$forceUpdate()
							}
						}
					},250)
				})
			},
			//控制移除元素
			remove_element:function(uuid){
				return new Promise(res=>{
					for (var i = 0; i < this.popup_list.length; i++) {
						if(this.popup_list[i].uuid==uuid){
							this.popup_list[i].animator='fade_Top';
							res(uuid)
							break;
						} 
					}
				})
				
			},
			//更新
			update:function(update_list){
				for (var i = 0; i < this.popup_list.length; i++) {
					if(this.popup_list[i].uuid==update_list.uuid){
						this.popup_list[i].type=update_list.type;
						this.init(this.popup_list[i]);
						this.popup_list[i].content=update_list.content;
						break;
					} 
				}
			},
			//生成uuid
			guid:function() {
			    return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
			        var r = Math.random()*16|0, v = c == 'x' ? r : (r&0x3|0x8);
			        return v.toString(16);
			    });
			}
		}
	}
</script>

<style lang="scss">
	.mpopup{
		display: flex;
		flex-direction: column;
		text-align: center;
		justify-content: center;
		align-items: center;
		min-height: 45px;
		max-width: 80%;
		transition :all .5s;
		position: fixed;
    right:0;
    left:0;
		margin: 0 auto;
		border-radius: 5px;	
		z-index:998;
    @media screen and (min-width: 751px) { max-width: 500px }
		
    .icon{
			display: flex;
			text-align: center;
			justify-content: center;
			width: 32px;
			height: 32px;
			margin: 20px;
			background: no-repeat center center / contain;
		}
		.text{
			margin: 0px 20px 20px 20px;
			font-size: 16px;
		}
	}
	.mpopup-success{
		background: #f0f9eb;
		border: 1px solid #e1f3d8;
		color: #67c23a;
	}
	.mpopup-fail{
		background: #fef0f0;
		border: 1px solid #fde2e2;
		color: #f56c6c;
	}
	.mpopup-warn{
		background: #fdf6ec;
		border: 1px solid #faecd8;
		color: #e6a23c;
	}
	.mpopup-info{
		background: #edf2fc;
		border: 1px solid #ebeef5;
		color: #909399;
	}
	.mpopup-loading{
		background: #e2f5ff;
		border: 1px solid #ceeeff;
		color: #5cbaff;
		image{
			animation: rotate360 1.5s ease infinite;
		}
	}
	.fade_Down{
		animation: fadeInDown 0.6s both;
	}
	.fade_Top{
		animation: fadeInTop 0.5s forwards;
	}
	/*从上到下*/
	@keyframes fadeInDown
	{
	    from {
	        opacity: 0;
	        -webkit-transform: translate(0,-100px); 
	        transform: stranslate(0,-100px); 
	    }
	    to {
	        opacity:1;
	        -webkit-transform: translate(0,10px);
	        transform: stranslate(0,10px);
	    }
	}
	/*从下到上*/
	@keyframes fadeInTop
	{
	    from {
	        opacity:1;
	        -webkit-transform: translate(0,10px); 
	        transform: stranslate(0,10px);
	    }
	    to {
	
			opacity: 0;
			-webkit-transform: translate(0,-100px);
			transform: stranslate(0,-100px);
	    }
	}
	@keyframes rotate360
	{
		from {
			transform: rotate(0);
		}
		to{
			transform: rotate(360deg);
		}
	}
</style>
