184 lines
4.1 KiB
Vue
184 lines
4.1 KiB
Vue
<template>
|
|
<view class="Box">
|
|
<navseat :opacity='false' :title='"行业列表"' :titleshow='true' :namecolor='"#fff"' iconcolor='#fff'></navseat>
|
|
<view class="Box_top"><input placeholder="请输入开票服务名称" :showAction='false' :focus='true' v-model="modelkeyword"
|
|
@input="onInput" />
|
|
</view>
|
|
<view class="nav">
|
|
<view class="nav-right">
|
|
<scroll-view scroll-y :scroll-top="scrollTop" @scroll="scroll" @scrolltolower="loadMores" :style="h"
|
|
scroll-with-animation>
|
|
<view class="nav-right-item" v-for="(item, index2) in subCategoryList" :key="index2"
|
|
@click="categorySubClick(item)">
|
|
<view>{{ item.name }}</view>
|
|
</view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
<view class="empty-wrap">
|
|
<!-- <view class="empty" v-if="!subCategoryList.length && loadStatus == 'nomore'"><u-empty text="暂无数据"
|
|
:icon="require('https://czg-invoicing.oss-cn-beijing.aliyuncs.com/static/notice/icon_empty.png')"></u-empty></view>
|
|
<u-loadmore color="#999" :status="loadStatus" v-else></u-loadmore> -->
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
// import category from '@/components/qiyue-category/qiyue-category.vue';
|
|
import navseat from '@/components/navseat.vue'
|
|
export default {
|
|
components: {
|
|
navseat
|
|
},
|
|
// components: {
|
|
// category
|
|
// },
|
|
data() {
|
|
return {
|
|
current: 1,
|
|
size: 20,
|
|
page: 1,
|
|
modelkeyword: '',
|
|
subCategoryList: [],
|
|
loadStatus: 'nomore',
|
|
h: null,
|
|
namelang: '',
|
|
height: 0,
|
|
scrollTop: 0,
|
|
scrollHeight: 0,
|
|
categoryActive: 0,
|
|
};
|
|
},
|
|
onLoad() {},
|
|
mounted() {
|
|
this.computed_h();
|
|
},
|
|
onReachBottom() {
|
|
this.loadMores()
|
|
},
|
|
methods: {
|
|
onInput(e) {
|
|
this.modelkeyword = e.detail.value
|
|
if (e.detail.value) {
|
|
uni.$u.debounce(this.getOrder(), 500)
|
|
} else {
|
|
this.subCategoryList = []
|
|
}
|
|
},
|
|
async computed_h() {
|
|
//获取div宽度
|
|
try {
|
|
let content_Icon = await uni.utils.info_distance('Box_top');
|
|
let content_top_box = await uni.utils.info_distance('Box_text');
|
|
let system_info = await uni.pro.getSystemInfo();
|
|
var h_ = system_info.windowHeight - content_Icon.height - content_top_box.height - 45 + 'px';
|
|
this.h = {
|
|
height: h_
|
|
};
|
|
} catch (e) {
|
|
//TODO handle the exception
|
|
}
|
|
},
|
|
categorySubClick(category) {
|
|
console.log(11,category)
|
|
uni.cache.set('keyword', category)
|
|
uni.$emit("businesscategorys", category)
|
|
uni.pro.navigateBack();
|
|
},
|
|
|
|
loadMores() {
|
|
if (this.loadStatus != 'nomore') {
|
|
this.loadStatus = 'loading'
|
|
this.page++;
|
|
this.getOrder();
|
|
}
|
|
},
|
|
searchkeyword(e) {
|
|
this.name = e
|
|
this.page = 1
|
|
this.getOrder()
|
|
},
|
|
async getOrder() {
|
|
let res = await this.api.storeindustrylist({
|
|
name: this.modelkeyword,
|
|
page: this.page
|
|
})
|
|
if (res) {
|
|
setTimeout(() => {
|
|
if (this.page == 1) {
|
|
this.subCategoryList = res.msg;
|
|
this.loadStatus = 'loadmore'
|
|
} else {
|
|
this.subCategoryList.push(...res.msg);
|
|
}
|
|
if (res.msg.length == 20) {
|
|
this.loadStatus = 'loadmore';
|
|
} else {
|
|
this.loadStatus = 'nomore';
|
|
}
|
|
console.log('接口返回------', res);
|
|
}, 500)
|
|
}
|
|
}
|
|
},
|
|
};
|
|
</script>
|
|
<style lang="scss">
|
|
page {
|
|
background: #fff;
|
|
}
|
|
|
|
.Box {
|
|
|
|
.Box_top {
|
|
width: 100%;
|
|
background: #FFFFFF;
|
|
padding: 32rpx 28rpx;
|
|
|
|
input {
|
|
padding: 18rpx 16rpx;
|
|
width: 100%;
|
|
border: 2rpx solid #2F87FD;
|
|
border-radius: 36rpx 36rpx 36rpx 36rpx;
|
|
}
|
|
}
|
|
|
|
.nav {
|
|
display: flex;
|
|
width: 100%;
|
|
|
|
.nav-right {
|
|
width: 100%;
|
|
|
|
.nav-right-item {
|
|
width: 100%;
|
|
/* height: 100px; */
|
|
text-align: left;
|
|
padding: 24rpx 32rpx;
|
|
font-size: 13px;
|
|
}
|
|
|
|
.nav-right-item image {
|
|
width: 50px;
|
|
height: 50px;
|
|
}
|
|
}
|
|
}
|
|
|
|
.Box_text {
|
|
background: #F1F0F5;
|
|
padding: 10rpx 28rpx;
|
|
font-size: 28rpx;
|
|
font-family: Source Han Sans CN-Regular, Source Han Sans CN;
|
|
font-weight: 400;
|
|
color: #999999;
|
|
|
|
text {
|
|
margin-left: 16rpx;
|
|
font-size: 28rpx;
|
|
font-family: Source Han Sans CN-Medium, Source Han Sans CN;
|
|
font-weight: 500;
|
|
color: #333333;
|
|
}
|
|
}
|
|
}
|
|
</style> |