Browse Source

发现隐患

lisu_V4.3.1
是小王呀\24601 2 years ago
parent
commit
cd4d101656
  1. 457
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
  2. 115
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
  3. 3
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss
  4. 140
      subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js

457
subpages/InspectionReport/pages/InspectionReport/InspectionReport.js

@ -1,172 +1,25 @@
// // subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
// const QQMapWX = require('../../../../utils/qqmap-wx-jssdk')
// import addRecord from "../../../../utils/api"
// import {securityCheckk} from "../../../../utils/api"
// Page({
// /**
// * 页面的初始数据
// */
// data: {
// pageNo: 1,
// pageSize: 10,
// id: 0,
// addressContent:'',
// fmData: {
// gridId: '',
// attachmentList:[],//图片
// voiceList:[],
// latitude:"",
// longitude:"",
// resiId:"",
// happenTime:"",
// content:"",//内容
// address:"",//地址
// namesArray:[],
// checkPersons:''
// },
// },
// /**
// * 生命周期函数--监听页面加载
// */
// onLoad(options) {
// this.data.qqMapWX = new QQMapWX({
// key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ'
// })
// this.reverseLocation()
// // this.ToaddRecord()
// this.getList()
// },
// getList() {
// securityCheckk({
// pageNo: this.data.pageNo,
// pageSize: this.data.pageSize,
// }).then(({data}) => {
// console.log("123131",data.list)
// this.setData({
// marsi: data.list,
// total: data.total
// })
// this.setData({
// 'fmData.namesArray': data.list.map(item => ({ id: item.id, name: item.name })),
// 'fmData.checkPersons': data.list.map(item => item.checkPersons)
// });
// // console.log("123131", this.data.fmData.checkPersons);
// });
// },
// /**
// * 生命周期函数--监听页面初次渲染完成
// */
// onReady() {
// },
// /**
// * 生命周期函数--监听页面显示
// */
// onShow() {
// this.reverseLocation
// },
// /**
// * 生命周期函数--监听页面隐藏
// */
// onHide() {
// },
// /**
// * 生命周期函数--监听页面卸载
// */
// onUnload() {
// },
// /**
// * 页面相关事件处理函数--监听用户下拉动作
// */
// onPullDownRefresh() {
// },
// /**
// * 页面上拉触底事件的处理函数
// */
// onReachBottom() {
// },
// /**
// * 用户点击右上角分享
// */
// onShareAppMessage() {},
// //跳转地图选点
// toughGetLocation() {
// // this.getLocation(false);
// wx.chooseLocation({
// success: res => {
// console.log('resadddres', res)
// const {
// fmData
// } = this.data;
// this.setData({
// fmData: {
// ...fmData,
// address: res.address,
// longitude: res.longitude,
// latitude: res.latitude
// },
// addressContent: res.address
// });
// console.log(this.data.fmData);
// }
// })
// },
// //
// reverseLocation() {
// const _this = this
// this.data.qqMapWX.reverseGeocoder({
// success(res) {
// console.log(res);
// _this.setData({
// addressContent:res.result.address,
// 'fmData.address': res.result.address,
// 'fmData.longitude':res.result.location.lng,
// 'fmData.latitude':res.result.location.lat,
// })
// },
// fail(err) {
// console.debug(err)
// }
// })
// },
// ToaddRecord(){
// addRecord().then(res=>{
// console.log(res)
// })
// }
// })
// subpages/safetyinspection/pages/safetyinspection/safetyinspection.js
import {
$wuxActionSheet
} from '../../../../components/dist/index'
const QQMapWX = require('../../../../utils/qqmap-wx-jssdk')
const App = getApp()
import {addRecord,securityCheckk,inspectionStaff} from "../../../../utils/api"
import {
addRecord,
securityCheckk,
inspectionStaff
} from "../../../../utils/api"
Page({
/**
* 页面的初始数据
*/
data: {
hiddenDangeList: [
],
newObj:[],
addRecord: [],
attachmentUrl: '',
reviewTime: '',
hazardDesc:'',
checkResultFlag: '',
checkPersonsIdList: [],
pageNo: 1,
@ -192,7 +45,6 @@ Page({
getData: '',
gridName: '',
array: ['不合格', '合格'], // 选择器的数据源
result: ['a', 'b', 'c'],
arrlist: [],
fileList: [],
companyId: '',
@ -203,6 +55,8 @@ Page({
result: [],
// 用于存放输入框的值
newPassword: '',
uploadImageList: [],
imageId: 1,
arr: [
// {value:"1",name:'小王'},
// {value:"2",name:'李四'},
@ -238,10 +92,16 @@ submitBiao(){
checkPersonsIdList: this.data.checkPersonsIdList,
checkResultFlag: this.data.checkResultFlag,
reviewTime: this.data.reviewTime,
hazardDesc:[{hazardStatus:2},{hazardDesc:this.data.hazardDesc}],
attachmentUrls:[{fileName:'文件'},{attachmentUrl:'http://tmp/2JqHQVjACkEA00497265d7c287d505d1c20123e0470c.png'}],
hiddenDangeList: this.data.hiddenDangeList,
attachmentUrls: [{
fileName: '文件'
}, {
attachmentUrl: 'http://tmp/2JqHQVjACkEA00497265d7c287d505d1c20123e0470c.png'
}],
remark: '123'
}).then(({data}) => {
}).then(({
data
}) => {
console.log('data', data)
});
@ -251,26 +111,36 @@ submitBiao(){
securityCheckk({
pageNo: this.data.pageNo,
pageSize: this.data.pageSize,
}).then(({data}) => {
}).then(({
data
}) => {
// console.log("123131",data.list)
this.setData({
marsi: data.list,
total: data.total
})
this.setData({
'fmData.AllnamesArray': data.list.map(item => ({ id: item.id, name: item.name })),
'fmData.AllnamesArray': data.list.map(item => ({
id: item.id,
name: item.name
})),
'fmData.namesArray': data.list.map(item => (item.name)),
'fmData.checkPersons': data.list.map((item, index) => ({ value: index, name: item.checkPersons })),
'fmData.checkPersons': data.list.map((item, index) => ({
value: index,
name: item.checkPersons
})),
});
// console.log("123131", this.data.fmData.namesArray.map(item => item.name));
});
inspectionStaff({
orgId: App.globalData.user.agencyId,
orgId: App.globalData.user.agencyId,
orgType: 'agency',
pageNo: 1,
pageSize: 100
}).then(({data}) => {
}).then(({
data
}) => {
this.setData({
arr: data.staffList
})
@ -300,30 +170,29 @@ submitBiao(){
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
onUnload() {},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
onPullDownRefresh() {},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
onReachBottom() {},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
},
onShareAppMessage() {},
onChange(event) {
console.log(event)
console.log("111", event)
this.setData({
result: event.detail
});
// event.detail 为当前输入的值
console.log(this.data.selectedOptions);
console.log(this.data.result);
console.log(this.data.hiddenDangeList);
},
afterRead(event) {
const {
@ -355,10 +224,14 @@ submitBiao(){
},
showPopup() {
this.setData({ showPopup: true }); // 点击按钮显示弹出层
this.setData({
showPopup: true
}); // 点击按钮显示弹出层
},
onClose() {
this.setData({ showPopup: false }); // 关闭弹出层
this.setData({
showPopup: false
}); // 关闭弹出层
},
onChange1(event) {
console.log(event)
@ -366,7 +239,8 @@ submitBiao(){
selectedOptions: event.detail
});
console.log(this.data.selectedOptions)
},confirmSelection() {
},
confirmSelection() {
// 点击确定按钮后触发,处理选中的复选框项
console.log("选中的项:", this.data.selectedOptions);
@ -395,29 +269,35 @@ submitBiao(){
console.log(this.data.newPassword)
},
addAnother() {
// // 获取输入框的值
// const newPassword = this.data.newPassword;
// // 将值添加到arr数组中
// const arr = this.data.arr.concat(newPassword);
// // 更新数据
// this.setData({
// arr: arr,
// // 清空输入框的值
// newPassword: ''
// });
let newValue = this.data.arr1.length + 1; // 根据数组长度确定新值
let newArr = this.data.arr1.concat({ value: newValue.toString(), name: this.data.newPassword });
let newArr = this.data.arr1.concat({
value: newValue.toString(),
name: this.data.newPassword
});
this.setData({
arr1: newArr,
newPassword: '', // 清空输入框的值
});
console.log('添加后的数组:', this.data.arr1);
const nameArray = this.data.arr1.map(item => item.name);
console.log("111",nameArray)
nameArray.forEach(value => {
console.log( "qqq")
// 创建一个新的对象,设置 hazardDesc 属性为当前值
this.data.newObj = {
hazardStatus: '0', // 如果需要同时设置 hazardStatus 属性,可以在这里进行设置
hazardDesc: value
};
console.log( this.data.newObj)
// 将新对象添加到 hiddenDangeList 数组中
console.log(this.data.hiddenDangeList)
});
this.data.hiddenDangeList.push(this.data.newObj);
console.log(this.data.hiddenDangeList)
},
pickerChange: function (e) {
// 更新当前选中的索引
console.log(e.detail.value),
this.setData({
gridName: this.data.array[e.detail.value]
});
@ -449,22 +329,188 @@ bindRemarkInput(e){
console.log(this.data.remarks)
},
chooseImage() {
if (this.data.uploadImageList.length > 3) {
wx.showToast({
title: "最多上传3张照片",
icon: "none"
})
return
}
const _this = this
$wuxActionSheet().showSheet({
buttons: [{
text: '拍照'
},
{
text: '从相册中获取',
openType: null,
},
],
className: 'dialog-class',
buttonClicked(index) {
if (index === 0) {
wx.chooseMedia({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
sourceType: ['camera'],
success(res) {
console.log(res)
const tempFilePaths = res.tempFilePaths;
// 将选定的图片显示在页面上
this.setData({
imageUrl: tempFilePaths[0]
});
console.log(this.data.imageUrl)
console.log(res);
let deleteLength = _this.data.uploadImageList.length
const uploadImageList = [..._this.data.uploadImageList]
if (res.tempFiles[0].size <= 5 * 1024 * 1024) {
uploadImageList.push({
uploaded: false,
ossUrl: {
url:res.tempFiles[0].tempFilePath
},
imgUrl: res.tempFiles[0].tempFilePath,
imageId: ++_this.data.imageId,
type: res.tempFiles[0].tempFilePath.substr(res.tempFiles[0].tempFilePath.length - 3, 3),
format: "image",
name: 'wximage'
})
} else {
_this.showToast('图片上限5M,请压缩后重试~')
return false
}
_this.setData({
uploadImageList
})
wx.uploadFile({
url: `${config.BASEURL()}oss/file/uploadvariedfile`,
filePath: res.tempFiles[0].tempFilePath,
name: 'file',
header: {
'Content-type': 'application/json;charset=UTF-8',
'Authorization': wx.getStorageSync('token')
},
success(fileRes) {
if (!JSON.parse(fileRes.data).data) {
_this.showToast('图片上传失败,请重试~')
// 删除
const index = _this.data.uploadImageList.findIndex(item => item.imageId === _this.data.imageId)
if (index > -1) {
_this.data.uploadImageList.splice(index, 1)
_this.setData({
uploadImageList: _this.data.uploadImageList
})
}
} else {
uploadImageList[uploadImageList.length - 1].uploaded = true
uploadImageList[uploadImageList.length - 1].ossUrl = JSON.parse(fileRes.data).data
_this.setData({
uploadImageList
})
}
},
fail(fileRes) {
_this.setData({
uploadImageList: []
})
_this.showToast('图片上传失败,请重试~')
}
})
}
})
} else if (index === 1) {
wx.chooseMedia({
count: 1,
type: 'image',
sourceType: ['album'],
success(res) {
console.log(res, '图片上传的res');
let deleteLength = _this.data.uploadImageList.length
const uploadImageList = []
const endIndex = _this.data.uploadImageList.length
res.tempFiles.forEach((item, index) => {
if (item.size <= 5 * 1024 * 1024) {
uploadImageList.push({
uploaded: false,
ossUrl: {
url: item.tempFilePath
},
imgUrl: item.tempFilePath,
imageId: ++_this.data.imageId,
format: "image",
type: item.tempFilePath.substr(item.tempFilePath.length - 3, 3),
originFileName: 'image' + index + 1
})
} else {
_this.showToast('图片上限5M,请压缩后重试~')
}
})
_this.setData({
uploadImageList: [..._this.data.uploadImageList, ...uploadImageList]
})
uploadImageList.forEach((item, index) => {
return (function (index) {
wx.uploadFile({
url: `${config.BASEURL()}oss/file/uploadvariedfile`,
filePath: res.tempFiles[index].tempFilePath,
name: 'file',
header: {
'Content-type': 'application/json;charset=UTF-8',
'Authorization': wx.getStorageSync('token')
},
success(fileRes) {
if (!JSON.parse(fileRes.data).data) {
_this.showToast('图片上传失败,请重试~')
_this.data.uploadImageList.splice(deleteLength, _this.data.uploadImageList.length - deleteLength)
_this.setData({
uploadImageList: _this.data.uploadImageList
})
} else {
uploadImageList[index].uploaded = true
uploadImageList[index].ossUrl = JSON.parse(fileRes.data).data
_this.data.uploadImageList = _this.data.uploadImageList.slice(0, endIndex)
_this.setData({
uploadImageList: [..._this.data.uploadImageList, ...uploadImageList]
})
}
},
fail(fileRes) {
_this.setData({
uploadImageList: []
})
_this.showToast('图片上传失败,请重试~')
}
})
})(index)
})
}
})
}
return true
},
cancelText: '取消',
cancel() {},
destructiveButtonClicked() {},
})
// wx.chooseMedia({
// count: 1,
// sizeType: ['original', 'compressed'],
// sourceType: ['album', 'camera'],
// success(res) {
// console.log(res)
// const tempFilePaths = res.tempFilePaths;
// // 将选定的图片显示在页面上
// this.setData({
// imageUrl: tempFilePaths[0]
// });
// console.log(this.data.imageUrl)
// }
// })
},
// 删除选中的图片
deleteImage(e) {
const index = this.data.uploadImageList.findIndex(item => item.imageId === e.currentTarget.dataset.imageid)
if (index > -1) {
this.data.uploadImageList.splice(index, 1)
this.setData({
uploadImageList: this.data.uploadImageList
})
}
},
//跳转地图选点
toughGetLocation() {
// this.getLocation(false);
@ -506,6 +552,3 @@ reverseLocation() {
})
},
})

115
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml

@ -1,99 +1,4 @@
<!--subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml-->
<!-- <view class="header">
<view class="header_left">
<image src="../../../../images/location.png" class="header_img"></image>
<view class="inside">
<text class="text1">{{addressContent}}</text>
<text class="text2">如定位不在事发地,请重新选择定位</text>
</view>
</view>
<view class="header_right" bind:tap="toughGetLocation">
<text class="text3">重新定位</text>
</view>
</view>
<view class="from">
<view class="prosecutors">
<view>
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">企业名称</text>
<text class="prosecutors_name">张玉斌</text>
</view>
<view>
<image src="../../../../images/right.png" class="prosecutors_img"></image>
</view>
</view>
<view class="prosecutors_top">
<view class="prosecutors">
<view>
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">检察人员</text>
<text class="prosecutors_name">请选择</text>
</view>
<view>
<image src="../../../../images/right.png" class="prosecutors_img"></image>
</view>
</view>
</view>
<view class="prosecutors">
<view>
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">检查结论</text>
<text class="prosecutors_name">请选择</text>
</view>
<view>
<image src="../../../../images/right.png" class="prosecutors_img"></image>
</view>
</view>
<view class="hidden">
<view class="hidden_top">
<view>
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">隐患明细</text>
</view>
<view>
<image src="../../../../images/right.png" class="prosecutors_img"></image>
</view>
</view>
<view class="hidden_button">
<view class="input">
<input type="text" placeholder="请输入内容" bindinput="inputChange" />
</view>
<view class="add">
<image src="../../../../images/add.png" class="add_img"></image>
<text class="add_text">在添加一条</text>
</view>
</view>
<view class="date">
<text class="prosecutors_pre1">整改要求</text>
<view class="input1">
<input confirm-type="next" bindblur="bindOwnerIdCardInput" bindinput="bindOwnerIdCardInput" value="{{form.ownerIdCard}}" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
</view>
<view class="date">
<view class="prosecutors_data">
<text class="prosecutors_req">*</text>
<text class="prosecutors_pre">拟复查时间</text>
</view>
<view class="input1">
<input confirm-type="next" bindblur="bindOwnerIdCardInput" bindinput="bindOwnerIdCardInput" value="{{form.ownerIdCard}}" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
<view class="attachment">
<text class="prosecutors_pre1">附件</text>
<view class="shangchuan"> <van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" style="width: 200px; height: 200px;" /></view>
<text class="prosecutors_pre1">备注</text>
<view class="textarea1">
<textarea class="" placeholder-style="color: #C1C1C1;" value="{{form.remark}}" bindblur="bindRemarkInput" bindinput="bindRemarkInput" maxlength="100" placeholder-class="gray" placeholder="请输入" />
</view>
</view>
</view>
<view class="text-wrapper_11">
<text lines="1" class="text_29">提交</text>
</view> -->
<!--subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml-->
<view class="header">
<view class="header_left">
<image src="../../../../images/location.png" class="header_img"></image>
@ -142,7 +47,7 @@
</view>
<view class="checkbox1">
<van-checkbox-group value="{{ result }}" bind:change="onChange">
<van-checkbox name="{{item.value}}" wx:for="{{arr1}}" >{{item.name}}</van-checkbox>
<van-checkbox custom-class="group" data-value="{{item.value}}" name="{{item.value}}" wx:for="{{arr1}}" >{{item.name}}</van-checkbox>
</van-checkbox-group>
</view>
<view class="input1">
@ -204,6 +109,24 @@
</view>
</view>
<view class="attachment">
<!-- <view class="image-box">
<view class="{{ uploadImageList.length < 4 ? 'image-list' : uploadImageList.length > 3 && uploadImageList.length < 7 ? 'image-list image-list-2' : uploadImageList.length > 6 && uploadImageList.length < 10 ? 'image-list image-list-3' : 'image-list image-list-4' }}">
<view class=" image-list-label">
<view class="field-text">上传图片</view>
</view>
<view
class="image-item"
wx:for="{{uploadImageList}}"
wx:for-index="index"
wx:for-item="item"
wx:key="imageId">
<image class="issue-image" src="{{item.ossUrl.url}}" />
<image wx:if="{{!item.uploaded}}" class="loading" src="../../../images/loading.gif" />
<image bindtap="deleteImage" data-imageid="{{item.imageId}}" class="close" wx:else src="../../../images/sc.png" />
</view>
<image wx:if="{{uploadImageList.length < 3}}" src="../../../images/ig_tianjiatupian@2x.png" bindtap="chooseImage" />
</view>
</view> -->
<text class="text1">附件</text>
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" />
<text class="text1">备注</text>

3
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss

@ -509,6 +509,9 @@ page {
margin-left: 50rpx;
margin-bottom: 20rpx;
}
.group{
margin-top: 20rpx;
}
.input1{
width: 650rpx;
height: 90rpx;

140
subpages/demandCheck/pages/dissatisfied/demandCheck/demandCheck.js

@ -1,4 +1,6 @@
import { $wuxActionSheet } from '../../../../../components/dist/index'
import {
$wuxActionSheet
} from '../../../../../components/dist/index'
const QQMapWX = require('../../../../../utils/qqmap-wx-jssdk')
const config = require('../../../../../utils/config')
const app = getApp()
@ -13,7 +15,11 @@ Page({
*/
data: {
optionsId: '',
defaultMeasureNames:{label:'categoryName',value:'categoryCode',children:'childCateList'},
defaultMeasureNames: {
label: 'categoryName',
value: 'categoryCode',
children: 'childCateList'
},
fmData: {
gridId: '',
attachmentList: [], //图片
@ -28,7 +34,6 @@ Page({
minDate: '2018-01-01 00:00:00',
tabVal: "0",
uploadImageList: [], //图片上传的数组
streetList: [], // 街道
imageId: 1,
@ -160,7 +165,12 @@ Page({
addressContent: res.data.address,
resiName: res.data.name,
resiMobile: res.data.mobile,
uploadImageList:res.data.imageList&&res.data.imageList.length>0?res.data.imageList.map(item=>({ossUrl:{url:item},uploaded:true})):[],
uploadImageList: res.data.imageList && res.data.imageList.length > 0 ? res.data.imageList.map(item => ({
ossUrl: {
url: item
},
uploaded: true
})) : [],
uploadRecord: res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0] : null,
totalTime: this.format(res.data.voiceList && res.data.voiceList.length > 0 ? res.data.voiceList[0].duration : 0)
})
@ -178,7 +188,18 @@ Page({
this.setData({
submitDisabled: true
})
let {categoryCode,content,happenTime,resiId,gridId,attachmentList,voiceList,wantServiceTime,parentCode,reportType} = this.data.fmData
let {
categoryCode,
content,
happenTime,
resiId,
gridId,
attachmentList,
voiceList,
wantServiceTime,
parentCode,
reportType
} = this.data.fmData
const parm = {
categoryCode,
content,
@ -341,8 +362,7 @@ Page({
} else {
that.userDemandCance()
}
} else if (res.cancel) {
}
} else if (res.cancel) {}
}
})
},
@ -428,7 +448,9 @@ Page({
wx.chooseLocation({
success: res => {
console.log('resadddres', res)
const { fmData } = this.data;
const {
fmData
} = this.data;
this.setData({
fmData: {
...fmData,
@ -493,7 +515,12 @@ Page({
console.log(this.data.uploadImageList);
if (this.data.uploadImageList.length > 0) {
this.data.uploadImageList.forEach(item => {
imagesList.push({format:item.format ||'png',originFileName:item.originFileName ||'',url:item.ossUrl.url,type:item.type})
imagesList.push({
format: item.format || 'png',
originFileName: item.originFileName || '',
url: item.ossUrl.url,
type: item.type
})
})
}
this.setData({
@ -649,7 +676,18 @@ Page({
this.setData({
submitDisabled: true
})
let {categoryCode,content,happenTime,resiId,gridId,attachmentList,voiceList,wantServiceTime,parentCode,reportType} = this.data.fmData
let {
categoryCode,
content,
happenTime,
resiId,
gridId,
attachmentList,
voiceList,
wantServiceTime,
parentCode,
reportType
} = this.data.fmData
const parm = {
categoryCode,
content,
@ -756,9 +794,13 @@ Page({
}
const _this = this
$wuxActionSheet().showSheet({
buttons: [
{ text: '拍照' },
{ text: '从相册中获取',openType:null, },
buttons: [{
text: '拍照'
},
{
text: '从相册中获取',
openType: null,
},
],
className: 'dialog-class',
buttonClicked(index) {
@ -774,7 +816,9 @@ Page({
if (res.tempFiles[0].size <= 5 * 1024 * 1024) {
uploadImageList.push({
uploaded: false,
ossUrl: {url:res.tempFiles[0].tempFilePath},
ossUrl: {
url: res.tempFiles[0].tempFilePath
},
imgUrl: res.tempFiles[0].tempFilePath,
imageId: ++_this.data.imageId,
type: res.tempFiles[0].tempFilePath.substr(res.tempFiles[0].tempFilePath.length - 3, 3),
@ -838,7 +882,9 @@ Page({
if (item.size <= 5 * 1024 * 1024) {
uploadImageList.push({
uploaded: false,
ossUrl: {url:item.tempFilePath},
ossUrl: {
url: item.tempFilePath
},
imgUrl: item.tempFilePath,
imageId: ++_this.data.imageId,
format: "image",
@ -919,13 +965,23 @@ Page({
// 单选点击事件
inputSyncPicker(e) {
let {
detail: { value },
detail: {
value
},
currentTarget: {
dataset: { idKey, nameKey, listName, subname, subindex },
dataset: {
idKey,
nameKey,
listName,
subname,
subindex
},
},
} = e;
let item = this.data[listName][value];
let { personalInfo } = this.data;
let {
personalInfo
} = this.data;
if (subname && subindex !== undefined) {
personalInfo[subname][subindex][idKey] = item.value;
personalInfo[subname][subindex][nameKey] = item.label;
@ -934,7 +990,9 @@ Page({
personalInfo[nameKey] = item.label;
}
this.setData({ personalInfo });
this.setData({
personalInfo
});
this.dataHandle(listName)
@ -1095,7 +1153,10 @@ Page({
},
handleRecordDel() {
const { hasStop, isStart } = this.data
const {
hasStop,
isStart
} = this.data
console.log('hasStop---', this.data.hasStop)
if (isStart && !hasStop) {
recorderManager.stop()
@ -1115,7 +1176,9 @@ Page({
})
},
handleRecord() {
let { hasStart } = this.data
let {
hasStart
} = this.data
console.log(hasStart);
if (hasStart) this.recortPause()
else this.recortResume()
@ -1181,7 +1244,13 @@ Page({
this.setData({
"uploadRecord.uploaded": true,
"uploadRecord.url": url,
'fmData.voiceList':[{url:url,format:null,type:'mp3',duration,originFileName:fileName.toString()}],
'fmData.voiceList': [{
url: url,
format: null,
type: 'mp3',
duration,
originFileName: fileName.toString()
}],
showRecord: false,
hasStart: false,
isStart: false,
@ -1230,7 +1299,10 @@ Page({
})
recorderManager.onStop((res) => {
console.log('recorder stop', res);
const { tempFilePath, duration } = res;
const {
tempFilePath,
duration
} = res;
this.setData({
hasStop: true,
url: tempFilePath,
@ -1269,7 +1341,11 @@ Page({
},
// 录音结束
recordStop() {
const { url, recordingLength, hasStop } = this.data
const {
url,
recordingLength,
hasStop
} = this.data
this.setData({
hasStart: false
})
@ -1289,7 +1365,10 @@ Page({
timer = null
recorderManager.onStop((res) => {
console.log('recorder stop1111', res);
const { tempFilePath, duration } = res;
const {
tempFilePath,
duration
} = res;
this.uploadRecord(tempFilePath, duration)
//
console.log(duration, '上传结束的语音时间');
@ -1306,7 +1385,10 @@ Page({
clearInterval(timer)
timer = null
timer = setInterval(() => {
let { overDuration, recordingLength } = this.data
let {
overDuration,
recordingLength
} = this.data
if (recordingLength * 1000 >= overDuration) {
wx.showToast({
title: '录音已超时,已停止录音',
@ -1375,7 +1457,8 @@ Page({
},
// 播放逻辑
initDuration() {
var _a = this.data, duration = _a.duration;
var _a = this.data,
duration = _a.duration;
if (duration) {
this.setData({
totalMax: duration
@ -1395,8 +1478,7 @@ Page({
playUrl: res.tempFilePath
});
_this.initAudio();
}
else {
} else {
wx.showToast({
title: '音频加载失败',
icon: 'none',

Loading…
Cancel
Save