other means
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
import {View, Text, Image, StyleSheet, Button, TouchableOpacity} from "react-native";
|
||||
import {View, Image, StyleSheet, TouchableOpacity} from "react-native";
|
||||
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions";
|
||||
import DText from "../../components/DText/DText";
|
||||
import {RFPercentage} from "react-native-responsive-fontsize";
|
||||
import DTitle from "../../components/DTitle/DTitle";
|
||||
import BasicButton from "../../components/BasicButton/BasicButton";
|
||||
import Hyperlink from "../../components/Hyperlink/Hyperlink";
|
||||
import React, {FC, useEffect, useState} from "react";
|
||||
import userApi from "../../api/userApi";
|
||||
import {StatusBar} from "expo-status-bar";
|
||||
import * as Progress from 'react-native-progress';
|
||||
import {useDispatch, useSelector} from "react-redux";
|
||||
import {RootState} from "../../redux/store";
|
||||
import {closeLoadingModal, openLoadingModal, setLoadingText} from "../../features/loadingModal/loadingModalSlice";
|
||||
@@ -182,13 +178,14 @@ const OrderScreen: FC<OrderScreenProps> = ({order}) => {
|
||||
}
|
||||
const printLabel = () => {
|
||||
if (!order) return;
|
||||
let printer = printingService.getInstance().getPrinter(order.baseMarketplace);
|
||||
dispatch(setLoadingText('Идет печать этикетки...'))
|
||||
dispatch(openLoadingModal())
|
||||
printingApi.getLabel(order.databaseId).then(pdfData => {
|
||||
printingService.getInstance().printPdf('wildberries', pdfData).then((response) => {
|
||||
printingService.getInstance().printPdf(printer, pdfData).then((response) => {
|
||||
dispatch(closeLoadingModal());
|
||||
if (response) return;
|
||||
dispatch(setPrinterName({printerName: 'wildberries'}));
|
||||
dispatch(setPrinterName({printerName: printer}));
|
||||
dispatch(openReprintModal());
|
||||
});
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user