index.js 6.7 KB

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