MrShi
10 小时以前 b806c4ad52a661a1e5f0695650ec1a7e42f01633
small-program/shop/pages/Invoice-application/Invoice-application.vue
@@ -13,13 +13,13 @@
         </view>
      </view>
      <scroll-view scroll-y class="page-scroll">
      <scroll-view scroll-y class="page-scroll" @scrolltolower="handleScrollTolower">
         <view v-if="currentTab === 'apply'" class="card-list">
            <view v-for="item in applyList" :key="item.id" class="invoice-card apply-card">
               <view class="order-no">
                  <text>订单编号:{{ item.code }}</text>
                  <view class="mode-tag city-tag" v-if="item.type === 1">异地存取</view>
                  <view class="mode-tag local-tag" v-else>就地存取</view>
                  <view class="mode-tag city-tag" v-if="item.type === 1">同城寄送</view>
                  <view class="mode-tag local-tag" v-else>就地寄存</view>
               </view>
               <view class="address-group">
                  <view class="address-row">
@@ -58,7 +58,7 @@
                     <text class="price-label">实付款:</text>
                     <text class="price-value">¥{{((item.estimatedAmount || 0)/100).toFixed(2) }}</text>
                  </view>
               <view class="action-btn primary-btn" @tap="goInvoiceRequest(item)">申请开票</view>
               <!-- <view class="action-btn primary-btn" @tap="goInvoiceRequest(item)">申请开票</view> -->
               </view>
            </view>
         </view>
@@ -185,14 +185,14 @@
      onLoad() {
         this.getApplyList()
      },
      onReachBottom() {
         if (this.currentTab === 'apply') {
            this.getApplyList()
         } else if (this.currentTab === 'history') {
            this.getHistoryList()
         }
      },
      methods: {
         handleScrollTolower() {
            if (this.currentTab === 'apply') {
               this.getApplyList()
            } else if (this.currentTab === 'history') {
               this.getHistoryList()
            }
         },
         async getApplyList() {
            if (!this.isRequest) return
            const res = await this.$u.api.myOrderPage({
@@ -212,7 +212,8 @@
               })
               this.applyList = [...this.applyList, ...list]
               this.page++
               if (res.data.total <= this.applyList.length) {
               console.log(res.data.total, this.applyList.length)
               if (this.applyList.length >= res.data.total) {
                  this.isRequest = false
               }
            }
@@ -235,16 +236,23 @@
               })
               this.historyList = [...this.historyList, ...list]
               this.historyPage++
               if (res.data.total <= this.historyList.length) {
               if (this.historyList.length >= res.data.total) {
                  this.historyIsRequest = false
               }
            }
         },
         handleSearch() {
            this.historyPage = 1
            this.historyList = []
            this.historyIsRequest = true
            this.getHistoryList()
            if (this.currentTab === 'apply') {
               this.page = 1
               this.applyList = []
               this.isRequest = true
               this.getApplyList()
            } else if (this.currentTab === 'history') {
               this.historyPage = 1
               this.historyList = []
               this.historyIsRequest = true
               this.getHistoryList()
            }
         },
         getTabIcon(tab) {
            return this.currentTab === tab.value ? tab.activeIcon : tab.icon;
@@ -301,6 +309,7 @@
   .mode-tag {
      width: 112rpx;
      height: 38rpx;
      line-height: 38rpx;
      border-radius: 8rpx;
      display: flex;
      align-items: baseline;