File tree Expand file tree Collapse file tree 4 files changed +29
-12
lines changed Expand file tree Collapse file tree 4 files changed +29
-12
lines changed Original file line number Diff line number Diff line change 1
1
//app.js
2
2
App ( {
3
- onLaunch :function ( ) {
4
-
3
+ onLaunch : function ( ) {
4
+
5
5
} ,
6
6
7
7
globalData : {
8
-
8
+
9
9
}
10
10
} )
Original file line number Diff line number Diff line change 1
1
// pages/about/index.js
2
+ wx . cloud . init ( {
3
+ env : 'env-9eb476'
4
+ } )
5
+ const db = wx . cloud . database ( )
6
+
2
7
Page ( {
3
8
4
9
/**
5
10
* 页面的初始数据
6
11
*/
7
12
data : {
8
-
13
+ version : '....'
9
14
} ,
10
15
11
16
/**
12
17
* 生命周期函数--监听页面加载
13
18
*/
14
19
15
- onLoad : function ( options ) {
16
-
20
+ onLoad : function ( options ) {
21
+ db . collection ( 'version' ) . get ( ) . then ( _ => {
22
+ const {
23
+ data
24
+ } = _
25
+ this . setData ( {
26
+ version : data [ 0 ] . version
27
+ } )
28
+ } )
17
29
} ,
18
30
19
- copyLink ( e ) {
31
+ copyLink ( e ) {
20
32
wx . setClipboardData ( {
21
33
data : e . currentTarget . dataset . link ,
22
34
success : ( ) => {
28
40
} )
29
41
} ,
30
42
31
-
32
-
33
- onImage ( ) {
43
+ onImage ( ) {
34
44
wx . previewImage ( {
35
45
urls : [ 'https://pic1.zhimg.com/80/v2-efda715dcd7e93325b213400b67c1e80_hd.png' ]
36
46
} ) ;
39
49
/**
40
50
* 用户点击右上角分享
41
51
*/
42
- onShareAppMessage : function ( ) {
52
+ onShareAppMessage : function ( ) {
43
53
44
54
}
45
55
} )
Original file line number Diff line number Diff line change 1
- <!--pages/about/index.wxml-->
1
+ <!-- pages/about/index.wxml -->
2
2
<view class='container'>
3
3
<view class='logo-container'>
4
4
<image class='logo-img' src='/images/logo.png'></image>
5
+ <text class='version'>组件库版本号:v{{version}}</text>
5
6
</view>
6
7
<view class='address-container'>
7
8
<view class='dot' />
Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ page {
64
64
color: #596c8e;
65
65
}
66
66
67
+ .version {
68
+ font-size: 30rpx;
69
+ color: #3963bc;
70
+ margin-top: 20rpx;
71
+ }
72
+
67
73
.code {
68
74
width: 210rpx;
69
75
height: 210rpx;
You can’t perform that action at this time.
0 commit comments