优化会员充值
This commit is contained in:
parent
69482f81a7
commit
bf0614e10b
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "vite-electron",
|
||||
"private": true,
|
||||
"version": "1.1.14",
|
||||
"version": "1.2.2",
|
||||
"main": "dist-electron/main.js",
|
||||
"scripts": {
|
||||
"dev": "chcp 65001 && vite",
|
||||
|
|
|
|||
|
|
@ -7,10 +7,14 @@
|
|||
</el-icon>
|
||||
</div>
|
||||
<div class="right">
|
||||
<div class="t1">
|
||||
<div class="t1" v-if="props.type == 1">
|
||||
<span class="title">应收:¥</span>
|
||||
<span class="num">{{ money }}</span>
|
||||
</div>
|
||||
<div class="t1" v-else>
|
||||
<span class="title">会员:</span>
|
||||
<span class="num">{{ props.userInfo.id && props.userInfo.telephone }}</span>
|
||||
</div>
|
||||
<div class="t2">
|
||||
<span>已付:¥0.00</span>
|
||||
<span>优惠:¥0.00</span>
|
||||
|
|
@ -53,18 +57,31 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<scanModal ref="scanModalRef" fast :amount="money" @success="scanCodeSuccess" />
|
||||
<scanModal ref="scanModalRef" fast :amount="money" :selecttype="1" :orderId="props.userInfo.id"
|
||||
@success="scanCodeSuccess" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { onMounted, ref } from "vue";
|
||||
import { queryPayType, quickPay } from "@/api/pay";
|
||||
import { queryMembermember, createMembermember, membermemberScanPay, accountPaymember } from '@/api/member/index.js'
|
||||
import { useUser } from "@/store/user.js";
|
||||
import { clearNoNum } from "@/utils";
|
||||
|
||||
import scanModal from "@/components/payCard/scanModal.vue";
|
||||
import { ElMessage } from "element-plus";
|
||||
|
||||
const props = defineProps({
|
||||
type: {
|
||||
type: [String, Number],
|
||||
default: 1 // 1快捷收银 2会员支付
|
||||
},
|
||||
userInfo: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
|
||||
const store = useUser();
|
||||
|
||||
const emit = defineEmits(["paySuccess", "close"]);
|
||||
|
|
@ -112,11 +129,19 @@ async function confirmOrder() {
|
|||
payLoading.value = true;
|
||||
switch (payList.value[payActive.value].payType) {
|
||||
case "cash": //现金
|
||||
await quickPay({
|
||||
amount: money.value,
|
||||
authCode: "",
|
||||
payType: payList.value[payActive.value].payType,
|
||||
});
|
||||
if (props.type == 1) {
|
||||
await quickPay({
|
||||
amount: money.value,
|
||||
authCode: "",
|
||||
payType: payList.value[payActive.value].payType,
|
||||
});
|
||||
} else {
|
||||
await accountPaymember({
|
||||
shopId: store.userInfo.shopId,
|
||||
memberId: props.userInfo.id,
|
||||
amount: money.value
|
||||
})
|
||||
}
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<el-button style="width: 100%;">取消</el-button>
|
||||
<el-button style="width: 100%;" @click="detailVisible = false">取消</el-button>
|
||||
<el-button type="primary" style="width: 100%;" :loading="groupDetailLoading"
|
||||
@click="groupOrdergroupScanHandle">确认核销</el-button>
|
||||
</div>
|
||||
|
|
@ -169,6 +169,7 @@ async function submitHandle() {
|
|||
groupDetail.value = res
|
||||
detailVisible.value = true
|
||||
} catch (error) {
|
||||
loading.value = false
|
||||
console.log(error);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -201,6 +201,7 @@ async function printHandle() {
|
|||
|
||||
// 订单已支付
|
||||
function paySuccess() {
|
||||
useStorage.del('memberInfo')
|
||||
dialogVisible.value = false;
|
||||
printHandle();
|
||||
emit("paySuccess");
|
||||
|
|
|
|||
|
|
@ -237,7 +237,6 @@ async function pendingCart(params, status = true) {
|
|||
if (status && cartList.value.length) {
|
||||
await createCodeAjax();
|
||||
cartLoading.value = false;
|
||||
clearMember()
|
||||
} else {
|
||||
cartLoading.value = false;
|
||||
}
|
||||
|
|
@ -368,6 +367,7 @@ async function createCodeAjax(type = "0") {
|
|||
});
|
||||
masterId.value = res.code;
|
||||
queryCartAjax();
|
||||
getLocalMemberInfo()
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
|
|
@ -379,7 +379,7 @@ function getLocalMemberInfo() {
|
|||
if (localMemberInfo && localMemberInfo.telephone) {
|
||||
memberInfo.value = localMemberInfo
|
||||
} else {
|
||||
memberInfo.value = ''
|
||||
memberInfo.value = {}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -432,8 +432,9 @@ onMounted(() => {
|
|||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background-color: var(--el-color-info-light-7);
|
||||
padding-left: var(--el-font-size-base);
|
||||
// padding-left: var(--el-font-size-base);
|
||||
|
||||
.t {
|
||||
font-size: var(--el-font-size-base);
|
||||
|
|
|
|||
|
|
@ -3,11 +3,15 @@
|
|||
<div class="dialog_footer" v-for="(item, index) in props.flowingwater.list" :key="index">
|
||||
<div class="dialog_footer_left">
|
||||
<span>{{ item.biz_name }}</span>
|
||||
<span>{{ dayjs(item.create_time).format("YYYY-MM-DD") }}</span>
|
||||
<span>{{ dayjs(item.create_time).format("YYYY-MM-DD HH:mm:ss") }}</span>
|
||||
</div>
|
||||
<div class="dialog_footer_right">
|
||||
<span>{{ item.balance }}</span>
|
||||
<span>{{ item.amount }}</span>
|
||||
<span :class="{ active: item.biz_code == 'cashMemberIn' }">
|
||||
<template v-if="item.biz_code == 'cashMemberIn'">+</template>
|
||||
<template v-else>-</template>
|
||||
¥{{ (Math.floor(item.amount * 100) / 100).toFixed(2) }}
|
||||
</span>
|
||||
<span>余额:¥{{ (Math.floor(item.balance * 100) / 100).toFixed(2) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -29,6 +33,7 @@ const props = defineProps({
|
|||
.box {
|
||||
height: 400px;
|
||||
overflow: auto;
|
||||
|
||||
.dialog_footer:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
|
@ -54,7 +59,8 @@ const props = defineProps({
|
|||
|
||||
span:nth-child(2) {
|
||||
margin-top: 10px;
|
||||
color: #333;
|
||||
color: #999;
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,14 +70,18 @@ const props = defineProps({
|
|||
align-items: flex-end;
|
||||
|
||||
span:nth-child(1) {
|
||||
color: #fc3d3d;
|
||||
font-size: 16px;
|
||||
|
||||
&.active {
|
||||
color: #fc3d3d;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
span:nth-child(2) {
|
||||
margin-top: 10px;
|
||||
font-size: 14px;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,55 @@
|
|||
<template>
|
||||
<el-drawer size="100%" :with-header="false" direction="btt" v-model="dialogVisible">
|
||||
<div class="drawer_wrap">
|
||||
<div class="pay_wrap">
|
||||
<fastPayCard ref="fastPayCardRef" type="2" :userInfo="userInfo" @paySuccess="paySuccess"
|
||||
@close="dialogVisible = false" />
|
||||
</div>
|
||||
</div>
|
||||
</el-drawer>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import fastPayCard from "@/components/fastPayCard.vue";
|
||||
|
||||
const props = defineProps({
|
||||
userInfo: {
|
||||
type: Object,
|
||||
default: {}
|
||||
}
|
||||
})
|
||||
|
||||
const emit = defineEmits(["paySuccess"]);
|
||||
|
||||
const dialogVisible = ref(false);
|
||||
const fastPayCardRef = ref(null);
|
||||
|
||||
// 订单已支付
|
||||
function paySuccess() {
|
||||
dialogVisible.value = false;
|
||||
emit("paySuccess");
|
||||
}
|
||||
|
||||
function show() {
|
||||
dialogVisible.value = true;
|
||||
fastPayCardRef.value.reset();
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
show,
|
||||
});
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.drawer_wrap {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
padding: var(--el-font-size-base) 0;
|
||||
|
||||
.pay_wrap {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -83,7 +83,8 @@
|
|||
<keyboard v-if="props.membershow == '1'" @consumeFees="consumeFees"></keyboard>
|
||||
<div class="orderbox_right_button" v-if="props.membershow == '0'">
|
||||
<el-button style="width: 100%;" @click="toHome">创建订单</el-button>
|
||||
<el-button style="width: 60%;" type="primary" @click="recharge = true">账户充值</el-button>
|
||||
<!-- <el-button style="width: 60%;" type="primary" @click="recharge = true">账户充值</el-button> -->
|
||||
<el-button style="width: 60%;" type="primary" @click="userChargeRef.show()">账户充值</el-button>
|
||||
</div>
|
||||
<div class="orderbox_right_button" v-if="props.membershow == '1'">
|
||||
<router-link to="/" style="width: 35%;">
|
||||
|
|
@ -158,8 +159,7 @@
|
|||
:close-on-click-modal="false">
|
||||
<payCard :amount="moneys" :orderId="orderId" :selecttype="1" @paySuccess="paySuccess" />
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<userCharge ref="userChargeRef" :userInfo="tableData.list[datarow]" @paySuccess="asyncqueryMembermember" />
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
|
|
@ -174,6 +174,9 @@ import keyboard from '@/views/home/components/keyboard.vue'
|
|||
import payCard from '@/components/payCard/payCard.vue'
|
||||
import { useRouter } from 'vue-router'
|
||||
import useStorage from '@/utils/useStorage'
|
||||
import userCharge from './components/userCharge.vue'
|
||||
|
||||
const userChargeRef = ref(null)
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue