build: compile 1.6.6

This commit is contained in:
zhongnan 2021-01-21 16:32:18 +08:00
parent b13513f713
commit 89e9b0432c
10 changed files with 190 additions and 178 deletions

View File

@ -1,6 +1,3 @@
<wxs src="./index.wxs" module="computed"></wxs>
<template name="calendar">
<view class="van-calendar"> <view class="van-calendar">
<header <header
title="{{ title }}" title="{{ title }}"
@ -11,7 +8,11 @@
<slot name="title" slot="title"></slot> <slot name="title" slot="title"></slot>
</header> </header>
<scroll-view class="van-calendar__body" scroll-y scroll-into-view="{{ scrollIntoView }}"> <scroll-view
class="van-calendar__body"
scroll-y
scroll-into-view="{{ scrollIntoView }}"
>
<month <month
wx:for="{{ computed.getMonths(minDate, maxDate) }}" wx:for="{{ computed.getMonths(minDate, maxDate) }}"
wx:key="index" wx:key="index"
@ -34,11 +35,15 @@
/> />
</scroll-view> </scroll-view>
<view class="van-calendar__footer {{ safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}"> <view
class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
>
<slot name="footer"></slot> <slot name="footer"></slot>
</view> </view>
<view class="van-calendar__footer {{ safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}"> <view
class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
>
<van-button <van-button
wx:if="{{ showConfirm }}" wx:if="{{ showConfirm }}"
round round
@ -50,8 +55,11 @@
nativeType="text" nativeType="text"
bind:click="onConfirm" bind:click="onConfirm"
> >
{{ computed.getButtonDisabled(type, currentDate) ? confirmDisabledText : confirmText }} {{
computed.getButtonDisabled(type, currentDate)
? confirmDisabledText
: confirmText
}}
</van-button> </van-button>
</view> </view>
</view> </view>
</template>

View File

@ -1,4 +1,5 @@
<wxs src="./index.wxs" module="computed" /> <wxs src="./index.wxs" module="computed" />
<wxs src="../wxs/utils.wxs" module="utils" />
<import src="./calendar.wxml" /> <import src="./calendar.wxml" />
@ -16,16 +17,9 @@
bind:after-enter="onOpened" bind:after-enter="onOpened"
bind:after-leave="onClosed" bind:after-leave="onClosed"
> >
<template <include src="calendar.wxml" />
is="calendar"
data="{{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, formatter, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }}"
/>
</van-popup> </van-popup>
<template <include wx:else src="calendar.wxml" />
wx:else
is="calendar"
data="{{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, formatter, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }}"
/>
<van-toast id="van-toast" /> <van-toast id="van-toast" />

View File

@ -1,8 +1,4 @@
<template name="toolbar"> <view wx:if="{{ showToolbar }}" class="van-picker__toolbar toolbar-class">
<view
wx:if="{{ showToolbar }}"
class="van-picker__toolbar toolbar-class"
>
<view <view
class="van-picker__cancel" class="van-picker__cancel"
hover-class="van-picker__cancel--hover" hover-class="van-picker__cancel--hover"
@ -25,4 +21,3 @@
{{ confirmButtonText }} {{ confirmButtonText }}
</view> </view>
</view> </view>
</template>

View File

@ -182,6 +182,13 @@ VantComponent({
}, },
}); });
}, },
onPreviewFile(event) {
const { index } = event.currentTarget.dataset;
wx.openDocument({
filePath: this.data.lists[index].url,
showMenu: true,
});
},
onClickPreview(event) { onClickPreview(event) {
const { index } = event.currentTarget.dataset; const { index } = event.currentTarget.dataset;
const item = this.data.lists[index]; const item = this.data.lists[index];

View File

@ -20,7 +20,7 @@
class="van-uploader__preview-image" class="van-uploader__preview-image"
style="{{ computed.sizeStyle({ previewSize }) }}" style="{{ computed.sizeStyle({ previewSize }) }}"
data-index="{{ index }}" data-index="{{ index }}"
bind:tap="onPreviewImage" bindtap="onPreviewImage"
/> />
<video <video
wx:elif="{{ item.isVideo }}" wx:elif="{{ item.isVideo }}"
@ -31,13 +31,15 @@
class="van-uploader__preview-image" class="van-uploader__preview-image"
style="{{ computed.sizeStyle({ previewSize }) }}" style="{{ computed.sizeStyle({ previewSize }) }}"
data-index="{{ index }}" data-index="{{ index }}"
bind:tap="onPreviewVideo" bindtap="onPreviewVideo"
> >
</video> </video>
<view <view
wx:else wx:else
class="van-uploader__file" class="van-uploader__file"
style="{{ computed.sizeStyle({ previewSize }) }}" style="{{ computed.sizeStyle({ previewSize }) }}"
data-index="{{ index }}"
bindtap="onPreviewFile"
> >
<van-icon name="description" class="van-uploader__file-icon" /> <van-icon name="description" class="van-uploader__file-icon" />
<view class="van-uploader__file-name van-ellipsis">{{ item.name || item.url }}</view> <view class="van-uploader__file-name van-ellipsis">{{ item.name || item.url }}</view>

View File

@ -1,6 +1,3 @@
<wxs src="./index.wxs" module="computed"></wxs>
<template name="calendar">
<view class="van-calendar"> <view class="van-calendar">
<header <header
title="{{ title }}" title="{{ title }}"
@ -11,7 +8,11 @@
<slot name="title" slot="title"></slot> <slot name="title" slot="title"></slot>
</header> </header>
<scroll-view class="van-calendar__body" scroll-y scroll-into-view="{{ scrollIntoView }}"> <scroll-view
class="van-calendar__body"
scroll-y
scroll-into-view="{{ scrollIntoView }}"
>
<month <month
wx:for="{{ computed.getMonths(minDate, maxDate) }}" wx:for="{{ computed.getMonths(minDate, maxDate) }}"
wx:key="index" wx:key="index"
@ -34,11 +35,15 @@
/> />
</scroll-view> </scroll-view>
<view class="van-calendar__footer {{ safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}"> <view
class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
>
<slot name="footer"></slot> <slot name="footer"></slot>
</view> </view>
<view class="van-calendar__footer {{ safeAreaInsetBottom ? 'van-calendar__footer--safe-area-inset-bottom' : '' }}"> <view
class="{{ utils.bem('calendar__footer', { safeAreaInsetBottom }) }}"
>
<van-button <van-button
wx:if="{{ showConfirm }}" wx:if="{{ showConfirm }}"
round round
@ -50,8 +55,11 @@
nativeType="text" nativeType="text"
bind:click="onConfirm" bind:click="onConfirm"
> >
{{ computed.getButtonDisabled(type, currentDate) ? confirmDisabledText : confirmText }} {{
computed.getButtonDisabled(type, currentDate)
? confirmDisabledText
: confirmText
}}
</van-button> </van-button>
</view> </view>
</view> </view>
</template>

View File

@ -1,4 +1,5 @@
<wxs src="./index.wxs" module="computed" /> <wxs src="./index.wxs" module="computed" />
<wxs src="../wxs/utils.wxs" module="utils" />
<import src="./calendar.wxml" /> <import src="./calendar.wxml" />
@ -16,16 +17,9 @@
bind:after-enter="onOpened" bind:after-enter="onOpened"
bind:after-leave="onClosed" bind:after-leave="onClosed"
> >
<template <include src="calendar.wxml" />
is="calendar"
data="{{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, formatter, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }}"
/>
</van-popup> </van-popup>
<template <include wx:else src="calendar.wxml" />
wx:else
is="calendar"
data="{{ title, subtitle, showTitle, showSubtitle, minDate, maxDate, type, color, showMark, formatter, rowHeight, currentDate, safeAreaInsetBottom, showConfirm, confirmDisabledText, confirmText, scrollIntoView, allowSameDay }}"
/>
<van-toast id="van-toast" /> <van-toast id="van-toast" />

View File

@ -1,8 +1,4 @@
<template name="toolbar"> <view wx:if="{{ showToolbar }}" class="van-picker__toolbar toolbar-class">
<view
wx:if="{{ showToolbar }}"
class="van-picker__toolbar toolbar-class"
>
<view <view
class="van-picker__cancel" class="van-picker__cancel"
hover-class="van-picker__cancel--hover" hover-class="van-picker__cancel--hover"
@ -25,4 +21,3 @@
{{ confirmButtonText }} {{ confirmButtonText }}
</view> </view>
</view> </view>
</template>

View File

@ -227,6 +227,13 @@ component_1.VantComponent({
}, },
}); });
}, },
onPreviewFile: function (event) {
var index = event.currentTarget.dataset.index;
wx.openDocument({
filePath: this.data.lists[index].url,
showMenu: true,
});
},
onClickPreview: function (event) { onClickPreview: function (event) {
var index = event.currentTarget.dataset.index; var index = event.currentTarget.dataset.index;
var item = this.data.lists[index]; var item = this.data.lists[index];

View File

@ -20,7 +20,7 @@
class="van-uploader__preview-image" class="van-uploader__preview-image"
style="{{ computed.sizeStyle({ previewSize }) }}" style="{{ computed.sizeStyle({ previewSize }) }}"
data-index="{{ index }}" data-index="{{ index }}"
bind:tap="onPreviewImage" bindtap="onPreviewImage"
/> />
<video <video
wx:elif="{{ item.isVideo }}" wx:elif="{{ item.isVideo }}"
@ -31,13 +31,15 @@
class="van-uploader__preview-image" class="van-uploader__preview-image"
style="{{ computed.sizeStyle({ previewSize }) }}" style="{{ computed.sizeStyle({ previewSize }) }}"
data-index="{{ index }}" data-index="{{ index }}"
bind:tap="onPreviewVideo" bindtap="onPreviewVideo"
> >
</video> </video>
<view <view
wx:else wx:else
class="van-uploader__file" class="van-uploader__file"
style="{{ computed.sizeStyle({ previewSize }) }}" style="{{ computed.sizeStyle({ previewSize }) }}"
data-index="{{ index }}"
bindtap="onPreviewFile"
> >
<van-icon name="description" class="van-uploader__file-icon" /> <van-icon name="description" class="van-uploader__file-icon" />
<view class="van-uploader__file-name van-ellipsis">{{ item.name || item.url }}</view> <view class="van-uploader__file-name van-ellipsis">{{ item.name || item.url }}</view>