优化规格选择

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 = '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://cashiernew.sxczgkj.cn/cashier-client'

View File

@ -1,7 +1,7 @@
{
"name": "vite-electron",
"private": true,
"version": "0.0.7",
"version": "0.0.11",
"main": "dist-electron/main.js",
"scripts": {
"dev": "chcp 65001 && vite",

View File

@ -134,7 +134,8 @@ function show(item, t = 'shop') {
goods.value = item
type.value = t
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 = []
item.selectSpecResult.map(val => {
switch (type.value) {
@ -152,12 +153,14 @@ function show(item, t = 'shop') {
name: val
})
break;
default:
break;
}
})
item.selectSpecResult = arr
} else {
goods.value.selectSpec.splice(index, 1)
}
})
console.log(goods.value)
selectedSuccess()