清空代码-初始化yudao

This commit is contained in:
落日晚风
2023-12-18 14:02:47 +08:00
parent aad925ed51
commit 4cb256af6c
102 changed files with 4959 additions and 7836 deletions
-3
View File
@@ -71,9 +71,6 @@
if (options.page) {
sheep.$router.go(decodeURIComponent(options.page));
}
// TODO 芋艿:测试接口的调用
sheep.$api.app.test();
});
// 下拉刷新
+8 -2
View File
@@ -1,3 +1,4 @@
<!-- 搜索界面 -->
<template>
<s-layout class="set-wrap" title="搜索" :bgStyle="{ color: '#FFF' }">
<view class="ss-p-x-24">
@@ -33,14 +34,18 @@
import { reactive } from 'vue';
import sheep from '@/sheep';
import { onLoad } from '@dcloudio/uni-app';
const state = reactive({
historyList: [],
});
// 搜索
function onSearch(keyword) {
if (!keyword) return;
if (!keyword) {
return;
}
saveSearchHistory(keyword);
// 前往商品列表(带搜索条件)
sheep.$router.go('/pages/goods/list', { keyword });
}
@@ -53,7 +58,7 @@
// 置顶关键词
state.historyList.unshift(keyword);
// 最多保留10条记录
// 最多保留 10 条记录
if (state.historyList.length >= 10) {
state.historyList.length = 10;
}
@@ -72,6 +77,7 @@
},
});
}
onLoad(() => {
state.historyList = uni.getStorageSync('searchHistory') || [];
});