|
|
@@ -25,7 +25,7 @@
|
|
|
<!-- 完善信息提示,-->
|
|
|
<PrefectInfo />
|
|
|
<!-- 申请成为ib,-->
|
|
|
- <IbInfo />
|
|
|
+ <IbInfo ref="ibRef" />
|
|
|
|
|
|
<view class="content-wrapper" :class="{ 'content-wrapper-padding': isContentPadding }">
|
|
|
<!-- <cwg-header /> -->
|
|
|
@@ -45,7 +45,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { ref, computed } from 'vue'
|
|
|
+import { ref, computed, onMounted, onUnmounted } from 'vue'
|
|
|
import { onLoad, onShow } from '@dcloudio/uni-app'
|
|
|
import useRoute, { updateRoute } from '@/hooks/useRoute'
|
|
|
import useRouter from '@/hooks/useRouter'
|
|
|
@@ -88,12 +88,33 @@ const isTabBarPage = ref(false)
|
|
|
|
|
|
const rightDrawerRef = ref<any>(null)
|
|
|
const noticeDrawerRef = ref<any>(null)
|
|
|
-uni.$on('open-notice-drawer', (data) => {
|
|
|
- console.log(121212)
|
|
|
+const ibRef = ref<any>(null)
|
|
|
+
|
|
|
+// 事件处理函数
|
|
|
+const handleOpenIb = () => {
|
|
|
+ if (ibRef.value) ibRef.value?.getInfo()
|
|
|
+}
|
|
|
+
|
|
|
+const handleOpenNoticeDrawer = () => {
|
|
|
noticeDrawerRef.value?.open()
|
|
|
-})
|
|
|
-uni.$on('open-right-drawer', (data) => {
|
|
|
+}
|
|
|
+
|
|
|
+const handleOpenRightDrawer = () => {
|
|
|
openRightDrawer()
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ // 只在组件挂载时注册事件监听器
|
|
|
+ uni.$once('open-ib', handleOpenIb)
|
|
|
+ uni.$on('open-notice-drawer', handleOpenNoticeDrawer)
|
|
|
+ uni.$on('open-right-drawer', handleOpenRightDrawer)
|
|
|
+})
|
|
|
+
|
|
|
+onUnmounted(() => {
|
|
|
+ // 在组件销毁时移除事件监听器
|
|
|
+ uni.$off('open-ib', handleOpenIb)
|
|
|
+ uni.$off('open-notice-drawer', handleOpenNoticeDrawer)
|
|
|
+ uni.$off('open-right-drawer', handleOpenRightDrawer)
|
|
|
})
|
|
|
|
|
|
function openRightDrawer() {
|
|
|
@@ -130,6 +151,11 @@ onLoad(() => {
|
|
|
onShow(() => {
|
|
|
updateRoute()
|
|
|
})
|
|
|
+onUnmounted(() => {
|
|
|
+ uni.$off('open-ib')
|
|
|
+ uni.$off('open-notice-drawer')
|
|
|
+ uni.$off('open-right-drawer')
|
|
|
+})
|
|
|
|
|
|
</script>
|
|
|
|
|
|
@@ -208,6 +234,12 @@ onShow(() => {
|
|
|
z-index: 9;
|
|
|
}
|
|
|
|
|
|
+@media screen and (max-width: 1504px) {
|
|
|
+ .content-wrapper-padding {
|
|
|
+ padding: 0 px2rpx(16);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
@media screen and (max-width: 991px) {
|
|
|
.content-wrapper-padding {
|
|
|
padding: 0 px2rpx(16);
|