Bladeren bron

查询的优化

luhuan 1 maand geleden
bovenliggende
commit
1c6c2953e9
1 gewijzigde bestanden met toevoegingen van 17 en 2 verwijderingen
  1. 17 2
      pages/index/index.vue

+ 17 - 2
pages/index/index.vue

@@ -1,7 +1,9 @@
 <template>
 	<view class="u-page">
-		<u--input placeholder="请输入手机号或订单" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399"
-			v-model="numValue"></u--input>
+<!--		<u&#45;&#45;input placeholder="请输入手机号或订单" prefixIcon="search" prefixIconStyle="font-size: 22px;color: #909399"-->
+<!--			v-model="numValue"></u&#45;&#45;input>-->
+    <u-search shape="round" v-model="no" @search="getList(accountId,userId)"
+              placeholder="请输入手机号或订单" input-align="center" :show-action="false"></u-search>
 		<u-list @scrolltolower="scrolltolower">
       <view v-for="(item, index) in orderList" :key="index">
         <u-cell :value="item.CURRENT_VALUE" :isLink="true" :url="item.URL" :stop="false">
@@ -73,6 +75,7 @@ import {evaluationOrder, getOrderList} from "@/api";
   export default {
 		data() {
 			return {
+        no: undefined,
         accountId:undefined,
         userId:undefined,
         show:false,
@@ -131,11 +134,23 @@ import {evaluationOrder, getOrderList} from "@/api";
 		},
 		methods: {
       getList(accountId,userId){
+        if(null == accountId || null == userId)
+        {
+          uni.showToast({
+            title: "请重新登录",
+            icon: "none"
+          })
+          return
+        }
+
         // 获取当前订单list
         let params = {
           accountId: accountId,
           userId: userId
         }
+        if (this.no){
+          params.no = this.no
+        }
         getOrderList(params).then(res => {
           if (res.data){
             // 对数据进行处理