qiyemore.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  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. }
  88. },
  89. getLocation() {
  90. let that = this
  91. wx.getLocation({
  92. type: 'wgs84', //返回可以用于wx.openLocation的经纬度
  93. success: function (res) {
  94. that.setData({
  95. form: {
  96. longitude: res.longitude,
  97. latitude: res.latitude
  98. }
  99. })
  100. },
  101. })
  102. },
  103. /**
  104. * 生命周期函数--监听页面加载
  105. */
  106. onLoad(options) {
  107. },
  108. /**
  109. * 生命周期函数--监听页面初次渲染完成
  110. */
  111. onReady() {
  112. },
  113. /**
  114. * 生命周期函数--监听页面显示
  115. */
  116. onShow() {
  117. },
  118. /**
  119. * 生命周期函数--监听页面隐藏
  120. */
  121. onHide() {
  122. },
  123. /**
  124. * 生命周期函数--监听页面卸载
  125. */
  126. onUnload() {
  127. },
  128. /**
  129. * 页面相关事件处理函数--监听用户下拉动作
  130. */
  131. onPullDownRefresh() {
  132. },
  133. /**
  134. * 页面上拉触底事件的处理函数
  135. */
  136. onReachBottom() {
  137. },
  138. /**
  139. * 用户点击右上角分享
  140. */
  141. onShareAppMessage() {
  142. }
  143. })