From f40342616443633319f2a6c02250c0905c5d60f2 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Mon, 17 Mar 2025 13:27:24 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B4=BB=E5=8A=A8=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E5=85=81=E8=AE=B8=E5=85=85=E5=80=BC=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/user/active/indexconfig/api.ts | 31 ++++++++++++++----- .../indexconfig/component/AddButton.vue | 21 +++++++++++-- 2 files changed, 42 insertions(+), 10 deletions(-) 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'); }