商品规格选择编辑更新

This commit is contained in:
2024-10-21 10:02:34 +08:00
parent d23a966826
commit cdde7de1df
2 changed files with 23 additions and 8 deletions

View File

@@ -1475,6 +1475,7 @@
uni.$on('emitspecificationsSave', function(data) {
FormData.specificationsGroup = data
FormData.specId = data.specId
FormData.specsInfoName=data.specsInfoName
skuList.list = data.result.map(v => {
return {
...v.skus,

View File

@@ -23,29 +23,29 @@
</uni-data-picker>
</uni-forms-item>
</view> -->
<view class=" u-m-t-32">
<view class="u-m-t-16" v-for="(item,index) in FormData.selectSpec" :key="index">
<view class=" ">
<view class="u-m-t-32" v-for="(item,index) in FormData.selectSpec" :key="index">
<view class="font-bold">
{{item.name}}
</view>
<view class="u-m-t-16">
<up-checkbox-group :labelSize="12" :size="14" :activeColor="color.ColorMain"
<!-- <up-checkbox-group :labelSize="12" :size="14" :activeColor="color.ColorMain"
shape="circle" v-model="item.selectSpecResult" placement="row"
@change="createResult">
<up-checkbox :customStyle="{marginRight: '60rpx',marginBottom:'16rpx'}"
v-for="(item, index) in item.value" :key="index" :label="item.text"
:name="item.value">
</up-checkbox>
</up-checkbox-group>
</up-checkbox-group> -->
<!-- <uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
<uni-data-checkbox @change="createResult" multiple :selectedColor="color.ColorMain"
v-model="item.selectSpecResult" :localdata="item.value">
</uni-data-checkbox> -->
</uni-data-checkbox>
</view>
</view>
<view class="u-p-b-16"></view>
</view>
</view>
@@ -382,16 +382,27 @@
function createResult() {
let arr = []
// for(let i in FormData.selectSpec){
// const selectSpecResult=FormData.selectSpec[i].selectSpecResult
// if(selectSpecResult.length>0){
// arr.push({
// value: selectSpecResult,
// name: FormData.selectSpec[i].name
// })
// }
// }
for (let k of FormData.selectSpec) {
if (k.selectSpecResult.length) {
console.log(k);
console.log(k.selectSpecResult.length);
arr.push({
value: k.selectSpecResult,
name: k.name
})
}
}
console.log(arr);
const spes = combineSpecs(arr)
console.log(spes);
const result = spes.filter(v => {
return !Array.isArray(v)
}).map(v => {
@@ -652,6 +663,9 @@
.my-switch {
transform: scale(0.7);
}
::v-deep .uni-data-checklist .checklist-group .checklist-box .checkbox__inner{
border-radius: 50%;
}
::v-deep .uni-forms-item__error {
display: none !important;