|
|
@@ -7,11 +7,21 @@
|
|
|
</div>
|
|
|
<div class="search flex_r flex_jb flex_ac">
|
|
|
<span class="iconfont"></span>
|
|
|
- <input v-model="Query.name" @confirm="navSearch" class="inp" placeholder="搜索你要的内容">
|
|
|
- <span class="search_btn" @click="navSearch">搜索</span>
|
|
|
+ <input v-model="Query.name" @confirm="navSearch(Query.business)" class="inp" placeholder="搜索你要的内容">
|
|
|
+ <span class="search_btn" @click="navSearch(Query.business)">搜索</span>
|
|
|
</div>
|
|
|
<!-- <div class="scan-ico iconfont"></div> -->
|
|
|
</div>
|
|
|
+ <div class="tabs flex_r flex_ac flex_jb flex_wrap">
|
|
|
+ <div class="tabs_item" v-for="(i,s) in tabs" :key="s" @click="navSearch(i.business)">
|
|
|
+ <img :src="i.image" alt="" class="ico">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <view class="bou_head flex_r flex_ac flex_jc">
|
|
|
+ <image class="bou_img" src="/static/img/splite.png" mode=""></image>
|
|
|
+ <view class="bou_title">{{ tabVlue }}</view>
|
|
|
+ <image class="bou_img" src="/static/img/splite.png" mode=""></image>
|
|
|
+ </view>
|
|
|
<div class="list" v-if="list.length">
|
|
|
<div class="li_item" v-for="(i,s) in list" :key="s" @click="goMerchant(i)">
|
|
|
<div class="logo_img">
|
|
|
@@ -45,11 +55,15 @@ export default {
|
|
|
longitude: "",
|
|
|
page: 1,
|
|
|
rows: 20,
|
|
|
- city: ""
|
|
|
+ city: "",
|
|
|
+ business: -1
|
|
|
},
|
|
|
pageData: {},
|
|
|
LocationCity: "中国",
|
|
|
showAddress: false,
|
|
|
+ tabs: [],
|
|
|
+ tabObj: {},
|
|
|
+ tabVlue: '全部'
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
@@ -64,6 +78,20 @@ export default {
|
|
|
this.Query.longitude = adres.lng;
|
|
|
this.getList();
|
|
|
},
|
|
|
+ getTabs() {
|
|
|
+ post("v1/merchant/business", {}).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.tabs = res.data
|
|
|
+ this.getTypeDesc()
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async getTypeDesc() {
|
|
|
+ let res = await post("v1/merchant/typeDesc");
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.tabObj = res.data.business
|
|
|
+ }
|
|
|
+ },
|
|
|
getList(page) {
|
|
|
if (page) {
|
|
|
this.list = []
|
|
|
@@ -80,8 +108,21 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
// 搜索
|
|
|
- navSearch() {
|
|
|
+ navSearch(business) {
|
|
|
+ console.log(business,business+''!='');
|
|
|
+ if(business+'' != '') {
|
|
|
+ if (business != -1) {
|
|
|
+ let obj = this.tabObj
|
|
|
+ obj = obj.filter(item=>{
|
|
|
+ return item.value == business
|
|
|
+ })
|
|
|
+ this.tabVlue = obj[0].text || '全部'
|
|
|
+ }
|
|
|
+
|
|
|
+ this.Query.business = business
|
|
|
+ }
|
|
|
if (!this.Query.name) delete this.Query.name
|
|
|
+
|
|
|
this.getList(1);
|
|
|
},
|
|
|
// 获取当前城市
|
|
|
@@ -109,7 +150,13 @@ export default {
|
|
|
onLoad(da) {
|
|
|
this.getToCity();
|
|
|
},
|
|
|
+ onTabItemTap(item) {
|
|
|
+ this.tabVlue = '全部'
|
|
|
+ this.Query.business = -1;
|
|
|
+ this.getList(1)
|
|
|
+ },
|
|
|
onShow() {
|
|
|
+ this.getTabs();
|
|
|
this.getLocation();
|
|
|
},
|
|
|
mounted() {},
|
|
|
@@ -166,6 +213,18 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+.tabs{
|
|
|
+ padding: 30rpx 40rpx 0;
|
|
|
+ &_item {
|
|
|
+ width: 105rpx;
|
|
|
+ margin: 10rpx 10rpx;
|
|
|
+ .ico {
|
|
|
+ width: 100%;
|
|
|
+ height: 138rpx;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
.list {
|
|
|
padding: 30rpx;
|
|
|
|
|
|
@@ -223,4 +282,23 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+.bou_head {
|
|
|
+ width: 100%;
|
|
|
+ height: 114rpx;
|
|
|
+ // margin-top: 50rpx;
|
|
|
+
|
|
|
+ .bou_img {
|
|
|
+ width: 92rpx;
|
|
|
+ height: 30rpx;
|
|
|
+ }
|
|
|
+
|
|
|
+ .bou_title {
|
|
|
+ height: 30rpx;
|
|
|
+ line-height: 30rpx;
|
|
|
+ font-size: 36rpx;
|
|
|
+ color: #121212;
|
|
|
+ font-weight: bold;
|
|
|
+ margin: 0 36rpx;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|