|
@@ -1,28 +1,40 @@
|
|
<template>
|
|
<template>
|
|
<u-popup :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto"
|
|
<u-popup :maskCloseAble="maskCloseAble" mode="bottom" :popup="false" v-model="value" length="auto"
|
|
:safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
|
|
:safeAreaInsetBottom="safeAreaInsetBottom" @close="close" :z-index="uZIndex">
|
|
- <view class="u-datetime-picker">
|
|
|
|
-
|
|
|
|
|
|
+ <view class="u-datetime-picker">
|
|
<view class="u-picker-header" @touchmove.stop.prevent="">
|
|
<view class="u-picker-header" @touchmove.stop.prevent="">
|
|
- <view class="u-btn-picker u-btn-picker--tips" :style="{ color: cancelColor }" hover-class="u-opacity"
|
|
|
|
- :hover-stay-time="150" @tap="getResult('cancel')"></view>
|
|
|
|
|
|
+ <view class="u-btn-picker u-btn-picker--tips"
|
|
|
|
+ :style="{ color: cancelColor }"
|
|
|
|
+ hover-class="u-opacity"
|
|
|
|
+ :hover-stay-time="150"
|
|
|
|
+ v-show="!noselect"
|
|
|
|
+ @tap="getResult('cancel')"
|
|
|
|
+ >{{cancelText}}</view>
|
|
|
|
+ <view></view>
|
|
<view class="u-picker__title">{{ title }}</view>
|
|
<view class="u-picker__title">{{ title }}</view>
|
|
- <view class="u-btn-picker u-btn-picker--primary" :style="{ color: cancelColor }"
|
|
|
|
- hover-class="u-opacity" :hover-stay-time="150" @touchmove.stop="" @tap.stop="getResult('cancel')">
|
|
|
|
- <u-icon name="close"></u-icon>
|
|
|
|
|
|
+ <view></view>
|
|
|
|
+ <view
|
|
|
|
+ class="u-btn-picker u-btn-picker--primary"
|
|
|
|
+ :style="{ color: moving ? cancelColor : confirmColor }"
|
|
|
|
+ hover-class="u-opacity"
|
|
|
|
+ :hover-stay-time="150"
|
|
|
|
+ @touchmove.stop=""
|
|
|
|
+ @tap.stop="getResult('confirm')"
|
|
|
|
+ v-show="!noselect"
|
|
|
|
+ >
|
|
|
|
+ {{confirmText}}
|
|
</view>
|
|
</view>
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
|
|
+ </view>
|
|
<view class="u-datetime-picker" v-if="noselect">
|
|
<view class="u-datetime-picker" v-if="noselect">
|
|
<view class="u-picker-header" @touchmove.stop.prevent="">
|
|
<view class="u-picker-header" @touchmove.stop.prevent="">
|
|
|
|
|
|
<view class="headesParamsSelect" :class="{
|
|
<view class="headesParamsSelect" :class="{
|
|
selectIndex:params.day
|
|
selectIndex:params.day
|
|
- }" @click="params.day=true">按日期选择</view>
|
|
|
|
|
|
+ }" @click="params.day=true,init()">按日期选择</view>
|
|
|
|
|
|
<view class="headesParamsSelect" :class="{
|
|
<view class="headesParamsSelect" :class="{
|
|
selectIndex:!params.day
|
|
selectIndex:!params.day
|
|
- }" @click="params.day=false">按月选择</view>
|
|
|
|
|
|
+ }" @click="params.day=false,init()">按月选择</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="u-picker-body">
|
|
<view class="u-picker-body">
|
|
@@ -53,7 +65,7 @@
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
- <view class="u-datetime-picker">
|
|
|
|
|
|
+ <view class="u-datetime-picker" v-if="noselect">
|
|
|
|
|
|
<view class="u-picker-header u-picker-header2" @touchmove.stop.prevent="">
|
|
<view class="u-picker-header u-picker-header2" @touchmove.stop.prevent="">
|
|
<view class="u-btn-picker u-btn-picker--tips" :style="{ color: cancelColor }" hover-class="u-opacity"
|
|
<view class="u-btn-picker u-btn-picker--tips" :style="{ color: cancelColor }" hover-class="u-opacity"
|
|
@@ -76,7 +88,8 @@
|
|
import provinces from '../../libs/util/province.js';
|
|
import provinces from '../../libs/util/province.js';
|
|
import citys from '../../libs/util/city.js';
|
|
import citys from '../../libs/util/city.js';
|
|
import areas from '../../libs/util/area.js';
|
|
import areas from '../../libs/util/area.js';
|
|
-
|
|
|
|
|
|
+ // 苹果手机时间显示bug
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* picker picker弹出选择器
|
|
* picker picker弹出选择器
|
|
* @description 此选择器有两种弹出模式:一是时间模式,可以配置年,日,月,时,分,秒参数 二是地区模式,可以配置省,市,区参数
|
|
* @description 此选择器有两种弹出模式:一是时间模式,可以配置年,日,月,时,分,秒参数 二是地区模式,可以配置省,市,区参数
|
|
@@ -355,11 +368,10 @@
|
|
// 格式化时间,在IE浏览器(uni不存在此情况),无法识别日期间的"-"间隔符号
|
|
// 格式化时间,在IE浏览器(uni不存在此情况),无法识别日期间的"-"间隔符号
|
|
let fdate = this.defaultTime.replace(/\-/g, '/');
|
|
let fdate = this.defaultTime.replace(/\-/g, '/');
|
|
|
|
|
|
- fdate = fdate && fdate.indexOf('/') == -1 ? `2020/01/01 ${fdate}` : fdate;
|
|
|
|
|
|
+ fdate = fdate && fdate.indexOf('/') == -1 ? `2020/01/01 ${fdate}` : fdate;
|
|
if(fdate.length==7){
|
|
if(fdate.length==7){
|
|
fdate+="/01"
|
|
fdate+="/01"
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ }
|
|
let time = null;
|
|
let time = null;
|
|
if (fdate) time = this.newDate(fdate);
|
|
if (fdate) time = this.newDate(fdate);
|
|
else time = new Date();
|
|
else time = new Date();
|