su-video.js 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  1. "use strict";
  2. const common_vendor = require("../../../common/vendor.js");
  3. require("../../index.js");
  4. require("../../api/index.js");
  5. require("../../api/distri/score.js");
  6. require("../../request/index.js");
  7. require("../../config/index.js");
  8. require("../../store/index.js");
  9. require("../../store/app.js");
  10. require("../../api/promotion/diy.js");
  11. require("../../platform/index.js");
  12. require("../../platform/provider/wechat/index.js");
  13. require("../../platform/provider/wechat/miniProgram.js");
  14. require("../../api/member/auth.js");
  15. require("../../api/member/social.js");
  16. require("../../api/member/user.js");
  17. require("../../platform/provider/apple/index.js");
  18. require("../../platform/share.js");
  19. require("../../router/index.js");
  20. require("../../hooks/useModal.js");
  21. require("../../helper/index.js");
  22. require("../../helper/test.js");
  23. require("../../helper/digit.js");
  24. require("../../api/member/signin.js");
  25. require("../../helper/throttle.js");
  26. require("../../url/index.js");
  27. require("../../platform/pay.js");
  28. require("../../api/pay/order.js");
  29. require("../../store/user.js");
  30. require("../../store/cart.js");
  31. require("../../api/trade/cart.js");
  32. require("../../api/pay/wallet.js");
  33. require("../../api/trade/order.js");
  34. require("../../api/promotion/coupon.js");
  35. require("../../store/sys.js");
  36. require("../../store/modal.js");
  37. require("../../api/distri/share.js");
  38. require("../../api/distri/team.js");
  39. require("../../api/infra/file.js");
  40. require("../../api/member/address.js");
  41. require("../../api/member/point.js");
  42. require("../../api/migration/app.js");
  43. require("../../api/migration/chat.js");
  44. require("../../api/migration/index.js");
  45. require("../../api/migration/third.js");
  46. require("../../api/pay/channel.js");
  47. require("../../api/product/category.js");
  48. require("../../api/product/comment.js");
  49. require("../../api/product/favorite.js");
  50. require("../../api/product/history.js");
  51. require("../../api/product/spu.js");
  52. require("../../api/promotion/activity.js");
  53. require("../../api/promotion/article.js");
  54. require("../../api/promotion/bargain.js");
  55. require("../../api/promotion/combination.js");
  56. require("../../api/promotion/rewardActivity.js");
  57. require("../../api/promotion/seckill.js");
  58. require("../../api/system/area.js");
  59. require("../../api/system/voice.js");
  60. require("../../api/trade/afterSale.js");
  61. require("../../api/trade/brokerage.js");
  62. require("../../api/trade/config.js");
  63. require("../../api/trade/delivery.js");
  64. require("../../config/zIndex.js");
  65. const _sfc_main = {
  66. __name: "su-video",
  67. props: {
  68. moveX: {
  69. type: [Number],
  70. default: 0
  71. },
  72. // 下标索引
  73. uid: {
  74. type: [Number, String],
  75. default: 0
  76. },
  77. // 视频高度
  78. height: {
  79. type: Number,
  80. default: 300
  81. },
  82. // 视频宽度
  83. width: {
  84. type: Number,
  85. default: 750
  86. },
  87. // 指定视频初始播放位置,单位为秒(s)
  88. initialTime: {
  89. type: Number,
  90. default: 1
  91. },
  92. src: {
  93. type: String,
  94. default: ""
  95. },
  96. poster: {
  97. type: String,
  98. default: "https://img1.baidu.com/it/u=1601695551,235775011&fm=26&fmt=auto"
  99. },
  100. autoplay: {
  101. type: Boolean,
  102. default: false
  103. }
  104. },
  105. emits: ["videoTimeupdate"],
  106. setup(__props, { expose: __expose, emit: __emit }) {
  107. const vm = common_vendor.getCurrentInstance();
  108. const state = common_vendor.reactive({
  109. enableProgressGesture: false,
  110. // 手势滑动
  111. showModal: false
  112. // 弹框
  113. });
  114. const props = __props;
  115. const emits = __emit;
  116. const timeupdate = (e) => {
  117. emits("videoTimeupdate", e);
  118. };
  119. const videoErrorCallback = (e) => {
  120. console.log("视频错误信息:", e.target.errMsg);
  121. };
  122. const play = () => {
  123. console.log("视频开始");
  124. };
  125. const pause = () => {
  126. console.log("视频暂停");
  127. };
  128. const end = () => {
  129. console.log("视频结束");
  130. };
  131. const pausePlay = () => {
  132. const video = common_vendor.index.createVideoContext(`sVideo${props.index}`, vm);
  133. video.pause();
  134. };
  135. __expose({
  136. pausePlay
  137. });
  138. return (_ctx, _cache) => {
  139. return {
  140. a: `sVideo${__props.uid}`,
  141. b: common_vendor.s({
  142. height: __props.height + "rpx"
  143. }),
  144. c: __props.src,
  145. d: state.enableProgressGesture,
  146. e: __props.initialTime,
  147. f: common_vendor.o(videoErrorCallback),
  148. g: common_vendor.o(timeupdate),
  149. h: common_vendor.o(play),
  150. i: common_vendor.o(pause),
  151. j: common_vendor.o(end),
  152. k: __props.poster,
  153. l: __props.autoplay
  154. };
  155. };
  156. }
  157. };
  158. const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f4b9589e"], ["__file", "D:/zx/mall-front-app/sheep/ui/su-video/su-video.vue"]]);
  159. wx.createComponent(Component);