feat: 分享设置接口接入
This commit is contained in:
parent
4e956987d5
commit
6264708ee5
|
|
@ -61,6 +61,10 @@
|
|||
<script>
|
||||
import shopShareApi from "@/api/account/shopShare";
|
||||
import AddCoupon from "./addCoupon.vue";
|
||||
import { useUserStore } from "@/store/modules/user";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
const shopUser = useUserStore();
|
||||
export default {
|
||||
components: { AddCoupon },
|
||||
data() {
|
||||
|
|
@ -114,8 +118,8 @@ export default {
|
|||
tableType: "1", // 1添加 2编辑
|
||||
tableEditorIndex: 0, // 编辑时的index
|
||||
shopInfo: {
|
||||
name: localStorage.getItem("shopName"),
|
||||
logo: localStorage.getItem("logo"),
|
||||
name: "",
|
||||
logo: "",
|
||||
},
|
||||
form: {
|
||||
status: 1,
|
||||
|
|
@ -193,6 +197,7 @@ export default {
|
|||
},
|
||||
mounted() {
|
||||
this.byShopId();
|
||||
this.shopInfo = shopUser.userInfo;
|
||||
},
|
||||
methods: {
|
||||
// 添加完成优惠券
|
||||
|
|
@ -236,7 +241,7 @@ export default {
|
|||
this.form.shopId = localStorage.getItem("shopId");
|
||||
await shopShareApi.update(this.form);
|
||||
this.loading = false;
|
||||
this.$notify({
|
||||
ElMessage({
|
||||
title: "成功",
|
||||
message: `保存成功`,
|
||||
type: "success",
|
||||
|
|
@ -251,7 +256,7 @@ export default {
|
|||
// 获取店铺设置
|
||||
async byShopId() {
|
||||
try {
|
||||
const res = await byShopId();
|
||||
const res = await shopShareApi.get();
|
||||
if (res.id) {
|
||||
this.form = res;
|
||||
this.createdAt = [res.startTime, res.endTime];
|
||||
|
|
|
|||
Loading…
Reference in New Issue