解决冲突

dev
water_xu 2024-07-11 16:15:39 +08:00
parent 93666ae7e7
commit 895a4a7829
2 changed files with 166 additions and 66 deletions

View File

@ -0,0 +1,166 @@
<template>
<view v-if="visibleSync" :class="{ 'uni-drawer--visible': showDrawer }" class="uni-drawer" @touchmove.stop.prevent="clear">
<view class="uni-drawer__mask" :class="{ 'uni-drawer__mask--visible': showDrawer && mask }" @tap="close('mask')" />
<view class="uni-drawer__content" :class="{'uni-drawer--right': rightMode,'uni-drawer--left': !rightMode, 'uni-drawer__content--visible': showDrawer}" :style="[{width:drawerWidth+'px'},{top:StatusBar + 'px'}]">
<slot />
</view>
</view>
</template>
<script>
/**
* Drawer 抽屉
* @description 抽屉侧滑菜单
* @tutorial https://ext.dcloud.net.cn/plugin?id=26
* @property {Boolean} mask = [true | false] 是否显示遮罩
* @property {Boolean} maskClick = [true | false] 点击遮罩是否关闭
* @property {Boolean} mode = [left | right] Drawer 滑出位置
* @value left 从左侧滑出
* @value right 从右侧侧滑出
* @property {Number} width 抽屉的宽度 vue 页面生效
* @event {Function} close 组件关闭时触发事件
*/
export default {
name: 'UniDrawer',
props: {
/**
* 显示模式只在初始化生效
*/
mode: {
type: String,
default: ''
},
/**
* 蒙层显示状态
*/
mask: {
type: Boolean,
default: true
},
/**
* 遮罩是否可点击关闭
*/
maskClick: {
type: Boolean,
default: true
},
/**
* 抽屉宽度
*/
width: {
type: Number,
default: 300
}
},
data() {
return {
StatusBar: this.StatusBar,
visibleSync: false,
showDrawer: false,
rightMode: false,
watchTimer: null,
drawerWidth: 300
}
},
created() {
// #ifndef APP-NVUE
this.drawerWidth = this.width
// #endif
this.rightMode = this.mode === 'right'
},
methods: {
clear() {},
close(type) {
// fixed by mehaotian
if ((type === 'mask' && !this.maskClick) || !this.visibleSync) return
this._change('showDrawer', 'visibleSync', false)
},
open() {
// fixed by mehaotian
if (this.visibleSync) return
this._change('visibleSync', 'showDrawer', true)
},
_change(param1, param2, status) {
this[param1] = status
if (this.watchTimer) {
clearTimeout(this.watchTimer)
}
this.watchTimer = setTimeout(() => {
this[param2] = status
this.$emit('change', status)
}, status ? 50 : 300)
}
}
}
</script>
<style scoped>
.uni-drawer {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
overflow: hidden;
z-index: 999;
}
.uni-drawer__content {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
position: absolute;
/* top: 0; */
bottom: 0;
background-color: #ffffff;
transition: transform 0.3s ease;
}
.uni-drawer--left {
left: 0;
/* #ifdef APP-NVUE */
transform: translateX(-220px);
/* #endif */
/* #ifndef APP-NVUE */
transform: translateX(-100%);
/* #endif */
}
.uni-drawer--right {
right: 0;
/* #ifdef APP-NVUE */
transform: translateX(220px);
/* #endif */
/* #ifndef APP-NVUE */
transform: translateX(100%);
/* #endif */
}
.uni-drawer__content--visible {
transform: translateX(0px);
}
.uni-drawer__mask {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
opacity: 0;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
background-color: rgba(0, 0, 0, 0.4);
transition: opacity 0.3s;
}
.uni-drawer__mask--visible {
/* #ifndef APP-NVUE */
display: block;
/* #endif */
opacity: 1;
}
</style>

View File

@ -6,7 +6,6 @@
itemStyle="height:80upx;padding-bottom:10upx;background-color: #fff;" itemStyle="height:80upx;padding-bottom:10upx;background-color: #fff;"
@click="tabsClick" @click="tabsClick"
></u-tabs> ></u-tabs>
<<<<<<< HEAD
<view class="container"> <view class="container">
<u-sticky offset-top="200"> <u-sticky offset-top="200">
<u-button type="primary" text="高级搜索" @click="popupOpen" style="height: 30px;"></u-button> <u-button type="primary" text="高级搜索" @click="popupOpen" style="height: 30px;"></u-button>
@ -55,56 +54,6 @@
</view> </view>
</u-popup> </u-popup>
=======
<view class="container">
<u-sticky offset-top="200">
<u-button type="primary" text="高级搜索" @click="popupOpen" style="height: 30px;"></u-button>
</u-sticky>
</view>
<u-popup :show="popupShow" mode="right" :overlay="true" customStyle='width: 300px;' :safeAreaInsetTop="true" @close="popupClose" @open="popupOpen">
<view>
<u-datetime-picker
:show="addStartPickBarShow"
v-model="addTimeStart"
mode="date"
@close="addPickBarOnClose('start')"
@cancel="addPickBarOnCancel('start')"
@confirm="addPickBarOnConfirm"
></u-datetime-picker>
<u-button @click="addStartPickBarShow = true">起始时间{{ addTimeStartStr == '' ? '请选择起始时间...' : addTimeStartStr }}</u-button>
<u-datetime-picker
:show="addEndPickBarShow"
v-model="addTimeEnd"
mode="date"
@close="addPickBarOnClose('end')"
@cancel="addPickBarOnCancel('end')"
@confirm="addPickBarOnConfirm"
></u-datetime-picker>
<u-button @click="addEndPickBarShow = true">结束时间{{ addTimeEndStr == '' ? '请选择结束时间...' : addTimeEndStr }}</u-button>
<u-toast ref="uToast"></u-toast>
<view class="u-page">
<view class="u-demo-block">
<view class="u-demo-block__content">
<u-row customStyle="margin-bottom: 10px">
<u-col span="6">
<view class="demo-layout bg-purple-light">
<u-button @click="resetAdvancedParam"></u-button>
</view>
</u-col>
<u-col span="6">
<view class="demo-layout bg-purple">
<u-button @click="advancedSearch"></u-button>
</view>
</u-col>
</u-row>
</view>
</view>
</view>
</view>
</u-popup>
>>>>>>> remotes/origin/pet
<view class="message_list"> <view class="message_list">
<u-list @scrolltolower="scrolltolower" v-if="list.length > 0"> <u-list @scrolltolower="scrolltolower" v-if="list.length > 0">
<u-list-item v-for="(item, index) in list" :key="index"> <u-list-item v-for="(item, index) in list" :key="index">
@ -224,17 +173,10 @@ export default {
}, },
// //
<<<<<<< HEAD
popupClose() { popupClose() {
this.popupShow = false this.popupShow = false
}, },
=======
popupClose() {
this.popupShow = false
},
>>>>>>> remotes/origin/pet
// //
addPickBarOnClose(type) { addPickBarOnClose(type) {
switch (type) { switch (type) {
@ -270,11 +212,7 @@ export default {
this.$refs.uToast.show({message:'日期选择参数错误',duration:1000}) this.$refs.uToast.show({message:'日期选择参数错误',duration:1000})
} }
}, },
<<<<<<< HEAD
// //
=======
//
>>>>>>> remotes/origin/pet
resetAllAddTime() { resetAllAddTime() {
this.addTimeStart = Number(new Date()) this.addTimeStart = Number(new Date())
this.addTimeEnd = Number(new Date()) this.addTimeEnd = Number(new Date())
@ -291,11 +229,7 @@ export default {
const toast = uni.$u.toast const toast = uni.$u.toast
// //
if (this.addTimeStartStr > this.addTimeEndStr){ if (this.addTimeStartStr > this.addTimeEndStr){
<<<<<<< HEAD
// casecase1 > case2 // casecase1 > case2
=======
// casecase1 > case2
>>>>>>> remotes/origin/pet
this.$refs.uToast.show({message:'日期不合法',duration:1000}) this.$refs.uToast.show({message:'日期不合法',duration:1000})
return return
} }