main-zjh #127

Merged
root merged 4 commits from main-zjh into master 2025-04-27 05:49:15 +00:00
Showing only changes of commit bb97bfc337 - Show all commits

View File

@ -0,0 +1,137 @@
<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="mainBottom">
<div class='item' :class="currItem == 1 ? 'on' : ''" @click="clickItem(1)">
<img class="img"
src="https://zysc.fjptzykj.com/admin-api/infra/file/25/get/9349d776503051646314323aced460314415a04c943dc220e9e5b86362f864dd.png" />
<div class="text">样式1</div>
</div>
<!-- <div class='item' :class="currItem == 2 ? 'on' : ''" @click="clickItem(2)">
<img class="img"
src="https://zysc.fjptzykj.com/admin-api/infra/file/25/get/909ef630cff7cdc957962ae782ee9a882c86c35732140b1c9e013341fa559126.jpg" />
<div class="text">样式2</div>
</div> -->
</div>
</div>
</template>
<script setup lang="ts">
// TODO @ decorate index.vue
import * as DiyTemplateApi from '@/api/mall/promotion/diy/template'
import { useTagsdivStore } from '@/store/modules/tagsdiv'
import { DiyComponentLibrary, PAGE_LIBS } from '@/components/DiyEditor/util' // DIY DiyEditor
import { toNumber } from 'lodash-es'
const message = useMessage() //
const currItem = ref();
function clickItem(val) {
currItem.value = val;
}
function cz(val) {
currItem.value = 1;
}
function save() {
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>
.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;
}
}
}
.mainBottom {
width: 100%;
margin: 10px 10px;
background: white;
padding: 30px 30px;
display: flex;
.item {
margin-right: 20px;
text-align: center;
border-radius: 12px;
cursor: pointer;
&.on {
.text {
color: #0256ff;
}
.img {
border: 2px solid #0256ff;
}
}
.img {
width: 260px;
border-radius: 12px;
border: 2px solid white;
}
.text {
margin-top: 10px;
}
}
}
}
</style>