优化规格
This commit is contained in:
parent
e058c97016
commit
c68b36740f
|
|
@ -1 +1,40 @@
|
||||||
"use strict";const o=require("path"),e=require("electron");let n;e.app.whenReady().then(()=>{n=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?(n.loadURL(process.env.VITE_DEV_SERVER_URL),n.webContents.openDevTools()):n.loadFile(o.resolve(__dirname,"../dist/index.html")),e.app.on("activate",()=>{e.BrowserWindow.getAllWindows().length===0&&createWindow()}),e.ipcMain.on("quitHandler",(t,r)=>{e.app.quit()}),e.ipcMain.on("printStart",(t,r)=>{})});e.app.on("window-all-closed",()=>{process.platform!=="darwin"&&e.app.quit()});
|
"use strict";
|
||||||
|
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);
|
||||||
|
win.webContents.openDevTools();
|
||||||
|
} 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("printStart", (event, arg) => {
|
||||||
|
});
|
||||||
|
});
|
||||||
|
electron.app.on("window-all-closed", () => {
|
||||||
|
if (process.platform !== "darwin")
|
||||||
|
electron.app.quit();
|
||||||
|
});
|
||||||
|
|
|
||||||
|
|
@ -159,6 +159,11 @@ const menus = ref([
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
|
/* 去除下划线 */
|
||||||
|
color: inherit;
|
||||||
|
/* 继承父元素的颜色 */
|
||||||
|
cursor: pointer;
|
||||||
|
/* 修改鼠标指针样式 */
|
||||||
|
|
||||||
&:first-child {
|
&:first-child {
|
||||||
border-bottom: 1px solid #666;
|
border-bottom: 1px solid #666;
|
||||||
|
|
|
||||||
|
|
@ -107,14 +107,10 @@ async function submitHandle() {
|
||||||
async function checkPayStauts() {
|
async function checkPayStauts() {
|
||||||
try {
|
try {
|
||||||
const res = await queryOrder({ orderId: props.orderId })
|
const res = await queryOrder({ orderId: props.orderId })
|
||||||
loading.value = false
|
|
||||||
if (res.status == 'closed') {
|
if (res.status == 'closed') {
|
||||||
emits('success')
|
emits('success')
|
||||||
scanModalRef.value.close()
|
|
||||||
} else {
|
} else {
|
||||||
checkPayStatusLoading.value = false
|
|
||||||
ElMessage.error(res.payRemark || '支付失败!')
|
ElMessage.error(res.payRemark || '支付失败!')
|
||||||
scanModalRef.value.loading = false
|
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
|
|
@ -254,7 +250,7 @@ defineExpose({
|
||||||
.pay_wait {
|
.pay_wait {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding: 0 var(--el-font-size-base);
|
padding: 0 var(--el-font-size-base);
|
||||||
height: 600px;
|
height: 400px;
|
||||||
padding-bottom: 100px;
|
padding-bottom: 100px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
|
||||||
|
|
@ -134,35 +134,41 @@ function show(item, t = 'shop') {
|
||||||
goods.value = item
|
goods.value = item
|
||||||
type.value = t
|
type.value = t
|
||||||
goods.value.selectSpec = JSON.parse(goods.value.selectSpec)
|
goods.value.selectSpec = JSON.parse(goods.value.selectSpec)
|
||||||
goods.value.selectSpec.map((item, index) => {
|
goods.value.selectSpec.map(item => {
|
||||||
|
let arr = []
|
||||||
|
item.selectSpecResult.map(val => {
|
||||||
|
switch (type.value) {
|
||||||
|
case 'shop':
|
||||||
|
arr.push({
|
||||||
|
active: false,
|
||||||
|
name: val
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
case 'cart':
|
||||||
|
// 如果从购物车选择规格需要做选中效果
|
||||||
|
const skus = goods.value.skuName.split(',')
|
||||||
|
arr.push({
|
||||||
|
active: !!skus.find(item => item === val),
|
||||||
|
name: val
|
||||||
|
})
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
item.selectSpecResult = arr
|
||||||
|
})
|
||||||
|
|
||||||
|
let arr = []
|
||||||
|
|
||||||
|
goods.value.selectSpec.map(item => {
|
||||||
if (item.selectSpecResult.length) {
|
if (item.selectSpecResult.length) {
|
||||||
let arr = []
|
arr.push({ ...item })
|
||||||
item.selectSpecResult.map(val => {
|
|
||||||
switch (type.value) {
|
|
||||||
case 'shop':
|
|
||||||
arr.push({
|
|
||||||
active: false,
|
|
||||||
name: val
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
case 'cart':
|
|
||||||
// 如果从购物车选择规格需要做选中效果
|
|
||||||
const skus = goods.value.skuName.split(',')
|
|
||||||
arr.push({
|
|
||||||
active: !!skus.find(item => item === val),
|
|
||||||
name: val
|
|
||||||
})
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
item.selectSpecResult = arr
|
|
||||||
} else {
|
|
||||||
goods.value.selectSpec.splice(index, 1)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
console.log(goods.value)
|
|
||||||
|
goods.value.selectSpec = arr
|
||||||
|
|
||||||
selectedSuccess()
|
selectedSuccess()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,12 +33,12 @@
|
||||||
<el-button :icon="shopListType == 'text' ? 'PictureRounded' : 'PriceTag'"
|
<el-button :icon="shopListType == 'text' ? 'PictureRounded' : 'PriceTag'"
|
||||||
@click="changeShopListType"></el-button>
|
@click="changeShopListType"></el-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="shop_list" :class="{ img: shopListType == 'img' }">
|
<div class="shop_list" :class="{ img: shopListType == 'img' }" v-loading="loading">
|
||||||
<div class="item_wrap" v-for="item in goodsList" :key="item.id" @click="showSkuHandle(item)">
|
<div class="item_wrap" v-for="item in goodsList" :key="item.id" @click="showSkuHandle(item)">
|
||||||
<div class="item">
|
<div class="item">
|
||||||
<div class="dot" v-if="item.orderCount">{{ item.orderCount }}</div>
|
<div class="dot" v-if="item.orderCount">{{ item.orderCount }}</div>
|
||||||
<div class="cover" v-if="shopListType == 'img'">
|
<div class="cover" v-if="shopListType == 'img'">
|
||||||
<el-image :src="item.coverImg" class="el_img" fit="cover"></el-image>
|
<el-image :src="item.coverImg" class="el_img" fit="cover" lazy></el-image>
|
||||||
</div>
|
</div>
|
||||||
<div class="name"><el-text line-clamp="2">{{ item.name }}</el-text></div>
|
<div class="name"><el-text line-clamp="2">{{ item.name }}</el-text></div>
|
||||||
<div class="item_empty" v-if="shopListType == 'text'"></div>
|
<div class="item_empty" v-if="shopListType == 'text'"></div>
|
||||||
|
|
@ -78,12 +78,13 @@ const skuModalRef = ref(null)
|
||||||
|
|
||||||
const shopListType = ref('img')
|
const shopListType = ref('img')
|
||||||
|
|
||||||
|
const categoryId = ref('')
|
||||||
const categorys = ref([])
|
const categorys = ref([])
|
||||||
const categorysActive = ref(0)
|
const categorysActive = ref(0)
|
||||||
|
|
||||||
const commdityName = ref('')
|
const commdityName = ref('')
|
||||||
|
|
||||||
const originalGoods = ref([])
|
const loading = ref(false)
|
||||||
const goodsList = ref([])
|
const goodsList = ref([])
|
||||||
|
|
||||||
const showPopover = ref(false)
|
const showPopover = ref(false)
|
||||||
|
|
@ -140,16 +141,8 @@ function changeShopListType() {
|
||||||
function changeCategory(item, index) {
|
function changeCategory(item, index) {
|
||||||
showPopover.value = false
|
showPopover.value = false
|
||||||
categorysActive.value = index
|
categorysActive.value = index
|
||||||
if (item.id) {
|
categoryId.value = item.id
|
||||||
goodsList.value = []
|
productqueryCommodityInfoAjax()
|
||||||
originalGoods.value.map(val => {
|
|
||||||
if (val.categoryId == item.id) {
|
|
||||||
goodsList.value.push(val)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
goodsList.value = [...originalGoods.value]
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 查询分类信息
|
// 查询分类信息
|
||||||
|
|
@ -173,17 +166,19 @@ async function queryCategoryAjax() {
|
||||||
// 查询商品信息
|
// 查询商品信息
|
||||||
async function productqueryCommodityInfoAjax() {
|
async function productqueryCommodityInfoAjax() {
|
||||||
try {
|
try {
|
||||||
|
loading.value = true
|
||||||
const res = await productqueryCommodityInfo({
|
const res = await productqueryCommodityInfo({
|
||||||
shopId: store.userInfo.shopId,
|
shopId: store.userInfo.shopId,
|
||||||
categoryId: categorys.value[categorysActive.value].id,
|
categoryId: categoryId.value,
|
||||||
commdityName: commdityName.value,
|
commdityName: commdityName.value,
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 1000,
|
pageSize: 1000,
|
||||||
masterId: props.masterId
|
masterId: props.masterId
|
||||||
})
|
})
|
||||||
originalGoods.value = res
|
|
||||||
goodsList.value = res
|
goodsList.value = res
|
||||||
|
loading.value = false
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
loading.value = false
|
||||||
console.log(error)
|
console.log(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,8 @@ export default defineConfig({
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
// target: 'https://cashierclient.sxczgkj.cn/cashier-client', // 测试
|
target: 'https://cashierclient.sxczgkj.cn/cashier-client', // 测试
|
||||||
target: 'http://192.168.2.27:10587/cashier-client', // 国成
|
// target: 'http://192.168.2.27:10587/cashier-client', // 国成
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, '')
|
rewrite: (path) => path.replace(/^\/api/, '')
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue