bindingCarCaptain.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //绑定车队长
  2. <template>
  3. <view class="center">
  4. <view class="fleetInfo">
  5. <view class="fleetInfo_name">{{fleetInfo.name}}({{fleetInfo.phone}})</view>
  6. <view class="fleetInfo_phone">{{fleetInfo.status}}</view>
  7. </view>
  8. <view class="btn_css">
  9. <view class="btn_item">
  10. <u-button type="primary" text="去绑定" @click="operation"></u-button>
  11. </view>
  12. <view class="btn_item">
  13. <u-button type="primary" text="解绑" @click="leave"></u-button>
  14. </view>
  15. </view>
  16. <u-toast ref="uToast"></u-toast>
  17. <u-modal :show="tipsShow" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
  18. confirmColor='#2772FB' @confirm="$u.throttle(confirmClick, 5000)" @close="cancelClick" @cancel="cancelClick"></u-modal>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. fleetInfo:{
  26. name:"张三",
  27. phone:"1301111111111",
  28. status:"待确定"
  29. },
  30. tipsShow:false,
  31. alertTitle:"确定解绑车队长?"
  32. }
  33. },
  34. onLoad() {
  35. this.getInfo()
  36. },
  37. onShow() {
  38. },
  39. methods: {
  40. operation(){
  41. uni.$u.route('/pages/mine/fleet/addBinding');
  42. // uni.$u.route('/pages/mine/fleet/addBinding', {
  43. // data: JSON.stringify(this.dataDetails),
  44. // });
  45. },
  46. leave(){
  47. this.tipsShow = true
  48. },
  49. cancelClick(){
  50. this.tipsShow = false
  51. },
  52. confirmClick(){
  53. uni.showLoading({
  54. mask: true,
  55. title: '加载中'
  56. })
  57. this.tipsShow = false
  58. this.$request.baseRequest('post', '', this.dataDetails).then(res => {
  59. if (res.code == 200) {
  60. uni.hideLoading()
  61. this.$refs.uToast.show({
  62. type: 'success',
  63. message: "解绑成功!",
  64. complete() {
  65. // uni.navigateBack({
  66. // delta: 1
  67. // });
  68. this.getInfo()
  69. }
  70. })
  71. } else {
  72. uni.hideLoading()
  73. uni.$u.toast(res.message);
  74. }
  75. })
  76. .catch(res => {
  77. uni.hideLoading()
  78. uni.$u.toast(res.message);
  79. });
  80. },
  81. getInfo(){
  82. },
  83. }
  84. }
  85. </script>
  86. <style lang="scss" scoped>
  87. .center{
  88. padding: 20rpx 30rpx;
  89. }
  90. .fleetInfo{
  91. display: flex;
  92. width: 100%;
  93. margin-top: 30rpx;
  94. .fleetInfo_name{
  95. width: 50%;
  96. }
  97. .fleetInfo_phone{
  98. width: 50%;
  99. text-align: right;
  100. }
  101. }
  102. .btn_css{
  103. display: flex;
  104. margin-top: 30rpx;
  105. .btn_item{
  106. width: 120rpx;
  107. margin-right: 20rpx;
  108. }
  109. }
  110. </style>