解决冲突

v1.0.0
于肖磊 2024-09-04 17:14:26 +08:00
commit 4bc458e605
7 changed files with 175 additions and 31 deletions

14
src/api/seckill.ts Normal file
View File

@ -0,0 +1,14 @@
import request from '@/utils/request';
class ShopAPI {
/** 分类品牌查询接口*/
static getSeckillList(data: any) {
return request({
url: `plugins/index/pluginsname/seckill/pluginscontrol/diyapi/pluginsaction/goods`,
method: 'post',
data,
});
}
}
export default ShopAPI;

View File

@ -61,19 +61,19 @@ const props = defineProps({
const form = reactive(props.value);
const emit = defineEmits(['update:value']);
const nav_style_change = (style: any) => {
form.nav_style = style;
form.value.nav_style = style;
emit('update:value', form);
};
const nav_type_change = (type: any) => {
form.nav_type = type;
form.value.nav_type = type;
emit('update:value', form);
};
const nav_content_remove = (index: number) => {
form.nav_content.splice(index, 1);
form.value.nav_content.splice(index, 1);
emit('update:value', form);
};
const add = () => {
form.nav_content.push({
form.value.nav_content.push({
id: get_math(),
name: '',
src: [],

View File

@ -0,0 +1,116 @@
<template>
<div class="footer-nav flex-row jc-c align-c" :class="showFooter ? 'br-2 br-primary' : ''" @click="footer_nav_event">
<div class="footer-nav-content flex-row jc-c align-c w" :style="style_container">
<ul class="flex-row jc-sa align-c w">
<li v-for="(item, index) in nav_content" :key="index" class="flex-1 flex-col jc-c align-c gap-5" @mouseenter="is_hover = index" @mouseleave="is_hover = 0">
<div v-if="footerData.content.nav_style !== '2'" class="img re">
<div class="img-item abs radius-xs animate-linear w" :class="is_hover != index ? 'active' : ''">
<image-empty v-model="item.src[0]" error-img-style="width:1.5rem;height:1.5rem;"></image-empty>
</div>
<div class="img-item abs radius-xs animate-linear w" :class="is_hover == index ? 'active' : ''">
<image-empty v-model="item.src_checked[0]" error-img-style="width:1.5rem;height:1.5rem;"></image-empty>
</div>
</div>
<span v-if="footerData.content.nav_style !== '1'" class="animate-linear size-12 re z-i" :style="is_hover == index ? text_color_checked : default_text_color">{{ item.name }}</span>
</li>
</ul>
</div>
</div>
</template>
<script setup lang="ts">
import { cloneDeep } from 'lodash';
import { common_styles_computer, online_url } from '@/utils';
import { footerNavCounterStore } from '@/store';
const footer_nav_counter_store = footerNavCounterStore();
const props = defineProps({
showFooter: {
type: Boolean,
default: false,
},
footerData: {
type: Object,
default: () => ({}),
},
});
const style_container = ref('');
const default_text_color = ref('');
const text_color_checked = ref('');
const is_hover = ref(0);
const nav_content = ref<any[]>([]);
watch(
props.footerData,
async (newVal, oldValue) => {
const new_content = newVal?.content || {};
const new_style = newVal?.style || {};
const url = await online_url('/static/app/tabbar/').then((res) => res);
const clone_nav_content = cloneDeep(new_content.nav_content);
nav_content.value =
clone_nav_content.map((item: any) => {
item.src = item.src.map((img: any) => {
return {
...img,
url: item.src.includes('/') ? img.url : url + img.url,
};
});
item.src_checked = item.src_checked.map((img: any) => {
return {
...img,
url: item.src_checked.includes('/') ? img.url : url + img.url,
};
});
return item;
}) || [];
default_text_color.value = 'color:' + new_style.default_text_color || 'rgba(0, 0, 0, 1)';
text_color_checked.value = 'color:' + new_style.text_color_checked || 'rgba(204, 204, 204, 1)';
style_container.value = common_styles_computer(new_style.common_style);
let footer_height = new_style.common_style.padding_top + new_style.common_style.padding_bottom + new_style.common_style.margin_top + new_style.common_style.margin_bottom + 50;
if (footer_height >= 70) {
footer_height = footer_height;
} else {
footer_height = 70;
}
footer_nav_counter_store.padding_footer_computer(footer_height);
},
{ immediate: true, deep: true }
);
const emits = defineEmits(['footer-nav']);
const footer_nav_event = () => {
emits('footer-nav');
};
</script>
<style lang="scss" scoped>
.footer-nav {
width: 39rem;
margin: 0 auto;
padding: 0rem;
cursor: pointer;
background-color: transparent;
.footer-nav-content {
min-height: 7rem;
.img {
width: 2rem;
height: 2rem;
.img-item {
width: 2.2rem;
height: 2.2rem;
opacity: 0;
&.active {
opacity: 1;
}
}
}
}
}
.br-2 {
&::before {
content: '';
position: absolute;
border: 0.2rem solid $cr-main;
inset: 0;
width: calc(100% + 0.4rem);
height: calc(100% + 0.4rem);
}
}
</style>

View File

@ -1,6 +1,5 @@
import { isEmpty } from 'lodash';
import { commonStore } from '@/store';
const { common } = commonStore();
// 定义一组预定义的颜色数组,用于在各种场景中轻松引用这些颜色
// 这些颜色包括从白色到黑色的不同灰度以及一些鲜艳的颜色格式有十六进制、RGB、RGBA、HSV、HSL等
export const predefine_colors = ['#fff', '#ddd', '#ccc', '#999', '#666', '#333', '#000', '#ff4500', '#ff8c00', '#ffd700', '#90ee90', '#00ced1', '#c71585', 'rgba(255, 69, 0, 0.68)', 'rgb(255, 120, 0)', 'hsv(51, 100, 98)', 'hsva(120, 40, 94, 0.5)', 'hsl(181, 100%, 37%)', '#1F93FF', '#c7158577'];
@ -336,6 +335,7 @@ export const tabs_style = (color: string, style: string | number | boolean | und
* @returns {Promise<string>} PromiseURL
*/
export const online_url = async (directory: string) => {
const { common } = commonStore();
const attachemnt_host = common.config.attachment_host;
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
let temp_data = await import(import.meta.env.VITE_APP_BASE_API == '/dev-api' ? '../../temp.d' : '../../temp_pro.d');

View File

@ -56,7 +56,7 @@ const defaultCoupoin: DefaultCoupon = {
background_inside: [{ color: '#FFF1E1', color_percentage: undefined }],
direction_inside: '90deg',
spacing: 20,
common_style: { ...defaultCommon, padding_left: 18, padding_right: 18, padding_top: 18, padding_bottom: 18, color_list: [{ color: '#fff', color_percentage: undefined }] },
common_style: { ...defaultCommon, padding_left: 10, padding_right: 10, padding_top: 10, padding_bottom: 10, color_list: [{ color: '#fff', color_percentage: undefined }] },
// 风格4字段
type_color: '#FF3830',

View File

@ -1,7 +1,11 @@
import defaultCommon from './index';
import { online_url } from '@/utils';
import { onActivated } from 'vue';
const new_url = await online_url('/static/app/tabbar/');
const new_url = ref('');
onActivated(async () => {
new_url.value = await online_url('/static/app/tabbar/').then((res) => res);
});
interface DefaultFooterNav {
content: {
nav_style: string;
@ -14,15 +18,15 @@ interface DefaultFooterNav {
common_style: object;
};
}
const defaultFooterNav: DefaultFooterNav = {
const defaultFooterNav = ref<DefaultFooterNav>({
content: {
nav_style: '0',
nav_type: '0',
nav_content: [
{ id: '1', name: '首页', src: [{ id: 1, url: new_url + 'home.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url + 'active/home.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
{ id: '2', name: '分类', src: [{ id: 1, url: new_url + 'category.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url + 'active/category.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
{ id: '3', name: '购物车', src: [{ id: 1, url: new_url + 'cart.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url + 'active/cart.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
{ id: '4', name: '我的', src: [{ id: 1, url: new_url + 'user.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url + 'active/user.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
{ id: '1', name: '首页', src: [{ id: 1, url: new_url.value + 'home.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url.value + 'active/home.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
{ id: '2', name: '分类', src: [{ id: 1, url: new_url.value + 'category.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url.value + 'active/category.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
{ id: '3', name: '购物车', src: [{ id: 1, url: new_url.value + 'cart.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url.value + 'active/cart.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
{ id: '4', name: '我的', src: [{ id: 1, url: new_url.value + 'user.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], src_checked: [{ id: 1, url: new_url.value + 'active/user.png', original: '头像1', title: '头像1', ext: '.png', type: 'img' }], href: {} },
],
},
style: {
@ -30,6 +34,6 @@ const defaultFooterNav: DefaultFooterNav = {
default_text_color: 'rgba(0, 0, 0, 1)',
common_style: { ...defaultCommon, color_list: [{ color: 'rgba(255,255,255,1)', color_percentage: undefined }] },
},
};
});
export default defaultFooterNav;

View File

@ -1,6 +1,13 @@
import defaultCommon from './index';
import { online_url } from '@/utils';
const new_url = await online_url('/static/plugins/seckill/images/diy/');
import { onMounted } from 'vue';
const new_url = ref('');
onMounted(() => {
online_url('/static/app/tabbar/').then((res) => {
new_url.value = res;
});
});
interface DefaultSeckill {
content: {
head_state: string;
@ -56,12 +63,12 @@ interface DefaultSeckill {
seckill_subscript_location: string;
seckill_subscript_text_color: string;
seckill_subscript_bg_color: string;
progress_bg_color: string,
progress_actived_color_list: color_list[],
progress_actived_direction: string,
progress_button_color: string,
progress_button_icon_color: string,
progress_text_color: string,
progress_bg_color: string;
progress_actived_color_list: color_list[];
progress_actived_direction: string;
progress_button_color: string;
progress_button_icon_color: string;
progress_text_color: string;
is_roll: boolean;
interval_time: number;
rolling_fashion: string;
@ -73,7 +80,7 @@ const defaultSeckill: DefaultSeckill = {
head_state: '1',
theme: '1',
topic_type: 'image',
topic_src: [{ id: 1, url: new_url + 'header-title.png', original: '标题', title: '标题', ext: '.png', type: 'img' }],
topic_src: [{ id: 1, url: new_url.value + 'header-title.png', original: '标题', title: '标题', ext: '.png', type: 'img' }],
topic_text: '限时秒杀',
button_status: '1',
button_text: '更多',
@ -86,7 +93,7 @@ const defaultSeckill: DefaultSeckill = {
shop_button_text: '去抢购',
shop_button_icon_class: '',
seckill_subscript_show: '1',
subscript_text: '秒杀'
subscript_text: '秒杀',
},
style: {
topic_color: '#fff',
@ -100,14 +107,14 @@ const defaultSeckill: DefaultSeckill = {
header_background_color_list: [{ color: '', color_percentage: undefined }],
header_background_direction: '180deg',
header_background_img_style: '2',
header_background_img_url: [{ id: 1, url: new_url + 'header-bg.png', original: '背景', title: '背景1', ext: '.png', type: 'img' }],
header_background_img_url: [{ id: 1, url: new_url.value + 'header-bg.png', original: '背景', title: '背景1', ext: '.png', type: 'img' }],
shop_radius: {
radius: 8,
radius_top_left: 8,
radius_top_right: 8,
radius_bottom_left: 8,
radius_bottom_right: 8,
} ,
},
shop_img_radius: {
radius: 4,
radius_top_left: 4,
@ -116,18 +123,18 @@ const defaultSeckill: DefaultSeckill = {
radius_bottom_right: 4,
},
shop_padding: {
padding: 10,
padding_top: 10,
padding_bottom: 10,
padding_left: 10,
padding: 10,
padding_top: 10,
padding_bottom: 10,
padding_left: 10,
padding_right: 10,
},
content_outer_spacing: 10, // 商品间距
content_spacing: 10,
content_outer_height: 232,
shop_title_typeface: '500',
shop_title_size: 14,
shop_title_color: "#333333",
shop_title_size: 14,
shop_title_color: '#333333',
shop_price_typeface: '500',
shop_price_size: 18,
shop_price_color: "#EA3323;",
@ -151,7 +158,10 @@ const defaultSeckill: DefaultSeckill = {
seckill_subscript_text_color: '#fff',
seckill_subscript_bg_color: '#FF7607',
progress_bg_color: '#FFEDED',
progress_actived_color_list: [{ color: '#FF3131', color_percentage: undefined }, { color: '#FF973D', color_percentage: undefined }],
progress_actived_color_list: [
{ color: '#FF3131', color_percentage: undefined },
{ color: '#FF973D', color_percentage: undefined },
],
progress_actived_direction: '180deg',
progress_button_color: '#FFDE81',
progress_button_icon_color: '#FF2525',