当前位置:网站首页>[uniapp native plug-in] shangmi cashbox plug-in

[uniapp native plug-in] shangmi cashbox plug-in

2022-06-11 22:13:00 Tellsea

Shangmi cashbox plug-in

Plug in requirements

Before using plug-ins , Please use the trial version first , Debug locally , See if the plug-in meets , And then buy . If the plug-in doesn't meet your needs , You can contact me , Try to modify the plug-in or add functions , To help implement your business logic .

The plugin is introduced

As long as it is a cashbox connected to shangmi equipment , You can use this plug-in to open the cashbox , The cashbox does not limit the brand

Use cases

Get plug-ins

//  Shangmi cashbox plug-in 
let sunmiCashboxPlugin = uni.requireNativePlugin('Tellsea-SunmiCashboxPlugin');
console.log(' Shangmi cashbox plug-in :' + JSON.stringify(sunmiCashboxPlugin));

Connection service

//  Connection service 
connect() {
    
    sunmiPrinterPlugin.connect((e) => {
    
        let res = JSON.parse(e);
        console.log(res);
        if (res.code == 200) {
    
            that.$msg(res.msg);
        } else {
    
            that.$msg(res.msg);
        }
    });
},

Disconnect service

//  Disconnect service 
disconnect() {
    
    sunmiPrinterPlugin.disconnect((e) => {
    
        let res = JSON.parse(e);
        console.log(res);
        if (res.code == 200) {
    
            that.$msg(res.msg);
        } else {
    
            that.$msg(res.msg);
        }
    });
},

Open the money box

//  Open the money box 
openDrawer() {
    
    sunmiCashboxPlugin.openDrawer((e) => {
    
        let res = JSON.parse(e);
        console.log(res);
        if (res.code == 200) {
    
            that.$msg(res.msg);
        } else {
    
            that.$msg(res.msg);
        }
    });
},
原网站

版权声明
本文为[Tellsea]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/162/202206112200336711.html