bulade-ui 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/miniprogram_dist/bld-cloud-image/index.js +179 -0
- package/miniprogram_dist/bld-cloud-image/index.js.map +1 -0
- package/miniprogram_dist/bld-cloud-image/index.json +3 -0
- package/miniprogram_dist/bld-cloud-image/index.wxml +14 -0
- package/miniprogram_dist/bld-cloud-image/index.wxss +3 -0
- package/miniprogram_dist/bld-drawer/index.js +2 -2
- package/miniprogram_dist/bld-drawer/index.js.map +1 -1
- package/miniprogram_dist/bld-message/index.js +2 -2
- package/miniprogram_dist/bld-message/index.js.map +1 -1
- package/miniprogram_dist/bld-message/message.js +2 -2
- package/miniprogram_dist/bld-message/message.js.map +1 -1
- package/miniprogram_dist/bld-nav-bar/index.js +30 -3
- package/miniprogram_dist/bld-nav-bar/index.js.map +1 -1
- package/miniprogram_dist/bld-nav-bar/index.wxml +6 -1
- package/miniprogram_dist/bld-nav-bar/index.wxss +1 -1
- package/miniprogram_dist/bld-toast/index.js +2 -2
- package/miniprogram_dist/bld-toast/index.js.map +1 -1
- package/miniprogram_dist/bld-toast/toast.js +2 -2
- package/miniprogram_dist/bld-toast/toast.js.map +1 -1
- package/miniprogram_dist/cell/index.js +2 -2
- package/miniprogram_dist/cell/index.js.map +1 -1
- package/miniprogram_dist/cell-group/index.js +2 -2
- package/miniprogram_dist/cell-group/index.js.map +1 -1
- package/miniprogram_dist/grid/index.js +2 -2
- package/miniprogram_dist/grid/index.js.map +1 -1
- package/miniprogram_dist/grid-item/index.js +2 -2
- package/miniprogram_dist/grid-item/index.js.map +1 -1
- package/miniprogram_dist/icon/index.js +2 -2
- package/miniprogram_dist/icon/index.js.map +1 -1
- package/miniprogram_dist/timeline/index.js +2 -2
- package/miniprogram_dist/timeline/index.js.map +1 -1
- package/miniprogram_dist/timeline-item/index.js +2 -2
- package/miniprogram_dist/timeline-item/index.js.map +1 -1
- package/package.json +1 -1
- package/src/bld-cloud-image/index.js +79 -0
- package/src/bld-cloud-image/index.json +3 -0
- package/src/bld-cloud-image/index.scss +3 -0
- package/src/bld-cloud-image/index.wxml +14 -0
- package/src/bld-cloud-image/index.wxss +3 -0
- package/src/bld-nav-bar/index.js +30 -2
- package/src/bld-nav-bar/index.scss +2 -2
- package/src/bld-nav-bar/index.wxml +6 -1
- package/src/bld-nav-bar/index.wxss +1 -1
- package/src/bld-nav-bar1/index.js +90 -0
- package/src/bld-nav-bar1/index.json +6 -0
- package/src/bld-nav-bar1/index.scss +40 -0
- package/src/bld-nav-bar1/index.wxml +24 -0
- package/src/bld-nav-bar1/index.wxss +36 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
const app = getApp();
|
|
2
|
+
|
|
3
|
+
const deviceInfo = app.globalData.deviceInfo;
|
|
4
|
+
const systemInfo = app.globalData.systemInfo;
|
|
5
|
+
const menuButtonInfo = app.globalData.menuButtonDistance;
|
|
6
|
+
|
|
7
|
+
const screenWidth = systemInfo.screenWidth;
|
|
8
|
+
|
|
9
|
+
const statusBarHeight = systemInfo.statusBarHeight;
|
|
10
|
+
const gap = menuButtonInfo.top - statusBarHeight;
|
|
11
|
+
const padding = screenWidth - menuButtonInfo.right;
|
|
12
|
+
|
|
13
|
+
const _baseStyle = [
|
|
14
|
+
`padding-top: ${menuButtonInfo.top}px`,
|
|
15
|
+
`padding-bottom: ${gap}px`,
|
|
16
|
+
`line-height: ${menuButtonInfo.height}px`,
|
|
17
|
+
`height: ${menuButtonInfo.height}px`,
|
|
18
|
+
`padding-left: ${padding}px`,
|
|
19
|
+
`padding-right: ${padding * 2 + menuButtonInfo.width}px`,
|
|
20
|
+
`width: calc(100% - ${3 * padding + menuButtonInfo.width}px)`,
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
Component({
|
|
24
|
+
externalClasses: ["iclass"],
|
|
25
|
+
options: {
|
|
26
|
+
multipleSlots: true, // 在组件定义时的选项中启用多slot支持
|
|
27
|
+
},
|
|
28
|
+
properties: {
|
|
29
|
+
bgColor: {
|
|
30
|
+
type: String,
|
|
31
|
+
},
|
|
32
|
+
goBack: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
value: false,
|
|
35
|
+
},
|
|
36
|
+
showTitle: {
|
|
37
|
+
type: Boolean,
|
|
38
|
+
value: true,
|
|
39
|
+
},
|
|
40
|
+
showShare: {
|
|
41
|
+
type: Boolean,
|
|
42
|
+
value: false,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
data: {
|
|
46
|
+
style: _baseStyle.join(";"),
|
|
47
|
+
},
|
|
48
|
+
lifetimes: {
|
|
49
|
+
ready() {
|
|
50
|
+
const totalHeight = menuButtonInfo.top + menuButtonInfo.height + gap;
|
|
51
|
+
|
|
52
|
+
this.triggerEvent("height-change", totalHeight);
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
observers: {
|
|
56
|
+
bgColor: function (bgColor) {
|
|
57
|
+
if (bgColor) {
|
|
58
|
+
const _style = [..._baseStyle];
|
|
59
|
+
|
|
60
|
+
_style.push(`background-color: ${bgColor}`);
|
|
61
|
+
this.setData({
|
|
62
|
+
style: _style.join(";"),
|
|
63
|
+
});
|
|
64
|
+
} else {
|
|
65
|
+
this.setData({
|
|
66
|
+
style: _baseStyle.join(";"),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
methods: {
|
|
72
|
+
navigateHome() {
|
|
73
|
+
wx.switchTab({
|
|
74
|
+
url: "/pages/main/index",
|
|
75
|
+
});
|
|
76
|
+
},
|
|
77
|
+
|
|
78
|
+
navigateBack() {
|
|
79
|
+
const pages = getCurrentPages();
|
|
80
|
+
|
|
81
|
+
if (pages.length > 1) {
|
|
82
|
+
wx.navigateBack();
|
|
83
|
+
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
this.navigateHome();
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
});
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
.nav-bar {
|
|
2
|
+
font-size: var(--font-size-lg);
|
|
3
|
+
font-weight: 500;
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: flex-start;
|
|
6
|
+
align-items: center;
|
|
7
|
+
position: fixed;
|
|
8
|
+
left: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
z-index: 1000;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.title {
|
|
14
|
+
flex: 1;
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: flex-start;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.operation {
|
|
21
|
+
background: rgba(255, 255, 255, 0.6);
|
|
22
|
+
border: 1rpx solid rgba(0, 0, 0, 0.1);
|
|
23
|
+
border-radius: 32rpx;
|
|
24
|
+
width: 60rpx;
|
|
25
|
+
height: 60rpx;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
margin-right: 12rpx;
|
|
30
|
+
padding: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.operations {
|
|
34
|
+
&.right {
|
|
35
|
+
.operation {
|
|
36
|
+
margin-right: 0;
|
|
37
|
+
margin-left: 12rpx;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<view
|
|
2
|
+
class="iclass nav-bar"
|
|
3
|
+
style="{{ style }}"
|
|
4
|
+
>
|
|
5
|
+
<view class="operations">
|
|
6
|
+
<view
|
|
7
|
+
wx:if="{{ goBack }}"
|
|
8
|
+
class="operation"
|
|
9
|
+
bind:tap="navigateBack"
|
|
10
|
+
>
|
|
11
|
+
<bld-icon name="backward" />
|
|
12
|
+
</view>
|
|
13
|
+
</view>
|
|
14
|
+
<view class="title"> <slot wx:if="{{ showTitle }}" /> </view>
|
|
15
|
+
<view class="operations right">
|
|
16
|
+
<button
|
|
17
|
+
wx:if="{{ showShare }}"
|
|
18
|
+
class="operation"
|
|
19
|
+
open-type="share"
|
|
20
|
+
>
|
|
21
|
+
<bld-icon name="share" />
|
|
22
|
+
</button>
|
|
23
|
+
</view>
|
|
24
|
+
</view>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.nav-bar {
|
|
2
|
+
font-size: var(--font-size-lg);
|
|
3
|
+
font-weight: 500;
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: flex-start;
|
|
6
|
+
align-items: center;
|
|
7
|
+
position: fixed;
|
|
8
|
+
left: 0;
|
|
9
|
+
top: 0;
|
|
10
|
+
z-index: 1000;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.title {
|
|
14
|
+
flex: 1;
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: flex-start;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.operation {
|
|
21
|
+
background: rgba(255, 255, 255, 0.6);
|
|
22
|
+
border: 1rpx solid rgba(0, 0, 0, 0.1);
|
|
23
|
+
border-radius: 32rpx;
|
|
24
|
+
width: 60rpx;
|
|
25
|
+
height: 60rpx;
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
justify-content: center;
|
|
29
|
+
margin-right: 12rpx;
|
|
30
|
+
padding: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.operations.right .operation {
|
|
34
|
+
margin-right: 0;
|
|
35
|
+
margin-left: 12rpx;
|
|
36
|
+
}
|