ipanel-rnapp-ajb-base 1.0.17 → 1.0.20

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/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # ipanel-rnapp-ajb-base
1
+ ## ipanel-rnapp-ajb-base
2
2
 
3
3
  ipanel-rnapp-ajb-base npm仓库
package/app/App.js CHANGED
@@ -35,7 +35,7 @@ import Loading from './components/common/Loading';
35
35
  import Toast from './components/common/Toast';
36
36
  import Dialog from './components/common/Dialog';
37
37
  import Notify from './components/common/Notify';
38
- // import SheetManage from './components/common/SheetManage';
38
+ import SheetManage from './components/common/SheetManage';
39
39
  import storage from './storage';
40
40
 
41
41
  import {navigationRef} from './utils/RootNavigation';
@@ -61,6 +61,8 @@ import useDebounceFn from './hooks/useDebounceFn';
61
61
  import useUser from './hooks/useUser';
62
62
  import useKeyboard from './hooks/useKeyboard';
63
63
 
64
+ import RegisteCountScreen from './screens/RegisteCountScreen'
65
+
64
66
  LogBox.ignoreLogs([
65
67
  'ViewPropTypes will be removed',
66
68
  'ColorPropType will be removed',
@@ -127,6 +129,13 @@ const CommonScreens = {
127
129
  headerShown: false,
128
130
  },
129
131
  },
132
+ RegisteCountScreen: {
133
+ component: RegisteCountScreen,
134
+ screenOptions: {
135
+ title: '注册',
136
+ headerShown: false,
137
+ },
138
+ },
130
139
  ScanQRCodeScreen: {
131
140
  component: ScanQRCodeScreen,
132
141
  screenOptions: {
@@ -387,7 +396,7 @@ const App = () => {
387
396
  allStackScreens[routeName]?.screenOptions?.includeBottom || false,
388
397
  );
389
398
  /* 加载之后每次navigate都鉴权一把登录状态(重置密码不需要检测) */
390
- if (routeName !== 'ResePasswordScreen') {
399
+ if (routeName !== 'ResePasswordScreen' && routeName !== 'RegisteCountScreen') {
391
400
  checkLogin();
392
401
  }
393
402
 
@@ -440,7 +449,7 @@ const App = () => {
440
449
  <Toast onRef={ref => (global.toast = ref)} />
441
450
  <Notify onRef={ref => (global.notify = ref)} />
442
451
  <Dialog onRef={ref => (global.dialog = ref)} />
443
- {/* <SheetManage onRef={ref => (global.sheetManager = ref)} /> */}
452
+ <SheetManage onRef={ref => (global.sheetManager = ref)} />
444
453
  {versionUpdateConfirmVisible && (
445
454
  <VersionUpdateConfirm
446
455
  onVisibleChange={setVersionUpdateConfirmVisible}
@@ -19,8 +19,10 @@ export const getHomedUserInfo = async data => {
19
19
 
20
20
  // /account/device/get_list
21
21
  export const getUserList = async data => {
22
+ const domain = await global.base.getHomedDomain()
23
+ const host = domain === 'pyitv.com' ? 12690 : 80
22
24
  return homedHttp({
23
- url: `http://access.${await global.base.getHomedDomain()}/account/user/get_list`,
25
+ url: `http://access.${domain}:${host}/account/user/get_list`,
24
26
  method: 'GET',
25
27
  data,
26
28
  });
@@ -34,8 +36,9 @@ export const getRegionList = async data => {
34
36
  };
35
37
 
36
38
  export const getAccessToken = async (data, domain) => {
39
+ const host = domain === 'pyitv.com' ? 12690 : 80
37
40
  return homedHttp({
38
- url: `http://access.${domain}/account/get_accesstoken`,
41
+ url: `http://access.${domain}:${host}/account/get_accesstoken`,
39
42
  method: 'POST',
40
43
  data,
41
44
  });
@@ -142,6 +142,20 @@ export const accountLogin = (data, type) => {
142
142
  });
143
143
  };
144
144
 
145
+
146
+ //账号注册
147
+ export const accountRegiste = (data, type) => {
148
+ return request({
149
+ url: type === 'adg' ? ADG_SERVICE : ACCOUNT_SERVICE,
150
+ method: 'POST',
151
+ data: {
152
+ action: 'account_register',
153
+ ...data,
154
+ },
155
+ });
156
+ };
157
+
158
+
145
159
  export const obtainThirdToken = data => {
146
160
  return request({
147
161
  url: ACCOUNT_SERVICE,
@@ -659,38 +673,47 @@ export const getAddressUser = data => {
659
673
  method: 'POST',
660
674
  data: {
661
675
  action: 'get_address_user',
676
+ detail: true,
662
677
  ...data,
663
678
  },
664
679
  });
665
680
  };
666
681
 
667
682
  export const getCloudInfo = async data => {
683
+ const domain = await global.base.getHomedDomain()
684
+ const host = domain === 'pyitv.com' ? 14890 : 80
668
685
  return homedHttp({
669
- url: `http://izone.${appName === '禺乐慧家' ? await global.base.getHomedDomain() : 'homed.tv'}/account/cloud/get_info`,
686
+ url: `http://izone.${domain}:${host}/account/cloud/get_info`,
670
687
  method: 'GET',
671
688
  data,
672
689
  });
673
690
  };
674
691
 
675
692
  export const getCloudFileList = async data => {
693
+ const domain = await global.base.getHomedDomain()
694
+ const host = domain === 'pyitv.com' ? 14890 : 80
676
695
  return homedHttp({
677
- url: `http://izone.${appName === '禺乐慧家' ? await global.base.getHomedDomain() : 'homed.tv'}/account/cloud/file/get_list`,
696
+ url: `http://izone.${domain}:${host}/account/cloud/file/get_list`,
678
697
  method: 'GET',
679
698
  data,
680
699
  });
681
700
  };
682
701
 
683
702
  export const openCloudService = async data => {
703
+ const domain = await global.base.getHomedDomain()
704
+ const host = domain === 'pyitv.com' ? 14890 : 80
684
705
  return homedHttp({
685
- url: `http://izone.${appName === '禺乐慧家' ? await global.base.getHomedDomain() : 'homed.tv'}/account/cloud/open`,
706
+ url: `http://izone.${domain}:${host}/account/cloud/open`,
686
707
  method: 'POST',
687
708
  data,
688
709
  });
689
710
  };
690
711
 
691
712
  export const deleteCloudFile = async data => {
713
+ const domain = await global.base.getHomedDomain()
714
+ const host = domain === 'pyitv.com' ? 14890 : 80
692
715
  return homedHttp({
693
- url: `http://izone.${appName === '禺乐慧家' ? await global.base.getHomedDomain() : 'homed.tv'}/account/cloud/file/delete`,
716
+ url: `http://izone.${domain}:${host}/account/cloud/file/delete`,
694
717
  method: 'POST',
695
718
  data,
696
719
  });
@@ -699,7 +722,7 @@ export const deleteCloudFile = async data => {
699
722
  // 根据设备对应id获取题库
700
723
  export const getProductAnswers = questionId => {
701
724
  return request({
702
- url: `https://api.cloud.ipanel.cn/vgatehelp/ajb/getProductAnswers/${questionId}`,
725
+ url: `https://${appName === '禺乐慧家' ? 'szjtyfw.panyu.gd.cn:50443' : 'api.cloud.ipanel.cn'}/vgatehelp/ajb/getProductAnswers/${questionId}`,
703
726
  method: 'GET',
704
727
  });
705
728
  };
@@ -794,3 +817,15 @@ export const changePwdByPhone = data => {
794
817
  },
795
818
  });
796
819
  };
820
+
821
+ //查询账号
822
+ export const queryCountByName = data => {
823
+ return request({
824
+ url: ACCOUNT_SERVICE,
825
+ method: 'POST',
826
+ data: {
827
+ action: 'query_account_by_name',
828
+ ...data,
829
+ },
830
+ });
831
+ };
@@ -65,9 +65,7 @@ const Index = ({steps, active, onRef}) => {
65
65
  animationType="fade"
66
66
  transparent={true}
67
67
  visible={modalVisible}
68
- onRequestClose={() => {
69
- setModalVisible(!modalVisible);
70
- }}>
68
+ onRequestClose={() => {}}>
71
69
  <TouchableOpacity
72
70
  style={styles.centeredView}
73
71
  activeOpacity={1}
@@ -1,19 +1,22 @@
1
1
  import React,{useEffect, useState} from 'react';
2
- import {View, Text, StyleSheet} from 'react-native';
2
+ import {View, Text, StyleSheet,Platform} from 'react-native';
3
3
  import Picker from '../PickerV2Base/picker';
4
4
  import px from '../../../utils/scaleSize';
5
- // import {
5
+ //import { transform } from '@babel/core';
6
+ ////// import {
6
7
  // useAnimatedStyle,
7
8
  // withSpring,
8
9
  // } from 'react-native-reanimated';
9
10
  const pickerStyles = {
10
11
  okView:{borderLeftColor:'#F0F0F0',borderLeftWidth:1},
11
- okText: {color: '#E86003',width:px(500)},
12
+ okText: {color: '#E86003',width:px(500),fontWeight:'600'},
12
13
  dismissText: {color: '#666',width:px(500),},
13
14
  container:{borderTopLeftRadius:px(20),borderTopRightRadius:px(20)},
14
- wrappper:{borderTopLeftRadius:px(20),borderTopRightRadius:px(20)},
15
+ wheelWrapperAdd:{paddingVertical:px(60)},
15
16
  headerItem:{flex:0},
16
17
  header:{
18
+ height:Platform.OS !== 'android' ? px(180):px(150),
19
+ paddingBottom:Platform.OS !== 'android' ? px(30):px(0),
17
20
  borderBottomWidth:px(0),
18
21
  borderTopWidth:1,
19
22
  borderTopColor:'#F0F0F0',
@@ -22,19 +25,17 @@ header:{
22
25
  maskMiddle:{borderColor:'transparent'},
23
26
  titleBox:{
24
27
  width:'100%',
25
- height:px(205),
28
+ height:px(190),
26
29
  backgroundColor:'#fff',
27
- top:px(15),
28
- borderTopRightRadius:px(20),borderTopLeftRadius:px(20)
29
- },
30
- titleContent:{
31
- width:'100%',height:px(190),borderBottomColor:'#f0f0f0',borderBottomWidth:1
30
+ top:px(0),
31
+ borderTopRightRadius:px(20),borderTopLeftRadius:px(20),
32
32
  },
33
+ titleContent:{},
33
34
  titleText:{
34
35
  fontSize:px(48),color:'#333',textAlign:'center',lineHeight:px(190)
35
36
  }
36
37
  }
37
- const pickerStyle = {height:px(700)}
38
+ // const pickerStyle = {height:px(350)}
38
39
 
39
40
 
40
41
  const PickerV2 = ({
@@ -42,7 +43,7 @@ const PickerV2 = ({
42
43
  renderMaskBottom=()=>{return <View></View>},
43
44
  styles={},
44
45
  style={},
45
- itemHeight=px(140),
46
+ itemHeight=px(120),
46
47
  visible=false,
47
48
  pickerData = [],
48
49
  dealPickerCommit=()=>{},
@@ -53,11 +54,13 @@ const PickerV2 = ({
53
54
  changePickedIndex=()=>{},
54
55
  animatedStartValue,
55
56
  animationEffects = {},
56
- title
57
+ title,
58
+ dataLength=0
57
59
  }) => {
58
60
 
61
+ // console.log(defaultValue)
59
62
 
60
- // console.log(title)
63
+ ////// console.log(title)
61
64
  // const customSpringStyles = useAnimatedStyle(() => {
62
65
  // return {
63
66
  // transform: [
@@ -95,7 +98,8 @@ const PickerV2 = ({
95
98
  key={index}
96
99
  style={[styless.pickerItemCom,
97
100
  index===pickedIndex?styless.pickedPicker:
98
- {fontSize: px(50),color:Math.abs(index-pickedIndex)===1?'#999':'#eee'},
101
+ {fontSize: px(44),color:Math.abs(index-pickedIndex)===1?'#999':'#eee',},
102
+ dataLength>3?{height:'100%'}:{}
99
103
  ]}
100
104
  >
101
105
  {item.label}
@@ -110,11 +114,14 @@ const PickerV2 = ({
110
114
  title={title}
111
115
  renderMaskTop={renderMaskTop}
112
116
  renderMaskBottom={renderMaskBottom}
113
- styles={{...pickerStyles,...styles}}
117
+ styles={{...pickerStyles,...{wrappper:Boolean(title)?{
118
+ borderTopColor:'#f0f0f0',borderTopWidth:1
119
+ }:{borderTopLeftRadius:px(20),borderTopRightRadius:px(20)}},...styles}}
114
120
  renderLabel={renderItem||renderLabel}
115
- style={{...pickerStyle,...style}}
121
+ style={{...{height:dataLength<3?px(360):dataLength===3?px(480):px(600)},...style}}
116
122
  itemHeight={itemHeight}
117
- defaultValue = {defaultValue}
123
+ // defaultValue = {defaultValue}
124
+ value={[pickerData[pickedIndex]?.value]}
118
125
  onPickerChange={handlePickerChange}
119
126
  onOk={handlePikerCommit}
120
127
  onDismiss={handlePickerCancel}
@@ -131,8 +138,8 @@ const styless = StyleSheet.create({
131
138
  },
132
139
  pickedPicker:{
133
140
  color: '#333',
134
- fontSize:px(72),
135
- fontWeight:'bold'
141
+ fontSize:px(56),
142
+ fontWeight:'500',
136
143
  },
137
144
  });
138
145
  export default PickerV2;
@@ -197,7 +197,7 @@ const RMCPicker = forwardRef<PickerRef, RMCPickerProps>((props, ref) => {
197
197
  >
198
198
  {/* TODO: 组件卸载是在visible更新fasle之后,需要前置 */}
199
199
  {/* 否则会无效执行onPickerChange */}
200
- {typeof title !== 'undefined'&&<View style={props.styles.titleBox}>
200
+ {(innerVisible && Boolean(title))&&<View style={props.styles.titleBox}>
201
201
  <View style={props.styles.titleContent}>
202
202
  <Text style={props.styles.titleText}>{title}</Text>
203
203
  </View>
@@ -2,7 +2,8 @@ import React, { memo } from 'react'
2
2
  import { Text, TouchableHighlight, View,Modal,TouchableOpacity } from 'react-native'
3
3
  // import Modal from '../modal/ModalView'
4
4
  import { PopupPickerProps } from './PopupPickerTypes'
5
- import Animated from 'react-native-reanimated';
5
+ //////import Animated from 'react-native-reanimated';
6
+ import * as Animatable from 'react-native-animatable';
6
7
 
7
8
  const PopupPicker = memo((props: PopupPickerProps) => {
8
9
  const {
@@ -51,7 +52,9 @@ const PopupPicker = memo((props: PopupPickerProps) => {
51
52
  style={[{position:'absolute',top:0,left:0,right:0,bottom:0,zIndex:999},styles.maskColor]}
52
53
  onPress={onClose}
53
54
  ></TouchableOpacity>
54
- <Animated.View style={[{position:'absolute',left:0,right:0,bottom:0,zIndex:1000},customSpringStyles]}>
55
+ <Animatable.View
56
+ animation="slideInUp" easing="ease" iterationCount={1} duration={600}
57
+ style={[{position:'absolute',left:0,right:0,bottom:0,zIndex:1000},customSpringStyles]}>
55
58
  {children}
56
59
  <View style={[styles.header]}>
57
60
  <TouchableHighlight
@@ -72,7 +75,7 @@ const PopupPicker = memo((props: PopupPickerProps) => {
72
75
  {okEl}
73
76
  </TouchableHighlight>
74
77
  </View>
75
- </Animated.View>
78
+ </Animatable.View>
76
79
  </Modal>
77
80
  )
78
81
  })
@@ -6,6 +6,7 @@ import {
6
6
  Platform,
7
7
  ScrollView,
8
8
  View,
9
+ TouchableWithoutFeedback
9
10
  } from 'react-native'
10
11
 
11
12
  type ColumnItem = {
@@ -27,11 +28,13 @@ type Props = {
27
28
  class Wheel extends React.Component<Props> {
28
29
  scrollerRef: any
29
30
 
30
- scrollBuffer: number
31
+ scrollBuffer: any
31
32
 
32
33
  selectValue: any
33
34
  isScrolling: boolean
34
35
 
36
+ animateFlaf:any
37
+
35
38
  componentDidMount() {
36
39
  const { value, column, itemHeight } = this.props
37
40
  setTimeout(() => {
@@ -40,6 +43,7 @@ class Wheel extends React.Component<Props> {
40
43
  }
41
44
 
42
45
  shouldComponentUpdate(nextProps: Props) {
46
+ if(this.animateFlaf){return true}
43
47
  const { value, column, itemHeight, wheelHeight } = nextProps
44
48
  if (
45
49
  value !== this.props.value ||
@@ -53,6 +57,7 @@ class Wheel extends React.Component<Props> {
53
57
  }
54
58
 
55
59
  componentDidUpdate(prevProps: Props) {
60
+ if(this.animateFlaf){return false}
56
61
  const { column } = prevProps
57
62
  if (column !== this.props.column) {
58
63
  this.scrollTo(
@@ -62,11 +67,12 @@ class Wheel extends React.Component<Props> {
62
67
  }
63
68
  }
64
69
 
65
- scrollTo = (y: any) => {
70
+ scrollTo = (y: any,flag?:any) => {
66
71
  this.scrollerRef?.scrollTo?.({
67
72
  y,
68
- animated: false,
73
+ animated: flag === 'animate'?true:false,
69
74
  })
75
+ this.animateFlaf = false
70
76
  }
71
77
 
72
78
  getSelectIndex(column: ColumnItem[], value?: Value) {
@@ -154,14 +160,31 @@ class Wheel extends React.Component<Props> {
154
160
  this.isScrolling = false
155
161
  }
156
162
 
163
+ handleItemClick = (item:any,index:any) =>{
164
+ if(this.props.value === item?.value){return}
165
+ this.animateFlaf = true
166
+ this.props.onSelect(item?.value, this.props.index)
167
+ setTimeout(() => {
168
+ this.scrollTo(
169
+ this.getSelectIndex(this.props.column, item?.value) *
170
+ this.props.itemHeight,'animate'
171
+ )
172
+ })
173
+ }
174
+
157
175
  renderItems = () => {
158
176
  const { column, renderLabel, itemHeight, wheelHeight } = this.props
159
177
  return (
160
178
  <View
161
179
  style={{
162
- paddingVertical: (wheelHeight - itemHeight) / 2,
180
+ paddingVertical: (wheelHeight - itemHeight) / (this.props.column.length===3?3:
181
+ this.props.column.length>3?3:8),
163
182
  }}>
164
- {column.map((item, index) => renderLabel(item, index))}
183
+ {column.map((item, index) => {
184
+ return <TouchableWithoutFeedback key={index} onPress={()=>this.handleItemClick(item,index)}>
185
+ {renderLabel(item, index)}
186
+ </TouchableWithoutFeedback>
187
+ })}
165
188
  </View>
166
189
  )
167
190
  }
@@ -130,7 +130,7 @@ export default class RMCPickerView extends React.Component<
130
130
  <View
131
131
  style={[{ height: 7 * itemHeight }, s.wrappper, style]}
132
132
  onLayout={this.wrapperMeasure}>
133
- <View style={[s.wheelWrapper, { height: wheelHeight }]}>
133
+ <View style={[s.wheelWrapper, s.wheelWrapperAdd,{ height: wheelHeight }]}>
134
134
  {(loading || columns?.length === 0) && loading !== false
135
135
  ? loadingContent || (
136
136
  <View style={{ flex: 1, alignSelf: 'center' }}>
@@ -3,6 +3,7 @@ import { StyleSheet, ViewStyle } from 'react-native'
3
3
  export interface PickerViewStyle {
4
4
  wrappper: ViewStyle
5
5
  wheelWrapper: ViewStyle
6
+ wheelWrapperAdd:ViewStyle
6
7
  mask: ViewStyle
7
8
  maskTop: ViewStyle
8
9
  maskMiddle: ViewStyle
@@ -22,6 +23,7 @@ export default () =>
22
23
  display: 'flex',
23
24
  flexDirection: 'row',
24
25
  },
26
+ wheelWrapperAdd:{},
25
27
  mask: {
26
28
  position: 'absolute',
27
29
  zIndex: 10000,
@@ -1,82 +1,95 @@
1
- import React from 'react';
2
- import { View, Text, StyleSheet } from 'react-native';
1
+ // import React from 'react';
2
+ // import { View, Text, StyleSheet } from 'react-native';
3
3
 
4
- const Home = () => {
5
- return <View><Text>Home</Text></View>
6
- }
7
- const styles = StyleSheet.create({});
8
- export default Home;
4
+ // const Home = () => {
5
+ // return <View><Text>Home</Text></View>
6
+ // }
7
+ // const styles = StyleSheet.create({});
8
+ // export default Home;
9
9
 
10
10
 
11
- // import React,{useState,useImperativeHandle,useRef} from 'react';
12
- // import {View, Text, StyleSheet} from 'react-native';
13
- // import PickerV2 from '../PickerV2';
14
- // import {useSharedValue} from 'react-native-reanimated';
11
+ import React,{useState,useImperativeHandle,useRef} from 'react';
12
+ import {View, Text, StyleSheet} from 'react-native';
13
+ import PickerV2 from '../PickerV2';
14
+ //////import {useSharedValue} from 'react-native-reanimated';
15
15
 
16
- // const Home = ({steps, active, onRef}) => {
17
- // let backResult = useRef()
18
- // const animatedStartValue = useSharedValue(700);
19
- // const [visible, setPickerVisible] = useState(false);
20
- // const [pickerData, setPickerData] = useState([]);
21
- // const [pickerTitle,setPickerTitle] = useState()
22
- // const [defaultIndex,setDefaultIndex] = useState(0)
23
- // const [pickedIndex, setPickedIndex] = useState(() => {
24
- // return defaultIndex;
25
- // });
26
- // useImperativeHandle(onRef, () => {
27
- // return {
28
- // show: (str,data) => {
29
- // if(data?.payload?.columns.length){
30
- // setPickerTitle(data?.payload?.title)
31
- // setPickerData(data?.payload?.columns.map(item=>{
32
- // item.label = item[data?.payload?.nameProp]
33
- // item.value = item?.label;
34
- // return item})||[]);
35
- // // console.log(data)
36
- // setPickerVisible(true);
37
- // animatedStartValue.value = 0;
38
- // return new Promise((resolve,reject)=>{
39
- // backResult.current = (res)=>{
40
- // resolve(res)
41
- // }
42
- // })
43
- // }
44
- // },
45
- // };
46
- // });
47
- // const changePickedIndex = index => {
48
- // setPickedIndex(index);
49
- // };
50
- // const dealPickerCommit = (value) =>{
51
- // animatedStartValue.value = 700;
52
- // setPickerTitle()
53
- // setPickerVisible(false);
54
- // setPickedIndex(0);
55
- // // console.log(value);
56
- // const data = pickerData.find(item => {
57
- // return value[0] === item.value;
58
- // });
59
- // const index = pickerData.findIndex(item => {
60
- // return value[0] === item.value;
61
- // })
62
- // backResult.current({data,index})
63
- // }
64
- // return <PickerV2
65
- // pickerData={pickerData}
66
- // visible={visible}
67
- // // defaultValue={[pickerData[defaultIndex]?.value]}
68
- // title={pickerTitle}
69
- // pickedIndex={pickedIndex}
70
- // changePickedIndex={index => changePickedIndex(index)}
71
- // dealPickerCommit={item => dealPickerCommit(item)}
72
- // dealPickerCancel={() => {
73
- // animatedStartValue.value = 700;
74
- // setPickerTitle()
75
- // setPickerVisible(false);
76
- // setPickedIndex(0);
77
- // }}
78
- // animatedStartValue={animatedStartValue.value}
79
- // />
80
- // };
81
- // const styles = StyleSheet.create({});
82
- // export default Home;
16
+ const Home = ({steps, active, onRef}) => {
17
+ let backResult = useRef()
18
+ //////const animatedStartValue = useSharedValue(700);
19
+ const [visible, setPickerVisible] = useState(false);
20
+ const [pickerData, setPickerData] = useState([]);
21
+ const [pickerTitle,setPickerTitle] = useState()
22
+ //const [defaultIndex,setDefaultIndex] = useState(0)
23
+ const [pickedIndex, setPickedIndex] = useState();
24
+ const [dataLength,setDataLength] = useState(0)
25
+ useImperativeHandle(onRef, () => {
26
+ return {
27
+ show: (str,data) => {
28
+ setDataLength(data?.payload?.columns.length||0)
29
+ if(data?.payload?.columns.length){
30
+ setPickerTitle(data?.payload?.title)
31
+ setPickerData(data?.payload?.columns.map((item)=>{
32
+ if(data?.payload?.nameProp){
33
+ item.label = item[data?.payload?.nameProp]
34
+ item.value = item?.label;
35
+ }else if(typeof item !== 'object'){
36
+ return {
37
+ label:item,
38
+ value:item,
39
+ tag:'noNameProp'
40
+ }
41
+ }
42
+ return item})||[]);
43
+ // console.log(data)
44
+ setPickedIndex(data?.payload?.defaultIndex||0)
45
+ setPickerVisible(true);
46
+ //////animatedStartValue.value = 0;
47
+ return new Promise((resolve,reject)=>{
48
+ backResult.current = (res)=>{
49
+ if(res?.data?.tag === 'noNameProp'){
50
+ res.data = res?.data.value
51
+ }
52
+ resolve(res)
53
+ }
54
+ })
55
+ }
56
+ },
57
+ };
58
+ });
59
+ const changePickedIndex = index => {
60
+ setPickedIndex(index);
61
+ };
62
+ const dealPickerCommit = (value) =>{
63
+ //////animatedStartValue.value = 700;
64
+ setPickerTitle()
65
+ setPickerVisible(false);
66
+ setPickedIndex(0);
67
+ // console.log(value);
68
+ const data = pickerData.find(item => {
69
+ return value[0] === item.value;
70
+ });
71
+ const index = pickerData.findIndex(item => {
72
+ return value[0] === item.value;
73
+ })
74
+ backResult.current({data,index})
75
+ }
76
+ return <PickerV2
77
+ dataLength={dataLength}
78
+ pickerData={pickerData}
79
+ visible={visible}
80
+ // defaultValue={[pickerData[defaultIndex]?.value]}
81
+ title={pickerTitle}
82
+ pickedIndex={pickedIndex}
83
+ changePickedIndex={index => changePickedIndex(index)}
84
+ dealPickerCommit={item => dealPickerCommit(item)}
85
+ dealPickerCancel={() => {
86
+ ////// animatedStartValue.value = 700;
87
+ setPickerTitle()
88
+ setPickerVisible(false);
89
+ setPickedIndex(0);
90
+ }}
91
+ //////animatedStartValue={animatedStartValue.value}
92
+ />
93
+ };
94
+ const styles = StyleSheet.create({});
95
+ export default Home;
@@ -6,5 +6,5 @@ export ActionPicker from './common/ActionPicker';
6
6
  export ScreenBackHeader from './common/ScreenBackHeader';
7
7
  export CustomDialog from './common/CustomDialog';
8
8
  export OnceTouchable from './common/OnceTouchable';
9
- // export PickerV2 from './common/PickerV2';
10
- // export PickerV1 from "./common/PickerV1";
9
+ export PickerV2 from './common/PickerV2';
10
+ export PickerV1 from "./common/PickerV1";
@@ -9,6 +9,7 @@ import {
9
9
  TextInput,
10
10
  KeyboardAvoidingView,
11
11
  Keyboard,
12
+ NativeModules,
12
13
  } from 'react-native';
13
14
  import {Divider, Icon, Input, Slider, Text} from '@rneui/themed';
14
15
  import {launchImageLibrary} from 'react-native-image-picker';
@@ -18,6 +19,8 @@ const {ScreenBackHeader} = global.base.commonComponents;
18
19
 
19
20
  const px = global.base.scaleSize;
20
21
 
22
+ const appName = NativeModules?.RNToNativeEmitter?.appName || global.base?.config?.LOCALTEST_APP_NAME;
23
+
21
24
  import {getProductAnswers} from '../../../api';
22
25
 
23
26
  // 设备类型对应题库
@@ -102,7 +105,7 @@ export default ({route, navigation}) => {
102
105
  });
103
106
  global.loading.showLoading('提交中...');
104
107
  console.log(formData, 'formData');
105
- fetch('https://api.cloud.ipanel.cn/vgatehelp/ajb/problemFeedback', {
108
+ fetch(`https://${appName === '禺乐慧家' ? 'szjtyfw.panyu.gd.cn:50443' : 'api.cloud.ipanel.cn'}/vgatehelp/ajb/problemFeedback`, {
106
109
  method: 'POST',
107
110
  headers: {
108
111
  'Content-Type': 'multipart/form-data',