|
|
@@ -54,8 +54,8 @@
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item label="首页背景图" :rules="[
|
|
|
- { required: true, message: '上传首页背景图', trigger: 'change' },
|
|
|
+ <el-form-item label="产品背景图" :rules="[
|
|
|
+ { required: true, message: '上传产品背景图', trigger: 'change' },
|
|
|
]">
|
|
|
<div class="img-box" v-for="(item, i) in mainBgList" :key="i">
|
|
|
<img :src="item.url" alt="" />
|
|
|
@@ -74,7 +74,7 @@
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="客服微信二维码" :rules="[
|
|
|
- { required: true, message: '上传首页背景图', trigger: 'change' },
|
|
|
+ { required: true, message: '上传客服微信二维码', trigger: 'change' },
|
|
|
]">
|
|
|
<div class="img-box" v-for="(item, i) in CSWeChatList" :key="i">
|
|
|
<img :src="item.url" alt="" />
|
|
|
@@ -92,7 +92,25 @@
|
|
|
</el-icon>
|
|
|
</el-upload>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="优惠券背景图" :rules="[
|
|
|
+ { required: true, message: '上传优惠券背景图', trigger: 'change' },
|
|
|
+ ]">
|
|
|
+ <div class="img-box" v-for="(item, i) in couponBgList" :key="i">
|
|
|
+ <img :src="item.url" alt="" />
|
|
|
|
|
|
+ <div class="occlusion">
|
|
|
+ <el-icon class="del" @click="handleRemove(9, i)">
|
|
|
+ <IEpDelete />
|
|
|
+ </el-icon>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <el-upload action="#" list-type="picture-card" :auto-upload="false" :show-file-list="false"
|
|
|
+ :file-list="couponBgList" :on-change="onChange(9)">
|
|
|
+ <el-icon>
|
|
|
+ <IEpPlus />
|
|
|
+ </el-icon>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="个人中心背景图" :rules="[
|
|
|
{ required: true, message: '上传个人中心背景图', trigger: 'change' },
|
|
|
]">
|
|
|
@@ -216,6 +234,10 @@ let levelBgList = ref([]);
|
|
|
// 客服微信
|
|
|
let CSWeChatList = ref([]);
|
|
|
|
|
|
+// 优惠券
|
|
|
+let couponBgList = ref([]);
|
|
|
+
|
|
|
+
|
|
|
// 加入会员广告图
|
|
|
let joinVipAdList = ref([]);
|
|
|
|
|
|
@@ -229,7 +251,7 @@ const onChange = (type) => {
|
|
|
return (file, fileList) => {
|
|
|
// 在这里,你可以通过 type 来区分是哪个上传器触发了事件
|
|
|
console.log(`Uploader ${type} file changed`, file, fileList);
|
|
|
- // 执行其他逻辑...
|
|
|
+ // 执行其他逻辑...
|
|
|
let formData = new FormData();
|
|
|
formData.append("file", file.raw);
|
|
|
loading.value = true;
|
|
|
@@ -271,15 +293,7 @@ const onChange = (type) => {
|
|
|
mainBgList.value.push(obj);
|
|
|
}
|
|
|
break;
|
|
|
- case 8:
|
|
|
- // 上传首页背景图
|
|
|
- if (CSWeChatList.value.length > 0) {
|
|
|
- CSWeChatList.value = [];
|
|
|
- CSWeChatList.value.push(obj);
|
|
|
- } else {
|
|
|
- CSWeChatList.value.push(obj);
|
|
|
- }
|
|
|
- break;
|
|
|
+
|
|
|
case 4:
|
|
|
// 个人中心背景图
|
|
|
if (mineBgList.value.length > 0) {
|
|
|
@@ -319,6 +333,24 @@ const onChange = (type) => {
|
|
|
default:
|
|
|
loading.value = false;
|
|
|
break;
|
|
|
+ case 8:
|
|
|
+ // 上传微信客服
|
|
|
+ if (CSWeChatList.value.length > 0) {
|
|
|
+ CSWeChatList.value = [];
|
|
|
+ CSWeChatList.value.push(obj);
|
|
|
+ } else {
|
|
|
+ CSWeChatList.value.push(obj);
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case 9:
|
|
|
+ // 上传优惠券
|
|
|
+ if (couponBgList.value.length > 0) {
|
|
|
+ couponBgList.value = [];
|
|
|
+ couponBgList.value.push(obj);
|
|
|
+ } else {
|
|
|
+ couponBgList.value.push(obj);
|
|
|
+ }
|
|
|
+ break;
|
|
|
}
|
|
|
loading.value = false;
|
|
|
//
|
|
|
@@ -358,6 +390,11 @@ const handleRemove = (type, index) => {
|
|
|
case 8:
|
|
|
CSWeChatList.value.splice(index, 1);
|
|
|
break;
|
|
|
+
|
|
|
+ case 9:
|
|
|
+ couponBgList.value.splice(index, 1);
|
|
|
+ break;
|
|
|
+
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
@@ -366,9 +403,10 @@ const handleRemove = (type, index) => {
|
|
|
const submit = () => {
|
|
|
if (!formRef.value) return;
|
|
|
formRef.value.validate((valid, fields) => {
|
|
|
- const shop_bgimg = mineBgList.value && mainBgList.value.length ? mainBgList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
+ const shop_bgimg = mainBgList.value && mainBgList.value.length ? mainBgList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
const wx_bgimg = CSWeChatList.value && CSWeChatList.value.length ? CSWeChatList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
- const ucenter_bg = mainBgList.value && mineBgList.value.length ? mineBgList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
+ const youhuiquan_bgimg= couponBgList.value && couponBgList.value.length ? couponBgList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
+ const ucenter_bg =mineBgList.value && mineBgList.value.length ? mineBgList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
const user_grade_bg = levelBgList.value && levelBgList.value.length ? levelBgList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
const user_in_bg = joinVipAdList.value && joinVipAdList.value.length ? joinVipAdList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
const shop_adimg = sharePosterList.value && sharePosterList.value.length ? sharePosterList.value[0].url.replace(import.meta.env.VITE_APP_BASE_API, '') : null
|
|
|
@@ -386,6 +424,10 @@ const submit = () => {
|
|
|
conf_name: "wechat.cs_wechat_img",
|
|
|
conf_value: wx_bgimg,
|
|
|
},
|
|
|
+ {
|
|
|
+ conf_name: "wechat.cs_youhuiquan_bgimg",
|
|
|
+ conf_value: youhuiquan_bgimg,
|
|
|
+ },
|
|
|
{
|
|
|
conf_name: "wechat.shop_logo",
|
|
|
conf_value: siteLogo.value,
|
|
|
@@ -472,6 +514,13 @@ const getConfigApi = () => {
|
|
|
url: import.meta.env.VITE_APP_BASE_API + data.wechat.cs_wechat_img,
|
|
|
});
|
|
|
}
|
|
|
+ // 优惠券
|
|
|
+ if (data?.wechat?.cs_youhuiquan_bgimg) {
|
|
|
+ couponBgList.value = [];
|
|
|
+ couponBgList.value.push({
|
|
|
+ url: import.meta.env.VITE_APP_BASE_API + data.wechat.cs_youhuiquan_bgimg,
|
|
|
+ });
|
|
|
+ }
|
|
|
// 个人中心背景图
|
|
|
if (data?.wechat?.ucenter_bg) {
|
|
|
mineBgList.value = [];
|