1.代码注释

v1.0.0
sws 2024-10-18 15:57:45 +08:00
parent 95dacb4c92
commit f18e756514
23 changed files with 102 additions and 10 deletions

View File

@ -12,8 +12,8 @@
import { common_img_computer, common_styles_computer } from '@/utils';
import { cloneDeep } from 'lodash';
/**
* @description: 文章选项卡列表渲染
* @param value{Object} 样式数据
* @description: 文章选项卡列表 渲染
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
value: {

View File

@ -100,7 +100,7 @@ import { get_math, tabs_style } from '@/utils';
import { commonStore } from '@/store';
const common_store = commonStore();
/**
* @description: 文章选项卡列表内容
* @description: 文章选项卡列表 内容
* @param value{Object} 内容数据
* @param tabsStyle{Object} tabs样式数据
* @param defaultConfig{Object} 默认配置

View File

@ -10,7 +10,7 @@
</template>
<script setup lang="ts">
/**
* @description: 文章选项卡列表设置
* @description: 文章选项卡列表 设置
* @param type{String} 类型1内容2样式
* @param value{Object} 传过来的数据用于数据渲染
*/

View File

@ -85,7 +85,7 @@
</template>
<script setup lang="ts">
/**
* @description: 文章选项卡列表样式
* @description: 文章选项卡列表 样式
* @param value{Object} 样式数据
* @param content{Object} 内容数据
* @param defaultConfig{Object} 默认配置

View File

@ -147,7 +147,7 @@ const common_store = commonStore();
const currency_symbol = common_store.common.config.currency_symbol;
/**
* @description: 优惠券渲染
* @param value{Object} 样式数据
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
value: {

View File

@ -27,6 +27,7 @@ const props = defineProps({
});
const form = ref(props.value);
const new_url = ref('');
//
const default_config = ref({
style: {
theme_1: {
@ -205,10 +206,12 @@ const default_config = ref({
},
},
});
//
onMounted(async () => {
new_url.value = await online_url('/static/plugins/coupon/images/diy/').then((res) => res);
default_config.value.common_style.theme_2.background_img = [{ url: new_url.value + 'theme-2-bg.png' }];
});
//
const change_theme = (val: string) => {
if (val) {
if (val == '2') {

View File

@ -61,6 +61,11 @@
</template>
<script setup lang="ts">
import { cloneDeep } from 'lodash';
/**
* @description: 优惠券样式
* @param value{Object} 样式数据
* @param theme{String} 主题
*/
const props = defineProps({
value: {
type: Object,
@ -76,22 +81,26 @@ const emit = defineEmits(['update:value']);
let form = reactive(props.value);
let clone_form = cloneDeep(props.value);
//
const background_event = (arry: color_list[], type: number) => {
form.background = arry;
form.direction = type.toString();
emit('update:value', form);
};
//
const background_inside_event = (arry: color_list[], type: number) => {
form.background_inside = arry;
form.direction_inside = type.toString();
emit('update:value', form);
};
//
const btn_background_event = (arry: color_list[], type: number) => {
form.btn_background = arry;
form.btn_direction = type.toString();
emit('update:value', form);
};
//
const common_styles_update = (val: Object) => {
form.common_style = val;
};

View File

@ -10,6 +10,10 @@
</template>
<script setup lang="ts">
import { common_img_computer, common_styles_computer } from '@/utils';
/**
* @description: 热区渲染
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
value: {
type: Object,
@ -45,7 +49,7 @@ watch(
},
{ immediate: true, deep: true }
);
//
const on_load_img = () => {
container_ref_h.value = containerRef.value?.clientHeight || 0;
container_ref_w.value = containerRef.value?.clientWidth || 0;
@ -57,6 +61,7 @@ const w_scale1 = computed(() => {
// 使
return container_ref_h.value / img_width.value;
});
// containerRef
const h_scale1 = computed(() => {
return container_ref_h.value / img_height.value;
});
@ -64,10 +69,11 @@ const h_scale1 = computed(() => {
const w_scale2 = computed(() => {
return hot_ref_w.value / container_ref_h.value;
});
// hotRef
const h_scale2 = computed(() => {
return hot_ref_h.value / container_ref_h.value;
});
//
const rect_style = computed(() => {
return (start: rectCoords, end: rectCoords) => {
return `left: ${start.x * w_scale1.value * w_scale2.value}px;top: ${start.y * h_scale1.value * h_scale2.value}px;width: ${Math.max(end.width * w_scale1.value * w_scale2.value, 1)}px;height: ${Math.max(end.height * h_scale1.value * h_scale2.value, 1)}px;display: flex;`;

View File

@ -12,6 +12,10 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 热曲内容
* @param value{Object} 内容数据
*/
const props = defineProps({
value: {
type: Object,
@ -22,7 +26,7 @@ const props = defineProps({
},
});
const form = ref(props.value);
//
const update_upload_data = (val: any) => {
if (val.length > 0) {
form.value.hot.img = val[0].url;

View File

@ -9,6 +9,11 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 热区设置
* @param type{String} 类型1内容2样式
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
type: {
type: String,

View File

@ -4,6 +4,10 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 热区样式
* @param value{Object} 样式数据
*/
const props = defineProps({
value: {
type: Object,
@ -14,6 +18,7 @@ const props = defineProps({
});
//
let form = ref(props.value);
//
const common_styles_update = (val: Object) => {
form.value.common_style = val;
};

View File

@ -9,6 +9,10 @@
import { common_img_computer, common_styles_computer } from '@/utils';
// dompurify HTMLDOMXSS
import DOMPurify from 'dompurify';
/**
* @description: 富文本渲染
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
value: {
type: Object,

View File

@ -15,6 +15,10 @@
<script setup lang="ts">
import '@wangeditor/editor/dist/css/style.css'; // css
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
/**
* @description: 富文本内容
* @param value{Object} 内容数据
*/
const props = defineProps({
value: {
type: Object,
@ -40,6 +44,7 @@ const rich_upload_type = ref('img');
interface InsertFnType {
(url: string, alt?: string, link?: string): void;
}
//
const editor_config = ref({
placeholder: '请输入内容...',
MENU_CONF: {
@ -66,14 +71,17 @@ const editor_config = ref({
});
//
const upload_insert = ref<any>(null);
//
const handle_created = (editor: any) => {
editor_ref.value = editor; // editor
};
const emit = defineEmits(['update:value']);
//
const handle_change = (editor: any) => {
form.html = editor.getHtml();
};
//
const upload_list_change = (arry: uploadList[]) => {
const editor = editor_ref.value;
let new_html = '';

View File

@ -9,6 +9,11 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 富文本设置
* @param type{String} 类型1内容2样式
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
type: {
type: String,

View File

@ -4,6 +4,10 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 富文本样式
* @param value{Object} 样式数据
*/
const props = defineProps({
value: {
type: Object,
@ -15,6 +19,7 @@ const props = defineProps({
const emit = defineEmits(['update:value']);
//
let form = reactive(props.value);
//
const common_styles_update = (val: Object) => {
form.common_style = val;
};

View File

@ -31,6 +31,10 @@
</template>
<script setup lang="ts">
import { common_styles_computer, gradient_computer, common_img_computer } from '@/utils';
/**
* @description: 用户信息渲染
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
value: {
type: Object,
@ -58,6 +62,7 @@ const icon_setting = ref<icon_params[]>([
{ id: '1', img: [], icon: '', link: {} },
{ id: '2', img: [], icon: '', link: {} },
]);
//
const base_data = reactive({
//
user_avatar_size: '60',
@ -102,6 +107,7 @@ const user_name_style = ref('');
const number_code_style = ref('');
const stats_name_style = ref('');
const stats_number_style = ref('');
//
watch(
props.value,
(newVal, oldValue) => {

View File

@ -28,6 +28,10 @@
</template>
<script setup lang="ts">
import { get_math } from '@/utils';
/**
* @description: 用户信息内容
* @param value{Object} 内容数据
*/
const props = defineProps({
value: {
type: Object,

View File

@ -9,6 +9,11 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 用户信息设置
* @param type{String} 类型1内容2样式
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
type: {
type: String,

View File

@ -99,7 +99,10 @@
</div>
</template>
<script setup lang="ts">
import { omit } from 'lodash';
/**
* @description: 用户信息 样式
* @param value{Object} 样式数据
*/
const props = defineProps({
value: {
type: Object,
@ -112,10 +115,12 @@ const font_weight = reactive([
]);
//
let form = ref(props.value);
//
const mult_color_picker_event = (arry: string[], type: number) => {
form.value.number_code_color_list = arry;
form.value.number_code_direction = type.toString();
};
//
const common_styles_update = (val: Object) => {
form.value.common_style = val;
};

View File

@ -15,6 +15,10 @@
</template>
<script setup lang="ts">
import { common_styles_computer, common_img_computer } from '@/utils';
/**
* @description: 视频 渲染
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
value: {
type: Object,

View File

@ -21,6 +21,10 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 视频 内容
* @param value{Object} 内容数据
*/
const props = defineProps({
value: {
type: Object,

View File

@ -9,6 +9,11 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 视频 设置
* @param type{String} 类型1内容2样式
* @param value{Object} 传过来的数据用于数据渲染
*/
const props = defineProps({
type: {
type: String,

View File

@ -4,6 +4,10 @@
</div>
</template>
<script setup lang="ts">
/**
* @description: 视频 样式
* @param value{Object} 样式数据
*/
const props = defineProps({
value: {
type: Object,
@ -15,6 +19,7 @@ const props = defineProps({
const emit = defineEmits(['update:value']);
//
let form = reactive(props.value);
//
const common_styles_update = (val: Object) => {
form.common_style = val;
};