From 4e28ef3d37ed7c46c822af2dd084a7f13422aa0f Mon Sep 17 00:00:00 2001 From: modendeveloper Date: Tue, 21 Jan 2025 00:15:37 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A3122=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E5=A1=AB=E5=86=99=E5=85=A5?= =?UTF-8?q?=E9=A9=BB=E7=94=B3=E8=AF=B7=E8=B5=84=E6=96=99=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=BA=97=E9=93=BA=E8=90=A5=E4=B8=9A=E6=97=B6?= =?UTF-8?q?=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/timePickerPopup/README.md | 87 +++++ .../timePickerPopup/time-picker-popup.vue | 159 +++++++++ components/timePickerPopup/utils.js | 69 ++++ components/tpf-time-range/tpf-time-range.vue | 316 ++++++++++++++++++ pkg_join/views/supplier.vue | 58 +++- 5 files changed, 686 insertions(+), 3 deletions(-) create mode 100644 components/timePickerPopup/README.md create mode 100644 components/timePickerPopup/time-picker-popup.vue create mode 100644 components/timePickerPopup/utils.js create mode 100644 components/tpf-time-range/tpf-time-range.vue diff --git a/components/timePickerPopup/README.md b/components/timePickerPopup/README.md new file mode 100644 index 0000000..91e3133 --- /dev/null +++ b/components/timePickerPopup/README.md @@ -0,0 +1,87 @@ +### 使用组件 + +```html + +``` + +### 引入组件 + +```javascript +import TimePickerPopup from '@/components/time-picker-popup/time-picker-popup.vue'; +``` + +### 注册组件 + +```javascript +export default { + components: { TimePickerPopup }, + data() { + return { + value: ['00', '00', '00', '00'] + } + }, + onReady() { + this.open(); + }, + methods: { + confirm(data) { + uni.showToast({ + title: `${data[0]}:${data[1]}-${data[2]}:${data[3]}` + }) + }, + open() { + this.$refs.TimePickerPopupRef.open(); + } + } +} +``` + +### 参数 + +```javascript +// 当前选中的值 +value: { + type: Array, + default: () => (['00', '00', '00', '00']) +}, +// 标题 +title: { + type: String, + default: '时间' +}, +// 取消按钮文字 +cancelText: { + type: String, + default: '取消' +}, +// 取消按钮颜色 +canceColor: { + type: String, + default: '#666666' +}, +// 确定按钮文字 +confirmText: { + type: String, + default: '确定' +}, +// 确定按钮颜色 +confirmColor: { + type: String, + default: '#2bb781' +}, +// 分割符 +segmentation: { + type: String, + default: '-' +}, +// 设置选择器中间选中框的类名 注意页面或组件的style中写了scoped时,需要在类名前写/deep/ +indicatorClass: { + type: String, + default: 'picker-view__indicator' +}, +// 设置选择器中间选中框的样式 +indicatorStyle: { + type: String, + default: '' +}, +``` diff --git a/components/timePickerPopup/time-picker-popup.vue b/components/timePickerPopup/time-picker-popup.vue new file mode 100644 index 0000000..7a07f60 --- /dev/null +++ b/components/timePickerPopup/time-picker-popup.vue @@ -0,0 +1,159 @@ + + + + + \ No newline at end of file diff --git a/components/timePickerPopup/utils.js b/components/timePickerPopup/utils.js new file mode 100644 index 0000000..e093659 --- /dev/null +++ b/components/timePickerPopup/utils.js @@ -0,0 +1,69 @@ +// 组件props +const props = { + // 当前选中的值 + value: { + type: Array, + default: () => (['00', '00', '00', '00']) + }, + // 标题 + title: { + type: String, + default: '时间' + }, + // 取消按钮文字 + cancelText: { + type: String, + default: '取消' + }, + // 取消按钮颜色 + canceColor: { + type: String, + default: '#666666' + }, + // 确定按钮文字 + confirmText: { + type: String, + default: '确定' + }, + // 确定按钮颜色 + confirmColor: { + type: String, + default: '#2bb781' + }, + // 分割符 + segmentation: { + type: String, + default: '-' + }, + // 设置选择器中间选中框的类名 注意页面或组件的style中写了scoped时,需要在类名前写/deep/ + indicatorClass: { + type: String, + default: 'picker-view__indicator' + }, + // 设置选择器中间选中框的样式 + indicatorStyle: { + type: String, + default: '' + }, +} + +// 滚动数据 +let range = [ + [], + [], + [], + [] +]; +for (let i = 0; i < 24; i++) { + range[0].push(i >= 10 ? String(i) : `0${i}`); + range[2].push(i >= 10 ? String(i) : `0${i}`); +} +for (let i = 0; i < 60; i++) { + range[1].push(i >= 10 ? String(i) : `0${i}`); + range[3].push(i >= 10 ? String(i) : `0${i}`); +} + +export default { + props, + range +} \ No newline at end of file diff --git a/components/tpf-time-range/tpf-time-range.vue b/components/tpf-time-range/tpf-time-range.vue new file mode 100644 index 0000000..ab34330 --- /dev/null +++ b/components/tpf-time-range/tpf-time-range.vue @@ -0,0 +1,316 @@ + + + + + \ No newline at end of file diff --git a/pkg_join/views/supplier.vue b/pkg_join/views/supplier.vue index 60e4a5b..97f660f 100644 --- a/pkg_join/views/supplier.vue +++ b/pkg_join/views/supplier.vue @@ -187,6 +187,7 @@ + + + + + + +