解决userId为空bug

This commit is contained in:
itgaojian163 2025-05-13 15:46:34 +08:00
parent 0af5906b61
commit e687fe6184
3 changed files with 14 additions and 24 deletions

View File

@ -17,10 +17,10 @@ const apiPath = {
}
class InvoiceApi {
static userId = Cache.get('userId')
//获取可以开具发票的订单
static doGetMineInvoiceOrderList(data, status) {
const path = apiPath.mineInvoiceOrderList.replace('{userId}', this.userId).replace('{status}', status)
const userId = Cache.get('userId')
const path = apiPath.mineInvoiceOrderList.replace('{userId}', userId).replace('{status}', status)
return request(path, "GET", data, null, 'plug')
}
static doGetDicListByPId(id) {
@ -29,12 +29,14 @@ class InvoiceApi {
}
//我的开票信息
static doGetMineInvoiceList(data) {
const path = apiPath.mineInvoiceList.replace('{userId}', this.userId)
const userId = Cache.get('userId')
const path = apiPath.mineInvoiceList.replace('{userId}', userId)
return request(path, "GET", data, null, 'plug')
}
//保存我的开票信息
static doSaveMineInvoiceInfo(data) {
const path = apiPath.saveInvoiceInfo.replace('{userId}', this.userId)
const userId = Cache.get('userId')
const path = apiPath.saveInvoiceInfo.replace('{userId}', userId)
return request(path, "POST", data, null, 'plug')
}
//编辑开票信息
@ -49,7 +51,8 @@ class InvoiceApi {
}
//开票申请列表
static doGetInvoiceRecordList(data) {
const path = apiPath.mineInvoiceRecordList.replace('{userId}', this.userId)
const userId = Cache.get('userId')
const path = apiPath.mineInvoiceRecordList.replace('{userId}', userId)
return request(path, "GET", data, null, 'plug')
}
//取消开票申请
@ -59,7 +62,8 @@ class InvoiceApi {
}
//提交开票申请
static doSaveInvoiceRecord(data) {
const path = apiPath.saveInvoiceRecord.replace('{userId}', this.userId)
const userId = Cache.get('userId')
const path = apiPath.saveInvoiceRecord.replace('{userId}', userId)
return request(path, "POST", data, null, 'plug')
}
//修改开票申请

View File

@ -1,23 +1,9 @@
<!--pages/mine/mineAccount/invoiceOrder/invoiceOrder.wxml-->
<!-- 可以开具发票的订单 -->
<view class="page-container">
<!-- <view class="list-title-btns">
<view bind:tap="doChangeStatus" data-value="not" class="{{currentStatus=='not'? 'btn-select':'btn-normal'}} border-left">
<view class="tab">
<text>可开</text>
<view class="{{currentStatus=='not'?'border-select':'border-normal'}}"></view>
</view>
</view>
<view bind:tap="doChangeStatus" data-value="yes" class="{{currentStatus=='yes'? 'btn-select':'btn-normal'}} border-right">
<view class="tab">
<text>已开</text>
<view class="{{currentStatus=='yes'?'border-select':'border-normal'}}"></view>
</view>
</view>
</view> -->
<view style="margin-top: 5rpx;">
<container-loading loadingState="{{loadingState}}">
<scroll-view scroll-y style="height: 80vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='40'>
<scroll-view scroll-y style="height: 81vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='50'>
<view class="order-list-box">
<block wx:for="{{orderList}}" wx:key="index">
<view class="order-list-item" bind:tap="checkItem" data-value="{{item}}">
@ -36,8 +22,8 @@
</block>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore}}" class="no-more">
<view class="no-more-dot"></view>
</view>
<view class="no-more-dot"></view>
</view>
</view>
</scroll-view>
</container-loading>

View File

@ -22,7 +22,7 @@
</view>
</view>
<container-loading loadingState="{{loadingState}}" style="height: 82vh;margin-top: 140rpx;" bindrefresh="doRefreshList">
<scroll-view scroll-y="{{true}}" style="height: 82vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='30'>
<scroll-view scroll-y="{{true}}" style="height: 82vh;" bindrefresherrefresh="doRefreshList" refresher-enabled refresher-triggered="{{listRefreshTrig}}" bindscrolltolower="doLoadMore" lower-threshold='50'>
<view class="order-box">
<block wx:for="{{recordList}}" wx:key="index">
<view class="order-item">