123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <template>
- <view>
- <!-- <mescroll-body :up="upOption" ref="mescrollRef" @init="mescrollInit" @up="upCallback" @down="downCallback"> -->
-
- <view class='notice-wrap' v-for='item in noticeList'>
- <view class="flex justify-space-between">
- <view style='width:100px;margin:10rpx 0;' class='flex justify-space-between'>
- <u--image :showLoading="true" src="/static/imgs/card/news.png" width="52rpx" height="52rpx"></u--image>
- <view>{{item.newsTitle}}</view>
- </view>
-
- <view class='date'>{{parseTime(item.gmtCreate)}}</view>
- </view>
- <view class='content'>{{item.newsContent}}</view>
- </view>
- <!-- </mescroll-body> -->
- <u-toast ref="uToast"></u-toast>
- </view>
- </template>
- <script>
- import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
- export default {
- mixins: [MescrollMixin],
- data() {
- return {
- noticeList:[],
- unreadList:[]
- };
- },
- onShow() {
- this.getList()
- },
- methods:{
- getList(){
- var that = this
- uni.showLoading({
- title: '数据加载中'
- })
- this.$request.baseRequest('admin.unimall.cardNewsInfo', 'list',{
- receiveId:uni.getStorageSync("userInfo").id,
- }, failres => {
- uni.showToast({
- icon:"none",
- title: failres.errmsg,
- duration: 3000
- });
- uni.hideLoading()
- }).then(res => {
- let curPageLen = res.data.items.length;
- let totalPage = res.data.total;
- this.noticeList=res.data.items
- if(this.noticeList.length>0){
- var data=this.noticeList.filter((item)=>{return item.newsFlag==0})
- this.unreadList=data
- if(this.unreadList.length>0){
- for(var i=0;i<this.unreadList.length;i++){
- if(this.unreadList[i].newsFlag==0){
- this.unreadList[i].newsFlag=1
- this.$request.baseRequest('admin.unimall.cardNewsInfo', 'update',{
- cardNewsInfo:JSON.stringify(this.unreadList[i]),
- }, failres => {
- uni.showToast({
- icon:"none",
- title: failres.errmsg,
- duration: 3000
- });
- uni.hideLoading()
- }).then(res => {})
- }
-
- }
-
- }
- }
-
- uni.hideLoading()
- })
- },
- }
-
- }
- </script>
- <style lang="scss" scoped>
- .notice-wrap{
- background:#fff;
- padding:20rpx;
- margin:10rpx;
- border-radius:20rpx;
- }
- .date{
- color:#CCCCCC;
- }
- .content{
- font-size:26rpx;
- color:#666;
- }
- </style>
|