优化规格选择

This commit is contained in:
gyq
2024-03-13 09:04:28 +08:00
parent 4adbc125b2
commit 4ea6ece75a
4 changed files with 101 additions and 96 deletions

View File

@@ -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/'

View File

@@ -3,3 +3,4 @@ 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'

View File

@@ -1,7 +1,7 @@
{ {
"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",

View File

@@ -134,7 +134,8 @@ 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) => {
if (item.selectSpecResult.length) {
let arr = [] let arr = []
item.selectSpecResult.map(val => { item.selectSpecResult.map(val => {
switch (type.value) { switch (type.value) {
@@ -152,12 +153,14 @@ function show(item, t = 'shop') {
name: 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()