index.js 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_album2 = common_vendor.resolveComponent("u-album");
  5. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  6. (_easycom_u_album2 + _easycom_u_icon2)();
  7. }
  8. const _easycom_u_album = () => "../../node-modules/uview-plus/components/u-album/u-album.js";
  9. const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
  10. if (!Math) {
  11. (_easycom_u_album + _easycom_u_icon)();
  12. }
  13. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  14. __name: "index",
  15. setup(__props) {
  16. var _a;
  17. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  18. common_vendor.computed(() => {
  19. return common_vendor.index.getStorageSync("openid");
  20. });
  21. const config = common_vendor.ref({});
  22. const type = common_vendor.ref("");
  23. const current = common_vendor.ref(0);
  24. const itemId = common_vendor.ref("");
  25. const imageList = common_vendor.ref([
  26. {
  27. name: "外观",
  28. url: [
  29. "https://cdn.uviewui.com/uview/album/1.jpg",
  30. "https://cdn.uviewui.com/uview/album/2.jpg",
  31. "https://cdn.uviewui.com/uview/album/3.jpg",
  32. "https://cdn.uviewui.com/uview/album/4.jpg",
  33. "https://cdn.uviewui.com/uview/album/5.jpg",
  34. "https://cdn.uviewui.com/uview/album/6.jpg",
  35. "https://cdn.uviewui.com/uview/album/7.jpg",
  36. "https://cdn.uviewui.com/uview/album/8.jpg",
  37. "https://cdn.uviewui.com/uview/album/9.jpg"
  38. ]
  39. },
  40. {
  41. name: "内饰",
  42. url: [
  43. "https://cdn.uviewui.com/uview/album/1.jpg",
  44. "https://cdn.uviewui.com/uview/album/2.jpg",
  45. "https://cdn.uviewui.com/uview/album/10.jpg"
  46. ]
  47. },
  48. {
  49. name: "空间",
  50. url: [
  51. "https://cdn.uviewui.com/uview/album/7.jpg",
  52. "https://cdn.uviewui.com/uview/album/8.jpg",
  53. "https://cdn.uviewui.com/uview/album/9.jpg"
  54. ]
  55. }
  56. ]);
  57. common_vendor.onLoad(async (options) => {
  58. type.value = options && options.id;
  59. await searchConfig();
  60. await searchOther();
  61. await search();
  62. });
  63. const searchOther = async () => {
  64. };
  65. const searchConfig = async () => {
  66. config.value = common_vendor.index.getStorageSync("config");
  67. };
  68. const search = async () => {
  69. };
  70. const toChat = (item) => {
  71. common_vendor.index.makePhoneCall({
  72. phoneNumber: item.shop || "110",
  73. success: function() {
  74. console.log("拨打电话成功");
  75. },
  76. fail: function() {
  77. console.log("拨打电话失败");
  78. }
  79. });
  80. };
  81. const swichMenu = (index) => {
  82. if (index == current.value)
  83. return;
  84. current.value = index;
  85. itemId.value = `item${index}`;
  86. };
  87. return (_ctx, _cache) => {
  88. return {
  89. a: common_vendor.f(imageList.value, (item, index, i0) => {
  90. return {
  91. a: common_vendor.t(item.name),
  92. b: common_vendor.t(item.url.length || 0),
  93. c: common_vendor.n(current.value == index ? "border" : ""),
  94. d: index,
  95. e: common_vendor.o(($event) => swichMenu(index), index)
  96. };
  97. }),
  98. b: common_vendor.f(imageList.value, (item, index, i0) => {
  99. return {
  100. a: common_vendor.t(item.name),
  101. b: common_vendor.t(item.url.length || 0),
  102. c: "item" + index,
  103. d: common_vendor.o((width) => _ctx.albumWidth = width, index),
  104. e: "0d1a9630-0-" + i0,
  105. f: common_vendor.p({
  106. urls: item.url,
  107. multipleSize: "110"
  108. }),
  109. g: index
  110. };
  111. }),
  112. c: common_vendor.o(
  113. //@ts-ignore
  114. (...args) => _ctx.toPage && _ctx.toPage(...args)
  115. ),
  116. d: itemId.value,
  117. e: common_vendor.p({
  118. color: "#ffffff",
  119. name: "red-packet",
  120. size: "20"
  121. }),
  122. f: common_vendor.o(toChat),
  123. g: common_vendor.o(toChat),
  124. h: common_vendor.o(toChat)
  125. };
  126. };
  127. }
  128. });
  129. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0d1a9630"], ["__file", "D:/project/二手车/car_applet/pagesHome/picture/index.vue"]]);
  130. wx.createPage(MiniProgramPage);