Commit fd6868cf authored by Xuguangxing's avatar Xuguangxing

feat: 猜你喜欢增加选择商品来源

parent 576f34b0
<template>
<div class="goodsResourceSelectorContainer">
<span class="option" @click="select(item.id)" v-for="(item, index) in options" :key="index" :class="{selected: item.id == dataValue.type}">
{{item.label}}
</span>
<!-- <Button type="primary" @click="save">保存</Button> -->
</div>
</template>
<script>
export default {
props: {
value: {
type: Object,
default() {
return {}
}
}
},
watch: {
value(val) {
this.dataValue = val;
},
selected(val) {
this.$emit('input', val);
}
},
methods: {
select(type) {
this.dataValue.type = type;
}
},
data() {
return {
options: [
{id: 'all', label: '全部商品'},
{id: 'category', label: '按照品类'},
{id: 'brand', label: '按照品牌'}
],
dataValue: {}
}
},
created() {
if (!Object.keys(this.value).length) {
// 默认值
this.dataValue = {
type: 'all',
brandId: '',
categoryId: '',
}
} else {
this.dataValue = this.value;
}
}
}
</script>
<style lang="less" scoped>
.option{
cursor: pointer;
border-radius: 4px;
line-height:normal;
display: inline-block;
padding: 3px 5px;
border: 1px solid #dddee1;
margin: 0 2px;
user-select: none;
&.selected, &:hover{
border-color: #57a3f3;
box-shadow: 0px 0px 0px 2px rgb(45 140 240 / 20%)
}
}
</style>
\ No newline at end of file
<template>
<div class="snapUpActivityContainer">
<div class="swiperStyleSeletorContainer">
<span class="option" @click="select(item.id)" v-for="(item, index) in options" :key="index" :class="{selected: item.id == selected}">
{{item.label}}
</span>
......
......@@ -17,6 +17,7 @@ import GoodsSwiperSelector from './component/GoodsSwiperSelector/index.vue';
import DiscountGoodsSelectorV2 from './component/DiscountGoodsSelectorV2/index.vue';
import GoodsChannelTypeSelector from './component/GoodsChannelTypeSelector/index.vue';
import GoodsPromotionTypeSelector from './component/GoodsPromotionTypeSelector/index.vue';
import GoodsResourceSelector from './component/GoodsResourceSelector/index.vue';
import BaseSelect from './component/BaseSelect/index.vue';
import ComponentSelect from './component/ComponentSelect/index.vue';
import FormList from './component/FormList/index.vue';
......@@ -54,7 +55,8 @@ const allComponentsMap = getAllScheme();
GoodsSwiperSelector,
GoodsChannelTypeSelector,
GoodsPromotionTypeSelector,
FontWeightSelector
FontWeightSelector,
GoodsResourceSelector
}, name: 'DynamicForm' })
export default class DynamicForm extends Mixins(ContextMenuMixin, DynamicFormMixin) {
@State(state => state.editor.curEleIndex) curEleIndex;
......
......@@ -2176,9 +2176,9 @@
}
},
"@qg/citrus-ui": {
"version": "0.3.55-beta1",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.55-beta1.tgz",
"integrity": "sha512-8QJe/rybCcJJ58YzFdPTmD/S/98sfmJhPBvQJlP9f1vBZzcMrIcNalCzdrD14wCRDYhjD34mtLvqebOQUQ6AzQ==",
"version": "0.3.55-beta2",
"resolved": "http://npmprivate.quantgroups.com/@qg%2fcitrus-ui/-/citrus-ui-0.3.55-beta2.tgz",
"integrity": "sha512-a5JzDfblNMo7m8U+kyVDxl9HjB2ClnV5gPaWAtTDcNL3D5sOZ4BOoa9HKpjxNWXfTBAlV1tdQiVc1myKMmPnLQ==",
"requires": {
"@better-scroll/core": "^2.1.1",
"@qg/cherry-ui": "^2.23.9",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment