1.商品列表 添加分组 选择商品优化

2.订单列表修复详情没有规格
This commit is contained in:
gyq
2024-03-18 15:40:35 +08:00
parent 5ea9e7951f
commit 3159d0b459
5 changed files with 141 additions and 19 deletions

View File

@@ -36,7 +36,7 @@
<el-button type="primary" :loading="loading" @click="onSubmitHandle"> </el-button>
</span>
</el-dialog>
<shopList ref="shopListRef" @success="res => productIds = res" />
<shopList ref="shopListRef" @success="slectShop" />
</div>
</template>
@@ -72,6 +72,27 @@ export default {
}
},
methods: {
slectShop(res) {
if (this.productIds.length) {
res.map(async item => {
if (!await this.checkShop(item.id)) {
this.productIds.push({ ...item })
}
})
} else {
this.productIds = res
}
},
// 判断是否存在重复商品
checkShop(id) {
let falg = false
this.productIds.map(item => {
if (item.id == id) {
falg = true
}
})
return falg
},
onSubmitHandle() {
this.$refs.form.validate(async valid => {
if (valid) {
@@ -151,10 +172,6 @@ export default {
&:hover {
cursor: pointer;
&::before {
transform: translateY(0);
}
}
&::after {
@@ -190,7 +207,6 @@ export default {
bottom: 0;
left: 0;
z-index: 10;
transform: translateY(100%);
transition: all .1s ease-in-out;
}
}