my_invitation_send.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  1. <template>
  2. <view>
  3. <!-- 顶部对方已读和未读按钮 -->
  4. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem" styleType="button" activeColor="#6EB312"></uni-segmented-control>
  5. <!-- 发出的邀请列表 -->
  6. <view v-show="current === 0">
  7. <view v-for="(Info,index) in InviteInfoRead" :key="index">
  8. <view class="invitationWrapper" @click="invitationDetail(Info)">
  9. <view class="invitationTitle">
  10. <view>
  11. <text>邀请号</text>
  12. <text class="invitatinDetail">{{Info.id}}</text>
  13. </view>
  14. <view class="other">
  15. <text>对方</text>
  16. <text class="invitatinDetail">{{Info.toUname}} {{Info.identity === '教员' ? '学员' : '教员'}}</text>
  17. </view>
  18. </view>
  19. <view class="invitationContent">
  20. <text>邀请内容</text>
  21. <text class="invitatinDetail">{{Info.requireDetail}}</text>
  22. </view>
  23. <view class="invitationDateAndStatus">
  24. <view>
  25. <text>邀请日期</text>
  26. <text class="invitatinDetailOther">{{Info.datetime}}</text>
  27. </view>
  28. <view class="other">
  29. <text>我方状态</text>
  30. <text class="invitatinStatus">{{Info.operateStatus}}</text>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </view>
  36. <view v-show="current === 1">
  37. <view v-for="(Info,index) in InviteInfoUnRead" :key="index">
  38. <view class="invitationWrapper" @click="invitationDetail(Info)">
  39. <view class="invitationTitle">
  40. <view>
  41. <text>邀请号</text>
  42. <text class="invitatinDetail">{{Info.id}}</text>
  43. </view>
  44. <view class="other">
  45. <text>对方</text>
  46. <text class="invitatinDetail">{{Info.toUname}} {{Info.identity === '教员' ? '学员' : '教员'}}</text>
  47. </view>
  48. </view>
  49. <view class="invitationContent">
  50. <text>邀请内容</text>
  51. <text class="invitatinDetail">{{Info.requireDetail}}</text>
  52. </view>
  53. <view class="invitationDateAndStatus">
  54. <text>邀请日期</text>
  55. <text class="invitatinDetailOther">{{Info.datetime}}</text>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </template>
  62. <script>
  63. import {
  64. mapState,
  65. mapMutations
  66. } from 'vuex'
  67. export default {
  68. data() {
  69. return {
  70. current: 1,
  71. items: ['对方已读', '对方未读'],
  72. InviteInfoRead: [],
  73. InviteInfoUnRead: []
  74. };
  75. },
  76. created() {
  77. this.readNo()
  78. },
  79. methods: {
  80. async readYes() {
  81. const {
  82. data: result
  83. } = await uni.$http.get('/education/invite-info/getSendedInvitationRead')
  84. this.InviteInfoRead = result.data.list
  85. },
  86. async readNo() {
  87. const {
  88. data: result
  89. } = await uni.$http.get('/education/invite-info/getSendedInvitationUnread')
  90. this.InviteInfoUnRead = result.data.list
  91. },
  92. async invitationDetail(Info) {
  93. uni.navigateTo({
  94. url: '/subpkg/my/invitation/my_invitation_send_detail?id=' + encodeURIComponent(Info.id)
  95. })
  96. },
  97. onClickItem(e) {
  98. if (this.current != e.currentIndex) {
  99. this.current = e.currentIndex
  100. }
  101. if (this.current === 1) {
  102. this.readNo()
  103. }
  104. if (this.current === 0) {
  105. this.readYes()
  106. }
  107. }
  108. }
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. page {
  113. padding: 20rpx;
  114. height: 100%;
  115. background-color: #E2F0D9;
  116. }
  117. /* 顶部对方已读和未读按钮 */
  118. .read {
  119. display: flex;
  120. justify-content: space-around;
  121. }
  122. .readDetail {
  123. padding: 10rpx 20rpx;
  124. border-radius: 30rpx;
  125. background-color: #FFF2CC;
  126. font-weight: bold;
  127. }
  128. /* 列表样式 */
  129. .invitationWrapper {
  130. width: 93%;
  131. padding: 20rpx;
  132. margin-top: 20rpx;
  133. border-radius: 20rpx;
  134. background-color: #FFF2CC;
  135. margin-left: 10rpx;
  136. }
  137. /* 邀请号和对方身份、邀请日期和对方状态 */
  138. .invitationTitle,
  139. .invitationDateAndStatus {
  140. display: flex;
  141. position: relative;
  142. }
  143. /* 对方身份 */
  144. .other {
  145. position: absolute;
  146. left: 60%;
  147. }
  148. /* 具体内容的样式 */
  149. .invitatinDetail,
  150. .invitatinStatus {
  151. margin-left: 20rpx;
  152. font-weight: bold;
  153. }
  154. .invitatinDetailOther {
  155. margin-left: 20rpx;
  156. font-weight: bold;
  157. font-size: 26rpx;
  158. }
  159. .invitatinStatus {
  160. color: red;
  161. }
  162. /* 邀请内容、邀请日期和对方状态 */
  163. .invitationContent {
  164. margin-top: 10rpx;
  165. }
  166. </style>