index_draw_alert.vue 3.4 KB
<template>
	<view class="getDrawAlert" :style="{'padding-top':drawInfo.bgPdTop}">
		<view class="getDraw" :style="{'background': 'url('+drawInfo.bgImgUrl+') no-repeat','background-size': '100% 100%','width':drawInfo.bgImgWidth,'height':drawInfo.bgImgHeight}">
			<view class="drawInfo" :style="{'width':drawInfo.infoWidth,'height':drawInfo.infoHeight,'padding-top':drawInfo.infoPdTop}">
				<view class="alertTxt" v-for="(item,index) in drawInfo.content" :key="index">
					{{item}}
				</view>
				<view class="time" v-if="drawInfo.time != ''">
					{{drawInfo.time}}
				</view>
				<view class="address" v-if="drawInfo.address != ''">
					{{drawInfo.address}}
				</view>
				<view class="bottomBtn">
					<view v-if="drawInfo.btnList[0].type != 'program'" class="btnItem" v-for="(item,index) in drawInfo.btnList" :key="index" :style="{width:item.btnWidth}" @click="handle(item.type,item.url,item.type_id)">
						{{item.btnName}}
					</view>
					<view v-if="drawInfo.btnList[0].type == 'program'" class="btnItem" style="width: 100%;">
						<wx-open-launch-weapp
							id="launch-btn"
							username="gh_8a71dfc6644b"
						>
							<script type="text/wxtag-template">
								<style>.goMallWrap{color: #aa3a0c;font-size: 12px;font-weight: 600;text-align: center;line-height: 34px;}</style>
								<div class="goMallWrap">前往小程序领取</div>
							</script>
						</wx-open-launch-weapp>
					</view>
				</view>
			</view>
		</view>
		<view class="closeBtn">
			<image src="../static/image/guanbi_icon.png" mode="" @click="closeDrawAlert"></image>
		</view>
	</view>
</template>

<script>
	import wx from 'jweixin-module';
	export default{
		data(){
			return{
				
			}
		},
		props:{
			drawInfo:{
				type:Object
			},
			actId:{
				type:Number
			}
		},
		methods:{
			handle(type,url){
				if(type == 'share'){
					this.$emit('shareAlert')
				}
				if(type == 'navTo'){
					this.$emit('closeDrawAlert')
					this.$href(url)
				}
				if(type == 'close'){
					this.$emit('closeDrawAlert')
				}
				if(type == 'coupon'){
					//判断是否填写过获奖信息
					/* this.$request('/api/h5/haveInfo',{id:this.actId}).then((res)=>{
						console.log('是否填过获奖信息',res)
						if(res.data.have_id == 1){
							this.$href(url)
						}else{
							this.$emit('showPickInfo')
						}
					}) */
					this.$href(url)
				}
			},
			closeDrawAlert(){
				this.$emit('closeDrawAlert')
			}
		}
	}
</script>

<style>
	/* 中奖弹框区域 */
	.getDrawAlert{position: fixed;top: 0;bottom: 0;left: 0;right: 0;background: rgba(0,0,0,0.5);z-index: 3;display: flex;justify-content: center;}
	.getDrawAlert .getDraw{position: relative;display: flex;justify-content: center;}
	.getDraw .drawInfo{position: relative;}
	.drawInfo .alertTxt{font-size: 28rpx;color: #fff;text-align: center;}
	.drawInfo .time{font-size: 24rpx;color: #fff;padding-top: 24rpx;}
	.drawInfo .address{font-size: 24rpx;color: #fff;padding-top: 8rpx;}
	.drawInfo .bottomBtn{position: absolute;height: 68rpx;display: flex;justify-content: space-between;bottom: 0;width: 100%;}
	.bottomBtn .btnItem{background: linear-gradient(113deg,#fed96c 0%, #ff9060 100%);border-radius: 34rpx;font-size: 24rpx;font-weight: 600;text-align: center;line-height: 68rpx;color: #fff;}
	.getDrawAlert .closeBtn{position: fixed;width: 100%;height: 48rpx;top: 1038rpx;left: 0; display: flex;justify-content: center;}
	.closeBtn image{width: 48rpx;height: 48rpx;}
</style>