|
|
@ -160,8 +160,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) |
|
|
@ -169,6 +169,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 = |
|
|
@ -246,7 +247,7 @@ const Index = () => { |
|
|
|
]) |
|
|
|
}, [reportType]) |
|
|
|
|
|
|
|
function report() { |
|
|
|
function report () { |
|
|
|
if (!canReport) { return } |
|
|
|
if ( |
|
|
|
(isPatrol && (!projectType || !road)) |
|
|
@ -322,7 +323,7 @@ const Index = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function deleteReport() { |
|
|
|
function deleteReport () { |
|
|
|
Taro.showModal({ |
|
|
|
title: '提示', |
|
|
|
content: '确定删除吗?', |
|
|
@ -349,7 +350,7 @@ const Index = () => { |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
function handleInput({ detail: { value } }, type) { |
|
|
|
function handleInput ({ detail: { value } }, type) { |
|
|
|
switch (type) { |
|
|
|
case 'roadSectionStart': |
|
|
|
setRoadSectionStart(value) |
|
|
@ -384,15 +385,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 |
|
|
@ -492,12 +493,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链接列表 |
|
|
|
}) |
|
|
@ -519,7 +520,7 @@ const Index = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
}, [road]) |
|
|
|
function handleOk() { |
|
|
|
function handleOk () { |
|
|
|
if (!canReport) { return } |
|
|
|
let str = handleCenter.trim() |
|
|
|
if (!str) { |
|
|
@ -564,17 +565,17 @@ const Index = () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
function addVideo() { |
|
|
|
function addVideo () { |
|
|
|
wx.chooseMedia({ |
|
|
|
count: 1, |
|
|
|
mediaType: ['video'], |
|
|
|
sourceType: ['album', 'camera'], |
|
|
|
maxDuration: 15, |
|
|
|
camera: 'back', |
|
|
|
success(res) { |
|
|
|
console.log(res,'上传的视频'); |
|
|
|
success (res) { |
|
|
|
console.log(res, '上传的视频'); |
|
|
|
const tempFilePaths = res.tempFiles[0].tempFilePath |
|
|
|
|
|
|
|
|
|
|
|
setVideo(res.tempFiles[0].tempFilePath) |
|
|
|
let token = getState('token') || Taro.getStorageSync('token') |
|
|
|
Taro.uploadFile({ |
|
|
|