fix: 优化售后搜索

master
misworga831 2023-10-16 18:33:52 +08:00
parent b69c7d5a05
commit 2634017fb3
1 changed files with 15 additions and 7 deletions

View File

@ -12,11 +12,11 @@
</view> </view>
<div class="u-tabs-search"> <div class="u-tabs-search">
<u-search <u-search
placeholder="请输入订单编号" placeholder="请输入订单编号/商品名称/售后单号"
@search="submitSearchOrderList(current)" @search="submitSearchOrderList(current)"
@clear="submitSearchOrderList(current)" @clear="clear(current)"
@custom="submitSearchOrderList(current)" @custom="submitSearchOrderList(current)"
v-model="orderSn" v-model="keywords"
> >
</u-search> </u-search>
</div> </div>
@ -239,13 +239,13 @@ export default {
pageSize: 10, pageSize: 10,
}, },
status: "loadmore", status: "loadmore",
orderSn: "", // sn keywords: "", // sn
}; };
}, },
onLoad(options) { onLoad(options) {
this.orderList = []; this.orderList = [];
this.params.pageNumber = 1; this.params.pageNumber = 1;
if (options.orderSn) this.params.orderSn = options.orderSn; if (options.orderSn) this.params.keywords = options.orderSn;
this.searchOrderList(this.current); this.searchOrderList(this.current);
}, },
onPullDownRefresh() { onPullDownRefresh() {
@ -261,6 +261,14 @@ export default {
this.orderList = []; this.orderList = [];
this.searchOrderList(current); this.searchOrderList(current);
}, },
//
clear(current){
this.params.pageNumber = 1;
this.logParams.pageNumber = 1;
this.params.keywords = ''
this.orderList = [];
this.searchOrderList(current);
},
/** /**
* 切换tab页时初始化数据 * 切换tab页时初始化数据
*/ */
@ -282,7 +290,7 @@ export default {
*/ */
searchOrderList(index) { searchOrderList(index) {
if (index == 0) { if (index == 0) {
this.orderSn ? (this.params.orderSn = this.orderSn) : ""; this.keywords ? (this.params.keywords = this.keywords) : "";
this.getOrderList(); this.getOrderList();
} else { } else {
this.logParams = { this.logParams = {
@ -294,7 +302,7 @@ export default {
if (index === 1) { if (index === 1) {
this.logParams.serviceStatus = "APPLY"; this.logParams.serviceStatus = "APPLY";
} }
this.orderSn ? (this.logParams.orderSn = this.orderSn) : ""; this.keywords ? (this.logParams.keywords = this.keywords) : "";
this.orderList = []; this.orderList = [];
this.getAfterSaleLogList(); this.getAfterSaleLogList();
} }