my_invitation_receive.vue 4.1 KB

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