租房小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

153 lines
4.7 KiB

6 months ago
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_api = require("../../common/api.js");
  4. const common_assets = require("../../common/assets.js");
  5. const citySelect = () => "../../components/cityselect/index.js";
  6. const lineBg = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABoAAAANCAYAAAC3mX7tAAAAAXNSR0IArs4c6QAAAbxJREFUOE+lk0FrE1EUhc+ZDOhMigjZdNcWdCPJqNCdlkZw4TKL2mVwkKLQ/gAFRcEu/AEKuumDrEopNEsXSlNoV+2iTYIbBdNdNwGpmRmFyVx5oQk6mYSpvt1799z7zTnvDQPlBAJcRGxZOLXotn7Gz8ftZePaROCZP+IaEh36a04LxFS8mMmgcKFcb54H9Kvi5LtdNIZ6BMf0lVMDMD88UJ7abuP1eUDeWuEZyVcJPZ/oKeclgRcJxRMrG17l4udOGthZbF8ATMb1IvKcXiU/y66xnziM2LQf1O+nAfnq+hYgpSStCeMmdcFXzi6AWyMGrlvZcGmUs54T31QQLIzo37Pd+u0eKFD5osDYHvPlJyLyNopYnbgUtrSuc2pOG4aUSC4nxTWYFXHOfni02wPp5anCO4KP0sSUViOQ91m38VjrByDZLprBt/ZHkAkvMO3oP3QiO9ZM7i7v1MK/QHoj6sblQLrV/4ZpCDMluoff++iBo/6Bdua32m/+NUYdlz2dW+k7GQnqF84eyOqY1xjPcw8Rn+iLTwp6yFFcpP8zhLxHsgjBFRrI9WKO0AbxVURqMOVDttw8GHeTvwFKoZ4cmcUYJAAAAABJRU5ErkJggg==";
  7. const _sfc_main = {
  8. components: {
  9. citySelect
  10. },
  11. data() {
  12. return {
  13. city: "长沙市",
  14. keyword: "",
  15. lineBg,
  16. nav: [
  17. {
  18. img: "../../static/image/nav1.png",
  19. name: "闲置散居农房"
  20. },
  21. {
  22. img: "../../static/image/nav2.png",
  23. name: "集体建设用地"
  24. },
  25. {
  26. img: "../../static/image/nav3.png",
  27. name: "鱼塘"
  28. },
  29. {
  30. img: "../../static/image/nav4.png",
  31. name: "林地"
  32. },
  33. {
  34. img: "../../static/image/nav5.png",
  35. name: "经营性建设用地"
  36. },
  37. {
  38. img: "../../static/image/nav6.png",
  39. name: "耕地"
  40. },
  41. {
  42. img: "../../static/image/nav7.png",
  43. name: "出租房"
  44. },
  45. {
  46. img: "../../static/image/nav8.png",
  47. name: "二手房"
  48. }
  49. ],
  50. list: [
  51. {
  52. name: "近期热销"
  53. },
  54. {
  55. name: "城市"
  56. },
  57. {
  58. name: "分区"
  59. },
  60. {
  61. name: "闲置资源分类"
  62. }
  63. ]
  64. };
  65. },
  66. mounted() {
  67. this.getHttpData();
  68. },
  69. methods: {
  70. getHttpData() {
  71. const res = common_api.fetchMenu();
  72. console.log(res);
  73. },
  74. handleAreaChange() {
  75. this.$refs.citySelectRef.open();
  76. },
  77. handleCityChange(e) {
  78. console.info(e);
  79. this.city = e.city.label;
  80. },
  81. onDetail(event) {
  82. common_vendor.index.navigateTo({
  83. url: "/pages_subpack/detail/index"
  84. });
  85. }
  86. }
  87. };
  88. if (!Array) {
  89. const _easycom_uv_icon2 = common_vendor.resolveComponent("uv-icon");
  90. const _easycom_uv_search2 = common_vendor.resolveComponent("uv-search");
  91. const _easycom_uv_tabs2 = common_vendor.resolveComponent("uv-tabs");
  92. const _component_citySelect = common_vendor.resolveComponent("citySelect");
  93. (_easycom_uv_icon2 + _easycom_uv_search2 + _easycom_uv_tabs2 + _component_citySelect)();
  94. }
  95. const _easycom_uv_icon = () => "../../uni_modules/uv-icon/components/uv-icon/uv-icon.js";
  96. const _easycom_uv_search = () => "../../uni_modules/uv-search/components/uv-search/uv-search.js";
  97. const _easycom_uv_tabs = () => "../../uni_modules/uv-tabs/components/uv-tabs/uv-tabs.js";
  98. if (!Math) {
  99. (_easycom_uv_icon + _easycom_uv_search + _easycom_uv_tabs)();
  100. }
  101. function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  102. return {
  103. a: common_vendor.t($data.city),
  104. b: common_vendor.p({
  105. name: "arrow-down-fill"
  106. }),
  107. c: common_vendor.o(($event) => $options.handleAreaChange()),
  108. d: common_vendor.o(($event) => $data.keyword = $event),
  109. e: common_vendor.p({
  110. showAction: false,
  111. bgColor: "transparent",
  112. placeholder: "请输入租房信息",
  113. modelValue: $data.keyword
  114. }),
  115. f: common_assets._imports_0,
  116. g: common_vendor.f($data.nav, (item, index, i0) => {
  117. return {
  118. a: item.img,
  119. b: common_vendor.t(item.name),
  120. c: index
  121. };
  122. }),
  123. h: common_assets._imports_1,
  124. i: common_vendor.p({
  125. list: $data.list,
  126. activeStyle: {
  127. color: "#000000"
  128. },
  129. inactiveStyle: {
  130. color: "#666666"
  131. },
  132. lineColor: `url(${$data.lineBg}) 100% 100%`
  133. }),
  134. j: common_vendor.f(20, (item, index, i0) => {
  135. return {
  136. a: "380a2403-3-" + i0,
  137. b: common_vendor.o(($event) => $options.onDetail(item), index),
  138. c: index
  139. };
  140. }),
  141. k: common_assets._imports_0$1,
  142. l: common_vendor.p({
  143. name: "eye"
  144. }),
  145. m: common_vendor.sr("citySelectRef", "380a2403-4"),
  146. n: common_vendor.o($options.handleCityChange),
  147. o: common_vendor.p({
  148. zIndex: 0
  149. })
  150. };
  151. }
  152. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
  153. wx.createPage(MiniProgramPage);