index.js 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const common_assets = require("../../common/assets.js");
  4. const _sfc_main = {
  5. __name: "index",
  6. props: {
  7. imgUrls: {
  8. type: Array,
  9. default: () => []
  10. },
  11. videoline: {
  12. type: String,
  13. default: ""
  14. }
  15. },
  16. setup(__props) {
  17. const props = __props;
  18. const indicatorDots = common_vendor.ref(true);
  19. const circular = common_vendor.ref(true);
  20. const autoplay = common_vendor.ref(true);
  21. const interval = common_vendor.ref(3e3);
  22. const duration = common_vendor.ref(500);
  23. const currents = common_vendor.ref("1");
  24. const controls = common_vendor.ref(true);
  25. common_vendor.ref(true);
  26. const videoContext = common_vendor.ref("");
  27. common_vendor.onMounted(() => {
  28. if (props.videoline) {
  29. props.imgUrls.shift();
  30. }
  31. });
  32. const bindPause = () => {
  33. videoContext.value.play();
  34. controls.value = false;
  35. autoplay.value = false;
  36. };
  37. const change = (e) => {
  38. currents.value = e.detail.current + 1;
  39. };
  40. const videoPause = (e) => {
  41. };
  42. return (_ctx, _cache) => {
  43. return common_vendor.e({
  44. a: __props.videoline
  45. }, __props.videoline ? {
  46. b: __props.videoline,
  47. c: __props.imgUrls[0],
  48. d: common_vendor.o(videoPause),
  49. e: !controls.value,
  50. f: __props.imgUrls[0],
  51. g: controls.value,
  52. h: common_assets._imports_0,
  53. i: controls.value,
  54. j: common_vendor.o(bindPause)
  55. } : {}, {
  56. k: common_vendor.f(__props.imgUrls, (item, index, i0) => {
  57. return {
  58. a: item,
  59. b: index
  60. };
  61. }),
  62. l: indicatorDots.value,
  63. m: autoplay.value,
  64. n: circular.value,
  65. o: interval.value,
  66. p: duration.value,
  67. q: common_vendor.o(change)
  68. });
  69. };
  70. }
  71. };
  72. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-afea8b02"]]);
  73. wx.createComponent(Component);
  74. //# sourceMappingURL=../../../.sourcemap/mp-weixin/components/productConSwiper/index.js.map