qiyemore.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. // pages/qiyemore/qiyemore.js
  2. import http from '../../base/httputil'
  3. const app = getApp()
  4. Page({
  5. onLoad() {
  6. this.getLocation()
  7. },
  8. /**
  9. * 页面的初始数据
  10. */
  11. data: {
  12. host: app.globalData.host,
  13. longitude: Number,
  14. form: {
  15. longitude: Number,
  16. latitude: Number,
  17. businessName: null,
  18. orgCode: null,
  19. officeAddress: null,
  20. businessAddress: null,
  21. supervisor: null,
  22. tradeDept: null,
  23. deptId: null,
  24. mainPerson: null,
  25. mainPersonPhone: null,
  26. headSecurity: null,
  27. headSecurityPhone: null
  28. }
  29. },
  30. //-------------------------------表单数据绑定方法---------------------------------------
  31. get_businessName(e) {
  32. this.data.form.businessName = e.detail.value
  33. },
  34. get_orgCode(e) {
  35. this.data.form.orgCode = e.detail.value
  36. },
  37. get_officeAddress(e) {
  38. this.data.form.officeAddress = e.detail.value
  39. },
  40. get_businessAddress(e) {
  41. this.data.form.businessAddress = e.detail.value
  42. },
  43. get_supervisor(e) {
  44. this.data.form.supervisor = e.detail.value
  45. },
  46. get_tradeDept(e) {
  47. this.data.form.tradeDept = e.detail.value
  48. },
  49. get_mainPerson(e) {
  50. this.data.form.mainPerson = e.detail.value
  51. },
  52. get_mainPersonPhone(e) {
  53. this.data.form.mainPersonPhone = e.detail.value
  54. },
  55. get_headSecurity(e) {
  56. this.data.form.headSecurity = e.detail.value
  57. },
  58. headSecurityPhone(e) {
  59. this.data.form.headSecurityPhone = e.detail.value
  60. },
  61. //----------------------------------------------------------------------------
  62. addEnterprise(e) {
  63. let obj = new Object()
  64. obj.latitude = this.data.form.latitude
  65. obj.longitude = this.data.form.longitude
  66. obj.businessName = this.data.form.businessName
  67. obj.orgCode = this.data.form.orgCode
  68. obj.officeAddress = this.data.form.officeAddress
  69. obj.businessAddress = this.data.form.businessAddress
  70. obj.supervisor = this.data.form.supervisor
  71. obj.tradeDept = this.data.form.tradeDept
  72. obj.mainPerson = this.data.form.mainPerson
  73. obj.mainPersonPhone = this.data.form.mainPersonPhone
  74. obj.headSecurity = this.data.form.headSecurity
  75. obj.headSecurityPhone = this.data.form.headSecurityPhone
  76. http.post("/system/AppEnterpriseController/addEnterprise", obj, this.addEnterpriseSuccess)
  77. },
  78. addEnterpriseSuccess(e) {
  79. wx.showToast({
  80. title: e.msg,
  81. icon: "none"
  82. })
  83. if(e.code == 200){
  84. // wx.navigateTo({
  85. // url: '../qiye/qiye',
  86. // })
  87. wx.navigateBack()
  88. }
  89. },
  90. getLocation() {
  91. let that = this
  92. wx.getLocation({
  93. type: 'wgs84', //返回可以用于wx.openLocation的经纬度
  94. success: function (res) {
  95. that.setData({
  96. form: {
  97. longitude: res.longitude,
  98. latitude: res.latitude
  99. }
  100. })
  101. },
  102. })
  103. },
  104. /**
  105. * 生命周期函数--监听页面加载
  106. */
  107. onLoad(options) {
  108. },
  109. /**
  110. * 生命周期函数--监听页面初次渲染完成
  111. */
  112. onReady() {
  113. },
  114. /**
  115. * 生命周期函数--监听页面显示
  116. */
  117. onShow() {
  118. },
  119. /**
  120. * 生命周期函数--监听页面隐藏
  121. */
  122. onHide() {
  123. },
  124. /**
  125. * 生命周期函数--监听页面卸载
  126. */
  127. onUnload() {
  128. },
  129. /**
  130. * 页面相关事件处理函数--监听用户下拉动作
  131. */
  132. onPullDownRefresh() {
  133. },
  134. /**
  135. * 页面上拉触底事件的处理函数
  136. */
  137. onReachBottom() {
  138. },
  139. /**
  140. * 用户点击右上角分享
  141. */
  142. onShareAppMessage() {
  143. }
  144. })