<template> <view class="egersis"> <image src="../../static/index/back.png" style="position:fixed;top: -4rpx;left: 0;z-index: -999; width:100%;height: 300rpx;"></image> <!-- 搜索框 --> <view class="search-area"> <u-search placeholder="我要查证" v-model="keyword" bgColor="#fff" height="40" :actionStyle="{ fontSize: '16px', color: '#fff', fontWeight: '600' }" clearabled @custom="search" @search="search" ></u-search> </view> <view class="egersis-area"> <Egersis :list="egersisList"/> </view> <u-loadmore :status="status" loadmoreText=" "/> <!-- 返回顶部 --> <u-back-top :scroll-top="scrollTop" icon="arrow-up" customStyle="background: rgba(67, 144, 247, .7)" :iconStyle="{ fontSize: '32rpx', color: '#fff', fontWeight: '600' }" duration="200" ></u-back-top> <!-- 空 --> <u-empty v-if="isEmpty" mode="search" text="暂无结果" :show="true" iconColor="#77797d" textColor="#77797d" marginTop="80" ></u-empty> </view> </template> <script> import Egersis from '../components/egersisList.vue' export default { components: { Egersis, }, data() { return { isEmpty: false, //数据是否为空 scrollTop: 0, egersisList: [] // 列表数据 } }, mounted() { uni.showShareMenu({ withShareTicket: true, menus: ["shareAppMessage", "shareTimeline"] }); this.egersisList = [ { title: '薯片涨袋是变质了?', time: '2022-12-12', img: '../../static/share.png' }, { title: '成本是要一毛钱的鸡蛋泛滥?', time: '2022-12-12', img: '../../static/share.png' }, { title: '薯片涨袋是变质了?', time: '2022-12-12', img: '../../static/share.png' }, { title: '成本是要一毛钱的鸡蛋泛滥?', time: '2022-12-12', img: '../../static/share.png' }, { title: '薯片涨袋是变质了?', time: '2022-12-12', img: '../../static/share.png' }, { title: '成本是要一毛钱的鸡蛋泛滥?', time: '2022-12-12', img: '../../static/share.png' }, { title: '薯片涨袋是变质了?', time: '2022-12-12', img: '../../static/share.png' }, { title: '成本是要一毛钱的鸡蛋泛滥?', time: '2022-12-12', img: '../../static/share.png' }, ] }, //分享好友 onShareAppMessage() { return { title: ' ', imageUrl: '../../static/share.png', // path: "/pages/messageList/messageList", }; }, //分享朋友圈 onShareTimeline() { return { title: '新疆网络举报', } }, watch: { egersisList: { handler(val){ if(val.length) { this.isEmpty = false; } else { this.isEmpty = true; } }, deep: true, // immediate: true, } }, // 监听滚动条位置 onPageScroll(e) { this.scrollTop = e.scrollTop; }, //上滑加载 onReachBottom() { }, methods: { search() { }, } } </script> <style lang="scss" scoped> .egersis { width: 100%; box-sizing: border-box; padding: 40rpx; padding-bottom: 60rpx; } </style> <style> page { background-color: #f0f0f0; } </style>