| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146 |
- <template>
- <view style="background-color: #FFFFFF;min-height: 100vh;">
- <view class="nav_section" v-if="list.length>0">
- <view v-for="(item, index) in list" :key="index" class="nav_section_items">
- <view class="section_cont">
- <view class="section_cont_tel">
- <text class="title">{{item.noticeTitle}}</text>
- </view>
- <view class="section_cont_tel">
- <text class="content">{{item.noticeContent}}</text>
- </view>
- <view class="section_cont_tel">
- <text class="date">{{item.createDate}}</text>
- </view>
- </view>
- </view>
- </view>
- <view class="default" v-if="list==null || list.length==0">
- <image src="/static/common/empty.png" mode="heightFix"></image>
- <view>
- <text>没有消息</text>
- </view>
- </view>
- </view>
- </template>
- <script>
- var util = require("../../../utils/util.js"); //获取app实例
- //获取app实例
- var app = getApp();
- export default {
- data() {
- return {
- list: null
- };
- },
- components: {},
- props: {},
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function(options) {
- this.getNotice();
- },
- methods: {
- //获取公告消息
- getNotice: function() {
- var that = this;
- let params = {};
- params['member_id'] = app.globalData.member.id; //发布目标渠道 1-app 2-小程序,
- params['push_target'] = 2;
- let operation = 'member/getNotices';
- app.globalData.postRequest(params, operation, function(res) {
- console.info("获取结果:" + res.data.result_msg); //获取成功
- if (res.data.result_code == 1) {
- let list = res.data.list;
- for (let i in list) {
- list[i].createDate = util.formatTime(list[i].createDate);
- }
- that.setData({
- list: list
- });
- }
- });
- }
- }
- };
- </script>
- <style>
- /* pages/myHome/myHome.wxss */
- page {
- overflow-y: scroll;
- }
- .nav_section {
- width: 100%;
- }
- .nav_section_items {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- padding: 30rpx;
- border-bottom: 2rpx solid #ddd;
- position: relative;
- background: #fff;
- }
- .nav_section_items:active {
- background: #ddd;
- }
- .nav_section_items .section_cont .section_cont_sub {
- font-size: 30rpx;
- line-height: 50rpx;
- margin-bottom: 10rpx;
- }
- .section_cont_tel .title {
- font-size: 28rpx;
- color: #1f1f1f;
- }
- .section_cont_tel {
- line-height: 60rpx;
- }
- .section_cont_tel .content {
- font-size: 32rpx;
- color: #080808;
- }
- .section_cont_tel .date {
- font-size: 24rpx;
- color: #868686;
- }
- .default {
- text-align: center;
- position: fixed;
- left: 50%;
- top: 40%;
- transform: translate(-50%, -50%);
- }
- .default text {
- color: #AAAAAA;
- }
- .default image {
- height: 160rpx;
- display: inline-block;
- }
- </style>
|