付延余
2023-03-21 dc46a242306048ac558c287cdf8d421399cb4fdd
code码调整
11个文件已修改
1个文件已添加
178 ■■■■ 已修改文件
api/publicInterface.js 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/request.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages.json 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/customer-index.vue 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-my/customer-my.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/appointment/appointment.vue 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue 42 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/driver-index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/userPassword.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/register/register.vue 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
api/publicInterface.js
@@ -3,7 +3,8 @@
// 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"
const BaseUrl = "http://192.168.0.130:9999"
// 登录
// function apiLogin({
api/request.js
@@ -78,9 +78,10 @@
    500: responseError
}
// const BaseUrl = "http://192.168.3.159:9999/";
// const BaseUrl = "http://192.168.0.120:9997";
const BaseUrl = "http://192.168.0.120:9997";
// const BaseUrl = "http://192.168.0.120:9997"
// const webSocketUrl = "ws://192.168.0.120:9997/wrzs/ws/info"
const BaseUrl = "http://192.168.0.130:9997";
const webSocketUrl = "ws://192.168.0.130:9997/wrzs/ws/info"
// 请求拦截
const fetch = (url, opt) => {
@@ -146,5 +147,6 @@
export {
    fetch,
    BaseUrl
    BaseUrl,
    webSocketUrl
}
pages.json
@@ -148,6 +148,15 @@
            }
        }
        ,{
            "path" : "pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock",
            "style" :
            {
                "navigationBarTitleText": "",
                "enablePullDownRefresh": false
            }
        }
    ],
    "tabBar": {
        // "color": "#999794",
pages/customer-page/addTo-freightForwarder-driver/addTo-freightForwarder-driver.vue
@@ -74,9 +74,8 @@
                        });
                    }, 1000);
                } else {
                    this.$u.toast(res.msg ? res.msg : '未成功添加');
                    this.$u.toast(res.data ? res.data : '未成功添加');
                }
                console.log('邀请货代', res);
            });
        },
        // 邀请司机
@@ -90,7 +89,7 @@
                    });
                } else {
                    uni.showToast({
                        title: res.msg,
                        title: res.data,
                        icon: 'null',
                        duration: 2000
                    });
pages/customer-page/customer-index/customer-index.vue
@@ -61,7 +61,6 @@
<script>
import card from '@/components/card/card.vue';
import { customerId } from '@/utils/status';
// import colorGradient from '@/uni_modules/uview-ui/libs/function/colorGradient';
import { todayDate } from '@/utils/util.js';
export default {
    components: {
@@ -80,7 +79,6 @@
    },
    onShow() {
        this.init();
        console.log(todayDate, '获取今天的日期');
    },
    methods: {
        init() {
@@ -96,10 +94,6 @@
                uni.hideLoading();
            });
        },
        // 领取点击
        // numInput(id) {
        // },
        popupDetermineClick() {
            if (this.receiveNum) {
                this.getOrderNum.num = this.receiveNum;
@@ -116,6 +110,8 @@
                            icon: 'none',
                            duration: 1000
                        });
                    } else {
                        this.$u.toast(res.data ? res.data : '领取失败');
                    }
                });
            } else {
@@ -128,17 +124,14 @@
        },
        /**
         * @客户领取
         * 领取弹框
         */
        receiveClick(item) {
            this.show = true;
            this.getOrderNum.id = item.id; // 获取领取提煤单的id
        },
        open() {
            console.log('打开了');
        },
        open() {},
        close() {
            console.log('关闭方法');
            this.show = false;
            this.receiveNum = null;
        },
pages/customer-page/customer-my/customer-my.vue
@@ -177,8 +177,12 @@
            // 新建车队
            this.$reqPost('saveFleet', this.addGroupForm, 'params').then(res => {
                uni.hideLoading();
                console.log('新建车队', res);
                if (res.code == 0) {
                    this.$u.toast('添加成功');
                this.getFleet();
                } else {
                    this.$u.toast(res.data ? res.data : '添加失败');
                }
            });
            this.updateGroupShow = false;
        },
pages/driver-page/appointment/appointment.vue
@@ -36,7 +36,7 @@
            },
            yuYuePostParams:{
                takeCoalId: null,
                yuYueId: null,
                yuYueId: null
            },
            yuYueData: [],
            isRCSQ: false, // 入场申请接口控制
@@ -95,6 +95,8 @@
            this.$reqPost('yuYue', { takeCoalId: this.yuYuePostParams.takeCoalId, yuYueId: this.yuYuePostParams.yuYueId }, 'params').then(res => {
                if (res.code == 0) {
                    this.$u.toast('预约成功!');
                } else {
                    this.$u.toast(res.data ? res.data : '预约失败');
                }
                setTimeout(() => {
                    this.yuYueList();
pages/driver-page/driver-index/bill-of-lading-details/punchTheClock/punchTheClock.vue
New file
@@ -0,0 +1,42 @@
<template>
    <!-- 打卡 -->
    <view class="punchTheClock">
        <!-- 打卡按钮 -->
        <view class="punchTheClock_container">
            <view class="punchTheClock_btn">签到/打卡</view>
            <view class="punchTheClock_text"><text>未进入考勤区域</text></view>
        </view>
    </view>
</template>
<script>
export default {
    data() {
        return {};
    },
    methods: {}
};
</script>
<style lang="scss" scoped>
.punchTheClock{
    display:flex;
    justify-content: center;
    align-items: center;
    .punchTheClock_container{
        .punchTheClock_btn{
            width:vww(240);
            height:vww(240);
            border-radius: 50%;
            background-color: #ffd63e;
            display:flex;
            justify-content: center;
            align-items: center;
        }
        .punchTheClock_text{
        }
    }
}
</style>
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -4,9 +4,18 @@
            <view class="top">
                <view class="top_left"><text>41.5</text></view>
                <view class="top_right">
                    <view class="">称重: <u--text type="success" text="正常" size="34"></u--text></view>
                    <view class="">红外: <u--text type="success" text="正常" size="34"></u--text></view>
                    <view class="">雷达: <u--text type="success" text="正常" size="34"></u--text></view>
                    <view class="">
                        称重:
                        <u--text type="success" text="正常" size="34"></u--text>
                    </view>
                    <view class="">
                        红外:
                        <u--text type="success" text="正常" size="34"></u--text>
                    </view>
                    <view class="">
                        雷达:
                        <u--text type="success" text="正常" size="34"></u--text>
                    </view>
                </view>
            </view>
            <view class="bottom"><text>TIP:当前状态正常可以称重</text></view>
@@ -29,6 +38,8 @@
</template>
<script>
let socket = null;
import { webSocketUrl } from '@/api/request.js';
export default {
    onLoad(params) {
        console.log('称重页面', params);
@@ -37,11 +48,28 @@
    data() {
        return {
            takeCoalId: null,
            weighList: {}
            weighList: {},
            webSocket: null // webSocket实例
            // lockReconnect: false, // 重连锁,避免多次重连
            // maxReconnect: 6, // 最大重连次数, -1 标识无限重连
            // reconnectTime: 0, // 重连尝试次数
            // heartbeat: {
            //     interval: 30 * 1000, // 心跳间隔时间
            //     timeout: 10 * 1000, // 响应超时时间
            //     pingTimeoutObj: null, // 延时发送心跳的定时器
            //     pongTimeoutObj: null, // 接收心跳响应的定时器
            //     pingMessage: JSON.stringify({ type: 'ping' }) // 心跳请求信息
            // }
        };
    },
    onShow() {
        this.init();
        this.initWebSocket();
    },
    computed: {
        token() {
            return uni.getStorageSync('token');
        }
    },
    methods: {
        init() {
@@ -60,6 +88,34 @@
            // this.$reqPost('saveWeigh',{id:this.takeCoalId,skin:'',hair:''}).then(res=>{
            //     console.log(res,"确认称重");
            // })
        },
        /**
         * 初始化 weoSocket
         */
        initWebSocket() {
            // let wsUrl = `wss://192.168.0.120:9997/wrzs/ws/info?access_token=${this.token}`;
            let wsUrl = `${webSocketUrl}?access_token=c954c7f5-f34b-453e-8c9d-e291747b401f`;
            socket = uni.connectSocket({
                url: wsUrl,
                header: {
                    CLIENT_TOC: 'Y'
                },
                complete: res => {
                    console.log(res, 'socket结果');
                }
            });
            socket.onOpen(() => {
                console.log('onOpen');
            });
            socket.onMessage(res => {
                console.log(res, '服务器返回的数据');
            }); // 获取服务器传来的数据,做相应处理
            socket.onClose(() => {
                console.log('close');
            });
            socket.onError(err => {
                console.log('socket报错', err);
            });
        }
    }
};
pages/driver-page/driver-index/driver-index.vue
@@ -162,12 +162,12 @@
        },
        // 抢单请求
        qiangDan(id) {
            // this.$reqPost('qiangDan', { orderPlanId: id, wxUserId: customerId }, 'params').then(res => {
            this.$reqPost('qiangDan', { orderPlanId: id }, 'params').then(res => {
                if (res.code == 0) {
                    this.$u.toast('抢单成功');
                } else {
                    this.$u.toast(res.data ? res.data : '抢单失败');
                }
                console.log('抢单', res);
                this.qiangDanList();
            });
        },
pages/login/userPassword.vue
@@ -43,7 +43,7 @@
    },
    data() {
        return {
            username: '18804050607',// 客户
            username: 'appuser',// 客户
            // username: '18805080506',// 王楠(司机)
            password: '123456',
            remember: true,
pages/register/register.vue
@@ -1,6 +1,5 @@
<template>
    <view class="register">
        <!-- <home-species title="注册"></home-species> -->
        <view class="registerForm">
            <u--form :rules="rules" :model="registerFormModel" ref="regesterFormRef">
                <u-form-item labelWidth="20%" label="选择身份" borderBottom ref="roleRef" required>
@@ -58,7 +57,6 @@
</template>
<script>
// import HomeSpecies from '@/components/home-species/HomeSpecies.vue';
import { apiRegister } from '@/api/publicInterface.js';
import { BaseUrl } from '@/api/publicInterface.js';
export default {
@@ -77,9 +75,6 @@
    //     }
    //   })
    // },
    components: {
        // HomeSpecies
    },
    // 监听页面初次渲染完成。注意如果渲染速度快,会在页面进入动画完成前触发
    onReady() {
        // this.$refs.regesterFormRef.setRules(this.rules);
@@ -236,7 +231,6 @@
                        this.registerFormModel.username = this.registerFormModel.phone;
                        apiRegister(this.registerFormModel)
                            .then(res => {
                                console.log(res);
                                if (res.data.code == 0) {
                                    uni.showToast({
                                        title: '注册成功,即将进入登录!',
@@ -247,7 +241,7 @@
                                        uni.redirectTo({ url: '/pages/login/login' });
                                    }, 1000);
                                } else {
                                    this.$u.toast(res.data.msg);
                                    this.$u.toast(res.data.data?res.data.data:'添加失败');
                                }
                            })
                            .catch(err => {
@@ -262,12 +256,6 @@
                this.$u.toast('两次密码不一致');
            }
        },
        // 音视频通话
        // callingIn() {
        //     uni.navigateTo({
        //         url: '/pages/calling-index/calling-index'
        //     });
        // },
        // 单选框事件
        groupChange(e) {
            console.log('单选框小组', e);