9a38e7d0 by 张猛

开票

1 parent 11fa3904
......@@ -1780,7 +1780,7 @@ export function cancelPay(id) {
export const outputInvoiceNo = (data) => {
return request({
url: `/common/order/outputInvoiceNo/${data.id}`,
url: `/common/order/outputInvoiceNo/${data.id}?taxno=${data.taxno}&phone=${data.phone}&name=${data.name}&invoiceType=${data.invoiceType}&amount=${data.amount}`,
method: 'post',
params: data
})
......
// dev
// const baseUrl_api = 'http://192.168.1.125:8787'
const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/'
const baseUrl_api = 'http://47.98.186.233:8787'
// const baseUrl_api = 'https://tk001.wxjylt.com/stage-api/'
const loginImage_api = 'https://tk001.wxjylt.com/stage-api'
const payUrl = 'https://wxpay.cmbc.com.cn/mobilePlatform/appserver/lcbpPay.do'
......
<template>
<view class="order-page" :class="{ 'no-scroll': isPopupOpen }">
<view :class="{ 'no-scroll': isPopupOpen }" class="order-page">
<!-- 顶部标签栏 -->
<view class="tab-bar">
<view
v-for="(tab, index) in tabs"
:key="index"
class="tab-item"
:class="{ active: currentTab === tab.type }"
class="tab-item"
@click="switchTab(tab.type)"
>
{{ tab.name }}
</view>
</view>
<!-- 订单列表 -->
<scroll-view
scroll-y
class="order-list-scroll"
:show-scrollbar="false"
:scroll-enabled="!isPopupOpen"
@scrolltolower="loadMore"
:show-scrollbar="false"
class="order-list-scroll"
lower-threshold="200"
scroll-y
@scrolltolower="loadMore"
>
<view class="order-list">
<!-- 有数据才循环 -->
......@@ -36,7 +36,7 @@
<view class="date">
<!-- <image :src="config.baseUrl_api + '/fs/static/calendar@2x.png'" mode="widthFix" style="width:30rpx;height:30rpx;"/> -->
<!-- -->
<text class="value text-primary" >{{ item.wfCode || '——' }}</text>
<text class="value text-primary">{{ item.wfCode || '——' }}</text>
</view>
<view class="status-tags">
<!-- <view
......@@ -50,25 +50,25 @@
{{ getStatusText(item.payStatus) }}
</view> -->
<view
class="status-tag ml-10"
:class="{
'status-wait': item.auditStatus == 0,
'status-pending': item.auditStatus == 1,
'status-success': item.auditStatus == 2,
'status-danger': item.auditStatus == 3
}"
class="status-tag ml-10"
>
{{ getAuditStatusText(item.auditStatus) }}
</view>
</view>
</view>
<!-- 订单编号、缴费编号 -->
<view class="info-row">
<text class="label">订单编号:</text>
<text class="value">{{ item.tradeNo || '——' }}</text>
</view>
<view class="info-row" v-if="item.orderName">
<view v-if="item.orderName" class="info-row">
<text class="label">缴费名称:</text>
<text class="value">{{ item.orderName || '' }}</text>
</view>
......@@ -76,29 +76,29 @@
<text class="label">缴费编号:</text>
</view> -->
<!-- 核心:前2tab仅展示缴费年限,后2tab仅展示人数合计 -->
<view class="info-section flex f-j-s" v-if="item.content">
<view v-if="item.content" class="info-section flex f-j-s">
<!-- 个人/单位会员(仅缴费年限) -->
<view v-if="currentTab === '0' || currentTab === '1'" class="single-info">
<view class="label">缴费年限:</view>
<view class="value">{{ item.content.yearCount || 0 }}</view>
</view>
<view class="line" v-if="currentTab === '0' || currentTab === '1'"></view>
<view v-if="currentTab === '0' || currentTab === '1'" class="line"></view>
<!-- 级位/段位考试(仅人数合计) -->
<view v-if="currentTab === '2' || currentTab === '3' || currentTab === '4'" class="single-info">
<view class="label">人数合计</view>
<view class="value">{{ item.content.personCount || 0 }}</view>
</view>
<view class="line" v-if="currentTab === '2' || currentTab === '3' || currentTab === '4'"></view>
<view v-if="currentTab === '2' || currentTab === '3' || currentTab === '4'" class="line"></view>
<view class="single-info">
<view class="label">订单状态</view>
<view class="value" :class="item.effect == 1 ? 'text-success' : 'text-warning'">
<view :class="item.effect == 1 ? 'text-success' : 'text-warning'" class="value">
{{ item.effect == 1 ? '已生效' : '未生效' }}
</view>
</view>
</view>
<!-- 费用合计 + 缴费方式 -->
<view class="price-section">
<view class="price-row">
......@@ -110,13 +110,13 @@
<text class="price-value">民生付</text>
</view>
</view>
<!-- 按钮组:靠右紧凑展示 -->
<view class="btn-group">
<!-- 已缴费:申请开票/已开票(需要审核通过才能开票) -->
<template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2">
<button class="btn btn-view-invoice" @click="makeInvoiceFN(item)" :disabled="item.invoiceStatus === 1">
开票
<button :disabled="item.invoiceStatus === 1" class="btn btn-view-invoice" @click="makeInvoiceFN(item)">
开票
</button>
</template>
<!-- 已开票:查看发票 -->
......@@ -131,19 +131,19 @@
</view>
</view>
</view>
<!-- 空状态 -->
<view v-else class="empty">
<image class="empty-img" mode="aspectFit" :src="config.baseUrl_api + '/fs/static/nodata.png'"></image>
<image :src="config.baseUrl_api + '/fs/static/nodata.png'" class="empty-img" mode="aspectFit"></image>
<text class="empty-text">暂无订单记录</text>
</view>
<!-- 加载/无更多提示 -->
<view class="loading-tip" v-if="loading">加载中...</view>
<view class="no-more" v-if="!loading && !hasMore && list.length">没有更多了</view>
<view v-if="loading" class="loading-tip">加载中...</view>
<view v-if="!loading && !hasMore && list.length" class="no-more">没有更多了</view>
</view>
</scroll-view>
<!-- 发票查看弹窗 -->
<view v-if="showInvoicePopup" class="invoice-popup-mask" @click="closeInvoicePopup">
<view class="invoice-popup-content" @click.stop>
......@@ -153,19 +153,19 @@
</view>
<view class="invoice-popup-body">
<view class="invoice-info-list">
<view class="invoice-info-row">
<view class="invoice-info-row">
<view class="invoice-info-label">发票类型</view>
<view class="invoice-type-badge" :class="{ 'vat-type': invoiceData.invoiceType == 2 }">
{{ invoiceData.invoiceType == 1 ? '普通发票' : '增值税专用发票' }}
</view>
<view :class="{ 'vat-type': invoiceData.invoiceType == 2 }" class="invoice-type-badge">
{{ invoiceData.invoiceType == 1 ? '普通发票' : '增值税专用发票' }}
</view>
</view>
<view class="invoice-info-row">
<text class="invoice-info-label">发票抬头</text>
<text class="invoice-info-value">{{ invoiceData.invoiceBuyerName || '—' }}</text>
</view>
<view class="invoice-info-row" v-if="invoiceData.invoiceBuyerTaxno">
<view v-if="invoiceData.invoiceBuyerTaxno" class="invoice-info-row">
<text class="invoice-info-label">纳税人识别号</text>
<text class="invoice-info-value">{{ invoiceData.invoiceBuyerTaxno }}</text>
</view>
......@@ -173,11 +173,19 @@
<text class="invoice-info-label">接收邮箱</text>
<text class="invoice-info-value">{{ invoiceData.invoicePushPhone || '—' }}</text>
</view>
<view class="invoice-info-row">
<text class="invoice-info-label">开票时间</text>
<text class="invoice-info-value">{{ invoiceData.invoiceTime || '—' }}</text>
</view>
<view class="invoice-info-row">
<text class="invoice-info-label">开票金额</text>
<text class="invoice-info-value">¥{{ invoiceData.price || '—' }}</text>
</view>
</view>
</view>
</view>
</view>
<!-- 自定义删除确认弹窗 -->
<view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup">
<view class="custom-modal" @click.stop>
......@@ -189,7 +197,7 @@
</view>
</view>
</view>
<!-- 自定义取消订单确认弹窗 -->
<view v-if="showCancelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeCancelPopup">
<view class="custom-modal" @click.stop>
......@@ -205,17 +213,17 @@
</template>
<script setup>
import { ref, reactive, onMounted, computed } from 'vue';
import {
onShow,
onLoad
} from '@dcloudio/uni-app'
import {ref, reactive, onMounted, computed} from 'vue';
import {
onShow,
onLoad
} from '@dcloudio/uni-app'
import * as api from '@/common/api.js'
import config from '@/config.js'
// 获取deptType值(初始值为0,在onMounted中设置实际值)
const deptType = ref(0);
const goToDetail = (item) => {
uni.navigateTo({ url: `/pages/rank/applyDetail?examId=${item.sourceId || item.id}&type=${queryParams.type}` });
uni.navigateTo({url: `/pages/rank/applyDetail?examId=${item.sourceId || item.id}&type=${queryParams.type}`});
}
// 标签栏配置(根据deptType动态生成)
......@@ -226,25 +234,25 @@ const tabs = computed(() => {
if (dt === 6) {
console.log('返回3个tab: 个人会员、单位会员、级位考试');
return [
{ name: '个人会员', type: '0' },
{ name: '单位会员', type: '1' },
{ name: '级位考试', type: '2' }
{name: '个人会员', type: '0'},
{name: '单位会员', type: '1'},
{name: '级位考试', type: '2'}
];
} else if (dt === 2) {
console.log('返回3个tab: 单位会员、段位考试、越段考试');
return [
// { name: '单位会员', type: '1' },
{ name: '段位考试', type: '3' },
{ name: '越段考试', type: '4' }
{name: '段位考试', type: '3'},
{name: '越段考试', type: '4'}
];
} else {
console.log('返回默认5个tab, dt值为:', dt);
return [
{ name: '个人会员', type: '0' },
{ name: '单位会员', type: '1' },
{ name: '级位考试', type: '2' },
{ name: '段位考试', type: '3' },
{ name: '越段考试', type: '4' }
{name: '个人会员', type: '0'},
{name: '单位会员', type: '1'},
{name: '级位考试', type: '2'},
{name: '段位考试', type: '3'},
{name: '越段考试', type: '4'}
];
}
});
......@@ -287,7 +295,7 @@ onLoad((option) => {
deptType.value = Number(app.globalData?.deptType || 0);
const firstType = tabs.value[0]?.type ?? '0';
currentTab.value = option.type || firstType;
queryParams.type = option.type ||firstType;
queryParams.type = option.type || firstType;
initData();
});
......@@ -349,11 +357,11 @@ const getAuditStatusText = (status) => {
const initData = async () => {
loading.value = true;
queryParams.pageNum = pageNum.value;
try {
const res = await api.orderList(queryParams);
console.log("接口返回:", res);
if (!res || !res.rows || res.rows.length === 0) {
hasMore.value = false;
loading.value = false;
......@@ -379,7 +387,7 @@ const initData = async () => {
hasMore.value = res.rows.length === pageSize.value;
} catch (e) {
console.error('订单加载异常:', e);
uni.showToast({ title: '加载失败', icon: 'none' });
uni.showToast({title: '加载失败', icon: 'none'});
hasMore.value = false;
} finally {
loading.value = false;
......@@ -399,13 +407,13 @@ const confirmDel = async () => {
if (!currentOrder.value) return;
try {
await api.deleteOrder(currentOrder.value.id);
uni.showToast({ title: '删除成功', icon: 'success' });
uni.showToast({title: '删除成功', icon: 'success'});
pageNum.value = 1;
list.value = [];
initData();
closeDelPopup();
} catch (e) {
uni.showToast({ title: '删除失败', icon: 'error' });
uni.showToast({title: '删除失败', icon: 'error'});
}
};
......@@ -420,10 +428,10 @@ const closeDelPopup = () => {
const handlePay = async (item) => {
if (item.payStatus !== 0) return;
try {
await api.goPay({ id: item.id });
uni.navigateTo({ url: `/pages/pay/pay?orderId=${item.id}` });
await api.goPay({id: item.id});
uni.navigateTo({url: `/pages/pay/pay?orderId=${item.id}`});
} catch (e) {
uni.showToast({ title: '发起支付失败', icon: 'none' });
uni.showToast({title: '发起支付失败', icon: 'none'});
}
};
......@@ -447,7 +455,9 @@ const viewInvoice = (item) => {
invoiceType: item.invoiceType || 1,
invoiceBuyerName: item.invoiceTitle || item.invoiceBuyerName || '—',
invoiceBuyerTaxno: item.invoiceTaxno || item.invoiceBuyerTaxno || '',
invoicePushPhone: item.invoiceEmail || item.invoicePushPhone || '—'
invoicePushPhone: item.invoiceEmail || item.invoicePushPhone || '—',
price: item.price || '-',
invoiceTime: item.invoiceTime || '—'
};
showInvoicePopup.value = true;
isPopupOpen.value = true;
......@@ -472,13 +482,13 @@ const confirmCancel = async () => {
if (!currentOrder.value) return;
try {
await api.cancelPay(currentOrder.value.id);
uni.showToast({ title: '取消成功', icon: 'success' });
uni.showToast({title: '取消成功', icon: 'success'});
pageNum.value = 1;
list.value = [];
initData();
closeCancelPopup();
} catch (e) {
uni.showToast({ title: '取消失败', icon: 'error' });
uni.showToast({title: '取消失败', icon: 'error'});
}
};
......@@ -496,7 +506,7 @@ const closeCancelPopup = () => {
height: 100vh;
display: flex;
flex-direction: column;
&.no-scroll {
overflow: hidden;
height: 100vh;
......@@ -571,65 +581,65 @@ const closeCancelPopup = () => {
padding-bottom: 20rpx;
// margin-bottom: 20rpx;
// border-bottom: 1rpx dashed #eee;
.date {
display: flex;
align-items: center;
gap: 8rpx;
font-size: 26rpx;
.date-text {
color: #666;
}
}
.status-tags {
display: flex;
gap: 10rpx;
}
.status-tag {
font-size: 22rpx;
padding: 6rpx 16rpx;
border-radius: 20rpx;
&.success {
background: #e6f7ef;
color: #52c41a;
}
&.danger {
background: #fff1f0;
color: #ff4d4f;
}
&.pending {
background: #f5f5f5;
color: #999;
}
&.ml-10 {
margin-left: 10rpx;
}
&.status-wait {
background: #f0f5ff;
color: #597ef7;
border: 1rpx solid rgba(89, 126, 247, 0.3);
}
&.status-pending {
background: #fff7e6;
color: #faad14;
border: 1rpx solid rgba(250, 173, 20, 0.3);
}
&.status-success {
background: #e6f7ef;
color: #52c41a;
border: 1rpx solid rgba(82, 196, 26, 0.3);
}
&.status-danger {
background: #fff1f0;
color: #ff4d4f;
......@@ -665,11 +675,13 @@ const closeCancelPopup = () => {
justify-content: space-around;
margin: 20rpx 0;
}
.line{
.line {
width: 1rpx;
height: 90%;
background: #eee;
}
.single-info {
padding: 16rpx 20rpx;
border-radius: 8rpx;
......@@ -679,17 +691,17 @@ const closeCancelPopup = () => {
color: #999;
text-align: center;
}
.value {
color: #333;
font-weight: 500;
text-align: center;
margin-top: 10rpx;
&.text-success {
color: #52c41a;
}
&.text-warning {
color: #faad14;
}
......@@ -701,26 +713,26 @@ const closeCancelPopup = () => {
// border-top: 1rpx dashed #eee;
// padding-top: 16rpx;
margin-top: 8rpx;
.price-row {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8rpx 0;
.price-label {
font-size: 26rpx;
color: #333;
}
.price-value {
font-size: 26rpx;
color: #666;
&.text-success {
color: #52c41a;
}
&.text-warning {
color: #faad14;
}
......@@ -731,12 +743,12 @@ const closeCancelPopup = () => {
// 按钮组
.btn-group {
display: flex;
justify-content: flex-end;
justify-content: flex-end;
align-items: center;
gap: 16rpx;
width: 100%;
margin-top: 20rpx;
.btn {
// 固定宽度,所有按钮一样大
width: 160rpx;
......@@ -750,10 +762,12 @@ const closeCancelPopup = () => {
background: transparent;
text-align: center;
margin: 0;
&::after {
&::after {
border: none;
display: none; // 关键:隐藏伪元素
display: none; // 关键:隐藏伪元素
}
&.btn-delete {
background: #fff;
color: #e4393c;
......@@ -765,7 +779,7 @@ const closeCancelPopup = () => {
color: #e4393c;
border: 1rpx solid #e4393c;
}
&.btn-view-invoice {
background: linear-gradient(90deg, #FF755A, #F51722);
color: #fff;
......@@ -879,11 +893,12 @@ const closeCancelPopup = () => {
border: none;
}
}
.code-text {
font-size: 28rpx;
font-weight: 600;
color: #e8341d;
letter-spacing: 1rpx;
font-size: 28rpx;
font-weight: 600;
color: #e8341d;
letter-spacing: 1rpx;
}
// 发票弹窗样式
......@@ -914,13 +929,13 @@ const closeCancelPopup = () => {
align-items: center;
padding: 30rpx;
background: linear-gradient(135deg, #AD181F 0%, #E4393C 100%);
.invoice-popup-title {
font-size: 32rpx;
font-weight: 600;
color: #fff;
}
.invoice-popup-close {
width: 44rpx;
height: 44rpx;
......@@ -945,7 +960,7 @@ const closeCancelPopup = () => {
border-radius: 30rpx;
font-size: 24rpx;
font-weight: 500;
&.vat-type {
background: linear-gradient(135deg, #6aaaf2 0%, #178cd7 100%);
}
......@@ -958,17 +973,17 @@ const closeCancelPopup = () => {
align-items: flex-start;
padding: 24rpx 0;
border-bottom: 1rpx dashed #eee;
&:last-child {
border-bottom: none;
}
.invoice-info-label {
font-size: 26rpx;
color: #999;
flex-shrink: 0;
}
.invoice-info-value {
font-size: 26rpx;
color: #333;
......@@ -978,4 +993,4 @@ const closeCancelPopup = () => {
}
}
}
</style>
\ No newline at end of file
</style>
......
......@@ -186,6 +186,7 @@ const handleSubmit = async () => {
uni.navigateBack();
}, 1500);
} catch (error) {
console.log(error)
submitting.value = false;
// 错误已由 request.js 处理
} finally {
......
......@@ -141,6 +141,7 @@ const queryParams = reactive({
pageNum: 1,
pageSize: 10,
type: '0', // 0表示个人会员
subType: '1', //0道馆 1个人
// queryType: '1',
// payStatus: '',
perId: ''
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!