vhall-mini-sdk 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/lib/components/chat/chat-edit/chat-edit.js +7 -4
  2. package/lib/components/chat/chat-list/chat-list.js +1 -1
  3. package/lib/components/live-landscape/live-landscape.js +11 -7
  4. package/lib/components/live-landscape/live-landscape.wxml +2 -2
  5. package/lib/components/live-portrait/live-portrait.js +11 -7
  6. package/lib/components/live-portrait/live-portrait.wxml +3 -3
  7. package/lib/components/live-portrait/live-portrait.wxss +1 -1
  8. package/lib/components/lottery/lottery.wxml +2 -2
  9. package/lib/components/player/components/online-hot/index.js +2 -2
  10. package/lib/components/player/extensions/observers.js +5 -5
  11. package/lib/components/player/player.js +5 -0
  12. package/lib/components/player/player.wxml +3 -3
  13. package/lib/components/product/product-list/product-list.wxml +3 -11
  14. package/lib/components/signin/signin-dialog.js +1 -0
  15. package/lib/sdk/main/index.js +2 -1
  16. package/lib/sdk/player/index.js +1 -1
  17. package/lib/sdk/plugins/InviteCardServer.js +1 -1
  18. package/lib/sdk/plugins/MallRewardServer.js +1 -1
  19. package/lib/sdk/plugins/ProductServer.js +1 -1
  20. package/lib/shared/RequestUtil.js +1 -1
  21. package/lib/shared/logger.js +1 -1
  22. package/package.json +2 -4
  23. package/postinstall.js +21 -51
  24. package/dist/components/chat/chat-edit/chat-edit.js +0 -127
  25. package/dist/components/chat/chat-edit/chat-edit.json +0 -4
  26. package/dist/components/chat/chat-edit/chat-edit.wxml +0 -7
  27. package/dist/components/chat/chat-edit/chat-edit.wxss +0 -1
  28. package/dist/components/chat/chat-item/chat-item.js +0 -253
  29. package/dist/components/chat/chat-item/chat-item.json +0 -3
  30. package/dist/components/chat/chat-item/chat-item.wxml +0 -96
  31. package/dist/components/chat/chat-item/chat-item.wxss +0 -1
  32. package/dist/components/chat/chat-list/chat-list.js +0 -216
  33. package/dist/components/chat/chat-list/chat-list.json +0 -6
  34. package/dist/components/chat/chat-list/chat-list.wxml +0 -9
  35. package/dist/components/chat/chat-list/chat-list.wxss +0 -1
  36. package/dist/components/chat/chat.js +0 -98
  37. package/dist/components/chat/chat.json +0 -7
  38. package/dist/components/chat/chat.wxml +0 -7
  39. package/dist/components/chat/chat.wxss +0 -1
  40. package/dist/components/gift/gift-display/gift-display.js +0 -118
  41. package/dist/components/gift/gift-display/gift-display.json +0 -3
  42. package/dist/components/gift/gift-display/gift-display.wxml +0 -16
  43. package/dist/components/gift/gift-display/gift-display.wxss +0 -1
  44. package/dist/components/gift/gift-sender/gift-sender.js +0 -63
  45. package/dist/components/gift/gift-sender/gift-sender.json +0 -6
  46. package/dist/components/gift/gift-sender/gift-sender.wxml +0 -19
  47. package/dist/components/gift/gift-sender/gift-sender.wxss +0 -1
  48. package/dist/components/introduction/introduction.js +0 -43
  49. package/dist/components/introduction/introduction.json +0 -3
  50. package/dist/components/introduction/introduction.wxml +0 -8
  51. package/dist/components/introduction/introduction.wxss +0 -1
  52. package/dist/components/invite-rank/img/bronze.png +0 -0
  53. package/dist/components/invite-rank/img/gold.png +0 -0
  54. package/dist/components/invite-rank/img/silver.png +0 -0
  55. package/dist/components/invite-rank/index.js +0 -135
  56. package/dist/components/invite-rank/index.json +0 -8
  57. package/dist/components/invite-rank/index.wxml +0 -42
  58. package/dist/components/invite-rank/index.wxss +0 -1
  59. package/dist/components/invite-rank/invite-rank-item.js +0 -12
  60. package/dist/components/invite-rank/invite-rank-item.json +0 -4
  61. package/dist/components/invite-rank/invite-rank-item.wxml +0 -21
  62. package/dist/components/invite-rank/invite-rank-item.wxss +0 -1
  63. package/dist/components/invite-rank/my-invite-detail.js +0 -82
  64. package/dist/components/invite-rank/my-invite-detail.json +0 -7
  65. package/dist/components/invite-rank/my-invite-detail.wxml +0 -27
  66. package/dist/components/invite-rank/my-invite-detail.wxss +0 -1
  67. package/dist/components/invite-rank/util.wxs +0 -21
  68. package/dist/components/live-landscape/live-landscape.js +0 -216
  69. package/dist/components/live-landscape/live-landscape.json +0 -39
  70. package/dist/components/live-landscape/live-landscape.wxml +0 -73
  71. package/dist/components/live-landscape/live-landscape.wxss +0 -1
  72. package/dist/components/live-portrait/live-portrait.js +0 -274
  73. package/dist/components/live-portrait/live-portrait.json +0 -38
  74. package/dist/components/live-portrait/live-portrait.wxml +0 -106
  75. package/dist/components/live-portrait/live-portrait.wxss +0 -1
  76. package/dist/components/lottery/lottery-accept/index.js +0 -249
  77. package/dist/components/lottery/lottery-accept/index.json +0 -4
  78. package/dist/components/lottery/lottery-accept/index.wxml +0 -49
  79. package/dist/components/lottery/lottery-accept/index.wxss +0 -1
  80. package/dist/components/lottery/lottery-history/index.js +0 -36
  81. package/dist/components/lottery/lottery-history/index.json +0 -3
  82. package/dist/components/lottery/lottery-history/index.wxml +0 -28
  83. package/dist/components/lottery/lottery-history/index.wxss +0 -1
  84. package/dist/components/lottery/lottery-shake/lottery-shake.js +0 -328
  85. package/dist/components/lottery/lottery-shake/lottery-shake.json +0 -1
  86. package/dist/components/lottery/lottery-shake/lottery-shake.wxml +0 -52
  87. package/dist/components/lottery/lottery-shake/lottery-shake.wxss +0 -1
  88. package/dist/components/lottery/lottery-slot/lottery-slot.js +0 -230
  89. package/dist/components/lottery/lottery-slot/lottery-slot.json +0 -1
  90. package/dist/components/lottery/lottery-slot/lottery-slot.wxml +0 -62
  91. package/dist/components/lottery/lottery-slot/lottery-slot.wxss +0 -1
  92. package/dist/components/lottery/lottery-wheel/lottery-wheel.js +0 -153
  93. package/dist/components/lottery/lottery-wheel/lottery-wheel.json +0 -4
  94. package/dist/components/lottery/lottery-wheel/lottery-wheel.wxml +0 -91
  95. package/dist/components/lottery/lottery-wheel/lottery-wheel.wxss +0 -1
  96. package/dist/components/lottery/lottery-winners/index.js +0 -101
  97. package/dist/components/lottery/lottery-winners/index.json +0 -4
  98. package/dist/components/lottery/lottery-winners/index.wxml +0 -39
  99. package/dist/components/lottery/lottery-winners/index.wxss +0 -1
  100. package/dist/components/lottery/lottery.js +0 -388
  101. package/dist/components/lottery/lottery.json +0 -11
  102. package/dist/components/lottery/lottery.wxml +0 -78
  103. package/dist/components/lottery/lottery.wxss +0 -1
  104. package/dist/components/lottery/wheel.json +0 -49
  105. package/dist/components/mall-reward/common/reward-card.wxss +0 -0
  106. package/dist/components/mall-reward/duration-icon/index.js +0 -101
  107. package/dist/components/mall-reward/duration-icon/index.json +0 -3
  108. package/dist/components/mall-reward/duration-icon/index.wxml +0 -7
  109. package/dist/components/mall-reward/duration-icon/index.wxss +0 -1
  110. package/dist/components/mall-reward/f-count-down/index.js +0 -61
  111. package/dist/components/mall-reward/f-count-down/index.json +0 -3
  112. package/dist/components/mall-reward/f-count-down/index.wxml +0 -9
  113. package/dist/components/mall-reward/f-count-down/index.wxss +0 -1
  114. package/dist/components/mall-reward/f-empty/index.js +0 -11
  115. package/dist/components/mall-reward/f-empty/index.json +0 -3
  116. package/dist/components/mall-reward/f-empty/index.wxml +0 -8
  117. package/dist/components/mall-reward/f-empty/index.wxss +0 -1
  118. package/dist/components/mall-reward/f-history/index.js +0 -84
  119. package/dist/components/mall-reward/f-history/index.json +0 -4
  120. package/dist/components/mall-reward/f-history/index.wxml +0 -38
  121. package/dist/components/mall-reward/f-history/index.wxss +0 -1
  122. package/dist/components/mall-reward/f-open/index.js +0 -36
  123. package/dist/components/mall-reward/f-open/index.json +0 -3
  124. package/dist/components/mall-reward/f-open/index.wxml +0 -10
  125. package/dist/components/mall-reward/f-open/index.wxss +0 -1
  126. package/dist/components/mall-reward/f-receive/index.js +0 -36
  127. package/dist/components/mall-reward/f-receive/index.json +0 -3
  128. package/dist/components/mall-reward/f-receive/index.wxml +0 -9
  129. package/dist/components/mall-reward/f-receive/index.wxss +0 -1
  130. package/dist/components/mall-reward/index.js +0 -374
  131. package/dist/components/mall-reward/index.json +0 -8
  132. package/dist/components/mall-reward/index.wxml +0 -4
  133. package/dist/components/mall-reward/index.wxss +0 -0
  134. package/dist/components/mall-reward/main-popup/index.js +0 -46
  135. package/dist/components/mall-reward/main-popup/index.json +0 -12
  136. package/dist/components/mall-reward/main-popup/index.wxml +0 -16
  137. package/dist/components/mall-reward/main-popup/index.wxss +0 -1
  138. package/dist/components/player/assets/image/arrow-left.png +0 -0
  139. package/dist/components/player/assets/image/arrow-right.png +0 -0
  140. package/dist/components/player/assets/image/enterFullScreen.png +0 -0
  141. package/dist/components/player/assets/image/exitFullScreen.png +0 -0
  142. package/dist/components/player/assets/image/fullscreen_1.png +0 -0
  143. package/dist/components/player/assets/image/fullscreen_2.png +0 -0
  144. package/dist/components/player/assets/image/pause.png +0 -0
  145. package/dist/components/player/assets/image/pause_1.png +0 -0
  146. package/dist/components/player/assets/image/play.png +0 -0
  147. package/dist/components/player/assets/image/play_1.png +0 -0
  148. package/dist/components/player/assets/image/refresh.png +0 -0
  149. package/dist/components/player/assets/image/refresh_1.png +0 -0
  150. package/dist/components/player/assets/image/subtitle_close.png +0 -0
  151. package/dist/components/player/assets/image/subtitle_default.png +0 -0
  152. package/dist/components/player/assets/image/volume-off.png +0 -0
  153. package/dist/components/player/assets/image/volume-on.png +0 -0
  154. package/dist/components/player/common/config.js +0 -7
  155. package/dist/components/player/common/veComponent.js +0 -4
  156. package/dist/components/player/components/barrage/barrage-canvas.js +0 -488
  157. package/dist/components/player/components/barrage/barrage-dom.js +0 -471
  158. package/dist/components/player/components/barrage/index.js +0 -62
  159. package/dist/components/player/components/barrage/index.json +0 -4
  160. package/dist/components/player/components/barrage/index.wxml +0 -39
  161. package/dist/components/player/components/barrage/index.wxss +0 -1
  162. package/dist/components/player/components/barrage/utils.js +0 -71
  163. package/dist/components/player/components/controls/controls.js +0 -93
  164. package/dist/components/player/components/controls/controls.json +0 -6
  165. package/dist/components/player/components/controls/controls.wxml +0 -60
  166. package/dist/components/player/components/controls/controls.wxss +0 -1
  167. package/dist/components/player/components/danmaku/danmaku.js +0 -23
  168. package/dist/components/player/components/danmaku/danmaku.json +0 -4
  169. package/dist/components/player/components/danmaku/danmaku.wxml +0 -1
  170. package/dist/components/player/components/danmaku/danmaku.wxss +0 -0
  171. package/dist/components/player/components/error/error.js +0 -15
  172. package/dist/components/player/components/error/error.json +0 -3
  173. package/dist/components/player/components/error/error.wxml +0 -6
  174. package/dist/components/player/components/error/error.wxss +0 -1
  175. package/dist/components/player/components/loading/loading.js +0 -9
  176. package/dist/components/player/components/loading/loading.json +0 -3
  177. package/dist/components/player/components/loading/loading.wxml +0 -4
  178. package/dist/components/player/components/loading/loading.wxss +0 -1
  179. package/dist/components/player/components/main/extensions/data.js +0 -8
  180. package/dist/components/player/components/main/extensions/export.js +0 -83
  181. package/dist/components/player/components/main/extensions/methods.js +0 -110
  182. package/dist/components/player/components/main/extensions/observers.js +0 -41
  183. package/dist/components/player/components/main/extensions/props.js +0 -177
  184. package/dist/components/player/components/main/index.js +0 -44
  185. package/dist/components/player/components/main/index.json +0 -4
  186. package/dist/components/player/components/main/index.wxml +0 -7
  187. package/dist/components/player/components/main/index.wxss +0 -1
  188. package/dist/components/player/components/marquee/marquee.js +0 -304
  189. package/dist/components/player/components/marquee/marquee.json +0 -4
  190. package/dist/components/player/components/marquee/marquee.wxml +0 -14
  191. package/dist/components/player/components/marquee/marquee.wxss +0 -1
  192. package/dist/components/player/components/online-hot/assets/line-hot.png +0 -0
  193. package/dist/components/player/components/online-hot/assets/line-user.png +0 -0
  194. package/dist/components/player/components/online-hot/index.js +0 -66
  195. package/dist/components/player/components/online-hot/index.json +0 -3
  196. package/dist/components/player/components/online-hot/index.wxml +0 -15
  197. package/dist/components/player/components/online-hot/index.wxss +0 -1
  198. package/dist/components/player/components/poster/poster.js +0 -12
  199. package/dist/components/player/components/poster/poster.json +0 -3
  200. package/dist/components/player/components/poster/poster.wxml +0 -5
  201. package/dist/components/player/components/poster/poster.wxss +0 -1
  202. package/dist/components/player/components/watermark/watermark.js +0 -52
  203. package/dist/components/player/components/watermark/watermark.json +0 -4
  204. package/dist/components/player/components/watermark/watermark.wxml +0 -8
  205. package/dist/components/player/components/watermark/watermark.wxss +0 -1
  206. package/dist/components/player/extensions/data.js +0 -63
  207. package/dist/components/player/extensions/export.js +0 -325
  208. package/dist/components/player/extensions/methods.js +0 -406
  209. package/dist/components/player/extensions/observers.js +0 -114
  210. package/dist/components/player/extensions/props.js +0 -162
  211. package/dist/components/player/player.js +0 -83
  212. package/dist/components/player/player.json +0 -33
  213. package/dist/components/player/player.wxml +0 -48
  214. package/dist/components/player/player.wxss +0 -1
  215. package/dist/components/praise/praise.js +0 -150
  216. package/dist/components/praise/praise.json +0 -5
  217. package/dist/components/praise/praise.wxml +0 -17
  218. package/dist/components/praise/praise.wxss +0 -1
  219. package/dist/components/product/product-card/product-card.js +0 -109
  220. package/dist/components/product/product-card/product-card.json +0 -3
  221. package/dist/components/product/product-card/product-card.wxml +0 -47
  222. package/dist/components/product/product-card/product-card.wxss +0 -1
  223. package/dist/components/product/product-detail/product-detail.js +0 -127
  224. package/dist/components/product/product-detail/product-detail.json +0 -3
  225. package/dist/components/product/product-detail/product-detail.wxml +0 -57
  226. package/dist/components/product/product-detail/product-detail.wxss +0 -1
  227. package/dist/components/product/product-item/product-item.js +0 -56
  228. package/dist/components/product/product-item/product-item.json +0 -3
  229. package/dist/components/product/product-item/product-item.wxml +0 -35
  230. package/dist/components/product/product-item/product-item.wxss +0 -1
  231. package/dist/components/product/product-list/product-list.js +0 -67
  232. package/dist/components/product/product-list/product-list.json +0 -6
  233. package/dist/components/product/product-list/product-list.wxml +0 -16
  234. package/dist/components/product/product-list/product-list.wxss +0 -1
  235. package/dist/components/product/product-order/product-order.js +0 -394
  236. package/dist/components/product/product-order/product-order.json +0 -3
  237. package/dist/components/product/product-order/product-order.wxml +0 -75
  238. package/dist/components/product/product-order/product-order.wxss +0 -1
  239. package/dist/components/signin/signin-dialog.js +0 -305
  240. package/dist/components/signin/signin-dialog.json +0 -7
  241. package/dist/components/signin/signin-dialog.wxml +0 -19
  242. package/dist/components/signin/signin-dialog.wxss +0 -1
  243. package/dist/components/top-notify/index.js +0 -14
  244. package/dist/components/top-notify/index.json +0 -3
  245. package/dist/components/top-notify/index.wxml +0 -2
  246. package/dist/components/top-notify/index.wxss +0 -1
  247. package/dist/pubComponents/countdown/countdown.js +0 -97
  248. package/dist/pubComponents/countdown/countdown.json +0 -5
  249. package/dist/pubComponents/countdown/countdown.wxml +0 -19
  250. package/dist/pubComponents/countdown/countdown.wxss +0 -1
  251. package/dist/pubComponents/error-page/index.js +0 -146
  252. package/dist/pubComponents/error-page/index.json +0 -5
  253. package/dist/pubComponents/error-page/index.wxml +0 -37
  254. package/dist/pubComponents/error-page/index.wxss +0 -1
  255. package/dist/pubComponents/popup/popup.js +0 -161
  256. package/dist/pubComponents/popup/popup.json +0 -5
  257. package/dist/pubComponents/popup/popup.wxml +0 -17
  258. package/dist/pubComponents/popup/popup.wxss +0 -1
  259. package/dist/pubComponents/tabs/index.js +0 -95
  260. package/dist/pubComponents/tabs/index.json +0 -4
  261. package/dist/pubComponents/tabs/index.wxml +0 -22
  262. package/dist/pubComponents/tabs/index.wxss +0 -1
  263. package/dist/sdk/config/index.js +0 -1
  264. package/dist/sdk/main/index.js +0 -1
  265. package/dist/sdk/player/index.js +0 -1
  266. package/dist/sdk/plugins/ChatServer.js +0 -1
  267. package/dist/sdk/plugins/CustomMenuServer.js +0 -1
  268. package/dist/sdk/plugins/InteractServer.js +0 -1
  269. package/dist/sdk/plugins/InviteCardServer.js +0 -1
  270. package/dist/sdk/plugins/LotteryServer.js +0 -1
  271. package/dist/sdk/plugins/MallRewardServer.js +0 -1
  272. package/dist/sdk/plugins/ProductServer.js +0 -1
  273. package/dist/shared/RequestUtil.js +0 -1
  274. package/dist/shared/SerializableMap.js +0 -1
  275. package/dist/shared/base.server.js +0 -1
  276. package/dist/shared/cacheUtil.js +0 -1
  277. package/dist/shared/dateUtil.js +0 -1
  278. package/dist/shared/logger.js +0 -1
  279. package/dist/shared/mpUtils.js +0 -1
  280. package/dist/shared/utils.js +0 -1
@@ -1,101 +0,0 @@
1
- import { formatSeconds2Time } from '../../../shared/utils';
2
- Component({
3
- properties: {
4
- showIcon: {
5
- type: Boolean,
6
- value: false,
7
- },
8
- mallRewardInfo: {
9
- type: Object,
10
- value: null,
11
- },
12
- activeMallReward: {
13
- type: Object,
14
- value: null,
15
- },
16
- onlineDuration: {
17
- type: Number,
18
- value: 0,
19
- },
20
- },
21
- data: {
22
- x: 20,
23
- y: 100,
24
- startX: 0,
25
- startY: 0,
26
- hasMoved: false,
27
-
28
- second: 0, // 倒计时秒数
29
- displayText: '--:--', // 倒计时展示内容
30
- },
31
- observers: {
32
- onlineDuration: function () {
33
- this.updateOnlineDuration(this.properties.onlineDuration);
34
- },
35
- 'activeMallReward.reward_id': function () {
36
- this.calcSecond(this.properties.onlineDuration);
37
- },
38
- 'mallRewardInfo.is_received': function () {
39
- this.calcSecond(this.properties.onlineDuration);
40
- },
41
- 'mallRewardInfo.list.length': function () {
42
- this.calcSecond(this.properties.onlineDuration);
43
- },
44
- },
45
- methods: {
46
- fmtDuration(ss) {
47
- // 无当前活动红包信息,但显示小图标,说明参与过有记录
48
- if (!this.properties.activeMallReward) {
49
- return this.properties.mallRewardInfo?.is_received === 1 ? '已领取' : '领福利';
50
- }
51
-
52
- // 当前活动红包信息是无条件红包
53
- if (this.properties.activeMallReward?.viewing_minutes == 0) return '领福利';
54
-
55
- // 当前活动红包信息是时长红包
56
- if (this.properties.activeMallReward?.viewing_minutes > 0 && !isNaN(ss)) {
57
- if (ss <= 0) return '领福利';
58
-
59
- return formatSeconds2Time(ss);
60
- }
61
- return '--:--';
62
- },
63
- // 更新在线时长
64
- updateOnlineDuration(ol) {
65
- if (this.properties.activeMallReward?.viewing_minutes > 0 && this.data.second > 0) {
66
- this.calcSecond(ol);
67
- if (this.data.second < 1) {
68
- // 倒计时完成
69
- this.triggerEvent('countdownEnd', this.properties.activeMallReward);
70
- }
71
- }
72
- },
73
- // 计时倒计时秒数
74
- calcSecond(ol) {
75
- const ss = Math.max(this.properties.activeMallReward?.viewing_minutes * 60 - ol || 0, 0);
76
- const text = this.fmtDuration(ss);
77
- this.setData({
78
- second: ss,
79
- displayText: text,
80
- });
81
- },
82
-
83
- onTouchStart(e) {
84
- this.setData({ hasMoved: false });
85
- },
86
-
87
- onTouchEnd(e) {
88
- this.data.hasMoved = false;
89
- },
90
-
91
- onDragChange(e) {
92
- const { x, y } = e.detail;
93
- this.setData({ x, y, hasMoved: true });
94
- },
95
-
96
- onTapIcon() {
97
- if (this.data.hasMoved) return;
98
- this.triggerEvent('onTapIcon');
99
- },
100
- },
101
- });
@@ -1,3 +0,0 @@
1
- {
2
- "component": true
3
- }
@@ -1,7 +0,0 @@
1
- <movable-area class="drag-area">
2
- <movable-view class="drag-view" direction="all" x="{{x}}" y="{{y}}" damping="{{40}}" out-of-bounds="{{false}}" bindchange="onDragChange" bindtouchstart="onTouchStart" bindtouchend="onTouchEnd">
3
- <view class="mall-reward-icon" bindtap="onTapIcon">
4
- <view class="mall-reward-icon-content {{second>=3600?'is-long':''}}">{{displayText}}</view>
5
- </view>
6
- </movable-view>
7
- </movable-area>
@@ -1 +0,0 @@
1
- .drag-area{height:100vh;left:0;pointer-events:none;position:fixed;top:0;width:100vw;z-index:100}.drag-view{height:160rpx;pointer-events:auto;width:140rpx}.mall-reward-icon{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/dr_bg.png);height:120rpx;position:relative;width:120rpx}.mall-reward-icon,.mall-reward-icon-content{background-repeat:no-repeat;background-size:100% 100%}.mall-reward-icon-content{align-items:center;background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/dr_time_bg.png);background-position:50%;border-radius:100rpx;bottom:-14rpx;color:#fff;display:flex;font-size:.79rem;justify-content:center;left:10rpx;overflow:visible;position:absolute;text-align:center;white-space:nowrap;width:100rpx}.mall-reward-icon-content.is-long{left:4rpx;width:112rpx}
@@ -1,61 +0,0 @@
1
- import { formatSeconds2Time } from '../../../shared/utils';
2
- Component({
3
- properties: {
4
- info: {
5
- type: Object,
6
- value: {},
7
- },
8
- onlineDuration: {
9
- type: Number,
10
- value: 0,
11
- },
12
- tipMode: {
13
- type: Number,
14
- value: 1,
15
- },
16
- },
17
- data: {
18
- second: undefined,
19
- _ttl: '--:--',
20
- _title: '',
21
- },
22
-
23
- observers: {
24
- info: function (info) {
25
- this.setData({
26
- _title: info?.tip_setting?.title || info?.title || '',
27
- });
28
- },
29
- 'info, onlineDuration': function (info, onlineDuration) {
30
- // console.log('info, onlineDuration', onlineDuration);
31
- if (info?.viewing_minutes > 0 && !isNaN(onlineDuration)) {
32
- this.setData({
33
- second: Math.max(info.viewing_minutes * 60 - onlineDuration, 0),
34
- });
35
- }
36
- },
37
- second: function (ss) {
38
- const text = this.calcTtl(ss);
39
- this.setData({
40
- _ttl: text,
41
- });
42
- },
43
- },
44
- methods: {
45
- calcTtl(ss) {
46
- // 无当前活动红包信息,但显示小图标,说明参与过有记录
47
- if (!this.properties.info) return '已领取';
48
-
49
- // 当前活动红包信息是无条件红包
50
- if (this.properties.info.viewing_minutes == 0) return '领福利';
51
-
52
- // 当前活动红包信息是时长红包
53
- if (this.properties.info.viewing_minutes > 0 && !isNaN(ss)) {
54
- if (ss <= 0) return '领福利';
55
-
56
- return formatSeconds2Time(ss);
57
- }
58
- return '--:--';
59
- },
60
- },
61
- });
@@ -1,3 +0,0 @@
1
- {
2
- "component": true
3
- }
@@ -1,9 +0,0 @@
1
- <view class="mall-reward-countdown mode-{{tipMode}}">
2
- <!-- 自定义内容 -->
3
- <view class="custom-content">
4
- <view class="main-title">{{_title}}</view>
5
- <!-- 倒计时 -->
6
- <view class="countdown-box">{{_ttl}} 后可领取</view>
7
- </view>
8
- </view>
9
-
@@ -1 +0,0 @@
1
- .mall-reward-countdown{background-color:initial;background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_1.png);background-repeat:no-repeat;background-size:contain;height:750rpx;position:relative;width:750rpx}.mall-reward-countdown .custom-content{bottom:0;left:0;position:absolute;right:0;top:0;z-index:9}.mall-reward-countdown .main-title{align-items:center;color:#fff9e6;display:flex;font-size:1.93rem;font-weight:600;height:128rpx;justify-content:center;line-height:2.29rem;margin:0 160rpx;overflow:hidden;position:relative;text-align:center}.mall-reward-countdown .countdown-box{align-items:center;background:rgba(0,0,0,.25);border-radius:88rpx;color:rgba(255,249,230,.8);display:flex;justify-content:center;left:50%;overflow:hidden;padding:16rpx 44rpx;position:absolute;transform:translateX(-50%);z-index:10}.mall-reward-countdown.mode-1{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_1.png)}.mall-reward-countdown.mode-2{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_2.png)}.mall-reward-countdown.mode-3{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_3.png)}.mall-reward-countdown.mode-1 .main-title{top:380rpx}.mall-reward-countdown.mode-1 .countdown-box{top:560rpx}.mall-reward-countdown.mode-2 .main-title{top:380rpx}.mall-reward-countdown.mode-2 .countdown-box{top:550rpx}.mall-reward-countdown.mode-3 .main-title{color:#fb2626;top:270rpx}.mall-reward-countdown.mode-3 .countdown-box{top:560rpx}
@@ -1,11 +0,0 @@
1
- Component({
2
- methods: {
3
- // 点击"我知道了"
4
- handleClick() {
5
- this.triggerEvent('close', this.properties.info, {
6
- bubbles: true,
7
- composed: true,
8
- });
9
- },
10
- },
11
- });
@@ -1,3 +0,0 @@
1
- {
2
- "component": true
3
- }
@@ -1,8 +0,0 @@
1
- <view class="mall-reward-empty">
2
- <!-- 自定义内容 -->
3
- <view class="custom-content">
4
- <view class="main-title">很遗憾,您未领取到奖励</view>
5
- <!-- 按钮 -->
6
- <button class="weui-btn btn-main" bindtap="handleClick">知道了</button>
7
- </view>
8
- </view>
@@ -1 +0,0 @@
1
- .mall-reward-empty{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_empty_bg.png);background-repeat:no-repeat;background-size:contain;border-radius:20rpx;height:524rpx;position:relative;width:640rpx}.mall-reward-empty .custom-content{bottom:0;left:0;position:absolute;right:0;top:0;z-index:8}.mall-reward-empty .main-title{color:#262626;font-size:1.14rem;font-weight:600px;line-height:1.57rem;margin:0 55rpx;position:relative;text-align:center;top:80rpx}.mall-reward-empty .btn-main{background:linear-gradient(#fff7ec,#fdd8ac);border:3rpx solid #fdd8ac;border-radius:44px;color:#fb2626;font-size:1.14rem;height:80rpx;position:relative;top:340rpx;width:320rpx;z-index:10}
@@ -1,84 +0,0 @@
1
- import { debounce } from '../../../shared/utils';
2
-
3
- Component({
4
- properties: {
5
- onlineDuration: {
6
- type: Number,
7
- value: 0,
8
- },
9
- dataList: {
10
- type: Array,
11
- value: [],
12
- },
13
- },
14
-
15
- data: {
16
- _list: [],
17
- },
18
-
19
- observers: {
20
- 'dataList, onlineDuration': function (dataList, onlineDuration) {
21
- if (!dataList || !dataList.length) {
22
- this.setData({ _list: [] });
23
- return;
24
- }
25
- const list = dataList.map((item) => ({
26
- ...item,
27
- _desc: this.buildDesc(item, Number(onlineDuration) || 0),
28
- }));
29
- this.setData({ _list: list });
30
- },
31
- },
32
-
33
- methods: {
34
- formatTime(ms) {
35
- if (typeof ms !== 'number' || isNaN(ms)) return '';
36
- if (ms < 0) return '00:00';
37
- const totalSeconds = Math.floor(ms / 1000);
38
- const hours = Math.floor(totalSeconds / 3600);
39
- const minutes = Math.floor((totalSeconds % 3600) / 60);
40
- const seconds = totalSeconds % 60;
41
- const pad = (n) => String(n).padStart(2, '0');
42
- if (hours > 0) {
43
- return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
44
- }
45
- return `${pad(minutes)}:${pad(seconds)}`;
46
- },
47
-
48
- buildDesc(item, onlineDuration) {
49
- const viewingMinutes = Number(item.viewing_minutes) || 0;
50
- if (viewingMinutes === 0) {
51
- return `推送时间:${item.push_time || ''}`;
52
- }
53
- if (item.claim_status == 1 || (item.status !== 2 && onlineDuration >= viewingMinutes * 60)) {
54
- return `已达标,您已观看${this.formatTime(viewingMinutes * 60 * 1000)}`;
55
- } else if (item.status !== 2 && item.remaining_quota > 0) {
56
- const remain = Math.max(0, viewingMinutes * 60 - onlineDuration);
57
- return `继续观看 ${this.formatTime(remain * 1000)} 可领取`;
58
- }
59
- return '';
60
- },
61
-
62
- handleClaim: debounce(function (e) {
63
- const item = this.data._list[e.currentTarget.dataset.index];
64
- if (!item) return;
65
- this.triggerEvent('claim', item, {
66
- bubbles: true,
67
- composed: true,
68
- });
69
- }, 300),
70
-
71
- handleToWatch() {
72
- this.triggerEvent('close', this.properties.info, {
73
- bubbles: true,
74
- composed: true,
75
- });
76
- },
77
- onClose() {
78
- this.triggerEvent('close', this.properties.info, {
79
- bubbles: true,
80
- composed: true,
81
- });
82
- },
83
- },
84
- });
@@ -1,4 +0,0 @@
1
- {
2
- "component": true,
3
- "styleIsolation": "shared"
4
- }
@@ -1,38 +0,0 @@
1
- <!-- 半屏面板 -->
2
- <view class="mall-reward-history">
3
- <view class="mall-reward-history-head">
4
- <text class="main-title">直播福利</text>
5
- <view class="head-close" bindtap="onClose">✕</view>
6
- </view>
7
- <scroll-view class="mall-reward-history-body" scroll-y enhanced show-scrollbar="{{false}}">
8
- <view class="data-list" wx:if="{{_list.length > 0}}">
9
- <view wx:for="{{_list}}" wx:key="id" class="data-list-item">
10
- <view class="data-list-item__bd">
11
- <view class="item-title">{{ item.title }}</view>
12
- <view class="item-description">{{item._desc}}</view>
13
- </view>
14
- <view class="data-list-item__ft">
15
- <!-- 已领取 -->
16
- <view wx:if="{{item.claim_status == 1}}" class="status-box status-box--claimed">已领取</view>
17
- <view wx:elif="{{item.status == 2 && item.claim_status == 0}}" class="status-box">
18
- 已结束
19
- </view>
20
- <view wx:elif="{{item.claim_status == 0 && item.remaining_quota === 0}}" class="status-box">
21
- 已领光
22
- </view>
23
- <button wx:elif="{{item.claim_status == 0 && item.remaining_quota > 0 && ((item.viewing_minutes > 0 && onlineDuration >= item.viewing_minutes * 60) || item.viewing_minutes == 0)}}" class="weui-btn btn-reward" type="primary" size="mini" data-index="{{index}}" bindtap="handleClaim">
24
- 我要领取
25
- </button>
26
- <button wx:elif="{{item.claim_status == 0 && item.remaining_quota > 0 && item.viewing_minutes > 0 && onlineDuration < item.viewing_minutes * 60}}" class="weui-btn btn-reward" type="primary" size="mini" bindtap="handleToWatch">
27
- 去观看
28
- </button>
29
- </view>
30
- </view>
31
- </view>
32
- <!-- 空态 -->
33
- <view class="empty-data" wx:else>
34
- <image class="empty-img" src="https://cnstatic01.e.vhall.com/common-static/images/mp/sofa.png" mode="aspectFit" />
35
- <view class="empty-text">暂无福利记录</view>
36
- </view>
37
- </scroll-view>
38
- </view>
@@ -1 +0,0 @@
1
- .mall-reward-history{background:linear-gradient(#ffebd9,#fcf1e7);border-top-left-radius:24rpx;border-top-right-radius:24rpx;box-sizing:border-box;display:flex;flex-direction:column;height:736rpx}.mall-reward-history .mall-reward-history-head{box-sizing:border-box;padding:22rpx 0;position:relative;text-align:center}.mall-reward-history .mall-reward-history-head .main-title{font-size:1.14rem;font-weight:700}.mall-reward-history .mall-reward-history-head .head-close{align-items:center;border-radius:50%;color:#999;display:flex;font-size:1.14rem;height:48rpx;justify-content:center;position:absolute;right:32rpx;top:50%;transform:translateY(-50%);width:48rpx}.mall-reward-history .mall-reward-history-body{box-sizing:border-box;height:650rpx;padding:0 24rpx}.mall-reward-history .mall-reward-history-body .data-list{background-color:#fff;border-top-left-radius:24rpx;border-top-right-radius:24rpx;box-sizing:border-box;min-height:100%;width:100%}.mall-reward-history .mall-reward-history-body .data-list-item{align-items:center;border-bottom:1px solid #fcf1e7;box-sizing:border-box;display:flex;padding:24rpx 32rpx;width:100%}.mall-reward-history .mall-reward-history-body .data-list-item__bd{box-sizing:border-box;flex:1;overflow:hidden;text-align:left}.mall-reward-history .mall-reward-history-body .data-list-item__bd .item-title{color:#262626;font-size:1.07rem;font-weight:500;line-height:1.5rem;margin-bottom:4rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:462rpx}.mall-reward-history .mall-reward-history-body .data-list-item__bd .item-description{color:#8c8c8c;font-size:.86rem;line-height:1.14rem}.mall-reward-history .mall-reward-history-body .data-list-item__ft{box-sizing:border-box}.mall-reward-history .mall-reward-history-body .data-list-item__ft .status-box{align-items:center;background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/seal_bg.png);background-size:100% 100%;color:rgba(0,0,0,.25);display:flex;font-size:.71rem;height:100rpx;justify-content:center;margin-right:20rpx;transform:rotate(25deg);width:100rpx}.mall-reward-history .mall-reward-history-body .data-list-item__ft .status-box--claimed{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/received_icon.png);color:#55d483}.mall-reward-history .mall-reward-history-body .data-list-item__ft .btn-reward{font-size:1rem}
@@ -1,36 +0,0 @@
1
- Component({
2
- properties: {
3
- info: { type: Object, value: null },
4
- tipMode: { type: Number, value: 1 },
5
- isBubble: { type: Boolean, value: false }, //气泡模式
6
- },
7
-
8
- data: {
9
- _title: '',
10
- _desc: '',
11
- },
12
-
13
- observers: {
14
- info: function (info) {
15
- this.setData({
16
- _title: info?.tip_setting?.title || info?.title || '',
17
- _desc: info?.tip_setting?.description || '',
18
- });
19
- },
20
- },
21
-
22
- methods: {
23
- onClaimNow() {
24
- this.triggerEvent('claim', this.properties.info, {
25
- bubbles: true,
26
- composed: true,
27
- });
28
- },
29
- onClose() {
30
- this.triggerEvent('close', this.properties.info, {
31
- bubbles: true,
32
- composed: true,
33
- });
34
- },
35
- },
36
- });
@@ -1,3 +0,0 @@
1
- {
2
- "component": true
3
- }
@@ -1,10 +0,0 @@
1
- <view class="mall-reward-open {{ isBubble?'is-bubble':'is-full' }} mode-{{tipMode}}">
2
- <!-- 自定义内容 -->
3
- <view class="custom-content">
4
- <view class="main-title">{{_title}}</view>
5
- <button class="weui-btn btn-main" bindtap="onClaimNow">立即领取</button>
6
- <view class="tip-description" wx:if="{{!isBubble}}">{{_desc}}</view>
7
- <!-- 气泡模式才有的关闭按钮 -->
8
- <view wx:if="{{isBubble}}" class="close-btn-for-bubble" bindtap="onClose">✕</view>
9
- </view>
10
- </view>
@@ -1 +0,0 @@
1
- .mall-reward-open{background-color:initial;background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_1.png);background-repeat:no-repeat;background-size:contain;position:relative}.mall-reward-open .custom-content{bottom:0;left:0;position:absolute;right:0;top:0;z-index:9}.mall-reward-open .main-title{align-items:center;color:#fff9e6;display:flex;font-weight:600;justify-content:center;overflow:hidden;position:relative;text-align:center}.mall-reward-open.mode-1{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_1.png)}.mall-reward-open.mode-2{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_2.png)}.mall-reward-open.mode-3{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_3.png)}.mall-reward-open.is-full{height:750rpx;width:750rpx}.mall-reward-open.is-full .main-title{font-size:1.93rem;height:128rpx;line-height:2.29rem;margin:0 160rpx}.mall-reward-open.is-full .btn-main{background:linear-gradient(#fff7ec,#fdd8ac);border-radius:44px;color:#fb2626;height:80rpx;left:50%;position:absolute;transform:translateX(-50%);width:320rpx;z-index:10}.mall-reward-open.is-full .tip-description{align-items:center;color:rgba(255,249,230,.8);display:flex;font-size:.79rem;height:60rpx;justify-content:center;left:50%;line-height:1.07rem;overflow:hidden;position:absolute;transform:translateX(-50%);width:380rpx}.mall-reward-open.is-full.mode-1 .main-title{top:380rpx}.mall-reward-open.is-full.mode-1 .btn-main{top:550rpx}.mall-reward-open.is-full.mode-1 .tip-description{top:640rpx}.mall-reward-open.is-full.mode-2 .main-title{top:380rpx}.mall-reward-open.is-full.mode-2 .btn-main{top:540rpx}.mall-reward-open.is-full.mode-2 .tip-description{top:630rpx}.mall-reward-open.is-full.mode-3 .main-title{color:#fb2626;top:270rpx}.mall-reward-open.is-full.mode-3 .btn-main{top:540rpx}.mall-reward-open.is-full.mode-3 .tip-description{top:624rpx}.mall-reward-open.is-bubble{height:368rpx;margin-bottom:150rpx;width:368rpx}.mall-reward-open.is-bubble .close-btn-for-bubble{align-items:center;background-color:rgba(0,0,0,.25);border-radius:50%;box-shadow:0 2rpx 8rpx rgba(0,0,0,.15);color:#fff;display:flex;flex-direction:column;font-size:1.14rem;height:48rpx;justify-content:center;position:absolute;right:24rpx;top:12rpx;width:48rpx}.mall-reward-open.is-bubble .main-title{font-size:1.14rem;height:80rpx;line-height:1.43rem;margin:0 100rpx}.mall-reward-open.is-bubble .btn-main{background:linear-gradient(#fff7ec,#fdd8ac);border:1px solid #fdd8ac;border-radius:44px;color:#fb2626;font-size:14px;left:50%;padding:4rpx 22rpx;position:absolute;transform:translateX(-50%);width:auto;z-index:10}.mall-reward-open.is-bubble.mode-1 .main-title{top:180rpx}.mall-reward-open.is-bubble.mode-1 .btn-main{bottom:40rpx;top:auto}.mall-reward-open.is-bubble.mode-2 .main-title{top:180rpx}.mall-reward-open.is-bubble.mode-2 .btn-main{bottom:50rpx;top:auto}.mall-reward-open.is-bubble.mode-3 .main-title{color:#fb2626;top:120rpx}.mall-reward-open.is-bubble.mode-3 .btn-main{bottom:40rpx;top:auto}
@@ -1,36 +0,0 @@
1
- Component({
2
- properties: {
3
- info: {
4
- type: Object,
5
- value: {},
6
- },
7
- tipMode: {
8
- type: Number,
9
- value: 1,
10
- },
11
- },
12
-
13
- data: {
14
- _title: '',
15
- _desc: '',
16
- },
17
-
18
- observers: {
19
- info: function (info) {
20
- console.log('info123', info);
21
- this.setData({
22
- _title: info?.tip_setting?.title || info?.title || '',
23
- _desc: info?.tip_setting?.description || '',
24
- });
25
- },
26
- },
27
-
28
- methods: {
29
- onRecive() {
30
- this.triggerEvent('close', this.properties.info, {
31
- bubbles: true,
32
- composed: true,
33
- });
34
- },
35
- },
36
- });
@@ -1,3 +0,0 @@
1
- {
2
- "component": true
3
- }
@@ -1,9 +0,0 @@
1
- <view class="mall-reward-receive mode-{{tipMode}}">
2
- <view class="colorful-title"></view>
3
- <!-- 自定义内容 -->
4
- <view class="custom-content">
5
- <view class="main-title">{{_title}}</view>
6
- <button class="weui-btn btn-main" bindtap="onRecive">开心收下</button>
7
- <view class="tip-description">{{_desc}}</view>
8
- </view>
9
- </view>
@@ -1 +0,0 @@
1
- .mall-reward-receive{background-color:initial;background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_1.png);background-repeat:no-repeat;background-size:contain;height:750rpx;position:relative;width:750rpx}.mall-reward-receive .colorful-title{background-color:initial;background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/colorful_title.png);background-repeat:no-repeat;background-size:100% 100%;height:56rpx;left:50%;margin-left:-180rpx;position:absolute;top:24rpx;width:380rpx}.mall-reward-receive .custom-content{bottom:0;left:0;position:absolute;right:0;top:0;z-index:9}.mall-reward-receive .main-title{align-items:center;color:#fff9e6;display:flex;font-size:1.93rem;font-weight:600;height:128rpx;justify-content:center;line-height:2.29rem;margin:0 160rpx;overflow:hidden;position:relative;text-align:center}.mall-reward-receive .btn-main{background:linear-gradient(#fff7ec,#fdd8ac);border-radius:44px;color:#fb2626;height:80rpx;left:50%;position:absolute;transform:translateX(-50%);width:320rpx;z-index:10}.mall-reward-receive .tip-description{align-items:center;color:rgba(255,249,230,.8);display:flex;font-size:.79rem;height:60rpx;justify-content:center;left:50%;line-height:1.07rem;overflow:hidden;position:absolute;transform:translateX(-50%);width:380rpx}.mall-reward-receive.mode-1{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_1.png)}.mall-reward-receive.mode-2{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_2.png)}.mall-reward-receive.mode-3{background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/mr_bg_3.png)}.mall-reward-receive.mode-1 .main-title{top:380rpx}.mall-reward-receive.mode-1 .btn-main{top:560rpx}.mall-reward-receive.mode-1 .tip-description{top:640rpx}.mall-reward-receive.mode-1 .colorful-title{top:24rpx}.mall-reward-receive.mode-2 .main-title{top:370rpx}.mall-reward-receive.mode-2 .btn-main{top:550rpx}.mall-reward-receive.mode-2 .tip-description{top:630rpx}.mall-reward-receive.mode-3 .colorful-title{top:0}.mall-reward-receive.mode-3 .main-title{color:#fb2626;top:260rpx}.mall-reward-receive.mode-3 .btn-main{top:550rpx}.mall-reward-receive.mode-3 .tip-description{top:630rpx}