Skip to content

Commit 495a3d6

Browse files
committed
upade : 修改蓝牙示例样式
1 parent bb56872 commit 495a3d6

File tree

1 file changed

+28
-36
lines changed

1 file changed

+28
-36
lines changed

pages/API/bluetooth/bluetooth.vue

Lines changed: 28 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -53,17 +53,17 @@
5353
获取服务的特征值
5454
</button>
5555
<view v-if="characteristicsData.length > 0">
56-
<view class="list-name">uuid:{{ characteristicsData[0].uuid }}</view>
57-
<view class="list-item">
56+
<view class="uni-list_name">uuid:{{ characteristicsData[0].uuid }}</view>
57+
<view class="uni-list_item">
5858
是否支持 read 操作:{{ characteristicsData[0].properties.read }}
5959
</view>
60-
<view class="list-item">
60+
<view class="uni-list_item">
6161
是否支持 write 操作:{{ characteristicsData[0].properties.write }}
6262
</view>
63-
<view class="list-item">
63+
<view class="uni-list_item">
6464
是否支持 notify 操作:{{ characteristicsData[0].properties.notify }}
6565
</view>
66-
<view class="list-item">
66+
<view class="uni-list_item">
6767
是否支持 indicate 操作:{{ characteristicsData[0].properties.indicate }}
6868
</view>
6969
</view>
@@ -86,42 +86,42 @@
8686
</view>
8787
<!-- 遮罩 -->
8888
<view v-if="maskShow" class="uni-mask" @touchmove.stop.prevent="moveHandle" @click="maskclose">
89-
<scroll-view class="uni-scroll-box" scroll-y @touchmove.stop.prevent="moveHandle" @click.stop="moveHandle">
89+
<scroll-view class="uni-scroll_box" scroll-y @touchmove.stop.prevent="moveHandle" @click.stop="moveHandle">
9090
<view class="uni-title">
9191
已经发现{{ list.length }}{{ showMaskType === 'device' ? '台设备' : '个服务' }}:
9292
</view>
9393
<view
94-
class="list"
94+
class="uni-list-box"
9595
v-for="(item, index) in list"
9696
:key="index"
9797
@click="tapQuery(item)"
9898
>
9999
<view v-if="showMaskType === 'device'">
100-
<view class="list-name">{{ item.name || item.localName }}</view>
101-
<view class="list-item">信号强度:{{ item.RSSI }}dBm</view>
102-
<view class="list-item">UUID:{{ item.deviceId }}</view>
100+
<view class="uni-list_name">{{ item.name || item.localName }}</view>
101+
<view class="uni-list_item">信号强度:{{ item.RSSI }}dBm</view>
102+
<view class="uni-list_item">UUID:{{ item.deviceId }}</view>
103103
<!-- <view class="list-item" v-if="showMaskType === 'device'">
104104
Service数量:{{ item.advertisServiceUUIDs.length }}
105105
</view> -->
106106
</view>
107107
<view v-if="showMaskType === 'service'">
108-
<view class="list-item" style="line-height:2.2;">
108+
<view class="uni-list_item" style="line-height:2.2;">
109109
UUID: {{ item.uuid }}
110110
<text v-if="showMaskType === 'service'">
111111
{{ item.isPrimary ? '(主服务)' : '' }}
112112
</text>
113113
</view>
114114
</view>
115115
<view v-if="showMaskType === 'characteristics'">
116-
<view class="list-name">uuid:{{ item.uuid }}</view>
117-
<view class="list-item">是否支持 read 操作:{{ item.properties.read }}</view>
118-
<view class="list-item">
116+
<view class="uni-list_name">uuid:{{ item.uuid }}</view>
117+
<view class="uni-list_item">是否支持 read 操作:{{ item.properties.read }}</view>
118+
<view class="uni-list_item">
119119
是否支持 write 操作:{{ item.properties.write }}
120120
</view>
121-
<view class="list-item">
121+
<view class="uni-list_item">
122122
是否支持 notify 操作:{{ item.properties.notify }}
123123
</view>
124-
<view class="list-item">
124+
<view class="uni-list_item">
125125
是否支持 indicate 操作:{{ item.properties.indicate }}
126126
</view>
127127
</view>
@@ -630,15 +630,7 @@ function toast(content, showCancel = false) {
630630
</script>
631631

632632
<style>
633-
.text-box {
634-
margin-bottom: 40upx;
635-
display: flex;
636-
flex-direction: column;
637-
min-height: 300upx;
638-
background-color: #ffffff;
639-
font-size: 30upx;
640-
color: #353535;
641-
}
633+
642634
.uni-title {
643635
/* width: 100%; */
644636
/* height: 80upx; */
@@ -658,31 +650,31 @@ function toast(content, showCancel = false) {
658650
box-sizing: border-box;
659651
}
660652
661-
.uni-scroll-box {
653+
.uni-scroll_box {
662654
height: 70%;
663655
background: #fff;
664656
border-radius: 20upx;
665657
}
666-
.list {
658+
.uni-list-box {
667659
margin: 0 20upx;
668660
padding: 15upx 0;
669661
border-bottom: 1px #f5f5f5 solid;
670662
box-sizing: border-box;
671663
}
672-
.list:last-child {
664+
.uni-list:last-child {
673665
border: none;
674666
}
675-
.list-name {
667+
.uni-list_name {
676668
font-size: 30upx;
677669
color: #333;
678670
}
679-
.list-item {
671+
.uni-list_item {
680672
font-size: 24upx;
681673
color: #555;
682674
line-height: 1.5;
683675
}
684676
685-
.success-box {
677+
.uni-success_box {
686678
position: absolute;
687679
left: 0;
688680
bottom: 0;
@@ -692,34 +684,34 @@ function toast(content, showCancel = false) {
692684
box-sizing: border-box;
693685
border-top: 1px #eee solid;
694686
}
695-
.success-sub {
687+
.uni-success_sub {
696688
/* width: 100%%; */
697689
height: 100upx;
698690
display: flex;
699691
justify-content: space-between;
700692
align-items: center;
701693
padding: 0 30upx;
702694
}
703-
.close-button {
695+
.uni-close_button {
704696
padding: 0 20upx;
705697
height: 60upx;
706698
line-height: 60upx;
707699
background: #ce3c39;
708700
color: #ffffff;
709701
border-radius: 10upx;
710702
}
711-
.success-content {
703+
.uni-success_content {
712704
height: 600upx;
713705
margin: 30upx;
714706
margin-top: 0;
715707
border: 1px #eee solid;
716708
padding: 30upx;
717709
}
718-
.content-list {
710+
.uni-content_list {
719711
padding-bottom: 10upx;
720712
border-bottom: 1px #f5f5f5 solid;
721713
}
722-
.tips {
714+
.uni-tips {
723715
text-align: center;
724716
font-size: 24upx;
725717
color: #666;

0 commit comments

Comments
 (0)