messagelist.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. <template>
  2. <view class="page_view">
  3. <top-return :color="'#FFF'" text="个人通知"></top-return>
  4. <view class="bg_card"></view>
  5. <view class="card_view" style="margin-top: 140rpx;">
  6. <view class="card_item" style="width: 100%;" v-for="(item,index) in userData.msgList" :key="index">
  7. <view class="card_title" style="margin-right: 10rpx;">
  8. <view class="t-icon t-icon-tongzhihuotixing"></view>
  9. <view class="title" style="margin-left: 20rpx;font-weight: 400;">{{item.title}}</view>
  10. <view class="subtitle" style="margin-left: auto;font-size: 24rpx;">{{item.msgTime}}</view>
  11. </view>
  12. <view class="title" style="margin: 0 30rpx;font-size: 28rpx;">{{item.content}}</view>
  13. <image class="msg_poster" :src="item.image" mode="scaleToFill"></image>
  14. </view>
  15. </view>
  16. </view>
  17. </template>
  18. <script>
  19. import {
  20. mapState,
  21. mapMutations
  22. } from 'vuex';
  23. export default {
  24. computed: {
  25. ...mapState('m_parent', ['userData'])
  26. },
  27. data() {
  28. return {};
  29. },
  30. onLoad() {
  31. // 延时
  32. // uni.$u.sleep(1500).then(() => {
  33. // this.loading = false
  34. // })
  35. },
  36. methods: {
  37. ...mapMutations('m_parent', ['updateUserData']),
  38. //删除信息
  39. deleteMsg(index) {
  40. let msgList = this.userData.msgList
  41. let data = msgList.splice(index, 1)
  42. this.updateUserData(data)
  43. }
  44. }
  45. }
  46. </script>
  47. <style lang="scss">
  48. .msg_poster{
  49. margin: 20rpx auto;
  50. width: 94%;
  51. height: 300rpx;
  52. border-radius: 20rpx;
  53. }
  54. .t-icon{
  55. width: 40rpx;
  56. height: 40rpx;
  57. }
  58. </style>