index.js 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const services_ams = require("../../services/ams.js");
  4. if (!Array) {
  5. const _easycom_wd_swiper2 = common_vendor.resolveComponent("wd-swiper");
  6. _easycom_wd_swiper2();
  7. }
  8. const _easycom_wd_swiper = () => "../../node-modules/wot-design-uni/components/wd-swiper/wd-swiper.js";
  9. if (!Math) {
  10. _easycom_wd_swiper();
  11. }
  12. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  13. __name: "index",
  14. setup(__props) {
  15. const current = common_vendor.ref(0);
  16. const appid = common_vendor.index.getStorageSync("appid");
  17. common_vendor.onLoad(() => {
  18. getBanner();
  19. });
  20. const getphonenumber = (e) => {
  21. console.log("-----------------------", e.detail.code);
  22. };
  23. const bannerList = common_vendor.ref([]);
  24. const getBanner = () => {
  25. services_ams.getCarousel(appid).then((res) => {
  26. bannerList.value = res.data;
  27. });
  28. };
  29. const toActivity = () => {
  30. common_vendor.index.navigateTo({
  31. url: "/pagesOne/winner/index"
  32. });
  33. };
  34. common_vendor.onShow(() => {
  35. });
  36. return (_ctx, _cache) => {
  37. return {
  38. a: common_vendor.p({
  39. customClass: "customSwiper",
  40. list: bannerList.value,
  41. autoplay: true,
  42. ["value-key"]: "imageUrl",
  43. value: current.value
  44. }),
  45. b: common_vendor.o(toActivity),
  46. c: common_vendor.o(getphonenumber)
  47. };
  48. };
  49. }
  50. });
  51. wx.createPage(_sfc_main);