修改选中效果

v1.0.0
于肖磊 2024-08-27 19:00:51 +08:00
parent bc8168fae0
commit 87d94d67e1
3 changed files with 27 additions and 11 deletions

View File

@ -17,7 +17,7 @@
</el-form-item>
<el-form-item label="按钮样式">
<div class="flex-col w gap-10">
<el-radio-group v-model="form.shop_type">
<el-radio-group v-model="form.shop_type" @change="change_shop_type">
<el-radio v-for="item in base_list.shopping_button_list" :key="item.value" :value="item.value">{{ item.name }}</el-radio>
</el-radio-group>
<template v-if="form.shop_type == 'text'">
@ -69,6 +69,10 @@ const base_list = {
{ name: '商品加购', value: '1' }
]
};
const emit = defineEmits(['change_shop_type']);
const change_shop_type = () => {
emit('change_shop_type');
}
</script>
<style lang="scss" scoped>

View File

@ -50,7 +50,7 @@
</template>
</card-container>
<!-- 商品显示的配置信息 -->
<product-show-config :value="form"></product-show-config>
<product-show-config :value="form" @change_shop_type="change_shop_type"></product-show-config>
</div>
<url-value-dialog v-model:dialog-visible="url_value_dialog_visible" :type="['goods']" multiple @update:model-value="url_value_dialog_call_back"></url-value-dialog>
</el-form>
@ -152,12 +152,18 @@ const goods_list_sort = (new_list: any) => {
//
const change_style = (val: any): void => {
form.value.theme = val;
if (['3', '4', '5'].includes(val) && form.value.shop_type == 'text') {
form.value.shop_type = 'icon';
} else if (['0', '1', '2'].includes(val) && form.value.shop_type == 'icon') {
form.value.shop_type = 'text';
if (!is_revise.value) {
if (['3', '4', '5'].includes(val) && form.value.shop_type == 'text') {
form.value.shop_type = 'icon';
} else if (['0', '1', '2'].includes(val) && form.value.shop_type == 'icon') {
form.value.shop_type = 'text';
}
}
};
const is_revise = ref(false);
const change_shop_type = () => {
is_revise.value = true;
}
</script>
<style lang="scss" scoped>
.content {

View File

@ -77,7 +77,7 @@
</div>
</card-container>
<!-- 商品显示的配置信息 -->
<product-show-config :value="form"></product-show-config>
<product-show-config :value="form" @change_shop_type="change_shop_type"></product-show-config>
<url-value-dialog v-model:dialog-visible="url_value_dialog_visible" :type="['goods']" multiple @update:model-value="url_value_dialog_call_back"></url-value-dialog>
</el-form>
</div>
@ -229,12 +229,18 @@ const tabs_theme_change = (val: string | number | boolean | undefined):void => {
//
const change_style = (val: any): void => {
form.value.theme = val;
if (['3', '4', '5'].includes(val) && form.value.shop_type == 'text') {
form.value.shop_type = 'icon';
} else if (['0', '1', '2'].includes(val) && form.value.shop_type == 'icon') {
form.value.shop_type = 'text';
if (!is_revise.value) {
if (['3', '4', '5'].includes(val) && form.value.shop_type == 'text') {
form.value.shop_type = 'icon';
} else if (['0', '1', '2'].includes(val) && form.value.shop_type == 'icon') {
form.value.shop_type = 'text';
}
}
};
const is_revise = ref(false);
const change_shop_type = () => {
is_revise.value = true;
}
</script>
<style lang="scss" scoped>
.content {