Browse Source

腾讯地图的定位

lisu_V4.3.1
是小王呀\24601 1 year ago
parent
commit
fcf73178f1
  1. 174
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
  2. 4
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml
  3. 1
      subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss
  4. 139
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml
  5. 12
      subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

174
subpages/InspectionReport/pages/InspectionReport/InspectionReport.js

@ -1,66 +1,118 @@
// subpages/InspectionReport/pages/InspectionReport/InspectionReport.js // subpages/InspectionReport/pages/InspectionReport/InspectionReport.js
const QQMapWX = require('../../../../utils/qqmap-wx-jssdk')
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
addressContent:'',
}, fmData: {
gridId: '',
/** attachmentList:[],//图片
* 生命周期函数--监听页面加载 voiceList:[],
*/ latitude:"",
onLoad(options) { longitude:"",
resiId:"",
}, happenTime:"",
content:"",//内容
/** address:"",//地址
* 生命周期函数--监听页面初次渲染完成 },
*/ },
onReady() {
/**
}, * 生命周期函数--监听页面加载
*/
/** onLoad(options) {
* 生命周期函数--监听页面显示 this.data.qqMapWX = new QQMapWX({
*/ key: 'CMJBZ-4DECI-JXGGN-5B4WU-QLV2H-B5BEJ'
onShow() { })
this.reverseLocation()
}, },
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面初次渲染完成
*/ */
onHide() { onReady() {
}, },
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面显示
*/ */
onUnload() { onShow() {
this.reverseLocation
}, },
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 生命周期函数--监听页面隐藏
*/ */
onPullDownRefresh() { onHide() {
}, },
/** /**
* 页面上拉触底事件的处理函数 * 生命周期函数--监听页面卸载
*/ */
onReachBottom() { 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)
}
})
}, },
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
}) })

4
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxml

@ -3,11 +3,11 @@
<view class="header_left"> <view class="header_left">
<image src="../../../../images/location.png" class="header_img"></image> <image src="../../../../images/location.png" class="header_img"></image>
<view class="inside"> <view class="inside">
<text class="text1">定位的信息</text> <text class="text1">{{addressContent}}</text>
<text class="text2">如定位不在事发地,请重新选择定位</text> <text class="text2">如定位不在事发地,请重新选择定位</text>
</view> </view>
</view> </view>
<view class="header_right"> <view class="header_right" bind:tap="toughGetLocation">
<text class="text3">重新定位</text> <text class="text3">重新定位</text>
</view> </view>
</view> </view>

1
subpages/InspectionReport/pages/InspectionReport/InspectionReport.wxss

@ -162,6 +162,7 @@ page {
flex-direction: column; flex-direction: column;
width: 650rpx; width: 650rpx;
margin-left: 40rpx; margin-left: 40rpx;
height: 90rpx;
} }
.add{ .add{
display: flex; display: flex;

139
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxml

@ -10,30 +10,33 @@
<image src="../../../../images/right.png" class="prosecutors_img"></image> <image src="../../../../images/right.png" class="prosecutors_img"></image>
</view> </view>
</view> </view>
<view class="prosecutors_top"> <view class="hidden">
<view class="prosecutors"> <view class="hidden_top">
<view> <view class="prosecutors">
<text class="prosecutors_req">*</text> <view>
<text class="prosecutors_pre">已整改隐患</text> <text class="prosecutors_req">*</text>
<text class="prosecutors_pre">已整改隐患</text>
</view>
<view>
<image src="../../../../images/right.png" class="prosecutors_img"></image>
</view>
</view> </view>
<view> <view class="prosecutors_but">
<image src="../../../../images/right.png" class="prosecutors_img"></image> <van-checkbox-group value="{{ result }}" bind:change="onCheckBox" class="prosecutors_chex">
<van-checkbox class="checkbox" name="a">1.车间一些软件设备出现生锈断裂情况严重。 </van-checkbox>
<van-checkbox name="b">2.还有部分货运车辆已过年检。</van-checkbox>
</van-checkbox-group>
<van-cell-group>
<van-field value="{{ value }}" placeholder="请输入新的隐患信息" border="{{ false }}" bind:change="onChange" class="prosecutors_group" />
</van-cell-group>
</view>
<view class="prosecutors_add">
<image src="../../../../images/add.png" style="width: 30rpx; height: 30rpx;"></image>
<text class="text3">在添加一条</text>
</view> </view>
</view>
<view class="prosecutors_but">
<van-checkbox-group value="{{ result }}" bind:change="onCheckBox" class="prosecutors_chex">
<van-checkbox class="checkbox" name="a">1.车间一些软件设备出现生锈断裂情况严重。 </van-checkbox>
<van-checkbox name="b">2.还有部分货运车辆已过年检。</van-checkbox>
</van-checkbox-group>
<van-cell-group>
<van-field value="{{ value }}" placeholder="请输入新的隐患信息" border="{{ false }}" bind:change="onChange" class="prosecutors_group"/>
</van-cell-group>
</view>
<view class="prosecutors_add">
<image src="../../../../images/add.png" style="width: 30rpx; height: 30rpx;"></image>
<text class="text3">在添加一条</text>
</view> </view>
</view> </view>
<view class="prosecutors"> <view class="prosecutors">
<view> <view>
<text class="prosecutors_req">*</text> <text class="prosecutors_req">*</text>
@ -49,8 +52,8 @@
<text class="prosecutors_req">*</text> <text class="prosecutors_req">*</text>
<text class="prosecutors_pre">拟复查时间</text> <text class="prosecutors_pre">拟复查时间</text>
<view class="input"> <view class="input">
<input confirm-type="next" bindblur="bindOwnerIdCardInput" bindinput="bindOwnerIdCardInput" value="{{form.ownerIdCard}}" placeholder-class="gray" placeholder="请输入" /> <input confirm-type="next" bindblur="bindOwnerIdCardInput" bindinput="bindOwnerIdCardInput" value="{{form.ownerIdCard}}" placeholder-class="gray" placeholder="请输入" />
</view> </view>
</view> </view>
<view> <view>
<image src="../../../../images/right.png" class="prosecutors_img"></image> <image src="../../../../images/right.png" class="prosecutors_img"></image>
@ -60,58 +63,58 @@
<text class="text1">附件</text> <text class="text1">附件</text>
<van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" /> <van-uploader file-list="{{ fileList }}" bind:after-read="afterRead" />
<text class="text1">备注</text> <text class="text1">备注</text>
<view class="textarea1"> <view class="textarea1">
<textarea class="" placeholder-style="color: #C1C1C1;" value="{{form.remark}}" bindblur="bindRemarkInput" bindinput="bindRemarkInput" maxlength="100" placeholder-class="gray" placeholder="请输入" /> <textarea class="" placeholder-style="color: #C1C1C1;" value="{{form.remark}}" bindblur="bindRemarkInput" bindinput="bindRemarkInput" maxlength="100" placeholder-class="gray" placeholder="请输入" />
</view> </view>
</view> </view>
</view> </view>
<view class="from"> <view class="from">
<view><text class="text2">巡检记录</text></view> <view><text class="text2">巡检记录</text></view>
<view style="margin-top: 32rpx;padding: 0 35rpx;"> <view style="margin-top: 32rpx;padding: 0 35rpx;">
<view class="logsBox"> <view class="logsBox">
<view class="item-dian {{index!=0?'item-dian1':''}}"> <view class="item-dian {{index!=0?'item-dian1':''}}">
<view class="neidian"></view> <view class="neidian"></view>
</view> </view>
<view class="logs-top"> <view class="logs-top">
<view class="logs-top-title">时间</view> <view class="logs-top-title">时间</view>
</view> </view>
<view class="logs-content"> <view class="logs-content">
<view class="logs-content-left"> <view class="logs-content-left">
<view> <view>
<text class="logs-content-title">检察人员:</text> <text class="logs-content-title">检察人员:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">123</text>
</view> </view>
<view> <view>
<text class="logs-content-title">检查结论:</text> <text class="logs-content-title">检查结论:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">123</text>
</view> </view>
<view> <view>
<text class="logs-content-title">隐患明细:</text> <text class="logs-content-title">隐患明细:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">123</text>
</view> </view>
<view> <view>
<text class="logs-content-title">整改要求:</text> <text class="logs-content-title">整改要求:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">123</text>
</view> </view>
<view> <view>
<text class="logs-content-title">附件:</text> <text class="logs-content-title">附件:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">123</text>
</view> </view>
<view> <view>
<text class="logs-content-title">备注:</text> <text class="logs-content-title">备注:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">123</text>
</view> </view>
<view> <view>
<text class="logs-content-title">整改要求:</text> <text class="logs-content-title">整改要求:</text>
<text class="logs-content-txt">123</text> <text class="logs-content-txt">123</text>
</view> </view>
</view>
</view>
</view>
</view> </view>
</view>
</view>
</view>
</view> </view>

12
subpages/safetyinspection/pages/safetyinspection/safetyinspection.wxss

@ -222,3 +222,15 @@ page {
line-height: 48rpx; line-height: 48rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.hidden{
display: flex;
flex-direction: column;
}
.hidden_top{
display: flex;
flex-direction:row;
align-items: center;
margin: 20rpx;
justify-content: space-between;
height: 50rpx;
}
Loading…
Cancel
Save