付延余
2023-03-16 1ab29b3567574a721bd37d5ff9d7e9db386272d6
thirdCommit
18个文件已修改
1个文件已添加
893 ■■■■■ 已修改文件
api/globalApi.js 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/publicInterface.js 147 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manifest.json 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 41 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/customer-index.vue 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-my/customer-my.vue 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/appointment/appointment.vue 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/driver-index.vue 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/drvier-my/drvier-my.vue 159 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue 78 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.vue 56 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/userPassword.vue 67 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/wxLogin.vue 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/public-page/forward/forward.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/register/register.vue 179 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
store/index.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/globalApi.js
@@ -1,4 +1,10 @@
export const globalApi = {
    // 绑定微信
    wxBind:{
        url:'/wrzs/social/bind',
        method:"POST"
    },
    //    提煤单
    //    获取发运计划列表
    GetOrderPlan: {
api/publicInterface.js
@@ -3,77 +3,46 @@
// const BaseUrl = "http://192.168.3.159:9999/";
import {BaseUrl as wrBaseUrl} from '@/api/request.js'
// const BaseUrl = "http://192.168.0.120:9999"
const BaseUrl = "http://192.168.0.120:9999"
// 登录
function apiLogin({
    code
}) {
    uni.showLoading({
        title: '登录中...',
    })
    return new Promise((resolve, reject) => {
        uni.request({
            url: BaseUrl + "/wrzs/wx/login",
            method: "POST",
            data: {
                code
            },
            header: {
                // "TENANT-ID": "5",
                // "Authorization": "Basic cGlnOnBpZw==",
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            success: (res) => {
                uni.hideLoading();
                // console.log(res)
                resolve(res.data);
            },
            fail: (err) => {
                console.log('错误', err);
                uni.hideLoading();
                uni.showToast({
                    icon: 'none',
                    title: '服务器错误'
                })
            }
        })
    })
}
// function apiLogin({
//     code
// }) {
//     uni.showLoading({
//         title: '登录中...',
//     })
//     return new Promise((resolve, reject) => {
//         uni.request({
//             url: BaseUrl + "/wrzs/wx/login",
//             method: "POST",
//             data: {
//                 code
//             },
//             header: {
//                 // "TENANT-ID": "5",
//                 // "Authorization": "Basic cGlnOnBpZw==",
//                 'Content-Type': 'application/x-www-form-urlencoded'
//             },
//             success: (res) => {
//                 uni.hideLoading();
//                 // console.log(res)
//                 resolve(res.data);
//             },
//             fail: (err) => {
//                 console.log('错误', err);
//                 uni.hideLoading();
//                 uni.showToast({
//                     icon: 'none',
//                     title: '服务器错误'
//                 })
//             }
//         })
//     })
// }
function apiLogin2({
    code
}) {
    uni.showLoading({
        title: '加载中...'
    })
    return new Promise((resolve, reject) => {
        uni.request({
            url: BaseUrl + "/wrzs/wx/login2",
            method: "POST",
            data: {
                code
            },
            header: {
                'Content-Type': 'application/x-www-form-urlencoded'
            },
            success: (res) => {
                uni.hideLoading();
                resolve(res.data)
            },
            fail: (err) => {
                console.log('错误', err);
                uni.hideLoading();
                uni.showToast({
                    icon: 'none',
                    title: '服务器错误'
                })
            }
        })
    })
}
// 注册
@@ -130,6 +99,7 @@
    })
}
// 获取token
function apiLoginPassword({
    username,
@@ -170,6 +140,45 @@
}
// 微信小程序一键登录
function apiLoginWx({
    code
}) {
    uni.showLoading({
        title: '加载中...'
    })
    return new Promise((resolve, reject) => {
        uni.request({
            url: BaseUrl + '/admin/oauth2/token',
            method: "POST",
            data: {
                grant_type:'mobile',
                mobile:`MINI@${code}`,
                code
            },
            header: {
                "Authorization": 'Basic c29jaWFsOnNvY2lhbA==', //app:app
                'content-type': 'application/x-www-form-urlencoded',
                "CLIENT_TOC": "Y",
                "isToken": "false"
            },
            success: (res) => {
                uni.hideLoading();
                resolve(res.data)
            },
            fail: (err) => {
                console.log('错误', err);
                uni.hideLoading();
                uni.showToast({
                    icon: 'none',
                    title: '服务器错误'
                })
            }
        })
    })
}
// 获取流程数据
// export const getProcessDataList = (params) => {
@@ -178,8 +187,8 @@
export {
    apiLogin,
    apiLogin2,
    apiLoginWx,
    apiRegister,
    apiLoginPassword
    apiLoginPassword,
    BaseUrl
}
manifest.json
@@ -50,7 +50,7 @@
    "quickapp" : {},
    /* 小程序特有相关 */
    "mp-weixin" : {
        "appid" : "wx30f254cbb0b90b3c",
        "appid" : "wx4a62fc1684c429a9",
        "setting" : {
            "urlCheck" : false,
            "es6" : true,
pages.json
@@ -126,26 +126,29 @@
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/driver-page/driver-index/bill-of-lading-details/coal-pick-up-bill/coal-pick-up-bill",
            "style": {
                "navigationBarTitleText": "提煤单",
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice",
            "style": {
                "navigationBarTitleText": "称重",
                "enablePullDownRefresh": false
            }
        }, {
            "path": "pages/login/wxLogin",
            "style": {
                "navigationBarTitleText": "",
                "enablePullDownRefresh": false
            }
        }
        ,{
            "path" : "pages/driver-page/driver-index/bill-of-lading-details/coal-pick-up-bill/coal-pick-up-bill",
            "style" :
            {
                "navigationBarTitleText": "提煤单",
                "enablePullDownRefresh": false
            }
        }
        ,{
            "path" : "pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice",
            "style" :
            {
                "navigationBarTitleText": "称重",
                "enablePullDownRefresh": false
            }
        }
    ],
    ],
    "tabBar": {
        // "color": "#999794",
        // "selectedColor": "#007AFF",
pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue
@@ -63,16 +63,18 @@
            }
        },
        // 邀请货代
        bindHuoDai() {
        bindHuoDai() {
            // this.$reqPost('bindHuoDai', { customerId: this.customerId, name: this.name, phone: this.phone }, 'params').then(res => {
            this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }).then(res => {
            this.$reqPost('bindHuoDai', { name: this.name, phone: this.phone }, 'params').then(res => {
                if (res.code == 0) {
                    this.$u.toast(res.msg ? res.msg : res.data);
                    this.$u.toast('添加成功');
                    setTimeout(() => {
                        uni.navigateBack({
                            delta: 1
                        });
                    }, 1000);
                } else {
                    this.$u.toast(res.msg ? res.msg : '未成功添加');
                }
                console.log('邀请货代', res);
            });
@@ -82,7 +84,7 @@
            this.$reqPost('bindUserFleet', { fleetId: this.fleetId, name: this.name, phone: this.phone, carNo: this.carNo }, 'params').then(res => {
                console.log('邀请司机', res);
                if (res.code == 0) {
                    this.$u.toast(res.data?res.data:'操作成功');
                    this.$u.toast(res.data ? res.data : '操作成功');
                    uni.navigateBack({
                        delta: 1
                    });
pages/customer-page/customer-index/customer-index.vue
@@ -1,6 +1,7 @@
<template>
    <view class="customer-index">
        <view class="customer-index-body">
            <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" textSize="30" iconSize="1000" v-if="orderPlanData.length == 0"></u-empty>
            <card v-for="(item, index) in orderPlanData" :key="index" :name="item.id" @click="cardBodyClick">
                <template v-slot:left>
                    <view class="card-left__top">
@@ -86,11 +87,12 @@
        },
        // 获取发运计划列表
        GetOrderPlan() {
            // this.$reqGet('GetOrderPlan', { customerId: customerId }).then(res => {
            //     this.orderPlanData = res.data;
            // });
            uni.showLoading({
                title: '加载中...'
            });
            this.$reqGet('GetOrderPlan').then(res => {
                this.orderPlanData = res.data;
                uni.hideLoading()
            });
        },
        // 领取点击
@@ -152,7 +154,7 @@
        // 转发
        forwardClick(obj) {
            uni.navigateTo({
                url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNum=${obj.carNum}`
                url: `/pages/public-page/forward/forward?orderPlanId=${obj.id}&carNum=${obj.cars2}`
            });
        }
    }
pages/customer-page/customer-index/fayunPlanDetails/fayunPlanDetails.vue
@@ -42,6 +42,9 @@
            orderPlanDetail: {}
        };
    },
    onShow(){
        this.init();
    },
    methods: {
        init() {
            this.GetOrderPlanDetail();
pages/customer-page/customer-my/customer-my.vue
@@ -9,7 +9,7 @@
            <view class="huodai-list">
                <u-swipe-action>
                    <u-cell-group :border="false">
                        <u-swipe-action-item :options="options1" v-for="(item, index) in huoDaiData" :index="index" :name="item.id" :key="index" @click="deleteHuoDaiClick">
                        <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-swipe-action-item>
                    </u-cell-group>
@@ -26,7 +26,7 @@
                <u-swipe-action>
                    <u-cell-group :border="false">
                        <u-swipe-action-item :options="options1" v-for="(item, index) in fleetData" :index="index" :name="item.id" :key="index" @click="deleteFleetClick">
                            <u-cell :title="item.name" value="25辆" @click="tofleetDetails(item.id)"></u-cell>
                            <u-cell :title="item.name" :value="item.userSijisum + '辆'" @click="tofleetDetails(item.id)"></u-cell>
                        </u-swipe-action-item>
                    </u-cell-group>
                </u-swipe-action>
@@ -90,7 +90,7 @@
<script>
import combinedTitle from '@/components/combined-title/combined-title.vue';
import { customerId ,redirectLogin} from '@/utils/status';
import { customerId, redirectLogin } from '@/utils/status';
export default {
    components: {
        combinedTitle
@@ -140,7 +140,7 @@
        },
        // 获取货代列表
        getAllHuoDaiByCustomerId() {
            this.$reqGet('getAllHuoDaiByCustomerId', { customerId }).then(res => {
            this.$reqGet('getAllHuoDaiByCustomerId').then(res => {
                this.huoDaiData = res.data;
                console.log('货代列表', res);
            });
@@ -184,12 +184,12 @@
        },
        // 删除货代
        deleteHuoDaiClick(args) {
            console.log(args.name, '货代id');
            console.log(args, '货代id');
            this.deleteHuoDaiId = args.name;
            this.deleteHuoDaiShow = true;
            this.huoDaiData.forEach(item => {
                if (item.id == this.deleteHuoDaiId) {
                    this.deleteHuoDaiContent = '确认删除货代' + item.huoDaiName;
                if (item.userId == this.deleteHuoDaiId) {
                    this.deleteHuoDaiContent = '确认删除货代' + item.name + '吗?';
                }
            });
        },
@@ -207,9 +207,13 @@
            this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params').then(res => {
                uni.hideLoading();
                if (res.code == 0) {
                    this.$u.toast('删除成功');
                    if (res.data) {
                        this.$u.toast('删除成功');
                        this.getAllHuoDaiByCustomerId();
                    } else {
                        this.$u.toast('删除失败');
                    }
                }
                this.getAllHuoDaiByCustomerId();
            });
        },
        // 删除车队
@@ -259,7 +263,7 @@
            this.logoutShow = true;
        },
        logoutConfirm() {
            redirectLogin()
            redirectLogin();
        },
        logoutCancel() {
            this.logoutShow = false;
pages/driver-page/appointment/appointment.vue
@@ -30,8 +30,15 @@
    },
    data() {
        return {
            takeCoalId: null,
            yuYueId: null,
            yuYueListParams: {
                filedId: '',
                deptId: '',
                sendDate: ''
            },
            yuYuePostParams:{
                takeCoalId: null,
                yuYueId: null,
            },
            yuYueData: [],
            isRCSQ: false, // 入场申请接口控制
            rcsqData: {
@@ -50,7 +57,10 @@
            this.isRCSQ = true;
            this.rcsqData.originalYyId = params.yyId;
        }
        this.takeCoalId = params.takeCoalId;
        this.yuYuePostParams.takeCoalId = params.takeCoalId;
        this.yuYueListParams.filedId = params.filedId;
        this.yuYueListParams.deptId = params.deptId;
        this.yuYueListParams.sendDate = params.sendDate;
    },
    onShow() {
        this.init();
@@ -64,7 +74,7 @@
            uni.showLoading({
                title: '加载中...'
            });
            this.$reqGet('yuYueList').then(res => {
            this.$reqGet('yuYueList', this.yuYueListParams).then(res => {
                uni.hideLoading();
                if (res.code == 0) {
                    this.yuYueData = res.data;
@@ -74,7 +84,7 @@
        // 预约和入场申请共用事件
        yuYueBtnClick(value) {
            if (this.isRCSQ) {
                this.rcsqData.taskId = this.takeCoalId;
                this.rcsqData.taskId = this.yuYuePostParams.takeCoalId;
                this.saveRCSQ(value);
            } else {
                this.yuYueClick(value.id);
@@ -82,8 +92,8 @@
        },
        // 预约
        yuYueClick(id) {
            this.yuYueId = id;
            this.$reqPost('yuYue', { takeCoalId: this.takeCoalId, yuYueId: this.yuYueId }, 'params').then(res => {
            this.yuYuePostParams.yuYueId = id;
            this.$reqPost('yuYue', { takeCoalId: this.yuYuePostParams.takeCoalId, yuYueId: this.yuYuePostParams.yuYueId }, 'params').then(res => {
                if (res.code == 0) {
                    this.$u.toast('预约成功!');
                }
pages/driver-page/driver-index/driver-index.vue
@@ -3,6 +3,13 @@
        <view class="driver-index-body">
            <!-- 待领取提煤单 -->
            <combined-title title="待领取"></combined-title>
            <u-empty
                mode="data"
                icon="http://cdn.uviewui.com/uview/empty/data.png"
                textSize="30"
                iconSize="1000"
                v-if="driverBillOfLoadingData.list1 ? (driverBillOfLoadingData.list1.length == 0 ? true : false) : true"
            ></u-empty>
            <card v-for="(item, index) in driverBillOfLoadingData.list1" :key="index" :name="item.id" backgroundType="2">
                <template v-slot:left>
                    <view class="card-left__top">
@@ -34,6 +41,23 @@
            <combined-title title="我的提煤单"></combined-title>
            <!-- 卡片 -->
            <!-- <view v-for="(item, index) in driverBillOfLoadingData.list2" :key="index"> -->
            <u-empty
                mode="data"
                icon="http://cdn.uviewui.com/uview/empty/data.png"
                textSize="30"
                iconSize="1000"
                v-if="
                    driverBillOfLoadingData.list2
                        ? driverBillOfLoadingData.list2.length == 0
                            ? true
                            : false
                        : true && driverBillOfLoadingData.list3
                        ? driverBillOfLoadingData.list3.length == 0
                            ? true
                            : false
                        : true
                "
            ></u-empty>
            <view>
                <!-- 待预约提煤单 -->
                <view class="daiYuYue" v-for="(item, index) in driverBillOfLoadingData.list3" :key="index">
@@ -45,7 +69,7 @@
                        <view>{{ item.coalName }}</view>
                        <view>已预约:{{ item.cars }} 车</view>
                    </view>
                    <view><u-button text="预约" type="primary" @click="toAppointmentClick(item.id)"></u-button></view>
                    <view><u-button text="预约" type="primary" @click="toAppointmentClick(item)"></u-button></view>
                </view>
                <!-- 已预约提煤单 -->
                <view @click="list3CardIconClick(item)" class="haveYuYue" v-for="(item, index) in driverBillOfLoadingData.list2" :key="index">
@@ -68,6 +92,7 @@
<script>
import { customerId } from '@/utils/status';
export default {
    data() {
        return {
@@ -116,9 +141,9 @@
            });
        },
        // 去预约
        toAppointmentClick(id) {
        toAppointmentClick(value) {
            uni.navigateTo({
                url: `/pages/driver-page/appointment/appointment?takeCoalId=${id}`
                url: `/pages/driver-page/appointment/appointment?takeCoalId=${value.id}&filedId=${value.filedId}&deptId=${value.deptId}&sendDate=${value.sendDate}`
            });
        }
    }
pages/driver-page/drvier-my/drvier-my.vue
@@ -1,6 +1,6 @@
<template>
    <view class="driver-my">
        <view class="jifen">
        <!-- <view class="jifen">
            <view class="zheng">
                <image src="../../../static/image/无人值守/组 38_1.png"></image>
                <view class="font">
@@ -15,7 +15,7 @@
                    <view class="font-bottom">负积分</view>
                </view>
            </view>
        </view>
        </view> -->
        <view class="personal-information-form">
            <u--form labelPosition="left" :model="userInfo" ref="form1">
@@ -34,68 +34,92 @@
                <u-form-item labelWidth="20%" label="体重" ref="item1">
                    <u--input v-model="userInfo.weight" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
                </u-form-item>
                <u-form-item labelWidth="20%" label="车轴数" ref="item1">
                    <u--input v-model="userInfo.carNo" border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
                <u-form-item v-model="userInfo.axleNum" labelWidth="20%" label="车轴数" ref="item1">
                    <u--input border="none" inputAlign="right" disabled disabledColor="#fff"></u--input>
                </u-form-item>
                <u-form-item labelWidth="20%" label="车辆照片" ref="item1">
                    <!-- <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="10" disabled></u-upload> -->
                    <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="imageClick(0)"></u--image>
                    <u--image :showLoading="true" :src="BaseUrl + userInfo.carImg" width="80px" height="80px" @click="imageClick(1)"></u--image>
                </u-form-item>
                <u-form-item labelWidth="20%" label="行驶证照片" ref="item1">
                    <!-- <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="10" disabled></u-upload> -->
                    <u--image :showLoading="true" :src="src" width="80px" height="80px" @click="imageClick(1)"></u--image>
                <u-form-item labelWidth="25%" label="行驶证照片" ref="item1">
                    <u--image :showLoading="true" :src="BaseUrl + userInfo.drivingImg" width="80px" height="80px" @click="imageClick(2)"></u--image>
                </u-form-item>
            </u--form>
            <view class="push-information-button"><u-button text="修改个人资料" type="primary" @click="editBtnClick"></u-button></view>
            <view class="push-information-button">
                <u-button text="退出登录" type="primary" @click="logout"></u-button>
                <u-button text="修改个人资料" type="primary" @click="editBtnClick"></u-button>
            </view>
        </view>
        <!-- 图片预览弹出框 -->
        <view class="previewImage-container">
            <u-popup :show="previewImageShow" mode="center" @close="previewImageClose" @open="previewImageOpen">
                <u--image :src="previewImageSrc" width="200px" height="200px"></u--image>
                <u--image :src="BaseUrl + previewImageSrc" width="400px" height="400px"></u--image>
            </u-popup>
        </view>
        <!-- 修改弹出框 -->
        <view class="editDriverPopup-container">
            <u-popup :show="editDriverPopupShow" mode="bottom" @close="editDriverPopupClose" @open="editDriverPopupOpen">
            <u-popup :show="editDriverPopupShow" mode="bottom" @close="editDriverPopupClose" @open="editDriverPopupOpen" :closeable="true">
                <combined-title title="修改个人信息" style="margin-left:20rpx"></combined-title>
                <view class="editDriverPopup-container-box">
                    <u--form labelPosition="left" :model="userInfo" ref="form1">
                        <u-form-item labelWidth="20%" label="姓名" ref="item1"><u--input v-model="userInfo.name" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="身份证号" ref="item1"><u--input v-model="userInfo.idCard" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="手机号" ref="item1"><u--input v-model="userInfo.phone" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="车牌号" ref="item1"><u--input v-model="userInfo.carNo" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="体重" ref="item1"><u--input v-model="userInfo.weight" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="车轴数" ref="item1"><u--input v-model="userInfo.carCS" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="车辆照片" ref="item1">
                            <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="10"></u-upload>
                    <u--form labelPosition="left" :model="editUserInfo" ref="form1">
                        <u-form-item labelWidth="20%" label="姓名" ref="item1"><u--input v-model="editUserInfo.name" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="身份证号" ref="item1"><u--input v-model="editUserInfo.idCard" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="手机号" ref="item1"><u--input v-model="editUserInfo.phone" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="车牌号" ref="item1"><u--input v-model="editUserInfo.carNo" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="体重" ref="item1"><u--input v-model="editUserInfo.weight" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="20%" label="车轴数" ref="item1"><u--input v-model="editUserInfo.axleNum" border="none" inputAlign="left"></u--input></u-form-item>
                        <u-form-item labelWidth="25%" label="车辆照片" ref="item1">
                            <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="1" width="250" height="150"></u-upload>
                        </u-form-item>
                        <u-form-item labelWidth="20%" label="行驶证照片" ref="item1">
                            <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="10"></u-upload>
                        <u-form-item labelWidth="25%" label="行驶证照片" ref="item1">
                            <u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" multiple :maxCount="1" width="250" height="150"></u-upload>
                        </u-form-item>
                    </u--form>
                    <u-button text="提交" @click="updateUser" type="primary"></u-button>
                </view>
            </u-popup>
        </view>
        <view class="logoutModel">
            <u-modal :show="logoutShow" :title="logoutTitle" showCancelButton :content="logoutContent" @confirm="logoutConfirm" @cancel="logoutCancel"></u-modal>
        </view>
    </view>
</template>
<script>
import { customerId, userInfo } from '@/utils/status';
import { customerId, userInfo, redirectLogin } from '@/utils/status';
import { BaseUrl } from '@/api/publicInterface.js';
export default {
    data() {
        return {
            userInfo: {
                carCS:'',
            // 获取的司机详情
            userInfo: {},
            // 修改司机详情
            editUserInfo: {
                phone: '',
                name: '',
                username: '',
                type: 3,
                idCard: '',
                carNo: '',
                carImg: '',
                drivingImg: '',
                axleNum: '',
                weight: ''
            },
            src: 'https://cdn.uviewui.com/uview/album/1.jpg',
            src: '',
            fileList1: [],
            fileList2: [],
            // 修改信息弹出框
            editDriverPopupShow: false,
            // previewImage
            previewImageShow: false,
            previewImageSrc: 'https://cdn.uviewui.com/uview/album/1.jpg'
            previewImageSrc: '',
            // 退出模态框
            logoutShow: false,
            logoutTitle: '提示',
            logoutContent: '是否确认退出',
            BaseUrl
        };
    },
    onShow() {
@@ -103,7 +127,6 @@
    },
    methods: {
        init() {
            // this.getUserById();
            this.getUserEntity();
        },
        getUserEntity() {
@@ -114,18 +137,14 @@
                console.log(res, '司机详情');
                uni.hideLoading();
                this.userInfo = res.data;
                Object.keys(this.editUserInfo).map(item => {
                    console.log(res.data[item]);
                    if (res.data[item]) {
                        this.editUserInfo[item] = res.data[item];
                    }
                });
            });
        },
        // 获取用户信息
        // getUserById() {
        //     uni.showLoading({
        //         title: '加载中...'
        //     });
        //     this.$reqPost('getUserById', { id: customerId }, 'params').then(res => {
        //         uni.hideLoading();
        //         this.userInfo = res.data;
        //     });
        // },
        // 修改按钮点击
        editBtnClick() {
            this.editDriverPopupShow = true;
@@ -133,7 +152,14 @@
        imageClick(index) {
            // 通过index切换图片
            console.log('切换图片', index);
            this.previewImageShow = true;
            if (index == 1) {
                this.previewImageSrc = this.userInfo.carImg;
            } else {
                this.previewImageSrc = this.userInfo.drivingImg;
            }
            this.$nextTick(() => {
                this.previewImageShow = true;
            });
        },
        // 删除
        deletePic(event) {
@@ -152,7 +178,7 @@
                });
            });
            for (let i = 0; i < lists.length; i++) {
                const result = await this.uploadFilePromise(lists[i].url);
                const result = await this.uploadFilePromise(lists[i].url, event.name);
                let item = this[`fileList${event.name}`][fileListLen];
                this[`fileList${event.name}`].splice(
                    fileListLen,
@@ -166,19 +192,22 @@
                fileListLen++;
            }
        },
        uploadFilePromise(url) {
        uploadFilePromise(url, num) {
            return new Promise((resolve, reject) => {
                let a = uni.uploadFile({
                    url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
                    url: BaseUrl + '/admin/sys-file/uploadUnToken', // 仅为示例,非真实的接口地址
                    filePath: url,
                    name: 'file',
                    formData: {
                        user: 'test'
                    },
                    // formData: {
                    //     user: 'test'
                    // },
                    success: res => {
                        setTimeout(() => {
                            resolve(res.data.data);
                        }, 1000);
                        resolve(JSON.parse(res.data).data.url);
                        if (num == 1) {
                            this.editUserInfo.carImg = JSON.parse(res.data).data.url;
                        } else if (num == 2) {
                            this.editUserInfo.drivingImg = JSON.parse(res.data).data.url;
                        }
                    }
                });
            });
@@ -203,12 +232,12 @@
        },
        // 修改用户信息
        updateUser() {
            this.$reqPost('updateUser', this.userInfo, 'params').then(res => {
            this.$reqPost('updateUser', this.editUserInfo, 'json').then(res => {
                console.log('更新数据', res);
                this.editDriverPopupShow = false;
                if (res.code == 0) {
                    this.$u.toast('修改成功');
                    this.getUserById();
                    this.init();
                } else {
                    uni.showToast({
                        title: res.msg,
@@ -217,6 +246,15 @@
                    });
                }
            });
        },
        logout() {
            this.logoutShow = true;
        },
        logoutConfirm() {
            redirectLogin();
        },
        logoutCancel() {
            this.logoutShow = false;
        }
    }
};
@@ -289,10 +327,16 @@
    }
    // 表单
    .personal-information-form {
        margin-top: vww(24);
        // margin-top: vww(24);
        .push-information-button {
            display: flex;
            margin: vww(20) auto 0;
            width: 80%;
            .u-button {
                &:nth-of-type(2) {
                    margin-left: vww(10);
                }
            }
        }
    }
@@ -305,13 +349,22 @@
        .u-popup {
            .u-transition {
                height: 95%;
                .u-popup__content {
                    overflow: scroll !important;
                    .editDriverPopup-container-box {
                        width: 90%;
                        margin: 0 auto;
                    }
                    //closeIcon
                    .u-popup__content__close--top-right {
                        top: vww(20) !important;
                        .u-icon {
                            .u-icon__icon {
                                font-size: vww(20) !important;
                            }
                        }
                    }
                }
            }
        }
pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue
@@ -1,10 +1,11 @@
<template>
    <view class="freightForwarder-index">
        <view class="freightForwarder-index-body">
            <u-empty mode="data" icon="http://cdn.uviewui.com/uview/empty/data.png" textSize="30" iconSize="1000" v-if="orderPlanData.length == 0"></u-empty>
            <card v-for="(item, index) in orderPlanData" :key="index" :name="item.id" @click="cardBodyClick" backgroundType="1">
                <template v-slot:left>
                    <view class="card-left__top">
                        <text>{{ item.orderPlan.cars }}</text>
                        <text>{{ item.carNum }}</text>
                        张
                    </view>
                    <view class="card-left__utils"><u-button text="转发" type="primary" @tap.stop="forwardClick(item.id)" shape="circle"></u-button></view>
@@ -13,17 +14,17 @@
                    <view class="right-top">
                        <view class="card-right-top-row">
                            <view>
                                <text>{{ item.orderPlan.compName }}</text>
                                <text>{{ item.deptName||'' }}</text>
                            </view>
                            <view>
                                <text>{{ item.orderPlan.coalName }}</text>
                                <text>{{ item.coalName||'' }}</text>
                            </view>
                        </view>
                    </view>
                </template>
                <template v-slot:right-bottom>
                    <view class="code">
                        <text>编号:{{ item.orderPlan.code }}</text>
                        <text>编号:{{ item.orderCode||'' }}</text>
                    </view>
                </template>
            </card>
pages/freight-forwarder-page/freightForwarder-my/freightForwarder-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 fleetData" :index="index" :name="item.id" :key="index" @click="deleteFleetClick">
                            <u-cell :title="item.name" value="无" @click="tofleetDetails(item.id)"></u-cell>
                            <u-cell :title="item.name" :value="item.userSijisum + '辆'" @click="tofleetDetails(item.id)"></u-cell>
                        </u-swipe-action-item>
                    </u-cell-group>
                </u-swipe-action>
@@ -34,25 +34,53 @@
                <view class="addCarButton"><u-button text="添加" type="primary" @click="addNewGroupClick"></u-button></view>
            </u-popup>
        </view>
        <view class="utils"><u-button text="退出登录" type="primary" @click="logout"></u-button></view>
        <!-- 删除车队模态框 -->
        <view class="deleteFleetModal">
            <u-modal
                :show="deleteFleetShow"
                :title="deleteFleetTitle"
                @close="deleteFleetClose"
                @cancel="deleteFleetCancel"
                @confirm="deleteFleetConfirm"
                :closeOnClickOverlay="true"
                :showCancelButton="true"
            >
                <view class="slot-content"><rich-text :nodes="deleteFleetContent"></rich-text></view>
            </u-modal>
        </view>
        <view class="logoutModel">
            <u-modal :show="logoutShow" :title="logoutTitle" showCancelButton :content="logoutContent" @confirm="logoutConfirm" @cancel="logoutCancel"></u-modal>
        </view>
    </view>
</template>
<script>
import { redirectLogin } from '@/utils/status';
export default {
    data() {
        return {
            fleetData: [],
            // 新建车队
            addGroupForm: {
                name: '',
                wxUserId: uni.getStorageSync('userInfo').id
                name: ''
                // wxUserId: uni.getStorageSync('userInfo').id
            },
            updateGroupShow: false,
            options1: [
                {
                    text: '删除'
                }
            ]
            ],
            // 删除车队模态框
            deleteFleetId: null, // 删除车队id
            deleteFleetShow: false,
            deleteFleetTitle: '',
            deleteFleetContent: '',
            // 退出模态框
            logoutShow: false,
            logoutTitle: '提示',
            logoutContent: '是否确认退出'
        };
    },
    onShow() {
@@ -92,15 +120,51 @@
                }
            });
        },
        toFreightForwarderDetails() {
            uni.navigateTo({
                url: '/pages/customer-page/freight-forwarder-details/freight-forwarder-details'
        // 删除车队
        deleteFleetClick(args) {
            console.log(args.name, '车队id');
            this.deleteFleetId = args.name;
            this.deleteFleetShow = true;
            this.fleetData.forEach(item => {
                if (item.id == this.deleteFleetId) {
                    this.deleteFleetContent = '确认删除车队' + item.name;
                }
            });
        },
        deleteFleetClose() {
            this.deleteFleetShow = false;
        },
        deleteFleetCancel() {
            this.deleteFleetShow = false;
        },
        deleteFleetConfirm() {
            this.deleteFleetShow = false;
            uni.showLoading({
                title: '加载中...'
            });
            this.$reqPost('deleteFleet', { id: this.deleteFleetId }, 'params').then(res => {
                console.log('删除车队', res);
                if (res.code == 0) {
                    this.$u.toast('删除成功');
                }
                uni.hideLoading();
                this.getFleet();
            });
        },
        // 车队详情
        tofleetDetails(id) {
            uni.navigateTo({
                url: `/pages/customer-page/fleet-management/fleet-management?id=${id}`
            });
        },
        logout() {
            this.logoutShow = true;
        },
        logoutConfirm() {
            redirectLogin();
        },
        logoutCancel() {
            this.logoutShow = false;
        }
    }
};
pages/login/login.vue
@@ -2,7 +2,7 @@
    <view class="login">
        <view class="logo">无人值守</view>
        <!--用户名密码登录-->
        <user-password />
        <user-password :btnText='0'/>
        <!-- 微信openid登录 -->
        <view class="loginBtn">
            <u-button class="button" @click.stop="beforeLoginEvent" :disabled="btnLoading" :loading="btnLoading" type="primary" text="微信一键登录"></u-button>
@@ -24,20 +24,28 @@
                </view>
            </u-popup>
        </view>
        <!-- 询问是否绑定微信 -->
        <view class="bindWxModel">
            <u-modal :show="bindWxModelShow" :title="bindWxModelTitle" showCancelButton :content="bindWxContent" @confirm="bindWxConfirm" @cancel="bindWxCancel"></u-modal>
        </view>
    </view>
</template>
<script>
import { apiLogin, apiLogin2, apiLoginPassword } from '@/api/publicInterface.js';
import { apiLoginWx, apiLoginPassword } from '@/api/publicInterface.js';
import { mapMutations } from 'vuex';
import userPassword from './userPassword.vue';
import { setToken, setRefreshToken, setUsernameKey, setCustomerId, redirectHome } from '@/utils/status.js';
export default {
    data() {
        return {
            wxcode: '', // 司机1
            btnLoading: false,
            loginPopupShow: false
            loginPopupShow: false,
            // 绑定微信模态框
            bindWxModelShow: false,
            bindWxModelTitle: '提示',
            bindWxContent: '如果已拥有系统账号,可以直接跳转绑定微信页面'
        };
    },
    components: {
@@ -67,7 +75,7 @@
        },
        // 登录接口
        apiLogin() {
            // apiLogin2({ code: this.wxcode })
            // apiLoginWx({ code: this.wxcode })
            //     .then(res => {
            //         console.log('请求登录', res);
            //         if (res.msg == '需绑定') {
@@ -93,7 +101,7 @@
             */
            wx.request({
                url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx30f254cbb0b90b3c&secret=938a068410796cda21e5e03b9435cdbf&js_code=${this.wxcode}&grant_type=authorization_code`,
                url: `https://api.weixin.qq.com/sns/jscode2session?appid=wx4a62fc1684c429a9&secret=ee90afe376cdcec2fdd947c0a4db961a&js_code=${this.wxcode}&grant_type=authorization_code`,
                success(res) {
                    let id = res.data.openid;
                    uni.setStorageSync('openid', id);
@@ -103,7 +111,41 @@
                    });
                }
            });
            this.loginPopupShow = false
            this.$nextTick(() => {
                apiLoginWx({ code: uni.getStorageSync('openid') }).then(res => {
                    if (res.code != 1) {
                        this.$u.toast('恭喜您,登录成功!');
                        // 登陆成功,存储相关信息
                        setToken(res.access_token);
                        setRefreshToken(res.refresh_token);
                        setUsernameKey(res.username);
                        //查询用户详细信息并储存
                        this.$reqGet('getUserEntity').then(res => {
                            this.setUserTabbar(res.data.type);
                            uni.setStorageSync('roleType', res.data.type);
                            setCustomerId(res.data.customerid);
                            //跳转页面
                            this.$nextTick(() => {
                                redirectHome();
                            });
                        });
                    } else {
                        this.$u.toast(res.msg);
                        this.bindWxModelShow = true;
                    }
                });
            });
            this.loginPopupShow = false;
        },
        bindWxConfirm() {
            uni.navigateTo({
                url: `/pages/login/wxLogin?code=${uni.getStorageSync('openid')}`
            });
            this.bindWxModelShow = false;
        },
        bindWxCancel() {
            this.bindWxModelShow = false;
        },
        // 弹出层时间
        closePopup() {
pages/login/userPassword.vue
@@ -24,7 +24,7 @@
                ></u--input>
            </view>
        </view>
        <view class="loginBtn"><u-button type="primary" text="登录" @click="submit()"></u-button></view>
        <view class="loginBtn"><u-button type="primary" :text="btnText == 1 ? '绑定' : '登录'" @click="submit()"></u-button></view>
    </view>
</template>
@@ -34,11 +34,16 @@
import { setToken, setRefreshToken, setUsernameKey, setCustomerId, redirectHome } from '@/utils/status.js';
export default {
    name: 'userPassword',
    props: {
        //0:正常,1:微信绑定
        btnText: {
            type: Number,
            default: 0
        }
    },
    data() {
        return {
            // username: 'appUser',
            // username:'siJi1',
            username:'siJi2',
            username: '18812345677',
            password: '123456',
            remember: true,
            baseUrl: ''
@@ -48,6 +53,9 @@
        ...mapMutations(['setUserTabbar']),
        //登录
        async submit() {
            uni.showLoading({
                title: '登陆中...'
            });
            //表单校验
            if (this.username.length === 0) {
                this.$u.toast('请输入账号');
@@ -57,7 +65,7 @@
                this.$u.toast('请输入密码');
                return;
            }
            let grant_type = 'password'
            let grant_type = 'password';
            //登录接口
            await apiLoginPassword({
                username: this.username,
@@ -66,24 +74,45 @@
                scope: 'server'
            })
                .then(res => {
                    this.$u.toast('恭喜您,登录成功!');
                    // 登陆成功,存储相关信息
                    setToken(res.access_token);
                    setRefreshToken(res.refresh_token);
                    setUsernameKey(res.username);
                    //查询用户详细信息并储存
                    this.$reqGet('getUserEntity').then(res => {
                        this.setUserTabbar(res.data.type);
                        uni.setStorageSync('roleType', res.data.type);
                        setCustomerId(res.data.customerid);
                        //跳转页面
                    if (this.btnText == 0) {
                        if (res.code != 1) {
                            this.$u.toast('恭喜您,登录成功!');
                            // 登陆成功,存储相关信息
                            setToken(res.access_token);
                            setRefreshToken(res.refresh_token);
                            setUsernameKey(res.username);
                            //查询用户详细信息并储存
                            this.$reqGet('getUserEntity').then(res => {
                                this.setUserTabbar(res.data.type);
                                uni.setStorageSync('roleType', res.data.type);
                                setCustomerId(res.data.customerid);
                                uni.hideLoading();
                                //跳转页面
                                this.$nextTick(() => {
                                    redirectHome();
                                });
                            });
                        } else {
                            uni.hideLoading();
                            this.$u.toast(res.msg);
                        }
                    } else {
                        this.$nextTick(() => {
                            redirectHome();
                            this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('code') }, 'params').then(res => {
                                uni.hideLoading();
                                if (res.code == 0) {
                                    this.$u.toast('绑定成功!即将回到登录页!');
                                    setTimeout(() => {
                                        uni.navigateBack();
                                    }, 1000);
                                } else {
                                    this.$u.toast(res.msg ? res.msg : '绑定失败');
                                }
                            });
                        });
                    });
                    }
                })
                .catch(e => {
                    this.$u.toast(e);
pages/login/wxLogin.vue
New file
@@ -0,0 +1,39 @@
<template>
    <view class="login">
        <view class="logo">微信绑定</view>
        <!--用户名密码登录-->
        <user-password :btnText="1" />
    </view>
</template>
<script>
import userPassword from './userPassword.vue';
export default {
    components: {
        userPassword
    },
    data() {
        return {};
    },
    methods: {}
};
</script>
<style lang="scss">
@import 'index.scss';
.login {
    .logo {
        width: 80%;
        font-size: 64rpx;
        color: #497bff;
        margin: vww(100) auto 0;
        text-align: center;
    }
    .loginBtn {
        margin-top: vww(20);
        .u-button {
            width: 80%;
        }
    }
}
</style>
pages/public-page/forward/forward.vue
@@ -141,9 +141,8 @@
        // 转发选择货代
        forwardHuoDaiObjectSelect(item) {
            this.selectPopupShow = false;
            this.forwardForm.userId = item.id;
            // this.forwardForm.name = item.huoDaiName;
            this.name = item.huoDaiName;
            this.forwardForm.userId = item.userId;
            this.name = item.name;
            this.forwardForm.fleetId = 0;
            console.log('货代选择', this.forwardForm);
        },
@@ -151,7 +150,6 @@
        forwardFleetObjectSelect(item) {
            this.selectPopupShow = false;
            this.forwardForm.fleetId = item.id;
            // this.forwardForm.name = item.name;
            this.name = item.name;
            this.forwardForm.userId = 0;
            console.log('车队选择', this.forwardForm);
pages/register/register.vue
@@ -18,49 +18,49 @@
                    </u-radio-group>
                </u-form-item>
                <u-form-item prop="name" label="姓名" labelWidth="20%" borderBottom required>
                    <u--input v-model="registerFormModel.name" placeholder="请输入内容"></u--input>
                    <u--input v-model="registerFormModel.name" placeholder="请输入内容" clearable></u--input>
                </u-form-item>
                <u-form-item prop="idCard" label="身份证" labelWidth="20%" borderBottom required>
                    <u--input v-model="registerFormModel.idCard" placeholder="请输入内容"></u--input>
                    <u--input v-model="registerFormModel.idCard" placeholder="请输入内容" clearable></u--input>
                </u-form-item>
                <u-form-item prop="phone" label="手机号" labelWidth="20%" borderBottom required>
                    <u--input v-model="registerFormModel.phone" placeholder="请输入内容"></u--input>
                    <u--input v-model="registerFormModel.phone" placeholder="请输入内容" clearable></u--input>
                </u-form-item>
                <u-form-item prop="password" label="密码" labelWidth="20%" borderBottom required>
                    <u--input v-model="registerFormModel.password" placeholder="请输入内容"></u--input>
                    <u--input v-model="registerFormModel.password" placeholder="请输入内容" password clearable></u--input>
                </u-form-item>
                <u-form-item prop="confirmPassword" label="确认密码" labelWidth="20%" borderBottom required>
                    <u--input v-model="registerFormModel.confirmPassword" placeholder="请输入内容" password clearable @blur="jiaoYanPassword"></u--input>
                </u-form-item>
                <u-form-item prop="carNo" label="车牌号" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required>
                    <u--input v-model="registerFormModel.carNo" placeholder="请输入内容"></u--input>
                    <u--input v-model="registerFormModel.carNo" placeholder="请输入内容" clearable></u--input>
                </u-form-item>
                <u-form-item prop="carPhoto" label="车辆照片" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required>
                    <u-upload :fileList="fileList6" @afterRead="afterRead" @delete="deletePic" name="6" multiple :maxCount="1" width="250" height="150">
                <u-form-item prop="carImg" label="车辆照片" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required>
                    <u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="1" width="250" height="150">
                        <!-- <image src="https://cdn.uviewui.com/uview/demo/upload/positive.png"
                        mode="widthFix" style="width: 250px;height: 150px;"></image> -->
                    </u-upload>
                </u-form-item>
                <u-form-item prop="drivingLicense" label="行驶证" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required>
                    <u-upload :fileList="fileList5" @afterRead="afterRead" @delete="deletePic" name="5" multiple :maxCount="1" width="250" height="150">
                <u-form-item prop="drivingImg" label="行驶证" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required>
                    <u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" multiple :maxCount="1" width="250" height="150">
                        <!-- <image src="https://cdn.uviewui.com/uview/demo/upload/positive.png"
                        mode="widthFix" style="width: 250px;height: 150px;"></image> -->
                    </u-upload>
                </u-form-item>
                <u-form-item label="推荐人账号" labelWidth="25%" borderBottom ><u--input v-model="registerFormModel.tuiJianMa" placeholder="请输入内容"></u--input></u-form-item>
                <u-form-item label="推荐人账号" labelWidth="25%" borderBottom><u--input v-model="registerFormModel.tuiJianMa" placeholder="请输入内容" clearable></u--input></u-form-item>
            </u--form>
        </view>
        <view class="roleModel">
            <u-modal :show="editRoleModelShow" :title="title" :content="content" :showCancelButton="true" @confirm="roleConfirm" @cancel="roleCancel"></u-modal>
        </view>
        <view class="registerBtn"><u-button text="注册" type="primary" @click="registerClick"></u-button></view>
        <!-- <view class="utils">
            <text @click="callingIn">打电话</text>
        </view> -->
    </view>
</template>
<script>
// import HomeSpecies from '@/components/home-species/HomeSpecies.vue';
import { apiRegister } from '@/api/publicInterface.js';
import { BaseUrl } from '@/api/publicInterface.js';
export default {
    // onLoad: function() {
    //   // 查看是否授权
@@ -99,15 +99,18 @@
                phone: '',
                password: '',
                name: '',
                username:'',
                username: '',
                openId: '',
                type: 2,
                idCard: '',
                carNo: '',
                carImg: '',
                drivingImg: '',
                tuiJianMa: ''
                tuiJianMa: '',
                confirmPassword:''
            },
            fileList1: [],
            fileList2: [],
            rules: {
                name: {
                    type: 'string',
@@ -142,8 +145,20 @@
                    },
                    {
                        min: 6,
                        max: 8,
                        message: '长度在6-8个字符之间'
                        max: 12,
                        message: '长度在6-12个字符之间'
                    }
                ],
                confirmPassword:[
                    {
                        required: true,
                        message: '请设置初始密码',
                        trigger: ['blur', 'change']
                    },
                    {
                        min: 6,
                        max: 12,
                        message: '长度在6-12个字符之间'
                    }
                ],
                carNo: [
@@ -154,19 +169,20 @@
                        trigger: ['blur', 'change']
                    }
                ],
                // carPhoto: {
                //     type: 'string',
                //     required: true,
                //     message: '请上传车辆图片',
                //     trigger: ['blur', 'change']
                // },
                // drivingLicense: {
                //     type: 'string',
                //     required: true,
                //     message: '请上传行驶证照片',
                //     trigger: ['blur', 'change']
                // }
                carImg: {
                    type: 'string',
                    required: true,
                    message: '请上传车辆图片',
                    trigger: ['blur', 'change']
                },
                drivingImg: {
                    type: 'string',
                    required: true,
                    message: '请上传行驶证照片',
                    trigger: ['blur', 'change']
                }
            },
            confirmPassword:'',
            // 基本案列数据
            radiolist1: [
                {
@@ -181,8 +197,6 @@
            // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
            radiovalue1: '货代',
            beforeChangeValue: '',
            fileList5: [],
            fileList6: [],
            // 更换角色弹框
            editRoleModelShow: false,
            title: '提示',
@@ -215,35 +229,39 @@
    },
    methods: {
        registerClick() {
            this.$refs.regesterFormRef
                .validate()
                .then(res => {
                    console.log(this.registerFormModel);
                    this.registerFormModel.username = this.registerFormModel.name
                    apiRegister(this.registerFormModel)
                        .then(res => {
                            console.log(res);
                            if (res.data.code == 0) {
                                uni.showToast({
                                    title: '注册成功,即将进入登录!',
                                    icon: 'none',
                                    duration: 1000
                                });
                                setTimeout(() => {
                                    uni.redirectTo({ url: '/pages/login/login' });
                                }, 1000);
                            } else {
                                this.$u.toast(res.data.msg)
                            }
                        })
                        .catch(err => {
                            console.log('错误', err);
                        });
                })
                .catch(err => {
                    console.log('err', err);
                    uni.$u.toast('效验失败');
                });
            if(this.registerFormModel.password == this.registerFormModel.confirmPassword){
                this.$refs.regesterFormRef
                    .validate()
                    .then(res => {
                        console.log(this.registerFormModel);
                        this.registerFormModel.username = this.registerFormModel.phone;
                        apiRegister(this.registerFormModel)
                            .then(res => {
                                console.log(res);
                                if (res.data.code == 0) {
                                    uni.showToast({
                                        title: '注册成功,即将进入登录!',
                                        icon: 'none',
                                        duration: 1000
                                    });
                                    setTimeout(() => {
                                        uni.redirectTo({ url: '/pages/login/login' });
                                    }, 1000);
                                } else {
                                    this.$u.toast(res.data.msg);
                                }
                            })
                            .catch(err => {
                                console.log('错误', err);
                            });
                    })
                    .catch(err => {
                        console.log('err', err);
                        uni.$u.toast('请规范输入内容');
                    });
            } else {
                this.$u.toast('两次密码不一致')
            }
        },
        // 音视频通话
        // callingIn() {
@@ -269,6 +287,12 @@
                this.beforeChangeValue = e;
            }
        },
        jiaoYanPassword(){
            console.log('密码:',this.registerFormModel.password ,'确认密码:',this.confirmPassword);
            // if(this.registerFormModel.password != this.confirmPassword){
            //     this.$u.toast('两次密码不一致')
            // }
        },
        // 上传图片方法
        // 删除图片
        deletePic(event) {
@@ -288,7 +312,7 @@
                });
            });
            for (let i = 0; i < lists.length; i++) {
                const result = await this.uploadFilePromise(lists[i].url);
                const result = await this.uploadFilePromise(lists[i].url, event.name);
                let item = this[`fileList${event.name}`][fileListLen];
                this[`fileList${event.name}`].splice(
                    fileListLen,
@@ -302,19 +326,22 @@
                fileListLen++;
            }
        },
        uploadFilePromise(url) {
        uploadFilePromise(url, num) {
            return new Promise((resolve, reject) => {
                let a = uni.uploadFile({
                    url: 'http://192.168.0.120:9999/admin/sys-file/uploadUnToken', // 仅为示例,非真实的接口地址
                    url: BaseUrl + '/admin/sys-file/uploadUnToken',
                    filePath: url,
                    name: 'file',
                    formData: {
                        user: 'test'
                    },
                    // formData: {
                    //     user: 'test'
                    // },
                    success: res => {
                        setTimeout(() => {
                            resolve(res.data.data);
                        }, 1000);
                        resolve(JSON.parse(res.data).data.url);
                        if (num == 1) {
                            this.registerFormModel.carImg = JSON.parse(res.data).data.url;
                        } else if (num == 2) {
                            this.registerFormModel.drivingImg = JSON.parse(res.data).data.url;
                        }
                    }
                });
            });
@@ -331,7 +358,6 @@
             * @resetFields 不管用时候用上边的代替
             */
            this.$refs.regesterFormRef.resetFields();
            this.editRoleModelShow = false;
        },
        roleCancel() {
@@ -339,17 +365,6 @@
            this.$nextTick(() => {
                this.editRoleModelShow = false;
            });
            // switch (this.radiovalue1) {
            //     case '客户':
            //         this.radiovalue1 = '';
            //         break;
            //     case '货代':
            //         this.radiovalue1 = '司机';
            //         break;
            //     case '司机':
            //         this.radiovalue1 = '货代';
            //         break;
            // }
        }
    }
};
store/index.js
@@ -36,7 +36,7 @@
        // 用戶界面判斷
        userInfo: {},
        roleType: null, // 1客户,2货代,3司机
        userTabbar: [] // 用户所在角色底部菜单
        userTabbar: [] ,// 用户所在角色底部菜单,
    },
    mutations: {
        setUserInfo(state, identity) {