Skip to content

Commit e618465

Browse files
committed
fixed: icons bug, opti: rename files
1 parent 122650a commit e618465

File tree

7 files changed

+61
-57
lines changed

7 files changed

+61
-57
lines changed

uni_modules/uni-datetime-picker/changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 2.0.6(2021-05-22)
2+
- 修复 图标 在小程序上不显示的 bug
3+
- 优化 重命名引用组件,避免冲突
14
## 2.0.5(2021-05-20)
25
- 优化 代码目录扁平化
36
## 2.0.4(2021-05-12)
Binary file not shown.

uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-calendar.vue renamed to uni_modules/uni-datetime-picker/components/uni-datetime-picker/calendar.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393

9494
<script>
9595
import Calendar from './util.js';
96-
import calendarItem from './uni-calendar-item.vue'
96+
import calendarItem from './calendar-item.vue'
9797
import timePicker from './time-picker.vue'
9898
/**
9999
* Calendar 日历
@@ -117,7 +117,7 @@
117117
*/
118118
export default {
119119
components: {
120-
calendarItem,
120+
calendarItem,
121121
timePicker
122122
},
123123
props: {
@@ -209,7 +209,7 @@
209209
timeRange: {
210210
startTime: this.defTime.start ? this.defTime.start : '',
211211
endTime: this.defTime.end ? this.defTime.end : ''
212-
},
212+
},
213213
tempSingleDate: this.date,
214214
tempRange: {
215215
before: '',
@@ -444,7 +444,7 @@
444444
this.calendar = weeks
445445
// 设置多选
446446
this.cale.setMultiple(this.calendar.fullDate, true)
447-
this.weeks = this.cale.weeks
447+
this.weeks = this.cale.weeks
448448
this.tempSingleDate = this.calendar.fullDate
449449
this.tempRange.before = this.cale.multipleStatus.before
450450
this.tempRange.after = this.cale.multipleStatus.after
@@ -757,4 +757,4 @@
757757
.mr-10 {
758758
margin-right: 10px;
759759
}
760-
</style>
760+
</style>

uni_modules/uni-datetime-picker/components/uni-datetime-picker/time-picker.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
</view>
7979
</view>
8080
<!-- #ifdef H5 -->
81-
<keypress v-if="visible" @esc="tiggerTimePicker" @enter="setTime" />
81+
<!-- <keypress v-if="visible" @esc="tiggerTimePicker" @enter="setTime" /> -->
8282
<!-- #endif -->
8383
</view>
8484
</template>
@@ -921,4 +921,4 @@
921921
.time-hide-second {
922922
width: 180px;
923923
}
924-
</style>
924+
</style>

uni_modules/uni-datetime-picker/components/uni-datetime-picker/uni-datetime-picker.vue

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44
'uni-date-x--border': border}">
55
<view v-if="!isRange" class="uni-date-x uni-date-single" @click="show">
66
<view class="uni-date__icon-logo">
7-
<image class="uni-date-editor--logo" src="./cale-50.png" mode=""></image>
7+
<image class="uni-date-editor--logo" :src="iconBase64" mode=""></image>
88
</view>
99
<input class="uni-date__input" type="text" v-model="singleVal" :placeholder="placeholder"
1010
:disabled="true" />
1111
</view>
1212
<view v-else class="uni-date-x uni-date-range" @click="show">
1313
<view class="uni-date__icon-logo">
14-
<image class="uni-date-editor--logo" src="./cale-50.png" mode=""></image>
14+
<image class="uni-date-editor--logo" :src="iconBase64" mode=""></image>
1515
</view>
1616
<input class="uni-date__input uni-date-range__input" type="text" v-model="range.startDate"
1717
:placeholder="startPlaceholder" :disabled="true" />
@@ -28,7 +28,7 @@
2828
</view>
2929

3030
<view v-show="popup" class="uni-date-mask" @click="close"></view>
31-
<view ref="datePicker" v-show="popup" class="uni-date-picker__container">
31+
<view ref="datePicker" v-show="popup" class="uni-date-picker__container">
3232
<view v-if="!isRange" class="uni-date-single--x" :style="popover">
3333
<view v-show="hasTime" class="uni-date-changed popup-x-header">
3434
<input class="uni-date__input uni-date-range__input" type="text" v-model="tempSingleDate"
@@ -39,12 +39,12 @@
3939
placeholder="选择时间" :disabled="!tempSingleDate" />
4040
</time-picker>
4141
</view>
42-
<uni-calendar ref="pcSingle" :showMonth="false" :start-date="caleRange.startDate"
42+
<calendar ref="pcSingle" :showMonth="false" :start-date="caleRange.startDate"
4343
:end-date="caleRange.endDate" :date="defSingleDate" @change="singleChange" />
4444
<view v-if="hasTime" class="popup-x-footer">
4545
<!-- <text class="">此刻</text> -->
4646
<text class="confirm" @click="confirmSingleChange">确定</text>
47-
</view>
47+
</view>
4848
<view class="uni-date-popper__arrow"></view>
4949
</view>
5050

@@ -71,10 +71,10 @@
7171
</view>
7272
</view>
7373
<view class="popup-x-body">
74-
<uni-calendar ref="left" :showMonth="false" :start-date="caleRange.startDate"
74+
<calendar ref="left" :showMonth="false" :start-date="caleRange.startDate"
7575
:end-date="caleRange.endDate" :range="true" @change="leftChange" :pleStatus="endMultipleStatus"
7676
@firstEnterCale="updateRightCale" @monthSwitch="leftMonthSwitch" style="padding-right: 16px;" />
77-
<uni-calendar ref="right" :showMonth="false" :start-date="caleRange.startDate"
77+
<calendar ref="right" :showMonth="false" :start-date="caleRange.startDate"
7878
:end-date="caleRange.endDate" :range="true" @change="rightChange"
7979
:pleStatus="startMultipleStatus" @firstEnterCale="updateLeftCale"
8080
@monthSwitch="rightMonthSwitch" style="padding-left: 16px;border-left: 1px solid #F1F1F1;" />
@@ -85,14 +85,14 @@
8585
</view>
8686
</view>
8787
</view>
88-
<uni-calendar ref="mobile" :clearDate="false" :date="defSingleDate" :defTime="reactMobDefTime"
88+
<calendar ref="mobile" :clearDate="false" :date="defSingleDate" :defTime="reactMobDefTime"
8989
:start-date="caleRange.startDate" :end-date="caleRange.endDate" :selectableTimes="mobSelectableTime"
9090
:pleStatus="endMultipleStatus" :showMonth="false" :range="isRange" :typeHasTime="hasTime" :insert="false"
9191
@confirm="mobileChange" />
9292
</view>
9393
</template>
9494
<script>
95-
import uniCalendar from './uni-calendar.vue'
95+
import calendar from './calendar.vue'
9696
import timePicker from './time-picker.vue'
9797
9898
/**
@@ -110,10 +110,10 @@
110110
* @event {Function} change 确定日期时触发的事件
111111
**/
112112
113-
export default {
113+
export default {
114114
name:'UniDatetimePicker',
115115
components: {
116-
uniCalendar,
116+
calendar,
117117
timePicker
118118
},
119119
data() {
@@ -160,7 +160,8 @@
160160
},
161161
visible: false,
162162
popup: false,
163-
popover: null
163+
popover: null,
164+
iconBase64: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAACVklEQVRoge2Zv2vTQRTAP4oWJQQskmolBAnSQVMcSxbp4ubmIEWETu0oIjg5iIOgpLNunfQfMHToUgpOVgfRqRAL4q8WRLQVq4sOdyHPL9/7evfNJReS+8DB433v7r37fl/eu9xBJBKUB0BLt+uDaOOQZb8SUNXyuKuRftg46NeXcBww6M8AC0ANOAycAyb1s7e6+SbNxi/gBfAQ2HadcA7YB/4MUPsKzLos4jzwewAcNy3mhMnx5I/9BiqUAD4DDWAXmAfqWt8Enlq+GBfSbEwAt4AicAxYBO7aTPaGzhu4KvTLQn/Hh9cpmGzcFvqmaXAyaxWE/MGTg93yXsgFUyfbOrJCJ2s8y+tRP21s0fmMTlmih8zT8WnN1GloCmJWaF0CpvrlSAb1/3fJXshNT470hZEIrZeoahqaU8BZ10Exa4XGtiCaKKL+EIHaMX8U81ZEP7ntrwi7n4CfWi7p+UCFdFdh7Rpaps9+mn93rjY2THut0QqtoVlIkpi1QjNyCzEdnl0W+idCXxb6VmKudaGfsbBhRbcHdEWhf5eYt0o6FVR6BjhqYcOKoQkt2y/SAB5rWVbpVeCilmUl3hb6JNeAI1p+ZWEjFzH9hsY2tEwHdHX9DGATWNLyceCeGL/YhY+58LWhy9o0uhJDKw3T4dlr4L6WZab5JvRBGJqs9UPI5R44lQfpx56pUzK0NlA3R6AK1Engu1+/nGhfK7R5bjtwGnXdFfpSJ6190Quz5grqQCC048lFXMhy2nQZWkUVsRowZv8OvLOPCvdHwE5APyKRSMQzfwE22DtT3T5PPwAAAABJRU5ErkJggg=='
164165
}
165166
},
166167
props: {
@@ -407,10 +408,10 @@
407408
}
408409
this.$emit('change', value)
409410
this.$emit('input', value)
410-
},
411-
createTimestamp(date) {
412-
date = this.fixIosDateFormat(date)
413-
return Date.parse(new Date(date))
411+
},
412+
createTimestamp(date) {
413+
date = this.fixIosDateFormat(date)
414+
return Date.parse(new Date(date))
414415
},
415416
singleChange(e) {
416417
this.tempSingleDate = e.fulldate
@@ -574,7 +575,7 @@
574575
// if (this.popup) this.popup = false
575576
},
576577
577-
parseDate(date) {
578+
parseDate(date) {
578579
date = this.fixIosDateFormat(date)
579580
const defVal = new Date(date)
580581
const year = defVal.getFullYear()
@@ -595,13 +596,13 @@
595596
return item < 10 ? '0' + item : item
596597
},
597598
598-
//兼容 iOS、safari 日期格式
599-
fixIosDateFormat(value) {
600-
if (typeof value === 'string') {
601-
value = value.replace(/-/g, '/')
602-
}
603-
return value
604-
},
599+
//兼容 iOS、safari 日期格式
600+
fixIosDateFormat(value) {
601+
if (typeof value === 'string') {
602+
value = value.replace(/-/g, '/')
603+
}
604+
return value
605+
},
605606
606607
leftMonthSwitch(e) {
607608
// console.log('leftMonthSwitch 返回:', e)
@@ -687,7 +688,7 @@
687688
z-index: 996;
688689
}
689690
690-
.uni-date-single--x {
691+
.uni-date-single--x {
691692
/* padding: 0 8px; */
692693
position: absolute;
693694
top: 0;
@@ -699,7 +700,7 @@
699700
border-radius: 4px;
700701
}
701702
702-
.uni-date-range--x {
703+
.uni-date-range--x {
703704
padding: 0 8px;
704705
background-color: #fff;
705706
position: absolute;
@@ -790,31 +791,31 @@
790791
.uni-date-changed--time-date {
791792
color: #333;
792793
opacity: 0.6;
793-
}
794-
795-
/* .uni-date-popper__arrow {
796-
width: 10px;
797-
height: 10px;
798-
top: -6px;
799-
left: 35px;
800-
margin-right: 3px;
801-
border-top-width: 0;
802-
border-bottom-color: #ebeef5;
803-
border-width: 6px;
804-
filter: drop-shadow(0 2px 12px rgba(0,0,0,.03));
805-
}
806-
.uni-date-popper__arrow:after {
807-
content: " ";
808-
position: absolute;
809-
display: block;
810-
width: 0;
811-
height: 0;
812-
border-color: transparent;
813-
border-style: solid;
794+
}
795+
796+
/* .uni-date-popper__arrow {
797+
width: 10px;
798+
height: 10px;
799+
top: -6px;
800+
left: 35px;
801+
margin-right: 3px;
802+
border-top-width: 0;
803+
border-bottom-color: #ebeef5;
804+
border-width: 6px;
805+
filter: drop-shadow(0 2px 12px rgba(0,0,0,.03));
806+
}
807+
.uni-date-popper__arrow:after {
808+
content: " ";
809+
position: absolute;
810+
display: block;
811+
width: 0;
812+
height: 0;
813+
border-color: transparent;
814+
border-style: solid;
814815
} */
815816
816817
.mr-50 {
817818
margin-right: 50px;
818-
}
819+
}
819820
820-
</style>
821+
</style>

uni_modules/uni-datetime-picker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "uni-datetime-picker",
33
"displayName": "uni-datetime-picker 日期选择器",
4-
"version": "2.0.5",
4+
"version": "2.0.6",
55
"description": "uni-datetime-picker 日期时间选择器,支持日历,支持范围选择",
66
"keywords": [
77
"uni-datetime-picker",

0 commit comments

Comments
 (0)