123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138 |
- //绑定车队长
- <template>
- <view class="center">
- <view class="fleetInfo">
- <view class="fleetInfo_name" v-if="fleetInfo.carCaptainName">{{fleetInfo.carCaptainName}}({{fleetInfo.carCaptainAccountNumber}})</view>
- <view class="fleetInfo_name" v-else>队长名称</view>
- <view class="fleetInfo_phone">{{fleetInfo.status?fleetInfo.status:"未绑定"}}</view>
- </view>
- <view class="btn_css" v-if="fleetInfo.status != '待确认'">
- <view class="btn_item" v-if="!fleetInfo.status||fleetInfo.status=='已拒绝'|| fleetInfo.status=='未绑定'">
- <u-button type="primary" text="去绑定" @click="operation"></u-button>
- </view>
- <view class="btn_item" v-else>
- <u-button type="primary" text="解绑" @click="leave"></u-button>
- </view>
-
- </view>
- <view class="red_char">
- 注:绑定车队长后,运费将自动结算到车队长账户,不再对司机结算,如需对司机本人结算请先解绑车队长。
- </view>
- <u-toast ref="uToast"></u-toast>
- <u-modal :show="tipsShow" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
- confirmColor='#2772FB' @confirm="$u.throttle(confirmClick, 1000)" @close="cancelClick" @cancel="cancelClick"></u-modal>
- </view>
- </template>
- <script>
- import {
- mapState
- } from 'vuex';
- export default {
- data() {
- return {
- fleetInfo:{},
- tipsShow:false,
- alertTitle:"确定解绑车队长?"
- }
- },
- onLoad() {
- this.getInfo()
- },
- onShow() {
- },
- computed: {
- ...mapState(['hasLogin', 'userInfo']),
- },
- methods: {
- operation(){
- uni.$u.route('/pages/mine/fleet/addBinding');
- // uni.$u.route('/pages/mine/fleet/addBinding', {
- // data: JSON.stringify(this.dataDetails),
- // });
- },
- leave(){
- this.tipsShow = true
- },
- cancelClick(){
- this.tipsShow = false
- },
- confirmClick(){
- let that = this
- uni.showLoading({
- mask: true,
- title: '加载中'
- })
- this.tipsShow = false
- this.$request.baseRequest('post', '/hyBindCarCaptainInfo/api/unbinding', {id:this.fleetInfo.id}).then(res => {
- if (res.code == 200) {
- uni.hideLoading()
- that.getInfo()
- this.$refs.uToast.show({
- type: 'success',
- message: "解绑成功!",
- complete() {}
- })
- } else {
- uni.hideLoading()
- uni.$u.toast(res.message);
- }
- })
- .catch(res => {
- uni.hideLoading()
- uni.$u.toast(res.message);
- });
- },
- getInfo(){
- this.$request.baseRequest('get', '/hyBindCarCaptainInfo/getBindCarCaptain', {
- commonId:this.userInfo.id
- }).then(res => {
- if (res.code == 200) {
- if(res.data){
- this.fleetInfo = res.data
- }
- } else {
- uni.$u.toast(res.message);
- }
- })
- .catch(res => {
- uni.hideLoading()
- uni.$u.toast(res.message);
- });
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .center{
- padding: 20rpx 30rpx;
-
- }
- .fleetInfo{
- display: flex;
- width: 100%;
- margin-top: 30rpx;
- .fleetInfo_name{
- width: 50%;
- }
- .fleetInfo_phone{
- width: 50%;
- text-align: right;
- }
- }
- .btn_css{
- display: flex;
- margin-top: 30rpx;
- .btn_item{
- width: 120rpx;
- margin-right: 20rpx;
- }
- }
- .red_char{
- color: #f05458;
- font-size: 28rpx;
- margin-top: 30rpx;
- }
- </style>
|