This commit is contained in:
parent
bcdf4a5b73
commit
69a74cc416
|
|
@ -2,7 +2,7 @@
|
||||||
ENV = development
|
ENV = development
|
||||||
|
|
||||||
# 测试
|
# 测试
|
||||||
# VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
|
VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
|
||||||
|
|
||||||
# 阿伟
|
# 阿伟
|
||||||
# VITE_API_URL = 'http://192.168.2.96:10587/cashier-client'
|
# VITE_API_URL = 'http://192.168.2.96:10587/cashier-client'
|
||||||
|
|
@ -11,4 +11,4 @@ ENV = development
|
||||||
# VITE_API_URL = 'http://192.168.2.41:10587/cashier-client'
|
# VITE_API_URL = 'http://192.168.2.41:10587/cashier-client'
|
||||||
|
|
||||||
# 正式
|
# 正式
|
||||||
VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client'
|
# VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client'
|
||||||
|
|
@ -2,4 +2,7 @@
|
||||||
ENV = production
|
ENV = production
|
||||||
|
|
||||||
# 线上环境接口地址
|
# 线上环境接口地址
|
||||||
VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'
|
# VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'
|
||||||
|
|
||||||
|
# 测试
|
||||||
|
VITE_API_URL = 'https://cashier-client.sxczgkj.cn/cashier-client'
|
||||||
|
|
@ -1,86 +1 @@
|
||||||
"use strict";
|
"use strict";const s=require("path"),e=require("electron");let t;e.app.whenReady().then(()=>{t=new e.BrowserWindow({title:"银收客",width:1024,height:768,fullscreenable:!0,fullscreen:!process.env.VITE_DEV_SERVER_URL,simpleFullscreen:!0,frame:!!process.env.VITE_DEV_SERVER_URL,webPreferences:{nodeIntegration:!0,contextIsolation:!1}}),process.env.VITE_DEV_SERVER_URL?t.loadURL(process.env.VITE_DEV_SERVER_URL):t.loadFile(s.resolve(__dirname,"../dist/index.html")),e.app.on("activate",()=>{e.BrowserWindow.getAllWindows().length===0&&createWindow()}),e.ipcMain.on("quitHandler",(r,n)=>{e.app.quit()}),e.ipcMain.on("getPrintList",()=>{t.webContents.getPrintersAsync().then(r=>{t.webContents.send("printList",r)})});const i=new e.BrowserWindow({show:!1,width:464,height:1726,webPreferences:{nodeIntegration:!0,contextIsolation:!1}});process.env.VITE_DEV_SERVER_URL?i.loadFile(s.join(__dirname,"../public/print.html")):i.loadFile(s.resolve(__dirname,"../dist/print.html")),e.ipcMain.on("printerInfoSync",(r,n)=>{i.webContents.send("getParams",n)}),e.ipcMain.on("printStart",(r,n)=>{console.log(n);let o=JSON.parse(n).deviceName;i.webContents.print({silent:!0,deviceName:o,pageSize:{width:58e3,height:216e3},scaleFactor:80,landscape:!1,margins:{marginType:"none",top:0,bottom:0,left:0,right:0},dpi:{horizontal:203,vertical:203}})})});e.app.on("window-all-closed",()=>{process.platform!=="darwin"&&e.app.quit()});
|
||||||
const path = require("path");
|
|
||||||
const electron = require("electron");
|
|
||||||
let win;
|
|
||||||
electron.app.whenReady().then(() => {
|
|
||||||
win = new electron.BrowserWindow({
|
|
||||||
title: "银收客",
|
|
||||||
width: 1024,
|
|
||||||
height: 768,
|
|
||||||
fullscreenable: true,
|
|
||||||
fullscreen: process.env.VITE_DEV_SERVER_URL ? false : true,
|
|
||||||
simpleFullscreen: true,
|
|
||||||
frame: process.env.VITE_DEV_SERVER_URL ? true : false,
|
|
||||||
webPreferences: {
|
|
||||||
// 集成网页和 Node.js,也就是在渲染进程中,可以调用 Node.js 方法
|
|
||||||
nodeIntegration: true,
|
|
||||||
contextIsolation: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (process.env.VITE_DEV_SERVER_URL) {
|
|
||||||
win.loadURL(process.env.VITE_DEV_SERVER_URL);
|
|
||||||
} else {
|
|
||||||
win.loadFile(path.resolve(__dirname, "../dist/index.html"));
|
|
||||||
}
|
|
||||||
electron.app.on("activate", () => {
|
|
||||||
if (electron.BrowserWindow.getAllWindows().length === 0) {
|
|
||||||
createWindow();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
electron.ipcMain.on("quitHandler", (_, msg) => {
|
|
||||||
electron.app.quit();
|
|
||||||
});
|
|
||||||
electron.ipcMain.on("getPrintList", () => {
|
|
||||||
win.webContents.getPrintersAsync().then((res) => {
|
|
||||||
win.webContents.send("printList", res);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
const printWin = new electron.BrowserWindow({
|
|
||||||
show: false,
|
|
||||||
width: 464,
|
|
||||||
height: 1726,
|
|
||||||
webPreferences: {
|
|
||||||
// 集成网页和 Node.js,也就是在渲染进程中,可以调用 Node.js 方法
|
|
||||||
nodeIntegration: true,
|
|
||||||
contextIsolation: false
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (process.env.VITE_DEV_SERVER_URL) {
|
|
||||||
printWin.loadFile(path.join(__dirname, "../public/print.html"));
|
|
||||||
} else {
|
|
||||||
printWin.loadFile(path.resolve(__dirname, "../dist/print.html"));
|
|
||||||
}
|
|
||||||
electron.ipcMain.on("printerInfoSync", (event, arg) => {
|
|
||||||
printWin.webContents.send("getParams", arg);
|
|
||||||
});
|
|
||||||
electron.ipcMain.on("printStart", (event, arg) => {
|
|
||||||
console.log(arg);
|
|
||||||
const _parmas = JSON.parse(arg);
|
|
||||||
let name = _parmas.deviceName;
|
|
||||||
printWin.webContents.print({
|
|
||||||
silent: true,
|
|
||||||
deviceName: name,
|
|
||||||
pageSize: {
|
|
||||||
width: 58e3,
|
|
||||||
height: 216e3
|
|
||||||
},
|
|
||||||
scaleFactor: 80,
|
|
||||||
landscape: false,
|
|
||||||
margins: {
|
|
||||||
marginType: "none",
|
|
||||||
top: 0,
|
|
||||||
bottom: 0,
|
|
||||||
left: 0,
|
|
||||||
right: 0
|
|
||||||
},
|
|
||||||
dpi: {
|
|
||||||
horizontal: 203,
|
|
||||||
vertical: 203
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
|
||||||
electron.app.on("window-all-closed", () => {
|
|
||||||
if (process.platform !== "darwin")
|
|
||||||
electron.app.quit();
|
|
||||||
});
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "vite-electron",
|
"name": "vite-electron",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.2.8",
|
"version": "1.2.11",
|
||||||
"main": "dist-electron/main.js",
|
"main": "dist-electron/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "chcp 65001 && vite",
|
"dev": "chcp 65001 && vite",
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,9 @@ async function confirmOrder() {
|
||||||
memberAccount: ''
|
memberAccount: ''
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
payLoading.value = false
|
||||||
scanModalRef.value.show()
|
scanModalRef.value.show()
|
||||||
|
return
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'cash'://现金
|
case 'cash'://现金
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="shop_list" :class="{ img: shopListType == 'img' }" v-loading="loading">
|
<div class="shop_list" :class="{ img: shopListType == 'img' }" v-loading="loading">
|
||||||
<!-- <swiper class="swiper_box" direction="vertical" @slideChange="onSlideChange"> -->
|
<!-- <swiper class="swiper_box" direction="vertical" @slideChange="onSlideChange"> -->
|
||||||
<swiper class="swiper_box" direction="vertical">
|
<swiper class="swiper_box" direction="vertical" @slideChange="onSlideChange">
|
||||||
<swiper-slide class="slide_item" v-for="(goods, index) in goodsList" :key="index">
|
<swiper-slide class="slide_item" v-for="(goods, index) in goodsList" :key="index">
|
||||||
<div class="item_wrap" v-for="item in goods" :key="item.id" @click="showSkuHandle(item)">
|
<div class="item_wrap" v-for="item in goods" :key="item.id" @click="showSkuHandle(item)">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
</div>
|
</div>
|
||||||
</swiper-slide>
|
</swiper-slide>
|
||||||
</swiper>
|
</swiper>
|
||||||
</div>
|
</div>
|
||||||
<div class="empty">
|
<div class="empty">
|
||||||
<el-empty description="空空如也~" v-if="!goodsList.length" />
|
<el-empty description="空空如也~" v-if="!goodsList.length" />
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -236,15 +236,15 @@ async function productqueryCommodityInfoAjax() {
|
||||||
}
|
}
|
||||||
// loading.value = false
|
// loading.value = false
|
||||||
|
|
||||||
if (res.pages > 2 && loopTimer.value == null) {
|
// if (res.pages > 2 && loopTimer.value == null) {
|
||||||
// 启动循环任务
|
// // 启动循环任务
|
||||||
// loopMax.value = parseInt(res.total / goodsPageSize.value)
|
// // loopMax.value = parseInt(res.total / goodsPageSize.value)
|
||||||
loopGetGoods()
|
// loopGetGoods()
|
||||||
}
|
// }
|
||||||
if (goodsPage.value >= res.pages) {
|
// if (goodsPage.value >= res.pages) {
|
||||||
clearInterval(loopTimer.value)
|
// clearInterval(loopTimer.value)
|
||||||
loopTimer.value = null
|
// loopTimer.value = null
|
||||||
}
|
// }
|
||||||
return res.list
|
return res.list
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
|
|
@ -290,9 +290,17 @@ const onSlideChange = _.debounce(async function (e) {
|
||||||
if (e.activeIndex == e.previousIndex || finish.value) return
|
if (e.activeIndex == e.previousIndex || finish.value) return
|
||||||
if (e.activeIndex > e.previousIndex) {
|
if (e.activeIndex > e.previousIndex) {
|
||||||
// console.log('向下滑动');
|
// console.log('向下滑动');
|
||||||
goodsPage.value++
|
{
|
||||||
const res = await productqueryCommodityInfoAjax()
|
goodsPage.value++
|
||||||
goodsList.value.push(res)
|
const res = await productqueryCommodityInfoAjax()
|
||||||
|
goodsList.value.push(res)
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
goodsPage.value++
|
||||||
|
const res = await productqueryCommodityInfoAjax()
|
||||||
|
goodsList.value.push(res)
|
||||||
|
}
|
||||||
// goodsList.value.shift()
|
// goodsList.value.shift()
|
||||||
} else {
|
} else {
|
||||||
// console.log('向上滑动');
|
// console.log('向上滑动');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue