Merge branch 'master' of http://192.168.0.105:10010/r/qfqk-android
| | |
| | | }, |
| | | watch: { |
| | | socketValue() { |
| | | console.log(this.socketValue); |
| | | // console.log(this.socketValue); |
| | | let that = this; |
| | | if (that.socketValue.type === "start") { |
| | | console.log("任务开启") |
| | | // console.log("任务开启") |
| | | this.$store.commit("addTask", this.socketValue.rid); |
| | | } else if (that.socketValue.type === "stop") { |
| | | console.log("任务结束") |
| | | // console.log("任务结束") |
| | | this.$store.commit("stopTask", this.socketValue.rid); |
| | | } |
| | | } |
| | |
| | | //开始持续获取定位 |
| | | let that = this; |
| | | if (val != 1) { |
| | | console.log("开始持续定位") |
| | | // console.log(that.id,"开始持续定位") |
| | | this.isContinued = true; |
| | | that.once(function(res) { |
| | | if (res.state == false) { |
| | |
| | | } |
| | | }) |
| | | if (this.isContinuedTimeOut) { |
| | | console.log("重复开始持续定位") |
| | | // console.log("重复开始持续定位") |
| | | return; |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | }) |
| | | }, 5000) |
| | | }, 3000) |
| | | |
| | | } |
| | | overContinued() { |
| | | console.log("结束持续定位") |
| | | // console.log("结束持续定位") |
| | | let that = this; |
| | | if (this.isContinued) { |
| | | this.isContinued = false; |
| | |
| | | this.isContinuedTimeOut = null; |
| | | } |
| | | } |
| | | this.isContinued = false; |
| | | that.outData('out'); |
| | | } |
| | | // overContinued() { |
| | | // console.log("结束持续定位") |
| | | // let that = this; |
| | | // if (this.isContinued) { |
| | | // this.isContinued = false; |
| | | // clearInterval(that.isContinuedTimeInt); |
| | | // this.isContinuedTimeInt = null; |
| | | // } |
| | | // } |
| | | once(fn) { |
| | | console.log("开始获取一次定位"); |
| | | // console.log("开始获取一次定位"); |
| | | this.state = true; |
| | | let ok = true; |
| | | let that = this, |
| | | fns = fn, |
| | | fns = fn || '', |
| | | outit = function() { |
| | | if (fns) { |
| | | fns({ |
| | |
| | | outit(); |
| | | let success = function(position) { |
| | | // console.log(position); |
| | | var lat = position.coords.latitude; |
| | | var lon = position.coords.longitude; |
| | | var lat = position.coords.longitude;//经度 |
| | | var lon = position.coords.latitude;//纬度 |
| | | // console.log("成功返回经纬度信息"); |
| | | // console.log(lon, lat, "成功"); |
| | | that.onceNowPosition = [lat, lon]; |
| | |
| | | } |
| | | that.onceNowPosition = msg; |
| | | that.state = false; |
| | | ok = true; |
| | | ok = false; |
| | | outit(); |
| | | }; |
| | | let options = { |
| | |
| | | error, |
| | | options |
| | | ); |
| | | //高德定位 |
| | | // console.log("开始获取一次定位"); |
| | | // this.state = true; |
| | | // let that = this; |
| | | // that.outData(); |
| | | // AMap.plugin("AMap.Geolocation", function() { |
| | | // var geolocation = new AMap.Geolocation({ |
| | | // // 是否使用高精度定位,默认:true |
| | | // enableHighAccuracy: true, |
| | | // // 设置定位超时时间,默认:无穷大 |
| | | // // timeout: 10000, |
| | | // }); |
| | | // geolocation.getCurrentPosition(); |
| | | // AMap.event.addListener(geolocation, "complete", onComplete); |
| | | // AMap.event.addListener(geolocation, "error", onError); |
| | | |
| | | // function onComplete(data) { |
| | | // // data是具体的定位信息 |
| | | // // console.log(data); |
| | | // var lat = data.position.lat; |
| | | // var lon = data.position.lng; |
| | | // // console.log("成功返回经纬度信息"); |
| | | // // console.log(lon, lat, "成功"); |
| | | // that.onceNowPosition = [lon, lat]; |
| | | // this.state = false; |
| | | // that.outData(); |
| | | // } |
| | | |
| | | // function onError(data) { |
| | | // // 定位出错 |
| | | // // console.log(data); |
| | | // that.onceNowPosition = data; |
| | | // this.state = false; |
| | | // that.outData(); |
| | | // } |
| | | // }); |
| | | } |
| | | //结束获取 |
| | | outInit() { |
| | | |
| | | } |
| | | //抛出数据 |
| | | outData() { |
| | | outData(val) { |
| | | let d = { |
| | | state: this.state, |
| | | intlat: this.onceNowPosition |
| | | } |
| | | if (val) { |
| | | d[val] = val |
| | | } |
| | | this.fn(d) |
| | | } |
| | | } |
| | | |
| | | // export default $getPositions; |
| | |
| | | }); |
| | | } else if (that.data.butCT == "begin") { |
| | | // 开始任务 |
| | | this.setUniAppMsg({ |
| | | that.setUniAppMsg({ |
| | | type: "start", |
| | | data: { |
| | | id: that.data.id, |
| | |
| | | }, |
| | | fn: function(val) { |
| | | if (val == "success") { |
| | | console.log("成功开启任务") |
| | | this.data.butCT = "beginUp"; |
| | | this.data.rtype = '0'; |
| | | this.data.type = "0"; |
| | | // console.log("成功开启任务") |
| | | that.data.butCT = "beginUp"; |
| | | that.data.rtype = '0'; |
| | | that.data.type = "0"; |
| | | } |
| | | } |
| | | }) |
| | |
| | | this.oncePosition = new $getPositions({ |
| | | id: 1, |
| | | fn: function(res) { |
| | | console.log(res); |
| | | // console.log(res); |
| | | that.mapPositionLoding = res.state; |
| | | if (!res.state) { |
| | | that.addIcon(res.intlat); |
| | | console.log(res) |
| | | if (typeof res.intlat === "string") { |
| | | window.parent.showTip("获取定位失败") |
| | | } else { |
| | | that.addIcon([res.intlat[1], res.intlat[0]]); |
| | | } |
| | | } |
| | | } |
| | | }).init(); |
| | | } |
| | | if (!this.onPosition) { |
| | | this.oncePosition.continuedTime(); |
| | | this.onPosition = !this.onPosition; |
| | | this.oncePosition.once(); |
| | | } else { |
| | | this.oncePosition.overContinued(); |
| | | this.onPosition = !this.onPosition; |
| | | this.oncePosition.once(); |
| | | } |
| | | |
| | | // if (!this.onPosition) { |
| | | // this.oncePosition.continuedTime(); |
| | | // this.onPosition = !this.onPosition; |
| | | // } else { |
| | | // this.oncePosition.overContinued(); |
| | | // this.onPosition = !this.onPosition; |
| | | // } |
| | | }, |
| | | //添加图标 |
| | | addIcon(intlat) { |
| | |
| | | }, |
| | | }); |
| | | this.domMove.init(); |
| | | |
| | | // console.log(window.parent.setIntLat) |
| | | window.parent.setIntLat({ |
| | | rid: this.data.id, |
| | | fn: (out) => { |
| | | console.log(out); |
| | | that.addIcon(out); |
| | | // console.log(out,"1111"); |
| | | // that.addIcon(out); |
| | | that.addIcon([out[1], out[0]]); |
| | | } |
| | | }) |
| | | }, |
| | |
| | | </view> |
| | | </view> |
| | | <view class="butb"> |
| | | <u-button class="custom-style" type="primary" @click="upData">我反馈</u-button> |
| | | <!-- custom-style --> |
| | | <u-button class="submits" type="primary" @click="upData">我反馈</u-button> |
| | | </view> |
| | | </view> |
| | | </view> |
| | |
| | | serid: uni.getStorageSync("ids") |
| | | // result: this.content, |
| | | }; |
| | | let ds = { |
| | | |
| | | } |
| | | |
| | | wx.showLoading({ |
| | | title: "提交中...", |
| | | mask: true |
| | | }) |
| | | // console.log(dataList); |
| | | let d = { |
| | | rid: this.data.id, |
| | | serid: this.data.serid, |
| | | type: "stop", |
| | | that: that |
| | | } |
| | | that.$store.commit('useWebScoketApi', d); |
| | | wx.request({ |
| | | url: this.$store.state.piAPI + 'taskfk/save', //仅为示例,并非真实接口地址。 |
| | | data: dataList, |
| | |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | let d = { |
| | | rid: this.data.id, |
| | | serid: this.data.serid, |
| | | type: "stop", |
| | | that: that |
| | | } |
| | | that.$store.commit('useWebScoketApi', d); |
| | | }, |
| | | takePhoto() { |
| | | var that = this; |
| | |
| | | } |
| | | |
| | | .butb { |
| | | margin: 1rem auto; |
| | | width: 6rem; |
| | | // margin: 1rem auto; |
| | | // width: 6rem; |
| | | height: 3rem; |
| | | // // border: 1px solid rgb(46, 118, 228); |
| | | // border-radius: 1rem; |
| | |
| | | background-image: linear-gradient(to right, #08EFF6, #0693FD); |
| | | border-radius: 20px; |
| | | } |
| | | |
| | | .submits { |
| | | margin: 60rpx 90rpx 0; |
| | | border: none; |
| | | width: 572rpx; |
| | | height: 86rpx; |
| | | // line-height: 86rpx; |
| | | box-sizing: border-box; |
| | | border-radius: 15rpx; |
| | | background-color: #103289; |
| | | color: #ffffff; |
| | | |
| | | &::after { |
| | | content: none; |
| | | } |
| | | |
| | | &::before { |
| | | content: none; |
| | | } |
| | | |
| | | &[disabled='true'] { |
| | | background: #e4e4e4; |
| | | font-size: 36rpx; |
| | | font-family: Source Han Sans CN; |
| | | font-weight: 500; |
| | | color: #ffffff; |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <view class="content"> |
| | | <u-top-tips ref="uTips"></u-top-tips> |
| | | <!-- <u-button type="info" @click="acc">测试</u-button> --> |
| | | <web-view :src="urls"></web-view> |
| | | </view> |
| | | </template> |
| | |
| | | return { |
| | | urls: '', |
| | | // dataList: [], |
| | | fn: null, |
| | | rid: '' |
| | | } |
| | | }, |
| | | methods: { |
| | | |
| | | methods: {}, |
| | | computed: { |
| | | isOnTaskValue() { |
| | | if (this.$store.state.changes) { |
| | | return this.$store.state.isOnTaskValue; |
| | | } else { |
| | | return this.$store.state.isOnTaskValue; |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | isOnTaskValue: { |
| | | handler(newName, oldName) { |
| | | // console.log("map", this.isOnTaskValue); |
| | | for (let k in this.isOnTaskValue) { |
| | | if (this.isOnTaskValue[k].id == this.rid) { |
| | | if (this.fn) { |
| | | this.fn(this.isOnTaskValue[k].intlat); |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | deep: true |
| | | } |
| | | }, |
| | | mounted() {}, |
| | | onReady() { |
| | | let that = this; |
| | | window.hBackMsg = (val) => { |
| | | // console.log(val) |
| | | let d = { |
| | | rid: val.data.id, |
| | | serid: val.data.serid, |
| | |
| | | that: that, |
| | | fn: () => { |
| | | // that.getGrabOrders(that.current); //重获取数据 |
| | | val.fn(); |
| | | if (val.fn) { |
| | | // console.log(111) |
| | | val.fn("success"); |
| | | } |
| | | } |
| | | } |
| | | that.$store.commit('useWebScoketApi', d); |
| | | } |
| | | window.setIntLat = (val) => { |
| | | // console.log(fn); |
| | | that.fn = val.fn || ''; |
| | | that.rid = val.rid || ''; |
| | | } |
| | | window.showTip = (val) => { |
| | | that.$refs.uTips.show({ |
| | | title: val, |
| | | type: "warning", |
| | | duration: '2300' |
| | | }) |
| | | } |
| | | }, |
| | | onLoad: function(options) { |
| | |
| | | if (b == '/api') { |
| | | name = 1; |
| | | } |
| | | // "E:\liumy\qfqk\qfqks\qfqk-android\leafletMapOur\grabOrdersMap\xcxmap.html" |
| | | let a = name == 1 ? "http://127.0.0.1:8848/qfqk-android/leafletMapOur/" : b.slice(0, b.indexOf('api')); |
| | | // this.urls = a + "grabOrdersMap/xcxmap.html?data=" + data; |
| | | // a = a.slice(0, a.indexOf('api')); |
| | |
| | | outit(); |
| | | let success = function(position) { |
| | | // console.log(position); |
| | | var lat = position.coords.latitude; |
| | | var lon = position.coords.longitude; |
| | | var lat = position.coords.longitude;//经度 |
| | | var lon = position.coords.latitude;//纬度 |
| | | // console.log("成功返回经纬度信息"); |
| | | // console.log(lon, lat, "成功"); |
| | | that.onceNowPosition = [lat, lon]; |
| | |
| | | state: { |
| | | isBeginTask: {}, |
| | | isOnTask: {}, |
| | | isOnTaskValue: {}, |
| | | changes: true |
| | | }, |
| | | actions: { |
| | | // connectws({ |
| | |
| | | id: id, |
| | | fn: function(res) { |
| | | // console.log(res); |
| | | $store.commit("setMsg", { |
| | | state.isOnTaskValue[id] = { |
| | | id: id, |
| | | intlat: res.intlat |
| | | }) |
| | | } |
| | | state.changes = !state.changes; |
| | | console.log(state.isOnTaskValue) |
| | | // $store.commit("setMsg", { |
| | | // id: id, |
| | | // intlat: res.intlat |
| | | // }) |
| | | } |
| | | }) |
| | | } |
| | |
| | | import WxStorage from "../static/lib/wxStorage.js" //微信Storage |
| | | |
| | | // var url = 'ws://' + vueconfig.devServer.proxy["/cloud"].target.substring(5) + '/websocket'; |
| | | |
| | | import $store from './index.js' |
| | | let url = 'ws://192.168.0.108:9034/websocket'; |
| | | // let url = 'ws://223.82.109.183:2082/websocket'; |
| | | |
| | | const webSockets = new Wst(url); |
| | | |