qingyiay
2023-03-24 09c2ac7911db8993b6b435cb5af23fcf69c0fbe2
pages/customer-page/customer-my/customer-my.vue
@@ -10,7 +10,7 @@
            <u-swipe-action>
               <u-cell-group :border="false">
                  <u-swipe-action-item :options="options1" v-for="(item, index) in huoDaiData" :index="index" :name="item.userId" :key="index" @click="deleteHuoDaiClick">
                     <u-cell :title="item.name" value="详情" @click="toFreightForwarderDetails(item.id)"></u-cell>
                     <u-cell :title="item.name" value="详情" @click="toFreightForwarderDetails(item.userId)"></u-cell>
                  </u-swipe-action-item>
               </u-cell-group>
            </u-swipe-action>
@@ -131,25 +131,27 @@
   },
   methods: {
      init() {
         uni.showLoading({
            title: '加载中...'
         });
         this.getAllHuoDaiByCustomerId();
         this.getFleet();
         uni.hideLoading();
      },
      // 获取货代列表
      getAllHuoDaiByCustomerId() {
         uni.showLoading({
            title: '加载中...'
         });
         this.$reqGet('getAllHuoDaiByCustomerId').then(res => {
            uni.hideLoading();
            this.huoDaiData = res.data;
            console.log('货代列表', res);
         });
      },
      // 获取车队列表
      getFleet() {
         this.$reqGet('getFleet', { customerId }).then(res => {
         uni.showLoading({
            title: '加载中...'
         });
         this.$reqGet('getFleet').then(res => {
            uni.hideLoading();
            this.fleetData = res.data;
            console.log('车队列表', res);
         });
      },
      // 添加货代
@@ -160,7 +162,6 @@
      },
      // 添加车队
      addFleet() {
         console.log('添加车队');
         this.updateGroupShow = true;
      },
      addNewFleetPopupClose() {
@@ -177,8 +178,12 @@
         // 新建车队
         this.$reqPost('saveFleet', this.addGroupForm, 'params').then(res => {
            uni.hideLoading();
            console.log('新建车队', res);
            this.getFleet();
            if (res.code == 0) {
               this.$u.toast('添加成功');
               this.getFleet();
            } else {
               this.$u.toast(res.data ? res.data : '添加失败');
            }
         });
         this.updateGroupShow = false;
      },
@@ -248,9 +253,9 @@
         });
      },
      // 货代详情
      toFreightForwarderDetails(id) {
      toFreightForwarderDetails(userId) {
         uni.navigateTo({
            url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details`
            url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details?userId=${userId}`
         });
      },
      // 车队详情