We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sku-select
一个商品由多个维度构成,可以选择或者取消任意一个维度。所有维度选择结束决定此时特定的商品
问题难点在于: 每个维度选择和取消后,需要判断任意其他维度的商品属性是否可选
流程
所以关键要解决的问题就是 选择后不可用的判断和当前状态已选
可先看demo 关键点分析,如何识别哪些不可用
disableTags(tag_groups,default_tag) { let tagLength = tag_groups.length; let tagArrayIndex = []; let default_tag_key_array = Object.keys(default_tag); remove(default_tag_key_array, n => n == 'inventory'); for (let i in default_tag_key_array) {tagArrayIndex.push(i)}; for (let i in tag_groups) { let tagsFilter = cloneDeep(this.tags); let tagsFilterArray = cloneDeep(tagArrayIndex); let idx = tagLength-1-i; remove(tagsFilterArray, n => n == idx); for (let v of tagsFilterArray) { if (default_tag[tag_groups[v].name] !== '') { tagsFilter = tagsFilter.filter(item => { return item[tag_groups[v].name] === default_tag[tag_groups[v].name] }); } } if (tag_groups[idx].length !== tagsFilter.length) { let arrN1 = keyBy(tagsFilter, tag_groups[idx].name); let keysN1 = Object.keys(arrN1); for (let c of tag_groups[idx].tags) { c.isDisable = !keysN1.includes(c.tag); } } } return tag_groups;
待补充 tobeContinued
The text was updated successfully, but these errors were encountered:
牛了个逼
Sorry, something went wrong.
No branches or pull requests
目录
代码demo
sku-select
问题描述
一个商品由多个维度构成,可以选择或者取消任意一个维度。所有维度选择结束决定此时特定的商品
选择方案及问题解决思路
选择方案
问题解决思路
问题难点在于: 每个维度选择和取消后,需要判断任意其他维度的商品属性是否可选
流程
所以关键要解决的问题就是 选择后不可用的判断和当前状态已选
代码实现(之后补充)
可先看demo
关键点分析,如何识别哪些不可用
待补充 tobeContinued
The text was updated successfully, but these errors were encountered: