1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <template>
- <view>
- <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/image/enter/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.tourism.noticeMessageInfo', '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.tourism.noticeMessageInfo', 'update',{
- noticeMessageInfo: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>
|