fix: request without token; request before getting id in detailframework

mgy
Dawn1Ocean 2024-04-23 10:17:02 +08:00
parent 8b2ed25109
commit 86398ff9a9
3 changed files with 18 additions and 5 deletions

View File

@ -50,6 +50,7 @@ interface TicketDetailState {
comment: boolean; comment: boolean;
status: boolean; status: boolean;
reminder: boolean; reminder: boolean;
framework: boolean;
}; };
isDisable: { isDisable: {
oreo: boolean; oreo: boolean;
@ -94,6 +95,7 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
comment: false, comment: false,
status: false, status: false,
reminder: false, reminder: false,
framework: true,
}, },
isDisable: { isDisable: {
oreo: false, oreo: false,
@ -122,6 +124,12 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
isMember: wechatUser.getAccess(), isMember: wechatUser.getAccess(),
}); });
getDisable(this, id); getDisable(this, id);
this.setState({
isLoading: {
...this.state.isLoading,
framework: false,
},
});
} }
onAddToOreo(): void { onAddToOreo(): void {
@ -675,11 +683,13 @@ export default class TicketDetail extends Component<{}, TicketDetailState> {
> >
{sheetItemsRenderer} {sheetItemsRenderer}
</AtActionSheet> </AtActionSheet>
{!this.state.isLoading.framework && (
<DetailFramework <DetailFramework
middleButton={middleButton} middleButton={middleButton}
id={this.state.id} id={this.state.id}
isInfoShow={isInfoShow} isInfoShow={isInfoShow}
/> />
)}
<PageFooter /> <PageFooter />
</View> </View>
); );

View File

@ -9,6 +9,7 @@ export function getDisable(that: TicketDetail, id: number) {
method: 'GET', method: 'GET',
data: { data: {
id: id, id: id,
token: wechatUser.getToken(),
}, },
}) })
.then((res) => { .then((res) => {

View File

@ -4,6 +4,7 @@ import Taro from '@tarojs/taro';
import moment from 'moment'; import moment from 'moment';
import { FixStatus } from '@/common'; import { FixStatus } from '@/common';
import pt from '@/plain-text'; import pt from '@/plain-text';
import wechatUser from '@/wechat';
import { getUrl } from '.'; import { getUrl } from '.';
const mapStatusStep: Map<FixStatus, 0 | 1 | 2 | 3> = new Map([ const mapStatusStep: Map<FixStatus, 0 | 1 | 2 | 3> = new Map([
@ -23,6 +24,7 @@ export function getTicketInfo(that: DetailFramework, id: number) {
method: 'GET', method: 'GET',
data: { data: {
id: id, id: id,
token: wechatUser.getToken(),
}, },
}) })
.then((res) => { .then((res) => {