| | |
| | | <!-- <web-view :src="urls" @message="message"></web-view> --> |
| | | <map :scale='18' id="myMap" style="width: 100%" :style="{height: mapHeight + 'px'}" :markers="markersCom" |
| | | :longitude="longitude" :latitude="latitude" :circles="circlesCom" :polyline="mypolylinesCom" |
| | | show-location="true"></map> |
| | | <view id="Umain"> |
| | | show-location="true"> |
| | | <cover-view class="dingwBut" @click="mapControlsBack"> |
| | | <cover-image :class="[beginFindDW?'dingwButImg':'']" src="./map/img/dingwei.png" |
| | | @click="mapControlsBack"></cover-image> |
| | | </cover-view> |
| | | </map> |
| | | <view id="Umain" :style="{ height: activeHeight}" @touchstart="touchstart" @touchend="touchend" |
| | | @touchmove="touchmove"> |
| | | <view :class="['activeTip',activeTip?'isOpens':'notOpens'] " :style="{height:'30px'}"></view> |
| | | <view class="once-b"> |
| | | 任务详情 |
| | | </view> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import $moveWindow from "./map/js/move.js" |
| | | import $moveUniAppMap from "./map/js/moveUniAppMap.js" |
| | | export default { |
| | | data() { |
| | | return { |
| | |
| | | rid: '', |
| | | webV: null, |
| | | wv: null, |
| | | mapHeight: 0, |
| | | latitude: 28.687205773173343, |
| | | longitude: 115.8995839881188, |
| | | circles: [], //圆 |
| | |
| | | }, |
| | | bye: true, |
| | | types: '', //android? |
| | | moveDom: null, //移动实体类 |
| | | activeHeight: "auto ", //活动高度 默认自动 |
| | | afterClass: {}, |
| | | activeTip: false, //是否展开 |
| | | |
| | | mapControls: [{ |
| | | id: "1", |
| | | position: 20, |
| | | iconPath: "/static/tabbar/addSelectedIcon.png", |
| | | clickable: true, |
| | | }], //地图控件 |
| | | beginFindDW: false, //是否旋转 |
| | | } |
| | | }, |
| | | methods: { |
| | | mapControlsBack() { |
| | | // console.log(1111) |
| | | this.beginFindDW = true; |
| | | this.getLocationInfo("notSet"); |
| | | |
| | | }, |
| | | touchstart(e) { |
| | | // console.log(e.changedTouches[0].clientY) |
| | | if (this.moveDom) { |
| | | this.moveDom.ListenerTouchstart(e) |
| | | } |
| | | }, |
| | | touchmove(e) { |
| | | // console.log(e.changedTouches[0].clientY) |
| | | if (this.moveDom) { |
| | | this.moveDom.ListenerTouchmove(e) |
| | | } |
| | | }, |
| | | touchend(e) { |
| | | // console.log(e.changedTouches[0].clientY) |
| | | if (this.moveDom) { |
| | | this.moveDom.ListenerTouchend(e) |
| | | } |
| | | }, |
| | | openAPP(type) { |
| | | let that = this; |
| | | if (type == "oks") { |
| | |
| | | // } |
| | | // }) |
| | | let d = { |
| | | rid:rid, |
| | | rid: rid, |
| | | serid: serid, |
| | | type: type, |
| | | // data: JSON.stringify(item), |
| | |
| | | latitude: a, |
| | | }); |
| | | }, |
| | | getLocationInfo() { |
| | | getLocationInfo(val) { |
| | | var that = this |
| | | uni.getLocation({ |
| | | type: 'wgs84', |
| | |
| | | that.longitude = res.longitude |
| | | console.log(that.latitude) |
| | | console.log(that.longitude) |
| | | let d = { |
| | | id: that.ourData.id, |
| | | intlat: [res.longitude, res.latitude] |
| | | } |
| | | that.timeBeginSet(d) //30秒送数据 |
| | | that.map.moveToLocation({ |
| | | latitude: res.latitude, |
| | | longitude: res.longitude |
| | |
| | | radius: 10, //半径 |
| | | strokeWidth: 2 //描边的宽度 |
| | | }] |
| | | that.beginFindDW = false; |
| | | if (val != "notSet") { |
| | | let d = { |
| | | id: that.ourData.id, |
| | | intlat: [res.longitude, res.latitude] |
| | | } |
| | | that.timeBeginSet(d) //30秒送数据 |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | |
| | | onReady() { |
| | | let that = this; |
| | | |
| | | this.types = uni.getSystemInfoSync().platform; |
| | | this.types = uni.getSystemInfoSync(); |
| | | |
| | | |
| | | let activeHeight = 0; |
| | | this.getDom("#Umain", (res) => { |
| | | // console.log(res, 1111111111111111111111111111) |
| | | that.mapHeight = that.types.windowHeight - res.height + 30; |
| | | // that.mapHeight = 30; |
| | | that.activeHeight = res.height; |
| | | activeHeight = res.height; |
| | | let minHeight = 4 * 40 + 30 |
| | | let d = { |
| | | activeDom: "#Umain", |
| | | adaptDom: "#myMap", |
| | | uni: uni, |
| | | maxHeight: activeHeight, //在外面获取活动区域的高度, |
| | | //在构造中动态获取会实时改变这个值 |
| | | //导致改变固定的最高高度 |
| | | useHeight: minHeight, //缩小后的高度、、可设置成保留高度 |
| | | critical: (activeHeight - minHeight) / 3, //收缩程度,,可设置成总滑动距离的1/2 (maxHeight - useHeight) / 2 |
| | | fn: (res) => { |
| | | // console.log(res) |
| | | if (res.state != 'on') { |
| | | that.mapHeight = that.types.windowHeight - res.height + 30; |
| | | } else { |
| | | if (res.translate) { |
| | | that.activeTip = true; |
| | | } |
| | | if (res.translate) { |
| | | that.activeTip = false; |
| | | } |
| | | } |
| | | |
| | | if (res.translate === true) { |
| | | that.activeTip = true; |
| | | } else if (res.translate === false) { |
| | | that.activeTip = false; |
| | | } |
| | | that.activeHeight = res.height + 'px'; |
| | | } |
| | | } |
| | | that.moveDom = new $moveUniAppMap(d); |
| | | }) |
| | | // if (type == "android") { |
| | | // this.useHeight = "calc(100vh - 40px)"; |
| | | // } |
| | |
| | | // data = JSON.stringify({ |
| | | datas = { |
| | | appenUrl: "http://192.168.0.108:83/", |
| | | butCT: "beginUp", |
| | | butCT: "begin", |
| | | buttype: 0, |
| | | captain: "我", |
| | | city: "南昌市", |
| | |
| | | } |
| | | that.ourData = data; |
| | | |
| | | |
| | | uni.getSystemInfo({ //初始化地图高度 |
| | | success(res) { |
| | | that.mapHeight = res.windowHeight; |
| | | } |
| | | }); |
| | | // console.log(data); |
| | | // return |
| | | // console.log(options.html) |
| | |
| | | // } |
| | | that.query = uni.createSelectorQuery(); |
| | | const _this = this; |
| | | uni.getSystemInfo({ |
| | | success: (res) => { |
| | | // _this.mapHeight = (res.screenHeight - res.statusBarHeight) /2 |
| | | // setTimeout(() => { |
| | | // that.getDom('#Umain', data => { |
| | | // console.log(res.statusBarHeight, res.screenHeight, data, 'dat') |
| | | // console.log(res.screenHeight - data.height + res |
| | | // .statusBarHeight) |
| | | // _this.mapHeight = res.screenHeight - res.statusBarHeight - 420 |
| | | that.mapHeight = res.screenHeight - res.statusBarHeight - 466 |
| | | that.mapHeight = that.mapHeight |
| | | // }) |
| | | // }, 1000) |
| | | // uni.getSystemInfo({ |
| | | // success: (res) => { |
| | | // // _this.mapHeight = (res.screenHeight - res.statusBarHeight) /2 |
| | | // // setTimeout(() => { |
| | | // // that.getDom('#Umain', data => { |
| | | // // console.log(res.statusBarHeight, res.screenHeight, data, 'dat') |
| | | // // console.log(res.screenHeight - data.height + res |
| | | // // .statusBarHeight) |
| | | // // _this.mapHeight = res.screenHeight - res.statusBarHeight - 420 |
| | | // that.mapHeight = res.screenHeight - res.statusBarHeight - 466 |
| | | // that.mapHeight = that.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 - 各种参数 |
| | | // console.log(data.width) // 获取元素宽度 |
| | | // }).exec() |
| | | } |
| | | }) |
| | | // // 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 - 各种参数 |
| | | // // console.log(data.width) // 获取元素宽度 |
| | | // // }).exec() |
| | | // } |
| | | // }) |
| | | // console.log(document.getElementById("Umain")) |
| | | // this.checkDomHeightId({ |
| | | // domName: "getElementById", |
| | |
| | | |
| | | <style lang="scss"> |
| | | .content { |
| | | flex: 1; |
| | | height: 100%; |
| | | // flex: 1; |
| | | // height: 100%; |
| | | overflow: hidden; |
| | | // position: relative; |
| | | } |
| | | |
| | | #Umain { |
| | | position: absolute; |
| | | width: 100%; |
| | | height: auto; |
| | | left: 0; |
| | | bottom: 0; |
| | | background-color: #e8e8e8; |
| | | z-index: 1000000; |
| | | left: 0; |
| | | width: 100%; |
| | | overflow: hidden; |
| | | } |
| | | |
| | | .once { |
| | |
| | | height: 50px; |
| | | } |
| | | } |
| | | |
| | | .notOpens { |
| | | &::after { |
| | | content: ""; |
| | | display: block; |
| | | width: 20px; |
| | | height: 4px; |
| | | background-color: rgba(202, 202, 202, 1); |
| | | position: absolute; |
| | | top: 10px; |
| | | left: calc(50% - 10px); |
| | | border-radius: 5px; |
| | | transition: all 0.1s; |
| | | } |
| | | } |
| | | |
| | | .activeTip { |
| | | background-color: #fff; |
| | | } |
| | | |
| | | .isOpens { |
| | | &::after { |
| | | content: ""; |
| | | display: block; |
| | | width: 13px; |
| | | height: 4px; |
| | | background-color: rgba(202, 202, 202, 1); |
| | | position: absolute; |
| | | top: 10px; |
| | | left: calc(50% - 12px); |
| | | border-radius: 5px; |
| | | transform: rotate(30deg); |
| | | transition: all 0.1s; |
| | | } |
| | | |
| | | &::before { |
| | | content: ""; |
| | | display: block; |
| | | width: 13px; |
| | | height: 4px; |
| | | background-color: rgba(202, 202, 202, 1); |
| | | position: absolute; |
| | | top: 10px; |
| | | left: calc(50% - 4px); |
| | | border-radius: 5px; |
| | | transform: rotate(-30deg); |
| | | transition: all 0.1s; |
| | | } |
| | | } |
| | | |
| | | .dingwBut { |
| | | width: 80upx; |
| | | height: 80upx; |
| | | background-color: #fff; |
| | | border-radius: 20upx; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | position: absolute; |
| | | bottom: 40upx; |
| | | right: 40upx; |
| | | |
| | | // background-color: red; |
| | | // .dingwButImg { |
| | | // width: 80%; |
| | | // height: 80%; |
| | | // } |
| | | // .icon{ |
| | | // } |
| | | // &::after{ |
| | | // content: url(map/img/dingwei.png); |
| | | // } |
| | | .dingwButImg { |
| | | animation: mymove 5s infinite; |
| | | animation-timing-function: linear; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @keyframes mymove { |
| | | 0% { |
| | | transform: rotate(0deg); |
| | | } |
| | | |
| | | 100% { |
| | | transform: rotate(1turn); |
| | | } |
| | | } |
| | | </style> |