优化会员充值

This commit is contained in:
gyq
2024-05-29 10:04:37 +08:00
parent 69482f81a7
commit bf0614e10b
8 changed files with 116 additions and 20 deletions

View File

@@ -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);
}
}

View File

@@ -201,6 +201,7 @@ async function printHandle() {
// 订单已支付
function paySuccess() {
useStorage.del('memberInfo')
dialogVisible.value = false;
printHandle();
emit("paySuccess");

View File

@@ -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);

View File

@@ -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;
}
}
}

View File

@@ -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>

View File

@@ -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()