fleetInvitation.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. <template>
  2. <view class="center">
  3. <view v-for="(item,index) in applyList" class="fleet">
  4. <u-swipe-action>
  5. <u-swipe-action-item :options="options1" :disabled="item.status == '已申请'" @click="delInfo(item)">
  6. <!-- <view class="swipe-action u-border-top u-border-bottom flex"> -->
  7. <!-- <view class="swipe-action__content">
  8. <text class="swipe-action__content__text">基础使用</text>
  9. </view> -->
  10. <view class="flex">
  11. <view class="fleet_img">
  12. <u--image class="flex-end" :showLoading="true" :src="item.coverUrl" width="60px"
  13. height="60px" shape='circle'>
  14. </u--image>
  15. </view>
  16. <view class="fleet_right">
  17. <view class="flex">
  18. <view class="fleet_name">
  19. {{item.fleetName}}
  20. </view>
  21. <view class="btnChange flex">
  22. <view class="refuse" v-if="item.status == '已申请'" @click="refuse(item)">拒绝
  23. </view>
  24. <view class="adopt" v-if="item.status == '已申请'" @click="accept(item)">接受
  25. </view>
  26. <view class="fleet_invite" v-else>{{item.status}}</view>
  27. </view>
  28. </view>
  29. </view>
  30. </view>
  31. </u-swipe-action-item>
  32. </u-swipe-action>
  33. </view>
  34. <u-loadmore :status="status" :nomore-text="nomoreText" />
  35. <u-toast ref="uToast"></u-toast>
  36. </view>
  37. </template>
  38. <script>
  39. export default {
  40. data() {
  41. return {
  42. commonId: "",
  43. applyList: [],
  44. options1: [{
  45. text: '删除',
  46. style: {
  47. width: '145rpx',
  48. // height:'180rpx',
  49. backgroundColor: '#FE5C5C',
  50. }
  51. }],
  52. status: 'loadmore',
  53. nomoreText: '暂无记录',
  54. isLoadMore: false, //是否加载中
  55. pages: 1, //分页
  56. limit: 10, //每次取条目数
  57. }
  58. },
  59. // onPullDownRefresh() { //下拉刷新
  60. // this.$refs.udb.loadData({
  61. // clear: true //可选参数,是否清空数据
  62. // }, () => {
  63. // uni.stopPullDownRefresh()
  64. // })
  65. // },
  66. // onReachBottom() { //滚动到底翻页
  67. // this.$refs.udb.loadMore()
  68. // },
  69. onPageScroll(e) {
  70. this.scrollTop = e.scrollTop;
  71. },
  72. onReachBottom() { //上拉触底函数
  73. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  74. this.isLoadMore = true
  75. this.pages += 1
  76. this.getList()
  77. }
  78. },
  79. onPullDownRefresh() {
  80. this.pages = 1
  81. this.isLoadMore = false
  82. this.status = 'loading'
  83. this.getList()
  84. setTimeout(function() {
  85. uni.stopPullDownRefresh();
  86. }, 1000);
  87. },
  88. onShow() {
  89. },
  90. onLoad() {
  91. this.commonId = uni.getStorageSync("firstAuthentication").commonId
  92. this.read() //点击进来已读信息
  93. this.getList()
  94. },
  95. methods: {
  96. delInfo(item) {
  97. this.$request.baseRequest('post', '/fleetMemberInfo/api/listDelete', {
  98. id: item.id
  99. }).then(res => {
  100. if (res.code == 200) {
  101. this.$refs.uToast.show({
  102. type: 'success',
  103. message: "删除成功!",
  104. })
  105. this.getList()
  106. }
  107. })
  108. .catch(res => {
  109. uni.$u.toast(res.message);
  110. });
  111. },
  112. read() {
  113. this.$request.baseRequest('post', '/fleetMemberInfo/api/read', {
  114. commonId: this.commonId,
  115. readFlag: 2
  116. }).then(res => {})
  117. .catch(res => {
  118. uni.$u.toast(res.message);
  119. });
  120. },
  121. refuse(item) {
  122. this.$request.baseRequest('post', '/fleetMemberInfo/api/editFleetMemberInfo', {
  123. examineFlag: 2,
  124. id: item.id
  125. }).then(res => {
  126. if (res.code == 200) {
  127. this.$refs.uToast.show({
  128. type: 'success',
  129. message: "拒绝成功!",
  130. complete() {
  131. uni.$u.route("pages/riders/myTeam")
  132. }
  133. })
  134. }
  135. })
  136. .catch(res => {
  137. uni.$u.toast(res.message);
  138. });
  139. },
  140. accept(item) {
  141. this.$request.baseRequest('post', '/fleetMemberInfo/api/editFleetMemberInfo', {
  142. examineFlag: 1,
  143. id: item.id
  144. }).then(res => {
  145. if (res.code == 200) {
  146. this.$refs.uToast.show({
  147. type: 'success',
  148. message: "通过成功!",
  149. complete() {
  150. uni.$u.route("pages/riders/myTeam")
  151. }
  152. })
  153. }
  154. })
  155. .catch(res => {
  156. uni.$u.toast(res.message);
  157. });
  158. },
  159. getList() {
  160. this.status = 'loading'
  161. this.$request.baseRequest('get', '/fleetMemberInfo/selectFleetMemberInfo', {
  162. commonId: this.commonId,
  163. flag: 2,
  164. pageSize: 10,
  165. currentPage: this.pages
  166. }).then(res => {
  167. if (res.code == 200) {
  168. this.applyList = res.data.records
  169. if (res.data.total == 0) {
  170. this.status = 'nomore'
  171. } else {
  172. this.status = 'loadmore'
  173. }
  174. }
  175. })
  176. .catch(res => {
  177. uni.$u.toast(res.message);
  178. });
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss" scoped>
  184. .center {
  185. padding: 30rpx;
  186. }
  187. .fleet {
  188. margin: 30rpx 0;
  189. .fleet_img {
  190. width: 20%;
  191. }
  192. .fleet_right {
  193. margin-top: 20rpx;
  194. width: 80%;
  195. .fleet_name {
  196. width: 50%;
  197. margin-top: 20rpx;
  198. color: #333333;
  199. font-size: 34rpx;
  200. font-weight: 600;
  201. }
  202. .btnChange {
  203. width: 50%;
  204. justify-content: flex-end;
  205. }
  206. .fleet_invite {
  207. text-align: right;
  208. color: #BABABA;
  209. margin-right: 30rpx;
  210. margin-top: 20rpx;
  211. }
  212. .refuse,
  213. .adopt {
  214. padding: 10rpx 30rpx;
  215. height: 60rpx;
  216. color: #FFFFFF;
  217. line-height: 60rpx;
  218. text-align: center;
  219. border-radius: 40rpx;
  220. }
  221. .refuse {
  222. background-color: #FE5C5C;
  223. margin-right: 20rpx;
  224. }
  225. .adopt {
  226. background: #2772FB;
  227. }
  228. }
  229. }
  230. .u-swipe-action {
  231. height: 170rpx;
  232. border-bottom: 1px solid #E6E6E6;
  233. }
  234. </style>