Specification.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  1. import React, { Component } from 'react'
  2. import {
  3. View,
  4. Text,
  5. PixelRatio,
  6. TouchableOpacity,
  7. StyleSheet,
  8. ScrollView,
  9. Image,
  10. FlatList,
  11. Dimensions,
  12. Animated,
  13. TextInput,
  14. } from 'react-native'
  15. import phonaq from '../../../static/images/defaultimg.jpg'
  16. import Icon from '../../../components/Iconfont/Iconfont'
  17. import { Bubble, ModalEcx, CountNum } from '../../../components'
  18. import { ScaleUtil, accMul } from '../../../utils/utils'
  19. import { ImageBaseUrl } from '../../../utils/fetch/Fetchx'
  20. import OptFlatList from './OptFlatList'
  21. import {
  22. SpecificationMethod,
  23. _isContained,
  24. _isArrEqual,
  25. checkedKey,
  26. } from '../../../utils/SpecificationMethod'
  27. import Toast from 'react-native-root-toast'
  28. const { width } = Dimensions.get('window')
  29. export default class Specification extends Component {
  30. constructor(props) {
  31. super(props)
  32. this.state = {
  33. data: {},
  34. mockdata: [],
  35. proid: '',
  36. isCheckVal: [],
  37. isCheckName: [],
  38. noticeOpacity: new Animated.Value(0),
  39. noicename: '',
  40. vcode: '',
  41. price: '',
  42. picture: '',
  43. submit: false,
  44. totalAmt: 0,
  45. orderNum: 1,
  46. conversionRate: 1,
  47. // 不启动聚合
  48. AttrValues: [],
  49. optionData: [],
  50. chooseColor: ""
  51. }
  52. }
  53. // 选配开始入口
  54. _defaultOptional(optionData) {
  55. const {colorData } = this.props;
  56. if(colorData && colorData.length) {
  57. colorData[0].goodsAttrVals.forEach(touchData => {
  58. touchData.isChecked = false
  59. })
  60. }
  61. this.setState({ optionData: JSON.parse(JSON.stringify(optionData)),chooseColor:"" })
  62. }
  63. //选择的色卡颜色
  64. _chooseColor(colorData) {
  65. const {optionData} = this.state;
  66. optionData.chooseColor = colorData;
  67. if(colorData) {
  68. this.setState({
  69. chooseColor : colorData,
  70. price : colorData.goodsPriceByColor[0].goodsPrice,
  71. optionData : optionData
  72. })
  73. }
  74. }
  75. //默认选择该商品自由属性
  76. _defaultVfree(data, attrVals) {
  77. const freeArr = data.polyAttrsDtoList
  78. let vfreeda = []
  79. //将所选商品的自由辅助属性有值的都存在数组vfreeda中
  80. attrVals.map(item => vfreeda.push(item.attrValId))
  81. //筛选出的自由辅助属性vfreeda 与 自由辅助属性库匹配,并勾选
  82. for (let j = 0; j < freeArr.length; j++) {
  83. for (let g = 0; g < freeArr[j].values.length; g++) {
  84. if (vfreeda.indexOf(freeArr[j].values[g].id) != -1) {
  85. freeArr[j].values[g].isChecked = true
  86. } else {
  87. freeArr[j].values[g].isChecked = false
  88. }
  89. }
  90. }
  91. this.setState({
  92. mockdata: freeArr,
  93. submit: false,
  94. })
  95. //'default是标注从默认开始走'
  96. SpecificationMethod(freeArr, data, e => this.defaultMethod(e))
  97. }
  98. defaultMethod(e) {
  99. this.state.isCheckVal = e.checktrue
  100. this.state.isCheckName = e.checkname
  101. // 选择商品
  102. this._productSelect(e.data)
  103. this.setState({
  104. mockdata: e.freeArr,
  105. data: e.data,
  106. })
  107. }
  108. //对选择的属性找对应商品(第四步)
  109. _productSelect(data, verify) {
  110. const isCheckVal = this.state.isCheckVal
  111. const prodata = data.goodsInfos
  112. for (let prodataFirst of Object.keys(prodata)) {
  113. if (
  114. _isContained(prodata[prodataFirst], isCheckVal) &&
  115. _isArrEqual(prodata[prodataFirst], isCheckVal)
  116. ) {
  117. if (!verify) {
  118. this.props.cb(prodataFirst)
  119. this.setState({ submit: true })
  120. } else {
  121. return true
  122. }
  123. }
  124. }
  125. }
  126. _submitOrder() {
  127. if (this.toast) {
  128. Toast.hide(this.toast)
  129. }
  130. if (
  131. this.state.optionData &&
  132. this.state.optionData.length > 0 &&
  133. this.state.optionData.every(itea => itea.isChoose)
  134. ) {
  135. if (this._productSelect(this.state.data, true)) {
  136. this.props.cb(this.state.orderNum, this.state.optionData, 'touchaddd')
  137. } else {
  138. this.toast = Toast.show('所选属性没有对应商品!', {
  139. position: toastHeight,
  140. })
  141. }
  142. } else {
  143. this.toast = Toast.show('请先选择选配属性后再加入购物车!', {
  144. position: toastHeight,
  145. })
  146. }
  147. }
  148. _submitWithOutPloy() {
  149. // let returnOptionData = [];
  150. // this.state.optionData.forEach(item => {
  151. // if (item.isChoose) {
  152. // returnOptionData.push(item.isChoose);
  153. // } else {
  154. // returnOptionData = returnOptionData.concat(item.item);
  155. // }
  156. // });
  157. if(!this.state.optionData.chooseColor) {
  158. return;
  159. }
  160. this.props.cb(this.state.orderNum, this.state.optionData, 'touchaddd')
  161. }
  162. //提示框渐显渐隐动画
  163. _noticeFun(val) {
  164. if (!val) {
  165. val = 0
  166. }
  167. Animated.timing(
  168. // 随时间变化而执行的动画类型
  169. this.state.noticeOpacity, // 动画中的变量值
  170. {
  171. toValue: val, // 透明度最终变为1,即完全不透明
  172. }
  173. ).start()
  174. }
  175. // 选择每行标签
  176. _proCategoryred(val, index, bool) {
  177. //对提示框进行初始化并清除延时
  178. this._noticeFun(0)
  179. clearTimeout(this.settime)
  180. if (bool) {
  181. for (let i = 0; i < this.state.mockdata.length; i++) {
  182. for (let j = 0; j < this.state.mockdata[i].values.length; j++) {
  183. delete this.state.mockdata[i].values[j].isChecked
  184. delete this.state.mockdata[i].values[j].isDisabled
  185. delete this.state.mockdata[i].values[j].isDisableTrue
  186. }
  187. }
  188. this._noticeFun(0.7)
  189. this.state.noicename = val[index].name
  190. //提示框显示2s后消失
  191. this.settime = setTimeout(this._noticeFun.bind(this), 2000)
  192. this.setState({ submit: false })
  193. }
  194. for (let i = 0; i < val.length; i++) {
  195. val[i].isChecked = false
  196. }
  197. val[index].isChecked = true
  198. this.setState({ mockdata: this.state.mockdata })
  199. SpecificationMethod(this.state.mockdata, this.state.data, e =>
  200. this.defaultMethod(e)
  201. )
  202. // this._proCateSelected(this.state.mockdata, this.state.data, val[index]);
  203. }
  204. // FlatList做的聚合列表
  205. _renderRow(val) {
  206. let item = val.values
  207. let valuesname = []
  208. let confirmred, confdisable, disabled
  209. for (let i = 0; i < item.length; i++) {
  210. if (checkedKey(item[i], 'isChecked') && item[i].isChecked === true) {
  211. confirmred = ['#E14C46', '#E14C46']
  212. } else {
  213. confirmred = ['#ddd', '#333']
  214. }
  215. if (checkedKey(item[i], 'isDisabled') && item[i].isDisabled === true) {
  216. ;(confdisable = 'dashed'), (confirmred = ['#ddd', '#ddd'])
  217. } else {
  218. confdisable = 'solid'
  219. }
  220. if (
  221. checkedKey(item[i], 'isDisableTrue') &&
  222. item[i].isDisableTrue === true
  223. ) {
  224. ;(confdisable = 'solid'), (confirmred = ['#ddd', '#ddd'])
  225. }
  226. valuesname.push(
  227. <TouchableOpacity
  228. disabled={item[i].isDisableTrue}
  229. key={i}
  230. activeOpacity={1}
  231. style={{
  232. // height: 30,
  233. paddingHorizontal: 16,
  234. paddingVertical: 6,
  235. borderRadius: 100,
  236. borderStyle: confdisable,
  237. borderColor: confirmred[0],
  238. borderWidth: 1,
  239. justifyContent: 'center',
  240. alignItems: 'center',
  241. marginRight: 15,
  242. }}
  243. onPress={() => {
  244. this._proCategoryred(item, i, item[i].isDisabled)
  245. }}
  246. >
  247. <Text
  248. style={{ color: confirmred[1], fontSize: 12, lineHeight: 17 }}
  249. numberOfLines={1}
  250. >
  251. {item[i].name}
  252. </Text>
  253. </TouchableOpacity>
  254. )
  255. }
  256. return (
  257. <View>
  258. <Text
  259. style={{
  260. color: '#999',
  261. fontSize: 14,
  262. marginTop: 15,
  263. lineHeight: 20,
  264. letterSpacing: 0.17,
  265. }}
  266. >
  267. {val.name}
  268. </Text>
  269. <ScrollView
  270. scrollEnabled={true}
  271. removeClippedSubviews={true}
  272. showsHorizontalScrollIndicator={false}
  273. automaticallyAdjustContentInsets={false}
  274. pagingEnabled={true}
  275. locked={true}
  276. horizontal={true}
  277. style={{ flexDirection: 'row', marginTop: 8, overflow: 'hidden' }}
  278. >
  279. {valuesname}
  280. </ScrollView>
  281. </View>
  282. )
  283. }
  284. rowClosePoly(item) {
  285. return (
  286. <View
  287. style={{
  288. // height: 30,
  289. paddingHorizontal: 16,
  290. paddingVertical: 6,
  291. borderRadius: 100,
  292. borderColor: '#ddd',
  293. borderWidth: 1,
  294. justifyContent: 'center',
  295. alignItems: 'center',
  296. marginRight: 15,
  297. }}
  298. >
  299. <Text
  300. style={{ color: '#ddd', fontSize: 12, lineHeight: 17 }}
  301. numberOfLines={1}
  302. >
  303. {item.name}
  304. </Text>
  305. </View>
  306. )
  307. }
  308. _renderModalContent() {
  309. const {chooseColor} = this.state;
  310. return (
  311. <View style={styles.contentBox}>
  312. <View style={{ height: 20, backgroundColor: 'transparent' }} />
  313. <View
  314. style={{
  315. height: 101,
  316. backgroundColor: '#FFF',
  317. paddingLeft: 140,
  318. paddingTop: 20,
  319. justifyContent: 'space-between',
  320. paddingBottom: 20,
  321. }}
  322. >
  323. <Text
  324. style={{
  325. fontSize: 17,
  326. color: '#E70013',
  327. fontWeight: 'bold',
  328. }}
  329. >
  330. {CURRENCY.currencySign}
  331. {this.state.price || 0}
  332. </Text>
  333. <View
  334. style={{
  335. flexDirection: 'row',
  336. width: width * 0.5,
  337. backgroundColor: '#FFF',
  338. marginTop: 5,
  339. }}
  340. >
  341. <Text
  342. style={{
  343. fontSize: 12,
  344. lineHeight: 17,
  345. letterSpacing: 0.14,
  346. color: '#999',
  347. }}
  348. >
  349. {"已选:"+(chooseColor?(chooseColor.children.custDocGroupName+"->"+chooseColor.children.attrValName):"")}
  350. </Text>
  351. <ScrollView>
  352. <Text
  353. style={{
  354. fontSize: 12,
  355. lineHeight: 17,
  356. letterSpacing: 0.14,
  357. color: '#151515',
  358. }}
  359. >
  360. {this.state.isCheckName.join(' | ')}
  361. </Text>
  362. </ScrollView>
  363. </View>
  364. <TouchableOpacity
  365. onPress={() => {
  366. this.closeModalCate()
  367. }}
  368. style={{ position: 'absolute', right: 11, top: 11 }}
  369. >
  370. <Icon name="icon-icon-guanbianniu" size={28} color="#999" />
  371. </TouchableOpacity>
  372. </View>
  373. {this.state.picture ? (
  374. <View
  375. style={{
  376. position: 'absolute',
  377. marginLeft: 10,
  378. borderColor: '#EEE',
  379. borderWidth: 1 / PixelRatio.get(),
  380. borderRadius: 4,
  381. backgroundColor: '#FFF',
  382. }}
  383. >
  384. <Image
  385. source={{
  386. uri: ImageBaseUrl + this.state.picture,
  387. }}
  388. style={{
  389. height: 120,
  390. width: 120,
  391. }}
  392. />
  393. </View>
  394. ) : (
  395. <View
  396. style={{
  397. position: 'absolute',
  398. marginLeft: 10,
  399. borderColor: '#EEE',
  400. borderWidth: 1 / PixelRatio.get(),
  401. borderRadius: 4,
  402. backgroundColor: '#FFF',
  403. }}
  404. >
  405. <Image
  406. source={phonaq}
  407. style={{
  408. height: 120,
  409. width: 120,
  410. }}
  411. />
  412. </View>
  413. )}
  414. <View style={styles.Categorycontain}>
  415. <View style={{ backgroundColor: '#FFF', height: 15 }} />
  416. {/* 提示栏 */}
  417. <Animated.View
  418. style={{
  419. width: width,
  420. backgroundColor: '#E14C46',
  421. position: 'absolute',
  422. zIndex: 1,
  423. opacity: this.state.noticeOpacity,
  424. justifyContent: 'center',
  425. alignItems: 'center',
  426. paddingTop: 10,
  427. paddingBottom: 10,
  428. }}
  429. >
  430. <Text style={{ color: '#FFF', fontSize: 12 }}>
  431. {'"' +
  432. this.state.noicename +
  433. '"' +
  434. '与其他已选项无法组成可售商品,请重选'}
  435. </Text>
  436. </Animated.View>
  437. <ScrollView
  438. style={{ flex: 1 }}
  439. keyboardShouldPersistTaps={'handled'}
  440. >
  441. {this.state.mockdata && this.state.mockdata.length > 0 ? (
  442. <Text style={{ fontSize: 14, lineHeight: 20, fontWeight: '600' }}>
  443. 规格选项
  444. </Text>
  445. ) : null}
  446. <FlatList
  447. keyExtractor={(item, index) => index}
  448. data={this.state.mockdata}
  449. extraData={this.state}
  450. // columnWrapperStyle={{ flexWrap: "wrap" }}
  451. //numColumns={2}
  452. //horizontal={false}
  453. renderItem={({ item }) => this._renderRow(item)}
  454. />
  455. {/* 选配 */}
  456. {/* {this.state.optionData && this.state.optionData.length > 0 ? (
  457. <Text
  458. style={{
  459. fontSize: 14,
  460. lineHeight: 20,
  461. fontWeight: '600',
  462. marginTop: 20,
  463. }}
  464. >
  465. 选配选项
  466. </Text>
  467. ) : null} */}
  468. <OptFlatList optionData={this.state.optionData} chooseColor={this._chooseColor.bind(this)}/>
  469. {/* <View style={{ marginTop: 15 }}>
  470. <Text style={{ color: '#999', fontSize: 14, marginBottom: 10 }}>
  471. 数量
  472. </Text>
  473. <View style={{ flexDirection: 'row' }}>
  474. <CountNum
  475. defaultValue={this.state.orderNum}
  476. fontSize={20}
  477. size={30}
  478. top={0}
  479. callback={nv => {
  480. this.state.orderNum = nv
  481. this.state.totalAmt = ScaleUtil(
  482. accMul(this.state.price, this.state.orderNum),
  483. CURRENCY.currencyAmountScale
  484. )
  485. this.setState({
  486. orderNum: nv,
  487. })
  488. }}
  489. />
  490. <Text
  491. style={{
  492. alignSelf: 'center',
  493. fontSize: 12,
  494. lineHeight: 17,
  495. letterSpacing: 0.14,
  496. color: '#999',
  497. marginLeft: 15,
  498. }}
  499. >
  500. 主数量
  501. </Text>
  502. <Text
  503. style={{
  504. alignSelf: 'center',
  505. fontSize: 12,
  506. lineHeight: 17,
  507. letterSpacing: 0.14,
  508. color: '#333',
  509. marginLeft: 4,
  510. marginTop: 2,
  511. }}
  512. >
  513. {accMul(this.state.orderNum, this.state.conversionRate)}
  514. </Text>
  515. </View>
  516. </View> */}
  517. </ScrollView>
  518. </View>
  519. <View
  520. style={{
  521. height: 45 + HEADERSTYLE.paddingBottom,
  522. paddingBottom: HEADERSTYLE.paddingBottom,
  523. backgroundColor: '#FFF',
  524. borderTopColor: '#ddd',
  525. borderTopWidth: 1 / PixelRatio.get(),
  526. flexDirection: 'row',
  527. justifyContent: 'space-between',
  528. }}
  529. >
  530. {/* 加入购物车 */}
  531. {this.state.submit ? (
  532. <View style={{ flex: 1, flexDirection: 'row' }}>
  533. <View
  534. style={{
  535. flex: 2,
  536. alignSelf: 'center',
  537. paddingLeft: 10,
  538. flexDirection: 'row',
  539. }}
  540. >
  541. <Text style={{ fontSize: 12, lineHeight: 17, color: '#333' }}>
  542. 订货金额:
  543. </Text>
  544. <Text
  545. style={{
  546. fontSize: 14,
  547. lineHeight: 20,
  548. letterSpacing: 0.17,
  549. color: '#E14C46',
  550. }}
  551. >
  552. {CURRENCY.currencySign}
  553. {this.state.totalAmt}
  554. </Text>
  555. </View>
  556. <TouchableOpacity
  557. onPress={() => this._submitOrder()}
  558. style={{
  559. flex: 1,
  560. backgroundColor: '#E14C46',
  561. }}
  562. >
  563. <View
  564. style={{
  565. flex: 1,
  566. alignSelf: 'center',
  567. justifyContent: 'center',
  568. }}
  569. >
  570. <Text
  571. style={{
  572. fontSize: 14,
  573. color: '#FFF',
  574. lineHeight: 20,
  575. }}
  576. >
  577. 加入购物车
  578. </Text>
  579. </View>
  580. </TouchableOpacity>
  581. </View>
  582. ) : this.state.optionData &&
  583. this.state.mockdata &&
  584. this.state.mockdata.length == 0 ? (
  585. <View style={{ flex: 1, flexDirection: 'row' }}>
  586. <View
  587. style={{
  588. flex: 2,
  589. alignSelf: 'center',
  590. paddingLeft: 10,
  591. flexDirection: 'row',
  592. }}
  593. >
  594. <Text style={{ fontSize: 12, lineHeight: 17, color: '#333' }}>
  595. 订货金额:
  596. </Text>
  597. <Text
  598. style={{
  599. fontSize: 14,
  600. lineHeight: 20,
  601. letterSpacing: 0.17,
  602. color: '#E14C46',
  603. }}
  604. >
  605. {CURRENCY.currencySign}
  606. {this.state.price}
  607. </Text>
  608. </View>
  609. <TouchableOpacity
  610. onPress={() => this._submitWithOutPloy()}
  611. style={{
  612. flex: 1,
  613. backgroundColor: this.state.optionData.chooseColor?'#E14C46':'gray',
  614. }}
  615. >
  616. <View
  617. style={{
  618. flex: 1,
  619. alignSelf: 'center',
  620. justifyContent: 'center',
  621. }}
  622. >
  623. <Text
  624. style={{
  625. fontSize: 14,
  626. color: '#FFF',
  627. lineHeight: 20,
  628. }}
  629. >
  630. 加入购物车
  631. </Text>
  632. </View>
  633. </TouchableOpacity>
  634. </View>
  635. ) : (
  636. <View style={{ flex: 1, flexDirection: 'row' }}>
  637. <View
  638. style={{
  639. flex: 2,
  640. alignSelf: 'center',
  641. paddingLeft: 10,
  642. flexDirection: 'row',
  643. }}
  644. >
  645. <Text style={{ fontSize: 12, lineHeight: 17, color: '#333' }}>
  646. 订货金额:
  647. </Text>
  648. <Text
  649. style={{
  650. fontSize: 14,
  651. lineHeight: 20,
  652. letterSpacing: 0.17,
  653. color: '#E14C46',
  654. }}
  655. >
  656. {CURRENCY.currencySign}
  657. {this.state.totalAmt}
  658. </Text>
  659. </View>
  660. <View
  661. style={{
  662. flex: 1,
  663. backgroundColor: '#969696',
  664. }}
  665. >
  666. <View
  667. style={{
  668. flex: 1,
  669. alignSelf: 'center',
  670. justifyContent: 'center',
  671. }}
  672. >
  673. <Text
  674. style={{
  675. fontSize: 14,
  676. color: '#FFF',
  677. lineHeight: 20,
  678. }}
  679. >
  680. 加入购物车
  681. </Text>
  682. </View>
  683. </View>
  684. </View>
  685. )}
  686. </View>
  687. </View>
  688. )
  689. }
  690. _openModalCate(va, data, showData, detailDatas,colorGroups) {
  691. let goodsAttrs = [],
  692. optionalAtts = [],
  693. obj = {},
  694. result = []
  695. this.setState({
  696. price: showData.price,
  697. picture: showData.picture,
  698. conversionRate: detailDatas.conversionRate,
  699. totalAmt: ScaleUtil(
  700. accMul(showData.price, this.state.orderNum),
  701. CURRENCY.currencyAmountScale
  702. ),
  703. })
  704. this.mdCategory._setModalVisible(va)
  705. goodsAttrs = detailDatas.goodsAttrVals.filter(item => !item.isOptionalAttr)
  706. optionalAtts = detailDatas.goodsAttrVals.filter(item => item.isOptionalAttr)
  707. if (data && Object.keys(data).length > 0) {
  708. this._defaultVfree(data, goodsAttrs)
  709. }
  710. // 对特征属性合并
  711. optionalAtts.map(item => {
  712. obj[item.productAttrId]
  713. ? obj[item.productAttrId].push(item)
  714. : (obj[item.productAttrId] = [].concat(item))
  715. })
  716. // productAttrId
  717. for (let i in obj) {
  718. result.push({
  719. name: obj[i].length > 0 && obj[i][0].name,
  720. typeCode: obj[i].length > 0 && obj[i][0].productAttrTypeCode,
  721. id: i,
  722. item: obj[i],
  723. colorGroups : colorGroups,
  724. goodsId: detailDatas.id,
  725. saleOrgId : detailDatas.saleOrgId
  726. })
  727. }
  728. this._defaultOptional(result);
  729. }
  730. closeModalCate() {
  731. this.mdCategory._setModalVisible(false)
  732. }
  733. _refreshdata(price, carouselInfos) {
  734. this.setState({
  735. // vcode: data.vcode,
  736. price: price,
  737. picture: carouselInfos,
  738. })
  739. }
  740. render() {
  741. return (
  742. <ModalEcx
  743. animationType={'fade'}
  744. ref={mdCategory => (this.mdCategory = mdCategory)}
  745. content={this._renderModalContent()}
  746. />
  747. )
  748. }
  749. }
  750. const styles = StyleSheet.create({
  751. contentBox: {
  752. height: '80%',
  753. width: '100%',
  754. bottom: 0,
  755. position: 'absolute',
  756. backgroundColor: 'transparent',
  757. },
  758. Categorycontain: {
  759. flex: 1,
  760. padding: 10,
  761. paddingTop: 0,
  762. backgroundColor: '#FFF',
  763. borderBottomColor: '#ddd',
  764. borderBottomWidth: 1 / PixelRatio.get(),
  765. },
  766. })