Kaynağa Gözat

feat(KIP-11923): 补充pdf下载功能

john 1 yıl önce
ebeveyn
işleme
949dd7f430

+ 4 - 1
src/pages/parkingFeeV2/mixins/parkingReceipt/parkingInvoice.js

@@ -23,6 +23,7 @@ export default {
         remark: "",
         invoiceTitleId: 0,
         invoiceTime: "",
+        invoiceUrl: "",
         invoiceTitle: {
             id: 0,
             titleName: "",
@@ -92,7 +93,9 @@ export default {
       try {
         const res = await invoicesDeatil(id)
         console.log('支付订单详情', res)
-          self.order = res;
+        self.order = res;
+        // TODO KIP-11923 发布前移除
+        self.order.invoiceUrl = 'https://kip-public-qa.oss-cn-shanghai.aliyuncs.com/dea54e0cff544ace90564a9f715dc9df_99242000000001678918.pdf'
       } catch {
         uni.showToast({
           title: '服务器开小差了呢,请您稍后再试',

+ 5 - 0
src/pages/parkingFeeV2/mixins/parkingReceipt/parkingInvoiceImage.js

@@ -78,5 +78,10 @@ export default {
         });
       }
     },
+    downloadPdf() {
+      wx.miniProgram.navigateTo({
+        url: `/pages/package-parkingFee/file?invoiceUrl=${encodeURIComponent(this.order.invoiceUrl)}`,
+      });
+    }
   },
 };

+ 11 - 0
src/pages/parkingFeeV2/parkingReceipt/parkingInvoiceImage.vue

@@ -25,6 +25,17 @@
       >
         再次推送
       </div>
+      <div
+        v-if="order && order.invoiceUrl"
+        :class="{
+          btn: true,
+          'push-again-btn': true,
+        }"
+        style="width:100%; margin:24px auto 0;"
+        @click="downloadPdf"
+      >
+        下载发票
+      </div>
     </div>
   </scroll-view>
 </template>