From c058bcb643058243801e669a89baa51e1a2db5d4 Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期四, 27 四月 2023 16:57:13 +0800
Subject: [PATCH] #
---
pages/print/print.vue | 98 ++++++++++++++++++++++++++++---------------------
1 files changed, 56 insertions(+), 42 deletions(-)
diff --git a/pages/print/print.vue b/pages/print/print.vue
index ec0a463..101a7fc 100644
--- a/pages/print/print.vue
+++ b/pages/print/print.vue
@@ -1,6 +1,14 @@
<template>
<view>
- <button @click="connectBluetooth">connect</button>
+ <view class="print-model" :style="style">
+ <view class="display" :style="">
+ <table >
+ <tr><td>鏂欏彿</td><td>{{mat.matnr}}</td><td colspan="1" rowspan="2" style="width: 150px;"></td></tr>
+ <tr><td>鍟嗗搧</td><td colspan="1">{{mat.matkx}}</td></tr>
+ <tr><td>鏃ユ湡</td><td colspan="2">2023-04-24 15:25:32</td></tr>
+ </table>
+ </view>
+ </view>
</view>
</template>
@@ -8,51 +16,57 @@
export default {
data() {
return {
-
+ style: {height:'3px'},
+ mat: {matnr: '1200128-10055',matkx: 'X5S-4-M03/333'}
}
},
- methods: {
- connectBluetooth() {
- let that = this
- uni.openBluetoothAdapter({
- success(res) {
- console.log(res)
- uni.getBluetoothAdapterState({
- success(res) {
- console.log(res);
- if (!res.discovering) {
- uni.startBluetoothDevicesDiscovery({
- success(res) {
- console.log(res);
- uni.onBluetoothDeviceFound(devices => {
- console.log('寮�濮嬬洃鍚鎵惧埌鏂拌澶囩殑浜嬩欢');
- // this.$set(this.disabled, 3, false);
- uni.getBluetoothDevices({
- success: res => {
- this.newDeviceLoad = false;
- console.log('鑾峰彇钃濈墮璁惧鎴愬姛:' + res.errMsg);
- // console.log(JSON.stringify(res))
- },
- });
- });
- },
- fail(err) {
- console.log();
- }
- })
- }
- }
- })
- },
- })
- // 鐩戝惉钃濈墮璁惧鍒楄〃
-
- },
-
+ onShow() {
+ let getWindowInfo = uni.getWindowInfo()
+ console.log(getWindowInfo.screenHeight); //灞忓箷楂樺害
+ console.log(getWindowInfo.screenWidth); //灞忓箷瀹藉害
+ console.log(getWindowInfo.windowHeight); //鍙搷浣滈〉闈㈤珮搴�
+ console.log(getWindowInfo.windowWidth); //鍙搷浣滈〉闈㈠搴�
+ console.log(getWindowInfo);
+ console.log('鑾峰彇绐楀彛淇℃伅');
+ let height = (getWindowInfo.screenWidth + 10 ) * 48 / 74
+ console.log(height);
+ this.style.height = height + 'px'
+
}
}
</script>
<style>
-
-</style>
+ .print-model {
+ width: 100%;
+ /* background-color: #555555; */
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ .display {
+ width: 96%;
+ height: 96%;
+ border-radius: 5px;
+ background-color: #FFF;
+ box-shadow: #bdbdbd;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ }
+ .display-pak {
+ margin: 2%;
+ height: 92%;
+ border: 1px solid #8a8a8a;
+ }
+ table {
+ width: 92%;
+ height: 92%;
+ border: 0;
+ border-collapse: collapse;
+ }
+ td {
+ border: 1px solid #8a8a8a;
+ text-align: center;
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.1