message_detail.vue 2.0 KB

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