index.js 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
  5. const _easycom_u_subsection2 = common_vendor.resolveComponent("u-subsection");
  6. const _easycom_up_badge2 = common_vendor.resolveComponent("up-badge");
  7. (_easycom_u_swiper2 + _easycom_u_subsection2 + _easycom_up_badge2)();
  8. }
  9. const _easycom_u_swiper = () => "../../node-modules/uview-plus/components/u-swiper/u-swiper.js";
  10. const _easycom_u_subsection = () => "../../node-modules/uview-plus/components/u-subsection/u-subsection.js";
  11. const _easycom_up_badge = () => "../../node-modules/uview-plus/components/u-badge/u-badge.js";
  12. if (!Math) {
  13. (_easycom_u_swiper + _easycom_u_subsection + _easycom_up_badge)();
  14. }
  15. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  16. __name: "index",
  17. setup(__props) {
  18. var _a, _b;
  19. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  20. (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
  21. const offset = common_vendor.ref(["-2px", "355px"]);
  22. const tabList = common_vendor.ref(["销量榜", "保值榜", "店铺规模榜"]);
  23. const curNow = common_vendor.ref(0);
  24. const config = common_vendor.ref({ logoUrl: [] });
  25. const currentNum = common_vendor.ref(1);
  26. const url = common_vendor.ref([{ url: "https://cdn.uviewui.com/uview/album/1.jpg" }, { url: "https://cdn.uviewui.com/uview/album/2.jpg" }, { url: "https://cdn.uviewui.com/uview/album/3.jpg" }, { url: "https://cdn.uviewui.com/uview/album/4.jpg" }, { url: "https://cdn.uviewui.com/uview/album/5.jpg" }]);
  27. const list = common_vendor.ref([
  28. {
  29. id: "1",
  30. file: [{ url: "https://cdn.uviewui.com/uview/album/1.jpg" }],
  31. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  32. year: "2014年 ",
  33. city: "丹东",
  34. kilometer: "8万公里",
  35. money: "7.80"
  36. },
  37. {
  38. id: "1",
  39. file: [{ url: "https://cdn.uviewui.com/uview/album/2.jpg" }],
  40. name: "捷豹XEL 2020款 2.0T 200PS S进取优雅版",
  41. year: "2014年 ",
  42. city: "丹东",
  43. kilometer: "8万公里",
  44. money: "7.80"
  45. },
  46. {
  47. id: "1",
  48. file: [{ url: "https://cdn.uviewui.com/uview/album/3.jpg" }],
  49. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  50. year: "2014年 ",
  51. city: "丹东",
  52. kilometer: "8万公里",
  53. money: "7.80"
  54. },
  55. {
  56. id: "1",
  57. file: [{ url: "https://cdn.uviewui.com/uview/album/4.jpg" }],
  58. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  59. year: "2014年 ",
  60. city: "丹东",
  61. kilometer: "8万公里",
  62. money: "7.80"
  63. },
  64. {
  65. id: "1",
  66. file: [{ url: "https://cdn.uviewui.com/uview/album/5.jpg" }],
  67. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  68. year: "2014年 ",
  69. city: "丹东",
  70. kilometer: "8万公里",
  71. money: "7.80"
  72. },
  73. {
  74. id: "1",
  75. file: [{ url: "https://cdn.uviewui.com/uview/album/6.jpg" }],
  76. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  77. year: "2014年 ",
  78. city: "丹东",
  79. kilometer: "8万公里",
  80. money: "7.80"
  81. },
  82. {
  83. id: "1",
  84. file: [{ url: "https://cdn.uviewui.com/uview/album/7.jpg" }],
  85. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  86. year: "2014年 ",
  87. city: "丹东",
  88. kilometer: "8万公里",
  89. money: "7.80"
  90. },
  91. {
  92. id: "1",
  93. file: [{ url: "https://cdn.uviewui.com/uview/album/8.jpg" }],
  94. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  95. year: "2014年 ",
  96. city: "丹东",
  97. kilometer: "8万公里",
  98. money: "7.80"
  99. },
  100. {
  101. id: "1",
  102. file: [{ url: "https://cdn.uviewui.com/uview/album/9.jpg" }],
  103. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  104. year: "2014年 ",
  105. city: "丹东",
  106. kilometer: "8万公里",
  107. money: "7.80"
  108. },
  109. {
  110. id: "1",
  111. file: [{ url: "https://cdn.uviewui.com/uview/album/10.jpg" }],
  112. name: "夏朗 2013款 1.8TSI 标配型 欧IV",
  113. year: "2014年 ",
  114. city: "丹东",
  115. kilometer: "8万公里",
  116. money: "7.80"
  117. }
  118. ]);
  119. const total = common_vendor.ref(0);
  120. const skip = common_vendor.ref(0);
  121. const limit = common_vendor.ref(6);
  122. const page = common_vendor.ref(0);
  123. const is_bottom = common_vendor.ref(false);
  124. common_vendor.ref(0);
  125. common_vendor.onLoad(async () => {
  126. await searchConfig();
  127. await search();
  128. });
  129. const searchConfig = async () => {
  130. config.value = common_vendor.index.getStorageSync("config");
  131. };
  132. const search = async () => {
  133. };
  134. const sectionChange = (index) => {
  135. curNow.value = index;
  136. };
  137. const toView = (item) => {
  138. common_vendor.index.navigateTo({
  139. url: `/pagesHome/car/index?id=${item.id || item._id}`
  140. });
  141. };
  142. const toChat = (item) => {
  143. common_vendor.index.makePhoneCall({
  144. phoneNumber: item.shop || "110",
  145. success: function() {
  146. console.log("拨打电话成功");
  147. },
  148. fail: function() {
  149. common_vendor.index.showToast({
  150. title: "拨打电话失败",
  151. icon: "error"
  152. });
  153. }
  154. });
  155. };
  156. const toPage = () => {
  157. if (total.value > list.value.length) {
  158. common_vendor.index.showLoading({
  159. title: "加载中",
  160. mask: true
  161. });
  162. page.value = page.value + 1;
  163. skip.value = page.value * limit.value;
  164. search();
  165. common_vendor.index.hideLoading();
  166. } else
  167. is_bottom.value = true;
  168. };
  169. return (_ctx, _cache) => {
  170. return common_vendor.e({
  171. a: common_vendor.t(currentNum.value + 1),
  172. b: common_vendor.t(url.value.length),
  173. c: common_vendor.o((e) => currentNum.value = e.current),
  174. d: common_vendor.p({
  175. list: url.value,
  176. height: "200px",
  177. keyName: "url",
  178. indicatorStyle: "right: 20px",
  179. radius: "0"
  180. }),
  181. e: common_vendor.o(sectionChange),
  182. f: common_vendor.p({
  183. mode: "subsection",
  184. activeColor: "#ffbc00",
  185. list: tabList.value,
  186. current: curNow.value
  187. }),
  188. g: common_vendor.f(list.value, (item, index, i0) => {
  189. return common_vendor.e({
  190. a: "581af8d0-2-" + i0,
  191. b: common_vendor.p({
  192. absolute: true,
  193. offset: offset.value,
  194. numberType: "overflow",
  195. shape: "horn",
  196. max: "99",
  197. value: index + 1
  198. }),
  199. c: item.file && item.file.length > 0 ? item.file[0].url : "",
  200. d: common_vendor.t(item.name || "暂无"),
  201. e: item.year
  202. }, item.year ? {
  203. f: common_vendor.t(item.year || "暂无")
  204. } : {}, {
  205. g: item.kilometer
  206. }, item.kilometer ? {
  207. h: common_vendor.t(item.kilometer || "暂无")
  208. } : {}, {
  209. i: item.city
  210. }, item.city ? {
  211. j: common_vendor.t(item.city || "暂无")
  212. } : {}, {
  213. k: common_vendor.t(item.money || "0"),
  214. l: common_vendor.o(($event) => toChat(item), index),
  215. m: index,
  216. n: common_vendor.o(($event) => toView(item), index)
  217. });
  218. }),
  219. h: is_bottom.value
  220. }, is_bottom.value ? {
  221. i: common_vendor.t(config.value.bottom_title || "没有更多了!")
  222. } : {}, {
  223. j: common_vendor.o(toPage)
  224. });
  225. };
  226. }
  227. });
  228. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-581af8d0"], ["__file", "D:/project/二手车/car_applet/pagesHome/rank/index.vue"]]);
  229. wx.createPage(MiniProgramPage);