my_message_detail.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. if (this.userinfo.count > 0) {
  36. this.userinfo.count--
  37. this.updateUserInfo(this.userinfo)
  38. }
  39. },
  40. gotoInvite() {
  41. if (this.msg.msgTitle === '支付通知') {
  42. uni.navigateTo({
  43. url: '/subpkg/my/order/my_order_detail?orderId='+encodeURIComponent(this.msg.small)
  44. })
  45. } else if (this.msg.msgTitle === '邀请函'){
  46. uni.navigateTo({
  47. url: '/subpkg/my/invitation/my_invitation_receive_detail?id='+encodeURIComponent(this.msg.small)
  48. })
  49. } else if (this.msg.msgTitle === '支付成功') {
  50. uni.navigateTo({
  51. url: '/subpkg/student/order/student_order_detail?orderId='+encodeURIComponent(this.msg.small)
  52. })
  53. } else if (this.msg.msgTitle === '申请退款') {
  54. uni.navigateTo({
  55. url: '/subpkg/student/order/student_order_detail?orderId='+encodeURIComponent(this.msg.small)
  56. })
  57. }
  58. }
  59. }
  60. }
  61. </script>
  62. <style lang="scss" scoped>
  63. .container {
  64. border-radius: 40rpx;
  65. background-color: #fff;
  66. height: 40%;
  67. margin-left: 20rpx;
  68. margin-right: 20rpx;
  69. padding: 20px 20px;
  70. flex-wrap: wrap;
  71. }
  72. .title {
  73. text-align: center;
  74. font-weight: bold;
  75. font-size: 35rpx;
  76. color: #6d6d6d;
  77. padding-bottom: 20px;
  78. //margin-bottom: 20px;
  79. }
  80. .text1 {
  81. //padding-left: 40px;
  82. text-align: center;
  83. line-height: 30px;
  84. font-size: 35rpx;
  85. }
  86. .text2 {
  87. text-align: center;
  88. color: blue;
  89. text-decoration: underline;
  90. padding-top: 40px;
  91. }
  92. </style>