Skip to content

Commit 540603a

Browse files
author
zhangguohua
committed
update: subnvue 兼容 uni-app 编译模式,全局样式条件编译
1 parent 05793f3 commit 540603a

6 files changed

Lines changed: 57 additions & 44 deletions

File tree

‎App.vue‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
}
4242
</script>
4343

44-
<style>
44+
<style>
45+
/* #ifndef APP-PLUS-NVUE */
4546
/* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
4647
@import './common/uni.css';
4748
@@ -76,5 +77,6 @@
7677
margin-top: 10px;
7778
font-size: 38upx;
7879
color: #808080;
79-
}
80+
}
81+
/* #endif*/
8082
</style>

‎pages.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@
816816
"style": {
817817
"margin": "auto",
818818
"width": "80%",
819-
"height": "300px"
819+
"height": "600upx"
820820
}
821821
}, {
822822
"id": "video_mask",

‎pages/API/subnvue/subnvue/drawer.nvue‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<template>
22
<div class="wrapper">
3-
<text style="color: #8f8f94; margin-bottom: 40px;">左侧列表</text>
4-
<list style="height: 450px;">
3+
<text style="color: #8f8f94; margin-bottom: 40upx;">左侧列表</text>
4+
<list style="height: 450upx;">
55
<cell v-for="item in lists" :key="item.id">
66
<div class="text-wrapper" @click="clickitem(item.id)">
7-
<text style="font-size: 30px; ">{{item.name}}</text>
7+
<text style="font-size: 30upx; ">{{item.name}}</text>
88
<text class="icon">&#xe583;</text>
99
</div>
1010
</cell>
1111
</list>
1212
<div style="flex: 1; text-align: center;">
1313
<div class="close-drawer" @click="hideDrawer">
14-
<text style="font-size: 34px; text-align: center;">关闭抽屉</text>
14+
<text style="font-size: 34upx; text-align: center;">关闭抽屉</text>
1515
</div>
1616
</div>
1717
</div>
@@ -54,32 +54,32 @@
5454
.wrapper {
5555
flex-direction: column;
5656
text-align: center;
57-
padding: 60px 0px 0px 20px;
57+
padding: 60upx 0upx 0upx 20upx;
5858
background-color: #F4F5F6;
5959
}
6060
.text-wrapper {
6161
justify-content: center;
6262
border-bottom-style: solid;
63-
border-bottom-width: 1px;
63+
border-bottom-width: 1upx;
6464
border-bottom-color: rgba(0,0,0,.2);
65-
margin-bottom: 35px;
66-
padding-bottom: 15px;
65+
margin-bottom: 35upx;
66+
padding-bottom: 15upx;
6767
}
6868
.close-drawer {
6969
background-color: #f8f8f8;
70-
width: 300px;
71-
padding: 15px;
72-
border-radius: 20px;
70+
width: 300upx;
71+
padding: 15upx;
72+
border-radius: 20upx;
7373
border-style: solid;
74-
border-width: 1px;
74+
border-width: 1upx;
7575
border-color: rgba(0,0,0,.2);
7676
}
7777
.icon {
7878
position: absolute;
79-
right: 10px;
79+
right: 10upx;
8080
color: #000000;
8181
font-family: unibtn;
82-
font-size: 30px;
82+
font-size: 30upx;
8383
font-weight: 400;
8484
}
8585
</style>

‎pages/API/subnvue/subnvue/nav.nvue‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="status-bar"></div>
44
<div class="nav" @click="back">
55
<text class="back">&#xe582;</text>
6-
<text style="font-size: 32px;">nvue 渐变色标题栏</text>
6+
<text class="title">nvue 渐变色标题栏</text>
77
</div>
88
</div>
99
</template>
@@ -43,11 +43,14 @@
4343
justify-content: center;
4444
align-items: center;
4545
}
46+
.title {
47+
font-size: 36upx;
48+
}
4649
.back {
4750
position: absolute;
4851
left: 3px;
4952
color: #000000;
5053
font-family: unibtn;
51-
font-size: 54px;
54+
font-size: 54upx;
5255
}
5356
</style>

‎pages/API/subnvue/subnvue/popup.nvue‎

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<text class="content">{{content}}</text>
77
</div>
88
<div>
9-
<text style="color: red; font-size: 30px;">以下为 Popup 内部滚动示例:</text>
9+
<text style="color: red; font-size: 30upx;">以下为 Popup 内部滚动示例:</text>
1010
</div>
1111
<div class="cell" v-for="(item, index) in lists" @click="handle(item)" :key="index">
1212
<text class="text">{{item}}</text>
@@ -29,7 +29,7 @@
2929
},
3030
created() {
3131
const vm = this;
32-
for(let i = 1; i < 20; i++){
32+
for (let i = 1; i < 20; i++) {
3333
this.lists.push('item' + i);
3434
}
3535
uni.$on('page-popup', (data) => {
@@ -62,51 +62,59 @@
6262
.wrapper {
6363
flex-direction: column;
6464
justify-content: space-between;
65-
padding: 10px 15px;
65+
padding: 10upx 15upx;
6666
background-color: #F4F5F6;
67-
border-radius: 4px;
67+
border-radius: 4upx;
6868
}
69+
6970
.title {
70-
height: 100px;
71-
line-height: 100px;
71+
height: 100upx;
72+
line-height: 100upx;
7273
border-bottom-style: solid;
73-
border-bottom-width: 1px;
74+
border-bottom-width: 1upx;
7475
border-bottom-color: #CBCBCB;
7576
flex: 0;
76-
font-size: 30px;
77+
font-size: 30upx;
7778
}
79+
7880
.scroller {
79-
flex: 1;
80-
padding: 8px 15px;
81+
height: 400upx;
82+
padding: 8upx 15upx;
8183
}
84+
8285
.content {
8386
color: #555555;
84-
font-size: 32px;
87+
font-size: 32upx;
8588
}
89+
8690
.message-wrapper {
91+
flex: 0;
8792
border-top-style: solid;
88-
border-top-width: 1px;
93+
border-top-width: 1upx;
8994
border-top-color: #CBCBCB;
90-
height: 80px;
95+
height: 80upx;
9196
align-items: flex-end;
9297
}
98+
9399
.send-message {
94-
font-size: 30px;
95-
line-height: 80px;
100+
font-size: 30upx;
101+
line-height: 80upx;
96102
color: #00CE47;
97-
margin-left: 20px;
103+
margin-left: 20upx;
98104
}
105+
99106
.cell {
100-
margin: 10px;
101-
padding: 20px 0;
102-
top:10px;
107+
margin: 10upx;
108+
padding: 20upx 0;
109+
top: 10upx;
103110
align-items: center;
104111
justify-content: center;
105-
border-radius: 10px;
112+
border-radius: 10upx;
106113
background-color: #5989B9;
107114
}
115+
108116
.text {
109-
font-size: 30px;
117+
font-size: 30upx;
110118
text-align: center;
111119
color: white;
112120
}

‎pages/API/subnvue/subnvue/video-mask.nvue‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,19 @@
9696
background-color: rgba(0, 0, 0, 0.7);
9797
}
9898
.cell {
99-
padding: 10px 0;
99+
padding: 10upx 0;
100100
flex-direction: row;
101101
flex-wrap: nowrap;
102102
}
103103
.name {
104104
flex: 0;
105-
font-size: 20px;
106-
margin-right: 20px;
105+
font-size: 20upx;
106+
margin-right: 20upx;
107107
color: #FF5A5F;
108108
}
109109
.content {
110110
flex: 1;
111-
font-size: 20px;
111+
font-size: 20upx;
112112
color: #F4F5F6;
113113
}
114114
</style>

0 commit comments

Comments
 (0)