mirror of
https://gitee.com/beecue/fastbee.git
synced 2025-12-18 00:45:55 +08:00
智慧宿舍系统小程序
This commit is contained in:
117
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/index.js
generated
vendored
Normal file
117
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/index.js
generated
vendored
Normal file
@@ -0,0 +1,117 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
var relation_1 = require('../common/relation');
|
||||
var component_1 = require('../common/component');
|
||||
component_1.VantComponent({
|
||||
field: true,
|
||||
relation: relation_1.useParent('dropdown-menu', function () {
|
||||
this.updateDataFromParent();
|
||||
}),
|
||||
props: {
|
||||
value: {
|
||||
type: null,
|
||||
observer: 'rerender',
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
observer: 'rerender',
|
||||
},
|
||||
disabled: Boolean,
|
||||
titleClass: {
|
||||
type: String,
|
||||
observer: 'rerender',
|
||||
},
|
||||
options: {
|
||||
type: Array,
|
||||
value: [],
|
||||
observer: 'rerender',
|
||||
},
|
||||
popupStyle: String,
|
||||
},
|
||||
data: {
|
||||
transition: true,
|
||||
showPopup: false,
|
||||
showWrapper: false,
|
||||
displayTitle: '',
|
||||
},
|
||||
methods: {
|
||||
rerender: function () {
|
||||
var _this = this;
|
||||
wx.nextTick(function () {
|
||||
var _a;
|
||||
(_a = _this.parent) === null || _a === void 0
|
||||
? void 0
|
||||
: _a.updateItemListData();
|
||||
});
|
||||
},
|
||||
updateDataFromParent: function () {
|
||||
if (this.parent) {
|
||||
var _a = this.parent.data,
|
||||
overlay = _a.overlay,
|
||||
duration = _a.duration,
|
||||
activeColor = _a.activeColor,
|
||||
closeOnClickOverlay = _a.closeOnClickOverlay,
|
||||
direction = _a.direction;
|
||||
this.setData({
|
||||
overlay: overlay,
|
||||
duration: duration,
|
||||
activeColor: activeColor,
|
||||
closeOnClickOverlay: closeOnClickOverlay,
|
||||
direction: direction,
|
||||
});
|
||||
}
|
||||
},
|
||||
onOpen: function () {
|
||||
this.$emit('open');
|
||||
},
|
||||
onOpened: function () {
|
||||
this.$emit('opened');
|
||||
},
|
||||
onClose: function () {
|
||||
this.$emit('close');
|
||||
},
|
||||
onClosed: function () {
|
||||
this.$emit('closed');
|
||||
this.setData({ showWrapper: false });
|
||||
},
|
||||
onOptionTap: function (event) {
|
||||
var option = event.currentTarget.dataset.option;
|
||||
var value = option.value;
|
||||
var shouldEmitChange = this.data.value !== value;
|
||||
this.setData({ showPopup: false, value: value });
|
||||
this.$emit('close');
|
||||
this.rerender();
|
||||
if (shouldEmitChange) {
|
||||
this.$emit('change', value);
|
||||
}
|
||||
},
|
||||
toggle: function (show, options) {
|
||||
var _this = this;
|
||||
var _a;
|
||||
if (options === void 0) {
|
||||
options = {};
|
||||
}
|
||||
var showPopup = this.data.showPopup;
|
||||
if (typeof show !== 'boolean') {
|
||||
show = !showPopup;
|
||||
}
|
||||
if (show === showPopup) {
|
||||
return;
|
||||
}
|
||||
this.setData({
|
||||
transition: !options.immediate,
|
||||
showPopup: show,
|
||||
});
|
||||
if (show) {
|
||||
(_a = this.parent) === null || _a === void 0
|
||||
? void 0
|
||||
: _a.getChildWrapperStyle().then(function (wrapperStyle) {
|
||||
_this.setData({ wrapperStyle: wrapperStyle, showWrapper: true });
|
||||
_this.rerender();
|
||||
});
|
||||
} else {
|
||||
this.rerender();
|
||||
}
|
||||
},
|
||||
},
|
||||
});
|
||||
8
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/index.json
generated
vendored
Normal file
8
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/index.json
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"van-popup": "../popup/index",
|
||||
"van-cell": "../cell/index",
|
||||
"van-icon": "../icon/index"
|
||||
}
|
||||
}
|
||||
48
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/index.wxml
generated
vendored
Normal file
48
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/index.wxml
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
<wxs src="../wxs/utils.wxs" module="utils" />
|
||||
|
||||
<view
|
||||
wx:if="{{ showWrapper }}"
|
||||
class="{{ utils.bem('dropdown-item', direction) }}"
|
||||
style="{{ wrapperStyle }}"
|
||||
>
|
||||
<van-popup
|
||||
show="{{ showPopup }}"
|
||||
custom-style="position: absolute;{{ popupStyle }}"
|
||||
overlay-style="position: absolute;"
|
||||
overlay="{{ overlay }}"
|
||||
position="{{ direction === 'down' ? 'top' : 'bottom' }}"
|
||||
duration="{{ transition ? duration : 0 }}"
|
||||
close-on-click-overlay="{{ closeOnClickOverlay }}"
|
||||
bind:enter="onOpen"
|
||||
bind:leave="onClose"
|
||||
bind:close="toggle"
|
||||
bind:after-enter="onOpened"
|
||||
bind:after-leave="onClosed"
|
||||
>
|
||||
<van-cell
|
||||
wx:for="{{ options }}"
|
||||
wx:key="value"
|
||||
data-option="{{ item }}"
|
||||
class="{{ utils.bem('dropdown-item__option', { active: item.value === value } ) }}"
|
||||
clickable
|
||||
icon="{{ item.icon }}"
|
||||
bind:tap="onOptionTap"
|
||||
>
|
||||
<view
|
||||
slot="title"
|
||||
class="van-dropdown-item__title"
|
||||
style="{{ item.value === value ? 'color:' + activeColor : '' }}"
|
||||
>
|
||||
{{ item.text }}
|
||||
</view>
|
||||
<van-icon
|
||||
wx:if="{{ item.value === value }}"
|
||||
name="success"
|
||||
class="van-dropdown-item__icon"
|
||||
color="{{ activeColor }}"
|
||||
/>
|
||||
</van-cell>
|
||||
|
||||
<slot />
|
||||
</van-popup>
|
||||
</view>
|
||||
1
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/index.wxss
generated
vendored
Normal file
1
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/index.wxss
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@import '../common/index.wxss';.van-dropdown-item{position:fixed;right:0;left:0;overflow:hidden}.van-dropdown-item__option{text-align:left}.van-dropdown-item__option--active .van-dropdown-item__icon,.van-dropdown-item__option--active .van-dropdown-item__title{color:#ee0a24;color:var(--dropdown-menu-option-active-color,#ee0a24)}.van-dropdown-item--up{top:0}.van-dropdown-item--down{bottom:0}.van-dropdown-item__icon{display:block;line-height:inherit}
|
||||
2
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/shared.js
generated
vendored
Normal file
2
wechat/miniprogram/node_modules/@vant/weapp/lib/dropdown-item/shared.js
generated
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
Reference in New Issue
Block a user