|
@ -147,6 +147,8 @@ const Index = () => { |
|
|
let key = 'ODQBZ-3FZAU-6VIVL-2XXNM-F7CP7-WVFCY' // 写自己申请的key |
|
|
let key = 'ODQBZ-3FZAU-6VIVL-2XXNM-F7CP7-WVFCY' // 写自己申请的key |
|
|
Taro.getLocation({ |
|
|
Taro.getLocation({ |
|
|
type: 'wgs84', |
|
|
type: 'wgs84', |
|
|
|
|
|
isHighAccuracy: true, |
|
|
|
|
|
highAccuracyExpireTime: 1000 * 6, |
|
|
success: function (res) { |
|
|
success: function (res) { |
|
|
setLongitude(res.longitude) |
|
|
setLongitude(res.longitude) |
|
|
setLatitude(res.latitude) |
|
|
setLatitude(res.latitude) |
|
@ -228,7 +230,7 @@ const Index = () => { |
|
|
]) |
|
|
]) |
|
|
}, [reportType]) |
|
|
}, [reportType]) |
|
|
|
|
|
|
|
|
function report() { |
|
|
function report () { |
|
|
if (!canReport) { return } |
|
|
if (!canReport) { return } |
|
|
if ( |
|
|
if ( |
|
|
(isPatrol && (!projectType || !road)) |
|
|
(isPatrol && (!projectType || !road)) |
|
@ -304,7 +306,7 @@ const Index = () => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function deleteReport() { |
|
|
function deleteReport () { |
|
|
Taro.showModal({ |
|
|
Taro.showModal({ |
|
|
title: '提示', |
|
|
title: '提示', |
|
|
content: '确定删除吗?', |
|
|
content: '确定删除吗?', |
|
@ -331,7 +333,7 @@ const Index = () => { |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function handleInput({ detail: { value } }, type) { |
|
|
function handleInput ({ detail: { value } }, type) { |
|
|
switch (type) { |
|
|
switch (type) { |
|
|
case 'roadSectionStart': |
|
|
case 'roadSectionStart': |
|
|
setRoadSectionStart(value) |
|
|
setRoadSectionStart(value) |
|
@ -363,15 +365,15 @@ const Index = () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function handleTypeChange(e) { |
|
|
function handleTypeChange (e) { |
|
|
setReportType(e.detail.value) |
|
|
setReportType(e.detail.value) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function handleImgChange(files, operationType, index, type) { |
|
|
function handleImgChange (files, operationType, index, type) { |
|
|
if (operationType === 'remove') { |
|
|
if (operationType === 'remove') { |
|
|
setImg(false) |
|
|
setImg(false) |
|
|
} |
|
|
} |
|
|
function setImg(isAdd, url) { |
|
|
function setImg (isAdd, url) { |
|
|
switch (type) { |
|
|
switch (type) { |
|
|
case 'scenePic': |
|
|
case 'scenePic': |
|
|
let nextImg = sceneImg |
|
|
let nextImg = sceneImg |
|
@ -458,7 +460,7 @@ const Index = () => { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
function handleImgClick(index, file) { |
|
|
function handleImgClick (index, file) { |
|
|
Taro.previewImage({ |
|
|
Taro.previewImage({ |
|
|
urls: [file.url] // 需要预览的图片http链接列表 |
|
|
urls: [file.url] // 需要预览的图片http链接列表 |
|
|
}) |
|
|
}) |
|
|