<template> <view class="a_h_home"> <view class="a_h_body" v-if="show"> <image @click="open()" class="a_h_bg" mode="widthFix" src="https://lihai001.oss-cn-chengdu.aliyuncs.com/public/uploads/new_activity/tow_price_card.webp"></image> <image v-if="showClose" @click.stop="close()" class="a_h_close" src="../static/images/wt_close.png"></image> </view> </view> </template> <script> export default { props:{ showClose: { type: Boolean, default: true } }, data(){ return { show: true } }, methods:{ open(){ this.$emit('click'); }, close(){ this.show = false; } } } </script> <style lang="scss"> .a_h_home{ position: fixed; bottom: 25vh; right: 30rpx; z-index: 10; width: 180rpx; // height: 150rpx; .a_h_bg{ height: 100%; width: 100%; } .a_h_body{ width: 100%; height: 100%; // background-color: #eee; position: relative; .a_h_close{ position: absolute; right: 5rpx; top: 5rpx; width: 30rpx; height: 30rpx; background-color: rgba(#000, 0.4); border-radius: 50%; } } } </style>