新增营销系统、分销系统、会员功能、门店、提现功能
This commit is contained in:
@ -10,7 +10,7 @@
|
||||
<uv-search
|
||||
v-model="keywordData"
|
||||
shape="round"
|
||||
placeholder="搜索商品"
|
||||
:placeholder="placeholder || '搜索商品'"
|
||||
actionText="搜索"
|
||||
show-action
|
||||
@clear="onCancel"
|
||||
@ -84,14 +84,15 @@
|
||||
<script setup>
|
||||
import { computed, ref, unref } from 'vue';
|
||||
import { useRouter } from "@/hooks/useRouter";
|
||||
import { onShow } from '@dcloudio/uni-app'
|
||||
import {onLoad, onShow} from '@dcloudio/uni-app'
|
||||
import { hotSearch, historySearch, clearHistorySearch } from "@/api/product";
|
||||
import Modal from "@/components/Modal/index.vue";
|
||||
import { seeIcon, notSeeIcon, historyDeleteIcon } from "@/utils/images";
|
||||
const {push, goBack} = useRouter()
|
||||
const {push, goBack, getParams} = useRouter()
|
||||
|
||||
const searchRef = ref();
|
||||
const keyword = ref('');
|
||||
const placeholder = ref('')
|
||||
|
||||
const hotSearchList = ref([])
|
||||
const getHotKeywordList = async () => {
|
||||
@ -134,7 +135,6 @@ function confirmModal(){
|
||||
|
||||
/**
|
||||
* 清空所有
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
async function doClearAllRequest(){
|
||||
await clearHistorySearch()
|
||||
@ -149,7 +149,7 @@ function handleClickHistoryOrHot(key) {
|
||||
}
|
||||
|
||||
function searchByKeyword() {
|
||||
if (!keywordData.value) {
|
||||
if (!keywordData.value && !placeholder.value) {
|
||||
return uni.showToast({
|
||||
title: '请输入要搜索内容!',
|
||||
duration: 2000,
|
||||
@ -158,7 +158,7 @@ function searchByKeyword() {
|
||||
}
|
||||
push({url: '/pages/goodsList/goodsList'}, {
|
||||
data: {
|
||||
keyword: keywordData.value
|
||||
keyword: keywordData.value || placeholder.value
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -166,11 +166,16 @@ function searchByKeyword() {
|
||||
const onCancel = () => {
|
||||
}
|
||||
|
||||
|
||||
|
||||
onShow(() => {
|
||||
Promise.all([getHotKeywordList(), getHistoryKeywordList()])
|
||||
})
|
||||
|
||||
|
||||
onLoad((options) => {
|
||||
const params = getParams(options)
|
||||
placeholder.value = params.key
|
||||
})
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@ -285,10 +290,10 @@ onShow(() => {
|
||||
}
|
||||
|
||||
.historySearDel-box {
|
||||
height: 54rpx;
|
||||
//height: 54rpx;
|
||||
line-height: 54rpx;
|
||||
background-color: #F1F1F1;
|
||||
text-align: center;
|
||||
//text-align: center;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
Reference in New Issue
Block a user