查看发票
Showing
5 changed files
with
68 additions
and
18 deletions
| ... | @@ -134,7 +134,7 @@ | ... | @@ -134,7 +134,7 @@ |
| 134 | function getForm(memId){ | 134 | function getForm(memId){ |
| 135 | if(memId){ | 135 | if(memId){ |
| 136 | api.getGroupMemberInfoById(memId).then(res => { | 136 | api.getGroupMemberInfoById(memId).then(res => { |
| 137 | form.value = res.data | 137 | form.value = res.data |
| 138 | init() | 138 | init() |
| 139 | }) | 139 | }) |
| 140 | 140 | ... | ... |
| ... | @@ -261,12 +261,12 @@ | ... | @@ -261,12 +261,12 @@ |
| 261 | <!-- 按钮组:靠右紧凑展示 --> | 261 | <!-- 按钮组:靠右紧凑展示 --> |
| 262 | <view class="btn-group"> | 262 | <view class="btn-group"> |
| 263 | <view> | 263 | <view> |
| 264 | <text class="more" @click="goToDetail(item)">更多</text> | 264 | <text class="more" @click.stop="goToDetail(item)">更多</text> |
| 265 | </view> | 265 | </view> |
| 266 | <view class="btn-flex"> | 266 | <view class="btn-flex"> |
| 267 | <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> | 267 | <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> |
| 268 | <template> | 268 | <template> |
| 269 | <button class="btn btn-info" @click="goToDetail(item)">查看明细</button> | 269 | <button class="btn btn-info" @click.stop="goToDetail(item)">查看明细</button> |
| 270 | </template> | 270 | </template> |
| 271 | <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> | 271 | <!-- 已缴费:申请开票/已开票(需要审核通过才能开票) --> |
| 272 | <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2 &&item.price>0"> | 272 | <template v-if="item.payStatus == 1 && item.invoiceStatus != 1&& item.auditStatus == 2 &&item.price>0"> |
| ... | @@ -302,7 +302,7 @@ | ... | @@ -302,7 +302,7 @@ |
| 302 | </view> | 302 | </view> |
| 303 | </scroll-view> | 303 | </scroll-view> |
| 304 | 304 | ||
| 305 | <!-- 发票查看弹窗 --> | 305 | <!-- 发票信息弹窗(级位/段位/越段考试) --> |
| 306 | <view v-if="showInvoicePopup" class="invoice-popup-mask" @click="closeInvoicePopup"> | 306 | <view v-if="showInvoicePopup" class="invoice-popup-mask" @click="closeInvoicePopup"> |
| 307 | <view class="invoice-popup-content" @click.stop> | 307 | <view class="invoice-popup-content" @click.stop> |
| 308 | <view class="invoice-popup-header"> | 308 | <view class="invoice-popup-header"> |
| ... | @@ -310,8 +310,6 @@ | ... | @@ -310,8 +310,6 @@ |
| 310 | <view class="invoice-popup-close" @click="closeInvoicePopup">✕</view> | 310 | <view class="invoice-popup-close" @click="closeInvoicePopup">✕</view> |
| 311 | </view> | 311 | </view> |
| 312 | <view class="invoice-popup-body"> | 312 | <view class="invoice-popup-body"> |
| 313 | |||
| 314 | |||
| 315 | <view class="invoice-info-list"> | 313 | <view class="invoice-info-list"> |
| 316 | <view class="invoice-info-row"> | 314 | <view class="invoice-info-row"> |
| 317 | <view class="invoice-info-label">发票类型</view> | 315 | <view class="invoice-info-label">发票类型</view> |
| ... | @@ -343,6 +341,19 @@ | ... | @@ -343,6 +341,19 @@ |
| 343 | </view> | 341 | </view> |
| 344 | </view> | 342 | </view> |
| 345 | </view> | 343 | </view> |
| 344 | |||
| 345 | <!-- 发票Webview弹窗(个人/单位会员) --> | ||
| 346 | <view v-if="showInvoiceWebview" class="invoice-popup-mask" @click="closeInvoiceWebview"> | ||
| 347 | <view class="invoice-webview-content" @click.stop> | ||
| 348 | <view class="invoice-popup-header"> | ||
| 349 | <text class="invoice-popup-title">发票</text> | ||
| 350 | <view class="invoice-popup-close" @click="closeInvoiceWebview">✕</view> | ||
| 351 | </view> | ||
| 352 | <view class="invoice-webview-body"> | ||
| 353 | <web-view :src="invoiceWebviewUrl"></web-view> | ||
| 354 | </view> | ||
| 355 | </view> | ||
| 356 | </view> | ||
| 346 | 357 | ||
| 347 | <!-- 自定义删除确认弹窗 --> | 358 | <!-- 自定义删除确认弹窗 --> |
| 348 | <view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup"> | 359 | <view v-if="showDelPopup" class="popup-mask" @touchmove.stop.prevent @click.stop="closeDelPopup"> |
| ... | @@ -440,6 +451,8 @@ const showDelPopup = ref(false); | ... | @@ -440,6 +451,8 @@ const showDelPopup = ref(false); |
| 440 | const showCancelPopup = ref(false); | 451 | const showCancelPopup = ref(false); |
| 441 | const isPopupOpen = ref(false); | 452 | const isPopupOpen = ref(false); |
| 442 | const showInvoicePopup = ref(false); | 453 | const showInvoicePopup = ref(false); |
| 454 | const showInvoiceWebview = ref(false); | ||
| 455 | const invoiceWebviewUrl = ref(''); | ||
| 443 | const invoiceData = ref({}); | 456 | const invoiceData = ref({}); |
| 444 | 457 | ||
| 445 | // 弹窗内容 | 458 | // 弹窗内容 |
| ... | @@ -661,6 +674,19 @@ const makeInvoiceFN = (item) => { | ... | @@ -661,6 +674,19 @@ const makeInvoiceFN = (item) => { |
| 661 | 674 | ||
| 662 | // 查看发票 | 675 | // 查看发票 |
| 663 | const viewInvoice = (item) => { | 676 | const viewInvoice = (item) => { |
| 677 | // 个人/单位会员(type 0或1)直接跳转webview页面展示发票 | ||
| 678 | if (item.type === 0 || item.type === '0' || item.type === 1 || item.type === '1') { | ||
| 679 | if (item.invoiceUrl) { | ||
| 680 | const encodedUrl = encodeURIComponent(item.invoiceUrl); | ||
| 681 | uni.navigateTo({ | ||
| 682 | url: `/pages/webview/webview?url=${encodedUrl}` | ||
| 683 | }); | ||
| 684 | } else { | ||
| 685 | uni.showToast({ title: '暂无发票', icon: 'none' }); | ||
| 686 | } | ||
| 687 | return; | ||
| 688 | } | ||
| 689 | // 其他类型显示发票信息弹窗 | ||
| 664 | invoiceData.value = { | 690 | invoiceData.value = { |
| 665 | invoiceType: item.invoiceType || 1, | 691 | invoiceType: item.invoiceType || 1, |
| 666 | invoiceBuyerName: item.invoiceTitle || item.invoiceBuyerName || '—', | 692 | invoiceBuyerName: item.invoiceTitle || item.invoiceBuyerName || '—', |
| ... | @@ -679,6 +705,12 @@ const closeInvoicePopup = () => { | ... | @@ -679,6 +705,12 @@ const closeInvoicePopup = () => { |
| 679 | isPopupOpen.value = false; | 705 | isPopupOpen.value = false; |
| 680 | }; | 706 | }; |
| 681 | 707 | ||
| 708 | // 关闭发票Webview弹窗 | ||
| 709 | const closeInvoiceWebview = () => { | ||
| 710 | showInvoiceWebview.value = false; | ||
| 711 | isPopupOpen.value = false; | ||
| 712 | }; | ||
| 713 | |||
| 682 | // 取消订单 | 714 | // 取消订单 |
| 683 | const handleCancel = (item) => { | 715 | const handleCancel = (item) => { |
| 684 | currentOrder.value = item; | 716 | currentOrder.value = item; |
| ... | @@ -1209,6 +1241,21 @@ const closeCancelPopup = () => { | ... | @@ -1209,6 +1241,21 @@ const closeCancelPopup = () => { |
| 1209 | box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.2); | 1241 | box-shadow: 0 10rpx 30rpx rgba(0, 0, 0, 0.2); |
| 1210 | } | 1242 | } |
| 1211 | 1243 | ||
| 1244 | .invoice-webview-content { | ||
| 1245 | width: 90%; | ||
| 1246 | height: 85vh; | ||
| 1247 | background: #fff; | ||
| 1248 | border-radius: 20rpx; | ||
| 1249 | overflow: hidden; | ||
| 1250 | display: flex; | ||
| 1251 | flex-direction: column; | ||
| 1252 | } | ||
| 1253 | |||
| 1254 | .invoice-webview-body { | ||
| 1255 | flex: 1; | ||
| 1256 | overflow: hidden; | ||
| 1257 | } | ||
| 1258 | |||
| 1212 | .invoice-popup-header { | 1259 | .invoice-popup-header { |
| 1213 | display: flex; | 1260 | display: flex; |
| 1214 | justify-content: space-between; | 1261 | justify-content: space-between; | ... | ... |
| ... | @@ -955,7 +955,7 @@ function submitCertification() { | ... | @@ -955,7 +955,7 @@ function submitCertification() { |
| 955 | parentId: form.value.parentId, | 955 | parentId: form.value.parentId, |
| 956 | creditCode: form.value.creditCode, | 956 | creditCode: form.value.creditCode, |
| 957 | legal: form.value.legal, | 957 | legal: form.value.legal, |
| 958 | businessLicense: JSON.stringify(form.value.businessLicense), | 958 | businessLicense: form.value.businessLicense, |
| 959 | pictures: form.value.pictures, | 959 | pictures: form.value.pictures, |
| 960 | memId: form.value.memId, | 960 | memId: form.value.memId, |
| 961 | id: form.value.deptId, | 961 | id: form.value.deptId, |
| ... | @@ -1034,8 +1034,10 @@ function onBusinessLicenseSelect() { | ... | @@ -1034,8 +1034,10 @@ function onBusinessLicenseSelect() { |
| 1034 | } | 1034 | } |
| 1035 | // 存储为数组格式的JSON字符串 | 1035 | // 存储为数组格式的JSON字符串 |
| 1036 | form.value.businessLicense = JSON.stringify([{ | 1036 | form.value.businessLicense = JSON.stringify([{ |
| 1037 | uid: Date.now(), | ||
| 1038 | name: name, | ||
| 1037 | url: url, | 1039 | url: url, |
| 1038 | name: name | 1040 | status: 'success' |
| 1039 | }]) | 1041 | }]) |
| 1040 | }).catch(() => { | 1042 | }).catch(() => { |
| 1041 | uni.hideLoading() | 1043 | uni.hideLoading() | ... | ... |
| ... | @@ -17,6 +17,9 @@ | ... | @@ -17,6 +17,9 @@ |
| 17 | if (options.url) { | 17 | if (options.url) { |
| 18 | url.value = decodeURIComponent(options.url); | 18 | url.value = decodeURIComponent(options.url); |
| 19 | } | 19 | } |
| 20 | if (options.title) { | ||
| 21 | uni.setNavigationBarTitle({ title: decodeURIComponent(options.title) }); | ||
| 22 | } | ||
| 20 | }); | 23 | }); |
| 21 | 24 | ||
| 22 | const handleMessage = (event) => { | 25 | const handleMessage = (event) => { | ... | ... |
| ... | @@ -438,16 +438,14 @@ const makeInvoiceFN = (item) => { | ... | @@ -438,16 +438,14 @@ const makeInvoiceFN = (item) => { |
| 438 | 438 | ||
| 439 | // 查看发票 | 439 | // 查看发票 |
| 440 | const viewInvoice = (item) => { | 440 | const viewInvoice = (item) => { |
| 441 | invoiceData.value = { | 441 | if (item.invoiceUrl) { |
| 442 | invoiceType: item.invoiceType || 1, | 442 | const encodedUrl = encodeURIComponent(item.invoiceUrl); |
| 443 | invoiceBuyerName: item.invoiceTitle || item.invoiceBuyerName || '—', | 443 | uni.navigateTo({ |
| 444 | invoiceBuyerTaxno: item.invoiceTaxno || item.invoiceBuyerTaxno || '', | 444 | url: `/pages/webview/webview?url=${encodedUrl}` |
| 445 | invoicePushPhone: item.invoiceEmail || item.invoicePushPhone || '—', | 445 | }); |
| 446 | price: item.price || '-', | 446 | } else { |
| 447 | invoiceTime: item.invoiceTime || '—' | 447 | uni.showToast({ title: '暂无发票', icon: 'none' }); |
| 448 | }; | 448 | } |
| 449 | showInvoicePopup.value = true; | ||
| 450 | isPopupOpen.value = true; | ||
| 451 | }; | 449 | }; |
| 452 | 450 | ||
| 453 | // 关闭发票弹窗 | 451 | // 关闭发票弹窗 | ... | ... |
-
Please register or sign in to post a comment