mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-uniapp.git
synced 2026-09-22 04:42:02 +08:00
feat(distribution): 添加分销员状态检查与加载指示
- 在多个分销相关页面中引入分销员状态检查,确保用户在访问前具备有效分销资格。 - 增加加载指示器以改善用户体验,提示用户正在加载数据。 - 更新相关逻辑以处理分销员资格的不同状态,确保用户在不符合条件时获得适当反馈。
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
</view>
|
||||
|
||||
<!-- 账户列表 -->
|
||||
<view v-else-if="accounts.length" class="account-list">
|
||||
<view v-else-if="pageReady && accounts.length" class="account-list">
|
||||
<view
|
||||
class="account-item"
|
||||
v-for="item in accounts"
|
||||
@@ -39,12 +39,12 @@
|
||||
</view>
|
||||
|
||||
<!-- 空状态 -->
|
||||
<view v-else class="empty-wrap">
|
||||
<view v-else-if="pageReady" class="empty-wrap">
|
||||
<text class="empty-text">暂无银行卡,请添加</text>
|
||||
</view>
|
||||
|
||||
<!-- 添加账户按钮 -->
|
||||
<view class="add-btn-wrap">
|
||||
<view v-if="pageReady" class="add-btn-wrap">
|
||||
<view class="add-btn" @click="openAddPopup">+ 添加账户</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -102,6 +102,7 @@ import { onLoad, onShow } from '@dcloudio/uni-app'
|
||||
import { useStore } from '@/store'
|
||||
import { getThemeStyle } from '@/utils/theme'
|
||||
import { getBankCards, addBankCard, deleteBankCard, setDefaultBankCard } from '@/api/distribution'
|
||||
import { assertActiveDistributor } from '@/utils/distributionStatus'
|
||||
|
||||
const store = useStore()
|
||||
const themeStyle = computed(() => getThemeStyle(store.state.theme))
|
||||
@@ -113,7 +114,8 @@ const isSelectMode = ref(false)
|
||||
|
||||
const accounts = ref<any[]>([])
|
||||
const selectedId = ref('')
|
||||
const loading = ref(false)
|
||||
const pageReady = ref(false)
|
||||
const loading = ref(true)
|
||||
const addPopupVisible = ref(false)
|
||||
const saveLoading = ref(false)
|
||||
const form = ref({ holderName: '', bankName: '', cardNo: '' })
|
||||
@@ -127,7 +129,14 @@ onLoad((options: any) => {
|
||||
})
|
||||
|
||||
onShow(() => {
|
||||
loadAccounts()
|
||||
loading.value = true
|
||||
assertActiveDistributor().then((d) => {
|
||||
if (!d) {
|
||||
return
|
||||
}
|
||||
pageReady.value = true
|
||||
loadAccounts()
|
||||
})
|
||||
})
|
||||
|
||||
function loadAccounts() {
|
||||
|
||||
Reference in New Issue
Block a user