Merge branch 'master' of https://e.coding.net/g-cphe0354/cashier/cashier-web into ymf
This commit is contained in:
commit
7e9a9d1767
|
|
@ -13,7 +13,12 @@ const contentConfig: IContentConfig = {
|
|||
pageSizes: [10, 20, 30, 50],
|
||||
},
|
||||
indexAction: function (params) {
|
||||
return Api.getList(params);
|
||||
let obj = { ...params }
|
||||
if (obj.createAt) {
|
||||
obj.beginTime = obj.createAt[0]
|
||||
obj.endTime = obj.createAt[1]
|
||||
}
|
||||
return Api.getList(obj);
|
||||
},
|
||||
// deleteAction: Api.delete,
|
||||
// modifyAction: function (data) {
|
||||
|
|
|
|||
|
|
@ -18,6 +18,14 @@ const AuthAPI = {
|
|||
params,
|
||||
});
|
||||
},
|
||||
// 获取会员码
|
||||
getVipCode(data: any) {
|
||||
return request<any, Responseres>({
|
||||
url: `${baseURL}/getVipCode`,
|
||||
method: "post",
|
||||
data: { ...data },
|
||||
});
|
||||
},
|
||||
// 新增
|
||||
add(data: any) {
|
||||
return request<any, Responseres>({
|
||||
|
|
@ -57,4 +65,4 @@ export interface Responseres {
|
|||
[property: string]: any;
|
||||
}
|
||||
|
||||
export default AuthAPI;
|
||||
export default AuthAPI;
|
||||
|
|
|
|||
|
|
@ -1,19 +1,24 @@
|
|||
<template>
|
||||
<el-button type="primary" icon="Plus" @click="addEvent">新增</el-button>
|
||||
<el-button type="primary" icon="Plus" @click="addEvent">下载会员充值二维码</el-button>
|
||||
<el-button type="primary" icon="Plus" @click="toUrl()">下载会员充值二维码</el-button>
|
||||
<br />
|
||||
<div style="margin-top: 10px;">
|
||||
允许充值自定义金额: <el-switch v-model="value2" class="ml-2" />
|
||||
</div>
|
||||
<QR ref="downloadQR"></QR>
|
||||
|
||||
</template>
|
||||
<script setup>
|
||||
import { useRouter } from 'vue-router';
|
||||
const router = useRouter();
|
||||
import QR from './downloadQR.vue'
|
||||
import API from '../api.js'
|
||||
const emit = defineEmits(['add']);
|
||||
function toUrl(name) {
|
||||
router.push({ name });
|
||||
const downloadQR = ref(null)
|
||||
async function toUrl() {
|
||||
const shopId = localStorage.getItem("shopId");
|
||||
let res = await API.getVipCode({shopId:shopId});
|
||||
downloadQR.value.show(res)
|
||||
}
|
||||
function addEvent() {
|
||||
emit('add');
|
||||
}
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,63 @@
|
|||
<template>
|
||||
<div class="downloadQR" v-show="datas.isshow">
|
||||
<div class="box">
|
||||
<img :src="datas.imgUrl" style="width: 300px;height: 300px;" alt="">
|
||||
<div class="btnStyle">
|
||||
<el-button type="primary" @click="datas.isshow = false">取消</el-button>
|
||||
<el-button type="primary"><a :href="datas.imgUrl">下载</a></el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
let props = defineProps({
|
||||
imgUrl: String,
|
||||
});
|
||||
let datas = reactive({
|
||||
imgUrl: "",
|
||||
isshow: false,
|
||||
});
|
||||
|
||||
function show(d) {
|
||||
datas.imgUrl = d;
|
||||
datas.isshow = true;
|
||||
}
|
||||
|
||||
defineExpose({ show });
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.downloadQR {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
background-color: rgba($color: #000000, $alpha: .6);
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
|
||||
.box {
|
||||
padding: 20px;
|
||||
border-radius: 3px;
|
||||
height: 400px;
|
||||
width: 340px;
|
||||
background-color: #fff;
|
||||
display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
flex-direction: column;
|
||||
|
||||
}
|
||||
|
||||
|
||||
.btnStyle {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 20px;
|
||||
justify-content: space-around;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Loading…
Reference in New Issue