diff --git a/miniprogram/app.js b/miniprogram/app.js index bc0d8cd..4da07f8 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -18,13 +18,14 @@ // this.globalData = {} }, globalData: { - // httpsUrl: "https://logapi.smartlog.work/", // 正式域名 + httpsUrl: "https://logapi.smartlog.work/", // 正式域名 // httpsUrl: "http://111.198.10.15:11638/", // 15 - httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 + // httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 openid: null, indexCount:1, nickName:"", userName:"", + currentUserName:"", role:"", // 角色,是管理用户还是普通用户 isConfigProject: '', // 管理用户是否配置了选择项目,,1 是【选择项目】,'0'否,【不选择项目】, devcode:"", diff --git a/miniprogram/app.js b/miniprogram/app.js index bc0d8cd..4da07f8 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -18,13 +18,14 @@ // this.globalData = {} }, globalData: { - // httpsUrl: "https://logapi.smartlog.work/", // 正式域名 + httpsUrl: "https://logapi.smartlog.work/", // 正式域名 // httpsUrl: "http://111.198.10.15:11638/", // 15 - httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 + // httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 openid: null, indexCount:1, nickName:"", userName:"", + currentUserName:"", role:"", // 角色,是管理用户还是普通用户 isConfigProject: '', // 管理用户是否配置了选择项目,,1 是【选择项目】,'0'否,【不选择项目】, devcode:"", diff --git a/miniprogram/pages/addDevice/addDevice.js b/miniprogram/pages/addDevice/addDevice.js index 29424a6..42f5f47 100644 --- a/miniprogram/pages/addDevice/addDevice.js +++ b/miniprogram/pages/addDevice/addDevice.js @@ -265,6 +265,11 @@ }; personArr.push(person); } + personArr.push({ + text: app.globalData.currentUserName, + value: app.globalData.currentUserName + }); + that.setData({ personoption1: personArr }) @@ -347,11 +352,14 @@ }) console.log('options', options); if(options.fromPage === 'defineMap') { // 从自定义地图页面跳转过来 + console.log('-09999999999', app.globalData.currentUserName); that.setData({ 'form.wellType': options.wellType, // 井类型 'form.wellcode': options.wellCode, // 井编号 'form.position': options.position, // 位置 'form.devicetype': '井盖状态监测仪', // 设备类型 + 'form.installperson': app.globalData.currentUserName, + 'form.project': '2025-NBJ', // 所属项目 'form.latitude': parseFloat(options.latitude).toFixed(6), 'form.longitude': parseFloat(options.longitude).toFixed(6), latitude: parseFloat(options.latitude).toFixed(6), diff --git a/miniprogram/app.js b/miniprogram/app.js index bc0d8cd..4da07f8 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -18,13 +18,14 @@ // this.globalData = {} }, globalData: { - // httpsUrl: "https://logapi.smartlog.work/", // 正式域名 + httpsUrl: "https://logapi.smartlog.work/", // 正式域名 // httpsUrl: "http://111.198.10.15:11638/", // 15 - httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 + // httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 openid: null, indexCount:1, nickName:"", userName:"", + currentUserName:"", role:"", // 角色,是管理用户还是普通用户 isConfigProject: '', // 管理用户是否配置了选择项目,,1 是【选择项目】,'0'否,【不选择项目】, devcode:"", diff --git a/miniprogram/pages/addDevice/addDevice.js b/miniprogram/pages/addDevice/addDevice.js index 29424a6..42f5f47 100644 --- a/miniprogram/pages/addDevice/addDevice.js +++ b/miniprogram/pages/addDevice/addDevice.js @@ -265,6 +265,11 @@ }; personArr.push(person); } + personArr.push({ + text: app.globalData.currentUserName, + value: app.globalData.currentUserName + }); + that.setData({ personoption1: personArr }) @@ -347,11 +352,14 @@ }) console.log('options', options); if(options.fromPage === 'defineMap') { // 从自定义地图页面跳转过来 + console.log('-09999999999', app.globalData.currentUserName); that.setData({ 'form.wellType': options.wellType, // 井类型 'form.wellcode': options.wellCode, // 井编号 'form.position': options.position, // 位置 'form.devicetype': '井盖状态监测仪', // 设备类型 + 'form.installperson': app.globalData.currentUserName, + 'form.project': '2025-NBJ', // 所属项目 'form.latitude': parseFloat(options.latitude).toFixed(6), 'form.longitude': parseFloat(options.longitude).toFixed(6), latitude: parseFloat(options.latitude).toFixed(6), diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 5535c2f..6ee50da 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -172,7 +172,7 @@ //删除事件 delItem: function (e) { - console.log(app.globalData.role, ']]]]]]]'); + console.log(app.globalData.role, ']]]]]]]'); if(app.globalData.role!='repair'){ wx.showToast({ icon: 'none', diff --git a/miniprogram/app.js b/miniprogram/app.js index bc0d8cd..4da07f8 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -18,13 +18,14 @@ // this.globalData = {} }, globalData: { - // httpsUrl: "https://logapi.smartlog.work/", // 正式域名 + httpsUrl: "https://logapi.smartlog.work/", // 正式域名 // httpsUrl: "http://111.198.10.15:11638/", // 15 - httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 + // httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 openid: null, indexCount:1, nickName:"", userName:"", + currentUserName:"", role:"", // 角色,是管理用户还是普通用户 isConfigProject: '', // 管理用户是否配置了选择项目,,1 是【选择项目】,'0'否,【不选择项目】, devcode:"", diff --git a/miniprogram/pages/addDevice/addDevice.js b/miniprogram/pages/addDevice/addDevice.js index 29424a6..42f5f47 100644 --- a/miniprogram/pages/addDevice/addDevice.js +++ b/miniprogram/pages/addDevice/addDevice.js @@ -265,6 +265,11 @@ }; personArr.push(person); } + personArr.push({ + text: app.globalData.currentUserName, + value: app.globalData.currentUserName + }); + that.setData({ personoption1: personArr }) @@ -347,11 +352,14 @@ }) console.log('options', options); if(options.fromPage === 'defineMap') { // 从自定义地图页面跳转过来 + console.log('-09999999999', app.globalData.currentUserName); that.setData({ 'form.wellType': options.wellType, // 井类型 'form.wellcode': options.wellCode, // 井编号 'form.position': options.position, // 位置 'form.devicetype': '井盖状态监测仪', // 设备类型 + 'form.installperson': app.globalData.currentUserName, + 'form.project': '2025-NBJ', // 所属项目 'form.latitude': parseFloat(options.latitude).toFixed(6), 'form.longitude': parseFloat(options.longitude).toFixed(6), latitude: parseFloat(options.latitude).toFixed(6), diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 5535c2f..6ee50da 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -172,7 +172,7 @@ //删除事件 delItem: function (e) { - console.log(app.globalData.role, ']]]]]]]'); + console.log(app.globalData.role, ']]]]]]]'); if(app.globalData.role!='repair'){ wx.showToast({ icon: 'none', diff --git a/miniprogram/pages/defineMap/defineMap.js b/miniprogram/pages/defineMap/defineMap.js index 7ea7fc8..33bcec3 100644 --- a/miniprogram/pages/defineMap/defineMap.js +++ b/miniprogram/pages/defineMap/defineMap.js @@ -48,6 +48,7 @@ markers: [], activeMarkerId: null, activeMarker: null, + activeMarkerWellCode: null, showActionSheet: false, filterOptions: [ { name: '查看全部井', type: 'all' }, @@ -233,6 +234,47 @@ console.log('气泡里面的按钮被点击'); // 在这里可以添加按钮点击后的具体逻辑 }, + // 点击井打不开 + notopen() { + var that = this + wx.showModal({ + content: '确定井打不开吗?', + success: function (res) { + if (res.confirm) { + if(wellList.length) { + console.log('000000000000', that.data.activeMarkerWellCode); + const index = wellList.findIndex(item => item.wellCode === that.data.activeMarkerWellCode) + if(index !== -1) { + wellList[index].isInStall = '2' + that.initManholeData(wellList) + } + } + wx.request({ + method: "post", + url: app.globalData.httpsUrl + "appDeviceAdd/changeWellState", + data: { + wellCode: that.data.activeMarker.manholeInfo.wellCode, + isInStall: '2' + }, + header: { + 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' + }, + success(res) { + }, + fail(err) { + wx.showToast({ + title: "修改井打不开状态失败", + icon: 'none', + duration: 2000 + }) + } + }) + } else { //这里是点击了取消以后 + console.log('用户点击取消') + } + } + }) + }, // 点击标记点 onMarkerTap(e) { // ========================================================= @@ -257,7 +299,8 @@ markers[index].zIndex = 100; this.setData({ markers: markers, - activeMarkerId: markerId + activeMarkerId: markerId, + activeMarkerWellCode: markers[index].manholeInfo.wellCode }); } // ========================================================= diff --git a/miniprogram/app.js b/miniprogram/app.js index bc0d8cd..4da07f8 100644 --- a/miniprogram/app.js +++ b/miniprogram/app.js @@ -18,13 +18,14 @@ // this.globalData = {} }, globalData: { - // httpsUrl: "https://logapi.smartlog.work/", // 正式域名 + httpsUrl: "https://logapi.smartlog.work/", // 正式域名 // httpsUrl: "http://111.198.10.15:11638/", // 15 - httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 + // httpsUrl: "https://grey.logapi.smartlog.work/", // 测试域名 openid: null, indexCount:1, nickName:"", userName:"", + currentUserName:"", role:"", // 角色,是管理用户还是普通用户 isConfigProject: '', // 管理用户是否配置了选择项目,,1 是【选择项目】,'0'否,【不选择项目】, devcode:"", diff --git a/miniprogram/pages/addDevice/addDevice.js b/miniprogram/pages/addDevice/addDevice.js index 29424a6..42f5f47 100644 --- a/miniprogram/pages/addDevice/addDevice.js +++ b/miniprogram/pages/addDevice/addDevice.js @@ -265,6 +265,11 @@ }; personArr.push(person); } + personArr.push({ + text: app.globalData.currentUserName, + value: app.globalData.currentUserName + }); + that.setData({ personoption1: personArr }) @@ -347,11 +352,14 @@ }) console.log('options', options); if(options.fromPage === 'defineMap') { // 从自定义地图页面跳转过来 + console.log('-09999999999', app.globalData.currentUserName); that.setData({ 'form.wellType': options.wellType, // 井类型 'form.wellcode': options.wellCode, // 井编号 'form.position': options.position, // 位置 'form.devicetype': '井盖状态监测仪', // 设备类型 + 'form.installperson': app.globalData.currentUserName, + 'form.project': '2025-NBJ', // 所属项目 'form.latitude': parseFloat(options.latitude).toFixed(6), 'form.longitude': parseFloat(options.longitude).toFixed(6), latitude: parseFloat(options.latitude).toFixed(6), diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 5535c2f..6ee50da 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -172,7 +172,7 @@ //删除事件 delItem: function (e) { - console.log(app.globalData.role, ']]]]]]]'); + console.log(app.globalData.role, ']]]]]]]'); if(app.globalData.role!='repair'){ wx.showToast({ icon: 'none', diff --git a/miniprogram/pages/defineMap/defineMap.js b/miniprogram/pages/defineMap/defineMap.js index 7ea7fc8..33bcec3 100644 --- a/miniprogram/pages/defineMap/defineMap.js +++ b/miniprogram/pages/defineMap/defineMap.js @@ -48,6 +48,7 @@ markers: [], activeMarkerId: null, activeMarker: null, + activeMarkerWellCode: null, showActionSheet: false, filterOptions: [ { name: '查看全部井', type: 'all' }, @@ -233,6 +234,47 @@ console.log('气泡里面的按钮被点击'); // 在这里可以添加按钮点击后的具体逻辑 }, + // 点击井打不开 + notopen() { + var that = this + wx.showModal({ + content: '确定井打不开吗?', + success: function (res) { + if (res.confirm) { + if(wellList.length) { + console.log('000000000000', that.data.activeMarkerWellCode); + const index = wellList.findIndex(item => item.wellCode === that.data.activeMarkerWellCode) + if(index !== -1) { + wellList[index].isInStall = '2' + that.initManholeData(wellList) + } + } + wx.request({ + method: "post", + url: app.globalData.httpsUrl + "appDeviceAdd/changeWellState", + data: { + wellCode: that.data.activeMarker.manholeInfo.wellCode, + isInStall: '2' + }, + header: { + 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' + }, + success(res) { + }, + fail(err) { + wx.showToast({ + title: "修改井打不开状态失败", + icon: 'none', + duration: 2000 + }) + } + }) + } else { //这里是点击了取消以后 + console.log('用户点击取消') + } + } + }) + }, // 点击标记点 onMarkerTap(e) { // ========================================================= @@ -257,7 +299,8 @@ markers[index].zIndex = 100; this.setData({ markers: markers, - activeMarkerId: markerId + activeMarkerId: markerId, + activeMarkerWellCode: markers[index].manholeInfo.wellCode }); } // ========================================================= diff --git a/miniprogram/pages/defineMap/defineMap.wxml b/miniprogram/pages/defineMap/defineMap.wxml index 0f227ad..c0fad34 100644 --- a/miniprogram/pages/defineMap/defineMap.wxml +++ b/miniprogram/pages/defineMap/defineMap.wxml @@ -35,6 +35,12 @@ + + +