/
indexTest.js
64 lines (55 loc) · 1.41 KB
/
indexTest.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import {
Platform,
NativeModules,
NativeAppEventEmitter
} from 'react-native';
const ios = Platform.OS === 'ios';
const android = Platform.OS === 'android';
const Picker = NativeModules.RNLhhLibrary;
const options = {
isLoop: false,
pickerConfirmBtnText: 'confirm',
pickerCancelBtnText: 'cancel',
pickerTitleText: 'pls select',
pickerConfirmBtnColor: [1, 186, 245, 1],
pickerCancelBtnColor: [1, 186, 245, 1],
pickerTitleColor: [20, 20, 20, 1],
pickerToolBarBg: [232, 232, 232, 1],
pickerTextEllipsisLen: 6,
pickerBg: [196, 199, 206, 1],
pickerRowHeight: 24,
wheelFlex: [1, 1, 1],
pickerData: [],
selectedValue: [],
onPickerConfirm(){},
onPickerCancel(){},
onPickerSelect(){},
pickerToolBarFontSize: 16,
pickerFontSize: 16,
pickerFontColor: [31, 31 ,31, 1],
title:"哈哈"
};
export default {
init(params){
const opt = {
...options,
...params
};
const fnConf = {
confirm: opt.onPickerConfirm,
cancel: opt.onPickerCancel,
select: opt.onPickerSelect
};
this.listener && this.listener.remove();
this.listener = NativeAppEventEmitter.addListener('pickerEvent', event => {
console.log(event)
});
},
// show(){
// Picker.show();
// },
//
// hide(){
// Picker.hide();
// },
};