优化
This commit is contained in:
@@ -125,11 +125,11 @@ function skuConfirm(e) {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 14px;
|
||||
gap: 16px;
|
||||
|
||||
.item {
|
||||
width: 70px;
|
||||
height: 30px;
|
||||
height: 34px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
@@ -39,8 +39,7 @@
|
||||
<div class="item">
|
||||
<div class="dot" v-if="item.orderCount">{{ item.orderCount }}</div>
|
||||
<div class="cover" v-if="shopListType == 'img'">
|
||||
<el-image :src="item.coverImg" style="width: 100%;height: 100%;background-color: #efefef;"
|
||||
fit="contain"></el-image>
|
||||
<el-image :src="item.coverImg" class="el_img" fit="cover"></el-image>
|
||||
</div>
|
||||
<div class="name"><el-text line-clamp="2">{{ item.name }}</el-text></div>
|
||||
<div class="item_empty" v-if="shopListType == 'text'"></div>
|
||||
@@ -330,7 +329,17 @@ defineExpose({
|
||||
|
||||
.cover {
|
||||
width: 100%;
|
||||
height: 80px;
|
||||
padding-bottom: 100%;
|
||||
position: relative;
|
||||
|
||||
.el_img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: #efefef;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.name {
|
||||
|
||||
@@ -104,6 +104,11 @@
|
||||
<pendingCartModal ref="pendingCartModalRef" @select="pendingCartHandle" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: 'home'
|
||||
}
|
||||
</script>
|
||||
<script setup>
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useUser } from "@/store/user.js"
|
||||
|
||||
@@ -1,37 +1,20 @@
|
||||
<template>
|
||||
<el-button @click="chooseSerial">选择扫码枪串口</el-button>
|
||||
<el-input ref="inputRef" v-model="printValue" @keyup.enter="enterHandle" @input="inputHandle"></el-input>
|
||||
<el-button @click="chooseSerial">打印</el-button>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import _ from 'lodash'
|
||||
import { ref, onMounted } from 'vue';
|
||||
|
||||
const inputRef = ref(null)
|
||||
|
||||
const printValue = ref('')
|
||||
|
||||
function enterHandle() {
|
||||
console.log('回车了')
|
||||
}
|
||||
|
||||
const inputHandle = _.debounce(function (e) {
|
||||
console.log('扫码枪输入完了', e)
|
||||
}, 100)
|
||||
import { ipcRenderer } from 'electron'
|
||||
|
||||
//选择串口设备
|
||||
const chooseSerial = async () => {
|
||||
if ('serial' in navigator) {
|
||||
// await port.close();
|
||||
console.log('当前浏览器支持serial')
|
||||
const port = await navigator.serial.requestPort()
|
||||
await port.open({ baudRate: 9600 })
|
||||
let printNum = localStorage.getItem('printNum')
|
||||
if (!printNum) {
|
||||
printNum = 1
|
||||
localStorage.setItem('printNum', printNum)
|
||||
} else {
|
||||
printNum++
|
||||
localStorage.setItem('printNum', printNum)
|
||||
}
|
||||
ipcRenderer.send('printStart', printNum)
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
inputRef.value.focus()
|
||||
}, 1000)
|
||||
})
|
||||
</script>
|
||||
@@ -72,9 +72,9 @@ const loading = ref(false);
|
||||
const form = reactive({
|
||||
serialNumber: RandomNumBoth(1000, 9999),
|
||||
clientType: 'pc',
|
||||
merchantName: '18821670757',
|
||||
loginName: "18821670757",
|
||||
password: "123456",
|
||||
merchantName: '',
|
||||
loginName: "",
|
||||
password: "",
|
||||
});
|
||||
|
||||
const rules = reactive({
|
||||
|
||||
Reference in New Issue
Block a user