add relaunch ticketdetail after changing it
parent
4640f89ea8
commit
cd3064c90f
|
|
@ -28,13 +28,11 @@ interface TicketDetailState {
|
||||||
id: number;
|
id: number;
|
||||||
isMember: boolean;
|
isMember: boolean;
|
||||||
showOreoModal: boolean;
|
showOreoModal: boolean;
|
||||||
showCommentModal: boolean;
|
showCommentLayout: boolean;
|
||||||
showRetrieveModal: boolean;
|
showRetrieveModal: boolean;
|
||||||
showStatusSheet: boolean;
|
showStatusSheet: boolean;
|
||||||
showPickModal: boolean;
|
showPickModal: boolean;
|
||||||
comment: string;
|
comment: string;
|
||||||
isLoading: boolean;
|
|
||||||
isDisable: boolean;
|
|
||||||
isOreoLoading: boolean;
|
isOreoLoading: boolean;
|
||||||
isOreoDisable: boolean;
|
isOreoDisable: boolean;
|
||||||
isPickLoading: boolean;
|
isPickLoading: boolean;
|
||||||
|
|
@ -43,6 +41,8 @@ interface TicketDetailState {
|
||||||
isRetrieveDisable: boolean;
|
isRetrieveDisable: boolean;
|
||||||
isStatusLoading: boolean;
|
isStatusLoading: boolean;
|
||||||
isStatusDisable: boolean;
|
isStatusDisable: boolean;
|
||||||
|
isCommentLoading: boolean;
|
||||||
|
isCommentDisable: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class TicketDetail extends Component<{}, TicketDetailState> {
|
export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
|
|
@ -50,13 +50,11 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
id: 0,
|
id: 0,
|
||||||
isMember: false,
|
isMember: false,
|
||||||
showOreoModal: false,
|
showOreoModal: false,
|
||||||
showCommentModal: false,
|
showCommentLayout: false,
|
||||||
showRetrieveModal: false,
|
showRetrieveModal: false,
|
||||||
showStatusSheet: false,
|
showStatusSheet: false,
|
||||||
showPickModal: false,
|
showPickModal: false,
|
||||||
comment: '',
|
comment: '',
|
||||||
isLoading: false,
|
|
||||||
isDisable: false,
|
|
||||||
isOreoLoading: false,
|
isOreoLoading: false,
|
||||||
isOreoDisable: false,
|
isOreoDisable: false,
|
||||||
isPickLoading: false,
|
isPickLoading: false,
|
||||||
|
|
@ -65,6 +63,8 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
isRetrieveDisable: false,
|
isRetrieveDisable: false,
|
||||||
isStatusLoading: false,
|
isStatusLoading: false,
|
||||||
isStatusDisable: false,
|
isStatusDisable: false,
|
||||||
|
isCommentLoading: false,
|
||||||
|
isCommentDisable: false,
|
||||||
};
|
};
|
||||||
|
|
||||||
componentDidMount(): void {
|
componentDidMount(): void {
|
||||||
|
|
@ -84,7 +84,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
|
|
||||||
onAddComment(): void {
|
onAddComment(): void {
|
||||||
this.setState({
|
this.setState({
|
||||||
showCommentModal: true,
|
showCommentLayout: true,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -114,7 +114,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
|
|
||||||
handleCommentCancel(): void {
|
handleCommentCancel(): void {
|
||||||
this.setState({
|
this.setState({
|
||||||
showCommentModal: false,
|
showCommentLayout: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -201,7 +201,8 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
|
|
||||||
onCommentSubmit() {
|
onCommentSubmit() {
|
||||||
this.setState({
|
this.setState({
|
||||||
isDisable: true,
|
isCommentDisable: true,
|
||||||
|
showCommentLayout: false,
|
||||||
});
|
});
|
||||||
if (this.state.comment == '') {
|
if (this.state.comment == '') {
|
||||||
Taro.atMessage({
|
Taro.atMessage({
|
||||||
|
|
@ -210,7 +211,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isDisable: false,
|
isCommentDisable: false,
|
||||||
});
|
});
|
||||||
}, submitInterval);
|
}, submitInterval);
|
||||||
return;
|
return;
|
||||||
|
|
@ -218,7 +219,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
submitComment(this);
|
submitComment(this);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.setState({
|
this.setState({
|
||||||
isDisable: false,
|
isCommentDisable: false,
|
||||||
});
|
});
|
||||||
}, submitInterval);
|
}, submitInterval);
|
||||||
}
|
}
|
||||||
|
|
@ -278,7 +279,12 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
className='at-col'
|
className='at-col'
|
||||||
style={{ marginLeft: 10, paddingRight: 5, width: '50%' }}
|
style={{ marginLeft: 10, paddingRight: 5, width: '50%' }}
|
||||||
>
|
>
|
||||||
<AtButton type='secondary' onClick={this.onAddComment.bind(this)}>
|
<AtButton
|
||||||
|
disabled={this.state.isCommentDisable}
|
||||||
|
loading={this.state.isCommentLoading}
|
||||||
|
type='secondary'
|
||||||
|
onClick={this.onAddComment.bind(this)}
|
||||||
|
>
|
||||||
{pt.get().ticketDetail.addNote}
|
{pt.get().ticketDetail.addNote}
|
||||||
</AtButton>
|
</AtButton>
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -306,7 +312,12 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
className='at-col'
|
className='at-col'
|
||||||
style={{ marginRight: 10, paddingLeft: 5, width: '50%' }}
|
style={{ marginRight: 10, paddingLeft: 5, width: '50%' }}
|
||||||
>
|
>
|
||||||
<AtButton type='secondary' onClick={this.onAddComment.bind(this)}>
|
<AtButton
|
||||||
|
disabled={this.state.isCommentDisable}
|
||||||
|
loading={this.state.isCommentLoading}
|
||||||
|
type='secondary'
|
||||||
|
onClick={this.onAddComment.bind(this)}
|
||||||
|
>
|
||||||
{pt.get().ticketDetail.addNote}
|
{pt.get().ticketDetail.addNote}
|
||||||
</AtButton>
|
</AtButton>
|
||||||
</View>
|
</View>
|
||||||
|
|
@ -354,12 +365,11 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
content={pt.get().modal.pick.content}
|
content={pt.get().modal.pick.content}
|
||||||
/>
|
/>
|
||||||
<AtFloatLayout
|
<AtFloatLayout
|
||||||
isOpened={this.state.showCommentModal}
|
isOpened={this.state.showCommentLayout}
|
||||||
title={pt.get().ticketDetail.comment.title}
|
title={pt.get().ticketDetail.comment.title}
|
||||||
onClose={this.handleCommentCancel.bind(this)}
|
onClose={this.handleCommentCancel.bind(this)}
|
||||||
>
|
>
|
||||||
<AtForm onSubmit={this.onCommentSubmit.bind(this)}>
|
<AtForm onSubmit={this.onCommentSubmit.bind(this)}>
|
||||||
<AtMessage />
|
|
||||||
<AtTextarea
|
<AtTextarea
|
||||||
value={this.state.comment}
|
value={this.state.comment}
|
||||||
onChange={this.handleCommentChange.bind(this)}
|
onChange={this.handleCommentChange.bind(this)}
|
||||||
|
|
@ -367,12 +377,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
|
||||||
height={200}
|
height={200}
|
||||||
placeholder={pt.get().ticketDetail.comment.placeholder}
|
placeholder={pt.get().ticketDetail.comment.placeholder}
|
||||||
/>
|
/>
|
||||||
<AtButton
|
<AtButton formType='submit' type='primary'>
|
||||||
loading={this.state.isLoading}
|
|
||||||
formType='submit'
|
|
||||||
type='primary'
|
|
||||||
disabled={this.state.isDisable}
|
|
||||||
>
|
|
||||||
{pt.get().button.buttonText.submit}
|
{pt.get().button.buttonText.submit}
|
||||||
</AtButton>
|
</AtButton>
|
||||||
</AtForm>
|
</AtForm>
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import Taro from '@tarojs/taro';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import { getUrl } from '.';
|
import { getUrl } from '.';
|
||||||
|
|
||||||
|
const reLaunchInterval = 1000;
|
||||||
|
|
||||||
export function changeStatus(that: TicketDetail, status: number) {
|
export function changeStatus(that: TicketDetail, status: number) {
|
||||||
that.setState({
|
that.setState({
|
||||||
isStatusLoading: true,
|
isStatusLoading: true,
|
||||||
|
|
@ -25,6 +27,11 @@ export function changeStatus(that: TicketDetail, status: number) {
|
||||||
message: pt.get().button.submitText.success,
|
message: pt.get().button.submitText.success,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.reLaunch({
|
||||||
|
url: '/pages/TicketDetail/TicketDetail?id=' + that.state.id,
|
||||||
|
});
|
||||||
|
}, reLaunchInterval);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import Taro from '@tarojs/taro';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import { getUrl } from '.';
|
import { getUrl } from '.';
|
||||||
|
|
||||||
|
const reLaunchInterval = 1000;
|
||||||
|
|
||||||
export function retrieve(that: TicketDetail) {
|
export function retrieve(that: TicketDetail) {
|
||||||
that.setState({
|
that.setState({
|
||||||
isRetrieveLoading: true,
|
isRetrieveLoading: true,
|
||||||
|
|
@ -24,6 +26,11 @@ export function retrieve(that: TicketDetail) {
|
||||||
message: pt.get().button.submitText.success,
|
message: pt.get().button.submitText.success,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.reLaunch({
|
||||||
|
url: '/pages/TicketDetail/TicketDetail?id=' + that.state.id,
|
||||||
|
});
|
||||||
|
}, reLaunchInterval);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,11 @@ import Taro from '@tarojs/taro';
|
||||||
import pt from '@/plain-text';
|
import pt from '@/plain-text';
|
||||||
import { getUrl } from '.';
|
import { getUrl } from '.';
|
||||||
|
|
||||||
|
const reLaunchInterval = 1000;
|
||||||
|
|
||||||
export function submitComment(that: TicketDetail) {
|
export function submitComment(that: TicketDetail) {
|
||||||
that.setState({
|
that.setState({
|
||||||
isLoading: true,
|
isCommentLoading: true,
|
||||||
});
|
});
|
||||||
Taro.request({
|
Taro.request({
|
||||||
url: getUrl('/report'),
|
url: getUrl('/report'),
|
||||||
|
|
@ -18,17 +20,22 @@ export function submitComment(that: TicketDetail) {
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log(res.data);
|
console.log(res.data);
|
||||||
that.setState({
|
that.setState({
|
||||||
isLoading: false,
|
isCommentLoading: false,
|
||||||
});
|
});
|
||||||
Taro.atMessage({
|
Taro.atMessage({
|
||||||
message: pt.get().button.submitText.success,
|
message: pt.get().button.submitText.success,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
});
|
});
|
||||||
|
setTimeout(() => {
|
||||||
|
Taro.reLaunch({
|
||||||
|
url: '/pages/TicketDetail/TicketDetail?id=' + that.state.id,
|
||||||
|
});
|
||||||
|
}, reLaunchInterval);
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
that.setState({
|
that.setState({
|
||||||
isLoading: false,
|
isCommentLoading: false,
|
||||||
});
|
});
|
||||||
Taro.atMessage({
|
Taro.atMessage({
|
||||||
message: pt.get().button.submitText.error + err.toString(),
|
message: pt.get().button.submitText.error + err.toString(),
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue