detail.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. <template>
  2. <view style="padding: 20rpx;">
  3. <view class="item">
  4. <view class="title">{{listData.informVo.informName}}</view>
  5. <view class="time">{{ $method.timestampToTime(listData.sendTime, false) }}</view>
  6. <view class="content" v-html="listData.informVo.affiche" style="width: 100%;">
  7. </view>
  8. </view>
  9. <view class="btn1" @click="isOk" v-if="listData.receiptStatus === 0">
  10. 我已阅读
  11. </view>
  12. <view class="btn1" @click="backPage" v-if="listData.receiptStatus === 1">
  13. 返回
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. import { mapGetters } from 'vuex';
  19. export default {
  20. components: {
  21. },
  22. data() {
  23. return {
  24. listData:{},
  25. id:null,
  26. img1:'/static/icon/msg_icon1.png',
  27. img2:'/static/icon/msg_icon2.png'
  28. };
  29. },
  30. onPullDownRefresh(){
  31. },
  32. onLoad(option) {
  33. this.id = Number(option.id)
  34. this.getInfo()
  35. },
  36. onShow() {
  37. /* if(this.current === 2 && this.$method.isLogin()){
  38. this.$refs.refMy.init();
  39. } */
  40. },
  41. onShareAppMessage(res) {
  42. var self = this;
  43. return {
  44. title: '中正',
  45. path: `/pages/index/index?inviteCode=` + userInfo == null ? '' : userInfo.userAccount
  46. };
  47. },
  48. methods: {
  49. isOk(){
  50. this.$api.courseappinformUser({id:this.listData.id,receiptStatus:1}).then(res => {
  51. if(res.data.code === 200){
  52. uni.navigateBack({
  53. delta: 1
  54. });
  55. }
  56. })
  57. },
  58. backPage(){
  59. uni.navigateBack({
  60. delta: 1
  61. });
  62. },
  63. getInfo(){
  64. this.$api.getappinformUserId(this.id).then(res => {
  65. if(res.data.code === 200){
  66. res.data.data.informVo.affiche = res.data.data.informVo.affiche.replace(/<img/gi,'<img style="max-width:100%;"')
  67. this.listData = res.data.data
  68. }
  69. })
  70. },
  71. change(index){
  72. this.current = index;
  73. }
  74. },
  75. onReachBottom() {},
  76. computed: { ...mapGetters(['userInfo']) }
  77. };
  78. </script>
  79. <style >
  80. page {
  81. background: #EAEEF1;
  82. }
  83. </style>
  84. <style scoped>
  85. .content{
  86. font-size: 28rpx;
  87. color: #666666;
  88. line-height: 36rpx;
  89. }
  90. .time{
  91. font-size: 24rpx;
  92. color: #999999;
  93. margin: 15rpx 0;
  94. }
  95. .btn1{
  96. width: 526rpx;
  97. height: 80rpx;
  98. background: #007AFF;
  99. border-radius: 40rpx;
  100. color: #FFFFFF;
  101. font-size: 30rpx;
  102. font-weight: bold;
  103. text-align: center;
  104. line-height: 80rpx;
  105. margin: 30rpx auto;
  106. }
  107. .item{
  108. width: 100%;
  109. background: #FFFFFF;
  110. border-radius: 16rpx;
  111. padding: 15rpx;
  112. }
  113. .title{
  114. font-size: 30rpx;
  115. font-weight: bold;
  116. color: #333333;
  117. }
  118. </style>