| | |
| | | import { cluePicUrl } from '../../../config/index'; |
| | | import { questionForm } from '../clue-item.js'; |
| | | import { toLabel, toValue } from '../../../common/dataTowns'; |
| | | import mapUtils from '../../../utils/map-utils'; |
| | | |
| | | import { uploadQuestion, updateQuestion } from '../../../services/clue/fetchClue'; |
| | | |
| | |
| | | // 从地图选择定位 |
| | | chooseLocation() { |
| | | const { locations } = this.data; |
| | | let lng, lat; |
| | | if (typeof locations.longitude === 'number' && typeof locations.latitude === 'number') { |
| | | const coor = mapUtils.wgs84togcj02(locations.longitude, locations.latitude); |
| | | lng = coor[0]; |
| | | lat = coor[1]; |
| | | } |
| | | wx.chooseLocation({ |
| | | longitude: locations.longitude, |
| | | latitude: locations.latitude, |
| | | longitude: lng, |
| | | latitude: lat, |
| | | success: res => { |
| | | const [lngGps, latGps] = mapUtils.gcj02towgs84(res.longitude, res.latitude); |
| | | this.setData({ |
| | | locations: { |
| | | ...res, |
| | | coorTxt: `${res.longitude},${res.latitude}`, |
| | | name: res.name, |
| | | address: res.address, |
| | | // 使用 gcj02 国测局坐标系 |
| | | longitude: lngGps, |
| | | latitude: latGps, |
| | | coorTxt: `${lngGps},${latGps}`, |
| | | }, |
| | | }); |
| | | }, |
| | |
| | | |
| | | // 添加图片 |
| | | handleAddImg(e) { |
| | | wx.chooseAddress({ |
| | | // wx.chooseAddress({ |
| | | |
| | | }) |
| | | wx.getLocation({ |
| | | type:'wgs84', |
| | | success:res=>{ |
| | | this.setData({ |
| | | locations: { |
| | | ...res, |
| | | coorTxt: `${res.longitude},${res.latitude}`, |
| | | }, |
| | | }); |
| | | } |
| | | }) |
| | | // }) |
| | | // wx.getLocation({ |
| | | // type:'wgs84', |
| | | // success:res=>{ |
| | | // this.setData({ |
| | | // locations: { |
| | | // ...res, |
| | | // coorTxt: `${res.longitude},${res.latitude}`, |
| | | // }, |
| | | // }); |
| | | // } |
| | | // }) |
| | | const { fileList } = this.data; |
| | | const { files } = e.detail; |
| | | this.setData({ |