| | |
| | | } else { |
| | | this.useTimeSet = setTimeout(() => { |
| | | that.$store.commit("setMsg", d) |
| | | clearTimeout(this.useTime); |
| | | that.useTime = null; |
| | | clearTimeout(this.useTimeSet); |
| | | that.useTimeSet = null; |
| | | }, that.setTimes) |
| | | } |
| | | }, |
| | |
| | | } |
| | | }); |
| | | }, |
| | | 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加载完成后的操作 |
| | | // 清除定时器 |
| | |
| | | } |
| | | // 首次执行 |
| | | checkDom(); |
| | | } |
| | | }, |
| | | }, |
| | | computed: { |
| | | isOnTaskValue() { |
| | |
| | | // 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 - 各种参数 |
| | |
| | | left: 0; |
| | | bottom: 0; |
| | | background-color: #e8e8e8; |
| | | z-index: 100; |
| | | z-index: 1000000; |
| | | } |
| | | |
| | | .once { |