OrderDetail.js 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037
  1. import React, { Component } from 'react'
  2. import {
  3. StyleSheet,
  4. View,
  5. Image,
  6. ImageBackground,
  7. StatusBar,
  8. Text,
  9. TouchableOpacity,
  10. Dimensions,
  11. PixelRatio,
  12. ScrollView,
  13. FlatList,
  14. } from 'react-native'
  15. import { connect } from 'react-redux'
  16. import StatusBacg from '../../static/images/Order-status.png'
  17. import png from '../../static/images/defaultimg.jpg'
  18. import Icon from '../../components/Iconfont/Iconfont'
  19. import { NavigationActions, createAction } from '../../utils'
  20. import { ScaleUtil, ReturnDate, accSub } from '../../utils/utils'
  21. import redblue from '../../static/images/ic-redblue.png'
  22. import { ImageBaseUrl } from '../../utils/fetch/Fetchx'
  23. import { transrefFn } from '../common/datamodel/dataModel'
  24. const { width, height } = Dimensions.get('window')
  25. /**
  26. * TEMPORY_STORAGE("01","暂存","暂存"),
  27. * AUDIT_PENDING("02","待审核","待审核"),
  28. * DELIVERY_PENDING("03","待发货","待发货"),
  29. * SIGN_IN_PENDING("04","待签收","待签收"),
  30. * TRANS_COMPLETE("05","交易完成","交易完成"),
  31. * REJECT("06","驳回","驳回"),
  32. * CANCEL("07","取消","取消");
  33. */
  34. // [0]:暂存; [1]:待审核; [2]:待发货; [3]:待签收; [4]:交易完成; [5]:驳回; [6]:取消
  35. const iconArr = [
  36. 'icon-icon-zancun',
  37. 'icon-icon-dingdandaishenhe',
  38. 'icon-icon-dingdandaifahuo',
  39. 'icon-icon-dingdandaiqianshou',
  40. 'icon-icon-jiaoyiwancheng',
  41. 'icon-icon-dingdanbohui',
  42. 'icon-icon-dingdanquxiao',
  43. ]
  44. @connect(({ theme, orderdetail, orderlist }) => ({
  45. ...theme,
  46. ...orderdetail,
  47. ...orderlist,
  48. }))
  49. class OrderDetail extends Component {
  50. constructor() {
  51. super()
  52. this.state = {
  53. trackIndex: 0,
  54. trackName: '待发货',
  55. iconName: 'icon-icon-dingdan',
  56. }
  57. }
  58. componentDidMount = () => {
  59. // 订单跟踪开始偏移量
  60. trackOffset = 0
  61. if (this.state.trackIndex <= 2) {
  62. trackOffset = 0
  63. } else if (this.state.trackIndex == 3) {
  64. trackOffset = 120
  65. } else {
  66. trackOffset = 240
  67. }
  68. this._scrollView.scrollTo({
  69. x: trackOffset,
  70. y: 0,
  71. animated: true,
  72. })
  73. if (
  74. this.props.navigation.state.params &&
  75. Object.keys(this.props.navigation.state.params).indexOf('comeFrom') == -1
  76. ) {
  77. const {
  78. reqOrderItems,
  79. orderStatusCode,
  80. } = this.props.navigation.state.params.orderData
  81. // 每个商品行的 累计签收数量 - 累计退货数量 > 0 则可以进行整单退货 ---- signNum - returnNum >0
  82. if (
  83. orderStatusCode == '03' ||
  84. orderStatusCode == '04' ||
  85. (orderStatusCode == '05' &&
  86. reqOrderItems.some(
  87. item => accSub(item.signNum || 0, item.refundNum || 0) > 0
  88. ))
  89. ) {
  90. this.setState({ isReturn: true })
  91. }
  92. }
  93. }
  94. // 头部
  95. header(orderData) {
  96. console.log(orderData);
  97. return (
  98. <View
  99. style={{
  100. height: HEADERSTYLE.height,
  101. paddingTop: HEADERSTYLE.paddingTop + 5,
  102. backgroundColor: '#fff',
  103. borderBottomColor: '#eee',
  104. borderBottomWidth: 1 / PixelRatio.get(),
  105. }}
  106. >
  107. <View
  108. style={{
  109. flex: 1,
  110. justifyContent: 'center',
  111. }}
  112. >
  113. <TouchableOpacity
  114. style={{ position: 'absolute', left: 10, flexDirection: 'row' }}
  115. onPress={() => this.props.dispatch(NavigationActions.back())}
  116. >
  117. <Icon
  118. name="icon-icon-fanhui"
  119. size={20}
  120. color={'#666'}
  121. style={{ marginTop: 4 }}
  122. />
  123. <Text
  124. style={{
  125. fontSize: 14,
  126. lineHeight: 20,
  127. color: '#666',
  128. alignSelf: 'center',
  129. }}
  130. >
  131. 返回
  132. </Text>
  133. </TouchableOpacity>
  134. <Text
  135. style={{
  136. alignSelf: 'center',
  137. fontSize: 18,
  138. lineHeight: 25,
  139. letterSpacing: 0.19,
  140. color: '#333',
  141. }}
  142. >
  143. {this.props.navigation.state.params &&
  144. this.props.navigation.state.params.comeFrom &&
  145. this.props.navigation.state.params.comeFrom == 'Refund'
  146. ? '退货单详情'
  147. : '订单详情'}
  148. </Text>
  149. <TouchableOpacity
  150. style={{ position: 'absolute', right: 10 }}
  151. onPress={() => {
  152. this.setState({
  153. activeAllCollaps: !this.state.activeAllCollaps,
  154. })
  155. // this._info.setActive()
  156. this.copyToEdit(orderData)
  157. }}
  158. >
  159. <Text
  160. style={{
  161. fontSize: 14,
  162. lineHeight: 20,
  163. letterSpacing: 0.17,
  164. color: '#666',
  165. }}
  166. >
  167. 复制
  168. </Text>
  169. </TouchableOpacity>
  170. </View>
  171. </View>
  172. )
  173. }
  174. // 复制订单并跳转到编辑页
  175. async copyToEdit(item) {
  176. this.setState({ Loading: true })
  177. await this.props.dispatch(
  178. createAction('orderlist/copyFromReq')({
  179. id: item.id,
  180. })
  181. )
  182. this.setState({ Loading: false })
  183. const { copyData } = this.props
  184. let SaleOrSupplier = transrefFn(copyData, 'saleOrg'),
  185. billwayDefault = transrefFn(copyData, 'billWay'),
  186. transportDefault = transrefFn(copyData, 'transport')
  187. this.props.dispatch(
  188. NavigationActions.navigate({
  189. routeName: 'OrderEdit',
  190. params: {
  191. ShopData: copyData.reqOrderItems,
  192. data: copyData,
  193. SaleOrSupplier: SaleOrSupplier,
  194. reqOrderInvoice: copyData.reqOrderInvoice,
  195. reqOrderReceiveAddress: copyData.reqOrderReceiveAddress,
  196. transportDefault: transportDefault,
  197. billwayDefault: billwayDefault,
  198. comefrom: 'temporarily',
  199. },
  200. })
  201. )
  202. }
  203. // 流程跟踪
  204. processTrack(orderData) {
  205. let track = [],
  206. trackVal = orderData.reqOrderTracks.sort((a, b) => a.sort - b.sort)
  207. for (let i = 0; i < trackVal.length; i++) {
  208. if (trackVal[i].finish && trackVal[i + 1] && !trackVal[i + 1].finish) {
  209. this.state.trackIndex = i
  210. }
  211. if (i == trackVal.length - 1 && trackVal[i].finish) {
  212. this.state.trackIndex = i
  213. }
  214. track.push(
  215. <View key={i}>
  216. <View style={{ paddingBottom: 10 }}>
  217. <View
  218. style={{
  219. width: 120,
  220. height: 2,
  221. backgroundColor: trackVal[i].finish ? '#59C152' : '#EEE',
  222. marginTop: 8,
  223. }}
  224. />
  225. {this.state.trackIndex == i ? (
  226. <View
  227. style={{
  228. left: '45%',
  229. position: 'absolute',
  230. width: 20,
  231. height: 20,
  232. borderRadius: 10,
  233. backgroundColor: '#59C152',
  234. overflow: 'hidden',
  235. justifyContent: 'center',
  236. }}
  237. >
  238. <Text
  239. style={{ fontSize: 10, color: '#FFF', alignSelf: 'center' }}
  240. >
  241. </Text>
  242. </View>
  243. ) : (
  244. <View
  245. style={{
  246. left: '45%',
  247. position: 'absolute',
  248. width: 10,
  249. height: 10,
  250. backgroundColor: trackVal[i].finish ? '#59C152' : '#CCC',
  251. borderRadius: 7,
  252. marginTop: 4,
  253. }}
  254. />
  255. )}
  256. </View>
  257. <View style={{ paddingHorizontal: 5 }}>
  258. <Text
  259. style={{
  260. alignSelf: 'center',
  261. fontSize: 12,
  262. lineHeight: 17,
  263. color: '#333',
  264. }}
  265. >
  266. {trackVal[i].content}
  267. </Text>
  268. <Text
  269. style={{
  270. alignSelf: 'center',
  271. fontSize: 10,
  272. lineHeight: 14,
  273. letterSpacing: 0,
  274. color: '#666',
  275. letterSpacing: 0,
  276. }}
  277. >
  278. {/* {ReturnDate(trackVal[i].date)} */}
  279. {trackVal[i].finish ? ReturnDate(trackVal[i].operateTime) : ''}
  280. </Text>
  281. </View>
  282. </View>
  283. )
  284. }
  285. return track
  286. }
  287. // 底部按钮
  288. bottomTouch(orderData) {
  289. let ParamsOrder = orderData
  290. ParamsOrder.reqOrderItems.map(data => {
  291. if (data.signNum <= data.orderNum) {
  292. data.orderNum = data.signNum
  293. }
  294. })
  295. let touchArr = [],
  296. touchAtt = [
  297. {
  298. touchName: '退货',
  299. background: this.state.isReturn ? '#E70013' : '#969696',
  300. textColor: '#FFF',
  301. disabled: this.state.isReturn ? false : true,
  302. touchonpress: () => {
  303. // this.props.dispatch(
  304. // NavigationActions.navigate({
  305. // routeName: "ReturnApplication",
  306. // params: { orderData: JSON.parse(JSON.stringify(ParamsOrder)) }
  307. // })
  308. // );
  309. this.props.dispatch(
  310. createAction('orderlist/returnFromReq')({
  311. id: orderData.id,
  312. orderData: JSON.parse(JSON.stringify(ParamsOrder)),
  313. })
  314. )
  315. },
  316. },
  317. ]
  318. for (let i = 0; i < touchAtt.length; i++) {
  319. touchArr.push(
  320. <TouchableOpacity
  321. disabled={touchAtt[i].disabled}
  322. onPress={() =>
  323. touchAtt[i].touchonpress ? touchAtt[i].touchonpress() : {}
  324. }
  325. key={i}
  326. style={{
  327. flex: 1,
  328. borderTopColor: '#eee',
  329. borderTopWidth: 1 / PixelRatio.get(),
  330. backgroundColor: touchAtt[i].background,
  331. justifyContent: 'center',
  332. borderRightColor: '#eee',
  333. borderRightWidth: 1 / PixelRatio.get(),
  334. }}
  335. >
  336. <Text
  337. style={{
  338. fontSize: 14,
  339. lineHeight: 20,
  340. color: touchAtt[i].textColor,
  341. alignSelf: 'center',
  342. }}
  343. >
  344. {touchAtt[i].touchName}
  345. </Text>
  346. </TouchableOpacity>
  347. )
  348. }
  349. return touchArr
  350. }
  351. goodsInfo(item, index, comeFrom) {
  352. console.log(item);
  353. return (
  354. <View key={index}>
  355. <View
  356. style={{
  357. paddingHorizontal: 10,
  358. paddingVertical: 7,
  359. marginTop: 10,
  360. backgroundColor: '#FFF',
  361. }}
  362. >
  363. <View
  364. style={{
  365. paddingBottom: 10,
  366. flexDirection: 'row',
  367. borderBottomColor: '#DDD',
  368. borderBottomWidth: 1 / PixelRatio.get(),
  369. }}
  370. >
  371. <Image
  372. source={
  373. item.goodsImg ? { uri: ImageBaseUrl + item.goodsImg } : png
  374. }
  375. style={{ width: 60, height: 60 }}
  376. />
  377. <View style={{ marginLeft: 10, flex: 1 }}>
  378. <Text style={{ fontSize: 13, lineHeight: 18, color: '#333' }}>
  379. {item.goodsDisplayName || item.goodsName}
  380. </Text>
  381. <View
  382. style={{
  383. flexDirection: 'row',
  384. justifyContent: 'space-between',
  385. marginTop: 5,
  386. }}
  387. >
  388. {comeFrom && comeFrom == 'Refund' ? null : (
  389. <View>
  390. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  391. 编码:{item.goodsCode}
  392. </Text>
  393. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  394. 型号:{item.model?item.model:""}
  395. </Text>
  396. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  397. 规格:{item.specification?(item.specification.split("/")[0]+"/"+item.mainNumUnitName):""}
  398. </Text>
  399. </View>
  400. )}
  401. </View>
  402. <View
  403. style={{
  404. //flexDirection: 'row',
  405. //justifyContent: 'space-between',
  406. marginTop: 5,
  407. }}
  408. >
  409. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  410. {comeFrom && comeFrom == 'Refund'
  411. ? `单价${item.currencySign || ''}${item.salePrice}${
  412. item.mainNumUnitName ? '/' : ''
  413. }${item.mainNumUnitName || ''}`
  414. : `数量:${item.mainNum}${item.orderNumUnitName || ''}`}
  415. </Text>
  416. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  417. {'重量:'+(item.rowWeight?item.rowWeight:item.mainNum*item.weight)+'KG'}
  418. </Text>
  419. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  420. {comeFrom && comeFrom == 'Refund'
  421. ? `退货量:${item.orderNum}`:""}
  422. {/* : `主数量:${item.mainNum}${item.mainNumUnitName || ''}`} */}
  423. </Text>
  424. </View>
  425. </View>
  426. </View>
  427. {comeFrom && comeFrom == 'Refund' ? (
  428. <View
  429. style={{
  430. flexDirection: 'row',
  431. justifyContent: 'space-between',
  432. marginTop: 7,
  433. }}
  434. >
  435. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  436. 成交金额:<Text
  437. style={{ fontSize: 14, lineHeight: 17, color: '#E14C46' }}
  438. >
  439. {CURRENCY.currencySign}
  440. {item.dealAmount}
  441. </Text>
  442. </Text>
  443. <TouchableOpacity
  444. onPress={() =>
  445. this.props.dispatch(
  446. NavigationActions.navigate({
  447. routeName: 'ReturnDetail',
  448. params: { detailData: item },
  449. })
  450. )
  451. }
  452. style={{ flexDirection: 'row' }}
  453. >
  454. <Text style={{ fontSize: 13, lineHeight: 18, color: '#999' }}>
  455. 详情
  456. </Text>
  457. <Icon name="icon-icon-jianjinzhishiqi" size={18} />
  458. </TouchableOpacity>
  459. </View>
  460. ) : (
  461. <View
  462. style={{
  463. flexDirection: 'row',
  464. justifyContent: 'space-between',
  465. marginTop: 7,
  466. }}
  467. >
  468. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  469. 单价:<Text
  470. style={{ fontSize: 14, lineHeight: 17, color: '#666' }}
  471. >
  472. {`${item.currencySign || ''}${item.salePrice}${
  473. item.mainNumUnitName ? '/' : ''
  474. }${item.mainNumUnitName || ''}`}
  475. </Text>
  476. </Text>
  477. <Text style={{ fontSize: 12, lineHeight: 17, color: '#666' }}>
  478. 金额:<Text
  479. style={{ fontSize: 14, lineHeight: 17, color: '#E14C46' }}
  480. >
  481. {item.currencySign}
  482. {item.amount}
  483. </Text>
  484. </Text>
  485. </View>
  486. )}
  487. </View>
  488. </View>
  489. )
  490. }
  491. render() {
  492. let comeFrom,
  493. arr = [1, 2, 3, 4, 5],
  494. imageArr = []
  495. if (arr.length > 3) {
  496. imageArr = arr.slice(0, 3)
  497. } else {
  498. imageArr = arr
  499. }
  500. if (
  501. this.props.navigation.state.params &&
  502. this.props.navigation.state.params.comeFrom
  503. ) {
  504. comeFrom = this.props.navigation.state.params.comeFrom
  505. }
  506. const { orderData } = this.props.navigation.state.params
  507. return (
  508. <View
  509. style={[
  510. styles.container,
  511. { backgroundColor: '#F7F7F7' },
  512. // { backgroundColor: appTheme.backgroundColor }
  513. ]}
  514. >
  515. <StatusBar
  516. animated={true}
  517. // barStyle={appTheme.barStyle}
  518. barStyle={'dark-content'}
  519. backgroundColor={'transparent'}
  520. translucent={true}
  521. />
  522. {/* 头部 */}
  523. {this.header(orderData)}
  524. <ScrollView
  525. style={{ flex: 1 }}
  526. scrollEventThrottle={200}
  527. showsHorizontalScrollIndicator={false}
  528. >
  529. {/* 流程状态 */}
  530. <ImageBackground
  531. source={StatusBacg}
  532. style={{ width: width, height: 55, justifyContent: 'center' }}
  533. >
  534. <View
  535. style={{
  536. flexDirection: 'row',
  537. justifyContent: 'space-between',
  538. backgroundColor: 'transparent',
  539. paddingHorizontal: 15,
  540. marginTop: 3,
  541. }}
  542. >
  543. <View style={{ flexDirection: 'row' }}>
  544. <Icon
  545. name={
  546. orderData && orderData.orderStatusCode
  547. ? iconArr[parseFloat(orderData.orderStatusCode) - 1]
  548. : iconArr[0]
  549. }
  550. size={32}
  551. color={'#FFF'}
  552. style={{ marginTop: 5 }}
  553. />
  554. <Text
  555. style={{
  556. fontSize: 18,
  557. lineHeight: 25,
  558. color: '#FFF',
  559. fontWeight: 'bold',
  560. marginLeft: 5,
  561. alignSelf: 'center',
  562. }}
  563. >
  564. {orderData.orderStatusName}
  565. </Text>
  566. </View>
  567. <TouchableOpacity
  568. style={{ alignSelf: 'center' }}
  569. onPress={() =>
  570. this.props.dispatch(
  571. NavigationActions.navigate({
  572. routeName: 'OrderLog',
  573. params: {
  574. logData: orderData.reqOrderLogs.sort(
  575. (a, b) => b.creationTime - a.creationTime
  576. ),
  577. },
  578. })
  579. )
  580. }
  581. >
  582. <Text style={{ fontSize: 13, lineHeight: 17, color: '#FFF' }}>
  583. 操作详情>
  584. </Text>
  585. </TouchableOpacity>
  586. </View>
  587. </ImageBackground>
  588. {/* 流程跟踪 */}
  589. <View style={{ paddingHorizontal: 20, backgroundColor: '#FFF' }}>
  590. <ScrollView
  591. showsHorizontalScrollIndicator={false}
  592. ref={component => (this._scrollView = component)}
  593. horizontal={true}
  594. showsHorizontalScrollIndicator={false}
  595. overScrollMode={'auto'}
  596. style={{
  597. paddingVertical: 10,
  598. flexDirection: 'row',
  599. }}
  600. >
  601. {this.processTrack(orderData)}
  602. {/* {this.processTrack(orderData)} */}
  603. </ScrollView>
  604. </View>
  605. {/* 驳回理由 */}
  606. {/* {comeFrom && comeFrom == "Refund" ? (
  607. <View
  608. style={{
  609. padding: 10,
  610. backgroundColor: "#FFF",
  611. borderTopWidth: 1,
  612. borderTopColor: "#EEE"
  613. }}
  614. >
  615. <Text style={{ fontSize: 12, lineHeight: 17, color: "#333" }}>
  616. 驳回原因:由于商品已经出库,不能进行退货,等客户接收后请自行手工联系退货。
  617. </Text>
  618. </View>
  619. ) : null} */}
  620. {comeFrom && comeFrom == 'Refund' ? (
  621. <View
  622. style={{
  623. backgroundColor: '#FFF',
  624. marginTop: 10,
  625. padding: 10,
  626. flexDirection: 'row',
  627. justifyContent: 'space-between',
  628. }}
  629. >
  630. <Text style={{ fontSize: 14, lineHeight: 20, color: '#333' }}>
  631. 退货总金额
  632. </Text>
  633. <Text style={{ fontSize: 17, lineHeight: 25, color: '#E14C46' }}>
  634. {CURRENCY.currencySign}
  635. {ScaleUtil(orderData.totalReturnAmount)}
  636. </Text>
  637. </View>
  638. ) : null}
  639. {/* 选地址 */}
  640. {orderData.reqOrderReceiveAddress ? (
  641. <View
  642. style={{
  643. borderTopColor: '#EEE',
  644. borderTopWidth: 1 / PixelRatio.get(),
  645. backgroundColor: '#FFF',
  646. flexDirection: 'row',
  647. paddingTop: 10,
  648. paddingBottom: 5,
  649. }}
  650. >
  651. <View style={{ flex: 1, justifyContent: 'flex-end' }}>
  652. <Icon
  653. name="icon-icon-dizhi"
  654. size={24}
  655. color={'#333'}
  656. style={{ alignSelf: 'center' }}
  657. />
  658. </View>
  659. <View style={{ flex: 9, paddingRight: 10, paddingBottom: 5 }}>
  660. <View style={{ flexDirection: 'row' }}>
  661. <Text style={{ fontSize: 15, lineHeight: 21, color: '#333' }}>
  662. {orderData.reqOrderReceiveAddress.receiver}
  663. </Text>
  664. <Text style={{ marginLeft: 3, alignSelf: 'center' }}>
  665. {orderData.reqOrderReceiveAddress.receiverPhone}
  666. </Text>
  667. </View>
  668. <Text
  669. style={{
  670. marginTop: 4,
  671. fontSize: 13,
  672. lineHeight: 18,
  673. color: '#333',
  674. }}
  675. >
  676. {(orderData.reqOrderReceiveAddress.receiverProvince || '') +
  677. (orderData.reqOrderReceiveAddress.receiverCity || '') +
  678. (orderData.reqOrderReceiveAddress.receiverTown || '') +
  679. (orderData.reqOrderReceiveAddress.receiverAddress || '')}
  680. </Text>
  681. </View>
  682. </View>
  683. ) : null}
  684. {/* Image地址下边框 */}
  685. <Image source={redblue} style={{ height: 2, width: width }} />
  686. {/* 商品信息 */}
  687. <FlatList
  688. keyExtractor={(item, index) => index}
  689. data={orderData.reqOrderItems}
  690. extraData={this.state}
  691. renderItem={({ item, index }) =>
  692. this.goodsInfo(item, index, comeFrom)
  693. }
  694. />
  695. {/* 信息组 */}
  696. <View style={{ padding: 10, marginTop: 10, backgroundColor: '#FFF' }}>
  697. {/* 订单编号 */}
  698. <View
  699. style={{
  700. paddingBottom: 10,
  701. borderBottomColor: '#EEE',
  702. borderBottomWidth: 1,
  703. }}
  704. >
  705. <Text
  706. style={{
  707. fontSize: 13,
  708. lineHeight: 20,
  709. letterSpacing: 0.16,
  710. color: '#666',
  711. }}
  712. >
  713. {comeFrom && comeFrom == 'Refund'
  714. ? `退货单编号:${orderData.orderCode}`
  715. : `订单编号:${orderData.orderCode}`}
  716. </Text>
  717. </View>
  718. {/* 运输结算方式 */}
  719. <View
  720. style={{
  721. paddingVertical: 10,
  722. borderBottomColor: '#EEE',
  723. borderBottomWidth: 1,
  724. }}
  725. >
  726. <Text
  727. style={{
  728. fontSize: 13,
  729. lineHeight: 20,
  730. letterSpacing: 0.16,
  731. color: '#666',
  732. }}
  733. >
  734. 运输方式:{orderData.transportModeName}
  735. </Text>
  736. {/* <Text
  737. style={{
  738. fontSize: 13,
  739. lineHeight: 20,
  740. letterSpacing: 0.16,
  741. color: '#666',
  742. }}
  743. >
  744. 结算方式:{orderData.settleModeName}
  745. </Text> */}
  746. {/* <Text
  747. style={{
  748. fontSize: 13,
  749. lineHeight: 20,
  750. letterSpacing: 0.16,
  751. color: '#666',
  752. }}
  753. >
  754. 支付方式:{orderData.underPaymentModeName}
  755. </Text> */}
  756. </View>
  757. {/* 发票抬头类型 */}
  758. {orderData.reqOrderInvoice ? (
  759. <View
  760. style={{
  761. paddingVertical: 10,
  762. borderBottomColor: '#EEE',
  763. borderBottomWidth: 1,
  764. }}
  765. >
  766. <Text
  767. style={{
  768. fontSize: 13,
  769. lineHeight: 20,
  770. letterSpacing: 0.16,
  771. color: '#666',
  772. }}
  773. >
  774. 发票类型:{orderData.reqOrderInvoice.invoiceType}
  775. </Text>
  776. <Text
  777. style={{
  778. fontSize: 13,
  779. lineHeight: 20,
  780. letterSpacing: 0.16,
  781. color: '#666',
  782. }}
  783. >
  784. 发票抬头:{orderData.reqOrderInvoice.invoiceTitle}
  785. </Text>
  786. </View>
  787. ) : null}
  788. {/* 纳税人号、开户行、账号 */}
  789. {orderData.reqOrderInvoice ? (
  790. <View
  791. style={{
  792. paddingVertical: 10,
  793. borderBottomColor: '#EEE',
  794. borderBottomWidth: 1,
  795. }}
  796. >
  797. <Text
  798. style={{
  799. fontSize: 13,
  800. lineHeight: 20,
  801. letterSpacing: 0.16,
  802. color: '#666',
  803. }}
  804. >
  805. 纳税人号:{orderData.reqOrderInvoice.invoiceTaxId}
  806. </Text>
  807. <Text
  808. style={{
  809. fontSize: 13,
  810. lineHeight: 20,
  811. letterSpacing: 0.16,
  812. color: '#666',
  813. }}
  814. >
  815. 开户行:{(orderData.reqOrderInvoice.invoiceBank || '') +
  816. (orderData.reqOrderInvoice.invoiceSubBank || '')}
  817. </Text>
  818. <Text
  819. style={{
  820. fontSize: 13,
  821. lineHeight: 20,
  822. letterSpacing: 0.16,
  823. color: '#666',
  824. }}
  825. >
  826. 账号:{orderData.reqOrderInvoice.invoiceAccount}
  827. </Text>
  828. </View>
  829. ) : null}
  830. {/* 备注 */}
  831. <View
  832. style={{
  833. paddingTop: 10,
  834. }}
  835. >
  836. {comeFrom && comeFrom == 'Refund' ? (
  837. <View>
  838. {/* <Text
  839. style={{
  840. fontSize: 13,
  841. lineHeight: 20,
  842. letterSpacing: 0.16,
  843. color: "#666"
  844. }}
  845. >
  846. 退货日期:2018-05-06
  847. </Text> */}
  848. <Text
  849. style={{
  850. fontSize: 13,
  851. lineHeight: 20,
  852. letterSpacing: 0.16,
  853. color: '#666',
  854. }}
  855. >
  856. 退货原因:{orderData.returnReasonName}
  857. </Text>
  858. </View>
  859. ) : null}
  860. <Text
  861. style={{
  862. fontSize: 13,
  863. lineHeight: 20,
  864. letterSpacing: 0.16,
  865. color: '#666',
  866. }}
  867. >
  868. 备注:{orderData.remark}
  869. </Text>
  870. </View>
  871. </View>
  872. {/* 商品金额 */}
  873. {comeFrom && comeFrom == 'Refund' ? null : (
  874. <View
  875. style={{ marginTop: 10, padding: 10, backgroundColor: '#FFF' }}
  876. >
  877. <Text style={{ fontSize: 14, lineHeight: 20, color: '#666' }}>
  878. 商品金额:{orderData.currencySign}
  879. {orderData.totalAmount}
  880. </Text>
  881. <Text style={{ fontSize: 14, lineHeight: 20, color: '#666' }}>
  882. 订单总重量:{orderData.totalWeight+'KG'}
  883. </Text>
  884. {/* <Text style={{ fontSize: 14, lineHeight: 20, color: '#666' }}>
  885. 费用冲抵:{orderData.currencySign}
  886. {orderData.offsetAmount}
  887. </Text> */}
  888. <Text style={{ fontSize: 14, lineHeight: 20, color: '#666' }}>
  889. 订单总金额:<Text style={{ color: '#E14C46' }}>
  890. {orderData.currencySign}
  891. {orderData.totalDealAmount+(orderData.offsetAmount?orderData.offsetAmount:0)}
  892. </Text>
  893. </Text>
  894. </View>
  895. )}
  896. {/* 发货信息 */}
  897. {comeFrom && comeFrom == 'Refund' ? (
  898. <View
  899. style={{
  900. padding: 10,
  901. marginTop: 10,
  902. backgroundColor: '#FFF',
  903. }}
  904. >
  905. <Text
  906. style={{
  907. fontSize: 14,
  908. lineHeight: 20,
  909. letterSpacing: 0.17,
  910. color: '#333',
  911. }}
  912. >
  913. 退货照片
  914. </Text>
  915. <View style={{ flexDirection: 'row', paddingTop: 10 }}>
  916. {imageArr.map((item, index) => (
  917. <Image
  918. source={png}
  919. style={{ width: 80, height: 80, marginRight: 10 }}
  920. key={index}
  921. />
  922. ))}
  923. <Text
  924. style={{ fontSize: 16, alignSelf: 'center', color: '#999' }}
  925. >
  926. ......
  927. </Text>
  928. </View>
  929. </View>
  930. ) : null
  931. // (
  932. // <TouchableOpacity
  933. // style={{
  934. // padding: 10,
  935. // marginTop: 10,
  936. // backgroundColor: "#FFF",
  937. // flexDirection: "row",
  938. // justifyContent: "space-between"
  939. // }}
  940. // >
  941. // <Text
  942. // style={{
  943. // fontSize: 14,
  944. // lineHeight: 20,
  945. // letterSpacing: 0.17,
  946. // color: "#333"
  947. // }}
  948. // >
  949. // 发货信息
  950. // </Text>
  951. // <View style={{ flexDirection: "row" }}>
  952. // <Text
  953. // style={{
  954. // fontSize: 14,
  955. // lineHeight: 20,
  956. // letterSpacing: 0.17,
  957. // color: "#999"
  958. // }}
  959. // >
  960. // 查看详情
  961. // </Text>
  962. // <Icon
  963. // size={26}
  964. // color={"#CCC"}
  965. // name="icon-icon-jianjinzhishiqi"
  966. // style={{ marginTop: -2 }}
  967. // />
  968. // </View>
  969. // </TouchableOpacity>
  970. // )
  971. }
  972. </ScrollView>
  973. {/* 底部 */}
  974. {/* {comeFrom && comeFrom == 'Refund' ? null : (
  975. <View
  976. style={{
  977. height: 45,
  978. backgroundColor: '#FFF',
  979. flexDirection: 'row',
  980. }}
  981. >
  982. {this.bottomTouch(orderData)}
  983. </View>
  984. )} */}
  985. </View>
  986. )
  987. }
  988. }
  989. const styles = StyleSheet.create({
  990. container: {
  991. flex: 1,
  992. },
  993. text333: {
  994. fontSize: 14,
  995. lineHeight: 20,
  996. letterSpacing: 0.17,
  997. color: '#333',
  998. },
  999. text666: {
  1000. fontSize: 13,
  1001. lineHeight: 18,
  1002. color: '#666',
  1003. },
  1004. text666red: {
  1005. fontSize: 14,
  1006. lineHeight: 25,
  1007. color: '#E14C46',
  1008. },
  1009. text999: {
  1010. fontSize: 12,
  1011. lineHeight: 17,
  1012. color: '#999',
  1013. },
  1014. })
  1015. export default OrderDetail