123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- <template>
- <view class="pages">
- <u-navbar
- title="演出资讯"
- :placeholder="true"
- :autoBack="false"
- @leftClick="leftClick"
- :safeAreaInsetTop="true"
- >
- </u-navbar>
- <view class="search-wrap">
- <u-search
- placeholder="请输入关键词"
- :clearabled="true"
- :showAction="true"
- height="80rpx"
- @search="search"
- @custom="search"
- @clear="reloadList"
- bgColor="#EAEAEA"
- borderColor="#EAEAEA"
- v-model="params.keyword">
- </u-search>
- </view>
- <view class="page-wrap">
- <mescroll-body class="" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :up="upOption">
-
- <view class="list">
- <view v-for="(item,index) in dataList" class="item u-flex" :class="{ show: show }" @click="itemClick(item)" :key="item.id">
- <view class="text">
- <view class="title u-line-1">{{ item.title }}</view>
- <view class="con u-line-2">{{item.infoSnapshot}}</view>
- <view class="time">{{ $u.timeFormat(item.onlineTime, 'yyyy-mm-dd') }}</view>
- </view>
- <image class="img" :src="item.mainImg" mode=""></image>
- </view>
- </view>
- </mescroll-body>
- </view>
- </view>
- </template>
- <script>
-
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- components: {
-
- },
- data() {
- return {
- staticUrl:this.$commonConfig.staticUrl,
-
-
-
-
- upOption: {
- page: {
- size: 10
- },
- noMoreSize: 5,
- empty: {
- tip: '暂无相关资讯,请重新搜索'
- }
- },
- params:{
- keyword:''
- },
- dataList:[],
- observer: null,
- show:false,
-
- }
- },
- onShow() {
- },
- onLoad() {
- this.observer = uni.createIntersectionObserver(this,{observeAll: true});
- },
- onReady() {
- this.observer.relativeToViewport().observe('.item', res => {
- if (res.intersectionRatio > 0) {
- console.log('resres',res);
-
-
- this.show = true;
- }
- })
- },
- onUnload() {
- if (this.observer) {
- this.observer.disconnect()
- }
- },
- methods: {
- leftClick(e){
- let pages = getCurrentPages();
- if(pages.length==1){
- uni.$u.route('/pages/index/index')
- }else{
- uni.navigateBack()
- };
- },
-
- </script>
- <style>
- page{
- background-color: #F9FAFD;
- }
- </style>
- <style lang="scss" scoped>
- .search-wrap{
- padding: 20rpx 34rpx;
- }
- .list{
- .item{
- &.show{
- animation: slide-top 0.5s cubic-bezier(0.250, 0.460, 0.450, 0.940) both;
- }
- background-color: #fff;
- border-radius: 24rpx;
- margin-bottom: 24rpx;
- overflow: hidden;
- .img{
- border-radius: 12rpx;
- width: 220rpx;
- height: 200rpx;
- }
- .text{
- height: 200rpx;
- box-sizing: border-box;
- padding:24rpx 28rpx;
- // flex: 1;
- width: calc( 100% - 220rpx );
- .title{
- font-size: 28rpx;
- font-weight: bold;
- color: #333333;
- margin-bottom: 16rpx;
- }
- .con{
- font-size: 24rpx;
- font-weight: 400;
- color: #6B6B6B;
- line-height: 36rpx;
- margin-bottom: 20rpx;
- }
- .time{
- font-size: 20rpx;
- font-weight: 400;
- color: #C0C0C0;
- line-height: 22rpx;
- }
- }
- }
- }
- </style>
|