<template>
|
<view class="confirm-page">
|
<view class="page-title">确认开票信息:</view>
|
|
<view class="info-card">
|
<view v-for="item in displayFields" :key="item.label" class="info-row">
|
<text class="info-label">{{ item.label }}</text>
|
<text class="info-value" :class="item.valueClass || ''">{{ item.value }}</text>
|
</view>
|
</view>
|
|
<view class="footer-bar">
|
<view class="footer-btn footer-btn-ghost" @tap="goBackEdit">返回修改</view>
|
<view class="footer-btn footer-btn-primary" @tap="showSubmitPopup = true">确认提交</view>
|
</view>
|
|
<u-popup :show="showSubmitPopup" mode="center" bgColor="transparent" @close="closeSubmitPopup">
|
<view class="submit-popup">
|
<view class="submit-popup-title">温馨提示</view>
|
<view class="submit-popup-text">确认提交开票申请?</view>
|
<view class="submit-popup-footer">
|
<view class="submit-popup-btn cancel-btn" @tap="closeSubmitPopup">取消</view>
|
<view class="submit-popup-btn confirm-btn" @tap="confirmSubmit">提交</view>
|
</view>
|
</view>
|
</u-popup>
|
</view>
|
</template>
|
|
<script>
|
export default {
|
data() {
|
return {
|
titleType: 'company',
|
showSubmitPopup: false,
|
invoiceInfo: {
|
invoiceType: '电子普通发票',
|
titleTypeText: '企业',
|
title: '安徽豆米科技有限公司',
|
content: '明细',
|
amount: '¥100.00',
|
taxNo: '913401000967388111',
|
bankName: '中国银行',
|
bankAccount: '合肥市中国银芜湖路支行',
|
companyAddress: '安徽省合肥市经济技术开发区莲花路标准厂房F401室',
|
companyPhone: '0551-62738237'
|
},
|
personalInfo: {
|
invoiceType: '电子普通发票',
|
titleTypeText: '个人/事业单位',
|
title: '李春梅',
|
content: '明细',
|
amount: '¥100.00'
|
},
|
data: {}
|
};
|
},
|
computed: {
|
displayFields() {
|
const base = this.titleType === 'company' ? this.invoiceInfo : this.personalInfo;
|
const fields = [
|
{ label: '发票类型', value: base.invoiceType },
|
{ label: '抬头类型', value: base.titleTypeText },
|
{ label: '发票抬头', value: base.title },
|
{ label: '发票内容', value: base.content },
|
{ label: '开票金额', value: base.amount }
|
];
|
|
if (this.titleType === 'company') {
|
fields.push(
|
{ label: '税号', value: base.taxNo },
|
{ label: '开户银行', value: base.bankName },
|
{ label: '银行账号', value: base.bankAccount },
|
{ label: '企业地址', value: base.companyAddress, valueClass: 'is-multiline' },
|
{ label: '企业电话', value: base.companyPhone }
|
);
|
}
|
|
return fields;
|
}
|
},
|
onLoad() {
|
const invoiceData = uni.getStorageSync('invoiceFormData')
|
if (invoiceData) {
|
this.data = invoiceData
|
this.titleType = invoiceData.titleType || 'company'
|
if (this.titleType === 'company') {
|
this.invoiceInfo = {
|
invoiceType: invoiceData.invoiceType || '',
|
titleTypeText: invoiceData.titleTypeText || '',
|
title: invoiceData.title || '',
|
content: invoiceData.content || '',
|
amount: invoiceData.amount || '',
|
taxNo: invoiceData.taxNo || '',
|
bankName: invoiceData.bankName || '',
|
bankAccount: invoiceData.bankAccount || '',
|
companyAddress: invoiceData.companyAddress || '',
|
companyPhone: invoiceData.companyPhone || ''
|
}
|
} else {
|
this.personalInfo = {
|
invoiceType: invoiceData.invoiceType || '',
|
titleTypeText: invoiceData.titleTypeText || '',
|
title: invoiceData.title || '',
|
content: invoiceData.content || '',
|
amount: invoiceData.amount || ''
|
}
|
}
|
uni.removeStorageSync('invoiceFormData')
|
}
|
},
|
methods: {
|
goBackEdit() {
|
uni.navigateBack({ delta: 1 });
|
},
|
closeSubmitPopup() {
|
this.showSubmitPopup = false;
|
},
|
async confirmSubmit() {
|
this.showSubmitPopup = false;
|
const params = {
|
orderId: this.data.orderId,
|
orderNo: this.data.orderNo,
|
name: this.data.title,
|
invoiceType: this.data.invoiceType === '电子普通发票' ? 0 : 1,
|
orgType: this.data.titleType === 'company' ? 1 : 0
|
}
|
if (this.data.titleType === 'company') {
|
params.taxId = this.data.taxNo
|
}
|
if (this.data.invoiceType === '电子专用发票') {
|
params.bankName = this.data.bankName
|
params.bankAccount = this.data.bankAccount
|
params.companyAddr = this.data.companyAddress
|
params.companyPhone = this.data.companyPhone
|
}
|
const res = await this.$u.api.invoiceApply(params)
|
if (res.code === 200) {
|
uni.setStorageSync('invoiceSuccessData', this.data)
|
uni.reLaunch({
|
url: '/shop/pages/Invoice-issued-successfully/Invoice-issued-successfully'
|
});
|
}
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.confirm-page {
|
min-height: 100vh;
|
padding: 32rpx 24rpx 180rpx;
|
background: #ffffff;
|
box-sizing: border-box;
|
}
|
|
.page-title {
|
font-size: 42rpx;
|
font-weight: 700;
|
line-height: 58rpx;
|
color: #222222;
|
}
|
|
.info-card {
|
padding: 18rpx 28rpx;
|
margin-top: 26rpx;
|
background: #fafafa;
|
border-radius: 20rpx;
|
}
|
|
.info-row {
|
display: flex;
|
align-items: flex-start;
|
justify-content: space-between;
|
gap: 24rpx;
|
padding: 14rpx 0;
|
}
|
|
.info-label {
|
flex-shrink: 0;
|
font-size: 34rpx;
|
line-height: 48rpx;
|
color: #a3a3a3;
|
}
|
|
.info-value {
|
flex: 1;
|
font-size: 34rpx;
|
font-weight: 500;
|
line-height: 48rpx;
|
color: #333333;
|
text-align: right;
|
word-break: break-all;
|
}
|
|
.is-multiline {
|
max-width: 430rpx;
|
}
|
|
.footer-bar {
|
position: fixed;
|
left: 0;
|
right: 0;
|
bottom: 0;
|
display: flex;
|
gap: 22rpx;
|
padding: 20rpx 24rpx calc(env(safe-area-inset-bottom) + 20rpx);
|
background: #ffffff;
|
}
|
|
.footer-btn {
|
flex: 1;
|
height: 82rpx;
|
line-height: 82rpx;
|
border-radius: 999rpx;
|
text-align: center;
|
font-size: 36rpx;
|
font-weight: 600;
|
}
|
|
.footer-btn-ghost {
|
border: 2rpx solid #7fd8ff;
|
background: #ffffff;
|
color: #1ea6ff;
|
}
|
|
.footer-btn-primary {
|
background: linear-gradient(135deg, #29c2ff 0%, #1ea6ff 100%);
|
color: #ffffff;
|
}
|
|
.submit-popup {
|
width: 610rpx;
|
overflow: hidden;
|
background: #ffffff;
|
border-radius: 18rpx;
|
}
|
|
.submit-popup-title {
|
padding-top: 38rpx;
|
font-size: 42rpx;
|
font-weight: 700;
|
line-height: 58rpx;
|
text-align: center;
|
color: #222222;
|
}
|
|
.submit-popup-text {
|
padding: 34rpx 24rpx 42rpx;
|
font-size: 34rpx;
|
line-height: 48rpx;
|
text-align: center;
|
color: #4a4a4a;
|
}
|
|
.submit-popup-footer {
|
display: flex;
|
height: 100rpx;
|
border-top: 1rpx solid #ececec;
|
}
|
|
.submit-popup-btn {
|
flex: 1;
|
height: 100rpx;
|
line-height: 100rpx;
|
text-align: center;
|
font-size: 36rpx;
|
font-weight: 500;
|
}
|
|
.cancel-btn {
|
color: #999999;
|
}
|
|
.confirm-btn {
|
color: #1eb6ff;
|
border-left: 1rpx solid #ececec;
|
}
|
</style>
|