diff --git a/src/views/user/active/indexconfig/api.ts b/src/views/user/active/indexconfig/api.ts index 2981ba8..83ed5c3 100644 --- a/src/views/user/active/indexconfig/api.ts +++ b/src/views/user/active/indexconfig/api.ts @@ -19,13 +19,13 @@ const AuthAPI = { }); }, // 获取会员码 -getVipCode(data: any) { - return request({ - url: `${baseURL}/getVipCode`, - method: "post", - data: { ...data }, - }); -}, + getVipCode(data: any) { + return request({ + url: `${baseURL}/getVipCode`, + method: "post", + data: { ...data }, + }); + }, // 新增 add(data: any) { return request({ @@ -56,7 +56,22 @@ getVipCode(data: any) { method: "delete", }); }, - + // 店铺详情 + shopInfodetail(params: any) { + return request({ + url: `/account/admin/shopInfo/detail`, + method: "get", + params + }); + }, + // 店铺修改 + shopInfoEidt(data: any) { + return request({ + url: `/account/admin/shopInfo`, + method: "put", + data, + }); + } }; export interface Responseres { code?: number | null; diff --git a/src/views/user/active/indexconfig/component/AddButton.vue b/src/views/user/active/indexconfig/component/AddButton.vue index d3869d2..0e2e45a 100644 --- a/src/views/user/active/indexconfig/component/AddButton.vue +++ b/src/views/user/active/indexconfig/component/AddButton.vue @@ -3,7 +3,8 @@ 下载会员充值二维码
- 允许充值自定义金额: + 允许充值自定义金额:
@@ -13,11 +14,27 @@ import QR from './downloadQR.vue' import API from '../api.js' const emit = defineEmits(['add']); const downloadQR = ref(null) +let isCustomAmount = ref(false) async function toUrl() { const shopId = localStorage.getItem("shopId"); - let res = await API.getVipCode({shopId:shopId}); + let res = await API.getVipCode({ shopId: shopId }); downloadQR.value.show(res) } +onMounted(() => { + getInfo() +}) +async function getInfo() { + const shopId = localStorage.getItem("shopId"); + let res = await API.shopInfodetail({ id: shopId }); + isCustomAmount.value = res.isCustomAmount +} +async function changeStatus() { + let shopId = localStorage.getItem("shopId"); + let res = await API.shopInfoEidt({ id: shopId, isCustomAmount: isCustomAmount.value }); + console.log(res, 'tpasj2') + ElMessage.success("修改成功"); + +} function addEvent() { emit('add'); }