my_invite.vue 4.3 KB

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