yangan
2024-09-06 7e7e77134aa0324993ce7d9db9884eab4d8f98fe
pages/customer-page/customer-my/customer-my.vue
@@ -59,10 +59,10 @@
               </view>
            </view>
         </view>
         <view class="personal-information-block">
         <!-- <view class="personal-information-block">
            <view class="block-main">
               <view class="huodai">
                  <combined-title title="我的货代"
                  <combined-title title="我的承运商"
                     @rightText="addHuoDai">
                     <template v-slot:rightText>
                        <text>添加</text>
@@ -90,7 +90,7 @@
                  </view>
               </view>
            </view>
         </view>
         </view> -->
         <view class="personal-information-block">
            <view class="block-main">
               <view class="fleet-container">
@@ -129,7 +129,7 @@
         <view class="statistics"><u-button text="用户管理"
               type="primary"
               @click="userManage"
               v-if="roleType == 1 && userEntity.isHostUser === '0'"></u-button></view>
               v-if="roleType == 1 && userInfo.isHostUser === 0"></u-button></view>
         <view class="logout"><u-button text="修改密码"
               type="primary"
               @click="modifyPwd"></u-button></view>
@@ -139,6 +139,9 @@
         <view class="logout"><u-button text="退出登录"
               type="primary"
               @click="logout()"></u-button></view>
         <view class="logout"><u-button text="联系我们"
               type="primary"
               @click="contactUs()"></u-button></view>
      </view>
      <u-toast ref="uToast"></u-toast>
      <!-- 新建车队弹出框 -->
@@ -171,8 +174,7 @@
                  @click="addNewGroupClick"></u-button></view>
         </u-popup>
      </view>
      <!-- 删除货代模态框 -->
      <!-- 删除承运商模态框 -->
      <view class="deleteHuoDaiModal">
         <u-modal :show="deleteHuoDaiShow"
            :title="deleteHuoDaiTitle"
@@ -209,6 +211,7 @@
</template>
<script>
   import { BaseUrl } from '@/api/publicInterface.js'
   import combinedTitle from '@/components/combined-title/combined-title.vue';
   import { customerId, redirectLogin } from '@/utils/status';
   export default {
@@ -231,8 +234,8 @@
            options1: [{
               text: '删除'
            }],
            // 删除货代模态框
            deleteHuoDaiId: null, // 删除货代id
            // 删除承运商模态框
            deleteHuoDaiId: null, // 删除承运商id
            deleteHuoDaiShow: false,
            deleteHuoDaiTitle: '',
            deleteHuoDaiContent: '',
@@ -249,12 +252,16 @@
            userEntity: {},
            initPwdShow: false,
            modifyPwdShow: false,
            passwordModified: ''
            passwordModified: '',
            phoneList:[]
         };
      },
      computed: {
         roleType() {
            return uni.getStorageSync('roleType');
         },
         userInfo(){
               return uni.getStorageSync('userInfo');
         }
      },
      methods: {
@@ -266,6 +273,44 @@
            this.getAllHuoDaiByCustomerId();
            this.getFleet();
            this.getUserEntity();
            uni.request({
               url:  `${BaseUrl}/admin/dict/page`,
               method: 'GET',
               data: {
                  dictType:'Setings'
               },
               header: {
                  Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'),
                  clientToc: 'Y',
                  'CLIENT_TOC': 'Y',
               },
               success: res => {
                  let dictId=res.data.data?.records[0].id
                  uni.request({
                     url:  `${BaseUrl}/admin/dict/item/page`,
                     method: 'GET',
                     data: {
                        dictId:dictId
                     },
                     header: {
                        Authorization: 'Bearer' + ' ' + uni.getStorageSync('token'),
                        clientToc: 'Y',
                        'CLIENT_TOC': 'Y',
                     },
                     success: res => {
                        res.data.data.records.forEach(item=>{
                           if(item.description.includes('联系')){
                              this.phoneList=item.value.split(',')
                           }
                        })
                     },
                     fail: err => {
                     }
                  })
               },
               fail: err => {
               }
               })
         },
         getUserEntity() {
            uni.showLoading({
@@ -285,7 +330,7 @@
               this.BuyCardData = res.data;
            });
         },
         // 获取货代列表
         // 获取承运商列表
         getAllHuoDaiByCustomerId() {
            uni.showLoading({
               title: '加载中...'
@@ -305,16 +350,16 @@
               this.fleetData = res.data;
            });
         },
         // 添加货代
         // 添加承运商
         addHuoDai() {
            uni.navigateTo({
               url: '/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver?role=1' // 1代表的是货代
               url: '/pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver?role=1' // 1代表的是承运商
            });
         },
         // 添加购买证
         addGouMai(){
            uni.navigateTo({
               url: '/pages/customer-page/addTo-freightForwarder-purchasePermit/addTo-freightForwarder-purchasePermit'
               url: '/subPages/addTo-freightForwarder-purchasePermit/addTo-freightForwarder-purchasePermit'
            });
         },
         // 添加车队
@@ -355,14 +400,14 @@
               });
            this.updateGroupShow = false;
         },
         // 删除货代
         // 删除承运商
         deleteHuoDaiClick(args) {
            console.log(args, '货代id');
            console.log(args, '承运商id');
            this.deleteHuoDaiId = args.name;
            this.deleteHuoDaiShow = true;
            this.huoDaiData.forEach(item => {
               if (item.userId == this.deleteHuoDaiId) {
                  this.deleteHuoDaiContent = '确认删除货代' + item.name + '吗?';
                  this.deleteHuoDaiContent = '确认删除承运商' + item.name + '吗?';
               }
            });
         },
@@ -426,7 +471,7 @@
                  this.getFleet();
               });
         },
         // 货代详情
         // 承运商详情
         toFreightForwarderDetails(userId) {
            uni.navigateTo({
               url: `/pages/customer-page/freight-forwarder-details/freight-forwarder-details?userId=${userId}`
@@ -441,6 +486,19 @@
         logout() {
            this.logoutShow = true;
         },
         contactUs(){
            uni.showActionSheet({
               itemList: this.phoneList,
               success: (res) => {
               uni.makePhoneCall({
                  phoneNumber:this.phoneList[res.tapIndex].split(":")[1]
               })
            },
            fail: (err) => {
               console.log('弹窗取消');
            }
            });
         },
         logoutConfirm() {
            redirectLogin();
            this.$store.commit('changeisLogin', false)