// 使用的页面 通过 id 获取 nvue 子窗体
const subNVue = uni.getSubNVueById('promote');
subNVue.show('', 250, () => {
uni.$emit('promote', this.promotionData)
});

子nvue页面  必须是nvue

<template>
<div class="popup-share">
<image class="popup" src="/static/extension/popup.png" mode="widthFix">
<image class="popup-btn" src="/static/extension/popup-btn.png" mode="widthFix" @click="copy">
<image class="popup-close" src="/static/extension/popup-close.png" mode="widthFix" @click="subNVue.hide()">
</div>
</template>

<script>
export default {
data() {
return {
promotionData: {},
subNVue: null,
}
},
onLoad() {
// uni.getCurrentSubNVue().addEventListener("show", function() {
// console.log("subNVue子窗体已显示!")

// });
// uni.getCurrentSubNVue().addEventListener("hide", function() {
// console.log("subNVue子窗体已隐藏!")

// });
this.subNVue = uni.getSubNVueById('promote');
uni.$on('promote', res => {
this.promotionData = res;
})
},
onUnload() {
uni.$off('promote');
},
methods: {
// 复制链接
copy() {
uni.setClipboardData({
data: this.promotionData.promote_url,
success: res => {
uni.showToast({
icon: 'success',
title: '复制成功',
duration: 2000
});
}
});
}
}
}
</script>

<style lang="scss" scoped>
.popup-share{
display: flex;
justify-content: center;
align-items: center;
width: 676rpx;
position: relative;
}
.popup{
position: absolute;
left:0;
top:0;
width: 676rpx;
}
.popup-btn{
position: relative;
top: 500rpx;
width: 396rpx;
}
.popup-close{
position: relative;
top: 620rpx;
width: 52rpx;
}
</style>



pages.json里面
  ,{
"path" : "pages/player/player",
"app-plus": {
"softinputMode": "adjustResize"
},
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false,
"app-plus": {
"subNVues": [
{
"id": "promote",
"path": "components/modal/modal-promote",
"type": "popup",
"style": {
"position": "dock",
"dock": "bottom",
"width": "676rpx",
"height": "800rpx",
"margin": "auto",
"background": "transparent"
}
}
]
}
}
}