Merge pull request 'dj' (#117) from dj into master

Reviewed-on: http://git.feashow.cn/odjbin/city-store-transfer/pulls/117
This commit is contained in:
odjbin
2023-11-27 15:49:12 +00:00
9 changed files with 59 additions and 80 deletions

View File

@@ -2,8 +2,9 @@
<view class="input-and-swiper-root"> <view class="input-and-swiper-root">
<view class="search-box" v-if="type!=='0'"> <view class="search-box" v-if="type!=='0'">
<view class="search-box-input"> <view class="search-box-input">
<u-input v-model="keyword" placeholder="请输入店铺名称进行搜索" placeholder-style="color: #969696" prefixIcon="search" <u-input v-model="keyword" placeholder="请输入标题进行搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @clear="handleClear" clearable @change="changeInput"> prefixIconStyle="font-size: 24px;color: #909399;" border="true" @clear="handleClear" clearable
@change="changeInput">
<template slot="suffix"> <template slot="suffix">
<view style="display: flex;align-items: center;"> <view style="display: flex;align-items: center;">
<u-icon name="map-fill" color="#329866" size="22"></u-icon> <u-icon name="map-fill" color="#329866" size="22"></u-icon>
@@ -46,7 +47,7 @@
return { return {
position: uni.getStorageSync('city') + uni.getStorageSync('district').slice(0, 2), position: uni.getStorageSync('city') + uni.getStorageSync('district').slice(0, 2),
currentNum: '', currentNum: '',
keyword:'' keyword: ''
}; };
}, },
options: { options: {
@@ -54,9 +55,9 @@
}, },
watch: { watch: {
refresh(newVal, oldVal) { refresh(newVal, oldVal) {
console.log('newVal',newVal); console.log('newVal', newVal);
if(newVal){ if (newVal) {
this.keyword='' this.keyword = ''
} }
} }
}, },
@@ -69,12 +70,12 @@
}, },
methods: { methods: {
changeInput(e){ changeInput(e) {
this.$emit('getQueryInfo',e) this.$emit('getQueryInfo', e)
}, },
handleClear(e){ handleClear(e) {
console.log('handleClear',e); console.log('handleClear', e);
}, },
open() { open() {
if (!uni.getStorageSync('city') && !uni.getStorageSync('district')) { if (!uni.getStorageSync('city') && !uni.getStorageSync('district')) {

View File

@@ -5,7 +5,7 @@
<view class="bug-fix"></view> <view class="bug-fix"></view>
<view class="search-box"> <view class="search-box">
<view class="search-box-input"> <view class="search-box-input">
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search" <u-input v-model="keyword" placeholder="请输入标题进行搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput"> prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input> </u-input>
</view> </view>
@@ -64,7 +64,7 @@
}, },
onReachBottom() { onReachBottom() {
if (this.shopListLength !== 0) { if (this.shopListLength !== 0) {
this.keyword='' this.keyword = ''
this.pageNum++ this.pageNum++
this.getShopList() this.getShopList()
console.log("触底加载"); console.log("触底加载");
@@ -76,16 +76,16 @@
this.getShopList() this.getShopList()
}, },
methods: { methods: {
getInput(val){ getInput(val) {
console.log('搜索值',val); console.log('搜索值', val);
if(this.pageNum!==1){ if (this.pageNum !== 1) {
this.pageNum=1 this.pageNum = 1
} }
const q = this.$u.queryParams({ const q = this.$u.queryParams({
type: 3, type: 3,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum, pageNum: this.pageNum,
kw:val kw: val
}) })
this.$api.getShopList(q).then(res => { this.$api.getShopList(q).then(res => {
this.shopListLength = res.data.data.length this.shopListLength = res.data.data.length

View File

@@ -5,7 +5,7 @@
<view class="bug-fix"></view> <view class="bug-fix"></view>
<view class="search-box"> <view class="search-box">
<view class="search-box-input"> <view class="search-box-input">
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search" <u-input v-model="keyword" placeholder="请输入标题进行搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput"> prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input> </u-input>
</view> </view>

View File

@@ -5,7 +5,7 @@
<view class="bug-fix"></view> <view class="bug-fix"></view>
<view class="search-box"> <view class="search-box">
<view class="search-box-input"> <view class="search-box-input">
<u-input v-model="keyword" placeholder="热门搜索" placeholder-style="color: #969696" prefixIcon="search" <u-input v-model="keyword" placeholder="请输入标题进行搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput"> prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input> </u-input>
</view> </view>
@@ -62,7 +62,7 @@
}, },
onReachBottom() { onReachBottom() {
if (!this.refresh && this.searchListLength !== 0) { if (!this.refresh && this.searchListLength !== 0) {
this.keyword='' this.keyword = ''
this.pageNum++ this.pageNum++
this.getShopList() this.getShopList()
console.log("触底加载"); console.log("触底加载");
@@ -74,16 +74,16 @@
this.getShopList() this.getShopList()
}, },
methods: { methods: {
getInput(val){ getInput(val) {
console.log('搜索值',val); console.log('搜索值', val);
if(this.pageNum!==1){ if (this.pageNum !== 1) {
this.pageNum=1 this.pageNum = 1
} }
const q = this.$u.queryParams({ const q = this.$u.queryParams({
type: 2, type: 2,
pageSize: this.pageSize, pageSize: this.pageSize,
pageNum: this.pageNum, pageNum: this.pageNum,
kw:val kw: val
}) })
this.$api.getShopList(q).then(res => { this.$api.getShopList(q).then(res => {
this.searchListLength = res.data.data.length this.searchListLength = res.data.data.length

View File

@@ -5,7 +5,7 @@
<view class="bug-fix"></view> <view class="bug-fix"></view>
<view class="search-box"> <view class="search-box">
<view class="search-box-input"> <view class="search-box-input">
<u-input v-model="keyword" placeholder="请输入店铺名称进行搜索" placeholder-style="color: #969696" prefixIcon="search" <u-input v-model="keyword" placeholder="请输入标题进行搜索" placeholder-style="color: #969696" prefixIcon="search"
prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput"> prefixIconStyle="font-size: 24px;color: #909399;" border="true" @change="getInput">
</u-input> </u-input>
</view> </view>
@@ -63,7 +63,7 @@
}, },
onReachBottom() { onReachBottom() {
if (!this.refresh && this.shopListLength !== 0) { if (!this.refresh && this.shopListLength !== 0) {
this.keyword='' this.keyword = ''
this.pageNum++ this.pageNum++
this.getShopList() this.getShopList()
console.log("触底加载"); console.log("触底加载");

View File

@@ -1,18 +1,15 @@
<template> <template>
<view class="root"> <view class="root">
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh"></InputAndSwiper> <view class="sticky">
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh"></InputAndSwiper>
<view> <view class="marginLR10">
<view class="dropdown-bug">
</view>
<view class="marginLR10 sticky">
<DropDown @getQueryInfo="getShopList" ref="dropdown" @cancelPageNum="cancelPageNum"></DropDown> <DropDown @getQueryInfo="getShopList" ref="dropdown" @cancelPageNum="cancelPageNum"></DropDown>
</view> </view>
<view class="marginLR10">
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
</view>
</view> </view>
<view class="marginLR10">
<SearchShopList :showStyle="1" :searchInfoList="searchInfoList" />
</view>
<view v-if="showNull" class="showNull"> <view v-if="showNull" class="showNull">
<text>没有符合条件的数据, 请下拉刷新重置数据~ <text>没有符合条件的数据, 请下拉刷新重置数据~
</text> </text>
@@ -143,7 +140,11 @@
} }
</script> </script>
<style>
page {
background-color: #f8f8f8;
}
</style>
<style lang="scss" scoped> <style lang="scss" scoped>
.showNull { .showNull {
display: flex; display: flex;
@@ -153,22 +154,10 @@
color: darkgray; color: darkgray;
} }
page {
background-color: $uni-bg-color-grey;
}
.root { .root {
position: relative; position: relative;
} }
.dropdown-bug {
position: absolute;
background-color: $uni-bg-color-grey;
height: 120rpx;
width: 100%;
transform: translateY(-20rpx);
z-index: 2;
}
.marginLR10 { .marginLR10 {
margin: 0 10px; margin: 0 10px;

View File

@@ -1,18 +1,14 @@
<template> <template>
<view class="root"> <view class="root">
<InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh"> <view class="sticky">
</InputAndSwiper> <InputAndSwiper @getQueryInfo="getInput" :bannerURL="swiperList" :refresh="isRefresh">
</InputAndSwiper>
<view> <view class="marginLR10 ">
<view class="dropdown-bug">
</view>
<view class="marginLR10 sticky">
<DropDown @getQueryInfo="getShopList" ref="dropdown" @cancelPageNum="cancelPageNum"></DropDown> <DropDown @getQueryInfo="getShopList" ref="dropdown" @cancelPageNum="cancelPageNum"></DropDown>
</view> </view>
<view class="marginLR10"> </view>
<ShowShopList :showStyle="1" :shopInfoList="shopInfoList"></ShowShopList> <view class="marginLR10">
</view> <ShowShopList :showStyle="1" :shopInfoList="shopInfoList"></ShowShopList>
</view> </view>
<view v-if="showNull" class="showNull"> <view v-if="showNull" class="showNull">
<text>没有符合条件的数据, 请下拉刷新重置数据~ <text>没有符合条件的数据, 请下拉刷新重置数据~
@@ -141,12 +137,12 @@
} }
} }
</script> </script>
<style>
<style lang="scss" scoped>
page { page {
background-color: $uni-bg-color-grey; background-color: #f8f8f8;
} }
</style>
<style lang="scss" scoped>
.showNull { .showNull {
display: flex; display: flex;
align-items: center; align-items: center;
@@ -159,14 +155,6 @@
position: relative; position: relative;
} }
.dropdown-bug {
position: absolute;
background-color: $uni-bg-color-grey;
height: 120rpx;
width: 100%;
transform: translateY(-20rpx);
z-index: 2;
}
.marginLR10 { .marginLR10 {
margin: 0 10px; margin: 0 10px;

View File

@@ -80,4 +80,5 @@ $uni-font-size-paragraph:15px;
position: sticky; position: sticky;
top: 0; top: 0;
z-index: 9; z-index: 9;
background-color: #F8F8F8;
} }