|
@ -154,7 +154,6 @@ const Index = () => { |
|
|
+ res.data.result.address_component.district |
|
|
+ res.data.result.address_component.district |
|
|
+ res.data.result.address_component.street_number |
|
|
+ res.data.result.address_component.street_number |
|
|
// addresscity = res.data.result.formatted_addresses.standard_address |
|
|
// addresscity = res.data.result.formatted_addresses.standard_address |
|
|
console.log(res, 'res') |
|
|
|
|
|
let street = res.data.result.address_component.street |
|
|
let street = res.data.result.address_component.street |
|
|
setRoad(street) |
|
|
setRoad(street) |
|
|
setAddress(addresscity) |
|
|
setAddress(addresscity) |
|
@ -190,7 +189,6 @@ const Index = () => { |
|
|
setRoadStartSel(sourceRoadStartSel) |
|
|
setRoadStartSel(sourceRoadStartSel) |
|
|
setRoadEndSel(sourceRoadEndSel) |
|
|
setRoadEndSel(sourceRoadEndSel) |
|
|
}, [sourceRoadStartSel, sourceRoadEndSel]) |
|
|
}, [sourceRoadStartSel, sourceRoadEndSel]) |
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
useEffect(() => { |
|
|
setTypeList([ |
|
|
setTypeList([ |
|
|
{ |
|
|
{ |
|
@ -217,7 +215,7 @@ const Index = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (isPatrol && prjTypeSelector.indexOf(projectType) === -1) { |
|
|
if (isPatrol && prjTypeSelector.indexOf(projectType) === -1) { |
|
|
Taro.showToast({ title: '工程类型错误', icon: 'none' }) |
|
|
Taro.showToast({ title: isAnomaly ? '反馈类型错误' : '工程类型错误', icon: 'none' }) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
if (content.length > 50) { |
|
|
if (content.length > 50) { |
|
@ -228,7 +226,8 @@ const Index = () => { |
|
|
Taro.showToast({ title: '请完善项目名称', icon: 'none' }) |
|
|
Taro.showToast({ title: '请完善项目名称', icon: 'none' }) |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
const reportProjectType = prjType[prjTypeSelector.indexOf(projectType)]?.value || '' |
|
|
const reportProjectType = prjType.find(p => p.text == projectType)?.value || '' |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let data = { |
|
|
let data = { |
|
|
reportType: isPatrol ? reportType : kind, |
|
|
reportType: isPatrol ? reportType : kind, |
|
@ -243,14 +242,13 @@ const Index = () => { |
|
|
projectName, |
|
|
projectName, |
|
|
handleState: isAnomaly ? '待处理' : undefined, |
|
|
handleState: isAnomaly ? '待处理' : undefined, |
|
|
} |
|
|
} |
|
|
if (reportType === 'patrol') { |
|
|
if (reportType === 'patrol' || isAnomaly || isRoad) { |
|
|
data['scenePic'] = sceneImg |
|
|
data['scenePic'] = sceneImg |
|
|
} else { |
|
|
} else { |
|
|
data['conserveBeforePic'] = conserveBeforeImg |
|
|
data['conserveBeforePic'] = conserveBeforeImg |
|
|
data['conserveUnderwayPic'] = conserveUnderwayImg |
|
|
data['conserveUnderwayPic'] = conserveUnderwayImg |
|
|
data['conserveAfterPic'] = conserveAfterImg |
|
|
data['conserveAfterPic'] = conserveAfterImg |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
Taro.showModal({ |
|
|
Taro.showModal({ |
|
|
title: '提示', |
|
|
title: '提示', |
|
|
content: '您要进行信息上报么?', |
|
|
content: '您要进行信息上报么?', |
|
@ -625,7 +623,6 @@ const Index = () => { |
|
|
sourceType: ['album', 'camera'], mediaType: ['image', 'video'], |
|
|
sourceType: ['album', 'camera'], mediaType: ['image', 'video'], |
|
|
camera: 'back', |
|
|
camera: 'back', |
|
|
success: function (res) { |
|
|
success: function (res) { |
|
|
console.log(res.tempFilePath) |
|
|
|
|
|
Taro.showLoading({ title: '上传中' }) |
|
|
Taro.showLoading({ title: '上传中' }) |
|
|
const tempFilePaths = res.tempFilePath |
|
|
const tempFilePaths = res.tempFilePath |
|
|
let token = getState('token') || Taro.getStorageSync('token') |
|
|
let token = getState('token') || Taro.getStorageSync('token') |
|
@ -634,7 +631,6 @@ const Index = () => { |
|
|
filePath: tempFilePaths, |
|
|
filePath: tempFilePaths, |
|
|
name: 'file', |
|
|
name: 'file', |
|
|
success: (res) => { |
|
|
success: (res) => { |
|
|
console.log(res); |
|
|
|
|
|
Taro.hideLoading(); |
|
|
Taro.hideLoading(); |
|
|
if (res.statusCode == 200) { |
|
|
if (res.statusCode == 200) { |
|
|
// setImg(true, JSON.parse(res.data).key) |
|
|
// setImg(true, JSON.parse(res.data).key) |
|
|