detail.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241
  1. // pagesPublic/pages/tdcr/details/detail.js
  2. const { imgUrl } = require('../../api/request')
  3. Page({
  4. /**
  5. * 页面的初始数据
  6. */
  7. data: {
  8. imgPath: imgUrl + 'tdcr/',
  9. headerStyle: {},
  10. tabs: [{
  11. label: '概况',
  12. }, {
  13. label: '基本情况',
  14. }, {
  15. label: '周边配套',
  16. }, {
  17. label: '其他地块',
  18. }],
  19. tabActive: 0,
  20. dataIndex: 0,
  21. list: [{
  22. longitude: 106.596361,
  23. latitude: 29.579387,
  24. name: '中西医结合医院地块',
  25. img: 'zsyy.png',
  26. time: '2024年4月',
  27. description: '项目位于南岸区弹子石组团,南靠重庆卷烟厂,北邻弹子石新街,项目范围面积2.44公顷(36.6亩) 。项目周边以住宅小区为主,东北侧分布有弹子石、长嘉汇商业购物中心,其他主要以沿街生活配套性商业为主;周边2KM范围内分布有三所小学、四所中学、两处医院,公共配套设施较为完善。',
  28. area: 36.6,
  29. status: '已开始供地',
  30. contstructionArea: 5.58,
  31. use: '居民用地',
  32. progress: '在第五人民医院搬迁至新址后,计划将中西医结合医院搬迁至原第五人民医院院区,目前第五人民医院新址办公楼正在修建,中西医结合医院预计2024年8月进行搬迁。地块内涉及2处未定级文保单位(文幼章故居、老教会楼),私房约300户(住宅291户,非住宅9户),面积住宅17428平方米,非住宅2321平方米。',
  33. rate: 4,
  34. dutyUnit: '区土储中心',
  35. phoneNum: '12345',
  36. polygon: [
  37. {
  38. longitude: 106.594297,
  39. latitude: 29.578465
  40. },
  41. {
  42. longitude: 106.594452,
  43. latitude: 29.578218
  44. },
  45. {
  46. longitude: 106.595821,
  47. latitude: 29.577567
  48. },
  49. {
  50. longitude: 106.596113,
  51. latitude: 29.577515
  52. },
  53. {
  54. longitude: 106.596965,
  55. latitude: 29.578226
  56. },
  57. {
  58. longitude: 106.597249,
  59. latitude: 29.578383
  60. },
  61. {
  62. longitude: 106.597334,
  63. latitude: 29.578465
  64. },
  65. {
  66. longitude: 106.597334,
  67. latitude: 29.57869
  68. },
  69. {
  70. longitude: 106.597275,
  71. latitude: 29.578839
  72. },
  73. {
  74. longitude: 106.597375,
  75. latitude: 29.579041
  76. },
  77. {
  78. longitude: 106.597103,
  79. latitude: 29.579513
  80. },
  81. {
  82. longitude: 106.595184,
  83. latitude: 29.579925
  84. },
  85. {
  86. longitude: 106.594943,
  87. latitude: 29.57982
  88. }
  89. ],
  90. peripherytabs: [{
  91. label: '教育'
  92. }, {
  93. label: '商业'
  94. }],
  95. surroundingFacilities: [
  96. {
  97. id: 1, name: '重庆市第11中学', type: '教育',
  98. longitude: 106.599916, latitude: 29.582458
  99. }, {
  100. id: 2, name: '弹子石老街景区', type: '商业',
  101. longitude: 106.587890, latitude: 29.579806
  102. }, {
  103. id: 3, name: '泽科弹子石中心', type: '商业',
  104. longitude: 106.591454, latitude: 29.583796
  105. }
  106. ]
  107. }],
  108. peripherytabsindex:0,
  109. markers: [],
  110. centerPoint: {
  111. longitude: 106.596361,
  112. latitude: 29.579387,
  113. }
  114. },
  115. /**
  116. * 生命周期函数--监听页面加载
  117. */
  118. onLoad(options) {
  119. const _this = this
  120. let markers = []
  121. _this.data.list.forEach(item => {
  122. item.surroundingFacilities.forEach(map => {
  123. markers.push({
  124. id: map.id,
  125. latitude: map.latitude,
  126. longitude: map.longitude,
  127. callout: {
  128. content: map.name,
  129. fontSize: 11,
  130. padding: 5,
  131. borderRadius: 5,
  132. display: 'ALWAYS'
  133. },
  134. iconPath: imgUrl + '/location.png',
  135. width: 20,
  136. height: 25,
  137. })
  138. })
  139. })
  140. this.setData({
  141. headerStyle: wx.getMenuButtonBoundingClientRect(),
  142. dataIndex: options.index,
  143. markers,
  144. polygons: [{
  145. dashArray: [10, 10],
  146. strokeColor: '#ffe20063',
  147. fillColor: '#ffe20063',
  148. points: _this.data.list[options.index].polygon
  149. }],
  150. centerPoint: {
  151. longitude: _this.data.list[options.index].longitude,
  152. latitude: _this.data.list[options.index].latitude,
  153. }
  154. })
  155. },
  156. /**
  157. * 生命周期函数--监听页面初次渲染完成
  158. */
  159. onReady() {
  160. },
  161. /**
  162. * 生命周期函数--监听页面显示
  163. */
  164. onShow() {
  165. },
  166. /**
  167. * 生命周期函数--监听页面隐藏
  168. */
  169. onHide() {
  170. },
  171. /**
  172. * 生命周期函数--监听页面卸载
  173. */
  174. onUnload() {
  175. },
  176. /**
  177. * 页面相关事件处理函数--监听用户下拉动作
  178. */
  179. onPullDownRefresh() {
  180. },
  181. /**
  182. * 页面上拉触底事件的处理函数
  183. */
  184. onReachBottom() {
  185. },
  186. /**
  187. * 用户点击右上角分享
  188. */
  189. onShareAppMessage() {
  190. return {
  191. title: this.data.list[this.data.dataIndex].name,
  192. imageUrl: imgUrl + '/tdcr/share.jpg'
  193. }
  194. },
  195. tabEvent(e) {
  196. this.setData({
  197. tabActive: e.target.dataset.index,
  198. })
  199. },
  200. peripherytabEvent(e){
  201. this.setData({
  202. peripherytabsindex: e.target.dataset.index,
  203. })
  204. },
  205. goBack() {
  206. wx.navigateBack()
  207. },
  208. callPhone() {
  209. const _this = this
  210. wx.makePhoneCall({
  211. phoneNumber: _this.data.list[_this.data.dataIndex].phoneNum,
  212. fail: (e) => {
  213. console.log(e);
  214. }
  215. })
  216. },
  217. mapMarkerEvent(e) {
  218. const map = this.data.list[this.data.dataIndex].surroundingFacilities.filter(item => item.id == e.target.dataset.id)
  219. this.setData({
  220. centerPoint: {
  221. longitude: map[0].longitude,
  222. latitude: map[0].latitude,
  223. }
  224. })
  225. }
  226. })