123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199 |
- <template name="dever-drawer-window">
- <view :style="{background:background,zIndex:zIndex, top:top+'px'}">
- <view :class="['DrawerClose_' + direction, show ? 'show' : '']" @tap="hideModal">
- <text :class="'cuIcon-pull'+direction"></text>
- </view>
- <scroll-view scroll-y="false" :class="['DrawerWindow_' + direction, show ? 'show' : '']" :style="{width:width,padding:padding, zIndex:zIndex+1, background:slotBg}" @tap.stop="stopFun" @touchstart="start" @touchend="end" @scrolltolower="bottomCall">
- <view class="cu-list menu card-menu margin-top-xl margin-bottom-xl shadow-lg" v-if="show">
- <slot name="links"></slot>
- </view>
- </scroll-view>
- </view>
- </template>
- <script>
- export default {
- props: {
- show : {
- type : Boolean,
- default : false
- },
- direction : {
- type : String,
- default : 'left'
- },
- width : {
- type : String,
- default : '60%'
- },
- background:{
- type : String,
- default : 'rgba(0, 0, 0, 0.5)'
- },
- slotBg:{
- type : String,
- default : 'rgba(255, 255, 255, 1)'
- },
- padding :{
- type : String,
- default : '30rpx'
- },
- zIndex : {
- type : Number,
- default : 10
- },
- // #ifdef H5
- top:{
- type : Number,
- default : 44
- },
- // #endif
- // #ifndef H5
- top:{
- type : Number,
- default : 0
- },
- // #endif
- type : {
- type : String,
- default : ''
- },
- },
- data() {
- return {
-
- };
- },
- mounted() {
-
- },
- methods:{
- bottomCall : function() {
- this.$emit('bottomFunc');
- },
- closeDrawer : function(){
- this.$emit('closeDrawer');
- },
- start : function(e) {
- return this.Dever.slide(e);
- },
- end : function(e) {
- if (this.type == 'share') {
- return;
- }
- var type = this.Dever.slideEnd(e);
- if (type == 3 || type == 4) {
- this.closeDrawer();
- }
- },
- showModal : function(e) {
- this.show = true;
- },
- hideModal : function(e) {
- this.closeDrawer();
- },
- stopFun : function() {
-
- }
- }
- }
- </script>
- <style>
- uni-scroll-view {
- overflow: hidden;
- }
- .DrawerWindow_left {
- position: absolute;
- width: 85vw;
- height: 100vh;
- left: 0;
- top: 0;
- transform: scale(1, 1) translateX(-100%);
- opacity: 1;
- pointer-events: none;
- transition: all 0.4s;
- }
- .DrawerWindow_left.show {
- transform: scale(1, 1) translateX(0%);
- opacity: 1;
- pointer-events: all;
- }
- .DrawerWindow_down {
- position: absolute;
- width: 85vw;
- height: 100vh;
- left: 0;
- top: 0;
- transform: scale(1, 1) translateY(100%);
- opacity: 1;
- pointer-events: none;
- transition: all 0.4s;
- }
- .DrawerWindow_down.show {
- height: 91vh;
- transform: scale(1, 1) translateY(10%);
- opacity: 1;
- pointer-events: all;
- }
- .DrawerClose_left {
- position: absolute;
- width: 40vw;
- height: 100vh;
- right: 0;
- top: 0;
- color: transparent;
- padding-bottom: 30upx;
- display: flex;
- align-items: flex-end;
- justify-content: center;
- /*background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));*/
- letter-spacing: 5px;
- font-size: 50upx;
- opacity: 0;
- pointer-events: none;
- transition: all 0.4s;
- }
- .DrawerClose_left.show {
- opacity: 1;
- pointer-events: all;
- width: 15vw;
- color: #fff;
- }
- .DrawerClose_down {
- position: absolute;
- width: 176vw;
- height: 30vh;
- left: 0;
- top: 0;
- color: transparent;
- padding-bottom: 30upx;
- padding-left: 60upx;
- display: flex;
- align-items: flex-end;
- justify-content: center;
- /*background-image: linear-gradient(90deg, rgba(0, 0, 0, 0.01), rgba(0, 0, 0, 0.6));*/
- letter-spacing: 5px;
- font-size: 50upx;
- opacity: 0;
- pointer-events: none;
- transition: all 0.4s;
- }
- .DrawerClose_down.show {
- opacity: 1;
- pointer-events: all;
- height: 10vh;
- color: #fff;
- }
- .card-menu {
- border-radius: 0px;
- }
- </style>
|