2024-11-07 16:01:15 +08:00
|
|
|
|
<template>
|
|
|
|
|
<div class="main">
|
|
|
|
|
<div class="mainTop">
|
|
|
|
|
<div>主题风格</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<div class="save" @click="save">保存</div>
|
|
|
|
|
<!-- <div class="cz" @click="cz">重置</div> -->
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="ztfg">
|
|
|
|
|
<div class='top'>
|
2024-11-08 17:27:58 +08:00
|
|
|
|
<div class="item" :class="currItem== '' ? 'on': ''" @click="clickItem('')">
|
|
|
|
|
<div class="le" style="background: rgb(233, 52, 34);"></div>
|
|
|
|
|
<div class="ri">红色</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item" :class="currItem== 'blue' ? 'on': ''" @click="clickItem('blue')">
|
2024-11-07 16:01:15 +08:00
|
|
|
|
<div class="le"></div>
|
|
|
|
|
<div class="ri">天空蓝</div>
|
|
|
|
|
</div>
|
2024-11-08 17:27:58 +08:00
|
|
|
|
<div class="item" :class="currItem== 'lv' ? 'on': ''" @click="clickItem('lv')">
|
2024-11-07 16:01:15 +08:00
|
|
|
|
<div class="le" style="background:rgb(66, 202, 77);"></div>
|
|
|
|
|
<div class="ri">生鲜绿</div>
|
|
|
|
|
</div>
|
2024-11-12 18:13:06 +08:00
|
|
|
|
<div class="item" :class="currItem== 'pink' ? 'on': ''" @click="clickItem('pink')">
|
|
|
|
|
<div class="le" style="background:#ff448f;"></div>
|
|
|
|
|
<div class="ri">魅力粉</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="item" :class="currItem== 'orange' ? 'on': ''" @click="clickItem('orange')">
|
|
|
|
|
<div class="le" style="background:#fe5c2d;"></div>
|
|
|
|
|
<div class="ri">活力橙</div>
|
|
|
|
|
</div>
|
2024-11-07 16:01:15 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class="mainBottom">
|
2024-11-08 17:27:58 +08:00
|
|
|
|
<div class='item' v-show="currItem== ''">
|
|
|
|
|
<img class="img"
|
2025-04-15 16:39:44 +08:00
|
|
|
|
src="https://zysc.fjptzykj.com/admin-api/infra/file/25/get/f973a0a4648d476a25b14a29250356d065507a1b9134b6303d7acd0b2d2d9cc7.jpg"/>
|
2024-11-08 17:27:58 +08:00
|
|
|
|
</div>
|
2025-04-15 16:39:44 +08:00
|
|
|
|
|
2024-11-08 17:27:58 +08:00
|
|
|
|
<div class='item' v-show="currItem== 'blue'">
|
2024-11-07 16:01:15 +08:00
|
|
|
|
<img class="img"
|
2025-04-15 16:39:44 +08:00
|
|
|
|
src="https://zysc.fjptzykj.com/admin-api/infra/file/25/get/f2c0e04f8491b618d691eb95c3df2f89ba565134cacc9b4e39ff96caa4d1cec0.jpg" />
|
2024-11-07 16:01:15 +08:00
|
|
|
|
</div>
|
2024-11-08 17:27:58 +08:00
|
|
|
|
<div class='item' v-show="currItem== 'lv'">
|
2024-11-07 16:01:15 +08:00
|
|
|
|
<img class="img"
|
2025-04-15 16:39:44 +08:00
|
|
|
|
src="https://zysc.fjptzykj.com/admin-api/infra/file/25/get/1ba06619f3f87677b51dd735b03e0378da352abbe47b188dd43c58262ed47cca.jpg" />
|
2024-11-07 16:01:15 +08:00
|
|
|
|
</div>
|
2024-11-12 18:13:06 +08:00
|
|
|
|
<div class='item' v-show="currItem== 'pink'">
|
|
|
|
|
<img class="img"
|
2025-04-15 16:39:44 +08:00
|
|
|
|
src="https://zysc.fjptzykj.com/admin-api/infra/file/25/get/13fd006f8883b492db10df8f1d03347b88c8836e68a603db874fd68bc01c7a71.jpg" />
|
2024-11-12 18:13:06 +08:00
|
|
|
|
</div>
|
|
|
|
|
<div class='item' v-show="currItem== 'orange'">
|
|
|
|
|
<img class="img"
|
2025-04-15 16:39:44 +08:00
|
|
|
|
src="https://zysc.fjptzykj.com/admin-api/infra/file/25/get/da61c583680494e23a31f39acbb0246cf1d439080ceb53d85dc564da2c1ecfe9.jpg" />
|
2024-11-12 18:13:06 +08:00
|
|
|
|
</div>
|
2024-11-07 16:01:15 +08:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
// TODO @疯狂:要不要建个 decorate 目录,然后挪进去,改成 index.vue,这样可以更明确看到是个独立界面哈,更好找
|
|
|
|
|
import * as DiyTemplateApi from '@/api/mall/promotion/diy/template'
|
|
|
|
|
import * as DiyPageApi from '@/api/mall/promotion/diy/page'
|
|
|
|
|
import { useTagsdivStore } from '@/store/modules/tagsdiv'
|
|
|
|
|
import { DiyComponentLibrary, PAGE_LIBS } from '@/components/DiyEditor/util' // 商城的 DIY 组件,在 DiyEditor 目录下
|
|
|
|
|
import { toNumber } from 'lodash-es'
|
2024-11-08 17:27:58 +08:00
|
|
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
const currItem = ref('blue');
|
2024-11-07 16:01:15 +08:00
|
|
|
|
|
|
|
|
|
function clickItem(val) {
|
|
|
|
|
currItem.value = val;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function cz(val) {
|
2024-11-08 17:27:58 +08:00
|
|
|
|
currItem.value = 'blue';
|
2024-11-07 16:01:15 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function save() {
|
2024-11-08 17:27:58 +08:00
|
|
|
|
const val = '';
|
2024-11-07 16:01:15 +08:00
|
|
|
|
// currItem.value = val;
|
2024-11-08 17:27:58 +08:00
|
|
|
|
if(currItem.value == 'lv'){
|
|
|
|
|
setZtClass('lv')
|
|
|
|
|
}else if(currItem.value == 'blue'){
|
|
|
|
|
setZtClass('blue')
|
2024-11-12 18:13:06 +08:00
|
|
|
|
}else if(currItem.value == 'pink'){
|
|
|
|
|
setZtClass('pink')
|
|
|
|
|
}else if(currItem.value == 'orange'){
|
|
|
|
|
setZtClass('orange')
|
2024-11-08 17:27:58 +08:00
|
|
|
|
}else{
|
|
|
|
|
setZtClass('')
|
|
|
|
|
}
|
|
|
|
|
// console.log("请求接口还没有写啊!!!!快让后端提供啊")
|
|
|
|
|
}
|
2025-04-15 16:39:44 +08:00
|
|
|
|
|
2024-11-08 17:27:58 +08:00
|
|
|
|
// 设置主题风格
|
|
|
|
|
const setZtClass = async (id) => {
|
|
|
|
|
const res = await DiyTemplateApi.setDiyZtClass(id);
|
|
|
|
|
console.log(res, "sssss");
|
|
|
|
|
if(res || res == ''){
|
|
|
|
|
message.success('保存成功')
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-04-15 16:39:44 +08:00
|
|
|
|
|
2024-11-08 17:27:58 +08:00
|
|
|
|
// 获取商品分类
|
|
|
|
|
const getZtClass = async () => {
|
|
|
|
|
const res = await DiyTemplateApi.getDiyZtClass();
|
|
|
|
|
currItem.value = res
|
2024-11-07 16:01:15 +08:00
|
|
|
|
}
|
2024-11-08 17:27:58 +08:00
|
|
|
|
getZtClass()
|
2024-11-07 16:01:15 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.main {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
|
|
.mainTop {
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin: 10px 10px;
|
|
|
|
|
background: white;
|
|
|
|
|
padding: 10px 20px;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
div {
|
|
|
|
|
padding: 5px 15px;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.save {
|
|
|
|
|
background: #0256FF;
|
|
|
|
|
margin-right: 10px;
|
|
|
|
|
color: white;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.cz {
|
|
|
|
|
border: 1px solid #cccccc;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ztfg {
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin: 10px 10px;
|
|
|
|
|
background: white;
|
|
|
|
|
padding: 30px 30px;
|
|
|
|
|
.top{
|
|
|
|
|
display: flex;
|
|
|
|
|
margin-bottom: 10px;
|
|
|
|
|
.item{
|
|
|
|
|
padding:10px 15px;
|
|
|
|
|
border:1px solid #cccccc;
|
|
|
|
|
border-radius:6px;
|
|
|
|
|
margin-right:10px;
|
|
|
|
|
display:flex;
|
|
|
|
|
align-items:center;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
&.on{
|
|
|
|
|
border:1px solid #0256ff;
|
|
|
|
|
}
|
|
|
|
|
.le{
|
|
|
|
|
margin-right:10px;
|
|
|
|
|
border-radius:6px;
|
|
|
|
|
width:25px;
|
|
|
|
|
height:25px;
|
|
|
|
|
background:rgb(28, 165, 233);
|
|
|
|
|
}
|
|
|
|
|
.ti{
|
2025-04-15 16:39:44 +08:00
|
|
|
|
|
2024-11-07 16:01:15 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
.mainBottom {
|
2025-04-15 16:39:44 +08:00
|
|
|
|
|
2024-11-07 16:01:15 +08:00
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
|
|
.item {
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
|
|
|
|
|
// &.on {
|
|
|
|
|
// .text {
|
|
|
|
|
// color: #0256ff;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// .img {
|
|
|
|
|
// border: 2px solid #0256ff;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
.img {
|
|
|
|
|
width: 800px;
|
|
|
|
|
border-radius: 12px;
|
|
|
|
|
border: 2px solid white;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.text {
|
|
|
|
|
margin-top: 10px;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2025-04-15 16:39:44 +08:00
|
|
|
|
</style>
|