案件上报

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

View File

@ -1,472 +1,439 @@
const app = getApp()
var bmap = require('../../lib/bmap-wx.js');
let wxMarkerData = [];
var bmap = require('../../lib/bmap-wx.js');
let wxMarkerData = [];
// pages/caseReport/caseReport.js
Page({
/**
* 页面的初始数据
*/
data: {
address: '获取案件地址中...',
recodePath: '',
recorderManager: wx.getRecorderManager(),
innerAudioContext: wx.createInnerAudioContext(),
// 办事处
officeIndex: 0,
officeArray: [],
officeList: [],
officeSelectedId: '',
// 社区
communityIndex: 0,
communityArray: [],
communityList: [],
communitySelectedId: '',
// 类型
typeIndex: 0,
typeArray: [],
typeList: [],
typeSelectedId: '',
// 类型二级
typeLvIndex: 0,
typeLvArray: [],
typeLvList: [],
typeLvSelectedId: '',
// 案件类型
caseIndex: 0,
caseArray: [],
caseList: [],
caseSelectedId: '',
photoList: [],
startTouch: {},
selfHandle: 0,
caseDesc: '',
imageList: [],
token: ''
},
// 办事处列表
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
});
},
/**
* 页面的初始数据
*/
data: {
address: '获取案件地址中...',
recodePath: '',
recorderManager: wx.getRecorderManager(),
innerAudioContext: wx.createInnerAudioContext(),
//街道
streetPicker: false,
streetList: [],
streetKeys: {
label: 'dictName',
value: 'dictId'
},
selStreet: null,
//社区
communityPicker: false,
communityList: [],
communityKeys: {
label: 'communityName',
value: 'communityId'
},
selCommunity: null,
//类型
typePicker: false,
typeList: [],
typeKeys: {
label: 'dictName',
value: 'dictId'
},
selType: null,
//详细类型
type2Picker: false,
type2List: [],
type2Keys: {
label: 'dictName',
value: 'dictId'
},
selType2: null,
/**
* 生命周期函数--监听页面初次渲染完成
*/
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
})
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
//详细类型
onShowType2() {
this.setData({
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()
});
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
// 社区列表
getCommunityList: function () {
var self = this
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()
});
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
// 类型二级
getTypeLv: function () {
var self = this
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
}
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
var info = {
areaId: self.data.selStreet.dictId,
areaName: self.data.selStreet.dictName,
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">
<view class="title">基本信息</view>
<view class="info">
<view class="row">
<view class="required">*</view>
<view class="main">
<view class="selected">
<picker bindchange="bindPickerChange" value="{{officeIndex}}" range="{{officeArray}}">
<view class="picker">
{{officeArray[officeIndex]}}
</view>
</picker>
</view>
<view class="select-icon">
<image src="../../images/select.png"></image>
</view>
</view>
</view>
<view class="row">
<view class="required">*</view>
<view class="main">
<view class="selected">
<picker bindchange="bindCommunityChange" value="{{communityIndex}}" range="{{communityArray}}">
<view class="picker">
{{communityArray[communityIndex]}}
</view>
</picker>
</view>
<view class="select-icon">
<image src="../../images/select.png"></image>
</view>
</view>
</view>
<view class="row">
<view class="required">*</view>
<view class="main">
<view class="selected">
<picker bindchange="bindTypeChange" value="{{typeIndex}}" range="{{typeArray}}">
<view class="picker">
{{typeArray[typeIndex]}}
</view>
</picker>
</view>
<view class="select-icon">
<image src="../../images/select.png"></image>
</view>
</view>
</view>
<view class="row">
<view class="required">*</view>
<view class="main">
<view class="selected">
<picker bindchange="bindTypeLvChange" value="{{typeLvIndex}}" range="{{typeLvArray}}">
<view class="picker">
{{typeLvArray[typeLvIndex]}}
</view>
</picker>
</view>
<view class="select-icon">
<image src="../../images/select.png"></image>
</view>
</view>
</view>
<view class="row">
<view class="required">*</view>
<view class="main">
<view class="selected">巡检采集</view>
</view>
</view>
<view class="row">
<view class="required">*</view>
<view class="main self-box">
<view class="self">自行处理</view>
<view class="self-check">
<radio-group bindchange="isSelfHandle">
<label>
<radio value="0" color="#008cff" checked="checked">否</radio>
</label>
</radio-group>
</view>
</view>
</view>
<view class="row">
<view class="required">*</view>
<view class="main address-main">
<view class="address">{{address}}</view>
</view>
</view>
</view>
</view>
<view class="report">
<view class="title">详细信息</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>
<scroll-view scroll-y style="height:{{scrollHeight}}px;padding-bottom: 35px;">
<view class="page-container">
<!-- 基础信息 -->
<view class="form-head">
<view class="form-head-line"></view>
<view>基本信息</view>
</view>
<view class="box-container">
<view class="form-item" bind:tap="onShowStreetPick">
<view class="form-title must">街道</view>
<view class="form-content select">{{selStreet==null?'请选择案件所属街道':selStreet.dictName}}</view>
</view>
<view class="form-item">
<view class="form-title must">社区</view>
<view class="form-content select" bind:tap="onShowCommunitPicker">{{selCommunity==null?'请选择案件所属社区':selCommunity.communityName}}</view>
</view>
<view class="form-item">
<view class="form-title must">类别</view>
<view class="form-content select" bind:tap="onShowType1">{{selType==null?'请选择所属类别':selType.dictName}}</view>
</view>
<view class="form-item">
<view class="form-title must">详细类型</view>
<view class="form-content select" bind:tap="onShowType2">{{selType2==null?'请选择详细类别':selType2.dictName}}</view>
</view>
<view class="form-item">
<view class="form-title must">地址</view>
<view class="form-content all">{{address==null?'请选择地址':address}}</view>
</view>
</view>
<view class="form-head">
<view class="form-head-line"></view>
<view>详细信息</view>
</view>
<view class="box-container">
<view class="form-item ver">
<view class="form-title must">案件描述</view>
<textarea class="form-textarea" placeholder="请输入案件描述" placeholder-style="font-size:14px;" bindinput="inputCaseDesc" />
</view>
<view class="form-item">
<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>
</view>
<view class="line"></view>
<view class="form-item ver">
<view class="form-title must">现场照片</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>
<!-- 街道 -->
<t-picker visible="{{streetPicker}}" value="{{streetList}}" keys="{{streetKeys}}" title="请选择" cancelBtn="取消" confirmBtn="确认" bindchange="onStreetPick" bindcancel="onStreetCancel">
<t-picker-item options="{{streetList}}" />
</t-picker>
<!-- 社区 -->
<t-picker visible="{{communityPicker}}" value="{{communityList}}" keys="{{communityKeys}}" title="请选择" cancelBtn="取消" confirmBtn="确认" bindchange="onCommunityPick" bindcancel="onCommunityCancel">
<t-picker-item options="{{communityList}}" />
</t-picker>
<!-- 类型 -->
<t-picker visible="{{typePicker}}" value="{{typeList}}" keys="{{typeKeys}}" title="请选择" cancelBtn="取消" confirmBtn="确认" bindchange="onTypePick" bindcancel="onTypeCancel">
<t-picker-item options="{{typeList}}" />
</t-picker>
<!-- 类型详细 -->
<t-picker visible="{{type2Picker}}" value="{{type2List}}" keys="{{type2Keys}}" title="请选择" cancelBtn="取消" confirmBtn="确认" bindchange="onType2Pick" bindcancel="onType2Cancel">
<t-picker-item options="{{type2List}}" />
</t-picker>
</view>
</scroll-view>
<view class="btn-submit" bind:tap="submitReport">上报</view>

View File

@ -1,191 +1,369 @@
page{
background: #f2f1f6;
.report,
.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;
margin-bottom: 15rpx;
.info {
padding: 20rpx 20rpx 0;
overflow: hidden;
background: #fff;
border-radius: 10rpx;
box-shadow: 0 0 10rpx #EEE;
}
.info{
padding: 20rpx 20rpx 0;
overflow: hidden;
background: #fff;
border-radius: 10rpx;
box-shadow: 0 0 10rpx #EEE;
.row {
margin-bottom: 20rpx;
position: relative;
padding-left: 20rpx;
}
.row{
margin-bottom: 20rpx;
position: relative;
padding-left: 20rpx;
.required {
position: absolute;
top: 0;
left: 0;
color: red;
}
.required{
position: absolute;
top: 0;
left: 0;
color: red;
.main {
background: #f1f1f6;
width: 100%;
height: 75rpx;
border-radius: 10rpx;
padding: 0 15rpx;
box-sizing: border-box;
position: relative;
}
.main{
background: #f1f1f6;
width: 100%;
height: 75rpx;
border-radius: 10rpx;
padding: 0 15rpx;
box-sizing: border-box;
position: relative;
.main input {
width: 100%;
height: 100%;
}
.main input{
width: 100%;
height: 100%;
.selected {
display: block;
line-height: 75rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-right: 75rpx;
}
.selected{
display: block;
line-height: 75rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
padding-right: 75rpx;
.select-icon {
position: absolute;
top: 0;
right: 0;
width: 75rpx;
height: 75rpx;
}
.select-icon{
position: absolute;
top: 0;
right: 0;
width: 75rpx;
height: 75rpx;
.select-icon image {
width: 30rpx;
height: 22rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.select-icon image{
width: 30rpx;
height: 22rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
.detail-required {
color: red;
}
.detail-required{
color: red;
.detail-row {
margin-bottom: 20rpx;
padding-left: 0;
}
.detail-row{
margin-bottom: 20rpx;
padding-left: 0;
.detail-row textarea {
width: 100%;
height: 200rpx;
padding: 10rpx;
box-sizing: border-box;
background: #f1f1f6;
}
.detail-row textarea{
width: 100%;
height: 200rpx;
padding: 10rpx;
box-sizing: border-box;
background: #f1f1f6;
.detail .info {
padding: 20rpx;
}
.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;
justify-content: space-between;
padding: 20rpx;
background: #f1f1f6;
border-radius: 10rpx;
.detail-info {
background: #FFF;
border-radius: 10rpx;
padding: 20rpx 20rpx 0;
overflow: hidden;
}
.detail-info{
background: #FFF;
border-radius: 10rpx;
padding: 20rpx 20rpx 0;
overflow: hidden;
.detail-main {
height: auto;
}
.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;
padding: 0 20rpx;
background: #008cff;
color: #fff;
border-radius: 10rpx;
line-height: 70rpx;
.voice-info {
line-height: 70rpx;
padding-left: 50rpx;
position: relative;
}
.voice-info{
line-height: 70rpx;
padding-left: 50rpx;
position: relative;
.voice-info image {
position: absolute;
top: 50%;
left: 0;
width: 45rpx;
height: 45rpx;
transform: translate(0, -50%);
}
.voice-info image{
position: absolute;
top: 50%;
left: 0;
width: 45rpx;
height: 45rpx;
transform: translate(0,-50%);
.choose-photo .img-box {
width: 32%;
height: 140rpx;
margin-right: 2%;
margin-bottom: 10rpx;
position: relative;
display: inline-block;
}
.choose-photo .img-box{
width: 32%;
height: 140rpx;
margin-right: 2%;
margin-bottom: 10rpx;
position: relative;
display: inline-block;
.img-box image {
width: 100%;
height: 100%;
}
.img-box image{
width: 100%;
height: 100%;
.img-box .delete-btn {
position: absolute;
top: -10rpx;
right: -10rpx;
width: 40rpx;
height: 40rpx;
}
.img-box .delete-btn{
position: absolute;
top: -10rpx;
right: -10rpx;
width: 40rpx;
height: 40rpx;
.choose-photo .img-box:nth-child(3n) {
margin-right: 0;
}
.choose-photo .img-box:nth-child(3n){
margin-right: 0;
.photo-main {
background: none;
padding: 0;
}
.photo-main{
background: none;
padding: 0;
.submit {
width: 710rpx;
height: 100rpx;
background: #008cff;
line-height: 100rpx;
text-align: center;
color: #fff;
border-radius: 10rpx;
margin: 15rpx auto;
}
.submit{
width: 710rpx;
height: 100rpx;
background: #008cff;
line-height: 100rpx;
text-align: center;
color: #fff;
border-radius: 10rpx;
margin: 15rpx auto;
.add {
display: inline-block;
width: 32%;
height: 140rpx;
background: #f1f1f6;
position: relative;
}
.add{
display: inline-block;
width: 32%;
height: 140rpx;
background: #f1f1f6;
position: relative;
.add image {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 60rpx;
height: 60rpx;
}
.add image{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 60rpx;
height: 60rpx;
.address {
line-height: 75rpx;
}
.address{
line-height: 75rpx;
.self-box {
display: flex;
justify-content: space-between;
}
.self-box{
display: flex;
justify-content: space-between;
.self,
.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
},
scrollHeight: 400,
totalNum:0,
totalNum: 0,
},
/**
@ -97,12 +97,12 @@ Page({
list: [],
['page.page']: 1,
triggered: false,
totalNum:0
totalNum: 0
})
_self.getList()
},
onLoadMore(){
onLoadMore() {
console.log(this.data.list)
var self = this
if (self.data.totalNum === self.data.list.length) {
@ -124,7 +124,9 @@ Page({
})
},
doReport() {
wx.navigateTo({
url: '/pages/caseReport/caseReport',
})
},
doCheck() {

View File

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