Skip to content

Commit

Permalink
v3.11.3
Browse files Browse the repository at this point in the history
  • Loading branch information
skyvow committed Apr 24, 2024
1 parent a4d681f commit 1d86762
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 17 deletions.
2 changes: 1 addition & 1 deletion docs/_coverpage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![logo](_images/tinified/logo2.png ':size=128x128')

# Wux Weapp <small>3.11.1</small>
# Wux Weapp <small>3.11.3</small>

<!-- 背景 -->
<style>
Expand Down
15 changes: 15 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@
- 次版本号(0.x.0):含有新特性的向下兼容的版本。
- 主版本号(x.0.0):含有破坏性更新和新特性,不向下兼容的版本。

## v 3.11.3 (2024-04-25)

- 🐞 更新组件:DatePicker - 日期选择器 修复 value 输入错误
- 🐞 更新组件:DatePickerView - 日期选择器 修复 value 输入错误

## v 3.11.2 (2024-04-24)

- 🔥 升级注意:适配 PC 小程序
- 🐞 更新组件:DatePicker - 日期选择器 新增 tillNow 属性
- 🐞 更新组件:DatePickerView - 日期选择器 新增 tillNow 属性
- 🐞 更新组件:Dialog - 对话框 修复 prompt 模式下 input placeholder 文本对齐的问题
- 🐞 更新组件:InputNumber - 数字输入框 修复 placeholder 文本对齐的问题
- 🐞 更新组件:PickerView - 单列选择器 新增 labelImage 属性,支持自定义 label 显示图像
- 🐞 更新组件:SearchBar - 搜索栏 修复 placeholder 文本对齐的问题

## v 3.11.1 (2024-03-21)

- 🐞 更新组件:CascaderView - 级联选择视图 修复 npm 导入项目,[cascader-view 组件编译错误](https://github.com/wux-weapp/wux-weapp/issues/424)
Expand Down
33 changes: 29 additions & 4 deletions docs/date-picker-view.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@
data-index="7"
bind:valueChange="onValueChange"
/>
<view class="sub-title">TillNow {{ displayValue8 }}</view>
<wux-date-picker-view
tillNow
lang="{{ lang }}"
value="{{ value8 }}"
data-index="8"
bind:valueChange="onValueChange"
/>
</view>
</view>
```
Expand All @@ -107,11 +115,12 @@ Page({
data: {
value1: [year, month, day, hour, minute],
value2: [year, month, day],
value3: [year, month],
value4: [year],
value3: [year],
value4: [year, month],
value5: [hour, minute],
value6: [year, month, day, hour, minute, '1'],
value7: [hour, minute, '1'],
value8: ['2029', '0', '1', '0', '0'],
lang: 'zh_CN',
},
onChange(e) {
Expand All @@ -125,7 +134,7 @@ Page({
},
setValue(values, key) {
this.setData({
[`value${key}`]: values.value,
[`value${key}`]: !values.tillNow ? values.value : { tillNow: true },
[`displayValue${key}`]: values.displayValue.join(' '),
})
},
Expand All @@ -143,13 +152,28 @@ Page({

## API

```ts
// ex. `yyyy-MM-dd hh:mm` | `yyyy-MM-dd` | `yyyy` | `yyyy-MM` | `hh:mm`
type DateString = string

// ex. `[year, monthIndex, date, hours, minutes, ampm]`
type StringArray = string[]

// ex. `new Date().getTime()`
type Timestamp = number

type PickerDate = DateString | StringArray | Timestamp | {
tillNow?: boolean
}
```
### DatePickerView props
| 参数 | 类型 | 描述 | 默认值 |
| -------------------- | --------------- | ---------------------------------------------------------------------------------------------------- | --------------------- |
| multiPickerPrefixCls | `string` | multPicker 自定义类名前缀 | wux-picker |
| pickerPrefixCls | `string` | picker 自定义类名前缀 | wux-picker-col |
| value | `any` | 当前选中时间,例如字符串 `2000-02-01 00:00:00` 或时间戳 `949334400000` 或者数组 `[2000, 1, 1, 0, 0]` | - |
| value | `PickerDate` | 当前选中时间,例如字符串 `2000-02-01 00:00` 或时间戳 `949334400000` 或者数组 `['2000', '1', '1', '0', '0']` | - |
| itemHeight | `number` | 每列子元素的高度 | 34 |
| itemStyle | `string,object` | 每列子元素的样式 | - |
| indicatorStyle | `string,object` | 设置选择器中间选中框的样式 | - |
Expand All @@ -167,4 +191,5 @@ Page({
| minMinute | `number` | 最小可选分钟 | 0 |
| maxMinute | `number` | 最大可选分钟 | 59 |
| lang | `string` | 返回文本的语言,可选值为 en、zh_CN、zh_TW | zh_CN |
| tillNow | `boolean` | 是否展示“至今” | false |
| bind:valueChange | `function` | 每列数据选择变化后的回调函数 | - |
57 changes: 46 additions & 11 deletions docs/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,23 @@
<wux-cell title="Time" is-link extra="{{ displayValue9 }}"></wux-cell>
</wux-date-picker>
</wux-cell-group>
<wux-cell-group title="TillNow">
<wux-date-picker
tillNow
mode="datetime"
value="{{ value10 }}"
lang="{{ lang }}"
data-index="10"
data-mode="datetime"
bind:confirm="onConfirm"
>
<wux-cell
title="Datetime"
is-link
extra="{{ displayValue10 }}"
></wux-cell>
</wux-date-picker>
</wux-cell-group>
<view class="button-sp-area">
<wux-button block type="light" bind:click="onClick"
>Button click - {{ displayValue1 }}</wux-button
Expand All @@ -168,15 +185,16 @@
```js
Page({
data: {
value1: [],
value2: [],
value3: [],
value4: [],
value5: [],
value6: [],
value7: [],
value8: [],
value9: [],
value1: [year, month, day, hour, minute],
value2: [year, month, day],
value3: [year],
value4: [year, month],
value5: [hour, minute],
value6: [year, month, day, hour, minute, '1'],
value7: [hour, minute, '1'],
value8: '2020-02-02 02:02',
value9: '1580580120000',
value10: ['2029', '0', '1', '0', '0'],
displayValue1: '请选择',
displayValue2: '请选择',
displayValue3: '请选择',
Expand All @@ -186,6 +204,7 @@ Page({
displayValue7: '请选择',
displayValue8: '请选择',
displayValue9: '请选择',
displayValue10: '请选择',
lang: 'zh_CN',
},
onChange(e) {
Expand All @@ -199,7 +218,7 @@ Page({
},
setValue(values, key, mode) {
this.setData({
[`value${key}`]: values.value,
[`value${key}`]: !values.tillNow ? values.value : { tillNow: true },
[`displayValue${key}`]: values.label,
// [`displayValue${key}`]: values.displayValue.join(' '),
})
Expand All @@ -224,14 +243,29 @@ Page({

## API

```ts
// ex. `yyyy-MM-dd hh:mm` | `yyyy-MM-dd` | `yyyy` | `yyyy-MM` | `hh:mm`
type DateString = string

// ex. `[year, monthIndex, date, hours, minutes, ampm]`
type StringArray = string[]

// ex. `new Date().getTime()`
type Timestamp = number

type PickerDate = DateString | StringArray | Timestamp | {
tillNow?: boolean
}
```
### DatePicker props
| 参数 | 类型 | 描述 | 默认值 |
| -------------------- | --------------- | ---------------------------------------------------------------------------------------------------- | --------------------- |
| prefixCls | `string` | 自定义类名前缀 | wux-date-picker |
| multiPickerPrefixCls | `string` | multPicker 自定义类名前缀 | wux-picker |
| pickerPrefixCls | `string` | picker 自定义类名前缀 | wux-picker-col |
| value | `any` | 当前选中时间,例如字符串 `2000-02-01 00:00:00` 或时间戳 `949334400000` 或者数组 `[2000, 1, 1, 0, 0]` | - |
| value | `PickerDate` | 当前选中时间,例如字符串 `2000-02-01 00:00` 或时间戳 `949334400000` 或者数组 `['2000', '1', '1', '0', '0']` | - |
| itemHeight | `number` | 每列子元素的高度 | 34 |
| itemStyle | `string,object` | 每列子元素的样式 | - |
| indicatorStyle | `string,object` | 设置选择器中间选中框的样式 | - |
Expand All @@ -249,6 +283,7 @@ Page({
| minMinute | `number` | 最小可选分钟 | 0 |
| maxMinute | `number` | 最大可选分钟 | 59 |
| lang | `string` | 返回文本的语言,可选值为 en、zh_CN、zh_TW | zh_CN |
| tillNow | `boolean` | 是否展示“至今” | false |
| toolbar | `object` | 工具栏配置项 | {} |
| toolbar.title | `string` | 标题的文字 | 请选择 |
| toolbar.cancelText | `string` | 取消按钮的文字 | 取消 |
Expand Down
2 changes: 1 addition & 1 deletion docs/sw.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const version = 'wuxui_3.11.1_20240321_force'
const version = 'wuxui_3.11.3_20240425_force'
const __DEVELOPMENT__ = false
const __DEBUG__ = false
const offlineResources = [
Expand Down

0 comments on commit 1d86762

Please sign in to comment.