tmp: 部分代码与UnishopV5结合,但是代码有严重缺陷

This commit is contained in:
2025-12-20 15:30:39 +08:00
parent ed5181b382
commit e263a616f6
183 changed files with 31316 additions and 18590 deletions

View File

@@ -4,7 +4,7 @@
<view class="content">
<view class="cate-search">
<view class="search-box">
<input class="uni-input" maxlength="50" v-model="inputValue" confirm-type="search" @focus="inputFocus" focus @confirm="search()" :placeholder="searchWords ? searchWords : ''" />
<input class="uni-input" maxlength="50" v-model="inputValue" confirm-type="search" @focus="inputFocus" focus @confirm="search()" :placeholder="searchWords ? searchWords : $lang('inputPlaceholder')" />
<text class="iconfont icon-sousuo3" @click="search()"></text>
</view>
</view>
@@ -13,7 +13,7 @@
<view class="history" v-if="historyList.length">
<view class="history-box">
<view class="history-top">
<view class="title">历史搜索</view>
<view class="title">{{ $lang('history') }}</view>
<view class="icon iconfont icon-icon7" @click="deleteHistoryList"></view>
</view>
<view class="history-bottom " id="history-list" :style="{ maxHeight: !isAllHistory ? '100%' : '168rpx' }">
@@ -31,7 +31,7 @@
<view class="history" v-if="hotList.length">
<view class="history-box">
<view class="history-top">
<view class="title">热门搜索</view>
<view class="title">{{ $lang('hot') }}</view>
</view>
<view class="history-bottom">
<view class="history-li" v-for="(item, index) in hotList" :key="index" @click="otherSearch(item)" @longtap="deleteItem(item)">
@@ -137,7 +137,6 @@
},
//搜索
search() {
if (this.inputValue.trim() != '') {
// 对历史搜索处理,判断有无,最近搜索显示在最前
@@ -163,7 +162,7 @@
});
} else {
this.$util.redirectTo('/pages/goods/list', {
//keyword: this.searchWords
keyword: this.searchWords
});
}
}
@@ -171,12 +170,11 @@
// 获取元素高度
getHistoryHeight() {
const query = uni.createSelectorQuery().in(this);
query.select('#history-list')
.boundingClientRect(data => {
if (data && data.height > uni.upx2px(70) * 2 + uni.upx2px(35) * 2) {
this.isAllHistory = true;
}
}).exec();
query.select('#history-list').boundingClientRect(data => {
if (data && data.height > uni.upx2px(70) * 2 + uni.upx2px(35) * 2) {
this.isAllHistory = true;
}
}).exec();
}
}
};