Skip to content

Commit 30fd840

Browse files
committed
feat: complie mp-alipay
1 parent 642bc11 commit 30fd840

2 files changed

Lines changed: 141 additions & 87 deletions

File tree

‎pages/tabBar/API/API.vue‎

Lines changed: 66 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,53 @@
2727
<script>
2828
export default {
2929
data() {
30-
let list = [{
30+
// 暂时这么写,后面看怎么优化。
31+
let mediaPages = [{
32+
name: '图片',
33+
url: 'image'
34+
},
35+
// #ifdef APP-PLUS
36+
{
37+
name: '录音',
38+
url: 'voice'
39+
}, {
40+
name: '背景音频',
41+
url: 'background-audio'
42+
},
43+
// #endif
44+
// #ifdef MP-WEIXIN
45+
{
46+
name: '录音',
47+
url: 'voice'
48+
}, {
49+
name: '背景音频',
50+
url: 'background-audio'
51+
},
52+
// #endif
53+
// #ifdef MP-BAIDU
54+
{
55+
name: '录音',
56+
url: 'voice'
57+
}, {
58+
name: '背景音频',
59+
url: 'background-audio'
60+
},
61+
// #endif
62+
// #ifndef MP-ALIPAY
63+
{
64+
name: '视频',
65+
url: 'video'
66+
},
67+
// #endif
68+
// #ifndef H5
69+
{
70+
name: '文件',
71+
url: 'file'
72+
},
73+
// #endif
74+
];
75+
76+
const list = [{
3177
id: 'page',
3278
name: '界面',
3379
open: false,
@@ -78,25 +124,25 @@
78124
}, {
79125
name: '打电话',
80126
url: 'make-phone-call'
81-
},
127+
},
82128
//#ifndef H5
83129
{
84130
name: '扫码',
85131
url: 'scan-code'
86132
}, {
87133
name: '剪贴板',
88134
url: 'clipboard'
89-
},
135+
},
90136
//#endif
91137
{
92138
name: '监听加速度传感器',
93139
url: 'on-accelerometer-change'
94140
}, {
95141
name: '监听罗盘数据',
96142
url: 'on-compass-change'
97-
}
143+
},
98144
//#ifdef APP-PLUS
99-
, {
145+
{
100146
name: '监听距离传感器',
101147
url: '/platforms/app-plus/proximity/proximity'
102148
}, {
@@ -123,30 +169,7 @@
123169
id: 'media',
124170
name: '媒体',
125171
open: false,
126-
pages: [{
127-
name: '图片',
128-
url: 'image'
129-
},
130-
//#ifndef H5
131-
{
132-
name: '录音',
133-
url: 'voice'
134-
}, {
135-
name: '背景音频',
136-
url: 'background-audio'
137-
},
138-
//#endif
139-
{
140-
name: '视频',
141-
url: 'video'
142-
},
143-
//#ifndef H5
144-
{
145-
name: '文件',
146-
url: 'file'
147-
},
148-
//#endif
149-
]
172+
pages: mediaPages
150173
}, {
151174
id: 'location',
152175
name: '位置',
@@ -169,7 +192,7 @@
169192
name: '数据存储',
170193
url: 'storage'
171194
}]
172-
},
195+
},
173196
//#ifdef MP-WEIXIN
174197
{
175198
id: 'login',
@@ -182,7 +205,7 @@
182205
name: '获取用户信息',
183206
url: 'get-user-info'
184207
}]
185-
},
208+
},
186209
{
187210
id: 'payment',
188211
name: '支付',
@@ -191,7 +214,7 @@
191214
name: '发起支付',
192215
url: 'request-payment'
193216
}]
194-
},
217+
},
195218
{
196219
id: 'share',
197220
name: '分享',
@@ -214,7 +237,7 @@
214237
name: '获取用户信息',
215238
url: 'get-user-info'
216239
}]
217-
},
240+
},
218241
{
219242
id: 'share',
220243
name: '分享',
@@ -237,7 +260,7 @@
237260
name: '获取用户信息',
238261
url: 'get-user-info'
239262
}]
240-
},
263+
},
241264
{
242265
id: 'payment',
243266
name: '支付',
@@ -246,7 +269,7 @@
246269
name: '发起支付',
247270
url: 'request-payment'
248271
}]
249-
},
272+
},
250273
{
251274
id: 'share',
252275
name: '分享',
@@ -297,9 +320,9 @@
297320
},
298321
methods: {
299322
triggerCollapse(e) {
300-
if(!this.lists[e].pages){
323+
if (!this.lists[e].pages) {
301324
this.goDetailPage(this.lists[e].url);
302-
return ;
325+
return;
303326
}
304327
for (var i = 0; i < this.lists.length; ++i) {
305328
if (e === i) {
@@ -320,12 +343,12 @@
320343
}
321344
</script>
322345

323-
<style>
324-
page{
325-
height: auto;
326-
min-height: 100%;
327-
}
328-
346+
<style>
347+
page {
348+
height: auto;
349+
min-height: 100%;
350+
}
351+
329352
.uni-card {
330353
box-shadow: none;
331354
}

0 commit comments

Comments
 (0)