this.$nextTick(() => {
this.$refs.yunpop.open();
});
<yunpop
ref="yunpop"
:mydata="mydata"
@GetGoodsNotice="GetGoodsNotice"
></yunpop>
<template>
<view class="myoverlay" @click="close" v-if="show">
<view class="mycontent">
<section class="posi">
<div class="mybot" @click="close">
<block v-if="mydata.arg_status === 0 ? false : true">
<u-button
type="primary"
:plain="true"
text="关闭"
@click="close"
></u-button>
<view class="" style="width: 10px"> </view>
</block>
<u-button
@click="confirm"
type="primary"
:text="mydata.arg_status === 0 ? '关闭' : '同意'"
></u-button>
</div>
</section>
<view class="mycontent2" v-html="mydata.content"> </view>
</view>
</view>
</template>
<script>
export default {
props: ["mydata"],
data() {
return {
show: false,
};
},
methods: {
open() {
console.log(1111111, 11111);
this.show = true;
},
close() {
console.log(1111111, 11111);
this.show = false;
},
confirm() {
if (this.mydata.arg_status === 0) {
this.close();
return;
}
this.$post(
"/Sale/ArgGoodsNotice",
{
id: this.mydata.id,
status: "0", //0=同意;1=不同意
},
{
isLoading: false,
}
).then((res) => {
this.close();
this.$emit("GetGoodsNotice");
});
},
},
};
</script>
<style lang="less" scoped>
.myoverlay {
position: fixed;
width: 100%;
height: 100%;
top: 0;
left: 0;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
background: rgba(0, 0, 0, 0.7);
z-index: 10000;
}
.mycontent {
position: relative;
width: 610/2px;
border-radius: 10px;
.mycontent2 {
padding: 20px;
position: relative;
width: 100%;
height: 500px;
background-color: white;
overflow-y: auto;
font-size: 28px/2;
color: #666666;
border-radius: 10px;
line-height: 1.7;
padding-bottom: 80px;
}
}
.posi {
z-index: 999;
position: absolute;
width: 100%;
bottom: 0;
left: 0;
background-color: #fff;
border-top: 1px solid rgb(214, 215, 217);
}
.mybot {
display: flex;
justify-content: space-between;
padding: 10px 20px;
}
</style>
uniapp 弹窗固定高度
于 2023-10-24 14:49:59 首次发布