优化规格选择
This commit is contained in:
parent
4adbc125b2
commit
4ea6ece75a
|
|
@ -3,4 +3,5 @@ ENV = development
|
||||||
|
|
||||||
# 本地环境接口地址
|
# 本地环境接口地址
|
||||||
# VITE_API_URL = 'http://192.168.2.87:10587/cashier-client'
|
# VITE_API_URL = 'http://192.168.2.87:10587/cashier-client'
|
||||||
VITE_API_URL = 'https://cashiernew.sxczgkj.cn/cashier-client'
|
# VITE_API_URL = 'https://cashiernew.sxczgkj.cn/cashier-client'
|
||||||
|
VITE_API_URL = 'https://cashierclient.sxczgkj.cn/cashier-client/'
|
||||||
|
|
@ -2,4 +2,5 @@
|
||||||
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://cashiernew.sxczgkj.cn/cashier-client'
|
||||||
140
package.json
140
package.json
|
|
@ -1,71 +1,71 @@
|
||||||
{
|
{
|
||||||
"name": "vite-electron",
|
"name": "vite-electron",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.0.7",
|
"version": "0.0.11",
|
||||||
"main": "dist-electron/main.js",
|
"main": "dist-electron/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "chcp 65001 && vite",
|
"dev": "chcp 65001 && vite",
|
||||||
"build": "node ./addVersion.js && vite build && electron-builder",
|
"build": "node ./addVersion.js && vite build && electron-builder",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"build:win": "node ./addVersion.js && vite build && electron-builder --w"
|
"build:win": "node ./addVersion.js && vite build && electron-builder --w"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@element-plus/icons-vue": "^2.3.1",
|
"@element-plus/icons-vue": "^2.3.1",
|
||||||
"axios": "^1.6.2",
|
"axios": "^1.6.2",
|
||||||
"dayjs": "^1.11.10",
|
"dayjs": "^1.11.10",
|
||||||
"electron-pos-printer": "^1.3.6",
|
"electron-pos-printer": "^1.3.6",
|
||||||
"electron-pos-printer-vue": "^1.0.9",
|
"electron-pos-printer-vue": "^1.0.9",
|
||||||
"element-plus": "^2.4.3",
|
"element-plus": "^2.4.3",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
"pinia": "^2.1.7",
|
"pinia": "^2.1.7",
|
||||||
"vue": "^3.3.8",
|
"vue": "^3.3.8",
|
||||||
"vue-router": "^4.2.5"
|
"vue-router": "^4.2.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vitejs/plugin-vue": "^4.5.0",
|
"@vitejs/plugin-vue": "^4.5.0",
|
||||||
"electron": "^28.2.3",
|
"electron": "^28.2.3",
|
||||||
"electron-builder": "^24.13.3",
|
"electron-builder": "^24.13.3",
|
||||||
"electron-rebuild": "^3.2.9",
|
"electron-rebuild": "^3.2.9",
|
||||||
"path": "^0.12.7",
|
"path": "^0.12.7",
|
||||||
"sass": "^1.69.5",
|
"sass": "^1.69.5",
|
||||||
"sass-loader": "^13.3.2",
|
"sass-loader": "^13.3.2",
|
||||||
"tree-kill": "^1.2.2",
|
"tree-kill": "^1.2.2",
|
||||||
"vite": "^5.0.0",
|
"vite": "^5.0.0",
|
||||||
"vite-plugin-electron": "^0.15.4",
|
"vite-plugin-electron": "^0.15.4",
|
||||||
"vite-plugin-electron-renderer": "^0.14.5"
|
"vite-plugin-electron-renderer": "^0.14.5"
|
||||||
},
|
},
|
||||||
"build": {
|
"build": {
|
||||||
"appId": "com.cashierdesktop.app",
|
"appId": "com.cashierdesktop.app",
|
||||||
"productName": "cashier_desktop",
|
"productName": "cashier_desktop",
|
||||||
"asar": true,
|
"asar": true,
|
||||||
"files": [
|
"files": [
|
||||||
"./dist/**/*",
|
"./dist/**/*",
|
||||||
"./dist-electron/**/*"
|
"./dist-electron/**/*"
|
||||||
],
|
],
|
||||||
"directories": {
|
"directories": {
|
||||||
"buildResources": "build",
|
"buildResources": "build",
|
||||||
"output": "release"
|
"output": "release"
|
||||||
},
|
},
|
||||||
"win": {
|
"win": {
|
||||||
"icon": "./public/logo.ico",
|
"icon": "./public/logo.ico",
|
||||||
"target": [
|
"target": [
|
||||||
{
|
{
|
||||||
"target": "nsis",
|
"target": "nsis",
|
||||||
"arch": [
|
"arch": [
|
||||||
"ia32"
|
"ia32"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"nsis": {
|
"nsis": {
|
||||||
"oneClick": false,
|
"oneClick": false,
|
||||||
"allowElevation": true,
|
"allowElevation": true,
|
||||||
"allowToChangeInstallationDirectory": true,
|
"allowToChangeInstallationDirectory": true,
|
||||||
"installerIcon": "./public/logo.ico",
|
"installerIcon": "./public/logo.ico",
|
||||||
"uninstallerIcon": "./public/logo.ico",
|
"uninstallerIcon": "./public/logo.ico",
|
||||||
"installerHeaderIcon": "./public/logo.ico",
|
"installerHeaderIcon": "./public/logo.ico",
|
||||||
"createDesktopShortcut": true,
|
"createDesktopShortcut": true,
|
||||||
"createStartMenuShortcut": true
|
"createStartMenuShortcut": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -134,30 +134,33 @@ 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 => {
|
goods.value.selectSpec.map((item, index) => {
|
||||||
let arr = []
|
if (item.selectSpecResult.length) {
|
||||||
item.selectSpecResult.map(val => {
|
let arr = []
|
||||||
switch (type.value) {
|
item.selectSpecResult.map(val => {
|
||||||
case 'shop':
|
switch (type.value) {
|
||||||
arr.push({
|
case 'shop':
|
||||||
active: false,
|
arr.push({
|
||||||
name: val
|
active: false,
|
||||||
})
|
name: val
|
||||||
break;
|
})
|
||||||
case 'cart':
|
break;
|
||||||
// 如果从购物车选择规格需要做选中效果
|
case 'cart':
|
||||||
const skus = goods.value.skuName.split(',')
|
// 如果从购物车选择规格需要做选中效果
|
||||||
arr.push({
|
const skus = goods.value.skuName.split(',')
|
||||||
active: !!skus.find(item => item === val),
|
arr.push({
|
||||||
name: val
|
active: !!skus.find(item => item === val),
|
||||||
})
|
name: val
|
||||||
break;
|
})
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
item.selectSpecResult = arr
|
item.selectSpecResult = arr
|
||||||
|
} else {
|
||||||
|
goods.value.selectSpec.splice(index, 1)
|
||||||
|
}
|
||||||
})
|
})
|
||||||
console.log(goods.value)
|
console.log(goods.value)
|
||||||
selectedSuccess()
|
selectedSuccess()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue