Browse Source

搜索修改

zqwang 2 years ago
parent
commit
830a1f6a3f
2 changed files with 11 additions and 9 deletions
  1. 3 2
      src/assets/less/consume.less
  2. 8 7
      src/views/Search/index.ux

+ 3 - 2
src/assets/less/consume.less

@@ -1,3 +1,4 @@
+@import url(./global.less);
 .consume-record__wrap {
   flex-direction: column;
 
@@ -25,13 +26,13 @@
         margin-top: 10px;
 
         &--active {
-          background-color: #EF5952;
+          background-color: @theme;
           
         }
       }
       
       .active {
-        color: #EF5952;
+        color: @theme;
         font-size:36px;
           font-weight: bold;
       }

+ 8 - 7
src/views/Search/index.ux

@@ -78,12 +78,13 @@
             </div>
           </x-book>
         </list-item>
+		<<list-item   onappear="getBooksList" ></list-item>
       </block>
     </list>
   </div>
 </template>
 <script>
-import { getBooksList, getHotMain, getUserInfo } from "../../api";
+import { booksList, getHotMain, getUserInfo } from "../../api";
 import { pageLoad } from "../../helper";
 import storage from '@system.storage';
 import prompt from '@system.prompt';
@@ -101,7 +102,7 @@ export default {
 		uid: '',
 		filter: {
 			key: "",
-			page_size: 100,
+			page_size: 5,
 			page: 1,
 			status: 1,
 		},
@@ -140,14 +141,14 @@ export default {
 			return false;
 		}
 		this.filter.key = iptValue.value;
-		this.getBooksArray(false);
+		this.getBooksList(false);
 		this.$element('search').focus({ focus: false });
 		this.showHistory = false;
 	},
 	serachItem(key) {
 		this.filter.key = key;
 		this.inputValue = key;
-		this.getBooksArray(false);
+		this.getBooksList(false);
 		this.showHistory = false;
 	},
 	deleteHistory() {
@@ -187,7 +188,7 @@ export default {
 			this.showHistory = true;
 		}
 	},
-	async getBooksArray(isLoad = true) {
+	async getBooksList(isLoad = true) {
 		this.empty = false;
 		this.loadingText = "加载ing...";
 		this.filter.page = (this.meta.current_page || 0) + 1;
@@ -198,7 +199,7 @@ export default {
 		let params = this.filter;
 		params.uid = this.uid;
 		console.log(params);
-		pageLoad(this.meta, getBooksList, params).then(ret => {
+		pageLoad(this.meta, booksList, params).then(ret => {
 			let newList = isLoad ? this.list : [];
 			let dataList = ret.list;
 			newList.push(...dataList);
@@ -227,7 +228,7 @@ export default {
 	},
 	onReachBottom() {
 		// 请求更多数据
-		this.getBooksArray();
+		this.getBooksList();
 	},
 }
 </script>