my_invitation_send.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  1. <template>
  2. <view style="padding: 0px 30px;margin-top: 5px;">
  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. <!-- 设置页面背景 -->
  112. <style lang="scss">
  113. page{
  114. padding: 20rpx;
  115. height: 100%;
  116. // background-color: #FFF;
  117. }
  118. </style>
  119. <style lang="scss" scoped>
  120. // page {
  121. // padding: 20rpx;
  122. // height: 100%;
  123. // background-color: #E2F0D9;
  124. // }
  125. /* 顶部对方已读和未读按钮 */
  126. .read {
  127. display: flex;
  128. justify-content: space-around;
  129. }
  130. .readDetail {
  131. padding: 10rpx 20rpx;
  132. border-radius: 30rpx;
  133. background-color: #FFF2CC;
  134. font-weight: bold;
  135. }
  136. /* 列表样式 */
  137. .invitationWrapper {
  138. width: 93%;
  139. padding: 20rpx;
  140. margin-top: 20rpx;
  141. border-radius: 20rpx;
  142. background-color: #FFF2CC;
  143. margin-left: 10rpx;
  144. }
  145. /* 邀请号和对方身份、邀请日期和对方状态 */
  146. .invitationTitle,
  147. .invitationDateAndStatus {
  148. display: flex;
  149. position: relative;
  150. }
  151. /* 对方身份 */
  152. .other {
  153. position: absolute;
  154. left: 60%;
  155. }
  156. /* 具体内容的样式 */
  157. .invitatinDetail,
  158. .invitatinStatus {
  159. margin-left: 20rpx;
  160. font-weight: bold;
  161. }
  162. .invitatinDetailOther {
  163. margin-left: 20rpx;
  164. font-weight: bold;
  165. font-size: 26rpx;
  166. }
  167. .invitatinStatus {
  168. color: red;
  169. }
  170. /* 邀请内容、邀请日期和对方状态 */
  171. .invitationContent {
  172. margin-top: 10rpx;
  173. }
  174. </style>