Files
APP/pages/6170/share/index.vue

90 lines
1.6 KiB
Vue
Raw Permalink Normal View History

2025-07-16 16:43:22 +08:00
<template>
<view class="share">
<!-- 内容区域 -->
<view class="content">
<!-- 分享设备 -->
<view class="section" @click="shareDevice">
<text class="section-title">分享设备</text>
</view>
<!-- 分享管理 -->
<view class="section" @click="shareManagement">
<text class="section-title">分享管理</text>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
2025-07-19 10:22:48 +08:00
itemInfo:""
2025-07-16 16:43:22 +08:00
}
},
methods: {
// 分享设备
shareDevice(){
uni.navigateTo({
2025-07-19 10:22:48 +08:00
url: '/pages/6170/shareDevices/index',
events: {
ack: function(data) {}
},
success: (res) => {
res.eventChannel.emit('shareDevice', {
data: this.itemInfo,
});
}
2025-07-16 16:43:22 +08:00
});
},
// 分享管理
shareManagement(){
uni.navigateTo({
url: '/pages/6170/shareManagement/index'
});
}
2025-07-19 10:22:48 +08:00
},
onLoad() {
const eventChannel = this.getOpenerEventChannel();
// 监听 'shareDevice' 事件,获取传过来的数据
eventChannel.on('share', (data) => {
console.log(data,'datat');
this.itemInfo = data.data;
})
2025-07-16 16:43:22 +08:00
}
}
</script>
<style scoped>
.share {
padding: 30rpx;
background: #121212;
min-height: 100vh;
}
.status-bar {
/* 根据实际情况设置状态栏高度 */
width: 100%;
height: 20px;
background-color: #f3f3f3;
}
.title {
font-size: 20px;
margin-top: 10px;
}
.content {
width: 100%;
margin-top: 20px;
}
.section {
margin-bottom: 20px;
padding:50rpx;
border-radius: 16rpx;
background: rgba(26, 26, 26, 1);
text-align: center;
color: rgba(255, 255, 255, 0.87);
width: 100%;
}
</style>