完善功能
This commit is contained in:
@@ -54,25 +54,29 @@
|
||||
placeholderClass="name-placeholder"
|
||||
class="center-input"
|
||||
/>
|
||||
<button @click="getData()">查询</button>
|
||||
<button @click="getData(true)">查询</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 遮罩层 -->
|
||||
<view v-if="activeFilter" class="overlay" @click="closeFilter"></view>
|
||||
|
||||
<view class="talents_list" v-if="list&&list.length>0">
|
||||
<view class="talents_item" v-for="(item,index) in list" :key="index" @click="goToDetail(item.id)">
|
||||
<image :src="item.icon" class="item_image" mode="aspectFit"></image>
|
||||
<view class="item_right">
|
||||
<view class="item_top">
|
||||
<text class="item_name">{{item.name}}</text>
|
||||
<text class="item_title">{{item.title}}</text>
|
||||
<scroll-view scroll-y="true"
|
||||
:scroll-top="scrollTop"
|
||||
style="height: calc(100vh - 300rpx); margin-top: 185rpx; padding-bottom: 140rpx;"
|
||||
v-if="list&&list.length>0">
|
||||
<view class="talents_list">
|
||||
<view class="talents_item" v-for="(item,index) in list" :key="index" @click="goToDetail(item.id)">
|
||||
<image :src="item.icon" class="item_image" mode="aspectFit"></image>
|
||||
<view class="item_right">
|
||||
<view class="item_top">
|
||||
<text class="item_name">{{item.name}}</text>
|
||||
<text class="item_title">{{item.title}}</text>
|
||||
</view>
|
||||
<text class="item_con">{{item.introduce}}</text>
|
||||
</view>
|
||||
<text class="item_con">{{item.introduce}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<text class="null_text" v-else>{{null_text}}</text>
|
||||
<z-navigation></z-navigation>
|
||||
</view>
|
||||
@@ -105,8 +109,22 @@ export default {
|
||||
//城市模块是否显示
|
||||
cityStatus: false,
|
||||
selectedPath: [], //存储选中路径
|
||||
scrollTop: 0, //滚动位置
|
||||
isRefreshing: false, //刷新状态
|
||||
}
|
||||
},
|
||||
onPullDownRefresh() {
|
||||
this.isRefreshing = true;
|
||||
console.log("下拉刷新");
|
||||
|
||||
setTimeout(() => {
|
||||
this.region = '';
|
||||
this.getData();
|
||||
uni.stopPullDownRefresh();
|
||||
this.isRefreshing = false;
|
||||
console.log("下拉刷新已停止");
|
||||
}, 800);
|
||||
},
|
||||
onLoad() {
|
||||
uni.hideTabBar();
|
||||
this.getAllBaseArea();
|
||||
@@ -117,7 +135,7 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
//获取数据
|
||||
getData() {
|
||||
getData(type) {
|
||||
uni.showLoading({
|
||||
title: '加载中'
|
||||
})
|
||||
@@ -137,6 +155,13 @@ export default {
|
||||
uni.hideLoading();
|
||||
if (res.list&&res.list.length>0) {
|
||||
this.list = res.list;
|
||||
|
||||
if(type){
|
||||
this.scrollTop = 0
|
||||
this.$nextTick(() => {
|
||||
this.scrollTop = 0.1; // 确保触发滚动
|
||||
})
|
||||
}
|
||||
}else{
|
||||
this.list = [];
|
||||
this.null_text = '暂无数据';
|
||||
@@ -272,6 +297,7 @@ export default {
|
||||
},
|
||||
//详情
|
||||
goToDetail(id){
|
||||
if (this.isRefreshing) return;
|
||||
uni.navigateTo({
|
||||
url: '/pages/talents/detail?id='+id,
|
||||
});
|
||||
@@ -309,8 +335,7 @@ export default {
|
||||
background-color: #fff;
|
||||
}
|
||||
.talents_list{
|
||||
margin: 185rpx 30rpx 20rpx;
|
||||
padding-bottom: 120rpx;
|
||||
margin: 0 30rpx 20rpx;
|
||||
}
|
||||
.talents_item{
|
||||
border: 1rpx solid $themeColor;
|
||||
@@ -322,8 +347,9 @@ export default {
|
||||
}
|
||||
.item_image{
|
||||
display: block;
|
||||
width: 160rpx;
|
||||
width: 180rpx;
|
||||
height: 200rpx;
|
||||
background: #f3f3f3;
|
||||
}
|
||||
.item_right{
|
||||
width: calc(100% - 200rpx);
|
||||
@@ -367,7 +393,7 @@ export default {
|
||||
.talents_module{
|
||||
width: 100%;
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
z-index: 99;
|
||||
top: 0;
|
||||
left: 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user