Skip to content

Commit 3a9221a

Browse files
committed
Merge branch 'yiruiwen' into dev
# Conflicts: # uview-ui/components/u-section/u-section.vue # uview-ui/components/u-tabbar/u-tabbar.vue
2 parents 91bf0ec + f48fd37 commit 3a9221a

File tree

51 files changed

+727
-14529
lines changed

Some content is hidden

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

51 files changed

+727
-14529
lines changed

common/locales/en.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default {
2+
// 可以以页面为单位来写,比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分
3+
components: {
4+
desc: 'Numerous components cover the various requirements of the development process, and the components are rich in functions and compatible with multiple terminals. Let you integrate quickly, out of the box'
5+
},
6+
js: {
7+
desc: 'Numerous intimate gadgets are a weapon that you can call upon during the development process, allowing you to dart in your hand and pierce the Yang with a hundred steps'
8+
},
9+
template: {
10+
desc: 'Collection of many commonly used pages and layouts, reducing the repetitive work of developers, allowing you to focus on logic and get twice the result with half the effort'
11+
},
12+
nav: {
13+
components: 'Comonents',
14+
js: 'JS',
15+
template: 'Template'
16+
},
17+
common: {
18+
intro: 'UI framework for rapid development of multiple platforms',
19+
title: 'uView UI',
20+
},
21+
}

common/locales/zh.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export default {
2+
// 可以以页面为单位来写,比如首页的内容,写在index字段,个人中心写在center,共同部分写在common部分
3+
components: {
4+
desc: '众多组件覆盖开发过程的各个需求,组件功能丰富,多端兼容。让你快速集成,开箱即用'
5+
},
6+
js: {
7+
desc: '众多的贴心小工具,是你开发过程中召之即来的利器,让你飞镖在手,百步穿杨'
8+
},
9+
template: {
10+
desc: '收集众多的常用页面和布局,减少开发者的重复工作,让你专注逻辑,事半功倍'
11+
},
12+
nav: {
13+
components: '组件',
14+
js: '工具',
15+
template: '模板'
16+
},
17+
common: {
18+
intro: '多平台快速开发的UI框架',
19+
title: 'uView UI',
20+
},
21+
}

components/page-nav/page-nav.vue

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,57 @@
44
<image class="logo" src="https://cdn.uviewui.com/uview/common/logo.png" mode="widthFix"></image>
55
<view class="nav-info">
66
<view class="nav-title__text">
7-
uView UI
7+
{{$t('common.title')}}
88
</view>
99
<view class="nav-slogan">
10-
多平台快速开发的UI框架
10+
{{$t('common.intro')}}
1111
</view>
1212
</view>
1313
</view>
1414
<view class="nav-desc">
1515
{{desc}}
1616
</view>
17+
<view class="lang" @tap="switchLang">
18+
<u-icon size="46" color="warning" :name="lang"></u-icon>
19+
</view>
1720
</view>
1821
</template>
1922

2023
<script>
2124
export default {
2225
props: {
23-
desc: String
26+
desc: String,
27+
title: String,
28+
},
29+
computed: {
30+
lang() {
31+
return this.$i18n.locale == 'zh' ? 'zh' : 'en';
32+
}
33+
},
34+
methods: {
35+
switchLang() {
36+
this.$i18n.locale = this.$i18n.locale == 'en' ? 'zh' : 'en';
37+
this.vuex_tabbar[0].text = this.$t('nav.components')
38+
this.vuex_tabbar[1].text = this.$t('nav.js')
39+
this.vuex_tabbar[2].text = this.$t('nav.template')
40+
uni.setNavigationBarTitle({
41+
title: this.$t(this.title)
42+
});
43+
}
2444
}
2545
}
2646
</script>
2747

2848
<style lang="scss" scoped>
2949
.nav-wrap {
3050
padding: 30rpx;
51+
position: relative;
52+
}
53+
54+
.lang {
55+
position: absolute;
56+
top: 30rpx;
57+
right: 30rpx;
3158
}
3259
3360
.nav-title {
@@ -48,6 +75,7 @@
4875
4976
.logo {
5077
width: 140rpx;
78+
flex: 0 0 140rpx;
5179
height: auto;
5280
}
5381

main.js

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,34 @@ Vue.mixin(vuexStore)
2929
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
3030
Vue.mixin(mpShare)
3131

32+
// i18n部分的配置
33+
// 引入语言包,注意路径
34+
import Chinese from '@/common/locales/zh.js';
35+
import English from '@/common/locales/en.js';
36+
37+
// VueI18n
38+
import VueI18n from 'vue-i18n'
39+
40+
// VueI18n
41+
Vue.use(VueI18n)
42+
43+
const i18n = new VueI18n({
44+
// 默认语言
45+
locale: 'zh',
46+
// 引入语言文件
47+
messages: {
48+
'zh': Chinese,
49+
'en': English,
50+
}
51+
})
52+
53+
// 由于微信小程序的运行机制问题,需声明如下一行,H5和APP非必填
54+
Vue.prototype._i18n = i18n
55+
3256
const app = new Vue({
33-
store,
34-
...App
57+
i18n,
58+
store,
59+
...App
3560
})
3661

3762
// http拦截器,将此部分放在new Vue()和app.$mount()之间,才能App.vue中正常使用
@@ -43,4 +68,3 @@ import httpApi from '@/common/http.api.js'
4368
Vue.use(httpApi, app)
4469

4570
app.$mount()
46-

manifest.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name" : "uView",
33
"appid" : "__UNI__60F4B81",
44
"description" : "多平台快速开发的UI框架",
5-
"versionName" : "1.5.8",
5+
"versionName" : "1.6.0",
66
"versionCode" : "100",
77
"transformPx" : false,
88
"app-plus" : {
@@ -109,6 +109,12 @@
109109
"usingComponents" : true,
110110
"component2" : true
111111
},
112+
"mp-qq" : {
113+
"optimization" : {
114+
"subPackages" : true
115+
},
116+
"appid" : "15646153"
117+
},
112118
"mp-baidu" : {
113119
"usingComponents" : true,
114120
"appid" : "17597421"

package-lock.json

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "uView",
3+
"version": "1.0.0",
4+
"description": "<p align=\"center\">\r <img alt=\"logo\" src=\"https://uviewui.com/common/logo.png\" width=\"120\" height=\"120\" style=\"margin-bottom: 10px;\">\r </p>\r <h3 align=\"center\" style=\"margin: 30px 0 30px;font-weight: bold;font-size:40px;\">uView</h3>\r <h3 align=\"center\">多平台快速开发的UI框架</h3>",
5+
"main": "main.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/YanxinNet/uView.git"
12+
},
13+
"keywords": [],
14+
"author": "",
15+
"license": "ISC",
16+
"bugs": {
17+
"url": "https://github.com/YanxinNet/uView/issues"
18+
},
19+
"homepage": "https://github.com/YanxinNet/uView#readme",
20+
"dependencies": {
21+
"vue-i18n": "^8.20.0"
22+
}
23+
}

pages.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// "current": 0, //当前激活的模式(list 的索引项)
77
// "list": [{
88
// "name": "test", //模式名称
9-
// "path": "pages/componentsC/test/index", //启动页面,必选
9+
// "path": "pages/componentsC/layout/index", //启动页面,必选
1010
// "query": "id=1&name=2" //启动参数,在页面的onLoad函数里面得到
1111
// }]
1212
// },
@@ -61,9 +61,9 @@
6161
{
6262
"path": "test/index",
6363
"style": {
64-
// "navigationBarTitleText": "navbar-自定义导航栏",
65-
"navigationStyle": "custom" ,// 隐藏系统导航栏
66-
"navigationBarTextStyle": "white" // 状态栏字体为白色
64+
"navigationBarTitleText": "navbar-自定义导航栏"
65+
// "navigationStyle": "custom" ,// 隐藏系统导航栏
66+
// "navigationBarTextStyle": "white" // 状态栏字体为白色
6767
}
6868
},
6969
// gap-间隔槽
@@ -835,22 +835,22 @@
835835
"backgroundColor": "#FFFFFF",
836836
"borderStyle": "black",
837837
"list": [{
838-
"pagePath": "pages/example/components"
838+
"pagePath": "pages/example/components",
839839
// "iconPath": "static/uview/example/component.png",
840840
// "selectedIconPath": "static/uview/example/component_select.png",
841-
// "text": "组件"
841+
"text": "组件"
842842
},
843843
{
844-
"pagePath": "pages/example/js"
844+
"pagePath": "pages/example/js",
845845
// "iconPath": "static/uview/example/js.png",
846846
// "selectedIconPath": "static/uview/example/js_select.png",
847-
// "text": "工具"
847+
"text": "工具"
848848
},
849849
{
850-
"pagePath": "pages/example/template"
850+
"pagePath": "pages/example/template",
851851
// "iconPath": "static/uview/example/template.png",
852852
// "selectedIconPath": "static/uview/example/template_select.png",
853-
// "text": "模板"
853+
"text": "模板"
854854
}
855855
]
856856
}

pages/componentsB/image/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<view class="u-demo-wrap">
44
<view class="u-demo-title">演示效果</view>
55
<view class="u-demo-area u-flex u-row-center">
6-
<u-image border-radius="100%" :shape="shape" ref="uImage" :width="width" :height="height" :src="src" mode="aspectFill">
6+
<u-image :shape="shape" ref="uImage" :width="width" :height="height" :src="src" mode="aspectFill">
77
<u-loading size="44" mode="flower" slot="loading" v-if="loadingSlot"></u-loading>
88
<view v-if="errorSlot" slot="error" style="font-size: 24rpx;">加载失败</view>
99
</u-image>

pages/componentsB/rate/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
},
7474
methods: {
7575
currentChange(index) {
76-
this.current = index == 0 ? 1 : index == 1 ? 2 : index == 2 ? 3 : 4;
76+
this.value = index == 0 ? 1 : index == 1 ? 2 : index == 2 ? 3 : 4;
7777
},
7878
plainChange(index) {
7979
this.plain = !index;

0 commit comments

Comments
 (0)