fleetInvitation.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. <template>
  2. <view class="center">
  3. <view v-for="(item,index) in applyList" class="flex fleet">
  4. <view class="fleet_img">
  5. <u--image class="flex-end" :showLoading="true" :src="item.coverUrl" width="60px" height="60px"
  6. shape='circle'>
  7. </u--image>
  8. </view>
  9. <view class="fleet_right">
  10. <view class="flex">
  11. <view class="fleet_name">
  12. {{item.fleetName}}
  13. </view>
  14. <view class="fleet_invite" v-if="item.status == '已申请'" @click="refuse(item)">拒绝</view>
  15. <view class="fleet_invite" v-if="item.status == '已申请'" @click="accept(item)">接受</view>
  16. <view class="fleet_invite" v-else>{{item.status}}</view>
  17. </view>
  18. </view>
  19. </view>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. commonId: "",
  27. applyList: []
  28. }
  29. },
  30. onShow() {
  31. },
  32. onLoad() {
  33. this.commonId = uni.getStorageSync("firstAuthentication").commonId
  34. this.read() //点击进来已读信息
  35. this.getList()
  36. },
  37. methods: {
  38. read() {
  39. this.$request.baseRequest('post', '/fleetMemberInfo/api/read', {
  40. commonId: this.commonId,
  41. readFlag: 2
  42. }).then(res => {})
  43. .catch(res => {
  44. uni.$u.toast(res.message);
  45. });
  46. },
  47. refuse(item) {
  48. this.$request.baseRequest('post', '/fleetMemberInfo/api/editFleetMemberInfo', {
  49. examineFlag: 2,
  50. id: item.id
  51. }).then(res => {
  52. if (res.code == 200) {
  53. this.$refs.uToast.show({
  54. type: 'success',
  55. message: "拒绝成功!",
  56. complete() {
  57. uni.$u.route("pages/riders/myTeam")
  58. }
  59. })
  60. }
  61. })
  62. .catch(res => {
  63. uni.$u.toast(res.message);
  64. });
  65. },
  66. accept(item) {
  67. this.$request.baseRequest('post', '/fleetMemberInfo/api/editFleetMemberInfo', {
  68. examineFlag: 1,
  69. id: item.id
  70. }).then(res => {
  71. if (res.code == 200) {
  72. this.$refs.uToast.show({
  73. type: 'success',
  74. message: "通过成功!",
  75. complete() {
  76. uni.$u.route("pages/riders/myTeam")
  77. }
  78. })
  79. }
  80. })
  81. .catch(res => {
  82. uni.$u.toast(res.message);
  83. });
  84. },
  85. getList() {
  86. this.$request.baseRequest('get', '/fleetMemberInfo/selectFleetMemberInfo', {
  87. commonId: this.commonId,
  88. flag: 2,
  89. pageSize: 10,
  90. currentPage: 1
  91. }).then(res => {
  92. if (res.code == 200) {
  93. this.applyList = res.data.records
  94. }
  95. })
  96. .catch(res => {
  97. uni.$u.toast(res.message);
  98. });
  99. }
  100. }
  101. }
  102. </script>
  103. <style lang="scss" scoped>
  104. .center {
  105. padding: 30rpx;
  106. }
  107. .fleet {
  108. margin: 30rpx 0;
  109. .fleet_img {
  110. width: 20%;
  111. }
  112. .fleet_right {
  113. margin-top: 20rpx;
  114. width: 80%;
  115. .fleet_name {
  116. width: 70%;
  117. }
  118. .fleet_invite {
  119. background-color: #5878e8;
  120. color: #fff;
  121. margin-left: 10rpx;
  122. }
  123. }
  124. }
  125. </style>