| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- <template>
- <view class="safe-area-inset-bottom margin-top-10">
- <mescroll-body :height="height" ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
- :down="downOption" :up="upOption">
- <view @click="jump(item)" class="cart-view-box" v-for="(item,index) in list" :key="index">
- <view class="text-gray text-center text-sm">{{item.createTime}}</view>
- <view class="bg-white margin-top-10 radius card-view">
- <view class="content-view">
- <view class="flex">
- <view class="center">
- <text class=" text-lg text-cut" style="color: #000000;">{{item.title}}</text>
- </view>
- </view>
- <view class=" text-sm text-cut-2 subtitle">{{item.content | formatHtml}}</view>
- <view class="flex text-gray justify-between "
- style=" border-top: 1rpx solid #f2f2f2;box-sizing: border-box;padding-top: 15rpx;">
- <view class="text-df ">
- <text>查看详情</text>
- </view>
- <view style="padding-top: 8rpx;">
- <text class="cuIcon-right "></text>
- </view>
- </view>
- </view>
- </view>
- </view>
- </mescroll-body>
- <toast ref="toast"></toast>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/components/mescroll-body/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- list: [],
- downOption:{
- auto:false
- }
- }
- },
- filters: {
- formatHtml(str) {
- try{
- str= decodeURIComponent(str).replace(/<[^>]+>/g, "")
- }catch(e){
- console.log(e);
- }
- return str
- }
- },
- methods: {
- jump(item) {
- uni.navigateTo({
- url:"./detail?id="+item.id
- })
- },
- downCallback() {
- setTimeout(() => {
- this.$refs.toast.info('刷新成功')
- this.mescroll.resetUpScroll();
- }, 1000)
- },
- upCallback(mescroll) {
- let params = {
- senderId: this.vuex_shopId,
- current: mescroll.num,
- size: mescroll.size,
- }
- try {
- this.$api.notice.list(params).then(res => {
- let data = res.data.records
- let total = res.data.total
- mescroll.endBySize(data.length, total);
- if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
- this.list = this.list.concat(data); //追加新数据
- })
- } catch (e) {
- this.mescroll.endErr()
- }
- },
- }
- }
- </script>
- <style lang="scss">
- page {
- background-color: #F3F3F3;
- font-size: 28rpx;
- }
- .subtitle {
- color: #7e7e7e;
- font-size: 28rpx;
- margin: 30rpx 0 10rpx 0;
- line-height: 52rpx;
- }
- .cart-view-box {
- padding: 25rpx 20rpx;
- .card-view {
- background-color: #FFFFFF;
- position: relative;
- border-radius: 10rpx;
- .head-img {
- width: 100%;
- height: 236rpx;
- }
- .content-view {
- padding: 27rpx 27rpx 15rpx;
- }
- }
- }
- </style>
|