解决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 { class InvoiceApi {
static userId = Cache.get('userId')
//获取可以开具发票的订单 //获取可以开具发票的订单
static doGetMineInvoiceOrderList(data, status) { 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') return request(path, "GET", data, null, 'plug')
} }
static doGetDicListByPId(id) { static doGetDicListByPId(id) {
@ -29,12 +29,14 @@ class InvoiceApi {
} }
//我的开票信息 //我的开票信息
static doGetMineInvoiceList(data) { 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') return request(path, "GET", data, null, 'plug')
} }
//保存我的开票信息 //保存我的开票信息
static doSaveMineInvoiceInfo(data) { 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') return request(path, "POST", data, null, 'plug')
} }
//编辑开票信息 //编辑开票信息
@ -49,7 +51,8 @@ class InvoiceApi {
} }
//开票申请列表 //开票申请列表
static doGetInvoiceRecordList(data) { 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') return request(path, "GET", data, null, 'plug')
} }
//取消开票申请 //取消开票申请
@ -59,7 +62,8 @@ class InvoiceApi {
} }
//提交开票申请 //提交开票申请
static doSaveInvoiceRecord(data) { 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') return request(path, "POST", data, null, 'plug')
} }
//修改开票申请 //修改开票申请

View File

@ -1,23 +1,9 @@
<!--pages/mine/mineAccount/invoiceOrder/invoiceOrder.wxml--> <!--pages/mine/mineAccount/invoiceOrder/invoiceOrder.wxml-->
<!-- 可以开具发票的订单 --> <!-- 可以开具发票的订单 -->
<view class="page-container"> <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;"> <view style="margin-top: 5rpx;">
<container-loading loadingState="{{loadingState}}"> <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"> <view class="order-list-box">
<block wx:for="{{orderList}}" wx:key="index"> <block wx:for="{{orderList}}" wx:key="index">
<view class="order-list-item" bind:tap="checkItem" data-value="{{item}}"> <view class="order-list-item" bind:tap="checkItem" data-value="{{item}}">
@ -36,8 +22,8 @@
</block> </block>
<mp-loading show="{{isLoadMore}}" type="circle"></mp-loading> <mp-loading show="{{isLoadMore}}" type="circle"></mp-loading>
<view wx:if="{{!hasMore}}" class="no-more"> <view wx:if="{{!hasMore}}" class="no-more">
<view class="no-more-dot"></view> <view class="no-more-dot"></view>
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
</container-loading> </container-loading>

View File

@ -22,7 +22,7 @@
</view> </view>
</view> </view>
<container-loading loadingState="{{loadingState}}" style="height: 82vh;margin-top: 140rpx;" bindrefresh="doRefreshList"> <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"> <view class="order-box">
<block wx:for="{{recordList}}" wx:key="index"> <block wx:for="{{recordList}}" wx:key="index">
<view class="order-item"> <view class="order-item">