Commit 448118af by liangjianmin

feat(approve): enhance search functionality and refine UI styling

- Update search bar padding to remove bottom spacing for better layout
- Rename search input variable from `keyword` to `order_sn` for clarity
- Add search input styling with custom font size (24rpx) and height (60rpx)
- Implement `onSearch` method to trigger data fetch on search input change
- Add order_sn parameter to API request when search value is provided
- Correct status filter logic to use '1' instead of '1,2' for processed items
- Enhance empty state display with custom icon size (140) and text size (24)
- Improve search UX by enabling real-time filtering based on order number
parent 5a434d79
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
padding-bottom: 158rpx; padding-bottom: 158rpx;
.search-bar { .search-bar {
padding: 20rpx 28rpx; padding: 20rpx 28rpx 0 28rpx;
background: #ffffff; background: #ffffff;
} }
......
<template> <template>
<view class="approve-page"> <view class="approve-page">
<view class="search-bar"> <view class="search-bar">
<u-search v-model="keyword" placeholder="订单号" shape="round" :showAction="false" bgColor="#f5f7fa"></u-search> <u-search v-model="order_sn" placeholder="订单号" shape="round" :showAction="false" bgColor="#f5f7fa" :inputStyle="{ fontSize: '24rpx' }" height="60" :searchIconSize="34" @change="onSearch"></u-search>
</view> </view>
<view class="tabs-wrap"> <view class="tabs-wrap">
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
</view> </view>
</view> </view>
<u-empty v-if="!currentList.length" mode="data" :text="currentTab === 0 ? '暂无待处理审批' : '暂无已处理审批'"></u-empty> <u-empty v-if="!currentList.length" mode="data" :text="currentTab === 0 ? '暂无待处理审批' : '暂无已处理审批'" iconSize="140" textSize="24"></u-empty>
</view> </view>
</view> </view>
</template> </template>
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
export default { export default {
data() { data() {
return { return {
keyword: '', order_sn: '',
currentTab: 0, currentTab: 0,
tabList: [ tabList: [
{ name: '待处理' }, { name: '待处理' },
...@@ -77,8 +77,12 @@ ...@@ -77,8 +77,12 @@
* @return {void} * @return {void}
*/ */
getData() { getData() {
var statusVal = this.currentTab === 0 ? '0' : '1,2'; var statusVal = this.currentTab === 0 ? '0' : '1';
this.request(API.feeApproveList, 'GET', { status: statusVal }, true).then(res => { var params = { status: statusVal };
if (this.order_sn) {
params.order_sn = this.order_sn;
}
this.request(API.feeApproveList, 'GET', params, true).then(res => {
if (res.code === 0) { if (res.code === 0) {
var { list = [], total = 0 } = res.data || {}; var { list = [], total = 0 } = res.data || {};
if (this.currentTab === 0) { if (this.currentTab === 0) {
...@@ -91,6 +95,13 @@ ...@@ -91,6 +95,13 @@
}); });
}, },
/** /**
* 搜索
* @return {void}
*/
onSearch() {
this.getData();
},
/**
* Tab 切换 * Tab 切换
* @param {Object} item - 选中的 tab 项 * @param {Object} item - 选中的 tab 项
* @return {void} * @return {void}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment