Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx
/
gl_tape
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
3
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit d36bc044
authored
Aug 25, 2025
by
cen
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge branch 'V4.56.0' of
http://192.168.3.233:8090/glsx/gl_tape
into V4.56.0
2 parents
795dbdde
07b64f2f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
85 additions
and
41 deletions
assets/css/sprite.scss
pages/boutique/tool/components/CreateOrder.vue
pages/boutique/tool/components/NoticePopup.vue
pages/boutique/tool/components/Package.vue
pages/boutique/tool/index.vue
assets/css/sprite.scss
View file @
d36bc04
This diff is collapsed.
Click to expand it.
pages/boutique/tool/components/CreateOrder.vue
View file @
d36bc04
...
@@ -18,10 +18,10 @@
...
@@ -18,10 +18,10 @@
</Product>
</Product>
</
template
>
</
template
>
<
template
slot=
"package"
>
<
template
slot=
"package"
>
<Package
v-if=
"orderObj.package"
:list=
"orderObj.package"
:positionTypeList=
"positionTypeList"
></Package>
<Package
v-if=
"orderObj.package"
@
changeTotalPrice=
"changeTotalPrice"
:list=
"orderObj.package"
:positionTypeList=
"positionTypeList"
></Package>
</
template
>
</
template
>
<
template
slot=
"skuGoods"
>
<
template
slot=
"skuGoods"
>
<SkuGoods
v-if=
"orderObj.skuGoods"
:list=
"orderObj.skuGoods"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
></SkuGoods>
<SkuGoods
v-if=
"orderObj.skuGoods"
:list=
"orderObj.skuGoods"
@
changeTotalPrice=
"changeTotalPrice"
:positionTypeList=
"positionTypeList"
:baseConfigData=
"baseConfigData"
></SkuGoods>
<view
class=
"total"
v-if=
"totalPrice > 0"
>
<view
class=
"total"
v-if=
"totalPrice > 0"
>
<view
class=
"total-left"
>
总价
</view>
<view
class=
"total-left"
>
总价
</view>
<view
class=
"total-right"
>
¥
{{
totalPrice
}}
</view>
<view
class=
"total-right"
>
¥
{{
totalPrice
}}
</view>
...
@@ -211,12 +211,26 @@ export default {
...
@@ -211,12 +211,26 @@ export default {
})
})
this
.
$set
(
this
.
orderObj
,
'couponInfo'
,
couponName
+
customerCouponCode
)
this
.
$set
(
this
.
orderObj
,
'couponInfo'
,
couponName
+
customerCouponCode
)
}
else
if
(
productFields
.
includes
(
_typeValue
.
key
))
{
}
else
if
(
productFields
.
includes
(
_typeValue
.
key
))
{
if
(
_typeValue
.
key
==
'skuGoods'
)
{
if
(
!
this
.
orderObj
[
_typeValue
.
key
])
{
this
.
$set
(
this
.
orderObj
,
_typeValue
.
key
,
chooseContent
)
}
else
{
// 过滤出已选的goodFlag为2的对象
const
selectedGoods
=
this
.
orderObj
[
_typeValue
.
key
].
filter
(
item
=>
item
.
goodsFlag
===
2
)
const
singleGoods
=
chooseContent
.
filter
(
item
=>
item
.
goodsFlag
===
1
)
const
moreGoods
=
chooseContent
.
filter
(
item
=>
item
.
goodsFlag
===
2
).
filter
(
item
=>
{
return
!
selectedGoods
.
some
(
selectedItem
=>
selectedItem
.
multipleSpecificationsGoods
.
id
===
item
.
multipleSpecificationsGoods
.
id
)
})
// 合并已选的goodFlag为2的对象
this
.
orderObj
[
_typeValue
.
key
]
=
[...
singleGoods
,
...
moreGoods
,
...
selectedGoods
]
}
}
else
{
this
.
$set
(
this
.
orderObj
,
_typeValue
.
key
,
chooseContent
)
}
// 商品类,需计算总价
// 商品类,需计算总价
this
.
$set
(
this
.
orderObj
,
_typeValue
.
key
,
val
.
chooseContent
)
setTimeout
(()
=>
{
this
.
$nextTick
(()
=>
{
// 确保数据更新后再计算总价
this
.
changeTotalPrice
()
this
.
changeTotalPrice
()
})
}
,
0
)
}
else
if
(
_typeValue
.
key
)
{
}
else
if
(
_typeValue
.
key
)
{
this
.
orderObj
[
_typeValue
.
targetIdKey
]
=
chooseContent
[
_typeValue
.
sourceIdKey
]
this
.
orderObj
[
_typeValue
.
targetIdKey
]
=
chooseContent
[
_typeValue
.
sourceIdKey
]
this
.
$set
(
this
.
orderObj
,
_typeValue
.
targetNameKey
,
chooseContent
[
_typeValue
.
sourceNameKey
])
this
.
$set
(
this
.
orderObj
,
_typeValue
.
targetNameKey
,
chooseContent
[
_typeValue
.
sourceNameKey
])
...
@@ -276,7 +290,7 @@ export default {
...
@@ -276,7 +290,7 @@ export default {
// 处理onlyLabel为true的特殊校验
// 处理onlyLabel为true的特殊校验
if
(
onlyLabelItem
.
length
>
0
)
{
if
(
onlyLabelItem
.
length
>
0
)
{
// 检查frontGear、frontWindow、rearGear、rearWindow、sunRoof和couponInfo字段中是否至少有一个不为空
// 检查frontGear、frontWindow、rearGear、rearWindow、sunRoof和couponInfo字段中是否至少有一个不为空
const
labelFields
=
[
'frontGear'
,
'frontWindow'
,
'rearGear'
,
'rearWindow'
,
'sunRoof'
]
const
labelFields
=
[
'frontGear'
,
'frontWindow'
,
'rearGear'
,
'rearWindow'
,
'sunRoof'
,
'package'
,
'skuGoods'
]
const
hasValue
=
labelFields
.
some
(
field
=>
{
const
hasValue
=
labelFields
.
some
(
field
=>
{
console
.
log
(
field
,
this
.
orderObj
[
field
])
console
.
log
(
field
,
this
.
orderObj
[
field
])
const
value
=
this
.
orderObj
[
field
]
const
value
=
this
.
orderObj
[
field
]
...
@@ -285,7 +299,7 @@ export default {
...
@@ -285,7 +299,7 @@ export default {
console
.
log
(
hasValue
,
hasValue
)
console
.
log
(
hasValue
,
hasValue
)
if
(
!
hasValue
)
{
if
(
!
hasValue
)
{
uni
.
showToast
({
uni
.
showToast
({
title
:
'
请至少选择一个产品
'
,
title
:
'
商品不能为空
'
,
icon
:
'none'
icon
:
'none'
})
})
return
false
return
false
...
@@ -313,8 +327,9 @@ export default {
...
@@ -313,8 +327,9 @@ export default {
},
{})
},
{})
}
}
// 将 frontGear、frontWindow、rearGear、rearWindow、sunRoof 字段合并到 goodsList 中
// 将 frontGear、frontWindow、rearGear、rearWindow、sunRoof 字段合并到 goodsList 中
const
labelFields
=
[
'frontGear'
,
'frontWindow'
,
'rearGear'
,
'rearWindow'
,
'sunRoof'
]
const
labelFields
=
[
'frontGear'
,
'frontWindow'
,
'rearGear'
,
'rearWindow'
,
'sunRoof'
,
'package'
,
'skuGoods'
]
let
goodsList
=
[]
let
goodsList
=
[]
let
subGoodsList
=
[]
labelFields
.
forEach
(
field
=>
{
labelFields
.
forEach
(
field
=>
{
if
(
Array
.
isArray
(
obj
[
field
])
&&
obj
[
field
].
length
>
0
)
{
if
(
Array
.
isArray
(
obj
[
field
])
&&
obj
[
field
].
length
>
0
)
{
goodsList
=
goodsList
.
concat
(
obj
[
field
]);
goodsList
=
goodsList
.
concat
(
obj
[
field
]);
...
@@ -322,13 +337,18 @@ export default {
...
@@ -322,13 +337,18 @@ export default {
delete
obj
[
field
];
delete
obj
[
field
];
});
});
if
(
goodsList
.
length
>
0
)
{
if
(
goodsList
.
length
>
0
)
{
obj
.
subOrderList
=
goodsList
.
map
(
item
=>
{
goodsList
.
map
(
e
=>
{
return
{
if
(
e
.
goodsFlag
==
1
)
{
totalPrice
:
item
.
goods
.
sellPrice
,
// 单商品
number
:
item
.
goods
.
number
,
merchantGoodsId
:
item
.
goods
.
merchantGoodsId
}
}
})
})
// obj.subOrderList = goodsList.map(item => {
// return {
// totalPrice: item.goods.sellPrice,
// number: item.goods.number,
// merchantGoodsId: item.goods.merchantGoodsId
// }
// })
}
}
delete
obj
.
carBrand
delete
obj
.
carBrand
delete
obj
.
couponInfo
delete
obj
.
couponInfo
...
@@ -357,6 +377,9 @@ export default {
...
@@ -357,6 +377,9 @@ export default {
total
+=
parseFloat
(
item
.
goods
.
sellPrice
)
*
parseInt
(
item
.
goods
.
number
)
total
+=
parseFloat
(
item
.
goods
.
sellPrice
)
*
parseInt
(
item
.
goods
.
number
)
}
else
if
(
item
.
packageGoods
&&
item
.
packageGoods
.
upgradePrice
&&
item
.
packageGoods
.
number
)
{
}
else
if
(
item
.
packageGoods
&&
item
.
packageGoods
.
upgradePrice
&&
item
.
packageGoods
.
number
)
{
total
+=
parseFloat
(
item
.
packageGoods
.
upgradePrice
)
*
parseInt
(
item
.
packageGoods
.
number
)
total
+=
parseFloat
(
item
.
packageGoods
.
upgradePrice
)
*
parseInt
(
item
.
packageGoods
.
number
)
// item.packageGoods.goodsList.forEach(i => {
// total += parseFloat(i.sellPrice) * parseInt(item.packageGoods.number)
// })
}
else
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
goods
&&
item
.
multipleSpecificationsGoods
.
goods
.
sellPrice
&&
item
.
multipleSpecificationsGoods
.
number
)
{
}
else
if
(
item
.
multipleSpecificationsGoods
&&
item
.
multipleSpecificationsGoods
.
goods
&&
item
.
multipleSpecificationsGoods
.
goods
.
sellPrice
&&
item
.
multipleSpecificationsGoods
.
number
)
{
total
+=
parseFloat
(
item
.
multipleSpecificationsGoods
.
goods
.
sellPrice
)
*
parseInt
(
item
.
multipleSpecificationsGoods
.
number
)
total
+=
parseFloat
(
item
.
multipleSpecificationsGoods
.
goods
.
sellPrice
)
*
parseInt
(
item
.
multipleSpecificationsGoods
.
number
)
}
}
...
...
pages/boutique/tool/components/NoticePopup.vue
View file @
d36bc04
...
@@ -61,18 +61,6 @@ export default {
...
@@ -61,18 +61,6 @@ export default {
buttonsList
:
[]
buttonsList
:
[]
}
}
},
},
computed
:
{
// 根据类型返回对应的图标
iconSrc
()
{
const
iconMap
=
{
success
:
'https://img01.glsx.com.cn/weapp/resource/app-tape/media/common/icon-success.png'
,
error
:
'https://img01.glsx.com.cn/weapp/resource/app-tape/media/common/icon-error.png'
,
warning
:
'@/assets/images/common/warning-notice.png'
,
info
:
'https://img01.glsx.com.cn/weapp/resource/app-tape/media/common/icon-info.png'
}
return
iconMap
[
this
.
type
]
||
iconMap
.
info
}
},
methods
:
{
methods
:
{
open
()
{
open
()
{
this
.
$refs
.
popup
.
open
(
"center"
);
this
.
$refs
.
popup
.
open
(
"center"
);
...
...
pages/boutique/tool/components/Package.vue
View file @
d36bc04
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<view
class=
"add"
@
click=
"increaseNumber(item)"
>
+
</view>
<view
class=
"add"
@
click=
"increaseNumber(item)"
>
+
</view>
</view>
</view>
</view>
</view>
<view
class=
"price"
>
¥
{{
item
.
packageGoods
.
upgradePrice
}}
</view>
<view
class=
"price"
>
¥
{{
changeTotal
(
item
)
}}
</view>
</view>
</view>
<view
class=
"goods-item"
v-for=
"(goods, ind) in item.packageGoods.goodsList"
:key=
"ind"
>
<view
class=
"goods-item"
v-for=
"(goods, ind) in item.packageGoods.goodsList"
:key=
"ind"
>
<view
class=
"goods-name"
>
{{
goods
.
goodsAlias
||
goods
.
upgradeGoodsName
}}
</view>
<view
class=
"goods-name"
>
{{
goods
.
goodsAlias
||
goods
.
upgradeGoodsName
}}
</view>
...
@@ -47,13 +47,27 @@ export default {
...
@@ -47,13 +47,27 @@ export default {
},
},
created
()
{
created
()
{
// 初始化商品数量
// 初始化商品数量
this
.
list
.
forEach
(
item
=>
{
this
.
initProductNumbers
()
if
(
!
item
.
packageGoods
.
number
)
{
},
this
.
$set
(
item
.
packageGoods
,
'number'
,
'1'
)
mounted
()
{
}
// 确保每次使用组件时都检查并设置number属性
})
this
.
initProductNumbers
()
},
updated
()
{
// 当组件数据更新时也检查number属性
this
.
initProductNumbers
()
},
},
methods
:
{
methods
:
{
// 初始化商品数量方法
initProductNumbers
()
{
if
(
this
.
list
&&
this
.
list
.
length
>
0
)
{
this
.
list
.
forEach
(
item
=>
{
if
(
!
item
.
packageGoods
.
number
)
{
this
.
$set
(
item
.
packageGoods
,
'number'
,
'1'
)
}
})
}
},
// 格式化位置信息
// 格式化位置信息
formatPosition
(
item
,
positionTypeList
)
{
formatPosition
(
item
,
positionTypeList
)
{
const
filterData
=
positionTypeList
.
filter
(
v
=>
v
.
positionValue
==
item
)
const
filterData
=
positionTypeList
.
filter
(
v
=>
v
.
positionValue
==
item
)
...
@@ -129,6 +143,10 @@ export default {
...
@@ -129,6 +143,10 @@ export default {
// 如果validMinSellPrice为Y,则强制修改值为最小值
// 如果validMinSellPrice为Y,则强制修改值为最小值
if
(
goods
.
validMinSellPrice
===
'Y'
&&
goods
.
minSellPrice
&&
parseFloat
(
value
)
<
parseFloat
(
goods
.
minSellPrice
))
{
if
(
goods
.
validMinSellPrice
===
'Y'
&&
goods
.
minSellPrice
&&
parseFloat
(
value
)
<
parseFloat
(
goods
.
minSellPrice
))
{
console
.
log
(
'最小值'
,
goods
.
minSellPrice
)
console
.
log
(
'最小值'
,
goods
.
minSellPrice
)
uni
.
showToast
({
title
:
'单价不可低于商品最低价'
,
icon
:
'none'
})
value
=
goods
.
minSellPrice
.
toString
()
value
=
goods
.
minSellPrice
.
toString
()
}
}
// 更新值
// 更新值
...
@@ -139,6 +157,15 @@ export default {
...
@@ -139,6 +157,15 @@ export default {
deleteGoods
(
index
)
{
deleteGoods
(
index
)
{
this
.
list
.
splice
(
index
,
1
)
this
.
list
.
splice
(
index
,
1
)
this
.
$emit
(
'changeTotalPrice'
)
this
.
$emit
(
'changeTotalPrice'
)
},
// 计算套餐的总价
changeTotal
(
item
)
{
let
total
=
0
item
.
packageGoods
.
goodsList
.
forEach
(
i
=>
{
total
+=
parseFloat
(
i
.
sellPrice
)
*
parseInt
(
item
.
packageGoods
.
number
)
})
item
.
packageGoods
.
upgradePrice
=
total
return
total
}
}
}
}
}
}
...
...
pages/boutique/tool/index.vue
View file @
d36bc04
...
@@ -79,17 +79,23 @@ export default {
...
@@ -79,17 +79,23 @@ export default {
// 配置弹窗按钮
// 配置弹窗按钮
this
.
$refs
.
notice
.
buttonsList
=
[
this
.
$refs
.
notice
.
buttonsList
=
[
{
{
text
:
'确认退出'
,
text
:
'确认退出'
,
type
:
'default'
,
type
:
'default'
,
callback
:
()
=>
{
callback
:
()
=>
{
// 点击确认后才切换组件
// 点击确认后才切换组件
this
.
toolComponentName
=
selectedItem
.
name
this
.
toolComponentName
=
selectedItem
.
name
if
(
selectedItem
.
name
!==
'CreateOrder'
)
{
if
(
selectedItem
.
name
!==
'CreateOrder'
)
{
this
.
transmissionOfData
=
null
this
.
transmissionOfData
=
null
}
}
}
this
.
$refs
.
notice
.
close
()
}
}
]
},
{
text
:
'继续编辑'
,
type
:
'primary'
,
callback
:
()
=>
{
this
.
$refs
.
notice
.
close
()
}
}]
// 打开弹窗
// 打开弹窗
this
.
$refs
.
notice
.
open
()
this
.
$refs
.
notice
.
open
()
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment