|
|
@ -162,8 +162,8 @@ const Index = () => { |
|
|
|
Taro.getLocation({ |
|
|
|
// type: 'wgs84', |
|
|
|
type: 'gcj02', |
|
|
|
isHighAccuracy: true, |
|
|
|
// isHighAccuracy: false, |
|
|
|
// isHighAccuracy: true, |
|
|
|
isHighAccuracy: false, |
|
|
|
highAccuracyExpireTime: 1000 * 6, |
|
|
|
success: function (res) { |
|
|
|
setLongitude(res.longitude) |
|
|
@ -171,6 +171,7 @@ const Index = () => { |
|
|
|
Taro.request({ |
|
|
|
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${res.latitude},${res.longitude}&key=${key}`, |
|
|
|
success: function (res) { |
|
|
|
console.log('地址:::', res); |
|
|
|
// 根据自己项目需求获取res内容 |
|
|
|
let addresscity = '' |
|
|
|
addresscity = |
|
|
@ -248,7 +249,7 @@ const Index = () => { |
|
|
|
]) |
|
|
|
}, [reportType]) |
|
|
|
|
|
|
|
function report() { |
|
|
|
function report () { |
|
|
|
if (!canReport) { return } |
|
|
|
if ( |
|
|
|
(isPatrol && (!projectType || !road)) |
|
|
@ -325,7 +326,7 @@ const Index = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function deleteReport() { |
|
|
|
function deleteReport () { |
|
|
|
Taro.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '确定删除吗?', |
|
|
@ -352,7 +353,7 @@ const Index = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function handleInput({ detail: { value } }, type) { |
|
|
|
function handleInput ({ detail: { value } }, type) { |
|
|
|
switch (type) { |
|
|
|
case 'roadSectionStart': |
|
|
|
setRoadSectionStart(value) |
|
|
@ -387,15 +388,15 @@ const Index = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function handleTypeChange(e) { |
|
|
|
function handleTypeChange (e) { |
|
|
|
setReportType(e.detail.value) |
|
|
|
} |
|
|
|
|
|
|
|
function handleImgChange(files, operationType, index, type) { |
|
|
|
function handleImgChange (files, operationType, index, type) { |
|
|
|
if (operationType === 'remove') { |
|
|
|
setImg(false) |
|
|
|
} |
|
|
|
function setImg(isAdd, url) { |
|
|
|
function setImg (isAdd, url) { |
|
|
|
switch (type) { |
|
|
|
case 'scenePic': |
|
|
|
let nextImg = sceneImg |
|
|
@ -495,12 +496,12 @@ const Index = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function handleImgClick(index, file) { |
|
|
|
function handleImgClick (index, file) { |
|
|
|
Taro.previewImage({ |
|
|
|
urls: [file.url] // 需要预览的图片http链接列表 |
|
|
|
}) |
|
|
|
} |
|
|
|
function handleImgClicks(index, file) { |
|
|
|
function handleImgClicks (index, file) { |
|
|
|
Taro.previewImage({ |
|
|
|
urls: [file] // 需要预览的图片http链接列表 |
|
|
|
}) |
|
|
@ -522,7 +523,7 @@ const Index = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
}, [road]) |
|
|
|
function handleOk() { |
|
|
|
function handleOk () { |
|
|
|
if (!canReport) { return } |
|
|
|
let str = handleCenter.trim() |
|
|
|
if (!str) { |
|
|
@ -567,7 +568,7 @@ const Index = () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
function addVideo() { |
|
|
|
function addVideo () { |
|
|
|
wx.chooseMedia({ |
|
|
|
count: 1, |
|
|
|
mediaType: ['video'], |
|
|
|