增加layout页面组件

This commit is contained in:
aihe 2024-04-29 14:51:51 +08:00
parent 6e573512a7
commit b247fdf803
5 changed files with 251 additions and 214 deletions

View File

@ -167,6 +167,7 @@ const dateRangeList = [
] ]
const pageEventNames = { const pageEventNames = {
globalClick: "globalClick", // 全局页面 click事件
chooseAddress: "chooseAddress", // 地址选择 chooseAddress: "chooseAddress", // 地址选择
} }

View File

@ -0,0 +1,36 @@
<template>
<view @click="handleClick" style="height: 100%;">
<slot></slot>
</view>
</template>
<script>
import { pageEventNames } from "@/common/enum"
export default {
props: {
},
data() {
return {
}
},
created() {
},
onHide() {
},
unmounted() {},
methods: {
handleClick() {
uni.$emit(pageEventNames.globalClick)
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@ -33,6 +33,8 @@
import ContentItems from "./content-items" import ContentItems from "./content-items"
import DefaultSelectInput from "./default-select-input" import DefaultSelectInput from "./default-select-input"
import { transListKeyTitle } from "@/common/util" import { transListKeyTitle } from "@/common/util"
import { pageEventNames } from "@/common/enum"
const modeEnum = { const modeEnum = {
sheet: 'sheet', sheet: 'sheet',
drop: 'drop' drop: 'drop'
@ -141,18 +143,15 @@
} }
}, },
created() { created() {
uni.$on('click', this.handleDocumentClick); uni.$on(pageEventNames.globalClick, this.handleDocumentClick);
// document.addEventListener('click', this.handleDocumentClick)
}, },
unmounted() { unmounted() {
uni.$off('click', this.handleDocumentClick); uni.$off(pageEventNames.globalClick, this.handleDocumentClick);
// document.removeEventListener('click', this.handleDocumentClick)
}, },
methods: { methods: {
handleDocumentClick(){ handleDocumentClick(){
debugger
this.show = false this.show = false
}, },
handleSelectSwitch() { handleSelectSwitch() {

View File

@ -1,4 +1,5 @@
<template> <template>
<tpx-page>
<tpx-layout> <tpx-layout>
<template v-slot:body> <template v-slot:body>
<view class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;"> <view class="com-jianju pos-rlt pb-30" style="padding-top: 2rpx;">
@ -232,7 +233,7 @@
<bpe-goodsize-tmp :value="tempObject.value"></bpe-goodsize-tmp> <bpe-goodsize-tmp :value="tempObject.value"></bpe-goodsize-tmp>
</view> </view>
</buns-edit-sheet> </buns-edit-sheet>
</tpx-page>
</template> </template>
<script> <script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB