Branch_chensl #113
@ -56,3 +56,32 @@ export const getDiyTemplateProperty = async (id: number) => {
|
||||
export const updateDiyTemplateProperty = async (data: DiyTemplateVO) => {
|
||||
return await request.put({ url: `/promotion/diy-template/update-property`, data })
|
||||
}
|
||||
|
||||
|
||||
// 设置商品分类接口
|
||||
export const setDiyProjuctClass = async (id) => {
|
||||
return await request.get({
|
||||
url: `/system/dict-data/diy-template-goods?id=` + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获取商品分类接口
|
||||
export const getDiyProjuctClass = async () => {
|
||||
return await request.get({
|
||||
url: `/system/dict-data/getGoods`
|
||||
})
|
||||
}
|
||||
|
||||
// 设置主题风格
|
||||
export const setDiyZtClass = async (id) => {
|
||||
return await request.get({
|
||||
url: `/system/dict-data/diy-template-theme?id=` + id
|
||||
})
|
||||
}
|
||||
|
||||
// 获取主题风格
|
||||
export const getDiyZtClass = async () => {
|
||||
return await request.get({
|
||||
url: `/system/dict-data/getTheme`
|
||||
})
|
||||
}
|
@ -9,11 +9,11 @@
|
||||
</div>
|
||||
|
||||
<div class="mainBottom">
|
||||
<div class='item' :class="currItem== 1 ? 'on': ''" @click="clickItem(1)">
|
||||
<div class='item' :class="currItem == 1 ? 'on': ''" @click="clickItem(1)">
|
||||
<img class="img" src="https://zysc.fjptzykj.com:3000/shangcheng/a7d0409cbf5335a2780409756914c530fc7c88bec85fc81302b53760d9be4a03.jpg" />
|
||||
<div class="text">样式1</div>
|
||||
</div>
|
||||
<div class='item' :class="currItem== 2 ? 'on': ''" @click="clickItem(2)">
|
||||
<div class='item' :class="currItem == 2 ? 'on': ''" @click="clickItem(2)">
|
||||
<img class="img" src="https://zysc.fjptzykj.com:3000/shangcheng/9096b2c04a6e46ea562999a93a1b975100c6b4557e680dcb31de6d3555407841.png" />
|
||||
<div class="text">样式2</div>
|
||||
</div>
|
||||
@ -23,12 +23,11 @@
|
||||
<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'
|
||||
|
||||
const currItem = ref(1);
|
||||
const message = useMessage() // 消息弹窗
|
||||
const currItem = ref();
|
||||
|
||||
function clickItem (val){
|
||||
currItem.value = val;
|
||||
@ -39,9 +38,25 @@
|
||||
}
|
||||
|
||||
function save (){
|
||||
// currItem.value = val;
|
||||
console.log("请求接口还没有写啊!!!!快让后端提供啊")
|
||||
setProjuctClass(currItem.value);
|
||||
// console.log("请求接口还没有写啊!!!!快让后端提供啊")
|
||||
}
|
||||
|
||||
// 设置商品分类
|
||||
const setProjuctClass = async (id) => {
|
||||
const res = await DiyTemplateApi.setDiyProjuctClass(id);
|
||||
console.log(res, "sssss");
|
||||
if(res){
|
||||
message.success('保存成功')
|
||||
}
|
||||
}
|
||||
|
||||
// 获取商品分类
|
||||
const getProjuctClass = async () => {
|
||||
const res = await DiyTemplateApi.getDiyProjuctClass();
|
||||
currItem.value = res
|
||||
}
|
||||
getProjuctClass()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@ -10,21 +10,30 @@
|
||||
|
||||
<div class="ztfg">
|
||||
<div class='top'>
|
||||
<div class="item" :class="currItem== 1 ? 'on': ''" @click="clickItem(1)">
|
||||
<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')">
|
||||
<div class="le"></div>
|
||||
<div class="ri">天空蓝</div>
|
||||
</div>
|
||||
<div class="item" :class="currItem== 2 ? 'on': ''" @click="clickItem(2)">
|
||||
<div class="item" :class="currItem== 'lv' ? 'on': ''" @click="clickItem('lv')">
|
||||
<div class="le" style="background:rgb(66, 202, 77);"></div>
|
||||
<div class="ri">生鲜绿</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mainBottom">
|
||||
<div class='item' v-show="currItem== 1">
|
||||
<div class='item' v-show="currItem== ''">
|
||||
<img class="img"
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/667bbed3e719df73217b10d743eb880c1719cb294b6f50a81f78f597fdbcf351.png" style="width:300px;" />
|
||||
</div>
|
||||
|
||||
<div class='item' v-show="currItem== 'blue'">
|
||||
<img class="img"
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/4bffe9f0cee9605262a579ee45156c9e37a16e2a24035a0e49b8a4433075f793.jpg" />
|
||||
</div>
|
||||
<div class='item' v-show="currItem== 2">
|
||||
<div class='item' v-show="currItem== 'lv'">
|
||||
<img class="img"
|
||||
src="https://zysc.fjptzykj.com:3000/shangcheng/0d0a7ab210afb5cee674e402ca3ec197a30523687acbec2e8e5f16fb52075e9b.jpg" />
|
||||
</div>
|
||||
@ -39,21 +48,45 @@
|
||||
import { useTagsdivStore } from '@/store/modules/tagsdiv'
|
||||
import { DiyComponentLibrary, PAGE_LIBS } from '@/components/DiyEditor/util' // 商城的 DIY 组件,在 DiyEditor 目录下
|
||||
import { toNumber } from 'lodash-es'
|
||||
|
||||
const currItem = ref(1);
|
||||
const message = useMessage() // 消息弹窗
|
||||
const currItem = ref('blue');
|
||||
|
||||
function clickItem(val) {
|
||||
currItem.value = val;
|
||||
}
|
||||
|
||||
function cz(val) {
|
||||
currItem.value = 1;
|
||||
currItem.value = 'blue';
|
||||
}
|
||||
|
||||
function save() {
|
||||
const val = '';
|
||||
// currItem.value = val;
|
||||
console.log("请求接口还没有写啊!!!!快让后端提供啊")
|
||||
if(currItem.value == 'lv'){
|
||||
setZtClass('lv')
|
||||
}else if(currItem.value == 'blue'){
|
||||
setZtClass('blue')
|
||||
}else{
|
||||
setZtClass('')
|
||||
}
|
||||
// console.log("请求接口还没有写啊!!!!快让后端提供啊")
|
||||
}
|
||||
|
||||
// 设置主题风格
|
||||
const setZtClass = async (id) => {
|
||||
const res = await DiyTemplateApi.setDiyZtClass(id);
|
||||
console.log(res, "sssss");
|
||||
if(res || res == ''){
|
||||
message.success('保存成功')
|
||||
}
|
||||
}
|
||||
|
||||
// 获取商品分类
|
||||
const getZtClass = async () => {
|
||||
const res = await DiyTemplateApi.getDiyZtClass();
|
||||
currItem.value = res
|
||||
}
|
||||
getZtClass()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
Loading…
Reference in New Issue
Block a user