qingyiay
2023-08-28 82a7eba143cc761b303b99889193f7aad2dc9d08
修改bug,称重页面增加历史和异常原因填写
13个文件已修改
896 ■■■■■ 已修改文件
api/publicInterface.js 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/request.js 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/bindBackground/bindBackground.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue 216 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-my/customer-my.vue 89 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/drvier-my/drvier-my.vue 134 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/login.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/userPassword.vue 227 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/tabbar-page/index-tabbar/index-tabbar.vue 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/publicInterface.js
@@ -3,10 +3,11 @@
import { BaseUrl as wrBaseUrl } from '@/api/request.js'
// const BaseUrl = 'http://192.168.31.14:9999'
const BaseUrl = 'https://mx.jzeg.cn:9095'
// const BaseUrl = 'http://192.168.31.18:9999'
const BaseUrl = 'http://192.168.31.14:9999'
// const BaseUrl = 'https://mx.jzeg.cn:9096'
// const BaseUrl = 'http://192.168.31.18:9999'
// const BaseUrl = 'http://192.168.0.100:9999'
// const BaseUrl = 'http://192.168.0.108:9999'
// 登录
// function apiLogin({
//     code
@@ -58,7 +59,9 @@
    idCard,
    carNo,
    carImg,
    drivingImg
    drivingImg,
    vehicleColour,
    bodyofcarJpg
}) {
    uni.showLoading({ title: '加载中...' })
    return new Promise((resolve, reject) => {
@@ -75,7 +78,9 @@
                idCard,
                carNo,
                carImg,
                drivingImg
                drivingImg,
                vehicleColour,
                bodyofcarJpg
            },
            header: {
                'Authorization': 'Basic c29jaWFsOnNvY2lhbA==', //app:app
api/request.js
@@ -1,13 +1,35 @@
import {
    globalApi
} from '@/api/globalApi.js';
import {
    apiLoginPassword
} from './publicInterface';
// 成功
const responseOK = (response) => {
    const {
        data
    } = response;
    test(data);
    return data;
}
const test = (obj) => {
    if (obj instanceof Array) {
        obj.forEach(e => {
            test(e);
        })
    } else if (obj instanceof Object) {
        for (let key in obj) {
            if (obj[key] == null) {
                obj[key] = "";
            } else {
                if (obj[key] instanceof Array || obj[key] instanceof Object) {
                    test(obj[key])
                }
            }
        }
    }
}
// 响应失败的依赖性
@@ -78,16 +100,20 @@
    500: responseError
}
// const BaseUrl = "http://192.168.31.18:9997"
// const webSocketUrl = "ws://192.168.31.18:9997/wrzs/ws/info"
const BaseUrl = "http://192.168.31.14:9997"
const webSocketUrl = "ws://192.168.31.14:9997/wrzs/ws/info"
// const BaseUrl = "http://192.168.31.14:9997";
// const webSocketUrl = "ws://192.168.31.14:9997/wrzs/ws/info"
// const BaseUrl = "http://192.168.0.106:9997";
// const webSocketUrl = "ws://192.168.0.106:9997/wrzs/ws/info"
// // 线上生产
const BaseUrl = "https://mx.jzeg.cn:9095";
const webSocketUrl = "wss://mx.jzeg.cn:9095/wrzs/ws/info"
// const BaseUrl = "http://localhost:9997";
// const webSocketUrl = "ws://localhost:9997/wrzs/ws/info"
export const onlineurl = "https://mx.jzeg.cn:9096";
// const BaseUrl = "http://192.168.0.100:9997";
// const webSocketUrl = "ws://192.168.0.100:9997/wrzs/ws/info"
// const BaseUrl = "http://192.168.0.108:9997";
// const webSocketUrl = "ws://192.168.0.108:9997/wrzs/ws/info"
// 线上生产
// const BaseUrl = "https://mx.jzeg.cn:9096";
// const webSocketUrl = "wss://mx.jzeg.cn:9096/wrzs/ws/info"
// 请求拦截
@@ -116,9 +142,17 @@
    return new Promise((resolve, reject) => {
        let options = {}
        if (opt.data) {
            Object.keys(opt.data).map(key => {
                if (opt.data[key] == '' || opt.data[key] == "") {
                    opt.data[key] = null;
                }
            });
        }
        Object.keys(opt).map(key => {
            if (key !== "params") {
                return options[key] = opt[key]
            }
        })
pages/bindBackground/bindBackground.vue
@@ -46,6 +46,27 @@
                }
                this.setUpWxOpenid(this.username, this.password, uni.getStorageSync('bindCode'))
            },
            getUserAuth() {
                wx.getSetting({
                    withSubscriptions: true,
                    success(res) {
                        if (res.subscriptionsSetting == null || res.subscriptionsSetting == undefined ||
                            res.subscriptionsSetting.itemSettings == null || res.subscriptionsSetting
                            .itemSettings == undefined || res.subscriptionsSetting[
                                "bvDqcHRRKEewTz7XVrdwUbrF6ZewSRmiUIB1V_IBJq4"] != 'accept') {
                            wx.requestSubscribeMessage({
                                tmplIds: ['bvDqcHRRKEewTz7XVrdwUbrF6ZewSRmiUIB1V_IBJq4'],
                                success(res) {
                                    console.log(res, '获取订阅消息');
                                },
                                fail(e) {
                                    console.log(e, '订阅消息失败');
                                }
                            })
                        }
                    }
                })
            },
            setUpWxOpenid(userName, passWord, code) {
                uni.request({
                    url: `${BaseUrl}/admin/user/setUpWxOpenid`,
@@ -62,6 +83,8 @@
                        console.log(res, '绑定结果');
                        if (res.data.code === 1) {
                            this.$u.toast(res.data.msg ? res.data.msg : '绑定失败')
                        } else {
                            this.$u.toast('操作成功')
                        }
                    }
                })
pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue
@@ -2,121 +2,137 @@
    <!-- 添加货代或司机 -->
    <view class="addTo-freightForwarder-drvier">
        <view class="addForm">
            <u--form labelPosition="top" ref="form1">
                <u-form-item labelWidth="20%" label="姓名" ref="item1"><u--input v-model="name" :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item>
                <u-form-item labelWidth="25%" label="手机号" ref="item1"><u--input v-model="phone" :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item>
                <u-form-item labelWidth="25%" label="汽车车牌号" ref="item1" v-if="role == 2">
                    <u--input v-model="carNo" :customStyle="{ border: '1px solid #dddddd' }"></u--input>
            <u--form labelPosition="top"
                ref="form1">
                <u-form-item labelWidth="20%"
                    label="姓名"
                    ref="item1"><u--input v-model="name"
                        :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item>
                <u-form-item labelWidth="25%"
                    label="手机号"
                    ref="item1"><u--input v-model="phone"
                        :customStyle="{ border: '1px solid #dddddd' }"></u--input></u-form-item>
                <u-form-item labelWidth="25%"
                    label="汽车车牌号"
                    ref="item1"
                    v-if="role == 2">
                    <u--input v-model="carNo"
                        :customStyle="{ border: '1px solid #dddddd' }"></u--input>
                </u-form-item>
            </u--form>
        </view>
        <view class="addBtn"><u-button text="邀请" type="primary" @click="addToHuoDaiOrDriver"></u-button></view>
        <view class="addBtn"><u-button text="邀请"
                type="primary"
                @click="addToHuoDaiOrDriver"></u-button></view>
    </view>
</template>
<script>
import { customerId } from '@/utils/status.js';
import { mapMutations } from 'vuex';
export default {
    onLoad(params) {
        this.role = params.role;
        if (params.fleetId) {
            this.fleetId = params.fleetId;
        }
    },
    data() {
        return {
            role: null, // 决定添加货代司机,还是车队司机
            fleetId: null,
            name: '',
            phone: '',
            carNo: '',
            customerId
        };
    },
    methods: {
        ...mapMutations(['lengthchange']),
        init() {},
        addToHuoDaiOrDriver() {
            switch (this.role) {
                case '1':
                    if (this.name == '' || this.phone == '') {
                        uni.showToast({
                            title: '请规范输入!',
                            icon: 'error',
                            duration: 2000
                        });
                    } else {
                        this.bindHuoDai();
                    }
                    break;
                case '2':
                    if (this.name == '' || this.phone == '' || this.carNo == '') {
                        uni.showToast({
                            title: '请规范输入!',
                            icon: 'error',
                            duration: 2000
                        });
                    } else {
                        this.bindUserFleet();
                    }
                default:
                    break;
    import { customerId } from '@/utils/status.js';
    import { mapMutations } from 'vuex';
    export default {
        onLoad(params) {
            this.role = params.role;
            if (params.fleetId) {
                this.fleetId = params.fleetId;
            }
        },
        // 邀请货代
        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 }, 'params').then(res => {
                if (res.code == 0) {
                    this.$u.toast('添加成功');
                    setTimeout(() => {
        data() {
            return {
                role: null, // 决定添加货代司机,还是车队司机
                fleetId: null,
                name: '',
                phone: '',
                carNo: '',
                customerId
            };
        },
        methods: {
            ...mapMutations(['lengthchange']),
            init() {},
            addToHuoDaiOrDriver() {
                switch (this.role) {
                    case '1':
                        if (this.name == '' || this.phone == '') {
                            uni.showToast({
                                title: '请规范输入!',
                                icon: 'error',
                                duration: 2000
                            });
                        } else {
                            this.bindHuoDai();
                        }
                        break;
                    case '2':
                        if (this.name == '' || this.phone == '' || this.carNo == '') {
                            uni.showToast({
                                title: '请规范输入!',
                                icon: 'error',
                                duration: 2000
                            });
                        } else {
                            this.bindUserFleet();
                        }
                    default:
                        break;
                }
            },
            // 邀请货代
            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 }, 'params').then(res => {
                    if (res.code == 0) {
                        this.$u.toast('添加成功');
                        setTimeout(() => {
                            uni.navigateBack({
                                delta: 1
                            });
                        }, 1000);
                    } else {
                        this.$u.toast(res.msg ? res.msg : '未成功添加');
                    }
                });
            },
            // 邀请司机
            bindUserFleet() {
                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.msg ? res.msg : '操作成功');
                        this.$reqGet('GetUserFleet', { fleetId: this.fleetId }).then(response => {
                            this.lengthchange(response.data.length);
                        });
                        uni.navigateBack({
                            delta: 1
                        });
                    }, 1000);
                } else {
                    this.$u.toast(res.msg ? res.msg : '未成功添加');
                }
            });
        },
        // 邀请司机
        bindUserFleet() {
            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.msg ? res.msg : '操作成功');
                    this.$reqGet('GetUserFleet', { fleetId: this.fleetId }).then(response => {
                        this.lengthchange(response.data.length);
                    });
                    uni.navigateBack({
                        delta: 1
                    });
                } else {
                    uni.showToast({
                        title: res.msg ? res.msg : '操作失败',
                        icon: 'null',
                        duration: 2000
                    });
                }
            });
                    } else {
                        uni.showToast({
                            title: res.msg ? res.msg : '操作失败',
                            duration: 2000
                        });
                    }
                });
            }
        }
    }
};
    };
</script>
<style lang="scss" scoped>
::v-deep.addTo-freightForwarder-drvier {
    width: 90%;
    margin: 0 auto;
    .addForm {
        margin: 0 auto;
    }
    .addBtn {
<style lang="scss"
    scoped>
    ::v-deep.addTo-freightForwarder-drvier {
        width: 90%;
        position: fixed;
        bottom: vww(48);
        margin: 0 auto;
        .addForm {
            margin: 0 auto;
        }
        .addBtn {
            width: 90%;
            position: fixed;
            bottom: vww(48);
            margin: 0 auto;
        }
    }
}
</style>
</style>
pages/customer-page/customer-my/customer-my.vue
@@ -75,6 +75,12 @@
                    type="primary"
                    @click="userManage"
                    v-if="roleType == 1 && userEntity.isHostUser === '0'"></u-button></view>
            <view class="logout"><u-button text="修改密码"
                    type="primary"
                    @click="modifyPwd"></u-button></view>
            <view class="logout"><u-button text="重置密码"
                    type="primary"
                    @click="initPwd"></u-button></view>
            <view class="logout"><u-button text="退出登录"
                    type="primary"
                    @click="logout()"></u-button></view>
@@ -103,9 +109,6 @@
                                border="none"
                                placeholder="请输入车队名称"></u--input>
                        </u-form-item>
                        <!-- <u-form-item label="车牌" borderBottom ref="cars" labelWidth="80">
              <u--textarea maxlength="2000" v-model="addGroupForm.carNums" placeholder="请输入车牌" height="150"></u--textarea>
            </u-form-item> -->
                    </u--form>
                </view>
                <view class="addCarButton"><u-button text="添加"
@@ -138,7 +141,7 @@
                <view class="slot-content"><rich-text :nodes="deleteFleetContent"></rich-text></view>
            </u-modal>
        </view>
        <!-- 退出登录弹出框 -->
        <view class="logoutModel">
            <u-modal :show="logoutShow"
                :title="logoutTitle"
@@ -146,6 +149,30 @@
                :content="logoutContent"
                @confirm="logoutConfirm"
                @cancel="logoutCancel"></u-modal>
        </view>
        <!-- 重置密码弹出框 -->
        <view class="initPwdModal">
            <u-modal :show="initPwdShow"
                title="重置密码"
                showCancelButton
                content="初始密码将变更为123456,是否确认重置"
                @confirm="initPwdConfirm"
                @cancel="initPwdCancel"></u-modal>
        </view>
        <!-- 修改密码弹出框 -->
        <view class="modifyPwdModal">
            <u-modal :show="modifyPwdShow"
                title="修改密码"
                showCancelButton
                @confirm="modifyPwdConfirm"
                @cancel="modifyPwdCancel">
                <view class="modifyPwd">
                    <u-input v-model="passwordModified"
                        placeholder="请输入修改后的密码"
                        border="surround"
                        type="password"></u-input>
                </view>
            </u-modal>
        </view>
    </view>
</template>
@@ -185,7 +212,10 @@
                logoutTitle: '提示',
                logoutContent: '是否确认退出',
                // 用户信息对象
                userEntity: {}
                userEntity: {},
                initPwdShow: false,
                modifyPwdShow: false,
                passwordModified: ''
            };
        },
        computed: {
@@ -355,6 +385,50 @@
                    url: `/pages/customer-page/fleet-management/fleet-management?id=${id}`
                });
            },
            updateInfo() {
                this.$reqPost('updateUser', this.userEntity, 'json').then(res => {
                    uni.hideLoading()
                    if (res.code == 0) {
                        uni.showToast({
                            title: '重置成功',
                            duration: 2000,
                            icon: 'success'
                        })
                    } else {
                        this.$u.toast(res.msg ? res.msg : '修改失败');
                    }
                }).catch(err => {
                    this.$u.toast('修改失败');
                });
            },
            initPwd() {
                this.initPwdShow = true
            },
            initPwdConfirm() {
                this.initPwdShow = false
                uni.showLoading({
                    title: '加载中'
                })
                this.userEntity.password = '123456'
                this.updateInfo()
            },
            initPwdCancel() {
                this.initPwdShow = false
            },
            modifyPwd() {
                this.modifyPwdShow = true
            },
            modifyPwdConfirm() {
                if (this.passwordModified.length === 0) {
                    return this.$u.toast('密码不能为空')
                }
                this.modifyPwdShow = false
                this.userEntity.password = this.passwordModified
                this.updateInfo()
            },
            modifyPwdCancel() {
                this.modifyPwdShow = false
            },
            logout() {
                this.logoutShow = true;
            },
@@ -515,5 +589,10 @@
                }
            }
        }
        .modifyPwd {
            width: 100%;
            border: 1rpx solid rgb(220, 223, 230);
        }
    }
</style>
pages/driver-page/driver-index/bill-of-lading-details/bill-of-lading-details.vue
@@ -142,7 +142,10 @@
                this.overTmWaixiao = value.overTmWaixiao
                this.getWeightHouseObj.overTmWaixiao = value.overTmWaixiao
            }
        },
        onShow() {
            this.init();
        },
        data() {
            return {
@@ -263,7 +266,7 @@
                });
                this.coalDayPage(); //获取日志
                this.getTakeCoal(); //获取提煤单详情
                this.getgetService(); //获取客服
            },
            // 获取客服openid
            getgetService() {
@@ -333,6 +336,8 @@
                            })
                        }
                    }
                }).then(() => {
                    this.getgetService(); //获取客服
                })
            },
            // 日志查询
@@ -399,7 +404,7 @@
                        } else {
                            wx.join1v1Chat({
                                caller: {
                                    nickname: uni.getStorageSync('name'),
                                    nickname: uni.getStorageSync('username'),
                                    openid: uni.getStorageSync(
                                        'openid')
                                },
pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue
@@ -88,11 +88,9 @@
                            this.$u.toast('签到成功');
                            setTimeout(() => {
                                uni.navigateBack({
                                        delta: 1
                                    },
                                    500
                                );
                            });
                                    delta: 1
                                });
                            }, 1000);
                        } else {
                            this.$u.toast(res.msg ? res.msg : '签到失败');
                        }
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -528,7 +528,8 @@
                    sceneId: this.weighData.sceneId,
                    carNo: this.weighData.carNo,
                    tmId: this.weighData.tmId,
                    filedId: this.weighData.filedId
                    filedId: this.weighData.filedId,
                    equipmentCode: this.weighData.equipmentCode
                }, 'json').then(res => {
                    if (res.code == 0) {
                        this.$u.toast('操作成功,即将返回上一页');
@@ -592,7 +593,7 @@
                        this.tmTaskCoalList = res.data.tmTaskCoalList
                        /**
                         * @description true的话是不异常 false就是异常 没有历史,平均皮重为0是第一次正常 */
                        this.isAbnormalAvgSkin = (Array.isArray(this.tmTaskCoalList.length === 0) && this
                        this.isAbnormalAvgSkin = (Array.isArray(this.tmTaskCoalList) && this
                            .tmTaskCoalList.length === 0 || !this.tmTaskCoalList) && this.avgSkin == 0
                    } else {
                        uni.hideLoading()
pages/driver-page/drvier-my/drvier-my.vue
@@ -1,17 +1,31 @@
<template>
    <view class="driver-my">
        <view class="driver-banner">
            <view class="navgation">我的</view>
            <view class="avatar">
                <view class="avatar-imgage"
                    style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/driverava.png')no-repeat;background-size: cover;">
        <view class=""
            style="height: 446rpx;width: 100%;">
            <view class="driver-banner">
                <view class="navgation">我的</view>
                <view class="avatar">
                    <view class="avatar-imgage"
                        style="background: url('https://mx.jzeg.cn:9095/appimg/image/banner/driverava.png')no-repeat;background-size: cover;">
                    </view>
                    <view class="avatar-name">{{ userInfo.name || '' }}</view>
                    <view class="edit-button"><u-button type="primary"
                            @click="editBtnClick"
                            shape="circle"
                            :disabled="userInfo.isRegister!==2"
                            plain>编辑个人资料</u-button></view>
                </view>
                <view class="avatar-name">{{ userInfo.name || '' }}</view>
                <view class="edit-button"><u-button type="primary"
                        @click="editBtnClick"
                        shape="circle"
                        plain>编辑个人资料</u-button></view>
            </view>
        </view>
        <view class="process-state">
            <view class="state-text">
                审核状态
            </view>
            <u--text :type="userInfo.isRegister===0?'primary':userInfo.isRegister===1?'error':'success'"
                :text="userInfo.isRegister===0?'待审核':userInfo.isRegister===1?'未通过':'已审核'"
                size="32"></u--text>
        </view>
        <view class="information-block">
            <view class="personal-information">
                <view class="personal-information-block">
                    <view class="block-main">
@@ -111,6 +125,11 @@
            </view>
        </view>
        <view class="loginout">
            <view class="loginout-main"><u-button text="重置密码"
                    type="primary"
                    @click="initPwd"
                    shape="circle"
                    plain></u-button></view>
            <view class="loginout-main"><u-button text="退出登录"
                    type="primary"
                    @click="logout"
@@ -148,6 +167,14 @@
                            prop="name"
                            required>
                            <u--input v-model="editUserInfo.name"
                                border="none"
                                inputAlign="left"></u--input>
                        </u-form-item>
                        <u-form-item labelWidth="20%"
                            label="密码"
                            prop="password"
                            required>
                            <u--input v-model="editUserInfo.password"
                                border="none"
                                inputAlign="left"></u--input>
                        </u-form-item>
@@ -238,11 +265,19 @@
                @confirm="logoutConfirm"
                @cancel="logoutCancel"></u-modal>
        </view>
        <view class="initPwdModal">
            <u-modal :show="initPwdShow"
                title="重置密码"
                showCancelButton
                content="初始密码将变更为123456,是否确认重置"
                @confirm="initPwdConfirm"
                @cancel="initPwdCancel"></u-modal>
        </view>
    </view>
</template>
<script>
    import { customerId, userInfo, redirectLogin } from '@/utils/status';
    import { redirectLogin } from '@/utils/status';
    import { BaseUrl } from '@/api/publicInterface.js';
    import { mapMutations } from 'vuex';
    export default {
@@ -262,7 +297,9 @@
                    drivingImg: '',
                    axleNum: '',
                    weight: '',
                    userId: ''
                    userId: '',
                    password: "",
                    isRegister: ''
                },
                rules: {
                    name: {
@@ -359,7 +396,9 @@
                logoutShow: false,
                logoutTitle: '提示',
                logoutContent: '是否确认退出',
                BaseUrl
                BaseUrl,
                initPwdShow: false
            };
        },
        onShow() {
@@ -397,6 +436,7 @@
                            this.editUserInfo[item] = res.data[item];
                        }
                    });
                    this.editUserInfo.password = ''
                });
            },
            // 修改按钮点击
@@ -496,7 +536,8 @@
                this.editUserInfo = {
                    ...this.editUserInfo,
                    carImg: uni.getStorageSync('carImg'),
                    drivingImg: uni.getStorageSync('drivingImg')
                    drivingImg: uni.getStorageSync('drivingImg'),
                    isRegister: 0
                };
                this.$refs.editRef
                    .validate()
@@ -519,6 +560,35 @@
                    .catch(err => {
                        this.$u.toast('修改失败');
                    });
            },
            initPwd() {
                this.initPwdShow = true
            },
            initPwdConfirm() {
                this.initPwdShow = false
                uni.showLoading({
                    title: '加载中...'
                });
                this.editUserInfo.password = '123456';
                this.editUserInfo.carImg = uni.getStorageSync('carImg');
                this.editUserInfo.drivingImg = uni.getStorageSync('drivingImg')
                this.$reqPost('updateUser', this.editUserInfo, 'json').then(res => {
                    uni.hideLoading()
                    if (res.code == 0) {
                        uni.showToast({
                            title: '重置成功',
                            duration: 2000,
                            icon: 'success'
                        })
                    } else {
                        this.$u.toast(res.msg ? res.msg : '修改失败');
                    }
                }).catch(err => {
                    this.$u.toast('修改失败');
                });
            },
            initPwdCancel() {
                this.initPwdShow = false
            },
            logout() {
                this.logoutShow = true;
@@ -549,15 +619,11 @@
        align-items: center;
    }
    .statistics {
        margin-top: vww(10);
        margin-bottom: vww(10);
    }
    ::v-deep.driver-my {
        width: 100%;
        margin: 0 auto;
        padding-bottom: vww(60);
        padding-bottom: vww(100);
        .driver-banner {
            width: 100%;
@@ -610,13 +676,32 @@
                    top: vww(4);
                }
            }
        }
        .process-state {
            width: 300rpx;
            height: 50rpx;
            margin: 0 auto;
            position: fixed;
            top: 284rpx;
            left: 37rpx;
            display: flex;
            align-items: center;
            .state-text {
                margin-right: vww(6);
            }
        }
        .information-block {
            width: 100%;
            .personal-information {
                width: 100%;
                display: flex;
                justify-content: center;
                position: relative;
                top: vww(20);
                top: vww(-30);
                &-block {
                    width: 690rpx;
@@ -676,7 +761,6 @@
        .car-information {
            width: 100%;
            position: relative;
            top: vww(410);
            @include flex justify-content: center;
            .information-main {
@@ -720,11 +804,13 @@
        .loginout {
            width: 100%;
            height: 74rpx;
            height: 200rpx;
            @include flex;
            justify-content: center;
            justify-content: space-around;
            flex-direction: column;
            align-items: center;
            position: relative;
            bottom: vww(-430);
            top: vww(20);
            .loginout-main {
                width: 84%;
pages/freight-forwarder-page/freightForwarder-my/freightForwarder-my.vue
@@ -75,6 +75,12 @@
        <!-- <view class="statistics"><u-button text="发运统计" type="primary" @click="statistics"></u-button></view> -->
        <view class="utils-button">
            <view class="utils"><u-button text="修改密码"
                    type="primary"
                    @click="modifyPwd"></u-button></view>
            <view class="utils"><u-button text="重置密码"
                    type="primary"
                    @click="initPwd"></u-button></view>
            <view class="utils"><u-button text="退出登录"
                    type="primary"
                    @click="logout"></u-button></view>
@@ -99,6 +105,30 @@
                :content="logoutContent"
                @confirm="logoutConfirm"
                @cancel="logoutCancel"></u-modal>
        </view>
        <!-- 重置密码弹出框 -->
        <view class="initPwdModal">
            <u-modal :show="initPwdShow"
                title="重置密码"
                showCancelButton
                content="初始密码将变更为123456,是否确认重置"
                @confirm="initPwdConfirm"
                @cancel="initPwdCancel"></u-modal>
        </view>
        <!-- 修改密码弹出框 -->
        <view class="modifyPwdModal">
            <u-modal :show="modifyPwdShow"
                title="修改密码"
                showCancelButton
                @confirm="modifyPwdConfirm"
                @cancel="modifyPwdCancel">
                <view class="modifyPwd">
                    <u-input v-model="passwordModified"
                        placeholder="请输入修改后的密码"
                        border="surround"
                        type="password"></u-input>
                </view>
            </u-modal>
        </view>
    </view>
</template>
@@ -126,15 +156,27 @@
                // 退出模态框
                logoutShow: false,
                logoutTitle: '提示',
                logoutContent: '是否确认退出'
                logoutContent: '是否确认退出',
                initPwdShow: false,
                modifyPwdShow: false,
                passwordModified: '',
                // 用户信息对象
                userEntity: {},
            };
        },
        onShow() {
        onLoad() {
            this.init();
        },
        methods: {
            init() {
                this.getFleet();
                this.getUserEntity()
            },
            // 获取用户信息
            getUserEntity() {
                this.$reqGet('getUserEntity').then(res => {
                    this.userEntity = res.data;
                });
            },
            // 获取车队
            getFleet() {
@@ -204,6 +246,50 @@
                uni.navigateTo({
                    url: `/pages/customer-page/fleet-management/fleet-management?id=${id}`
                });
            },
            updateInfo() {
                this.$reqPost('updateUser', this.userEntity, 'json').then(res => {
                    uni.hideLoading()
                    if (res.code == 0) {
                        uni.showToast({
                            title: '重置成功',
                            duration: 2000,
                            icon: 'success'
                        })
                    } else {
                        this.$u.toast(res.msg ? res.msg : '修改失败');
                    }
                }).catch(err => {
                    this.$u.toast('修改失败');
                });
            },
            initPwd() {
                this.initPwdShow = true
            },
            initPwdConfirm() {
                this.initPwdShow = false
                uni.showLoading({
                    title: '加载中'
                })
                this.userEntity.password = '123456'
                this.updateInfo()
            },
            initPwdCancel() {
                this.initPwdShow = false
            },
            modifyPwd() {
                this.modifyPwdShow = true
            },
            modifyPwdConfirm() {
                if (this.passwordModified.length === 0) {
                    return this.$u.toast('密码不能为空')
                }
                this.modifyPwdShow = false
                this.userEntity.password = this.passwordModified
                this.updateInfo()
            },
            modifyPwdCancel() {
                this.modifyPwdShow = false
            },
            logout() {
                this.logoutShow = true;
@@ -348,5 +434,10 @@
                }
            }
        }
        .modifyPwd {
            width: 100%;
            border: 1rpx solid rgb(220, 223, 230);
        }
    }
</style>
pages/login/login.vue
@@ -137,6 +137,7 @@
                wx.request({
                    url: `https://api.weixin.qq.com/sns/jscode2session?appid=${this.appid}&secret=${this.secret}&js_code=${code}&grant_type=authorization_code`,
                    success(res) {
                        console.log(res, 'openid');
                        uni.setStorageSync('openid', res.data.openid);
                        // uni.showToast({
                        //     title: '成功获取测试openid',
@@ -157,6 +158,7 @@
                            this.$reqGet('getUserEntity').then(res => {
                                this.setUserTabbar(res.data.type);
                                uni.setStorageSync('roleType', res.data.type);
                                uni.setStorageSync("userId", res.data.userId)
                                setCustomerId(res.data.customerid);
                                uni.hideLoading();
                                //跳转页面
pages/login/userPassword.vue
@@ -2,144 +2,145 @@
    <view>
        <view class="list">
            <view class="list-call">
                <u--input
                    v-model="username"
                <u--input v-model="username"
                    clearable
                    maxlength="32"
                    type="text"
                    placeholder="请输入手机号"
                    prefixIcon="account"
                    prefixIconStyle="font-size: 22px;color: #909399"
                ></u--input>
                    prefixIconStyle="font-size: 22px;color: #909399"></u--input>
            </view>
            <view class="list-call">
                <u--input
                    v-model="password"
                <u--input v-model="password"
                    clearable
                    maxlength="32"
                    type="password"
                    placeholder="请输入密码"
                    prefixIcon="lock"
                    prefixIconStyle="font-size: 22px;color: #909399"
                ></u--input>
                    prefixIconStyle="font-size: 22px;color: #909399"></u--input>
            </view>
        </view>
        <view class="loginBtn"><u-button type="primary" :text="btnText == 1 ? '绑定' : '登录'" @click="submit()"></u-button></view>
        <view class="loginBtn"><u-button type="primary"
                :text="btnText == 1 ? '绑定' : '登录'"
                @click="submit()"></u-button></view>
    </view>
</template>
<script>
import { apiLoginPassword } from '@/api/publicInterface.js';
import { mapMutations } from 'vuex';
import { setName, setToken, setRefreshToken, setUsernameKey, setCustomerId, redirectHome } from '@/utils/status.js';
export default {
    name: 'userPassword',
    props: {
        //0:正常,1:微信绑定
        btnText: {
            type: Number,
            default: 0
        }
    },
    data() {
        return {
            username: '', // 客户
            // username:'13333333331',//货代
            // username: '13333333332',// 司机
            password: '',
            remember: true,
            baseUrl: ''
        };
    },
    methods: {
        ...mapMutations(['setUserTabbar']),
        //登录
        async submit() {
            uni.showLoading({
                title: '登录中...'
            });
            //表单校验
            if (this.username.length === 0) {
                this.$u.toast('请输入账号');
                return;
    import { apiLoginPassword } from '@/api/publicInterface.js';
    import { mapMutations } from 'vuex';
    import { setName, setToken, setRefreshToken, setUsernameKey, setCustomerId, redirectHome } from '@/utils/status.js';
    export default {
        name: 'userPassword',
        props: {
            //0:正常,1:微信绑定
            btnText: {
                type: Number,
                default: 0
            }
            if (this.password.length === 0) {
                this.$u.toast('请输入密码');
                return;
            }
            let grant_type = 'password';
            //登录接口
            await apiLoginPassword({
                username: this.username,
                password: this.password,
                grant_type,
                scope: 'server'
            })
                .then(res => {
                    setToken(res.access_token);
                    setRefreshToken(res.refresh_token);
                    if (this.btnText == 0) {
                        if (res.code != 1) {
                            // 登陆成功,存储相关信息
                            setToken(res.access_token);
                            setRefreshToken(res.refresh_token);
                            setUsernameKey(res.username);
                            //查询用户详细信息并储存
                            this.$reqGet('getUserEntity')
                                .then(res => {
                                    this.$u.toast('登录成功');
                                    this.setUserTabbar(res.data.type);
                                    uni.setStorageSync('roleType', res.data.type);
                                    setCustomerId(res.data.customerid);
                                    setName(res.name);
                                    uni.hideLoading();
                                    //跳转页面
                                    this.$nextTick(() => {
                                        redirectHome();
        },
        data() {
            return {
                username: '', // 客户
                // username:'13333333331',//货代
                // username: '13333333332',// 司机
                password: '',
                remember: true,
                baseUrl: ''
            };
        },
        methods: {
            ...mapMutations(['setUserTabbar']),
            //登录
            async submit() {
                uni.showLoading({
                    title: '登录中...'
                });
                //表单校验
                if (this.username.length === 0) {
                    this.$u.toast('请输入账号');
                    return;
                }
                if (this.password.length === 0) {
                    this.$u.toast('请输入密码');
                    return;
                }
                let grant_type = 'password';
                //登录接口
                await apiLoginPassword({
                        username: this.username,
                        password: this.password,
                        grant_type,
                        scope: 'server'
                    })
                    .then(res => {
                        setToken(res.access_token);
                        setRefreshToken(res.refresh_token);
                        if (this.btnText == 0) {
                            if (res.code != 1) {
                                // 登陆成功,存储相关信息
                                setToken(res.access_token);
                                setRefreshToken(res.refresh_token);
                                setUsernameKey(res.username);
                                //查询用户详细信息并储存
                                this.$reqGet('getUserEntity')
                                    .then(res => {
                                        this.$u.toast('登录成功');
                                        this.setUserTabbar(res.data.type);
                                        uni.setStorageSync('roleType', res.data.type);
                                        uni.setStorageSync("userId", res.data.userId)
                                        setCustomerId(res.data.customerid);
                                        setName(res.name);
                                        uni.hideLoading();
                                        //跳转页面
                                        this.$nextTick(() => {
                                            redirectHome();
                                        });
                                    })
                                    .catch(err => {
                                        this.$u.toast('登录异常!');
                                        console.log(err);
                                    });
                                })
                                .catch(err => {
                                    this.$u.toast('登录异常!');
                                    console.log(err);
                                });
                        } else {
                            uni.hideLoading();
                            this.$u.toast(res.msg);
                        }
                    } else {
                        uni.login({
                            success: res => {
                                if (res.code) {
                                    uni.setStorageSync('bindcode', res.code);
                                }
                            }
                        });
                        if (uni.getStorageSync('bindcode')) {
                            this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('bindcode') }, 'params').then(res => {
                            } else {
                                uni.hideLoading();
                                if (res.code == 0) {
                                    this.$u.toast('绑定成功!即将回到登录页!');
                                    setTimeout(() => {
                                        uni.navigateBack();
                                    }, 1000);
                                } else {
                                    this.$u.toast(res.msg ? res.msg : '绑定失败');
                                this.$u.toast(res.msg);
                            }
                        } else {
                            uni.login({
                                success: res => {
                                    if (res.code) {
                                        uni.setStorageSync('bindcode', res.code);
                                    }
                                }
                            });
                            if (uni.getStorageSync('bindcode')) {
                                this.$reqPost('wxBind', { state: 'MINI', code: uni.getStorageSync('bindcode') },
                                    '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);
                });
                    })
                    .catch(e => {
                        this.$u.toast(e);
                    });
            }
        }
    }
};
    };
</script>
<style lang="scss">
@import 'index.scss';
.dengluBtn {
    margin-top: 80rpx;
}
</style>
    @import 'index.scss';
    .dengluBtn {
        margin-top: 80rpx;
    }
</style>
pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -169,7 +169,9 @@
                        title: this.messageList.title.slice(0, 8) + '...',
                        content: removeTags(this.messageList.content).trim().slice(0, 8) + '...'
                    }
                    this.messagePushShow = true;
                    if (uni.getStorageSync('userId') === this.messageList.appUserId) {
                        this.messagePushShow = true;
                    }
                } else {}
            }
        },
@@ -235,29 +237,26 @@
            userAuthorization() {
                wx.getSetting({
                    success(res) {
                        // wx.startRecord();
                        console.log('授权相机/麦克风权限success');
                        console.log(res);
                        if (!res.authSetting['scope.record'] || !res.authSetting['scope.camera']) {
                            if (!res.authSetting['scope.camera']) {
                                wx.authorize({
                                    scope: 'scope.camera',
                                    success() {
                                        // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                                        console.log('授权成功');
                                        console.log('相机成功');
                                    },
                                    fail() {
                                        console.log('授权失败');
                                        console.log('相机失败');
                                    }
                                });
                            } else if (!res.authSetting['scope.record']) {
                                wx.authorize({
                                    scope: 'scope.record',
                                    success() {
                                        // 用户已经同意小程序使用录音功能,后续调用 wx.startRecord 接口不会弹窗询问
                                        console.log('授权成功');
                                        console.log('录音成功');
                                    },
                                    fail: () => {
                                        console.log('授权失败');
                                        console.log('录音失败');
                                    }
                                });
                            }
@@ -265,7 +264,7 @@
                    },
                    fail() {
                        console.log('获取失败');
                    }
                    },
                });
            },
            // 初始化websocket