|
@@ -7,35 +7,37 @@
|
|
|
<view class="content">
|
|
|
<view class="item">
|
|
|
<text class="title">地块编号</text>
|
|
|
- <text class="val">{{ detailData.dkbh }}</text>
|
|
|
+ <text class="val">{{ objs.dkbh }}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="title">面积(亩)</text>
|
|
|
- <text class="val">{{ detailData.mj }}</text>
|
|
|
+ <text class="val">{{ objs.mj }}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="title">地块位置</text>
|
|
|
- <text class="val">{{ detailData.dkwz }}</text>
|
|
|
+ <text class="val">{{ objs.dkwz }}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="title">地块现状</text>
|
|
|
- <text class="val">{{ detailData.dkbh }}</text>
|
|
|
+ <text class="val">{{ objs.dkxz }}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="title">管地单位</text>
|
|
|
- <text class="val">{{ detailData.dkbh }}</text>
|
|
|
+ <text class="val">{{ objs.gddw }}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="title">联系人</text>
|
|
|
- <text class="val">{{ detailData.dkbh }}</text>
|
|
|
+ <text class="val">{{ objs.lxr }}</text>
|
|
|
</view>
|
|
|
<view class="item">
|
|
|
<text class="title">联系电话</text>
|
|
|
- <text class="val">{{ detailData.dkbh }}</text>
|
|
|
+ <text class="val">{{ objs.lxdh }}</text>
|
|
|
</view>
|
|
|
- <view class="item">
|
|
|
+ <view class="item szfw">
|
|
|
<text class="title">四至范围</text>
|
|
|
- <text class="val">{{ detailData.dkbh }}</text>
|
|
|
+ <text class="val">
|
|
|
+ <text>{{ objs.szfw }}</text>
|
|
|
+ </text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -50,7 +52,7 @@
|
|
|
id=""
|
|
|
cols="30"
|
|
|
rows="10"
|
|
|
- v-model="baseFormData.description"
|
|
|
+ v-model="baseFormData.xzms"
|
|
|
placeholder="请输入现状描述"
|
|
|
></textarea>
|
|
|
</view>
|
|
@@ -95,60 +97,258 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ lat: '',
|
|
|
+ lat2: '',
|
|
|
+ long: '',
|
|
|
+ long2: '',
|
|
|
+ lat3: '',
|
|
|
+ long3: '',
|
|
|
+ queryParams: {
|
|
|
+ xcryId: '',
|
|
|
+ xzms: '',
|
|
|
+ xcryName: '',
|
|
|
+ xcryMobile: '',
|
|
|
+ dksyh: '',
|
|
|
+ imgList: [
|
|
|
+ {
|
|
|
+ fileId: '',
|
|
|
+ lng: '',
|
|
|
+ lat: '',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ },
|
|
|
+ objs: {},
|
|
|
fileList: [],
|
|
|
- distance: 0,
|
|
|
+ fileImgList: [],
|
|
|
imageStyles: {
|
|
|
width: 64,
|
|
|
height: 64,
|
|
|
},
|
|
|
- canvasW: 0,
|
|
|
- canvasH: 0,
|
|
|
- typeList: [
|
|
|
- {
|
|
|
- value: 0,
|
|
|
- text: '不存在盗采',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 1,
|
|
|
- text: '正发生盗采',
|
|
|
- },
|
|
|
- {
|
|
|
- value: 2,
|
|
|
- text: '已盗采',
|
|
|
- },
|
|
|
- ],
|
|
|
+
|
|
|
baseFormData: {
|
|
|
lawBreakType: '',
|
|
|
- description: '',
|
|
|
+ xzms: '',
|
|
|
},
|
|
|
- covers: [],
|
|
|
- warningId: '',
|
|
|
- fileLists: [],
|
|
|
- detailData: {
|
|
|
- dkbh: 'CH-52',
|
|
|
- mj: '81.30',
|
|
|
- dkwz: '11',
|
|
|
- },
|
|
|
- lat: '',
|
|
|
- lat2: '',
|
|
|
- long: '',
|
|
|
- long2: '',
|
|
|
- lat3: '',
|
|
|
- long3: '',
|
|
|
- fileImgList: [],
|
|
|
- isAudioPlay: false,
|
|
|
};
|
|
|
},
|
|
|
onReady() {
|
|
|
uni.showTabBar();
|
|
|
},
|
|
|
onLoad(option) {
|
|
|
- const idStr = option['idStr'];
|
|
|
- this.warningId = idStr;
|
|
|
- this.getLocationApi2();
|
|
|
+ const idStr = JSON.parse(option['obj']);
|
|
|
+ this.objs = idStr;
|
|
|
+ console.log(this.objs);
|
|
|
},
|
|
|
beforeDestroy() {},
|
|
|
methods: {
|
|
|
+ saveWarning() {
|
|
|
+ //上报
|
|
|
+ if (this.baseFormData.xzms === '') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '现状描述不能为空',
|
|
|
+ icon: 'none',
|
|
|
+ duration: 1500,
|
|
|
+ });
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.relationFileById(this.fileList);
|
|
|
+ },
|
|
|
+ relationFileById(fileObj) {
|
|
|
+ //文件上传
|
|
|
+ let _that = this;
|
|
|
+ // let sendData = fileObj;
|
|
|
+ let files = [];
|
|
|
+ console.log(fileObj);
|
|
|
+ let sendData = {
|
|
|
+ xcryId: uni.getStorageSync('userInfo').id,
|
|
|
+ xzms: this.baseFormData.xzms,
|
|
|
+ xcryName: uni.getStorageSync('userInfo').xcry,
|
|
|
+ xcryMobile: uni.getStorageSync('userInfo').lxdh,
|
|
|
+ dksyh: this.objs.dksyh,
|
|
|
+ imgList: [],
|
|
|
+ };
|
|
|
+ fileObj.forEach((item) => {
|
|
|
+ let obj = {
|
|
|
+ fileId: item.fileId,
|
|
|
+ lat: item.lat,
|
|
|
+ lng: item.lng,
|
|
|
+ };
|
|
|
+ files.push(obj);
|
|
|
+ });
|
|
|
+ sendData.imgList = files;
|
|
|
+ console.log(sendData);
|
|
|
+
|
|
|
+ httpAjax({
|
|
|
+ url: 'app/xc/addXcjl',
|
|
|
+ method: 'POST',
|
|
|
+ data: sendData,
|
|
|
+ })
|
|
|
+ .then((result) => {
|
|
|
+ if (result.data) {
|
|
|
+ uni.showModal({
|
|
|
+ title: '提示',
|
|
|
+ content: '上报成功,是否返回首页',
|
|
|
+ success: function (res) {
|
|
|
+ if (res.confirm) {
|
|
|
+ uni.navigateTo({
|
|
|
+ url: '/pages/main/index?index=2',
|
|
|
+ });
|
|
|
+ } else if (res.cancel) {
|
|
|
+ }
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.error('');
|
|
|
+ });
|
|
|
+ },
|
|
|
+ selectFileChange(file) {
|
|
|
+ console.log(file);
|
|
|
+ const that = this;
|
|
|
+ const tempFilePath = file.tempFilePaths[0];
|
|
|
+ uni.getImageInfo({
|
|
|
+ src: tempFilePath,
|
|
|
+ success: function (image) {
|
|
|
+ const context = uni.createCanvasContext('Canvas');
|
|
|
+ const fileName = file['tempFiles'][0]['name'];
|
|
|
+ that.setFileImgList(fileName, tempFilePath);
|
|
|
+ that.fileUploadAjax(tempFilePath);
|
|
|
+ // setTimeout(function () {
|
|
|
+ // context.fillRect(0, 0, image.width, image.height);
|
|
|
+ // context.drawImage(
|
|
|
+ // file.tempFilePaths[0],
|
|
|
+ // 0,
|
|
|
+ // 0,
|
|
|
+ // image.width,
|
|
|
+ // image.height,
|
|
|
+ // );
|
|
|
+ // context.setFontSize(20);
|
|
|
+ // context.setFillStyle('rgba(150, 150, 150, 0.6)');
|
|
|
+ // const latText = that.lat2;
|
|
|
+ // const lngText = that.long2;
|
|
|
+ // context.fillText(
|
|
|
+ // that.getDateTimeByNow(),
|
|
|
+ // image.width - 320,
|
|
|
+ // image.height - 20,
|
|
|
+ // );
|
|
|
+ // context.fillText(
|
|
|
+ // `${latText},${lngText}`,
|
|
|
+ // image.width - 250,
|
|
|
+ // image.height - 50,
|
|
|
+ // );
|
|
|
+ // context.draw(false, () => {
|
|
|
+ // setTimeout(() => {
|
|
|
+ // uni.canvasToTempFilePath({
|
|
|
+ // canvasId: 'Canvas',
|
|
|
+ // success: (path) => {
|
|
|
+ // console.log(path['tempFilePath']);
|
|
|
+ // that.setFileImgList(fileName, path['tempFilePath']);
|
|
|
+ // that.fileUploadAjax(path['tempFilePath']);
|
|
|
+ // },
|
|
|
+ // });
|
|
|
+ // }, 200);
|
|
|
+ // });
|
|
|
+ // }, 500);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getDateTimeByNow() {
|
|
|
+ const dateObj = new Date();
|
|
|
+ const year = dateObj.getFullYear();
|
|
|
+ const month = dateObj.getMonth() + 1;
|
|
|
+ const date = dateObj.getDate();
|
|
|
+
|
|
|
+ const hour = dateObj.getHours();
|
|
|
+ const min = dateObj.getMinutes();
|
|
|
+ const sec = dateObj.getSeconds();
|
|
|
+
|
|
|
+ const monthStr = month < 10 ? `0${month}` : month;
|
|
|
+ const dateStr = date < 10 ? `0${date}` : date;
|
|
|
+ const hourStr = hour < 10 ? `0${hour}` : hour;
|
|
|
+ const minStr = min < 10 ? `0${min}` : min;
|
|
|
+ const secStr = sec < 10 ? `0${sec}` : sec;
|
|
|
+ return `${year}年${monthStr}月${dateStr}日 ${hourStr}时${minStr}分${secStr}秒`;
|
|
|
+ },
|
|
|
+ setFileImgList(name, url) {
|
|
|
+ console.log(this.fileImgList);
|
|
|
+ const extnames = name.match(/\.(jpg|jpeg|png|GIF|JPG|PNG)$/);
|
|
|
+ const extname = extnames[0];
|
|
|
+ this.fileImgList.push({
|
|
|
+ name,
|
|
|
+ url,
|
|
|
+ extname,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fileUploadAjax(tempFile) {
|
|
|
+ const formData = new FormData();
|
|
|
+ formData.appendFile('file', tempFile);
|
|
|
+ const sendData = formData.getData();
|
|
|
+ let header = {
|
|
|
+ 'content-type': sendData.contentType,
|
|
|
+ };
|
|
|
+ const that = this;
|
|
|
+ httpAjax({
|
|
|
+ url: 'api/oss/upload',
|
|
|
+ method: 'POST',
|
|
|
+ header,
|
|
|
+ data: sendData.buffer,
|
|
|
+ }).then((result) => {
|
|
|
+ const data = result['data'];
|
|
|
+ that.getLocationApi(data);
|
|
|
+ // that.updateWaterMark(data['path']);
|
|
|
+ });
|
|
|
+ },
|
|
|
+ //拍摄时获取设备的经纬度
|
|
|
+ getLocationApi(data) {
|
|
|
+ let _that = this;
|
|
|
+ wx.authorize({
|
|
|
+ scope: 'scope.userLocation',
|
|
|
+ success: (res) => {
|
|
|
+ wx.getLocation({
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res);
|
|
|
+ _that.lat = res.latitude;
|
|
|
+ _that.long = res.longitude;
|
|
|
+ data.lat = res.latitude;
|
|
|
+ data.lng = res.longitude;
|
|
|
+ data.fileId = data.id;
|
|
|
+ data.warningId = _that.warningId;
|
|
|
+ _that.fileList.push(data);
|
|
|
+ console.log(_that.fileList);
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log('获取当前初始位置失败', err);
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ fail: (err) => {
|
|
|
+ console.log('获取授权失败', err);
|
|
|
+ this.handleOpenSetting();
|
|
|
+ },
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // updateWaterMark(path) {
|
|
|
+ // console.log(path);
|
|
|
+ // let _that = this;
|
|
|
+ // let sendData = {
|
|
|
+ // lat2: this.lat2,
|
|
|
+ // long2: this.long2,
|
|
|
+ // path: path,
|
|
|
+ // };
|
|
|
+ // console.log(sendData);
|
|
|
+ // // httpAjax({
|
|
|
+ // // url: 'app-api/mining/app/save',
|
|
|
+ // // method: 'POST',
|
|
|
+ // // data: sendData,
|
|
|
+ // // })
|
|
|
+ // // .then((result) => {
|
|
|
+ // // const data = result['data'];
|
|
|
+ // // })
|
|
|
+ // // .catch((err) => {
|
|
|
+ // // console.error('');
|
|
|
+ // // });
|
|
|
+ // },
|
|
|
toBackHandle() {
|
|
|
uni.navigateBack();
|
|
|
},
|