案件上报

This commit is contained in:
itgaojian 2023-12-07 09:31:56 +08:00
parent 78ba1fc1ae
commit 6ceacf9f42
7 changed files with 916 additions and 802 deletions

102
app.json
View File

@ -1,52 +1,54 @@
{ {
"pages": [ "pages": [
"pages/index/index", "pages/index/index",
"pages/caseCheck/caseCheck", "pages/caseCheck/caseCheck",
"pages/caseReport/caseReport", "pages/caseReport/caseReport",
"pages/caseDetail/caseDetail", "pages/caseDetail/caseDetail",
"pages/process/process", "pages/process/process",
"pages/waitCheck/waitCheck", "pages/waitCheck/waitCheck",
"pages/census/census", "pages/census/census",
"pages/mine/mine", "pages/mine/mine",
"pages/censusinput/censusinput", "pages/censusinput/censusinput",
"pages/chooseArea/chooseArea", "pages/chooseArea/chooseArea",
"pages/censusDetail/censusDetail", "pages/censusDetail/censusDetail",
"pages/censusEdit/censusEdit" "pages/censusEdit/censusEdit"
], ],
"window": { "window": {
"backgroundTextStyle": "light", "backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#4583FE", "navigationBarBackgroundColor": "#4583FE",
"navigationBarTitleText": "包头高新网格化", "navigationBarTitleText": "包头高新网格化",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
}, },
"style": "v2", "style": "v2",
"sitemapLocation": "sitemap.json", "sitemapLocation": "sitemap.json",
"permission": { "permission": {
"scope.userLocation": { "scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示" "desc": "你的位置信息将用于小程序位置接口的效果展示"
} }
}, },
"usingComponents": { "requiredPrivateInfos": [
"scroller": "components/coolui-scroller/scroller/index" "getLocation"
}, ],
"tabBar": { "usingComponents": {
"color": "#000", "scroller": "components/coolui-scroller/scroller/index"
"borderStyle": "white", },
"selectedColor": "#4583FE", "tabBar": {
"backgroundColor": "#F8F8F8", "color": "#000",
"list": [ "borderStyle": "white",
{ "selectedColor": "#4583FE",
"pagePath": "pages/index/index", "backgroundColor": "#F8F8F8",
"iconPath": "images/ic_home_nomarl_icon.png", "list": [{
"text": "首页", "pagePath": "pages/index/index",
"selectedIconPath": "images/ic_home_sel_icon.png" "iconPath": "images/ic_home_nomarl_icon.png",
}, "text": "首页",
{ "selectedIconPath": "images/ic_home_sel_icon.png"
"pagePath": "pages/mine/mine", },
"iconPath": "images/ic_mine_nomarl_icon.png", {
"text": "我的", "pagePath": "pages/mine/mine",
"selectedIconPath": "images/ic_mine_sel_icon.png" "iconPath": "images/ic_mine_nomarl_icon.png",
} "text": "我的",
] "selectedIconPath": "images/ic_mine_sel_icon.png"
} }
]
}
} }

View File

@ -1,472 +1,439 @@
const app = getApp() const app = getApp()
var bmap = require('../../lib/bmap-wx.js'); var bmap = require('../../lib/bmap-wx.js');
let wxMarkerData = []; let wxMarkerData = [];
// pages/caseReport/caseReport.js // pages/caseReport/caseReport.js
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
address: '获取案件地址中...', address: '获取案件地址中...',
recodePath: '', recodePath: '',
recorderManager: wx.getRecorderManager(), recorderManager: wx.getRecorderManager(),
innerAudioContext: wx.createInnerAudioContext(), innerAudioContext: wx.createInnerAudioContext(),
// 办事处 //街道
officeIndex: 0, streetPicker: false,
officeArray: [], streetList: [],
officeList: [], streetKeys: {
officeSelectedId: '', label: 'dictName',
// 社区 value: 'dictId'
communityIndex: 0, },
communityArray: [], selStreet: null,
communityList: [], //社区
communitySelectedId: '', communityPicker: false,
// 类型 communityList: [],
typeIndex: 0, communityKeys: {
typeArray: [], label: 'communityName',
typeList: [], value: 'communityId'
typeSelectedId: '', },
// 类型二级 selCommunity: null,
typeLvIndex: 0, //类型
typeLvArray: [], typePicker: false,
typeLvList: [], typeList: [],
typeLvSelectedId: '', typeKeys: {
// 案件类型 label: 'dictName',
caseIndex: 0, value: 'dictId'
caseArray: [], },
caseList: [], selType: null,
caseSelectedId: '', //详细类型
photoList: [], type2Picker: false,
startTouch: {}, type2List: [],
selfHandle: 0, type2Keys: {
caseDesc: '', label: 'dictName',
imageList: [], value: 'dictId'
token: '' },
}, selType2: null,
// 办事处列表
getOfficeList: function () {
var self = this
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/dict/listdict/9d179f05-3ea0-48f7-853c-d3b7124b791c', [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
var arr = []
for (let i = 0 ; i < data.length; i++) {
arr.push(data[i].dictName)
}
self.setData({
officeArray: arr,
officeList: data,
officeSelectedId: data[0].dictId
})
self.getCommunityList()
});
},
// 办事处选中
bindPickerChange: function (e) {
var self = this
this.setData({
officeIndex: e.detail.value,
officeSelectedId: self.data.officeList[e.detail.value].dictId
})
wx.showToast({
title: '加载中',
icon: 'loading'
})
this.getCommunityList()
},
// 社区列表
getCommunityList: function () {
var self = this
self.setData({
communityIndex: 0
})
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/community/listareacommunity/' + self.data.officeSelectedId, [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
var arr = []
for (let i = 0 ; i < data.length; i++) {
arr.push(data[i].communityName)
}
self.setData({
communityArray: arr,
communityList: data,
communitySelectedId: data[0].communityId
})
wx.hideToast()
});
},
// 选中社区
bindCommunityChange: function (e) {
var self = this
this.setData({
communityIndex: e.detail.value,
communitySelectedId: self.data.communityList[e.detail.value].communityId
})
},
// 类型列表
getTypeList: function () {
var self = this
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/dict/listdict/46d108b2-4ef9-4f6f-b30c-0c700e3ee852' + self.data.officeSelectedId, [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
var arr = []
for (let i = 0 ; i < data.length; i++) {
arr.push(data[i].dictName)
}
self.setData({
typeArray: arr,
typeList: data,
typeSelectedId: data[0].dictId
})
self.getTypeLv()
});
},
// 类型选中
bindTypeChange: function (e) {
var self = this
this.setData({
typeIndex: e.detail.value,
typeSelectedId: self.data.typeList[e.detail.value].dictId
})
self.getTypeLv()
},
// 类型二级
getTypeLv: function () {
var self = this
self.setData({
typeLvIndex: 0
})
wx.showToast({
title: '加载中',
icon: 'loading'
})
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/dict/listdict/' + self.data.typeSelectedId, [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
var arr = []
for (let i = 0 ; i < data.length; i++) {
arr.push(data[i].dictName)
}
self.setData({
typeLvArray: arr,
typeLvList: data,
typeLvSelectedId: data[0].dictId
})
wx.hideToast()
});
},
// 类型二级选中
bindTypeLvChange: function (e) {
var self = this
this.setData({
typeLvIndex: e.detail.value,
typeLvSelectedId: self.data.typeLvList[e.detail.value].dictId
})
self.getTypeLv()
},
// 案件类型列表
getCaseList: function () {
var self = this
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/dict/listdict/46d108b2-4ef9-4f6f-b30c-0c700e3ee852' + self.data.officeSelectedId, [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
var arr = []
for (let i = 0 ; i < data.length; i++) {
arr.push(data[i].dictName)
}
self.setData({
typeArray: arr,
typeList: data,
typeSelectedId: data[0].dictId
})
self.getTypeLv()
});
},
// 录音
recordVoice: function (e) {
this.setData({
startTouch: e.touches[0]
})
var options = {
format: 'mp3'
}
this.data.recorderManager.start(options)
wx.showToast({
title: "正在录音",
icon: "none",
duration: 60000//先定义个60秒后面可以手动调用wx.hideToast()隐藏
});
},
// 录音结束
recordEnd: function () {
var self = this
this.data.recorderManager.stop()
this.data.recorderManager.onStop(function (res) {
var path = res.tempFilePath
self.setData({
recodePath: path
})
wx.showToast({
title: '上传中',
icon: 'loading'
})
app.restAjax.file(app.restAjax.path('{requestUrl}app/file/uploadaudio', [app.requestUrl]), path, 'audio', {
headers: {
token: self.data.token
}
}, function (code, data) {
var id = JSON.parse(data).data
self.setData({
audioId: id
})
wx.hideToast()
}, function (code, data) {
console.log(data)
})
})
var self = this
wx.hideToast()
},
// 播放录音
playRecord: function () {
var innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.src = this.data.recodePath
innerAudioContext.play()
},
// 选择图片
chooseImage: function () {
var self = this
wx.chooseImage({
count: 9 - self.data.photoList.length,
sourceType: ['album', 'camera'],
success: function (res) {
self.setData({
photoList: self.data.photoList.concat(res.tempFiles)
})
wx.showToast({
title: '上传中',
icon: 'loading'
})
var arr = []
for (let i = 0; i < res.tempFiles.length; i++) {
var path = res.tempFiles[i].path;
app.restAjax.file(app.restAjax.path('{requestUrl}app/file/uploadimage', [app.requestUrl]), path, 'image', {
headers: {
token: self.data.token
}
}, function (code, data) {
var id = JSON.parse(data).data
arr.push(id)
if (arr.length == res.tempFiles.length) {
self.setData({
imageList: arr
})
wx.hideToast()
}
}, function (code, data) {
console.log(data)
})
}
}
})
},
// 删除图片
deleteImg: function (e) {
var idx = e.currentTarget.dataset.num
var self = this
self.data.photoList.splice(idx, 1)
self.data.imageList.splice(idx, 1)
self.setData({
photoList: self.data.photoList,
imageList: self.data.imageList
})
},
// touchMove: function (e) {
// var moveLenght = e.touches[e.touches.length - 1].clientY - this.data.startTouch.clientY;
// if (Math.abs(moveLenght) > 50) {
// wx.showToast({
// title: "松开手指,取消发送",
// icon: "none",
// duration: 60000
// });
// } else {
// wx.showToast({
// title: "正在录音,上划取消发送",
// icon: "none",
// duration: 60000
// });
// }
// },
/**
* 生命周期函数--监听页面加载
*/
// 是否自行处理
isSelfHandle: function (e) {
this.setData({
selfHandle: e.detail.value
})
},
// 提交上报
submitReport: function () {
var self = this
var photos = ''
if (!self.data.caseDesc) {
wx.showToast({
title: '案件内容不能为空',
icon: 'none',
duration: 2000
})
return
}
if (self.data.imageList.length != 'undefined' && self.data.imageList.length != 0) {
for (let i = 0; i < self.data.imageList.length; i++) {
if (i == self.data.imageList.length - 1) {
photos += self.data.imageList[i]
} else {
photos += self.data.imageList[i] + ','
}
}
} else {
wx.showToast({
title: '请至少上传一张照片',
icon: 'none',
duration: 2000
})
return
}
var info = {
areaId: self.data.officeSelectedId,
areaName: self.data.officeArray[self.data.officeIndex],
casePhotos: photos,
caseAudio: self.data.audioId,
communityId: self.data.communitySelectedId,
communityName: self.data.communityArray[self.data.communityIndex],
caseSource: 1,
isSelf: self.data.selfHandle,
caseTypeId: self.data.typeLvSelectedId,
caseTypeName: self.data.typeLvArray[self.data.typeLvIndex],
caseContent: self.data.caseDesc,
caseLatitude: self.data.latitude,
caseLongitude: self.data.longitude,
casePosition: self.data.address
}
wx.showToast({
title: '上传中',
icon: 'loading'
})
app.restAjax.post(app.restAjax.path('{reqesutUrl}app/reportcase/saveappautoreportcase', [app.requestUrl]), info, {
headers: {
token: self.data.token
}
}, function (code, data) {
if (code == '200') {
wx.hideToast()
wx.showToast({
title: '上报成功',
duration: 1500
})
setTimeout(function () {
wx.reLaunch({
url: '../index/index',
})
}, 1500)
}
}, function (code, data) {
wx.showToast({
title: data.msg,
duration: 2000
})
});
},
onLoad: function (options) {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
self.getOfficeList()
self.getTypeList()
}
})
var BMap = new bmap.BMapWX({
ak: 'Zk732rbyjd327q7Zj9EOtRjUn2ED1GWK'
});
var success = function (data) {
self.setData({
address: data.wxMarkerData[0].address,
latitude: data.wxMarkerData[0].latitude,
longitude: data.wxMarkerData[0].longitude
})
}
var fail = function (data) {
console.log(data);
}
BMap.regeocoding({
fail:fail,
success:success
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
}, // 案件类型
photoList: [],
startTouch: {},
selfHandle: 0,
caseDesc: '',
imageList: [],
token: '',
scrollHeight: 0,
},
onLoad: function (options) {
var self = this
wx.getStorage({
key: 'token',
success: function (res) {
self.setData({
token: res.data
})
self.getOfficeList()
self.getTypeList()
}
})
var BMap = new bmap.BMapWX({
ak: 'Zk732rbyjd327q7Zj9EOtRjUn2ED1GWK'
});
var success = function (data) {
self.setData({
address: data.wxMarkerData[0].address,
latitude: data.wxMarkerData[0].latitude,
longitude: data.wxMarkerData[0].longitude
})
}
var fail = function (data) {
console.log(data);
}
BMap.regeocoding({
fail: fail,
success: success
});
let screenHeight = wx.getSystemInfoSync().windowHeight;
this.setData({
scrollHeight: screenHeight
})
},
//街道选择
onShowStreetPick() {
this.setData({
streetPicker: true
})
},
onStreetPick(e) {
var _self = this;
var index = e.detail.columns[0].index;
_self.setData({
communityList: [],
selCommunity: null,
selStreet: _self.data.streetList[index]
})
_self.getCommunityList();
},
onStreetCancel(e) {
this.setData({
streetPicker: false,
})
},
//社区
onShowCommunitPicker() {
this.setData({
communityPicker: true,
})
},
onCommunityPick(e) {
var index = e.detail.columns[0].index;
var _self = this;
_self.setData({
selCommunity: _self.data.communityList[index]
})
},
onCommunityCancel(e) {
this.setData({
communityPicker: false
})
},
//类型选择
onShowType1() {
this.setData({
typePicker: true
})
},
onTypePick(e) {
var index = e.detail.columns[0].index;
var _self = this;
_self.setData({
selType: _self.data.typeList[index]
})
_self.getTypeLv();
},
onTypeCancel(e) {
this.setData({
typePicker: false
})
},
/** //详细类型
* 生命周期函数--监听页面显示 onShowType2() {
*/ this.setData({
onShow: function () { type2Picker: true
})
},
onType2Pick(e) {
var index = e.detail.columns[0].index;
var _self = this;
_self.setData({
selType2: _self.data.type2List[index]
})
},
onType2Cancel(e) {
this.setData({
typePicker: false
})
},
}, // 办事处列表
getOfficeList: function () {
var self = this
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/dict/listdict/9d179f05-3ea0-48f7-853c-d3b7124b791c', [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
self.setData({
streetList: data,
selStreet: data[0]
})
self.getCommunityList()
});
},
/** // 社区列表
* 生命周期函数--监听页面隐藏 getCommunityList: function () {
*/ var self = this
onHide: function () { self.setData({
communityIndex: 0
})
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/community/listareacommunity/' + self.data.selStreet.dictId, [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
self.setData({
communityList: data,
selCommunity: data[0]
})
wx.hideToast()
});
},
}, // 类型列表
getTypeList: function () {
var self = this
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/dict/listdict/46d108b2-4ef9-4f6f-b30c-0c700e3ee852', [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
self.setData({
typeList: data,
selType: data[0]
})
self.getTypeLv()
});
},
/** // 类型二级
* 生命周期函数--监听页面卸载 getTypeLv: function () {
*/ var self = this
onUnload: function () { wx.showLoading({
title: '加载中...',
})
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/dict/listdict/' + self.data.selType.dictId, [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
self.setData({
type2List: data,
selType2: data[0]
})
wx.hideLoading()
}, (code, error) => {
wx.hideLoading()
});
},
//案件描述
inputCaseDesc(e) {
this.setData({
caseDesc: e.detail.value
})
},
// 案件类型列表
getCaseList: function () {
var self = this
app.restAjax.get(app.restAjax.path('{reqesutUrl}app/dict/listdict/46d108b2-4ef9-4f6f-b30c-0c700e3ee852' + self.data.officeSelectedId, [app.requestUrl]), {}, {
headers: {
token: self.data.token
}
}, function (code, data) {
var arr = []
for (let i = 0; i < data.length; i++) {
arr.push(data[i].dictName)
}
self.setData({
typeArray: arr,
typeList: data,
typeSelectedId: data[0].dictId
})
self.getTypeLv()
});
},
// 录音
recordVoice: function (e) {
this.setData({
startTouch: e.touches[0]
})
var options = {
format: 'mp3'
}
this.data.recorderManager.start(options)
wx.showToast({
title: "正在录音",
icon: "none",
duration: 60000//先定义个60秒后面可以手动调用wx.hideToast()隐藏
});
},
// 录音结束
recordEnd: function () {
var self = this
this.data.recorderManager.stop()
this.data.recorderManager.onStop(function (res) {
var path = res.tempFilePath
self.setData({
recodePath: path
})
wx.showToast({
title: '上传中',
icon: 'loading'
})
app.restAjax.file(app.restAjax.path('{requestUrl}app/file/uploadaudio', [app.requestUrl]), path, 'audio', {
headers: {
token: self.data.token
}
}, function (code, data) {
var id = JSON.parse(data).data
self.setData({
audioId: id
})
wx.hideToast()
}, function (code, data) {
console.log(data)
})
})
var self = this
wx.hideToast()
},
// 播放录音
playRecord: function () {
var innerAudioContext = wx.createInnerAudioContext()
innerAudioContext.src = this.data.recodePath
innerAudioContext.play()
},
// 选择图片
chooseImage: function () {
var self = this
wx.chooseImage({
count: 9 - self.data.photoList.length,
sourceType: ['album', 'camera'],
success: function (res) {
self.setData({
photoList: self.data.photoList.concat(res.tempFiles)
})
wx.showToast({
title: '上传中',
icon: 'loading'
})
var arr = []
for (let i = 0; i < res.tempFiles.length; i++) {
var path = res.tempFiles[i].path;
app.restAjax.file(app.restAjax.path('{requestUrl}app/file/uploadimage', [app.requestUrl]), path, 'image', {
headers: {
token: self.data.token
}
}, function (code, data) {
var id = JSON.parse(data).data
arr.push(id)
if (arr.length == res.tempFiles.length) {
self.setData({
imageList: arr
})
wx.hideToast()
}
}, function (code, data) {
console.log(data)
})
}
}
})
},
// 删除图片
deleteImg: function (e) {
var idx = e.currentTarget.dataset.num
var self = this
self.data.photoList.splice(idx, 1)
self.data.imageList.splice(idx, 1)
self.setData({
photoList: self.data.photoList,
imageList: self.data.imageList
})
},
}, // 提交上报
submitReport: function () {
var self = this
var photos = ''
if (!self.data.caseDesc) {
wx.showToast({
title: '案件内容不能为空',
icon: 'none',
duration: 2000
})
return
}
if (self.data.imageList.length != 'undefined' && self.data.imageList.length != 0) {
for (let i = 0; i < self.data.imageList.length; i++) {
if (i == self.data.imageList.length - 1) {
photos += self.data.imageList[i]
} else {
photos += self.data.imageList[i] + ','
}
}
} else {
wx.showToast({
title: '请至少上传一张照片',
icon: 'none',
duration: 2000
})
return
}
/** var info = {
* 页面相关事件处理函数--监听用户下拉动作 areaId: self.data.selStreet.dictId,
*/ areaName: self.data.selStreet.dictName,
onPullDownRefresh: function () { casePhotos: photos,
caseAudio: self.data.audioId,
communityId: self.data.selCommunity.communityId,
communityName: self.data.selCommunity.communityName,
caseSource: 1,
isSelf: self.data.selfHandle,
caseTypeId: self.data.selType2.dictId,
caseTypeName: self.data.selType2.dictName,
caseContent: self.data.caseDesc,
caseLatitude: self.data.latitude,
caseLongitude: self.data.longitude,
casePosition: self.data.address
}
wx.showLoading({
title: '上报中...',
})
app.restAjax.post(app.restAjax.path('{reqesutUrl}app/reportcase/saveappautoreportcase', [app.requestUrl]), info, {
headers: {
token: self.data.token
}
}, function (code, data) {
if (code == '200') {
wx.hideLoading()
wx.showToast({
title: '上报成功',
duration: 1500
})
setTimeout(function () {
wx.navigateBack()
}, 1500)
}
}, function (code, data) {
wx.hideLoading()
wx.showToast({
title: data.msg,
duration: 2000
})
});
},
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
}) })

View File

@ -1,3 +1,10 @@
{ {
"usingComponents": {} "usingComponents": {
"t-picker": "/miniprogram_npm/tdesign-miniprogram/picker/picker",
"t-picker-item": "/miniprogram_npm/tdesign-miniprogram/picker-item/picker-item",
"t-date-time-picker": "/miniprogram_npm/tdesign-miniprogram/date-time-picker/date-time-picker"
},
"navigationBarTitleText": "案件上报",
"navigationBarTextStyle": "black",
"navigationBarBackgroundColor": "#FFFFFF"
} }

View File

@ -1,132 +1,92 @@
<view class="report"> <scroll-view scroll-y style="height:{{scrollHeight}}px;padding-bottom: 35px;">
<view class="title">基本信息</view>
<view class="info"> <view class="page-container">
<view class="row"> <!-- 基础信息 -->
<view class="required">*</view> <view class="form-head">
<view class="main"> <view class="form-head-line"></view>
<view class="selected"> <view>基本信息</view>
<picker bindchange="bindPickerChange" value="{{officeIndex}}" range="{{officeArray}}"> </view>
<view class="picker"> <view class="box-container">
{{officeArray[officeIndex]}}
</view> <view class="form-item" bind:tap="onShowStreetPick">
</picker> <view class="form-title must">街道</view>
</view> <view class="form-content select">{{selStreet==null?'请选择案件所属街道':selStreet.dictName}}</view>
<view class="select-icon"> </view>
<image src="../../images/select.png"></image> <view class="form-item">
</view> <view class="form-title must">社区</view>
</view> <view class="form-content select" bind:tap="onShowCommunitPicker">{{selCommunity==null?'请选择案件所属社区':selCommunity.communityName}}</view>
</view> </view>
<view class="row"> <view class="form-item">
<view class="required">*</view> <view class="form-title must">类别</view>
<view class="main"> <view class="form-content select" bind:tap="onShowType1">{{selType==null?'请选择所属类别':selType.dictName}}</view>
<view class="selected"> </view>
<picker bindchange="bindCommunityChange" value="{{communityIndex}}" range="{{communityArray}}"> <view class="form-item">
<view class="picker"> <view class="form-title must">详细类型</view>
{{communityArray[communityIndex]}} <view class="form-content select" bind:tap="onShowType2">{{selType2==null?'请选择详细类别':selType2.dictName}}</view>
</view> </view>
</picker> <view class="form-item">
</view> <view class="form-title must">地址</view>
<view class="select-icon"> <view class="form-content all">{{address==null?'请选择地址':address}}</view>
<image src="../../images/select.png"></image> </view>
</view>
</view> </view>
</view> <view class="form-head">
<view class="row"> <view class="form-head-line"></view>
<view class="required">*</view> <view>详细信息</view>
<view class="main"> </view>
<view class="selected"> <view class="box-container">
<picker bindchange="bindTypeChange" value="{{typeIndex}}" range="{{typeArray}}">
<view class="picker"> <view class="form-item ver">
{{typeArray[typeIndex]}} <view class="form-title must">案件描述</view>
</view> <textarea class="form-textarea" placeholder="请输入案件描述" placeholder-style="font-size:14px;" bindinput="inputCaseDesc" />
</picker> </view>
</view> <view class="form-item">
<view class="select-icon"> <view class="voice">
<image src="../../images/select.png"></image> <view class="voice-info" wx:if="{{!recodePath}}">
</view> <image src="../../images/vioce.png"></image>
</view> 录音
</view> </view>
<view class="row"> <view class="voice-info" bindtap="playRecord" wx:else>
<view class="required">*</view> <image src="../../images/vioce.png"></image>
<view class="main"> 播放录音
<view class="selected"> </view>
<picker bindchange="bindTypeLvChange" value="{{typeLvIndex}}" range="{{typeLvArray}}"> <view class="voice-btn" bindlongpress="recordVoice" bindtouchend="recordEnd">长按录音</view>
<view class="picker"> </view>
{{typeLvArray[typeLvIndex]}} </view>
</view> <view class="line"></view>
</picker> <view class="form-item ver">
</view> <view class="form-title must">现场照片</view>
<view class="select-icon"> <view class="main detail-main photo-main">
<image src="../../images/select.png"></image> <view class="choose-photo">
</view> <view class="img-box" wx:for="{{photoList}}" wx:key="index">
</view> <image src="{{item.path}}"></image>
</view> <image src="../../images/delete.png" class="delete-btn" data-num="{{index}}" bindtap="deleteImg"></image>
<view class="row"> </view>
<view class="required">*</view> <view class="add" bindtap="chooseImage" wx:if="{{photoList.length < 9}}">
<view class="main"> <image src="../../images/camera.png"></image>
<view class="selected">巡检采集</view> </view>
</view> </view>
</view> </view>
<view class="row"> </view>
<view class="required">*</view> </view>
<view class="main self-box">
<view class="self">自行处理</view> <!-- 街道 -->
<view class="self-check"> <t-picker visible="{{streetPicker}}" value="{{streetList}}" keys="{{streetKeys}}" title="请选择" cancelBtn="取消" confirmBtn="确认" bindchange="onStreetPick" bindcancel="onStreetCancel">
<radio-group bindchange="isSelfHandle"> <t-picker-item options="{{streetList}}" />
<label> </t-picker>
<radio value="0" color="#008cff" checked="checked">否</radio> <!-- 社区 -->
</label> <t-picker visible="{{communityPicker}}" value="{{communityList}}" keys="{{communityKeys}}" title="请选择" cancelBtn="取消" confirmBtn="确认" bindchange="onCommunityPick" bindcancel="onCommunityCancel">
</radio-group> <t-picker-item options="{{communityList}}" />
</view> </t-picker>
</view> <!-- 类型 -->
</view> <t-picker visible="{{typePicker}}" value="{{typeList}}" keys="{{typeKeys}}" title="请选择" cancelBtn="取消" confirmBtn="确认" bindchange="onTypePick" bindcancel="onTypeCancel">
<view class="row"> <t-picker-item options="{{typeList}}" />
<view class="required">*</view> </t-picker>
<view class="main address-main"> <!-- 类型详细 -->
<view class="address">{{address}}</view> <t-picker visible="{{type2Picker}}" value="{{type2List}}" keys="{{type2Keys}}" title="请选择" cancelBtn="取消" confirmBtn="确认" bindchange="onType2Pick" bindcancel="onType2Cancel">
</view> <t-picker-item options="{{type2List}}" />
</view> </t-picker>
</view>
</view> </view>
<view class="report"> </scroll-view>
<view class="title">详细信息</view> <view class="btn-submit" bind:tap="submitReport">上报</view>
<view class="info">
<view class="row detail-row">
<view class="detail-required">*</view>
<view class="main detail-main">
<textarea placeholder="请输入案件描述内容" model:value="{{caseDesc}}"></textarea>
</view>
</view>
<view class="row detail-row">
<view class="voice">
<view class="voice-info" wx:if="{{!recodePath}}">
<image src="../../images/vioce.png"></image>
录音
</view>
<view class="voice-info" bindtap="playRecord" wx:else>
<image src="../../images/vioce.png"></image>
播放录音
</view>
<view class="voice-btn" bindlongpress="recordVoice" bindtouchend="recordEnd">长按录音</view>
<!-- <view class="voice-btn" bindlongpress="recordVoice" bindtouchend="recordEnd" bindtouchmove="touchMove">长按录音</view> -->
</view>
</view>
<view class="row detail-row">
<view class="detail-required">*</view>
<view class="main detail-main photo-main">
<view class="choose-photo">
<view class="img-box" wx:for="{{photoList}}" wx:key="index">
<image src="{{item.path}}"></image>
<image src="../../images/delete.png" class="delete-btn" data-num="{{index}}" bindtap="deleteImg"></image>
</view>
<view class="add" bindtap="chooseImage" wx:if="{{photoList.length < 9}}">
<image src="../../images/camera.png"></image>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="submit" bindtap="submitReport">
上报
</view>

View File

@ -1,191 +1,369 @@
page{ .report,
background: #f2f1f6; .detail {
padding: 0 20rpx;
} }
.report, .detail{
padding: 0 20rpx; .report {
margin-bottom: 15rpx;
} }
.report{
margin-bottom: 15rpx; .title,
.detail-title {
font-size: 36rpx;
margin-bottom: 15rpx;
} }
.title, .detail-title{
font-size: 36rpx; .info {
margin-bottom: 15rpx; padding: 20rpx 20rpx 0;
overflow: hidden;
background: #fff;
border-radius: 10rpx;
box-shadow: 0 0 10rpx #EEE;
} }
.info{
padding: 20rpx 20rpx 0; .row {
overflow: hidden; margin-bottom: 20rpx;
background: #fff; position: relative;
border-radius: 10rpx; padding-left: 20rpx;
box-shadow: 0 0 10rpx #EEE;
} }
.row{
margin-bottom: 20rpx; .required {
position: relative; position: absolute;
padding-left: 20rpx; top: 0;
left: 0;
color: red;
} }
.required{
position: absolute; .main {
top: 0; background: #f1f1f6;
left: 0; width: 100%;
color: red; height: 75rpx;
border-radius: 10rpx;
padding: 0 15rpx;
box-sizing: border-box;
position: relative;
} }
.main{
background: #f1f1f6; .main input {
width: 100%; width: 100%;
height: 75rpx; height: 100%;
border-radius: 10rpx;
padding: 0 15rpx;
box-sizing: border-box;
position: relative;
} }
.main input{
width: 100%; .selected {
height: 100%; display: block;
line-height: 75rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-right: 75rpx;
} }
.selected{
display: block; .select-icon {
line-height: 75rpx; position: absolute;
white-space: nowrap; top: 0;
overflow: hidden; right: 0;
text-overflow: ellipsis; width: 75rpx;
padding-right: 75rpx; height: 75rpx;
} }
.select-icon{
position: absolute; .select-icon image {
top: 0; width: 30rpx;
right: 0; height: 22rpx;
width: 75rpx; position: absolute;
height: 75rpx; top: 50%;
left: 50%;
transform: translate(-50%, -50%);
} }
.select-icon image{
width: 30rpx; .detail-required {
height: 22rpx; color: red;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
} }
.detail-required{
color: red; .detail-row {
margin-bottom: 20rpx;
padding-left: 0;
} }
.detail-row{
margin-bottom: 20rpx; .detail-row textarea {
padding-left: 0; width: 100%;
height: 200rpx;
padding: 10rpx;
box-sizing: border-box;
background: #f1f1f6;
} }
.detail-row textarea{
width: 100%; .detail .info {
height: 200rpx; padding: 20rpx;
padding: 10rpx;
box-sizing: border-box;
background: #f1f1f6;
} }
.detail .info{
padding: 20rpx; .voice {
display: flex;
justify-content: space-between;
padding-right: 10px;
border-radius: 10rpx;
width: 100%;
font-size: 14px;
} }
.voice{
display: flex; .detail-info {
justify-content: space-between; background: #FFF;
padding: 20rpx; border-radius: 10rpx;
background: #f1f1f6; padding: 20rpx 20rpx 0;
border-radius: 10rpx; overflow: hidden;
} }
.detail-info{
background: #FFF; .detail-main {
border-radius: 10rpx; height: auto;
padding: 20rpx 20rpx 0;
overflow: hidden;
} }
.detail-main{
height: auto; .voice-btn {
height: 30px;
padding: 0 10px;
font-size: 14px;
background: #008cff;
color: #fff;
border-radius: 10rpx;
line-height: 30px;
} }
.voice-btn{
height: 70rpx; .voice-info {
padding: 0 20rpx; line-height: 70rpx;
background: #008cff; padding-left: 50rpx;
color: #fff; position: relative;
border-radius: 10rpx;
line-height: 70rpx;
} }
.voice-info{
line-height: 70rpx; .voice-info image {
padding-left: 50rpx; position: absolute;
position: relative; top: 50%;
left: 0;
width: 45rpx;
height: 45rpx;
transform: translate(0, -50%);
} }
.voice-info image{
position: absolute; .choose-photo .img-box {
top: 50%; width: 32%;
left: 0; height: 140rpx;
width: 45rpx; margin-right: 2%;
height: 45rpx; margin-bottom: 10rpx;
transform: translate(0,-50%); position: relative;
display: inline-block;
} }
.choose-photo .img-box{
width: 32%; .img-box image {
height: 140rpx; width: 100%;
margin-right: 2%; height: 100%;
margin-bottom: 10rpx;
position: relative;
display: inline-block;
} }
.img-box image{
width: 100%; .img-box .delete-btn {
height: 100%; position: absolute;
top: -10rpx;
right: -10rpx;
width: 40rpx;
height: 40rpx;
} }
.img-box .delete-btn{
position: absolute; .choose-photo .img-box:nth-child(3n) {
top: -10rpx; margin-right: 0;
right: -10rpx;
width: 40rpx;
height: 40rpx;
} }
.choose-photo .img-box:nth-child(3n){
margin-right: 0; .photo-main {
background: none;
padding: 0;
} }
.photo-main{
background: none; .submit {
padding: 0; width: 710rpx;
height: 100rpx;
background: #008cff;
line-height: 100rpx;
text-align: center;
color: #fff;
border-radius: 10rpx;
margin: 15rpx auto;
} }
.submit{
width: 710rpx; .add {
height: 100rpx; display: inline-block;
background: #008cff; width: 32%;
line-height: 100rpx; height: 140rpx;
text-align: center; background: #f1f1f6;
color: #fff; position: relative;
border-radius: 10rpx;
margin: 15rpx auto;
} }
.add{
display: inline-block; .add image {
width: 32%; position: absolute;
height: 140rpx; top: 50%;
background: #f1f1f6; left: 50%;
position: relative; transform: translate(-50%, -50%);
width: 60rpx;
height: 60rpx;
} }
.add image{
position: absolute; .address {
top: 50%; line-height: 75rpx;
left: 50%;
transform: translate(-50%, -50%);
width: 60rpx;
height: 60rpx;
} }
.address{
line-height: 75rpx; .self-box {
display: flex;
justify-content: space-between;
} }
.self-box{
display: flex; .self,
justify-content: space-between; .self-check label {
line-height: 75rpx;
} }
.self, .self-check label{
line-height: 75rpx; .self-check label {
margin-right: 15rpx;
} }
.self-check label{
margin-right: 15rpx; .self-check label:last-child {
margin-right: 0;
} }
.self-check label:last-child{
margin-right: 0; .address-main {
height: auto;
} }
.address-main{
height: auto;
/* pages/censusinput/censusinput.wxss */
page {
background-color: #efefef;
}
.page-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
margin-top: 5px;
border-radius: 10px;
flex-basis: 100%;
padding: 10px;
}
.box-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: flex-start;
border-radius: 10px;
background-color: white;
flex-basis: 100%;
padding-left: 10px;
padding-right: 10px;
margin-top: 10px;
width: 94%;
margin-bottom: 10px;
}
.form-item {
display: flex;
flex-direction: row;
justify-content: center;
align-items: center;
padding: 5px;
width: fit-content;
width: 97%;
}
.ver {
flex-direction: column;
justify-content: flex-start;
align-items: flex-start;
}
.form-textarea {
background-color: #EFEFEF;
width: 95%;
margin-top: 5px;
padding: 5px;
font-size: 14px;
height: 100px;
border-radius: 5px;
}
.form-title {
font-size: 14px;
flex: .4;
}
.must::after {
content: "*";
color: red;
}
.select::after {
content: "\25BC";
color: #6d6d6d;
font-size: 12px;
padding-left: 5px;
}
.form-content {
font-size: 14px;
flex: .6;
text-align: right;
padding: 5px;
text-overflow: ellipsis;
overflow: hidden;
word-break: break-all;
white-space: nowrap;
}
.all{
text-overflow: normal;
overflow: normal;
word-break: normal;
white-space: normal;
}
.form-head {
display: flex;
flex-direction: row;
justify-content: flex-start;
align-items: center;
font-size: 15px;
color: black;
font-weight: bold;
}
.form-head-line {
height: 15px;
width: 6px;
background-color: #4985f8;
margin-right: 5px;
}
radio {
transform: scale(0.7);
font-size: 18px;
}
.btn-submit {
width: 100%;
position: fixed;
bottom: 0;
height: 48px;
background-color: #4985f8;
display: flex;
justify-content: center;
align-items: center;
align-self: center;
color: #FFFFFF;
z-index: 23;
}
.btn-submit:active {
transform: scale(0.9);
}
.line {
margin-top: 5px;
margin-bottom: 5px;
border: 1px dashed #ebe9e9;
width: 100%;
} }

View File

@ -14,7 +14,7 @@ Page({
rows: 10 rows: 10
}, },
scrollHeight: 400, scrollHeight: 400,
totalNum:0, totalNum: 0,
}, },
/** /**
@ -97,12 +97,12 @@ Page({
list: [], list: [],
['page.page']: 1, ['page.page']: 1,
triggered: false, triggered: false,
totalNum:0 totalNum: 0
}) })
_self.getList() _self.getList()
}, },
onLoadMore(){ onLoadMore() {
console.log(this.data.list) console.log(this.data.list)
var self = this var self = this
if (self.data.totalNum === self.data.list.length) { if (self.data.totalNum === self.data.list.length) {
@ -124,7 +124,9 @@ Page({
}) })
}, },
doReport() { doReport() {
wx.navigateTo({
url: '/pages/caseReport/caseReport',
})
}, },
doCheck() { doCheck() {

View File

@ -84,14 +84,12 @@ function doAjax(url, method, dataObj, args, successCallback, errorCallback, comp
} else { } else {
console.log(response) console.log(response)
if (errorCallback && typeof errorCallback == 'function') { if (errorCallback && typeof errorCallback == 'function') {
console.log('走走');
errorCallback(response.statusCode, response.data); errorCallback(response.statusCode, response.data);
} }
} }
}, },
fail: function (response) { fail: function (response) {
console.log(response); if (errorCallback && typeof errorCallback == 'function') {
if (errorCallback) {
console.log(response); console.log(response);
errorCallback(response.statusCode, response.data); errorCallback(response.statusCode, response.data);
} }