my_invitation_send.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. <template>
  2. <view >
  3. <!-- 顶部对方已读和未读按钮 style="padding: 0rpx 20rpx;margin-top: 5rpx;" -->
  4. <uni-segmented-control :current="current" :values="items" @clickItem="onClickItem"
  5. styleType="text" activeColor="#35b882"></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. <uni-row class="invitationTitle">
  11. <uni-col :span="20">
  12. <text>邀请号</text>
  13. <text class="invitatinDetail">{{Info.id}}</text>
  14. </uni-col>
  15. <uni-col :span="4">
  16. <!-- <text>对方</text> -->
  17. <text class="invitatinDetail">{{Info.toUname}}</text>
  18. </uni-col>
  19. </uni-row>
  20. <uni-row class="invitationTitle">
  21. <text>邀请内容</text>
  22. <text class="invitatinDetail">{{Info.requireDetail}}</text>
  23. </uni-row>
  24. <uni-row class="invitationTitle">
  25. <uni-col :span="20">
  26. <text>邀请日期</text>
  27. <text class="invitatinDetail">{{Info.datetime}}</text>
  28. </uni-col>
  29. <uni-col :span="4">
  30. <text class="invitatinStatus">{{Info.operateStatus}}</text>
  31. </uni-col>
  32. </uni-row>
  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. <uni-row class="invitationTitle">
  40. <uni-col :span="20">
  41. <text>邀请号</text>
  42. <text class="invitatinDetail">{{Info.id}}</text>
  43. </uni-col>
  44. <uni-col :span="4">
  45. <!-- <text>对方</text> -->
  46. <text class="invitatinDetail">{{Info.toUname}}</text>
  47. </uni-col>
  48. </uni-row>
  49. <uni-row class="invitationTitle">
  50. <text>邀请内容</text>
  51. <text class="invitatinDetail">{{Info.requireDetail}}</text>
  52. </uni-row>
  53. <uni-row class="invitationTitle">
  54. <text>邀请日期</text>
  55. <text class="invitatinDetail">{{Info.datetime}}</text>
  56. </uni-row>
  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. const tempList = result.data.list
  85. // console.log(tempList)
  86. for(var i = 0;i < tempList.length; i++){
  87. if (tempList[i].identity == '学员'){
  88. tempList[i].toUname = tempList[i].toUname.slice(0,1) + "教员"
  89. }else{
  90. tempList[i].toUname = tempList[i].toUname.slice(0,1) + "学员"
  91. }
  92. }
  93. this.InviteInfoRead = tempList
  94. //console.log(this.InviteInfoRead)
  95. },
  96. async readNo() {
  97. const {
  98. data: result
  99. } = await uni.$http.get('/education/invite-info/getSendedInvitationUnread')
  100. const tempList = result.data.list
  101. //console.log(tempList)
  102. for(var i = 0;i < tempList.length; i++){
  103. if (tempList[i].identity == '学员'){
  104. tempList[i].toUname = tempList[i].toUname.slice(0,1) + "教员"
  105. }else{
  106. tempList[i].toUname = tempList[i].toUname.slice(0,1) + "学员"
  107. }
  108. }
  109. this.InviteInfoUnRead = tempList
  110. //console.log(this.InviteInfoUnRead)
  111. },
  112. async invitationDetail(Info) {
  113. uni.navigateTo({
  114. url: '/subpkg/my/invitation/my_invitation_send_detail?id=' + encodeURIComponent(Info.id)
  115. })
  116. },
  117. onClickItem(e) {
  118. if (this.current != e.currentIndex) {
  119. this.current = e.currentIndex
  120. }
  121. if (this.current === 1) {
  122. this.readNo()
  123. }
  124. if (this.current === 0) {
  125. this.readYes()
  126. }
  127. }
  128. }
  129. }
  130. </script>
  131. <!-- 设置页面背景 -->
  132. <style lang="scss">
  133. page{
  134. height: 100%;
  135. }
  136. </style>
  137. <style lang="scss" scoped>
  138. /* 列表样式 */
  139. .invitationWrapper {
  140. padding: 30rpx;
  141. margin: 10rpx 30rpx;
  142. border-radius: 20rpx;
  143. background-color: #FFF;
  144. font-size: 30rpx;
  145. }
  146. /* 邀请号和对方身份、邀请日期和对方状态 */
  147. .invitationTitle {
  148. display: flex;
  149. position: relative;
  150. }
  151. /* 具体内容的样式 */
  152. .invitatinDetail {
  153. margin-left: 10rpx;
  154. font-weight: bold;
  155. }
  156. .invitatinStatus {
  157. margin-left: 10rpx;
  158. color: red;
  159. font-weight: bold;
  160. }
  161. </style>