File tree 1 file changed +68
-6
lines changed
1 file changed +68
-6
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,12 @@ Component({
14
14
type : String ,
15
15
value : '1'
16
16
} ,
17
- bgColor : String ,
18
- zIndex :{
19
- type :String ,
17
+ bgColor : {
18
+ type : String ,
19
+ value : ""
20
+ } ,
21
+ zIndex : {
22
+ type : String ,
20
23
value : '776'
21
24
} ,
22
25
// 类型
@@ -36,9 +39,15 @@ Component({
36
39
value : 'medium' ,
37
40
} ,
38
41
// 自定义
39
- custom : Boolean ,
42
+ custom : {
43
+ type : Boolean ,
44
+ value : false
45
+ } ,
40
46
// 全屏模式
41
- fullScreen : Boolean
47
+ fullScreen : {
48
+ type : Boolean ,
49
+ value : false
50
+ }
42
51
} ,
43
52
44
53
attached ( ) {
@@ -55,15 +64,24 @@ Component({
55
64
_init ( ) {
56
65
wx . lin = wx . lin || { } ;
57
66
wx . lin . showLoading = ( options ) => {
67
+ console . warn ( 'wx.lin 已废弃,请使用开放函数代替:https://doc.mini.talelin.com//start/open-function.html' ) ;
68
+ if ( ! options ) {
69
+ options = { } ;
70
+ }
71
+
58
72
const {
59
73
custom = false ,
60
74
fullScreen = false ,
61
75
color = '' ,
62
76
type = 'rotate' ,
63
77
size = 'medium' ,
64
- opacity = '1'
78
+ opacity = '1' ,
79
+ bgColor = '' ,
80
+ zIndex = '776' ,
65
81
} = { ...options } ;
66
82
this . setData ( {
83
+ bgColor,
84
+ zIndex,
67
85
custom,
68
86
fullScreen,
69
87
color,
@@ -74,6 +92,7 @@ Component({
74
92
} ) ;
75
93
} ;
76
94
wx . lin . hideLoading = ( ) => {
95
+ console . warn ( 'wx.lin 已废弃,请使用开放函数代替:https://doc.mini.talelin.com//start/open-function.html' ) ;
77
96
this . setData ( {
78
97
show : false
79
98
} ) ;
@@ -83,5 +102,48 @@ Component({
83
102
doNothingMove ( ) {
84
103
// do nothing……
85
104
} ,
105
+
106
+ // ========== 开放函数 =============
107
+
108
+ /**
109
+ * 显示 Loading
110
+ * @param {* } options Loading 组件参数
111
+ */
112
+ linShow ( options ) {
113
+ if ( ! options ) {
114
+ options = { } ;
115
+ }
116
+
117
+ const {
118
+ custom = false ,
119
+ fullScreen = false ,
120
+ color = '' ,
121
+ type = 'rotate' ,
122
+ size = 'medium' ,
123
+ opacity = '1' ,
124
+ bgColor = '' ,
125
+ zIndex = '776' ,
126
+ } = { ...options } ;
127
+ this . setData ( {
128
+ bgColor,
129
+ zIndex,
130
+ custom,
131
+ fullScreen,
132
+ color,
133
+ type,
134
+ size,
135
+ opacity,
136
+ show : true
137
+ } ) ;
138
+ } ,
139
+
140
+ /**
141
+ * 隐藏 Loading
142
+ */
143
+ linHide ( ) {
144
+ this . setData ( {
145
+ show : false
146
+ } )
147
+ }
86
148
}
87
149
} ) ;
You can’t perform that action at this time.
0 commit comments