Skip to content

Commit 6ca402c

Browse files
committed
update: sync [email protected], fix compile bug
1 parent 1e9f2c4 commit 6ca402c

File tree

116 files changed

+1901
-714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

116 files changed

+1901
-714
lines changed

components/uni-calendar/i18n/en.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"uni-calender.ok": "ok",
3+
"uni-calender.cancel": "cancel",
4+
"uni-calender.today": "today",
5+
"uni-calender.MON": "MON",
6+
"uni-calender.TUE": "TUE",
7+
"uni-calender.WED": "WED",
8+
"uni-calender.THU": "THU",
9+
"uni-calender.FRI": "FRI",
10+
"uni-calender.SAT": "SAT",
11+
"uni-calender.SUN": "SUN"
12+
}

components/uni-calendar/i18n/index.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import en from './en.json'
2+
import zhHans from './zh-Hans.json'
3+
import zhHant from './zh-Hant.json'
4+
export default {
5+
en,
6+
'zh-Hans': zhHans,
7+
'zh-Hant': zhHant
8+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"uni-calender.ok": "确定",
3+
"uni-calender.cancel": "取消",
4+
"uni-calender.today": "今日",
5+
"uni-calender.SUN": "",
6+
"uni-calender.MON": "",
7+
"uni-calender.TUE": "",
8+
"uni-calender.WED": "",
9+
"uni-calender.THU": "",
10+
"uni-calender.FRI": "",
11+
"uni-calender.SAT": ""
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"uni-calender.ok": "確定",
3+
"uni-calender.cancel": "取消",
4+
"uni-calender.today": "今日",
5+
"uni-calender.SUN": "",
6+
"uni-calender.MON": "",
7+
"uni-calender.TUE": "",
8+
"uni-calender.WED": "",
9+
"uni-calender.THU": "",
10+
"uni-calender.FRI": "",
11+
"uni-calender.SAT": ""
12+
}

components/uni-calendar/uni-calendar-item.vue

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
'uni-calendar-item--before-checked':weeks.beforeMultiple,
2626
'uni-calendar-item--multiple': weeks.multiple,
2727
'uni-calendar-item--after-checked':weeks.afterMultiple,
28-
}">今天</text>
28+
}">{{todayText}}</text>
2929
<text v-if="lunar&&!weeks.extraInfo" class="uni-calendar-item__weeks-lunar-text" :class="{
3030
'uni-calendar-item--isDay-text':weeks.isDay,
3131
'uni-calendar-item--isDay':calendar.fullDate === weeks.fullDate && weeks.isDay,
@@ -34,7 +34,7 @@
3434
'uni-calendar-item--multiple': weeks.multiple,
3535
'uni-calendar-item--after-checked':weeks.afterMultiple,
3636
'uni-calendar-item--disable':weeks.disable,
37-
}">{{weeks.isDay?'今天': (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text>
37+
}">{{weeks.isDay ? todayText : (weeks.lunar.IDayCn === '初一'?weeks.lunar.IMonthCn:weeks.lunar.IDayCn)}}</text>
3838
<text v-if="weeks.extraInfo&&weeks.extraInfo.info" class="uni-calendar-item__weeks-lunar-text" :class="{
3939
'uni-calendar-item--extra':weeks.extraInfo.info,
4040
'uni-calendar-item--isDay-text':weeks.isDay,
@@ -50,6 +50,13 @@
5050
</template>
5151

5252
<script>
53+
import {
54+
initVueI18n
55+
} from '@dcloudio/uni-i18n'
56+
import messages from './i18n/index.js'
57+
const {
58+
t
59+
} = initVueI18n(messages)
5360
export default {
5461
emits: ['change'],
5562
props: {
@@ -76,6 +83,11 @@
7683
default: false
7784
}
7885
},
86+
computed: {
87+
todayText() {
88+
return t("uni-calender.today")
89+
},
90+
},
7991
methods: {
8092
choiceDate(weeks) {
8193
this.$emit('change', weeks)

components/uni-calendar/uni-calendar.vue

Lines changed: 56 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@
44
<view v-if="insert || show" class="uni-calendar__content" :class="{'uni-calendar--fixed':!insert,'uni-calendar--ani-show':aniMaskShow}">
55
<view v-if="!insert" class="uni-calendar__header uni-calendar--fixed-top">
66
<view class="uni-calendar__header-btn-box" @click="close">
7-
<text class="uni-calendar__header-text uni-calendar--fixed-width">取消</text>
7+
<text class="uni-calendar__header-text uni-calendar--fixed-width">{{cancelText}}</text>
88
</view>
99
<view class="uni-calendar__header-btn-box" @click="confirm">
10-
<text class="uni-calendar__header-text uni-calendar--fixed-width">确定</text>
10+
<text class="uni-calendar__header-text uni-calendar--fixed-width">{{okText}}</text>
1111
</view>
1212
</view>
1313
<view class="uni-calendar__header">
1414
<view class="uni-calendar__header-btn-box" @click.stop="pre">
1515
<view class="uni-calendar__header-btn uni-calendar--left"></view>
1616
</view>
1717
<picker mode="date" :value="date" fields="month" @change="bindDateChange">
18-
<text class="uni-calendar__header-text">{{ (nowDate.year||'') +''+( nowDate.month||'') +'月'}}</text>
18+
<text class="uni-calendar__header-text">{{ (nowDate.year||'') +' / '+( nowDate.month||'')}}</text>
1919
</picker>
2020
<view class="uni-calendar__header-btn-box" @click.stop="next">
2121
<view class="uni-calendar__header-btn uni-calendar--right"></view>
2222
</view>
23-
<text class="uni-calendar__backtoday" @click="backtoday">回到今天</text>
23+
<text class="uni-calendar__backtoday" @click="backtoday">{{todayText}}</text>
2424

2525
</view>
2626
<view class="uni-calendar__box">
@@ -29,25 +29,25 @@
2929
</view>
3030
<view class="uni-calendar__weeks">
3131
<view class="uni-calendar__weeks-day">
32-
<text class="uni-calendar__weeks-day-text"></text>
32+
<text class="uni-calendar__weeks-day-text">{{SUNText}}</text>
3333
</view>
3434
<view class="uni-calendar__weeks-day">
35-
<text class="uni-calendar__weeks-day-text"></text>
35+
<text class="uni-calendar__weeks-day-text">{{monText}}</text>
3636
</view>
3737
<view class="uni-calendar__weeks-day">
38-
<text class="uni-calendar__weeks-day-text"></text>
38+
<text class="uni-calendar__weeks-day-text">{{TUEText}}</text>
3939
</view>
4040
<view class="uni-calendar__weeks-day">
41-
<text class="uni-calendar__weeks-day-text"></text>
41+
<text class="uni-calendar__weeks-day-text">{{WEDText}}</text>
4242
</view>
4343
<view class="uni-calendar__weeks-day">
44-
<text class="uni-calendar__weeks-day-text"></text>
44+
<text class="uni-calendar__weeks-day-text">{{THUText}}</text>
4545
</view>
4646
<view class="uni-calendar__weeks-day">
47-
<text class="uni-calendar__weeks-day-text"></text>
47+
<text class="uni-calendar__weeks-day-text">{{FRIText}}</text>
4848
</view>
4949
<view class="uni-calendar__weeks-day">
50-
<text class="uni-calendar__weeks-day-text"></text>
50+
<text class="uni-calendar__weeks-day-text">{{SATText}}</text>
5151
</view>
5252
</view>
5353
<view class="uni-calendar__weeks" v-for="(item,weekIndex) in weeks" :key="weekIndex">
@@ -63,6 +63,13 @@
6363
<script>
6464
import Calendar from './util.js';
6565
import calendarItem from './uni-calendar-item.vue'
66+
import {
67+
initVueI18n
68+
} from '@dcloudio/uni-i18n'
69+
import messages from './i18n/index.js'
70+
const {
71+
t
72+
} = initVueI18n(messages)
6673
/**
6774
* Calendar 日历
6875
* @description 日历组件可以查看日期,选择任意范围内的日期,打点操作。常用场景如:酒店日期预订、火车机票选择购买日期、上下班打卡等
@@ -137,6 +144,42 @@
137144
aniMaskShow: false
138145
}
139146
},
147+
computed: {
148+
/**
149+
* for i18n
150+
*/
151+
152+
okText() {
153+
return t("uni-calender.ok")
154+
},
155+
cancelText() {
156+
return t("uni-calender.cancel")
157+
},
158+
todayText() {
159+
return t("uni-calender.today")
160+
},
161+
monText() {
162+
return t("uni-calender.MON")
163+
},
164+
TUEText() {
165+
return t("uni-calender.TUE")
166+
},
167+
WEDText() {
168+
return t("uni-calender.WED")
169+
},
170+
THUText() {
171+
return t("uni-calender.THU")
172+
},
173+
FRIText() {
174+
return t("uni-calender.FRI")
175+
},
176+
SATText() {
177+
return t("uni-calender.SAT")
178+
},
179+
SUNText() {
180+
return t("uni-calender.SUN")
181+
},
182+
},
140183
watch: {
141184
date(newVal) {
142185
// this.cale.setDate(newVal)
@@ -343,13 +386,8 @@
343386
}
344387
345388
.uni-calendar--fixed {
346-
position: fixed;
347-
/* #ifndef APP-NVUE */
348-
bottom: calc(var(--window-bottom));
349-
/* #endif */
350-
/* #ifdef APP-NVUE */
351-
bottom: 0;
352-
/* #endif */
389+
position: fixed;
390+
bottom: calc(var(--window-bottom));
353391
left: 0;
354392
right: 0;
355393
transition-property: transform;

components/uni-collapse-item/uni-collapse-item.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</view>
1111
</slot>
1212
</view>
13-
<view :class="{ 'uni-collapse-item__title-arrow-active': isOpen, 'uni-collapse-item--animation': showAnimation === true }" class="uni-collapse-item__title-arrow">
13+
<view v-if="showArrow" :class="{ 'uni-collapse-item__title-arrow-active': isOpen, 'uni-collapse-item--animation': showAnimation === true }" class="uni-collapse-item__title-arrow">
1414
<uni-icons :color="disabled?'#ddd':'#bbb'" size="14" type="arrowdown" />
1515
</view>
1616
</view>
@@ -33,8 +33,12 @@
3333
* @property {String} title 标题文字
3434
* @property {String} thumb 标题左侧缩略图
3535
* @property {String} name 唯一标志符
36+
* @property {Boolean} open = [true|false] 是否展开组件
37+
* @property {Boolean} titleBorder = [true|false] 是否显示标题分隔线
38+
* @property {Boolean} border = [true|false] 是否显示分隔线
3639
* @property {Boolean} disabled = [true|false] 是否展开面板
3740
* @property {Boolean} showAnimation = [true|false] 开启动画
41+
* @property {Boolean} showArrow = [true|false] 是否显示右侧箭头
3842
*/
3943
export default {
4044
name: 'uniCollapseItem',
@@ -82,10 +86,13 @@
8286
type: String,
8387
default: 'auto'
8488
},
85-
// 是否显示分隔线
8689
border: {
8790
type: Boolean,
8891
default: true
92+
},
93+
showArrow: {
94+
type: Boolean,
95+
default: true
8996
}
9097
},
9198
data() {
@@ -128,9 +135,7 @@
128135
this.uninstall()
129136
},
130137
// #endif
131-
132138
mounted() {
133-
134139
if (!this.collapse) return
135140
if (this.name !== '') {
136141
this.nameSync = this.name

components/uni-countdown/i18n/en.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"uni-countdown.day": "day",
3+
"uni-countdown.h": "h",
4+
"uni-countdown.m": "m",
5+
"uni-countdown.s": "s"
6+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import en from './en.json'
2+
import zhHans from './zh-Hans.json'
3+
import zhHant from './zh-Hant.json'
4+
export default {
5+
en,
6+
'zh-Hans': zhHans,
7+
'zh-Hant': zhHant
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"uni-countdown.day": "",
3+
"uni-countdown.h": "",
4+
"uni-countdown.m": "",
5+
"uni-countdown.s": ""
6+
}

0 commit comments

Comments
 (0)