index.js 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const services_ams = require("../../services/ams.js");
  4. const utils_system = require("../../utils/system.js");
  5. if (!Array) {
  6. const _easycom_wd_swiper2 = common_vendor.resolveComponent("wd-swiper");
  7. _easycom_wd_swiper2();
  8. }
  9. const _easycom_wd_swiper = () => "../../node-modules/wot-design-uni/components/wd-swiper/wd-swiper.js";
  10. if (!Math) {
  11. (_easycom_wd_swiper + UserLoginPopup)();
  12. }
  13. const UserLoginPopup = () => "../../components/userLoginPopup.js";
  14. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  15. __name: "index",
  16. setup(__props) {
  17. const current = common_vendor.ref(0);
  18. const appid = common_vendor.index.getStorageSync("appid");
  19. common_vendor.onLoad(() => {
  20. getBanner();
  21. utils_system.isGetPhone();
  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 loginRef = common_vendor.ref(null);
  30. const toActivity = () => {
  31. if (!utils_system.isGetPhone()) {
  32. loginRef.value.show = true;
  33. } else {
  34. common_vendor.index.navigateTo({
  35. url: "/pagesOne/winner/index"
  36. });
  37. }
  38. };
  39. common_vendor.onShow(() => {
  40. utils_system.getActivityData();
  41. });
  42. return (_ctx, _cache) => {
  43. return {
  44. a: common_vendor.p({
  45. customClass: "customSwiper",
  46. list: bannerList.value,
  47. autoplay: true,
  48. ["value-key"]: "imageUrl",
  49. value: current.value
  50. }),
  51. b: common_vendor.o(toActivity),
  52. c: common_vendor.sr(loginRef, "f5f2151a-1", {
  53. "k": "loginRef"
  54. }),
  55. d: common_vendor.p({
  56. path: "/pagesOne/winner/index"
  57. })
  58. };
  59. };
  60. }
  61. });
  62. wx.createPage(_sfc_main);