qingyiay
2023-05-16 72935b2a35765bcc3622561bb06f2eccd64caf83
修改上传图片时页面跳转问题
10个文件已修改
148 ■■■■ 已修改文件
App.vue 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-index/customer-index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/customer-page/customer-my/customer-my.vue 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/login/userPassword.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/public-page/forward/forward.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/public-page/mapRoute/mapRoute.vue 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
pages/register/register.vue 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
store/index.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
App.vue
@@ -2,10 +2,12 @@
import { mapState, mapMutations } from 'vuex';
export default {
    onShow() {},
    onLaunch() {},
    onHide() {
        console.log('appvue隐藏后台');
        this.changeisconnect(false);
        if (!this.globalisconnect) {
        console.log(this.globalisUploadimg);
        if (!this.globalisconnect && !this.globalisUploadimg) {
            uni.switchTab({
                url: '/pages/tabbar-page/index-tabbar/index-tabbar'
            });
@@ -15,7 +17,7 @@
        ...mapMutations(['changeisconnect'])
    },
    computed: {
        ...mapState(['globalisconnect'])
        ...mapState(['globalisconnect', 'globalisUploadimg'])
    }
};
</script>
pages/customer-page/customer-index/customer-index.vue
@@ -429,7 +429,7 @@
                .second-line {
                    width: 100%;
                    height: vww(30);
                    margin-left: vww(12);
                    margin-left: vww(16);
                    display: flex;
                    align-items: center;
                    justify-content: flex-start;
pages/customer-page/customer-my/customer-my.vue
@@ -16,7 +16,7 @@
                                    <u-swipe-action-item
                                        :options="options1"
                                        v-for="(item, index) in huoDaiData"
                                        :index="index"
                                        :index="item.userId"
                                        :name="item.userId"
                                        :key="index"
                                        @click="deleteHuoDaiClick"
@@ -43,7 +43,7 @@
                                    <u-swipe-action-item
                                        :options="options1"
                                        v-for="(item, index) in fleetData"
                                        :index="index"
                                        :index="item.id"
                                        :name="item.id"
                                        :key="index"
                                        @click="deleteFleetClick"
@@ -218,15 +218,19 @@
                title: '加载中...'
            });
            // 新建车队
            this.$reqPost('saveFleet', this.addGroupForm, 'params').then(res => {
                uni.hideLoading();
                if (res.code == 0) {
                    this.$u.toast('添加成功');
            this.$reqPost('saveFleet', this.addGroupForm, 'params')
                .then(res => {
                    uni.hideLoading();
                    console.log(res, '新建车队');
                    if (res.code == 0) {
                        this.$u.toast('添加成功');
                    } else {
                        this.$u.toast(res.msg ? res.msg : '添加失败');
                    }
                })
                .then(r => {
                    this.getFleet();
                } else {
                    this.$u.toast(res.msg ? res.msg : '添加失败');
                }
            });
                });
            this.updateGroupShow = false;
        },
        // 删除货代
@@ -251,17 +255,18 @@
            uni.showLoading({
                title: '加载中...'
            });
            this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params').then(res => {
                uni.hideLoading();
                if (res.code == 0) {
                    if (res.data) {
            this.$reqPost('deleteHuoDai', { id: this.deleteHuoDaiId }, 'params')
                .then(res => {
                    uni.hideLoading();
                    if (res.code == 0) {
                        this.$u.toast('删除成功');
                        this.getAllHuoDaiByCustomerId();
                    } else {
                        this.$u.toast('删除失败');
                        this.$u.toast(res.msg ? res.msg : '删除失败');
                    }
                }
            });
                })
                .then(r => {
                    this.getAllHuoDaiByCustomerId();
                });
        },
        // 删除车队
        deleteFleetClick(args) {
@@ -285,16 +290,19 @@
            uni.showLoading({
                title: '加载中...'
            });
            this.$reqPost('deleteFleet', { id: this.deleteFleetId }, 'params').then(res => {
                console.log('删除车队', res);
                if (res.code == 0) {
                    this.$u.toast('删除成功');
                } else {
                    this.$u.toast(res.msg ? res.msg : '删除失败');
                }
                uni.hideLoading();
                this.getFleet();
            });
            this.$reqPost('deleteFleet', { id: this.deleteFleetId }, 'params')
                .then(res => {
                    console.log('删除车队', res);
                    if (res.code == 0) {
                        this.$u.toast('删除成功');
                    } else {
                        this.$u.toast(res.msg ? res.msg : '删除失败');
                    }
                    uni.hideLoading();
                })
                .then(() => {
                    this.getFleet();
                });
        },
        // 货代详情
        toFreightForwarderDetails(userId) {
pages/driver-page/driver-index/bill-of-lading-details/weighingDevice/weighingDevice.vue
@@ -259,9 +259,6 @@
            handler(v) {
                this.weighData.weigh = this.realTimeWeigh = v;
                console.log(this.realTimeWeigh, '真实重量改变了');
                // setTimeout(() => {
                //     this.weighData.weigh = this.realTimeWeigh = v;
                // }, 0);
            },
            deep: true,
            immediate: true
pages/freight-forwarder-page/freightForwarder-index/freightForwarder-index.vue
@@ -10,10 +10,9 @@
                    <view class="first-line">
                        <view class="main-information">
                            <view class="sign">装</view>
                            <view class="filedname">
                                <text v-if="item.orderType == '外销' || item.orderType == '内销' || item.orderType == '转出'">{{ item.deptName.slice(0, 16) }}</text>
                                <text v-else-if="item.orderType == '外购' || item.orderType == '内购' || item.orderType == '转入'">{{ item.customerName.slice(0, 16) }}</text>
                                <text v-show="item.deptName.length >= 15 || item.customerName.length >= 15">...</text>
                            <view class="filedname exceedHide">
                                <text v-if="item.orderType == '外销' || item.orderType == '内销' || item.orderType == '转出'">{{ item.deptName }}</text>
                                <text v-else-if="item.orderType == '外购' || item.orderType == '内购' || item.orderType == '转入'">{{ item.customerName }}</text>
                            </view>
                        </view>
                        <view class="main-divider"></view>
@@ -25,10 +24,9 @@
                    <view class="first-extra">
                        <view class="main-information">
                            <view class="sign">卸</view>
                            <view class="filedname">
                                <text v-if="item.orderType == '外销' || item.orderType == '内销' || item.orderType == '转出'">{{ item.customerName.slice(0, 16) }}</text>
                                <text v-else-if="item.orderType == '外购' || item.orderType == '内购' || item.orderType == '转入'">{{ item.deptName.slice(0, 16) }}</text>
                                <text v-show="item.customerName.length >= 15 || item.deptName.length >= 15">...</text>
                            <view class="filedname exceedHide">
                                <text v-if="item.orderType == '外销' || item.orderType == '内销' || item.orderType == '转出'">{{ item.customerName }}</text>
                                <text v-else-if="item.orderType == '外购' || item.orderType == '内购' || item.orderType == '转入'">{{ item.deptName }}</text>
                            </view>
                        </view>
                    </view>
@@ -340,6 +338,11 @@
        }
    }
}
.exceedHide {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
::v-deep.freightForwarder-index {
    width: 100%;
    margin: 0 auto;
pages/login/userPassword.vue
@@ -7,7 +7,7 @@
                    clearable
                    maxlength="32"
                    type="text"
                    placeholder="请输入用户名"
                    placeholder="请输入手机号"
                    prefixIcon="account"
                    prefixIconStyle="font-size: 22px;color: #909399"
                ></u--input>
pages/public-page/forward/forward.vue
@@ -19,7 +19,7 @@
            <view class="card-block">
                <view class="forward-card" v-for="(val, index) in jhOrderPlanForwardList" :key="index">
                    <u-swipe-action>
                        <u-swipe-action-item :options="options1" @click="deleteGroup(index, val)">
                        <u-swipe-action-item :options="options1" @click="deleteGroup(index, val)" :index="index" :name="val.xsUserId || val.fleetId">
                            <view class="card-content">
                                <u--form labelPosition="left" :model="forwardForm" ref="form1">
                                    <u-form-item label="转发对象" labelWidth="21%" ref="item1" @click="forwardObjectClick(index)">
pages/public-page/mapRoute/mapRoute.vue
@@ -15,7 +15,7 @@
                <text>{{ duration || '' }}</text>
            </view>
        </view>
        <!-- <view class="" @click="awaken"><button type="default">跳转</button></view> -->
        <view class="open-button" @click="awaken"><button type="default">跳转</button></view>
    </view>
</template>
@@ -213,27 +213,11 @@
        },
        // 唤醒
        awaken() {
            uni.getSystemInfo({
                success: function(res) {
                    if (res.platform == 'android') {
                        uni.navigateTo({
                            url: `intent://map/routeplan?type=drive&fromcoord=&from=${_this.fromLocation}&tocoord=${_this.toLocation.latitude},${
                                _this.toLocation.longitude
                            }&to=name&policy=0&referer=myapp#Intent;scheme=qqmap;package=com.tencent.map;end`
                        });
                    } else if (res.platform == 'ios') {
                        uni.navigateTo({
                            url: `qqmap://map/routeplan?type=drive&fromcoord=&from=${_this.fromLocation}&tocoord=${_this.toLocation.latitude},${
                                _this.toLocation.longitude
                            }&to=name&policy=0&referer=myapp`
                        });
                    } else {
                        uni.showToast({
                            title: '当前设备不支持地图导航',
                            icon: 'none'
                        });
                    }
                }
            uni.openLocation({
                latitude: this.markers[1].latitude,
                longitude: this.markers[1].longitude,
                name: '目的地位置',
                address: '目的地位置'
            });
        }
    },
@@ -268,4 +252,8 @@
        }
    }
}
.open-button {
    width: 200rpx;
    margin: 10rpx 0;
}
</style>
pages/register/register.vue
@@ -34,7 +34,7 @@
                <u-form-item prop="carNo" label="车牌号" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required>
                    <u--input v-model="registerFormModel.carNo" placeholder="请输入内容" clearable></u--input>
                </u-form-item>
                <u-form-item prop="carImg" label="车辆照片" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required>
                <u-form-item prop="carImg" label="车辆照片" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required @click="beforeRead">
                    <u-upload
                        :fileList="fileList1"
                        deletable
@@ -51,7 +51,7 @@
                        mode="widthFix" style="width: 250px;height: 150px;"></image> -->
                    </u-upload>
                </u-form-item>
                <u-form-item prop="drivingImg" label="行驶证" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required>
                <u-form-item prop="drivingImg" label="行驶证" labelWidth="20%" borderBottom v-if="radiovalue1 == '司机'" required @click="beforeRead">
                    <u-upload
                        :fileList="fileList2"
                        deletable
@@ -89,6 +89,7 @@
<script>
import { apiRegister } from '@/api/publicInterface.js';
import { BaseUrl } from '@/api/publicInterface.js';
import { mapMutations } from 'vuex';
export default {
    // onLoad: function() {
    //   // 查看是否授权
@@ -265,6 +266,7 @@
        }
    },
    methods: {
        ...mapMutations(['changeisUploadimg']),
        registerClick() {
            if (this.registerFormModel.password == this.registerFormModel.confirmPassword) {
                this.$refs.regesterFormRef
@@ -284,7 +286,7 @@
                                        uni.redirectTo({ url: '/pages/login/login' });
                                    }, 1000);
                                } else {
                                    this.$u.toast(res.data.data ? res.data.data : '添加失败');
                                    this.$u.toast(res.msg ? res.msg : '添加失败');
                                }
                            })
                            .catch(err => {
@@ -319,8 +321,12 @@
            }
        },
        // 上传图片方法
        beforeRead() {
            this.changeisUploadimg(true);
        },
        // 删除图片
        deletePic(event) {
            this.changeisUploadimg(true);
            this[`fileList${event.name}`].splice(event.index, 1);
        },
        // 新增图片
store/index.js
@@ -71,7 +71,8 @@
            weight: '',
            userId: ''
        },
        globalisconnect: false
        globalisconnect: false,
        globalisUploadimg: false
    },
    mutations: {
        lengthchange(state, payload) {
@@ -115,6 +116,9 @@
        // 改版全局websocket状态
        changeisconnect(state, payload) {
            state.globalisconnect = payload
        },
        changeisUploadimg(state, payload) {
            state.globalisUploadimg = payload
        }
    }
})