diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.js b/miniprogram/pages/notice/notice.js index 7aeafb9..2db206c 100644 --- a/miniprogram/pages/notice/notice.js +++ b/miniprogram/pages/notice/notice.js @@ -6,7 +6,10 @@ */ data: { time: 15 * 1000, - showTime: false + showTime: false, + popupShow: true, // 签名弹窗 + imageList: [], + buttonName: '开始签署' }, /** @@ -27,7 +30,18 @@ * 生命周期函数--监听页面显示 */ onShow: function () { - + let imgUrl = wx.getStorageSync('signImage') + if(imgUrl) { + this.data.imageList[0] = imgUrl; + this.setData({ + imageList: this.data.imageList, + buttonName: '重新签署' + }); + } else { + this.setData({ + buttonName: '开始签署' + }); + } }, /** @@ -58,23 +72,59 @@ this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + this.setData({ + popupShow: true }) }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, +// 倒计时结束 finished() { this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + // wx.switchTab({ + // url: '../indexapp/indexapp' + // }) + }, + // 预览图片 + previewBigImage(e) { + let imgs = this.data.imageList; + let {index} = e.currentTarget.dataset; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs }) - } + }, + // 点击开始签署 + startSign() { + wx.navigateTo({ + url: '../signName/signName', + }) + }, + // 点击确认 + confirm() { + if(this.data.imageList.length) { + wx.switchTab({ + url: '../indexapp/indexapp' + }) + } else { + wx.showToast({ + icon: 'error', + title: '请签名', + }) + } + }, + // 点击遮罩层 + closePopup() { + this.setData({ + popupShow: false + }) + }, + // 点击安全生产责任书图片 + clickImage() { + this.setData({ + popupShow: true + }) + } }) \ No newline at end of file diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.js b/miniprogram/pages/notice/notice.js index 7aeafb9..2db206c 100644 --- a/miniprogram/pages/notice/notice.js +++ b/miniprogram/pages/notice/notice.js @@ -6,7 +6,10 @@ */ data: { time: 15 * 1000, - showTime: false + showTime: false, + popupShow: true, // 签名弹窗 + imageList: [], + buttonName: '开始签署' }, /** @@ -27,7 +30,18 @@ * 生命周期函数--监听页面显示 */ onShow: function () { - + let imgUrl = wx.getStorageSync('signImage') + if(imgUrl) { + this.data.imageList[0] = imgUrl; + this.setData({ + imageList: this.data.imageList, + buttonName: '重新签署' + }); + } else { + this.setData({ + buttonName: '开始签署' + }); + } }, /** @@ -58,23 +72,59 @@ this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + this.setData({ + popupShow: true }) }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, +// 倒计时结束 finished() { this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + // wx.switchTab({ + // url: '../indexapp/indexapp' + // }) + }, + // 预览图片 + previewBigImage(e) { + let imgs = this.data.imageList; + let {index} = e.currentTarget.dataset; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs }) - } + }, + // 点击开始签署 + startSign() { + wx.navigateTo({ + url: '../signName/signName', + }) + }, + // 点击确认 + confirm() { + if(this.data.imageList.length) { + wx.switchTab({ + url: '../indexapp/indexapp' + }) + } else { + wx.showToast({ + icon: 'error', + title: '请签名', + }) + } + }, + // 点击遮罩层 + closePopup() { + this.setData({ + popupShow: false + }) + }, + // 点击安全生产责任书图片 + clickImage() { + this.setData({ + popupShow: true + }) + } }) \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.json b/miniprogram/pages/notice/notice.json index 4c73264..8e66903 100644 --- a/miniprogram/pages/notice/notice.json +++ b/miniprogram/pages/notice/notice.json @@ -1,5 +1,7 @@ { "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down" + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-popup": "@vant/weapp/popup/index", + "van-button": "../../miniprogram_npm/@vant/weapp/button" } } \ No newline at end of file diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.js b/miniprogram/pages/notice/notice.js index 7aeafb9..2db206c 100644 --- a/miniprogram/pages/notice/notice.js +++ b/miniprogram/pages/notice/notice.js @@ -6,7 +6,10 @@ */ data: { time: 15 * 1000, - showTime: false + showTime: false, + popupShow: true, // 签名弹窗 + imageList: [], + buttonName: '开始签署' }, /** @@ -27,7 +30,18 @@ * 生命周期函数--监听页面显示 */ onShow: function () { - + let imgUrl = wx.getStorageSync('signImage') + if(imgUrl) { + this.data.imageList[0] = imgUrl; + this.setData({ + imageList: this.data.imageList, + buttonName: '重新签署' + }); + } else { + this.setData({ + buttonName: '开始签署' + }); + } }, /** @@ -58,23 +72,59 @@ this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + this.setData({ + popupShow: true }) }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, +// 倒计时结束 finished() { this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + // wx.switchTab({ + // url: '../indexapp/indexapp' + // }) + }, + // 预览图片 + previewBigImage(e) { + let imgs = this.data.imageList; + let {index} = e.currentTarget.dataset; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs }) - } + }, + // 点击开始签署 + startSign() { + wx.navigateTo({ + url: '../signName/signName', + }) + }, + // 点击确认 + confirm() { + if(this.data.imageList.length) { + wx.switchTab({ + url: '../indexapp/indexapp' + }) + } else { + wx.showToast({ + icon: 'error', + title: '请签名', + }) + } + }, + // 点击遮罩层 + closePopup() { + this.setData({ + popupShow: false + }) + }, + // 点击安全生产责任书图片 + clickImage() { + this.setData({ + popupShow: true + }) + } }) \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.json b/miniprogram/pages/notice/notice.json index 4c73264..8e66903 100644 --- a/miniprogram/pages/notice/notice.json +++ b/miniprogram/pages/notice/notice.json @@ -1,5 +1,7 @@ { "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down" + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-popup": "@vant/weapp/popup/index", + "van-button": "../../miniprogram_npm/@vant/weapp/button" } } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.wxml b/miniprogram/pages/notice/notice.wxml index 975304a..e306df6 100644 --- a/miniprogram/pages/notice/notice.wxml +++ b/miniprogram/pages/notice/notice.wxml @@ -1,10 +1,33 @@ - - - + + + - + + + 请阅读并同意《安全生产责任书》协议,并签署真实姓名。 + + + + + + + + {{buttonName}} + + + 确认 + + + diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.js b/miniprogram/pages/notice/notice.js index 7aeafb9..2db206c 100644 --- a/miniprogram/pages/notice/notice.js +++ b/miniprogram/pages/notice/notice.js @@ -6,7 +6,10 @@ */ data: { time: 15 * 1000, - showTime: false + showTime: false, + popupShow: true, // 签名弹窗 + imageList: [], + buttonName: '开始签署' }, /** @@ -27,7 +30,18 @@ * 生命周期函数--监听页面显示 */ onShow: function () { - + let imgUrl = wx.getStorageSync('signImage') + if(imgUrl) { + this.data.imageList[0] = imgUrl; + this.setData({ + imageList: this.data.imageList, + buttonName: '重新签署' + }); + } else { + this.setData({ + buttonName: '开始签署' + }); + } }, /** @@ -58,23 +72,59 @@ this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + this.setData({ + popupShow: true }) }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, +// 倒计时结束 finished() { this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + // wx.switchTab({ + // url: '../indexapp/indexapp' + // }) + }, + // 预览图片 + previewBigImage(e) { + let imgs = this.data.imageList; + let {index} = e.currentTarget.dataset; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs }) - } + }, + // 点击开始签署 + startSign() { + wx.navigateTo({ + url: '../signName/signName', + }) + }, + // 点击确认 + confirm() { + if(this.data.imageList.length) { + wx.switchTab({ + url: '../indexapp/indexapp' + }) + } else { + wx.showToast({ + icon: 'error', + title: '请签名', + }) + } + }, + // 点击遮罩层 + closePopup() { + this.setData({ + popupShow: false + }) + }, + // 点击安全生产责任书图片 + clickImage() { + this.setData({ + popupShow: true + }) + } }) \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.json b/miniprogram/pages/notice/notice.json index 4c73264..8e66903 100644 --- a/miniprogram/pages/notice/notice.json +++ b/miniprogram/pages/notice/notice.json @@ -1,5 +1,7 @@ { "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down" + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-popup": "@vant/weapp/popup/index", + "van-button": "../../miniprogram_npm/@vant/weapp/button" } } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.wxml b/miniprogram/pages/notice/notice.wxml index 975304a..e306df6 100644 --- a/miniprogram/pages/notice/notice.wxml +++ b/miniprogram/pages/notice/notice.wxml @@ -1,10 +1,33 @@ - - - + + + - + + + 请阅读并同意《安全生产责任书》协议,并签署真实姓名。 + + + + + + + + {{buttonName}} + + + 确认 + + + diff --git a/miniprogram/pages/notice/notice.wxss b/miniprogram/pages/notice/notice.wxss index 36d7542..36ef9bd 100644 --- a/miniprogram/pages/notice/notice.wxss +++ b/miniprogram/pages/notice/notice.wxss @@ -15,4 +15,35 @@ color: #FFCF00; width: 750rpx; z-index:9999; - } \ No newline at end of file + } + +.popup-title { + padding: 20rpx; + font-size: 28rpx; + color: #4a4a4a; +} +.popup-blue { + color: #3e79f2; +} +.area { + padding: 0 20rpx; +} +.name-area { + position: relative; + width: 100%; + height: 400rpx; + display: flex; + justify-content: center; + box-sizing: border-box; + margin-bottom: 30rpx; + border: 1rpx solid #ccc; +} +.img-area { + width: 100%; + height: 400rpx; + overflow-y: auto; +} +.area-login_image { + width: 100%; + height: 95%; +} \ No newline at end of file diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.js b/miniprogram/pages/notice/notice.js index 7aeafb9..2db206c 100644 --- a/miniprogram/pages/notice/notice.js +++ b/miniprogram/pages/notice/notice.js @@ -6,7 +6,10 @@ */ data: { time: 15 * 1000, - showTime: false + showTime: false, + popupShow: true, // 签名弹窗 + imageList: [], + buttonName: '开始签署' }, /** @@ -27,7 +30,18 @@ * 生命周期函数--监听页面显示 */ onShow: function () { - + let imgUrl = wx.getStorageSync('signImage') + if(imgUrl) { + this.data.imageList[0] = imgUrl; + this.setData({ + imageList: this.data.imageList, + buttonName: '重新签署' + }); + } else { + this.setData({ + buttonName: '开始签署' + }); + } }, /** @@ -58,23 +72,59 @@ this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + this.setData({ + popupShow: true }) }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, +// 倒计时结束 finished() { this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + // wx.switchTab({ + // url: '../indexapp/indexapp' + // }) + }, + // 预览图片 + previewBigImage(e) { + let imgs = this.data.imageList; + let {index} = e.currentTarget.dataset; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs }) - } + }, + // 点击开始签署 + startSign() { + wx.navigateTo({ + url: '../signName/signName', + }) + }, + // 点击确认 + confirm() { + if(this.data.imageList.length) { + wx.switchTab({ + url: '../indexapp/indexapp' + }) + } else { + wx.showToast({ + icon: 'error', + title: '请签名', + }) + } + }, + // 点击遮罩层 + closePopup() { + this.setData({ + popupShow: false + }) + }, + // 点击安全生产责任书图片 + clickImage() { + this.setData({ + popupShow: true + }) + } }) \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.json b/miniprogram/pages/notice/notice.json index 4c73264..8e66903 100644 --- a/miniprogram/pages/notice/notice.json +++ b/miniprogram/pages/notice/notice.json @@ -1,5 +1,7 @@ { "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down" + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-popup": "@vant/weapp/popup/index", + "van-button": "../../miniprogram_npm/@vant/weapp/button" } } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.wxml b/miniprogram/pages/notice/notice.wxml index 975304a..e306df6 100644 --- a/miniprogram/pages/notice/notice.wxml +++ b/miniprogram/pages/notice/notice.wxml @@ -1,10 +1,33 @@ - - - + + + - + + + 请阅读并同意《安全生产责任书》协议,并签署真实姓名。 + + + + + + + + {{buttonName}} + + + 确认 + + + diff --git a/miniprogram/pages/notice/notice.wxss b/miniprogram/pages/notice/notice.wxss index 36d7542..36ef9bd 100644 --- a/miniprogram/pages/notice/notice.wxss +++ b/miniprogram/pages/notice/notice.wxss @@ -15,4 +15,35 @@ color: #FFCF00; width: 750rpx; z-index:9999; - } \ No newline at end of file + } + +.popup-title { + padding: 20rpx; + font-size: 28rpx; + color: #4a4a4a; +} +.popup-blue { + color: #3e79f2; +} +.area { + padding: 0 20rpx; +} +.name-area { + position: relative; + width: 100%; + height: 400rpx; + display: flex; + justify-content: center; + box-sizing: border-box; + margin-bottom: 30rpx; + border: 1rpx solid #ccc; +} +.img-area { + width: 100%; + height: 400rpx; + overflow-y: auto; +} +.area-login_image { + width: 100%; + height: 95%; +} \ No newline at end of file diff --git a/miniprogram/pages/validNameKeyword/validNameKeyword.js b/miniprogram/pages/validNameKeyword/validNameKeyword.js index e56fef9..38d3a02 100644 --- a/miniprogram/pages/validNameKeyword/validNameKeyword.js +++ b/miniprogram/pages/validNameKeyword/validNameKeyword.js @@ -135,6 +135,5 @@ }) } }) - } }) \ No newline at end of file diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.js b/miniprogram/pages/notice/notice.js index 7aeafb9..2db206c 100644 --- a/miniprogram/pages/notice/notice.js +++ b/miniprogram/pages/notice/notice.js @@ -6,7 +6,10 @@ */ data: { time: 15 * 1000, - showTime: false + showTime: false, + popupShow: true, // 签名弹窗 + imageList: [], + buttonName: '开始签署' }, /** @@ -27,7 +30,18 @@ * 生命周期函数--监听页面显示 */ onShow: function () { - + let imgUrl = wx.getStorageSync('signImage') + if(imgUrl) { + this.data.imageList[0] = imgUrl; + this.setData({ + imageList: this.data.imageList, + buttonName: '重新签署' + }); + } else { + this.setData({ + buttonName: '开始签署' + }); + } }, /** @@ -58,23 +72,59 @@ this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + this.setData({ + popupShow: true }) }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, +// 倒计时结束 finished() { this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + // wx.switchTab({ + // url: '../indexapp/indexapp' + // }) + }, + // 预览图片 + previewBigImage(e) { + let imgs = this.data.imageList; + let {index} = e.currentTarget.dataset; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs }) - } + }, + // 点击开始签署 + startSign() { + wx.navigateTo({ + url: '../signName/signName', + }) + }, + // 点击确认 + confirm() { + if(this.data.imageList.length) { + wx.switchTab({ + url: '../indexapp/indexapp' + }) + } else { + wx.showToast({ + icon: 'error', + title: '请签名', + }) + } + }, + // 点击遮罩层 + closePopup() { + this.setData({ + popupShow: false + }) + }, + // 点击安全生产责任书图片 + clickImage() { + this.setData({ + popupShow: true + }) + } }) \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.json b/miniprogram/pages/notice/notice.json index 4c73264..8e66903 100644 --- a/miniprogram/pages/notice/notice.json +++ b/miniprogram/pages/notice/notice.json @@ -1,5 +1,7 @@ { "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down" + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-popup": "@vant/weapp/popup/index", + "van-button": "../../miniprogram_npm/@vant/weapp/button" } } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.wxml b/miniprogram/pages/notice/notice.wxml index 975304a..e306df6 100644 --- a/miniprogram/pages/notice/notice.wxml +++ b/miniprogram/pages/notice/notice.wxml @@ -1,10 +1,33 @@ - - - + + + - + + + 请阅读并同意《安全生产责任书》协议,并签署真实姓名。 + + + + + + + + {{buttonName}} + + + 确认 + + + diff --git a/miniprogram/pages/notice/notice.wxss b/miniprogram/pages/notice/notice.wxss index 36d7542..36ef9bd 100644 --- a/miniprogram/pages/notice/notice.wxss +++ b/miniprogram/pages/notice/notice.wxss @@ -15,4 +15,35 @@ color: #FFCF00; width: 750rpx; z-index:9999; - } \ No newline at end of file + } + +.popup-title { + padding: 20rpx; + font-size: 28rpx; + color: #4a4a4a; +} +.popup-blue { + color: #3e79f2; +} +.area { + padding: 0 20rpx; +} +.name-area { + position: relative; + width: 100%; + height: 400rpx; + display: flex; + justify-content: center; + box-sizing: border-box; + margin-bottom: 30rpx; + border: 1rpx solid #ccc; +} +.img-area { + width: 100%; + height: 400rpx; + overflow-y: auto; +} +.area-login_image { + width: 100%; + height: 95%; +} \ No newline at end of file diff --git a/miniprogram/pages/validNameKeyword/validNameKeyword.js b/miniprogram/pages/validNameKeyword/validNameKeyword.js index e56fef9..38d3a02 100644 --- a/miniprogram/pages/validNameKeyword/validNameKeyword.js +++ b/miniprogram/pages/validNameKeyword/validNameKeyword.js @@ -135,6 +135,5 @@ }) } }) - } }) \ No newline at end of file diff --git a/miniprogram/project.private.config.json b/miniprogram/project.private.config.json index 1cd8aa6..4593b53 100644 --- a/miniprogram/project.private.config.json +++ b/miniprogram/project.private.config.json @@ -1,8 +1,8 @@ { "projectname": "miniprogram", "setting": { - "compileHotReLoad": true, - "urlCheck": true + "compileHotReLoad": false, + "urlCheck": false }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "condition": { @@ -38,7 +38,14 @@ }, { "name": "", - "pathName": "pages/login/login", + "pathName": "pages/notice/notice", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/signName/signName", "query": "", "launchMode": "default", "scene": null diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.js b/miniprogram/pages/notice/notice.js index 7aeafb9..2db206c 100644 --- a/miniprogram/pages/notice/notice.js +++ b/miniprogram/pages/notice/notice.js @@ -6,7 +6,10 @@ */ data: { time: 15 * 1000, - showTime: false + showTime: false, + popupShow: true, // 签名弹窗 + imageList: [], + buttonName: '开始签署' }, /** @@ -27,7 +30,18 @@ * 生命周期函数--监听页面显示 */ onShow: function () { - + let imgUrl = wx.getStorageSync('signImage') + if(imgUrl) { + this.data.imageList[0] = imgUrl; + this.setData({ + imageList: this.data.imageList, + buttonName: '重新签署' + }); + } else { + this.setData({ + buttonName: '开始签署' + }); + } }, /** @@ -58,23 +72,59 @@ this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + this.setData({ + popupShow: true }) }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, +// 倒计时结束 finished() { this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + // wx.switchTab({ + // url: '../indexapp/indexapp' + // }) + }, + // 预览图片 + previewBigImage(e) { + let imgs = this.data.imageList; + let {index} = e.currentTarget.dataset; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs }) - } + }, + // 点击开始签署 + startSign() { + wx.navigateTo({ + url: '../signName/signName', + }) + }, + // 点击确认 + confirm() { + if(this.data.imageList.length) { + wx.switchTab({ + url: '../indexapp/indexapp' + }) + } else { + wx.showToast({ + icon: 'error', + title: '请签名', + }) + } + }, + // 点击遮罩层 + closePopup() { + this.setData({ + popupShow: false + }) + }, + // 点击安全生产责任书图片 + clickImage() { + this.setData({ + popupShow: true + }) + } }) \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.json b/miniprogram/pages/notice/notice.json index 4c73264..8e66903 100644 --- a/miniprogram/pages/notice/notice.json +++ b/miniprogram/pages/notice/notice.json @@ -1,5 +1,7 @@ { "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down" + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-popup": "@vant/weapp/popup/index", + "van-button": "../../miniprogram_npm/@vant/weapp/button" } } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.wxml b/miniprogram/pages/notice/notice.wxml index 975304a..e306df6 100644 --- a/miniprogram/pages/notice/notice.wxml +++ b/miniprogram/pages/notice/notice.wxml @@ -1,10 +1,33 @@ - - - + + + - + + + 请阅读并同意《安全生产责任书》协议,并签署真实姓名。 + + + + + + + + {{buttonName}} + + + 确认 + + + diff --git a/miniprogram/pages/notice/notice.wxss b/miniprogram/pages/notice/notice.wxss index 36d7542..36ef9bd 100644 --- a/miniprogram/pages/notice/notice.wxss +++ b/miniprogram/pages/notice/notice.wxss @@ -15,4 +15,35 @@ color: #FFCF00; width: 750rpx; z-index:9999; - } \ No newline at end of file + } + +.popup-title { + padding: 20rpx; + font-size: 28rpx; + color: #4a4a4a; +} +.popup-blue { + color: #3e79f2; +} +.area { + padding: 0 20rpx; +} +.name-area { + position: relative; + width: 100%; + height: 400rpx; + display: flex; + justify-content: center; + box-sizing: border-box; + margin-bottom: 30rpx; + border: 1rpx solid #ccc; +} +.img-area { + width: 100%; + height: 400rpx; + overflow-y: auto; +} +.area-login_image { + width: 100%; + height: 95%; +} \ No newline at end of file diff --git a/miniprogram/pages/validNameKeyword/validNameKeyword.js b/miniprogram/pages/validNameKeyword/validNameKeyword.js index e56fef9..38d3a02 100644 --- a/miniprogram/pages/validNameKeyword/validNameKeyword.js +++ b/miniprogram/pages/validNameKeyword/validNameKeyword.js @@ -135,6 +135,5 @@ }) } }) - } }) \ No newline at end of file diff --git a/miniprogram/project.private.config.json b/miniprogram/project.private.config.json index 1cd8aa6..4593b53 100644 --- a/miniprogram/project.private.config.json +++ b/miniprogram/project.private.config.json @@ -1,8 +1,8 @@ { "projectname": "miniprogram", "setting": { - "compileHotReLoad": true, - "urlCheck": true + "compileHotReLoad": false, + "urlCheck": false }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "condition": { @@ -38,7 +38,14 @@ }, { "name": "", - "pathName": "pages/login/login", + "pathName": "pages/notice/notice", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/signName/signName", "query": "", "launchMode": "default", "scene": null diff --git a/project.config.json b/project.config.json index c3a97f8..9eab201 100644 --- a/project.config.json +++ b/project.config.json @@ -25,7 +25,7 @@ "useCompilerModule": false, "userConfirmedUseCompilerModuleSwitch": false }, - "appid": "wx2cef527a000f87c9", + "appid": "wx8f4b331065a9ac2e", "projectname": "constructionApp", "libVersion": "2.8.1", "simulatorType": "wechat", diff --git a/miniprogram/pages/addDevicelog/addDeviceLog.js b/miniprogram/pages/addDevicelog/addDeviceLog.js index a0dc6da..d5bef6e 100644 --- a/miniprogram/pages/addDevicelog/addDeviceLog.js +++ b/miniprogram/pages/addDevicelog/addDeviceLog.js @@ -1,5 +1,6 @@ // miniprogram/pages/addDevice/addDevice.js - +var QQMapWX = require('../../libs/qqmap-wx-jssdk.js'); +var qqmapsdk; var app = getApp(); Page({ @@ -215,7 +216,7 @@ ['form.installperson']: app.globalData.userName, ['form.installtimeFmt']: "", ['form.workmsg']: "", - ['form.description']: "" + // ['form.description']: "" }) const { @@ -398,8 +399,7 @@ //获取与上次修改的信息 changeMsg: function () { var formNew = this.data.form; - console.log(this.data.detail) - var formOld = JSON.parse(this.data.detail); + var formOld = this.data.detail || JSON.parse(this.data.detail); var descpNew = ""; if (formNew.devcode != formOld.devcode) { descpNew += "修改设备编号,原值:" + formOld.devcode + ",新值:" + formNew.devcode + ";" @@ -461,7 +461,6 @@ //提交表单 formSubmit: function (event) { - //表单验证 if (!this.formValidate()) { return false; @@ -469,14 +468,14 @@ //自动生成修改内容 this.changeMsg(); //提交权限限制(只有施工人员能修改) - if(app.globalData.role!='repair'){ - wx.showToast({ - icon: 'none', - title: '无权限修改', - duration:2000 - }) - return false - } + // if(app.globalData.role!='repair'){ + // wx.showToast({ + // icon: 'none', + // title: '无权限修改', + // duration:2000 + // }) + // return false + // } var that = this; var fileList = that.data.fileList; for (var i = 0; i < fileList.length; i++) { @@ -530,13 +529,40 @@ //扫码 scan() { - + var _this = this wx.scanCode({ success(res) { console.log(res) + _this.setData({ + ['form.devcode']: res.result + }) } }) }, + showAddress :function(longitude, latitude, self) { + // 实例化腾讯地图API核心类 + qqmapsdk = new QQMapWX({ + key: 'BGPBZ-C5O3P-ROUDR-LWC4J-63EKH-V5FRX'//此处使用你自己申请的key + }) + // 腾讯地图调用接口 + qqmapsdk.reverseGeocoder({ + location: { + latitude: latitude, + longitude: longitude + }, + success: function (res) { + self.setData({ + 'form.area':res.result.address.slice(0,res.result.address.indexOf('区')+1), + 'form.street':res.result.address.slice(res.result.address.indexOf('区')+1) + }) + }, + fail: function (res) { + console.log(res); + }, + complete: function (res) { + } + }); + }, //粘贴经纬度 paste() { var _this = this; @@ -556,6 +582,7 @@ }); } }) + _this.showAddress(_this.data.form.longitude,_this.data.form.latitude,_this) }, selectValue(value) { var that = this; @@ -656,7 +683,11 @@ header: { 'content-type': 'application/x-www-form-urlencoded;charset=utf-8' }, - success(res) {} + success(res) { + that.setData({ + [`form.photopath${image_index + 1}`] : '' + }) + } }) } else { //这里是点击了取消以后 console.log('用户点击取消') diff --git a/miniprogram/pages/applog/applog.js b/miniprogram/pages/applog/applog.js index 189e61f..7076480 100644 --- a/miniprogram/pages/applog/applog.js +++ b/miniprogram/pages/applog/applog.js @@ -25,14 +25,15 @@ isSeach: "true" }) this.initPages() - }else{ - this.setData({ - show: false - }) - //清空参数,重新加载 - this.clearParams(); - this.initPages(); } + // else{ + // this.setData({ + // show: false + // }) + // //清空参数,重新加载 + // this.clearParams(); + // this.initPages(); + // } }, diff --git a/miniprogram/pages/earth/earth.js b/miniprogram/pages/earth/earth.js index 376a6e2..8bc3b3b 100644 --- a/miniprogram/pages/earth/earth.js +++ b/miniprogram/pages/earth/earth.js @@ -388,6 +388,9 @@ var that = this; if (that.data.devcodes == "") { + that.setData({ + markers:[] + }) return false; } wx.request({ @@ -405,9 +408,9 @@ that.setData({ listData: listResultData }) - var markersArr = that.data.markers; + var markersArr = [] for (var i = 0; i < listResultData.length; i++) { - markersArr = markersArr.concat({ + let arr = { iconPath: "../../images/locat.png", id: listResultData[i].id, callout: { @@ -426,7 +429,8 @@ longitude: listResultData[i].longitude, width: 40, height: 40 - }); + }; + markersArr.push(arr) } that.setData({ markers: markersArr, diff --git a/miniprogram/pages/index/index.js b/miniprogram/pages/index/index.js index 423e4a4..a160cc3 100644 --- a/miniprogram/pages/index/index.js +++ b/miniprogram/pages/index/index.js @@ -37,6 +37,8 @@ }, onGetUserInfo: function(e) { + console.log('----------') + console.log(e.detail.userInfo) if (!this.data.logged && e.detail.userInfo) { this.setData({ logged: true, diff --git a/miniprogram/pages/login/login.js b/miniprogram/pages/login/login.js index 019de2a..8df5de1 100644 --- a/miniprogram/pages/login/login.js +++ b/miniprogram/pages/login/login.js @@ -230,7 +230,6 @@ } }) }, - // 判断用户是否绑定 getIsBound(code) { var that = this diff --git a/miniprogram/pages/login/login.json b/miniprogram/pages/login/login.json index f2043a3..89884a9 100644 --- a/miniprogram/pages/login/login.json +++ b/miniprogram/pages/login/login.json @@ -1,8 +1,8 @@ { - "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", - "van-button": "../../miniprogram_npm/@vant/weapp/button" - }, - "navigationBarBackgroundColor": "#E6D480", - "disableScroll":true -} \ No newline at end of file + "usingComponents": { + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-button": "../../miniprogram_npm/@vant/weapp/button" + }, + "navigationBarBackgroundColor": "#E6D480", + "disableScroll":true + } \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index cf2ec72..94b53f8 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,7 +1,7 @@ - - - + + + @@ -36,11 +36,11 @@ --> - + - + \ No newline at end of file diff --git a/miniprogram/pages/login/login.wxss b/miniprogram/pages/login/login.wxss index b9fa569..813227a 100644 --- a/miniprogram/pages/login/login.wxss +++ b/miniprogram/pages/login/login.wxss @@ -1,93 +1,91 @@ /* miniprogram/pages/login/login.wxss */ - + .logo { - display: flex; - flex-direction: column; - align-items: center; -} - -.logo image { - margin-top: 140rpx; - width: 216rpx; - height: 200rpx; -} - -.form { - padding: 40rpx; -} - -.form .row-group { - padding: 20rpx 0; - position: relative; - border-bottom: 1rpx solid #ddd; -} - -.form .row-group text { - font-size: 28rpx; - padding: 10rpx 0; -} - -.form .row-group input { - padding: 10rpx 0; -} - -.form .row-group .txt { - color: #ccc; -} - -.form .row-group .code { - position: absolute; - right: 0; - bottom: 26rpx; - z-index: 2; - - width: 206rpx; - height: 60rpx; - border: 2rpx solid #FFB90F; - border-radius: 12rpx; - font-size: 26rpx; - font-weight: 400; - color: #080808; - display: flex; - align-items: center; - justify-content: center; -} - -.form .submit { - - /* margin-top: 80rpx; */ - color: #fff; - border: 2rpx solid #FFB90F; - background-color: #FFB90F; - font-size: 32rpx; - font-weight: bold; -} - -.login_image { - width: 750rpx; - height: 360rpx; - /* height: 2300rpx; */ - /* padding-top: 100rpx - padding-left: 250rpx; */ -} -.bottom_image { - width: 750rpx; - height: 32%; - position: fixed; - bottom: 0px; - /* padding-top: 100rpx - padding-left: 250rpx; */ -} - -.cover{ - position: fixed; - top: 0rpx; - margin-left: 290rpx; - text-align:center; - font-size: 50rpx; - color: #FFCF00; - width: 750rpx; - z-index:9999; - } - - \ No newline at end of file + display: flex; + flex-direction: column; + align-items: center; + } + + .logo image { + margin-top: 140rpx; + width: 216rpx; + height: 200rpx; + } + + .form { + padding: 40rpx; + } + + .form .row-group { + padding: 20rpx 0; + position: relative; + border-bottom: 1rpx solid #ddd; + } + + .form .row-group text { + font-size: 28rpx; + padding: 10rpx 0; + } + + .form .row-group input { + padding: 10rpx 0; + } + + .form .row-group .txt { + color: #ccc; + } + + .form .row-group .code { + position: absolute; + right: 0; + bottom: 26rpx; + z-index: 2; + + width: 206rpx; + height: 60rpx; + border: 2rpx solid #FFB90F; + border-radius: 12rpx; + font-size: 26rpx; + font-weight: 400; + color: #080808; + display: flex; + align-items: center; + justify-content: center; + } + + .form .submit { + + /* margin-top: 80rpx; */ + color: #fff; + border: 2rpx solid #FFB90F; + background-color: #FFB90F; + font-size: 32rpx; + font-weight: bold; + } + + .login_image { + width: 750rpx; + height: 360rpx; + /* height: 2300rpx; */ + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + .bottom_image { + width: 750rpx; + height: 32%; + position: fixed; + bottom: 0px; + /* padding-top: 100rpx + padding-left: 250rpx; */ + } + + .cover{ + position: fixed; + top: 0rpx; + margin-left: 290rpx; + text-align:center; + font-size: 50rpx; + color: #FFCF00; + width: 750rpx; + z-index:9999; + } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.js b/miniprogram/pages/notice/notice.js index 7aeafb9..2db206c 100644 --- a/miniprogram/pages/notice/notice.js +++ b/miniprogram/pages/notice/notice.js @@ -6,7 +6,10 @@ */ data: { time: 15 * 1000, - showTime: false + showTime: false, + popupShow: true, // 签名弹窗 + imageList: [], + buttonName: '开始签署' }, /** @@ -27,7 +30,18 @@ * 生命周期函数--监听页面显示 */ onShow: function () { - + let imgUrl = wx.getStorageSync('signImage') + if(imgUrl) { + this.data.imageList[0] = imgUrl; + this.setData({ + imageList: this.data.imageList, + buttonName: '重新签署' + }); + } else { + this.setData({ + buttonName: '开始签署' + }); + } }, /** @@ -58,23 +72,59 @@ this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + this.setData({ + popupShow: true }) }, - - /** - * 用户点击右上角分享 - */ - onShareAppMessage: function () { - - }, +// 倒计时结束 finished() { this.setData({ showTime: true }) - wx.switchTab({ - url: '../indexapp/indexapp' + // wx.switchTab({ + // url: '../indexapp/indexapp' + // }) + }, + // 预览图片 + previewBigImage(e) { + let imgs = this.data.imageList; + let {index} = e.currentTarget.dataset; + wx.previewImage({ + //当前显示图片 + current: imgs[index], + //所有图片 + urls: imgs }) - } + }, + // 点击开始签署 + startSign() { + wx.navigateTo({ + url: '../signName/signName', + }) + }, + // 点击确认 + confirm() { + if(this.data.imageList.length) { + wx.switchTab({ + url: '../indexapp/indexapp' + }) + } else { + wx.showToast({ + icon: 'error', + title: '请签名', + }) + } + }, + // 点击遮罩层 + closePopup() { + this.setData({ + popupShow: false + }) + }, + // 点击安全生产责任书图片 + clickImage() { + this.setData({ + popupShow: true + }) + } }) \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.json b/miniprogram/pages/notice/notice.json index 4c73264..8e66903 100644 --- a/miniprogram/pages/notice/notice.json +++ b/miniprogram/pages/notice/notice.json @@ -1,5 +1,7 @@ { "usingComponents": { - "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down" + "van-count-down": "../../miniprogram_npm/@vant/weapp/count-down", + "van-popup": "@vant/weapp/popup/index", + "van-button": "../../miniprogram_npm/@vant/weapp/button" } } \ No newline at end of file diff --git a/miniprogram/pages/notice/notice.wxml b/miniprogram/pages/notice/notice.wxml index 975304a..e306df6 100644 --- a/miniprogram/pages/notice/notice.wxml +++ b/miniprogram/pages/notice/notice.wxml @@ -1,10 +1,33 @@ - - - + + + - + + + 请阅读并同意《安全生产责任书》协议,并签署真实姓名。 + + + + + + + + {{buttonName}} + + + 确认 + + + diff --git a/miniprogram/pages/notice/notice.wxss b/miniprogram/pages/notice/notice.wxss index 36d7542..36ef9bd 100644 --- a/miniprogram/pages/notice/notice.wxss +++ b/miniprogram/pages/notice/notice.wxss @@ -15,4 +15,35 @@ color: #FFCF00; width: 750rpx; z-index:9999; - } \ No newline at end of file + } + +.popup-title { + padding: 20rpx; + font-size: 28rpx; + color: #4a4a4a; +} +.popup-blue { + color: #3e79f2; +} +.area { + padding: 0 20rpx; +} +.name-area { + position: relative; + width: 100%; + height: 400rpx; + display: flex; + justify-content: center; + box-sizing: border-box; + margin-bottom: 30rpx; + border: 1rpx solid #ccc; +} +.img-area { + width: 100%; + height: 400rpx; + overflow-y: auto; +} +.area-login_image { + width: 100%; + height: 95%; +} \ No newline at end of file diff --git a/miniprogram/pages/validNameKeyword/validNameKeyword.js b/miniprogram/pages/validNameKeyword/validNameKeyword.js index e56fef9..38d3a02 100644 --- a/miniprogram/pages/validNameKeyword/validNameKeyword.js +++ b/miniprogram/pages/validNameKeyword/validNameKeyword.js @@ -135,6 +135,5 @@ }) } }) - } }) \ No newline at end of file diff --git a/miniprogram/project.private.config.json b/miniprogram/project.private.config.json index 1cd8aa6..4593b53 100644 --- a/miniprogram/project.private.config.json +++ b/miniprogram/project.private.config.json @@ -1,8 +1,8 @@ { "projectname": "miniprogram", "setting": { - "compileHotReLoad": true, - "urlCheck": true + "compileHotReLoad": false, + "urlCheck": false }, "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "condition": { @@ -38,7 +38,14 @@ }, { "name": "", - "pathName": "pages/login/login", + "pathName": "pages/notice/notice", + "query": "", + "launchMode": "default", + "scene": null + }, + { + "name": "", + "pathName": "pages/signName/signName", "query": "", "launchMode": "default", "scene": null diff --git a/project.config.json b/project.config.json index c3a97f8..9eab201 100644 --- a/project.config.json +++ b/project.config.json @@ -25,7 +25,7 @@ "useCompilerModule": false, "userConfirmedUseCompilerModuleSwitch": false }, - "appid": "wx2cef527a000f87c9", + "appid": "wx8f4b331065a9ac2e", "projectname": "constructionApp", "libVersion": "2.8.1", "simulatorType": "wechat", diff --git a/project.private.config.json b/project.private.config.json index 251bbf7..aa1fd22 100644 --- a/project.private.config.json +++ b/project.private.config.json @@ -1,6 +1,6 @@ { "description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", - "projectname": "%E6%99%BA%E6%85%A7%E6%96%BD%E5%B7%A5", + "projectname": "%25E6%2599%25BA%25E6%2585%25A7%25E6%2596%25BD%25E5%25B7%25A5", "setting": { "compileHotReLoad": true },