my_message_detail.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <template>
  2. <view class="container">
  3. <view class="title">{{msg.msgTitle}}</view>
  4. <view class="text1">{{msg.big}}</view>
  5. <view class="text2" @click="gotoInvite" >{{msg.small}}</view>
  6. </view>
  7. </template>
  8. <script>
  9. import { mapMutations, mapState } from 'vuex'
  10. export default {
  11. computed: {
  12. ...mapState('m_user', ['userinfo'])
  13. },
  14. data() {
  15. return {
  16. msg: {}
  17. };
  18. },
  19. onLoad(option) {
  20. this.msg = JSON.parse(decodeURIComponent(option.item))
  21. let arr = this.msg.msgContent.split(":")
  22. this.msg.big = arr[0]
  23. this.msg.small = arr[1]
  24. if (this.msg.status == '未读') {
  25. this.updateStatus(this.msg.id)
  26. }
  27. },
  28. methods: {
  29. ...mapMutations('m_user', ['updateUserInfo']),
  30. updateStatus(id) {
  31. const query = {
  32. id
  33. }
  34. uni.$http.get('/education/mp-inner-msg/updateMsg', query)
  35. this.userinfo.count--
  36. this.updateUserInfo(this.userinfo)
  37. },
  38. gotoInvite() {
  39. if (this.msg.msgTitle === '支付通知') {
  40. uni.navigateTo({
  41. url: '/subpkg/my/order/my_order_detail?orderId='+encodeURIComponent(this.msg.small)
  42. })
  43. } else if (this.msg.msgTitle === '邀请函'){
  44. uni.navigateTo({
  45. url: '/subpkg/my/invitation/my_invitation_receive_detail?id='+encodeURIComponent(this.msg.small)
  46. })
  47. } else if (this.msg.msgTitle === '支付成功') {
  48. uni.navigateTo({
  49. url: '/subpkg/student/order/student_order_detail?orderId='+encodeURIComponent(this.msg.small)
  50. })
  51. } else if (this.msg.msgTitle === '申请退款') {
  52. uni.navigateTo({
  53. url: '/subpkg/student/order/student_order_detail?orderId='+encodeURIComponent(this.msg.small)
  54. })
  55. }
  56. }
  57. }
  58. }
  59. </script>
  60. <style lang="scss" scoped>
  61. .container {
  62. border-radius: 40rpx;
  63. background-color: #fff;
  64. height: 40%;
  65. margin-left: 20rpx;
  66. margin-right: 20rpx;
  67. padding: 20px 20px;
  68. flex-wrap: wrap;
  69. }
  70. .title {
  71. text-align: center;
  72. font-weight: bold;
  73. font-size: 35rpx;
  74. color: #6d6d6d;
  75. padding-bottom: 20px;
  76. //margin-bottom: 20px;
  77. }
  78. .text1 {
  79. //padding-left: 40px;
  80. text-align: center;
  81. line-height: 30px;
  82. font-size: 35rpx;
  83. }
  84. .text2 {
  85. text-align: center;
  86. color: blue;
  87. text-decoration: underline;
  88. padding-top: 40px;
  89. }
  90. </style>