Merge branch 'dwb' of https://e.coding.net/g-cphe0354/cashier/cashier-web
This commit is contained in:
commit
ab5a258e66
|
|
@ -19,13 +19,13 @@ const AuthAPI = {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 获取会员码
|
// 获取会员码
|
||||||
getVipCode(data: any) {
|
getVipCode(data: any) {
|
||||||
return request<any, Responseres>({
|
return request<any, Responseres>({
|
||||||
url: `${baseURL}/getVipCode`,
|
url: `${baseURL}/getVipCode`,
|
||||||
method: "post",
|
method: "post",
|
||||||
data: { ...data },
|
data: { ...data },
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// 新增
|
// 新增
|
||||||
add(data: any) {
|
add(data: any) {
|
||||||
return request<any, Responseres>({
|
return request<any, Responseres>({
|
||||||
|
|
@ -56,7 +56,22 @@ getVipCode(data: any) {
|
||||||
method: "delete",
|
method: "delete",
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
// 店铺详情
|
||||||
|
shopInfodetail(params: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `/account/admin/shopInfo/detail`,
|
||||||
|
method: "get",
|
||||||
|
params
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 店铺修改
|
||||||
|
shopInfoEidt(data: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `/account/admin/shopInfo`,
|
||||||
|
method: "put",
|
||||||
|
data,
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
export interface Responseres {
|
export interface Responseres {
|
||||||
code?: number | null;
|
code?: number | null;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,8 @@
|
||||||
<el-button type="primary" icon="Plus" @click="toUrl()">下载会员充值二维码</el-button>
|
<el-button type="primary" icon="Plus" @click="toUrl()">下载会员充值二维码</el-button>
|
||||||
<br />
|
<br />
|
||||||
<div style="margin-top: 10px;">
|
<div style="margin-top: 10px;">
|
||||||
允许充值自定义金额: <el-switch v-model="value2" class="ml-2" />
|
允许充值自定义金额: <el-switch v-model="isCustomAmount" class="ml-2" :active-value="1" :inactive-value="0"
|
||||||
|
@click="changeStatus" />
|
||||||
</div>
|
</div>
|
||||||
<QR ref="downloadQR"></QR>
|
<QR ref="downloadQR"></QR>
|
||||||
|
|
||||||
|
|
@ -13,11 +14,27 @@ import QR from './downloadQR.vue'
|
||||||
import API from '../api.js'
|
import API from '../api.js'
|
||||||
const emit = defineEmits(['add']);
|
const emit = defineEmits(['add']);
|
||||||
const downloadQR = ref(null)
|
const downloadQR = ref(null)
|
||||||
|
let isCustomAmount = ref(false)
|
||||||
async function toUrl() {
|
async function toUrl() {
|
||||||
const shopId = localStorage.getItem("shopId");
|
const shopId = localStorage.getItem("shopId");
|
||||||
let res = await API.getVipCode({shopId:shopId});
|
let res = await API.getVipCode({ shopId: shopId });
|
||||||
downloadQR.value.show(res)
|
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() {
|
function addEvent() {
|
||||||
emit('add');
|
emit('add');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue