+
liuyg
2022-02-22 97a2c6d0a2130eb96e6cc370ca0d9f88c3be3c46
+
1 files modified
71 ■■■■■ changed files
pages/grabOrders/map.vue 71 ●●●●● patch | view | raw | blame | history
pages/grabOrders/map.vue
@@ -173,8 +173,8 @@
                } else {
                    this.useTimeSet = setTimeout(() => {
                        that.$store.commit("setMsg", d)
                        clearTimeout(this.useTime);
                        that.useTime = null;
                        clearTimeout(this.useTimeSet);
                        that.useTimeSet = null;
                    }, that.setTimes)
                }
            },
@@ -225,51 +225,32 @@
                    }
                });
            },
            getDom(name, fn) {
                this.query.select('#Umain').boundingClientRect(data => {
                    if (fn) {
                        fn(data)
                    }
                }).exec()
            },
            checkDomHeight(data) {
                //  声明定时器
                var timer = null;
                var timer = null,
                    that = this;
                //  检查dom是否执行完成
                function checkDom() {
                    let useData;
                    if (data.domName == 'not') {
                        useData = this[data.name];
                    } else {
                        let dom = document[data.domName](data.name);
                        useData = dom;
                    }
                    if (useData[0]) {
                        //  执行dom加载完成后的操作
                        //  清除定时器
                        if (!timer) {
                            clearTimeout(timer);
                        }
                    that.query.select(data.name).boundingClientRect(data => {
                        // console.log('11111111')
                        // console.log(data);
                        if (data.fn) {
                            //回调函数
                            data.fn(useData);
                            data.fn(data);
                            return;
                        } else {
                            return dom;
                            return data;
                        }
                    } else {
                        //  自我调用
                        timer = setTimeout(checkDom, 200);
                    }
                }
                //  首次执行
                checkDom();
            },
            checkDomHeightId(data) {
                //  声明定时器
                var timer = null;
                //  检查dom是否执行完成
                function checkDom() {
                    let useData;
                    if (data.domName == 'not') {
                        useData = this[data.name];
                    } else {
                        let dom = document[data.domName](data.name);
                        useData = dom;
                    }
                    }).exec()
                    return;
                    if (useData) {
                        //  执行dom加载完成后的操作
                        //  清除定时器
@@ -290,7 +271,7 @@
                }
                //  首次执行
                checkDom();
            }
            },
        },
        computed: {
            isOnTaskValue() {
@@ -432,13 +413,23 @@
            //         that.sendRequestData("给html", 2);
            //     }, 10000)
            // }
            that.query = uni.createSelectorQuery();
            const _this = this;
            uni.getSystemInfo({
                success: (res) => {
                    // _this.mapHeight = res.screenHeight - res.statusBarHeight
                    _this.mapHeight = res.screenHeight /2
                    // setTimeout(() => {
                    //     that.getDom('#Umain', data => {
                            console.log(res.screenHeight - res.statusBarHeight -420)
                    _this.mapHeight = res.screenHeight - res.statusBarHeight -420
                    _this.mapHeight = _this.mapHeight
                    // })
                    // }, 1000)
                    // that.query.select('#Umain').boundingClientRect(data => {
                    //     console.log('11111111')
                    //     console.log(data)
                    // }).exec();
                    // console.log(res)
                    // let info = uni.createSelectorQuery().select("Umain");
                    // info.boundingClientRect(function(data) { //data - 各种参数
@@ -560,7 +551,7 @@
        left: 0;
        bottom: 0;
        background-color: #e8e8e8;
        z-index: 100;
        z-index: 1000000;
    }
    .once {