|
@@ -0,0 +1,152 @@
|
|
|
+import http from '../../base/httputil'
|
|
|
+const app = getApp()
|
|
|
+Page({
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面的初始数据
|
|
|
+ */
|
|
|
+ data: {
|
|
|
+ host: app.globalData.host,
|
|
|
+ enterpriseId: null,
|
|
|
+ details: {
|
|
|
+ id: null,
|
|
|
+ longitude: Number,
|
|
|
+ latitude: Number,
|
|
|
+ name: null,
|
|
|
+ code: null,
|
|
|
+ address: null,
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面加载
|
|
|
+ */
|
|
|
+ onLoad(options) {
|
|
|
+ this.enterpriseId = options.id
|
|
|
+ // this.getDetails()
|
|
|
+ },
|
|
|
+
|
|
|
+ // getDetails() {
|
|
|
+ // let obj = new Object();
|
|
|
+ // obj.id = this.id
|
|
|
+ // http.post("/system/AppEnterpriseController/getEnterpriseDetails", obj, this.getEnterpriseDetailsSuccess)
|
|
|
+ // },
|
|
|
+ // getEnterpriseDetailsSuccess(res) {
|
|
|
+ // this.setData({
|
|
|
+ // enterpriseDetails: res.enterpriseDetails,
|
|
|
+ // })
|
|
|
+ // },
|
|
|
+ //-----------------------------------------
|
|
|
+ bindInputName(e) {
|
|
|
+ this.data.details.name = e.detail.value
|
|
|
+ },
|
|
|
+ bindInputAddress(e) {
|
|
|
+ this.data.details.address = e.detail.value
|
|
|
+ },
|
|
|
+ bindInputCode(e) {
|
|
|
+ this.data.details.code = e.detail.value
|
|
|
+ },
|
|
|
+
|
|
|
+ //------------------------------------------
|
|
|
+
|
|
|
+ updateDetails() {
|
|
|
+ let obj = new Object();
|
|
|
+ obj.enterpriseId = this.data.details.enterpriseId
|
|
|
+ obj.name = this.data.details.name
|
|
|
+ obj.address = this.data.details.address
|
|
|
+ obj.code = this.data.details.code
|
|
|
+
|
|
|
+ // http.post("/system/AppEnterpriseController/updateEnterprise", obj, this.updateDetailsSuccess)
|
|
|
+ },
|
|
|
+ updateDetailsSuccess(res) {
|
|
|
+ wx.showToast({
|
|
|
+ title: res.msg,
|
|
|
+ })
|
|
|
+ if(res.code == 200){
|
|
|
+ wx.navigateBack()
|
|
|
+ // wx.navigateTo({
|
|
|
+ // url: '../details/details?busEnterpriseId=' + this.busEnterpriseId,
|
|
|
+ // })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ deletePatrolPoint() {
|
|
|
+ // let obj = new Object();
|
|
|
+ // obj.busEnterpriseId = this.data.enterpriseDetails.busEnterpriseId
|
|
|
+ // http.post("/system/AppEnterpriseController/deleteEnterprise", obj, this.deleteEnterpriseSuccess)
|
|
|
+ },
|
|
|
+ // deleteEnterpriseSuccess(res) {
|
|
|
+ // wx.showToast({
|
|
|
+ // title: res.msg,
|
|
|
+ // })
|
|
|
+ // if(res.code == 200){
|
|
|
+ // wx.navigateTo({
|
|
|
+ // url: '../qiye/qiye'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面初次渲染完成
|
|
|
+ */
|
|
|
+ onReady() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面显示
|
|
|
+ */
|
|
|
+ onShow() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面隐藏
|
|
|
+ */
|
|
|
+ onHide() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 生命周期函数--监听页面卸载
|
|
|
+ */
|
|
|
+ onUnload() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面相关事件处理函数--监听用户下拉动作
|
|
|
+ */
|
|
|
+ onPullDownRefresh() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 页面上拉触底事件的处理函数
|
|
|
+ */
|
|
|
+ onReachBottom() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户点击右上角分享
|
|
|
+ */
|
|
|
+ onShareAppMessage() {
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
+ getLocation() {
|
|
|
+ let that = this
|
|
|
+ wx.getLocation({
|
|
|
+ type: 'wgs84', //返回可以用于wx.openLocation的经纬度
|
|
|
+ success: function (res) {
|
|
|
+ that.setData({
|
|
|
+ details: {
|
|
|
+ longitude: res.longitude,
|
|
|
+ latitude: res.latitude
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ })
|
|
|
+ },
|
|
|
+})
|