更新记录
1.0.0(2024-10-28)
下载此版本
初始化
平台兼容性
App |
快应用 |
微信小程序 |
支付宝小程序 |
百度小程序 |
字节小程序 |
QQ小程序 |
app-vue app-nvue |
× |
√ |
√ |
√ |
√ |
√ |
钉钉小程序 |
快手小程序 |
飞书小程序 |
京东小程序 |
× |
× |
× |
× |
H5-Safari |
Android Browser |
微信浏览器(Android) |
QQ浏览器(Android) |
Chrome |
IE |
Edge |
Firefox |
PC-Safari |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
√ |
next-x-delivery-time --预约控件/双列选择控件
遇到问题或有建议可以加入QQ群(455948571)反馈qQ : 455-948-571
如果觉得组件不错,给五星鼓励鼓励咯!
关注作者其他开源
npm开源包:npm;
github开源项目:github;
本插件支持uni-app,uni-app X, vue2/vue3, app平台, 微信小程序, H5等;
<template>
<view style="font-size: 16px;color: #666;padding: 10px"><text>1、定制风格一</text></view>
<view style="padding: 0 30rpx"><button style="width: 100%;background-color: #f9ae3d;color:#fff" size="mini" @click="openType1">查看</button></view>
<next-delivery-time
:closeOnClickOverlay="true"
:barHidth="500"
:title="title"
ref="nextXDeliveryTimeRef"
:content="dtoContent"
@confirm="dtpConfirm"
/>
</template>
<script setup lang="ts">
import dayjs from 'dayjs';
import { ref } from 'vue'
const nextXDeliveryTimeRef = ref();
const title = ref('');
const defTimelist: any = [
{timestr: '09: 00 - 11: 00', value: '09:00 - 11:00'},
{timestr: '11: 00 - 13: 00', value: '11:00 - 13:00'},
{timestr: '13: 00 - 15: 00', value: '13:00 - 15:00'},
{timestr: '15: 00 - 17: 00', value: '15:00 - 17:00'},
{timestr: '17: 00 - 19: 00', value: '17:00 - 19:00'},
{timestr: '19: 00 - 21: 00', value: '19:00 - 21:00'},
];
const dtoContent = ref([]);
function initDtoContentType1() {
const list: any = [];
const len = 7;
const today = dayjs();
for(let i = 0; i < len; i++) {
const o: any = { id: i + 1, timelist: defTimelist };
if(i === 0) {
o.timezh = "今天";
o.value = today.add(0, 'days').format('YYYY-MM-DD');
} else if(i === 1) {
o.timezh = "明天";
o.value = today.add(1, 'days').format('YYYY-MM-DD');
} else if(i === 2) {
o.timezh = "后天";
o.value = today.add(2, 'days').format('YYYY-MM-DD');
} else {
o.timezh = today.add(i, 'days').format('YYYY-MM-DD');
o.value = today.add(i, 'days').format('YYYY-MM-DD');
}
list.push(o);
}
dtoContent.value = list;
}
function dtpConfirm(index1: any, index2: any) {
console.log('------index1-------', index1);
console.log('------index2-------', index2)
}
function openType1() {
title.value = "预约看房时间";
initDtoContentType1();
nextXDeliveryTimeRef.value.open();
}
</script>
<style lang="scss">
</style>
属性说明
名称 |
类型 |
默认值 |
描述 |
title |
String |
'' |
标题title |
content |
Array |
[] |
数据源 |
barHidth |
Number |
400 |
bar高度 |
closeOnClickOverlay |
Boolean |
false |
是否可以点击遮罩关闭弹层 |