fleetInvitation.vue 2.5 KB

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