pad真机测试更改

dev2
Panzihang 2023-07-25 13:18:37 +08:00
parent e0e2393fed
commit 80eb0d647d
9 changed files with 322 additions and 353 deletions

View File

@ -17,6 +17,7 @@
@import "style/css/main.css";
@import "style/css/flex-main.css";
@import "/style/iconfont.css";
/deep/.uni-select {
background-color: #fff;

View File

@ -69,7 +69,7 @@ export default {
};
</script>
<style>
<style lang="less" scoped>
.info {
text-indent: 2em;
font-size: 28upx;

View File

@ -23,7 +23,7 @@
}
</script>
<style>
<style lang="less" scoped>
.headInfo {
position: relative;
background-color: #fff;

23
main.js
View File

@ -22,29 +22,6 @@ import liuStepBar from './uni_modules/liu-step-bar/components/liu-step-bar/liu-s
Vue.component('uni-pop', uniPop)
Vue.component('liu-step-bar', liuStepBar)
import Vant from 'vant';
import 'vant/lib/index.less';
Vue.use(Vant);
import {
RadioGroup,
Radio,
Button,
Uploader,
Field,
Checkbox,
CheckboxGroup,
Progress
} from 'vant';
Vue.use(Radio);
Vue.use(RadioGroup);
Vue.use(Button);
Vue.use(Uploader);
Vue.use(Field);
Vue.use(Checkbox);
Vue.use(CheckboxGroup);
const app = new Vue({
store,
...App

View File

@ -1,88 +1,87 @@
{
"name": "iapd",
"appid": "__UNI__820CEDC",
"description": "",
"versionName": "1.0.0",
"versionCode": "100",
"transformPx": false,
/* 5+App */
"app-plus": {
"usingComponents": true,
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"splashscreen": {
"alwaysShowBeforeRender": true,
"waiting": true,
"autoclose": true,
"delay": 0
},
/* */
"modules": {},
/* */
"distribute": {
/* android */
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
/* ios */
"ios": {},
/* SDK */
"sdkConfigs": {}
}
},
/* */
"quickapp": {},
/* */
"mp-weixin": {
"appid": "wxb5fe43c6c0f0a8da",
"setting": {
"urlCheck": false,
"es6": true,
"ignoreDevUnusedFiles": false
},
"usingComponents": true,
"permission": {
"scope.userLocation": {
"desc": "获取当前定位判断距离"
}
},
"requiredPrivateInfos": [
"getLocation"
],
"plugins": {
"ocr-plugin": {
"version": "3.1.1",
"provider": "wx4418e3e031e551be"
}
}
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"uniStatistics": {
"enable": false
},
"vueVersion": "2"
{
"name" : "iapd",
"appid" : "__UNI__820CEDC",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
/* 5+App */
"app-plus" : {
"usingComponents" : true,
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"splashscreen" : {
"alwaysShowBeforeRender" : true,
"waiting" : true,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ]
},
/* ios */
"ios" : {},
/* SDK */
"sdkConfigs" : {}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wxb5fe43c6c0f0a8da",
"setting" : {
"urlCheck" : false,
"es6" : true,
"ignoreDevUnusedFiles" : false
},
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "获取当前定位判断距离"
}
},
"requiredPrivateInfos" : [ "getLocation" ],
"plugins" : {
"ocr-plugin" : {
"version" : "3.1.1",
"provider" : "wx4418e3e031e551be"
}
}
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"uniStatistics" : {
"enable" : false
},
"vueVersion" : "2"
}

View File

@ -31,7 +31,7 @@
};
</script>
<style>
<style lang="less" scoped>
.container {
display: flex;
}

View File

@ -1,12 +1,10 @@
<template>
<view class="login">
<view class="loginBox">
<van-field v-model="account" left-icon="manager" placeholder="请输入账号"
:rules="[{ required: true, message: '请输入账号' }]" />
<van-field v-model="password" type="password" left-icon="lock" right-icon="eye" placeholder="请输入密码"
:rules="[{ required: true, message: '请输入密码' }]" @click-right-icon="rightIcon" v-if="!pwdType" />
<van-field v-model="password" left-icon="lock" right-icon="closed-eye" placeholder="请输入密码"
:rules="[{ required: true, message: '请输入密码' }]" @click-right-icon="rightIcon" v-else />
<uni-easyinput prefixIcon="person-filled" v-model="account" placeholder="请输入账号"></uni-easyinput>
<uni-easyinput type="password" prefixIcon="locked-filled" suffixIcon="search" v-model="account"
placeholder="请输入密码">
</uni-easyinput>
<view class="button" @click="loginGo('center')"></view>
<uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popupBox">
@ -37,8 +35,6 @@
account: 'rtoswuhan1',
// 123456
password: '123456',
//
pwdType: false,
//
type: "",
portList: [],
@ -63,10 +59,6 @@
]
},
methods: {
//
rightIcon() {
this.pwdType = !this.pwdType
},
//
loginGo(type) {
if (this.account == "rtoswuhan1" && this.password == "123456") {
@ -123,7 +115,7 @@
margin: 0 auto;
padding: 30px;
/deep/.van-cell {
/deep/.is-input-border {
margin-top: 20px;
}

View File

@ -5,19 +5,14 @@
<side-bar path='3'></side-bar>
<view class="content">
<view class="form">
<!-- <view class="select">
<uni-data-select v-model="pamValue" :localdata="pamList" @change="pamChange"
placeholder="请选择港口">
</uni-data-select>
</view> -->
<view class="select">
<superwei-combox :candidates="shipList" :isJSON="true" keyName="spmName" placeholder="请选择船名航次"
v-model="shipName" @input="input_json" @select="select_json"></superwei-combox>
</view>
<van-button type="default" @click="search"></van-button>
<button class="searchBtn" type="default" @click="search"></button>
</view>
<view class="itemList">
<template v-if="total != 0">
<template v-if="itemList.length > 0">
<view v-for="(item, index) in itemList" :key="index" class="item" @click="toGo(item)">
<view class="title">
<view class="name">
@ -71,10 +66,8 @@
</view>
<view class="footer">
<view class="footer">
<van-button class="fitem" type="default"
@click.stop="download(item)">下载</van-button>
<van-button class="fitem" type="default"
@click.stop="upload(item)">上传</van-button>
<button class="fitem" type="default" @click.stop="download(item)">下载</button>
<button class="fitem" type="default" @click.stop="upload(item)">上传</button>
</view>
</view>
</view>
@ -82,7 +75,7 @@
</template>
<o-empty v-else height="70vh" bg="#f5f6fa" />
</view>
<view class="pageBox" v-if="total != 0">
<view class="pageBox" v-if="itemList.length > 0">
<uni-pagination :show-icon="true" :total="total" :pageSize="pageSize" :current="current"
@change="changePage" />
</view>
@ -122,7 +115,6 @@
},
mounted() {
this.pamValue = uni.getStorageSync('portObj').portId
// this.getPam();
},
methods: {
//
@ -161,28 +153,6 @@
this.current = e.current;
this.initData()
},
//
// getPam() {
// uni.request({
// url: this.$local + '/api/shipOperate/queryPortArea',
// header: {
// 'Content-Type': 'application/json' //
// },
// method: 'GET', //
// success: (res) => {
// console.log('------', res);
// if (res.statusCode === 200) {
// let arr = res.data.data;
// arr.forEach((v, index) => {
// this.pamList.push({
// text: v.pamName,
// value: v.pamId
// })
// })
// }
// }
// })
// },
//
getShip() {
uni.request({
@ -211,7 +181,17 @@
},
//
search() {
this.initData()
this.itemList = [{
uploadTime: "1",
uploadStatusDesc: "2",
actualBerthageName: "3",
planBerthageName: "4",
outTradeTypeName: "5",
outVvyName: "6",
inTradeTypeName: "7",
inVvyName: "8"
}]
// this.initData()
},
//
download(item) {
@ -468,9 +448,10 @@
margin-left: 15px;
}
/deep/.van-button {
.searchBtn {
height: 35px;
line-height: 35px;
margin-left: 0;
}
}

View File

@ -2,22 +2,24 @@
<view class="uni-date">
<view class="uni-date-editor" @click="show">
<slot>
<view
class="uni-date-editor--x"
:class="{'uni-date-editor--x__disabled': disabled,'uni-date-x--border': border}"
>
<view class="uni-date-editor--x"
:class="{'uni-date-editor--x__disabled': disabled,'uni-date-x--border': border}">
<view v-if="!isRange" class="uni-date-x uni-date-single">
<uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
<view class="uni-date__x-input">{{ displayValue || singlePlaceholderText }}</view>
</view>
<view v-else class="uni-date-x uni-date-range">
<uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
<view class="uni-date__x-input text-center">{{ displayRangeValue.startDate || startPlaceholderText }}</view>
<uni-icons class="icon-calendar" type="calendar" color="#c0c4cc" size="22"></uni-icons>
<view class="uni-date__x-input text-center">
{{ displayRangeValue.startDate || startPlaceholderText }}
</view>
<view class="range-separator">{{rangeSeparator}}</view>
<view class="range-separator">{{rangeSeparator}}</view>
<view class="uni-date__x-input text-center">{{ displayRangeValue.endDate || endPlaceholderText }}</view>
<view class="uni-date__x-input text-center">
{{ displayRangeValue.endDate || endPlaceholderText }}
</view>
</view>
<view v-if="showClearIcon" class="uni-date__icon-clear" @click.stop="clear">
@ -38,16 +40,16 @@
:placeholder="selectDateText" />
<time-picker type="time" v-model="pickerTime" :border="false" :disabled="!inputDate"
:start="timepickerStartTime" :end="timepickerEndTime" :hideSecond="hideSecond" style="width: 100%;">
<input class="uni-date__input text-center" type="text" v-model="pickerTime" :placeholder="selectTimeText"
:disabled="!inputDate" />
:start="timepickerStartTime" :end="timepickerEndTime" :hideSecond="hideSecond"
style="width: 100%;">
<input class="uni-date__input text-center" type="text" v-model="pickerTime"
:placeholder="selectTimeText" :disabled="!inputDate" />
</time-picker>
</view>
<Calendar ref="pcSingle" :showMonth="false" :start-date="calendarRange.startDate"
:end-date="calendarRange.endDate" :date="calendarDate" @change="singleChange"
:default-value="defaultValue"
style="padding: 0 8px;" />
:default-value="defaultValue" style="padding: 0 8px;" />
<view v-if="hasTime" class="popup-x-footer">
<text class="confirm-text" @click="confirmSingleChange">{{okText}}</text>
@ -58,18 +60,18 @@
<view class="uni-popper__arrow"></view>
<view v-if="hasTime" class="popup-x-header uni-date-changed">
<view class="popup-x-header--datetime">
<input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.startDate"
:placeholder="startDateText" />
<input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.startDate"
:placeholder="startDateText" />
<time-picker type="time" v-model="tempRange.startTime" :start="timepickerStartTime" :border="false"
:disabled="!tempRange.startDate" :hideSecond="hideSecond">
<input class="uni-date__input uni-date-range__input" type="text"
v-model="tempRange.startTime" :placeholder="startTimeText"
:disabled="!tempRange.startDate" />
</time-picker>
</view>
<time-picker type="time" v-model="tempRange.startTime" :start="timepickerStartTime"
:border="false" :disabled="!tempRange.startDate" :hideSecond="hideSecond">
<input class="uni-date__input uni-date-range__input" type="text"
v-model="tempRange.startTime" :placeholder="startTimeText"
:disabled="!tempRange.startDate" />
</time-picker>
</view>
<uni-icons type="arrowthinright" color="#999" style="line-height: 40px;"></uni-icons>
<uni-icons type="arrowthinright" color="#999" style="line-height: 40px;"></uni-icons>
<view class="popup-x-header--datetime">
<input class="uni-date__input uni-date-range__input" type="text" v-model="tempRange.endDate"
@ -85,8 +87,8 @@
<view class="popup-x-body">
<Calendar ref="left" :showMonth="false" :start-date="calendarRange.startDate"
:end-date="calendarRange.endDate" :range="true" :pleStatus="endMultipleStatus"
@change="leftChange" @firstEnterCale="updateRightCale" style="padding: 0 8px;" />
:end-date="calendarRange.endDate" :range="true" :pleStatus="endMultipleStatus"
@change="leftChange" @firstEnterCale="updateRightCale" style="padding: 0 8px;" />
<Calendar ref="right" :showMonth="false" :start-date="calendarRange.startDate"
:end-date="calendarRange.endDate" :range="true" @change="rightChange"
:pleStatus="startMultipleStatus" @firstEnterCale="updateLeftCale"
@ -102,8 +104,7 @@
<Calendar v-if="isPhone" ref="mobile" :clearDate="false" :date="calendarDate" :defTime="mobileCalendarTime"
:start-date="calendarRange.startDate" :end-date="calendarRange.endDate" :selectableTimes="mobSelectableTime"
:startPlaceholder="startPlaceholder" :endPlaceholder="endPlaceholder"
:default-value="defaultValue"
:startPlaceholder="startPlaceholder" :endPlaceholder="endPlaceholder" :default-value="defaultValue"
:pleStatus="endMultipleStatus" :showMonth="false" :range="isRange" :hasTime="hasTime" :insert="false"
:hideSecond="hideSecond" @confirm="mobileChange" @maskClose="close" />
</view>
@ -133,9 +134,19 @@
**/
import Calendar from './calendar.vue'
import TimePicker from './time-picker.vue'
import { initVueI18n } from '@dcloudio/uni-i18n'
import {
initVueI18n
} from '@dcloudio/uni-i18n'
import i18nMessages from './i18n/index.js'
import { getDateTime, getDate, getTime, getDefaultSecond, dateCompare, checkDate, fixIosDateFormat } from './util'
import {
getDateTime,
getDate,
getTime,
getDefaultSecond,
dateCompare,
checkDate,
fixIosDateFormat
} from './util'
export default {
name: 'UniDatetimePicker',
@ -188,7 +199,7 @@
isEmitValue: false,
isPhone: false,
isFirstShow: true,
i18nT: () => {}
i18nT: () => {}
}
},
props: {
@ -221,7 +232,7 @@
default: ''
},
startPlaceholder: {
type: String,
type: String,
default: ''
},
endPlaceholder: {
@ -248,16 +259,16 @@
type: [Boolean],
default: false
},
defaultValue: {
type: [String, Object, Array],
default: ''
}
defaultValue: {
type: [String, Object, Array],
default: ''
}
},
watch: {
type: {
immediate: true,
handler(newVal) {
this.hasTime = newVal.indexOf('time') !== -1
this.hasTime = newVal.indexOf('time') !== -1
this.isRange = newVal.indexOf('range') !== -1
}
},
@ -348,9 +359,9 @@
selectDateText() {
return this.i18nT("uni-datetime-picker.selectDate")
},
selectDateTimeText() {
return this.i18nT("uni-datetime-picker.selectDateTime")
},
selectDateTimeText() {
return this.i18nT("uni-datetime-picker.selectDateTime")
},
selectTimeText() {
return this.i18nT("uni-datetime-picker.selectTime")
},
@ -373,18 +384,19 @@
return this.i18nT("uni-datetime-picker.clear")
},
showClearIcon() {
return this.clearIcon && !this.disabled && (this.displayValue || (this.displayRangeValue.startDate && this.displayRangeValue.endDate))
return this.clearIcon && !this.disabled && (this.displayValue || (this.displayRangeValue.startDate && this
.displayRangeValue.endDate))
}
},
created() {
this.initI18nT()
this.platform()
this.platform()
},
methods: {
initI18nT() {
const vueI18n = initVueI18n(i18nMessages)
this.i18nT = vueI18n.t
},
initI18nT() {
const vueI18n = initVueI18n(i18nMessages)
this.i18nT = vueI18n.t
},
initPicker(newVal) {
if ((!newVal && !this.defaultValue) || Array.isArray(newVal) && !newVal.length) {
this.$nextTick(() => {
@ -394,26 +406,26 @@
}
if (!Array.isArray(newVal) && !this.isRange) {
if(newVal){
this.displayValue = this.inputDate = this.calendarDate = getDate(newVal)
if (this.hasTime) {
this.pickerTime = getTime(newVal, this.hideSecond)
this.displayValue = `${this.displayValue} ${this.pickerTime}`
}
}else if(this.defaultValue){
this.inputDate = this.calendarDate = getDate(this.defaultValue)
if(this.hasTime){
this.pickerTime = getTime(this.defaultValue, this.hideSecond)
}
}
if (newVal) {
this.displayValue = this.inputDate = this.calendarDate = getDate(newVal)
if (this.hasTime) {
this.pickerTime = getTime(newVal, this.hideSecond)
this.displayValue = `${this.displayValue} ${this.pickerTime}`
}
} else if (this.defaultValue) {
this.inputDate = this.calendarDate = getDate(this.defaultValue)
if (this.hasTime) {
this.pickerTime = getTime(this.defaultValue, this.hideSecond)
}
}
} else {
const [before, after] = newVal
if (!before && !after) return
const beforeDate = getDate(before)
const beforeTime = getTime(before, this.hideSecond)
const beforeDate = getDate(before)
const beforeTime = getTime(before, this.hideSecond)
const afterDate = getDate(after)
const afterTime = getTime(after, this.hideSecond)
const afterDate = getDate(after)
const afterTime = getTime(after, this.hideSecond)
const startDate = beforeDate
const endDate = afterDate
this.displayRangeValue.startDate = this.tempRange.startDate = startDate
@ -450,11 +462,13 @@
right.setDate(this.$refs.right.nowDate.fullDate)
},
platform() {
if(typeof navigator !== "undefined"){
this.isPhone = navigator.userAgent.toLowerCase().indexOf('mobile') !== -1
return
}
const { windowWidth } = uni.getSystemInfoSync()
if (typeof navigator !== "undefined") {
this.isPhone = navigator.userAgent.toLowerCase().indexOf('mobile') !== -1
return
}
const {
windowWidth
} = uni.getSystemInfoSync()
this.isPhone = windowWidth <= 500
this.windowWidth = windowWidth
},
@ -465,8 +479,8 @@
this.platform()
if (this.isPhone) {
setTimeout(() => {
this.$refs.mobile.open()
}, 0);
this.$refs.mobile.open()
}, 0);
return
}
this.pickerPositionStyle = {
@ -544,52 +558,52 @@
this.confirmSingleChange()
},
confirmSingleChange() {
if(!checkDate(this.inputDate)){
if (!checkDate(this.inputDate)) {
const now = new Date()
this.calendarDate = this.inputDate = getDate(now)
this.calendarDate = this.inputDate = getDate(now)
this.pickerTime = getTime(now, this.hideSecond)
}
}
let startLaterInputDate = false
let startDate, startTime
if(this.start) {
let startString = this.start
if(typeof this.start === 'number'){
startString = getDateTime(this.start, this.hideSecond)
}
[startDate, startTime] = startString.split(' ')
if(this.start && !dateCompare(startDate, this.inputDate)) {
startLaterInputDate = true
this.inputDate = startDate
}
}
let startLaterInputDate = false
let startDate, startTime
if (this.start) {
let startString = this.start
if (typeof this.start === 'number') {
startString = getDateTime(this.start, this.hideSecond)
}
[startDate, startTime] = startString.split(' ')
if (this.start && !dateCompare(startDate, this.inputDate)) {
startLaterInputDate = true
this.inputDate = startDate
}
}
let endEarlierInputDate = false
let endDate, endTime
if(this.end) {
let endString = this.end
if(typeof this.end === 'number'){
endString = getDateTime(this.end, this.hideSecond)
}
[endDate, endTime] = endString.split(' ')
if(this.end && !dateCompare(this.inputDate, endDate)) {
endEarlierInputDate = true
this.inputDate = endDate
}
}
let endEarlierInputDate = false
let endDate, endTime
if (this.end) {
let endString = this.end
if (typeof this.end === 'number') {
endString = getDateTime(this.end, this.hideSecond)
}
[endDate, endTime] = endString.split(' ')
if (this.end && !dateCompare(this.inputDate, endDate)) {
endEarlierInputDate = true
this.inputDate = endDate
}
}
if (this.hasTime) {
if(startLaterInputDate){
this.pickerTime = startTime || getDefaultSecond(this.hideSecond)
}
if(endEarlierInputDate){
this.pickerTime = endTime || getDefaultSecond(this.hideSecond)
}
if(!this.pickerTime){
this.pickerTime = getTime(Date.now(), this.hideSecond)
}
if (startLaterInputDate) {
this.pickerTime = startTime || getDefaultSecond(this.hideSecond)
}
if (endEarlierInputDate) {
this.pickerTime = endTime || getDefaultSecond(this.hideSecond)
}
if (!this.pickerTime) {
this.pickerTime = getTime(Date.now(), this.hideSecond)
}
this.displayValue = `${this.inputDate} ${this.pickerTime}`
} else {
this.displayValue = this.inputDate
this.displayValue = this.inputDate
}
this.setEmit(this.displayValue)
this.pickerVisible = false
@ -624,11 +638,14 @@
},
mobileChange(e) {
if (this.isRange) {
const {before, after} = e.range
const {
before,
after
} = e.range
if(!before || !after){
return
}
if (!before || !after) {
return
}
this.handleStartAndEnd(before, after, true)
if (this.hasTime) {
@ -661,79 +678,79 @@
this.pickerVisible = false
return
}
if(!checkDate(this.tempRange.startDate)){
this.tempRange.startDate = getDate(Date.now())
}
if(!checkDate(this.tempRange.endDate)){
this.tempRange.endDate = getDate(Date.now())
}
if (!checkDate(this.tempRange.startDate)) {
this.tempRange.startDate = getDate(Date.now())
}
if (!checkDate(this.tempRange.endDate)) {
this.tempRange.endDate = getDate(Date.now())
}
let start, end
let startDateLaterRangeStartDate = false
let startDateLaterRangeEndDate = false
let startDate, startTime
if(this.start) {
let startString = this.start
if(typeof this.start === 'number'){
startString = getDateTime(this.start, this.hideSecond)
}
[startDate,startTime] = startString.split(' ')
if(this.start && !dateCompare(this.start, this.tempRange.startDate)) {
startDateLaterRangeStartDate = true
this.tempRange.startDate = startDate
}
if(this.start && !dateCompare(this.start, this.tempRange.endDate)) {
startDateLaterRangeEndDate = true
this.tempRange.endDate = startDate
}
}
let endDateEarlierRangeStartDate = false
let endDateEarlierRangeEndDate = false
let endDate, endTime
if(this.end) {
let endString = this.end
if(typeof this.end === 'number'){
endString = getDateTime(this.end, this.hideSecond)
}
[endDate,endTime] = endString.split(' ')
let startDateLaterRangeStartDate = false
let startDateLaterRangeEndDate = false
let startDate, startTime
if (this.start) {
let startString = this.start
if (typeof this.start === 'number') {
startString = getDateTime(this.start, this.hideSecond)
}
[startDate, startTime] = startString.split(' ')
if (this.start && !dateCompare(this.start, this.tempRange.startDate)) {
startDateLaterRangeStartDate = true
this.tempRange.startDate = startDate
}
if (this.start && !dateCompare(this.start, this.tempRange.endDate)) {
startDateLaterRangeEndDate = true
this.tempRange.endDate = startDate
}
}
let endDateEarlierRangeStartDate = false
let endDateEarlierRangeEndDate = false
let endDate, endTime
if (this.end) {
let endString = this.end
if (typeof this.end === 'number') {
endString = getDateTime(this.end, this.hideSecond)
}
[endDate, endTime] = endString.split(' ')
if(this.end && !dateCompare(this.tempRange.startDate, this.end)) {
endDateEarlierRangeStartDate = true
this.tempRange.startDate = endDate
}
if(this.end && !dateCompare(this.tempRange.endDate, this.end)) {
endDateEarlierRangeEndDate = true
this.tempRange.endDate = endDate
}
}
if (this.end && !dateCompare(this.tempRange.startDate, this.end)) {
endDateEarlierRangeStartDate = true
this.tempRange.startDate = endDate
}
if (this.end && !dateCompare(this.tempRange.endDate, this.end)) {
endDateEarlierRangeEndDate = true
this.tempRange.endDate = endDate
}
}
if (!this.hasTime) {
start = this.displayRangeValue.startDate = this.tempRange.startDate
start = this.displayRangeValue.startDate = this.tempRange.startDate
end = this.displayRangeValue.endDate = this.tempRange.endDate
} else {
if(startDateLaterRangeStartDate){
this.tempRange.startTime = startTime || getDefaultSecond(this.hideSecond)
}else if(endDateEarlierRangeStartDate){
this.tempRange.startTime = endTime || getDefaultSecond(this.hideSecond)
}
if(!this.tempRange.startTime){
this.tempRange.startTime = getTime(Date.now(), this.hideSecond)
}
if (startDateLaterRangeStartDate) {
this.tempRange.startTime = startTime || getDefaultSecond(this.hideSecond)
} else if (endDateEarlierRangeStartDate) {
this.tempRange.startTime = endTime || getDefaultSecond(this.hideSecond)
}
if (!this.tempRange.startTime) {
this.tempRange.startTime = getTime(Date.now(), this.hideSecond)
}
if(startDateLaterRangeEndDate){
this.tempRange.endTime = startTime || getDefaultSecond(this.hideSecond)
}else if(endDateEarlierRangeEndDate){
this.tempRange.endTime = endTime || getDefaultSecond(this.hideSecond)
}
if(!this.tempRange.endTime){
this.tempRange.endTime = getTime(Date.now(), this.hideSecond)
}
if (startDateLaterRangeEndDate) {
this.tempRange.endTime = startTime || getDefaultSecond(this.hideSecond)
} else if (endDateEarlierRangeEndDate) {
this.tempRange.endTime = endTime || getDefaultSecond(this.hideSecond)
}
if (!this.tempRange.endTime) {
this.tempRange.endTime = getTime(Date.now(), this.hideSecond)
}
start = this.displayRangeValue.startDate = `${this.tempRange.startDate} ${this.tempRange.startTime}`
end = this.displayRangeValue.endDate = `${this.tempRange.endDate} ${this.tempRange.endTime}`
}
if(!dateCompare(start,end)){
[start, end] = [end, start]
}
if (!dateCompare(start, end)) {
[start, end] = [end, start]
}
this.displayRangeValue.startDate = start
this.displayRangeValue.endDate = end
const displayRange = [start, end]
@ -744,10 +761,10 @@
if (!(before && after)) return
const type = temp ? 'tempRange' : 'range'
const isStartEarlierEnd = dateCompare(before, after)
this[type].startDate = isStartEarlierEnd ? before : after
this[type].endDate = isStartEarlierEnd ? after : before
},
const isStartEarlierEnd = dateCompare(before, after)
this[type].startDate = isStartEarlierEnd ? before : after
this[type].endDate = isStartEarlierEnd ? after : before
},
/**
* 比较时间大小
*/
@ -818,6 +835,7 @@
width: 100%;
flex: 1;
}
.uni-date-x {
display: flex;
flex-direction: row;
@ -829,16 +847,17 @@
font-size: 14px;
flex: 1;
.icon-calendar{
padding-left: 3px;
}
.range-separator{
height: 35px;
/* #ifndef MP */
padding: 0 2px;
/* #endif */
.icon-calendar {
padding-left: 3px;
}
.range-separator {
height: 35px;
/* #ifndef MP */
padding: 0 2px;
/* #endif */
line-height: 35px;
}
}
}
.uni-date-x--border {
@ -865,9 +884,9 @@
.uni-date__x-input {
width: auto;
height: 35px;
/* #ifndef MP */
padding-left: 5px;
/* #endif */
/* #ifndef MP */
padding-left: 5px;
/* #endif */
position: relative;
flex: 1;
line-height: 35px;
@ -1029,4 +1048,4 @@
margin-left: -6px;
border-bottom-color: #fff;
}
</style>
</style>