qiyemore.js 3.3 KB

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