|
@@ -464,10 +464,14 @@ const handleSubmit = async()=>{
|
|
|
// print("#printMe")
|
|
|
// 打印成功后调用/userPrescription/sendToUser
|
|
|
|
|
|
- // #ifdef APP-PLUS
|
|
|
- const ret = printerTsc()
|
|
|
- console.log('直接调用接口,然后打印',ret)
|
|
|
- // #endif
|
|
|
+ if(initPrint){
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ const ret = printerTsc()
|
|
|
+ console.log('ret',ret)
|
|
|
+ // #endif
|
|
|
+ } else {
|
|
|
+ uni.$showMsg('打印失败,打印机未连接,请先连接打印机', 2000)
|
|
|
+ }
|
|
|
|
|
|
const res = await sendToUser({
|
|
|
token: uni.getStorageSync('token'),
|
|
@@ -487,11 +491,16 @@ const handleSubmit = async()=>{
|
|
|
|
|
|
const dialogConfirm = async()=>{
|
|
|
console.log('dialogConfirm直接调用接口,然后打印')
|
|
|
+ const initPrint = uni.getStorageSync('initPrint')
|
|
|
+ if(initPrint){
|
|
|
+ // #ifdef APP-PLUS
|
|
|
+ const ret = printerTsc()
|
|
|
+ console.log('ret',ret)
|
|
|
+ // #endif
|
|
|
+ } else {
|
|
|
+ uni.$showMsg('打印失败,打印机未连接,请先连接打印机', 2000)
|
|
|
+ }
|
|
|
|
|
|
- // #ifdef APP-PLUS
|
|
|
- const ret = printerTsc()
|
|
|
- console.log('ret',ret)
|
|
|
- // #endif
|
|
|
|
|
|
// 打印成功后调用/userPrescription/sendToUser
|
|
|
const res = await sendToUser({
|