mirror of
https://gitee.com/bootx/dax-pay-h5.git
synced 2025-10-14 06:04:51 +00:00
支付宝收银台样式优化
This commit is contained in:
@@ -1,61 +1,35 @@
|
||||
<template>
|
||||
<div>
|
||||
<div class="container">
|
||||
<div style="font-size: 28px;margin-top: 10px;">
|
||||
{{ cashierInfo.cashierName || '支付宝收银台' }}
|
||||
<div class="payName">
|
||||
<span>付款给</span>
|
||||
<span class="paytext">杨家臭豆腐{{ mchName }}</span>
|
||||
</div>
|
||||
<div class="amount-display">
|
||||
<p style="font-size: 20px">
|
||||
付款给{{ mchName }}
|
||||
<p class="title">
|
||||
金额
|
||||
</p>
|
||||
<p style="font-size: 32px;">
|
||||
<p style="font-size: 32px">
|
||||
¥{{ amount }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<van-dialog
|
||||
v-model:show="showRemark"
|
||||
title="支付备注"
|
||||
confirm-button-text="保存"
|
||||
cancel-button-text="清除"
|
||||
confirm-button-color="#108ee9"
|
||||
cancel-button-color="red"
|
||||
show-cancel-button
|
||||
@cancel="description = ''"
|
||||
>
|
||||
<van-field
|
||||
v-model="description"
|
||||
rows="2"
|
||||
autosize
|
||||
label=""
|
||||
type="textarea"
|
||||
:maxlength="50"
|
||||
placeholder="请输入支付备注内容"
|
||||
show-word-limit
|
||||
/>
|
||||
</van-dialog>
|
||||
<van-number-keyboard
|
||||
:show="true"
|
||||
theme="custom"
|
||||
extra-key="."
|
||||
close-button-text="付款"
|
||||
@close="pay"
|
||||
@input="input"
|
||||
@delete="del"
|
||||
>
|
||||
<template #title-left>
|
||||
<div style="width: 100vw;display: flex; justify-content: center">
|
||||
<div class="notes">
|
||||
<div class="remark" @click="showRemark = true">
|
||||
<div v-if="!description">
|
||||
添加备注
|
||||
</div>
|
||||
<div v-else style="max-width: 75vw;">
|
||||
<van-text-ellipsis :content="`备注: ${description}`" /><div />
|
||||
<div v-if="!description">添加备注</div>
|
||||
<div v-else style="max-width: 75vw">
|
||||
<van-text-ellipsis :content="`备注: ${description}`" />
|
||||
<div />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</van-number-keyboard>
|
||||
<van-dialog v-model:show="showRemark" title="支付备注" confirm-button-text="保存" cancel-button-text="清除"
|
||||
confirm-button-color="#108ee9" cancel-button-color="red" show-cancel-button @cancel="description = ''">
|
||||
<van-field v-model="description" rows="2" autosize label="" type="textarea" :maxlength="50"
|
||||
placeholder="请输入支付备注内容" show-word-limit />
|
||||
</van-dialog>
|
||||
<van-number-keyboard :show="true" theme="custom" extra-key="." close-button-text="付款" @close="pay" @input="input"
|
||||
@delete="del" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -63,17 +37,9 @@
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useRoute } from 'vue-router'
|
||||
import { showNotify } from 'vant'
|
||||
import type {
|
||||
CashierPayParam,
|
||||
ChannelCashierConfigResult,
|
||||
} from '../CashierCode.api'
|
||||
import {
|
||||
cashierPay,
|
||||
getCashierInfo,
|
||||
getMchName,
|
||||
} from '../CashierCode.api'
|
||||
|
||||
import { AggregateEnum, CashierTypeEnum } from "@/enums/daxpay/DaxPayEnum";
|
||||
import type { CashierPayParam, ChannelCashierConfigResult } from '../CashierCode.api'
|
||||
import { cashierPay, getCashierInfo, getMchName } from '../CashierCode.api'
|
||||
import { AggregateEnum, CashierTypeEnum } from '@/enums/daxpay/DaxPayEnum'
|
||||
import router from '@/router'
|
||||
import { useKeyboard } from '@/hooks/daxpay/useKeyboard'
|
||||
|
||||
@@ -97,14 +63,18 @@ onMounted(() => {
|
||||
* 初始化数据
|
||||
*/
|
||||
function initData() {
|
||||
getCashierInfo(AggregateEnum.ALI, appId as string).then(({ data }) => {
|
||||
getCashierInfo(AggregateEnum.ALI, appId as string)
|
||||
.then(({ data }) => {
|
||||
cashierInfo.value = data
|
||||
}).catch((res) => {
|
||||
})
|
||||
.catch((res) => {
|
||||
router.push({ name: 'ErrorResult', query: { msg: res.message } })
|
||||
})
|
||||
getMchName(mchNo as string).then(({ data }) => {
|
||||
getMchName(mchNo as string)
|
||||
.then(({ data }) => {
|
||||
mchName.value = data
|
||||
}).catch((res) => {
|
||||
})
|
||||
.catch((res) => {
|
||||
router.push({ name: 'ErrorResult', query: { msg: res.message } })
|
||||
})
|
||||
}
|
||||
@@ -126,8 +96,7 @@ function pay() {
|
||||
description: description.value,
|
||||
mchNo,
|
||||
} as CashierPayParam
|
||||
cashierPay(from)
|
||||
.then(({ data }) => {
|
||||
cashierPay(from).then(({ data }) => {
|
||||
loading.value = false
|
||||
// 跳转到H5/付款码支付页面
|
||||
location.replace(data.payBody)
|
||||
@@ -141,25 +110,57 @@ function pay() {
|
||||
:deep(.van-key--blue) {
|
||||
background: @color;
|
||||
}
|
||||
|
||||
.container {
|
||||
background-color: @color;
|
||||
background: linear-gradient(to bottom, #1e90ff, #1e90ff, #ffffff); // 从蓝色渐变到白色
|
||||
width: 100%;
|
||||
padding: 10px;
|
||||
padding: 40px;
|
||||
height: 40%;
|
||||
border-radius: 10px;
|
||||
text-align: center;
|
||||
color: white;
|
||||
|
||||
.payName {
|
||||
margin: 5px 0;
|
||||
font-size: 16px;
|
||||
|
||||
.paytext {
|
||||
font-size: 20px;
|
||||
margin-left: 5px;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.amount-display {
|
||||
background-color: white;
|
||||
color: @color;
|
||||
border-radius: 20px;
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
display: flex;
|
||||
gap: 1.875rem;
|
||||
align-items: center;
|
||||
|
||||
p {
|
||||
font-size: 32px;
|
||||
}
|
||||
.amount-display p {
|
||||
margin: 5px 0;
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.notes {
|
||||
width: 100%;
|
||||
height: 10%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
.remark {
|
||||
color: @color;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
Reference in New Issue
Block a user