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],
|
pageSizes: [10, 20, 30, 50],
|
||||||
},
|
},
|
||||||
indexAction: function (params) {
|
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,
|
// deleteAction: Api.delete,
|
||||||
// modifyAction: function (data) {
|
// modifyAction: function (data) {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,14 @@ const AuthAPI = {
|
||||||
method: "get",
|
method: "get",
|
||||||
params,
|
params,
|
||||||
});
|
});
|
||||||
|
},
|
||||||
|
// 获取会员码
|
||||||
|
getVipCode(data: any) {
|
||||||
|
return request<any, Responseres>({
|
||||||
|
url: `${baseURL}/getVipCode`,
|
||||||
|
method: "post",
|
||||||
|
data: { ...data },
|
||||||
|
});
|
||||||
},
|
},
|
||||||
// 新增
|
// 新增
|
||||||
add(data: any) {
|
add(data: any) {
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,22 @@
|
||||||
<template>
|
<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="addEvent">下载会员充值二维码</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="value2" class="ml-2" />
|
||||||
</div>
|
</div>
|
||||||
|
<QR ref="downloadQR"></QR>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
import { useRouter } from 'vue-router';
|
import QR from './downloadQR.vue'
|
||||||
const router = useRouter();
|
import API from '../api.js'
|
||||||
const emit = defineEmits(['add']);
|
const emit = defineEmits(['add']);
|
||||||
function toUrl(name) {
|
const downloadQR = ref(null)
|
||||||
router.push({ name });
|
async function toUrl() {
|
||||||
|
const shopId = localStorage.getItem("shopId");
|
||||||
|
let res = await API.getVipCode({shopId:shopId});
|
||||||
|
downloadQR.value.show(res)
|
||||||
}
|
}
|
||||||
function addEvent() {
|
function addEvent() {
|
||||||
emit('add');
|
emit('add');
|
||||||
|
|
|
||||||
|
|
@ -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