feat: 分享设置接口接入

This commit is contained in:
YeMingfei666 2025-03-11 11:36:17 +08:00
parent 4e956987d5
commit 6264708ee5
1 changed files with 9 additions and 4 deletions

View File

@ -61,6 +61,10 @@
<script> <script>
import shopShareApi from "@/api/account/shopShare"; import shopShareApi from "@/api/account/shopShare";
import AddCoupon from "./addCoupon.vue"; import AddCoupon from "./addCoupon.vue";
import { useUserStore } from "@/store/modules/user";
import { ElMessage } from "element-plus";
const shopUser = useUserStore();
export default { export default {
components: { AddCoupon }, components: { AddCoupon },
data() { data() {
@ -114,8 +118,8 @@ export default {
tableType: "1", // 1 2 tableType: "1", // 1 2
tableEditorIndex: 0, // index tableEditorIndex: 0, // index
shopInfo: { shopInfo: {
name: localStorage.getItem("shopName"), name: "",
logo: localStorage.getItem("logo"), logo: "",
}, },
form: { form: {
status: 1, status: 1,
@ -193,6 +197,7 @@ export default {
}, },
mounted() { mounted() {
this.byShopId(); this.byShopId();
this.shopInfo = shopUser.userInfo;
}, },
methods: { methods: {
// //
@ -236,7 +241,7 @@ export default {
this.form.shopId = localStorage.getItem("shopId"); this.form.shopId = localStorage.getItem("shopId");
await shopShareApi.update(this.form); await shopShareApi.update(this.form);
this.loading = false; this.loading = false;
this.$notify({ ElMessage({
title: "成功", title: "成功",
message: `保存成功`, message: `保存成功`,
type: "success", type: "success",
@ -251,7 +256,7 @@ export default {
// //
async byShopId() { async byShopId() {
try { try {
const res = await byShopId(); const res = await shopShareApi.get();
if (res.id) { if (res.id) {
this.form = res; this.form = res;
this.createdAt = [res.startTime, res.endTime]; this.createdAt = [res.startTime, res.endTime];