Commit 1e03a8c7 by peii

分销开票对接

(cherry picked from commit e1710fdc)
parent 53607081
......@@ -57,3 +57,14 @@
&__text
color #444
&-disabled
@extend .row
background-color #ddd
width 100%
&__text
color #999
font-size 18px
font-family font_family_regular
margin-left 8px
......@@ -2,7 +2,7 @@
* @FilePath: /BoneHouse_Business_APP/src/pages/invoice/distribution/index.tsx
* @Author: peii
* @Date: 2021-12-27 09:59:21
* @LastEditTime: 2021-12-31 15:55:36
* @LastEditTime: 2022-01-04 10:53:48
* @LastEditors: peii
* @Vision: 1.0
* @Description: 分销开票申请
......@@ -11,7 +11,7 @@
// @ts-nocheck
import React, { Component } from 'react'
import { View, Text, TouchableOpacity, FlatList, Image } from 'react-native'
import { View, Text, TouchableOpacity, Image, ActivityIndicator } from 'react-native'
import { connect } from 'react-redux'
import * as R from 'ramda'
import { INavigation } from 'navigation'
......@@ -63,6 +63,7 @@ class Distribution extends Component<IProps, IState> {
sum: 0,
},
customers: [],
submitting: false,
}
componentDidMount() {
......@@ -275,15 +276,17 @@ class Distribution extends Component<IProps, IState> {
lines,
}
this.setState({ submitting: true })
const res = await api.postArInvoiceCreate(params)
this.setState({ submitting: false })
if (res.error_code) return
show('申请提交成功')
this.props.navigation.pop()
}
render() {
const title = this.props.navigation.getParam('title')
const { visible, loading, data, fresh, statistic } = this.state
const { visible, loading, data, fresh, statistic, submitting } = this.state
return (
<View style={g(styles, 'container')}>
......@@ -331,13 +334,20 @@ class Distribution extends Component<IProps, IState> {
<Text style={g(styles, 'body-ft-statistic__text')}>申请开票总金额: {statistic.sum}</Text>
</View>
<View style={g(styles, 'body-ft-btn')}>
<TouchableOpacity
style={g(styles, 'btn', 'btn-submit')}
activeOpacity={0.8}
onPress={this.submitHandler}
>
<Text style={g(styles, 'btn__text', 'btn-submit__text')}>申请开票</Text>
</TouchableOpacity>
{!submitting ? (
<TouchableOpacity
style={g(styles, 'btn', 'btn-submit')}
activeOpacity={0.8}
onPress={this.submitHandler}
>
<Text style={g(styles, 'btn__text', 'btn-submit__text')}>申请开票</Text>
</TouchableOpacity>
) : (
<TouchableOpacity style={g(styles, 'btn', 'btn-disabled')} activeOpacity={1}>
<ActivityIndicator style={g(styles, 'btn-indicator')}></ActivityIndicator>
<Text style={g(styles, 'btn__text', 'btn-disabled__text')}>申请开票</Text>
</TouchableOpacity>
)}
{/* <TouchableOpacity
style={g(styles, 'btn', 'btn-select')}
activeOpacity={0.8}
......
......@@ -123,6 +123,9 @@ export const request = (args: Partial<RequestConfig>) => {
return doRequest()
}
failHandler(e, pid)
if (!e.error_code) {
e.error_code = e.status
}
reject(e)
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment