feat: 分享设置接口接入
This commit is contained in:
parent
4e956987d5
commit
6264708ee5
|
|
@ -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];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue