This commit is contained in:
2022-11-01 14:25:20 +08:00
parent 155791f117
commit 79c8bdd149

View File

@@ -16,11 +16,13 @@
</view>
<text class="setup-text" @tap="setup">设置</text>
</view>
<button class="login-btn" :disabled="disabled" @tap="toLogin">确认登录</button>
<button class="login-btn" :disabled="disabled" @tap="toLogin">确认登录</button>
<!-- <button class="login-btn" @tap="test">打印</button> -->
</view>
</template>
<script>
import {getCLodop, getPrinterList} from "@/utils/CLodopfuncs.js"
import { RSAencrypt } from '@/utils/jsencrypt.js'
import {handLogin} from '@/utils/api.js'
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
@@ -48,7 +50,19 @@
})
//#endif
},
methods: {
methods: {
test() {
let LODOP = getCLodop();
// 更换为打印服务器ip 不需要加前缀
LODOP.PRINT_INIT(null, "192.168.81.198");
// 打印机序号 规则为打印服务器打印机列表倒数从0开始 -1为默认打印机
LODOP.SET_PRINTER_INDEX(-1);
// 设置打印纸大小
LODOP.SET_PRINT_PAGESIZE(1, 800, 600, "");
// 根据需求插入打印代码
LODOP.PRINT(); // 打印
// LODOP.PREVIEW()
},
toSaveUser() {
this.saveUser = !this.saveUser
},