messageDetail.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view class="message-detail-index">
  3. <view class="message-detail-content">
  4. {{detail.sendUserName}}{{detail.message}}
  5. </view>
  6. <view class="message-btn-box">
  7. <view class="message-btn red" @click="btnClick('拒绝')">拒绝</view>
  8. <view class="line"></view>
  9. <view class="message-btn primary" @click="btnClick('同意')">同意</view>
  10. </view>
  11. </view>
  12. </template>
  13. <script>
  14. import {
  15. getMessageDetailById,
  16. bindProject
  17. } from '@/request/api/message.js'
  18. export default {
  19. data() {
  20. return {
  21. messageId: '',
  22. detail: {}
  23. }
  24. },
  25. onLoad(body) {
  26. this.messageId = body.id;
  27. this.detail = JSON.parse(body.item);
  28. },
  29. methods: {
  30. init() {
  31. },
  32. btnClick(msg) {
  33. uni.showModal({
  34. title: '有极提示',
  35. content: '是否' + msg + '加入该项目',
  36. success: (res) => {
  37. if (res.confirm) {
  38. bindProject({
  39. organizationId: this.detail.organizationId,
  40. projectId: this.detail.projectId,
  41. clientId: this.detail.dataId,
  42. userId: this.$store.getters.user.userId,
  43. identityId: this.detail.identityId || 1
  44. }).then(res => {
  45. if (res.code === 200) {
  46. this.$toast('操作成功')
  47. }
  48. })
  49. }
  50. }
  51. });
  52. }
  53. }
  54. }
  55. </script>
  56. <style lang="scss">
  57. .message-detail-index {
  58. background: $uni-white;
  59. padding: 20rpx;
  60. padding-bottom: 0;
  61. margin: 20rpx 30rpx;
  62. border-radius: 10rpx;
  63. .message-detail-content {
  64. min-height: 200rpx;
  65. padding-bottom: 40rpx;
  66. }
  67. .message-btn-box {
  68. width: 100%;
  69. display: flex;
  70. height: 80rpx;
  71. align-items: center;
  72. border-top: 1px solid $uni-border-3;
  73. .line {
  74. width: 1px;
  75. height: 40rpx;
  76. background: $uni-border-3;
  77. }
  78. .message-btn {
  79. text-align: center;
  80. flex: 1;
  81. }
  82. .red {
  83. color: $uni-error;
  84. }
  85. .primary {
  86. color: $uni-primary;
  87. }
  88. }
  89. }
  90. </style>