Browse Source

搜索页面+历史记录

Shan9312 7 months ago
parent
commit
cd8f0a661e
2 changed files with 9 additions and 7 deletions
  1. 8 5
      src/pages/searchDetail/searchDetail.vue
  2. 1 2
      src/pages/serch/serch.vue

+ 8 - 5
src/pages/searchDetail/searchDetail.vue

@@ -17,20 +17,23 @@
 </template>
 
 <script lang="ts" setup>
-import { ref } from 'vue'
+import { reactive } from 'vue'
+
 defineOptions({
   name: 'Login',
 })
+
 let searchObj = reactive({
   searchNum: '',
 })
-onLoad((options) => {
-  console.log(options)
-  searchObj.searchNum = options.serch
-})
 
 // 拿到搜索框参数 去请求接口
 function doSearch() {}
+
+onLoad((options) => {
+  // 路由参数
+  searchObj.searchNum = options.serch
+})
 </script>
 
 <style lang="scss" scoped>

+ 1 - 2
src/pages/serch/serch.vue

@@ -37,7 +37,6 @@ defineOptions({
   name: 'Serch',
 })
 
-const searchNum = ref('')
 let serchObj = reactive({
   searchNum: '',
   historyList: [],
@@ -61,7 +60,7 @@ function doSearch(searchStr) {
   }
 }
 
-// 清除按钮
+// 清除历史记录
 function clearList() {
   serchObj.historyList = []
   uni.setStorageSync('history', JSON.stringify(serchObj.historyList))