123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157 |
- <template>
- <view class="content">
- <view class="iconmessage-box" v-for="(item,index) in messageDate" @click="navTo(item.id)">
- <view class="box-left">
- <!-- <view class="img">
- <image :src="item.img" mode=""></image>
- </view> -->
- <view class="box-title">
- <view class="title">
- {{item.title}}
- </view>
- <view class="detail">
- {{item.content}}
- </view>
- </view>
- </view>
- <view class="box-right">
- <view class="time">
- {{item.add_time}}
- </view>
- <view class="tishi" v-if="item.status!=1">
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- getMessage
- } from '@/api/index.js'
- export default {
- data() {
- return {
- id:0,
- page:1,
- limit:10,
- messageDate: []
- };
- },
- onLoad(options) {
-
- this.id = options.id
- console.log(this.id, '打印');
- this.getMessage()
- },
- onShow() {
- this.getMessage()
- },
- computed: {
- },
- methods: {
-
- navTo(id) {
- uni.navigateTo({
- url: '/pages/user/messageDetail?id=' + id
- })
- },
- getMessage() {
- console.log(this.id);
- getMessage({
- type:this.id,
- page:this.page,
- limit:this.limit
- }).then(res => {
- this.messageDate = res.data
- // this.messageDetail =res.data
- // this.messageDate[0].messageDetail = res.data.xt
- // this.messageDate[1].messageDetail = res.data.xx
- // this.messageDate[2].messageDetail = res.data.yj
- // this.messageDate[3].messageDetail = res.data.fh
- // this.messageDate[4].messageDetail = res.data.dg
- console.log(res, 'res');
- })
- }
- }
- }
- </script>
- <style lang="scss">
- page,
- .content {
- padding: 0;
- margin: 0;
- width: 100%;
- height: 100%;
- background: #f3f3f3;
- }
- .iconmessage-box {
- width: 750rpx;
- display: flex;
- justify-content: space-between;
- padding: 20rpx 30rpx;
- .box-left {
- display: flex;
- .img {
- margin: 10rpx 25rpx 10rpx 0;
- width: 70rpx;
- height: 70rpx;
- border-radius: 50%;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- }
- }
- .box-title {
- display: flex;
- width: 350rpx;
- flex-direction: column;
- .title {
- font-size: 34rpx;
- font-weight: 500;
- }
- .detail {
- font-size: 24rpx;
- color: #909090;
- }
- }
- }
- .box-right {
- display: flex;
- flex-direction: column;
- // justify-content: flex-end;
- .time {
- margin: 10rpx 0;
- font-size: 24rpx;
- color: #909090;
- }
- .tishi {
- margin-left: auto;
- width: 15rpx;
- height: 15rpx;
- border-radius: 50%;
- background-color: red;
- margin-right: 30rpx;
- }
- }
- }
- </style>
|