zsk 11 months ago
parent 6bd83f0157
commit bbeda9e09f

@ -1,6 +1,6 @@
import request from "../utils/request"; import request from "../utils/request";
// 获取轮播列表 // 获取中奖列表
export function getCarouselListApi(page, limit = 10) { export function getCarouselListApi(page, limit = 10) {
return request({ return request({
url: `/admin/banner/${page}/${limit}`, url: `/admin/banner/${page}/${limit}`,
@ -8,7 +8,7 @@ export function getCarouselListApi(page, limit = 10) {
}); });
} }
// 保存轮播 // 保存中奖
export function saveCarouselApi(data) { export function saveCarouselApi(data) {
return request({ return request({
url: `/admin/banner/save`, url: `/admin/banner/save`,
@ -17,7 +17,7 @@ export function saveCarouselApi(data) {
}); });
} }
// 删除轮播 // 删除中奖
export function deleteCarouselApi(id) { export function deleteCarouselApi(id) {
return request({ return request({
url: `/admin/banner/remove/${id}`, url: `/admin/banner/remove/${id}`,
@ -25,7 +25,7 @@ export function deleteCarouselApi(id) {
}); });
} }
// 修改轮播 // 修改中奖
export function updateCarouselApi(data) { export function updateCarouselApi(data) {
return request({ return request({
url: `/admin/banner/update`, url: `/admin/banner/update`,

@ -52,7 +52,7 @@ const router = createRouter({
path: "/merchantManagement/message", path: "/merchantManagement/message",
name: "message", name: "message",
meta: { meta: {
title: '轮播管理', title: '中奖管理',
}, },
component: () => import("../views/message/index.vue") component: () => import("../views/message/index.vue")
}, },

@ -63,7 +63,7 @@ export let mockMenuList = {
"createTime": "", "createTime": "",
"updateTime": "", "updateTime": "",
"deleted": 0, "deleted": 0,
"title": "轮播管理", "title": "中奖管理",
"menuName": "message", "menuName": "message",
"parentName": "", "parentName": "",
"path": "message", "path": "message",

@ -48,7 +48,7 @@
</template> </template>
<script setup> <script setup>
/* /*
* @params list 展示的数组 * @params list 展示的数组
* @params size 尺寸对象形式存放图片的宽高 * @params size 尺寸对象形式存放图片的宽高
* @params num 默认显示的数量数值类型 * @params num 默认显示的数量数值类型

@ -92,7 +92,7 @@
<div class="g_c_7 desc" v-if="info.desc_yq == '-'"></div> <div class="g_c_7 desc" v-if="info.desc_yq == '-'"></div>
<div v-html="info.desc_yq || '-'" style="white-space: pre-line" class="g_c_7 desc" v-else></div> <div v-html="info.desc_yq || '-'" style="white-space: pre-line" class="g_c_7 desc" v-else></div>
</div> </div>
<!-- 轮播 --> <!-- 中奖 -->
<div class="m-swiper-box" style="padding-top: 0.8rem; border-top: 1px solid #f5f5f5"> <div class="m-swiper-box" style="padding-top: 0.8rem; border-top: 1px solid #f5f5f5">
<div v-if="info.list.length == 0"> <div v-if="info.list.length == 0">
<img src="../../../assets/image/shareJob/nopicture.png" class="empty-img" /> <img src="../../../assets/image/shareJob/nopicture.png" class="empty-img" />

@ -41,7 +41,7 @@
<a-modal <a-modal
v-model:visible="modalVisible" v-model:visible="modalVisible"
:title="modalMode === 'add' ? '新增轮播图' : '编辑轮播图'" :title="modalMode === 'add' ? '新增中奖图' : '编辑中奖图'"
@ok="handleModalOk" @ok="handleModalOk"
@cancel="handleModalCancel" @cancel="handleModalCancel"
width="800px" width="800px"
@ -146,7 +146,7 @@ const handleModalOk = async () => {
try { try {
const data = { const data = {
title: formState.title, title: formState.title,
img: formState.img, img: processImagePath(formState.img),
status: formState.status status: formState.status
}; };
if (modalMode.value === 'add') { if (modalMode.value === 'add') {
@ -166,6 +166,14 @@ const handleModalOk = async () => {
} }
}; };
const processImagePath = (imgPath) => {
const urlPrefix = 'http://123.249.121.26:8801/images/';
if (imgPath.startsWith(urlPrefix)) {
return imgPath.substring(urlPrefix.length);
}
return imgPath;
};
const handleModalCancel = () => { const handleModalCancel = () => {
modalVisible.value = false; modalVisible.value = false;
}; };

Loading…
Cancel
Save