237 lines
9.5 KiB
Vue
237 lines
9.5 KiB
Vue
<template>
|
|
<view class="page" :style="themeColor">
|
|
<view class="flex flex-direction align-stretch justify-between benben-position-layout flex searchWithin_flex_0" :style="{height:(110+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
|
|
<view class='flex flex-wrap align-center justify-between searchWithin_fd0_0' >
|
|
<text class='fu-iconfont2 searchWithin_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back" data-url="1" ></text>
|
|
<view class='flex flex-wrap align-center flex-sub searchWithin_fd0_0_c1' >
|
|
<image class='searchWithin_fd0_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"53.png"'></image>
|
|
<input class='flex-sub searchWithin_fd0_0_c1_c1' type="text" placeholder="请输入关键字" confirm-type="done" :maxlength="-1" placeholder-style="color:rgba(153, 153, 153, 1);font-size:28rpx" @confirm="searchForFunc()" v-model="keywords" />
|
|
</view>
|
|
<text class='searchWithin_fd0_0_c2' @tap.stop="searchForFunc()" >搜索</text>
|
|
</view>
|
|
|
|
</view>
|
|
<view :style="{height: (110+StatusBarRpx)+'rpx'}" ></view>
|
|
<!---flex布局flex布局开始-->
|
|
<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout searchWithin_flex_1" >
|
|
<view class='flex flex-wrap align-center justify-between searchWithin_fd1_0' >
|
|
<view class='flex flex-wrap align-center' >
|
|
<image class='searchWithin_fd1_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"57.png"'></image>
|
|
<text class='searchWithin_fd1_0_c0_c1' >搜索历史</text>
|
|
</view>
|
|
<image class='searchWithin_fd1_0_c1' :src='STATIC_URL+"58.png"' @tap.stop="popupShow1681282077687=true" ></image>
|
|
</view>
|
|
<view class='flex flex-wrap align-center searchWithin_fd1_1' v-if= "appSearchHistory.length=='0'" >
|
|
<text class='searchWithin_fd1_1_c0' >暂无历史搜索</text>
|
|
</view>
|
|
<view class='flex flex-wrap align-center' v-if= "length.split(',')>'0'" >
|
|
<template v-for = '(item,key0) in appSearchHistory'>
|
|
<view class='flex flex-wrap align-center searchWithin_fd1_2_c0' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/dpxq/searchResult/searchResult?input=${item.name}`" :key='key0'>
|
|
<text class='searchWithin_fd1_2_c0_c0' >{{item.name}}</text>
|
|
<image class='searchWithin_fd1_2_c0_c1' :src='STATIC_URL+"60.png"' @tap.stop="deleteSearchFunc(item.name)" ></image>
|
|
</view>
|
|
</template>
|
|
|
|
</view>
|
|
<view class='flex flex-wrap align-center justify-between searchWithin_fd1_3' >
|
|
<view class='flex flex-wrap align-center' >
|
|
<image class='searchWithin_fd1_3_c0_c0' mode="aspectFit" :src='STATIC_URL+"59.png"'></image>
|
|
<text class='searchWithin_fd1_3_c0_c1' >热门搜索</text>
|
|
</view>
|
|
</view>
|
|
<view class='flex flex-wrap align-center searchWithin_fd1_4' v-if= "length.split(',')>'0'" >
|
|
<view class='flex flex-wrap align-center searchWithin_fd1_4_c0' @tap.stop="handleJumpDiy" data-type="navigateTo" :data-url="`/pages/dpxq/searchResult/searchResult`" >
|
|
<text class='searchWithin_fd1_4_c0_c0' >蓝牙耳机</text>
|
|
<image class='searchWithin_fd1_4_c0_c1' :src='STATIC_URL+"60.png"' @tap.stop="deleteSearchFunc()" ></image>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
|
|
<!---flex布局flex布局结束-->
|
|
<benben-popup v-model="popupShow1681282077687" :mask="true" mode='center'>
|
|
<!---删除历史记录flex布局开始-->
|
|
<view class="flex flex-direction flex-wrap align-center searchWithin_flex_2" >
|
|
<text class='searchWithin_fd2_0' >确定删除历史记录?</text>
|
|
<view class='flex flex-wrap align-center searchWithin_fd2_1' >
|
|
<button class='searchWithin_fd2_1_c0' @tap.stop="popupShow1681282077687=false" >取消</button>
|
|
<button class='searchWithin_fd2_1_c1' @tap.stop="clearSearchFunc()" >确定</button>
|
|
</view>
|
|
</view>
|
|
|
|
<!---删除历史记录flex布局结束-->
|
|
|
|
</benben-popup>
|
|
|
|
|
|
</view>
|
|
</template>
|
|
<script>
|
|
|
|
export default {
|
|
components:{},
|
|
|
|
|
|
data(){
|
|
return {"popupShow1681282077687":false,"keywords":"","length":"1","hository_length":["小笼包","煎饼果子","黄焖鸡米饭","汉堡"],"input_content":""};
|
|
},
|
|
computed:{
|
|
themeColor() {
|
|
return this.$store.getters.themeColor
|
|
},
|
|
appSearchHistory() {// 搜索历史
|
|
return this.$store.state.appSearchHistory
|
|
}
|
|
},
|
|
watch:{},
|
|
onLoad(options){
|
|
|
|
},
|
|
onUnload() {
|
|
|
|
},
|
|
onReady(){
|
|
|
|
},
|
|
onShow(){
|
|
|
|
},
|
|
onHide(){
|
|
|
|
},
|
|
onResize(){
|
|
|
|
},
|
|
onPullDownRefresh(){
|
|
|
|
},
|
|
onReachBottom(e){
|
|
|
|
},
|
|
onPageScroll(e){
|
|
|
|
},
|
|
methods:{
|
|
//删除搜索记录
|
|
deleteSearchFunc(name){
|
|
this.$store.commit('appSearchHistoryDel',{"name":name})
|
|
},
|
|
//清空搜索记录
|
|
clearSearchFunc(){
|
|
this.$store.commit('appSearchHistoryClean','')
|
|
this.popupShow1681282077687 = false;
|
|
},
|
|
//跳转
|
|
jumpResultFunc(){
|
|
this.$store.commit('appSearchHistoryAdd',{"name":this.keywords})
|
|
},
|
|
//添加搜索记录
|
|
addSearchRecordFunc(){
|
|
this.$store.commit('appSearchHistoryAdd',{"name":this.keywords})
|
|
},
|
|
//搜索
|
|
searchForFunc(){
|
|
if( this.keywords==''){
|
|
this.$message.info('请输入要搜索的商品');
|
|
}
|
|
else if( this.keywords!=''){
|
|
this.$urouter.navigateTo(`/pages/dpxq/searchResult/searchResult?input=${this.input_content}`);
|
|
}
|
|
}
|
|
}
|
|
};
|
|
</script>
|
|
<style lang="scss" scoped>
|
|
.page{
|
|
width: 100vw;
|
|
overflow-x: hidden;
|
|
min-height: calc(100vh - var(--window-bottom));
|
|
background:rgba(255, 255, 255, 1);background-size: 100% auto !important;
|
|
}
|
|
.searchWithin_flex_0{
|
|
background:#fff;width:750rpx;height:110rpx;overflow:hidden;z-index:10;top:0rpx;background-size:#eee;
|
|
}
|
|
.searchWithin_fd0_0_c2{
|
|
font-size:32rpx;font-weight:400;color:#333333;margin:0rpx 0rpx 0rpx 32rpx;line-height:32rpx;
|
|
}
|
|
.searchWithin_fd0_0_c1_c1{
|
|
font-size:24rpx;font-weight:400;color:#333;
|
|
}
|
|
.searchWithin_fd0_0_c1_c0{
|
|
width:28rpx;height:28rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 16rpx 0rpx 0rpx;
|
|
}
|
|
.searchWithin_fd0_0_c1{
|
|
background:rgba(246, 247, 249, 1);height:64rpx;background-size:100% auto !important;border-radius:34rpx 34rpx 34rpx 34rpx;padding:12rpx 24rpx 12rpx 24rpx;font-size:28rpx;font-weight:400;color:#333;
|
|
}
|
|
.searchWithin_fd0_0_c0{
|
|
font-size:36rpx;font-weight:500;color:#333;margin:0rpx 16rpx 0rpx 0rpx;
|
|
}
|
|
.searchWithin_fd0_0{
|
|
padding:0rpx 32rpx 0rpx 32rpx;line-height:110rpx;
|
|
}
|
|
.searchWithin_flex_1{
|
|
padding:32rpx 32rpx 32rpx 32rpx;
|
|
}
|
|
.searchWithin_fd1_4_c0_c1{
|
|
width:16rpx;height:16rpx;margin:0rpx 0rpx 0rpx 16rpx;
|
|
}
|
|
.searchWithin_fd1_4_c0_c0{
|
|
line-height:34rpx;font-size:24rpx;font-weight:400;color:rgba(51, 51, 51, 1);
|
|
}
|
|
.searchWithin_fd1_4_c0{
|
|
background:rgba(246, 247, 249, 1);height:56rpx;border-radius:32rpx 32rpx 32rpx 32rpx;padding:0rpx 32rpx 0rpx 32rpx;margin:12rpx 12rpx 12rpx 12rpx;
|
|
}
|
|
.searchWithin_fd1_4{
|
|
margin:0rpx 0rpx rpx 0rpx;
|
|
}
|
|
.searchWithin_fd1_3_c0_c1{
|
|
color:#333333;font-size:32rpx;font-weight:600;line-height:40rpx;
|
|
}
|
|
.searchWithin_fd1_3_c0_c0{
|
|
width:28rpx;height:28rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 16rpx 0rpx 0rpx;
|
|
}
|
|
.searchWithin_fd1_3{
|
|
margin:64rpx 0rpx 23rpx 0rpx;
|
|
}
|
|
.searchWithin_fd1_2_c0_c1{
|
|
width:16rpx;height:16rpx;margin:0rpx 0rpx 0rpx 16rpx;
|
|
}
|
|
.searchWithin_fd1_2_c0_c0{
|
|
line-height:34rpx;font-size:24rpx;font-weight:400;color:rgba(51, 51, 51, 1);
|
|
}
|
|
.searchWithin_fd1_2_c0{
|
|
background:rgba(246, 247, 249, 1);height:56rpx;border-radius:32rpx 32rpx 32rpx 32rpx;padding:0rpx 32rpx 0rpx 32rpx;margin:12rpx 12rpx 12rpx 12rpx;
|
|
}
|
|
.searchWithin_fd1_1_c0{
|
|
color:#BFBFBF;font-size:28rpx;font-weight:400;line-height:30rpx;
|
|
}
|
|
.searchWithin_fd1_1{
|
|
margin:0rpx 0rpx 23rpx 0rpx;
|
|
}
|
|
.searchWithin_fd1_0_c1{
|
|
width:32rpx;height:32rpx;
|
|
}
|
|
.searchWithin_fd1_0_c0_c1{
|
|
color:#333333;font-size:32rpx;font-weight:600;line-height:40rpx;
|
|
}
|
|
.searchWithin_fd1_0_c0_c0{
|
|
width:28rpx;height:28rpx;border-radius:0rpx 0rpx 0rpx 0rpx;margin:0rpx 16rpx 0rpx 0rpx;
|
|
}
|
|
.searchWithin_fd1_0{
|
|
margin:0rpx 0rpx 23rpx 0rpx;
|
|
}
|
|
.searchWithin_flex_2{
|
|
background:#fff;margin:0rpx 105rpx 0rpx 105rpx;background-size:#eee;border-radius:25rpx 25rpx 25rpx 25rpx;
|
|
}
|
|
.searchWithin_fd2_1_c1{
|
|
background:transparent;line-height:45rpx;border-radius:0rpx 0rpx 16rpx 0rpx;font-size:32rpx;color:rgba(255, 147, 0, 1);padding:24rpx 103rpx 24rpx 99rpx;
|
|
}
|
|
.searchWithin_fd2_1_c0{
|
|
border-right:1px solid #EEEEEE;background:transparent;line-height:45rpx;border-radius:0rpx 0rpx 0rpx 16rpx;font-size:32rpx;color:rgba(153, 153, 153, 1);padding:24rpx 103rpx 24rpx 103rpx;
|
|
}
|
|
.searchWithin_fd2_1{
|
|
border-top:1px solid #eee;
|
|
}
|
|
.searchWithin_fd2_0{
|
|
font-size:32rpx;font-weight:400;line-height:52rpx;color:#333333;margin:56rpx 0rpx 64rpx 0rpx;
|
|
}
|
|
</style> |