From 025e46e11cb2962fd7692adfa401333758cc779b Mon Sep 17 00:00:00 2001 From: gaoluyang <2820782392@qq.com> Date: 星期二, 02 九月 2025 14:00:34 +0800 Subject: [PATCH] 修改组件 --- src/pages/sales/receiptPayment/index.vue | 34 ++++++++++++++++++++++++++-------- 1 files changed, 26 insertions(+), 8 deletions(-) diff --git a/src/pages/sales/receiptPayment/index.vue b/src/pages/sales/receiptPayment/index.vue index 1fce10b..ee5a4e7 100644 --- a/src/pages/sales/receiptPayment/index.vue +++ b/src/pages/sales/receiptPayment/index.vue @@ -1,5 +1,5 @@ <template> - <view class="receipt-payment"> + <view class="sales-account"> <!-- 浣跨敤閫氱敤椤甸潰澶撮儴缁勪欢 --> <PageHeader title="鍥炴鐧昏" @back="goBack" /> @@ -22,7 +22,7 @@ <!-- 绛涢�夊紑鍏� --> <view class="switch-row"> <text class="switch-label">涓嶆樉绀哄緟鍥炴涓�0</text> - <van-switch v-model="searchForm.status" @change="getList" size="18"/> + <up-switch v-model="searchForm.status" @change="getList" size="18"/> </view> </view> @@ -82,7 +82,7 @@ <!-- 鎿嶄綔鎸夐挳 --> <view class="action-buttons"> - <van-button + <up-button type="primary" size="small" class="action-btn" @@ -90,7 +90,7 @@ @click="openForm(item)" > 鏂板鍥炴 - </van-button> + </up-button> </view> </view> </view> @@ -109,12 +109,28 @@ bindInvoiceNoRegPage, } from '@/api/salesManagement/receiptPayment' import useUserStore from '@/store/modules/user' + +// 鏄剧ず鎻愮ず淇℃伅 const showToast = (message) => { uni.showToast({ title: message, icon: 'none' }) } + +// 鏄剧ず鍔犺浇鎻愮ず +const showLoadingToast = (message) => { + uni.showLoading({ + title: message, + mask: true + }); +}; + +// 鍏抽棴鍔犺浇鎻愮ず +const closeToast = () => { + uni.hideLoading(); +}; + import {onShow} from "@dcloudio/uni-app"; // 鍝嶅簲寮忔暟鎹� @@ -148,14 +164,16 @@ // 鑾峰彇鍒楄〃鏁版嵁 const getList = () => { - tableLoading.value = true + showLoadingToast('鍔犺浇涓�...') bindInvoiceNoRegPage({ ...searchForm.value, ...page.value }) .then((res) => { - tableLoading.value = false tableData.value = res.data.records || [] }) .catch(() => { - tableLoading.value = false + showToast('鑾峰彇鏁版嵁澶辫触') + }) + .finally(() => { + closeToast() }) } @@ -179,7 +197,7 @@ margin: 0 !important; } -.receipt-payment { +.sales-account { min-height: 100vh; background: #f8f9fa; position: relative; -- Gitblit v1.9.3