打印
This commit is contained in:
@@ -17,10 +17,12 @@
|
|||||||
<text class="setup-text" @tap="setup">设置</text>
|
<text class="setup-text" @tap="setup">设置</text>
|
||||||
</view>
|
</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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import {getCLodop, getPrinterList} from "@/utils/CLodopfuncs.js"
|
||||||
import { RSAencrypt } from '@/utils/jsencrypt.js'
|
import { RSAencrypt } from '@/utils/jsencrypt.js'
|
||||||
import {handLogin} from '@/utils/api.js'
|
import {handLogin} from '@/utils/api.js'
|
||||||
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
|
import checkUpdate from '@/uni_modules/uni-upgrade-center-app/utils/check-update'
|
||||||
@@ -49,6 +51,18 @@
|
|||||||
//#endif
|
//#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() {
|
toSaveUser() {
|
||||||
this.saveUser = !this.saveUser
|
this.saveUser = !this.saveUser
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user