inTeam.vue 2.6 KB

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