vhall-mini-sdk 0.1.1 → 0.2.0

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 (33) hide show
  1. package/README.md +10 -10
  2. package/lib/components/chat/chat-edit/chat-edit.js +7 -4
  3. package/lib/components/chat/chat-list/chat-list.js +1 -1
  4. package/lib/components/live-landscape/live-landscape.js +11 -7
  5. package/lib/components/live-landscape/live-landscape.wxml +2 -2
  6. package/lib/components/live-portrait/live-portrait.js +15 -7
  7. package/lib/components/live-portrait/live-portrait.wxml +3 -3
  8. package/lib/components/live-portrait/live-portrait.wxss +1 -1
  9. package/lib/components/lottery/lottery.wxml +2 -2
  10. package/lib/components/mall-reward/index.js +1 -0
  11. package/lib/components/player/extensions/observers.js +5 -5
  12. package/lib/components/player/player.js +5 -0
  13. package/lib/components/player/player.wxml +3 -3
  14. package/lib/components/product/product-card/product-card.js +1 -0
  15. package/lib/components/product/product-card/product-card.wxss +1 -1
  16. package/lib/components/product/product-list/product-list.js +1 -0
  17. package/lib/components/product/product-list/product-list.wxml +3 -11
  18. package/lib/components/signin/signin-dialog.js +1 -0
  19. package/lib/pubComponents/error-page/index.js +2 -20
  20. package/lib/sdk/config/index.js +1 -1
  21. package/lib/sdk/main/index.js +2 -2
  22. package/lib/sdk/player/index.js +1 -1
  23. package/lib/sdk/plugins/ChatServer.js +1 -1
  24. package/lib/sdk/plugins/CustomMenuServer.js +1 -1
  25. package/lib/sdk/plugins/InteractServer.js +1 -1
  26. package/lib/sdk/plugins/InviteCardServer.js +1 -1
  27. package/lib/sdk/plugins/LotteryServer.js +1 -1
  28. package/lib/sdk/plugins/MallRewardServer.js +1 -1
  29. package/lib/sdk/plugins/ProductServer.js +1 -1
  30. package/lib/shared/RequestUtil.js +1 -1
  31. package/lib/shared/logger.js +1 -1
  32. package/lib/shared/mpUtils.js +1 -1
  33. package/package.json +16 -6
package/README.md CHANGED
@@ -29,22 +29,22 @@ uni-app工程安装完成后,会在当前工程目录下自动生成 wxcompone
29
29
  (1) 原生微信小程序开发
30
30
 
31
31
  ```js
32
- const VhallMiniSdk = require('vhall-mini-sdk/sdk/main/index.js').default;
33
- const CustomMenuServer = require('vhall-mini-sdk/sdk/plugins/CustomMenuServer.js').default;
34
- const ChatServer = require('vhall-mini-sdk/sdk/plugins/ChatServer.js').default;
35
- const ProductServer = require('vhall-mini-sdk/sdk/plugins/ProductServer.js').default;
36
- const InteractServer = require('vhall-mini-sdk/sdk/plugins/InteractServer.js').default;
32
+ const VhallMiniSdk = require('vhall-mini-sdk/sdk/main/index.js');
33
+ const CustomMenuServer = require('vhall-mini-sdk/sdk/plugins/CustomMenuServer.js');
34
+ const ChatServer = require('vhall-mini-sdk/sdk/plugins/ChatServer.js');
35
+ const ProductServer = require('vhall-mini-sdk/sdk/plugins/ProductServer.js');
36
+ const InteractServer = require('vhall-mini-sdk/sdk/plugins/InteractServer.js');
37
37
  ```
38
38
 
39
39
  (2) uni-app小程序开发
40
40
 
41
41
  ```js
42
42
  import { ref, onMounted } from 'vue';
43
- const VhallMiniSdk = require('../../wxcomponents/vhall-mini-sdk/sdk/main/index.js').default;
44
- const CustomMenuServer = require('../../wxcomponents/vhall-mini-sdk/sdk/plugins/CustomMenuServer.js').default;
45
- const ChatServer = require('../../wxcomponents/vhall-mini-sdk/sdk/plugins/ChatServer.js').default;
46
- const ProductServer = require('../../wxcomponents/vhall-mini-sdk/sdk/plugins/ProductServer.js').default;
47
- const InteractServer = require('../../wxcomponents/vhall-mini-sdk/sdk/plugins/InteractServer.js').default;
43
+ const VhallMiniSdk = require('../../wxcomponents/vhall-mini-sdk/sdk/main/index.js');
44
+ const CustomMenuServer = require('../../wxcomponents/vhall-mini-sdk/sdk/plugins/CustomMenuServer.js');
45
+ const ChatServer = require('../../wxcomponents/vhall-mini-sdk/sdk/plugins/ChatServer.js');
46
+ const ProductServer = require('../../wxcomponents/vhall-mini-sdk/sdk/plugins/ProductServer.js');
47
+ const InteractServer = require('../../wxcomponents/vhall-mini-sdk/sdk/plugins/InteractServer.js');
48
48
  ```
49
49
 
50
50
  4. 更多接入支持,参考文档: https://vhall.apifox.cn/dev/sdk/wmp/quick-start
@@ -62,19 +62,22 @@ Component({
62
62
  })
63
63
  },
64
64
  'permissions': (val) => {
65
- const status = _sdkInstance.store.get('liveInfo.status');
66
- // 4 点播 5 回放 && 开启了回放禁言
65
+ const status = _sdkInstance.store.get('webinarStatus');
67
66
  if ((status == 4 || status == 5) && val['ui.watch_record_no_chatting'] == 1) {
68
67
  this.setData({
69
68
  isAllBanned: true,
70
69
  });
71
70
  }
72
71
  },
73
- 'liveInfo.status': (status) => {
74
- if (status == 3) {
72
+ webinarStatus: (status) => {
73
+ if (status == 3 || status == 5 && _sdkInstance.store.get('permissions')['ui.watch_record_no_chatting'] == 1) {
75
74
  this.setData({
76
75
  isAllBanned: true,
77
76
  });
77
+ } else {
78
+ this.setData({
79
+ isAllBanned: _sdkInstance.store.get('interactToolStatus.all_banned'),
80
+ });
78
81
  }
79
82
  },
80
83
  });
@@ -88,7 +88,7 @@ Component({
88
88
  this._handleMsg(message);
89
89
  };
90
90
  eventObj[this.sdkInstance.EVENT.DELETE_MSG] = (message) => {
91
- const msgIds = message.msg_ids.split(',');
91
+ const msgIds = message.msg_ids.split(',');
92
92
  LastMsgList = LastMsgList.filter((item) => !msgIds.includes(item.msg_id));
93
93
  this.setData({
94
94
  chatList: this.data.chatList.filter((item) => !msgIds.includes(item.msg_id)),
@@ -31,6 +31,11 @@ Component({
31
31
  liveInfo: val,
32
32
  });
33
33
  },
34
+ webinarStatus: (val) => {
35
+ this.setData({
36
+ webinarStatus: val,
37
+ });
38
+ },
34
39
  customMenu: (_customMenu) => {
35
40
  if (_customMenu) {
36
41
  this.handleCustomMenu(_customMenu);
@@ -75,9 +80,8 @@ Component({
75
80
  tabList.push({ id: tabItem.id, name: tabItem.name, type: tabItem.type })
76
81
  }
77
82
  } else if (tabItem.type == 3) {
78
- // 聊天 ( 预约页 和 结束 不展示聊天)
79
- const liveInfo = this.sdkInstance.store.get('liveInfo');
80
- if (tabItem.status == 1 && (liveInfo.status !== 2 && liveInfo.status !== 3)) {
83
+ const webinarStatus = this.sdkInstance.store.get('webinarStatus');
84
+ if (tabItem.status == 1 && (webinarStatus !== 2 && webinarStatus !== 3)) {
81
85
  tabList.push({ id: tabItem.id, name: tabItem.name, type: tabItem.type })
82
86
  }
83
87
  } else if (tabItem.type === 1) {
@@ -106,10 +110,10 @@ Component({
106
110
  status: tabItem.status, // status 1显示,2隐藏,3预告结束隐藏,4预告结束显示
107
111
  cid: menuDetail.components[0].component_id,
108
112
  };
109
- const liveInfo = this.sdkInstance.store.get('liveInfo');
110
- if (liveInfo?.status && inviteRankMenu.id) {
113
+ const webinarStatus = this.sdkInstance.store.get('webinarStatus');
114
+ if (webinarStatus && inviteRankMenu.id) {
111
115
  // 预告页和结束页不展示
112
- if (liveInfo.status === 2 && inviteRankMenu.status === 3) return;
116
+ if (webinarStatus === 2 && inviteRankMenu.status === 3) return;
113
117
  const idx = tabList.findIndex((item) => item.id === inviteRankMenu.id);
114
118
  if (idx == -1) {
115
119
  tabList.push(inviteRankMenu)
@@ -140,7 +144,7 @@ Component({
140
144
  };
141
145
  obj[this.sdkInstance.EVENT.LIVE_END] = () => {
142
146
  this.sdkInstance.leaveRoom(true);
143
- this.sdkInstance.store.set('liveInfo.status', 3);
147
+ this.sdkInstance.store.set('webinarStatus', 3);
144
148
  };
145
149
  obj[this.sdkInstance.EVENT.KICKOUT] = () => {};
146
150
  obj[this.sdkInstance.EVENT.RECORD_WATCH_EXPIRE_ALERT] = () => {
@@ -2,7 +2,7 @@
2
2
  <view class="live_landscape_player">
3
3
  <vhall-player sdkInstance="{{sdkInstance}}"></vhall-player>
4
4
  </view>
5
- <start-countdown sdkInstance="{{sdkInstance}}" wx:if="{{liveInfo.status==2}}"></start-countdown>
5
+ <start-countdown sdkInstance="{{sdkInstance}}" wx:if="{{webinarStatus==2}}"></start-countdown>
6
6
  <vhall-tabs class="live-landscape-tab" tab-class="tab-action" swiper-class="menu-swiper" wx:if="{{tabList.length > 0}}" tabs="{{tabList}}" activeTab="{{activeTab}}" bindtabclick="onTabClick" bindchange="onTabChange">
7
7
  <block wx:for="{{tabList}}" wx:key="id">
8
8
  <view class="tab-content" data-set="{{item}}" slot="tab-content-{{index}}-{{id}}" wx:if="{{activeTab==index}}">
@@ -23,7 +23,7 @@
23
23
  <!-- 我的邀请明细 -->
24
24
  <my-invite-detail sdkInstance="{{sdkInstance}}"></my-invite-detail>
25
25
  <!-- 直播开始提示弹框(居中展示) -->
26
- <vh-popup wx:if="{{liveInfo.status==2||liveInfo.status==3}}" visible="{{showStartDialog}}" showClose="{{false}}">
26
+ <vh-popup wx:if="{{webinarStatus==2||webinarStatus==3}}" visible="{{showStartDialog}}" showClose="{{false}}">
27
27
  <view class="start-dialog dialog-content">
28
28
  <view class="dialog-image">
29
29
  <image class="image-item start_live_img" src="https://cnstatic01.e.vhall.com/common-static/images/mp/live_start.png" mode="widthFix" alt="开始直播"></image>
@@ -42,6 +42,11 @@ Component({
42
42
  liveInfo: val,
43
43
  });
44
44
  },
45
+ webinarStatus: (val) => {
46
+ this.setData({
47
+ webinarStatus: val,
48
+ });
49
+ },
45
50
  customMenu: (_customMenu) => {
46
51
  if (_customMenu) {
47
52
  this.handleCustomMenu(_customMenu);
@@ -105,9 +110,8 @@ Component({
105
110
  }
106
111
  }
107
112
  } else if (tabItem.type == 3) {
108
- // 聊天 ( 预约页 和 结束 不展示聊天), 竖屏模式聊天不在tab中而是在外面展示
109
- const liveInfo = this.sdkInstance.store.get('liveInfo');
110
- if (tabItem.status == 1 && (liveInfo.status !== 2 && liveInfo.status !== 3)) {
113
+ const webinarStatus = this.sdkInstance.store.get('webinarStatus');
114
+ if (tabItem.status == 1 && (webinarStatus !== 2 && webinarStatus !== 3)) {
111
115
  this.setData({ showChat: true })
112
116
  } else {
113
117
  this.setData({ showChat: false })
@@ -130,10 +134,10 @@ Component({
130
134
  status: tabItem.status, // status 1显示,2隐藏,3预告结束隐藏,4预告结束显示
131
135
  cid: menuDetail.components[0].component_id,
132
136
  };
133
- const liveInfo = this.sdkInstance.store.get('liveInfo');
134
- if (liveInfo?.status && inviteRankMenu.id) {
137
+ const webinarStatus = this.sdkInstance.store.get('webinarStatus');
138
+ if (webinarStatus && inviteRankMenu.id) {
135
139
  // 预告页和结束页不展示
136
- if (liveInfo.status === 2 && inviteRankMenu.status === 3) return;
140
+ if (webinarStatus === 2 && inviteRankMenu.status === 3) return;
137
141
  const idx = tabList.findIndex((item) => item.id === inviteRankMenu.id);
138
142
  if (idx == -1) {
139
143
  tabList.push(inviteRankMenu)
@@ -169,7 +173,7 @@ Component({
169
173
  };
170
174
  obj[this.sdkInstance.EVENT.LIVE_END] = () => {
171
175
  this.sdkInstance.leaveRoom(true);
172
- this.sdkInstance.store.set('liveInfo.status', 3);
176
+ this.sdkInstance.store.set('webinarStatus', 3);
173
177
  };
174
178
  obj[this.sdkInstance.EVENT.KICKOUT] = () => {};
175
179
  obj[this.sdkInstance.EVENT.RECORD_WATCH_EXPIRE_ALERT] = () => {
@@ -198,6 +202,10 @@ Component({
198
202
 
199
203
  // 点击小黄车,显示商品列表弹窗
200
204
  showProductList() {
205
+ const productServer = this.sdkInstance.get('productServer');
206
+ if (productServer) {
207
+ productServer.getProductList();
208
+ }
201
209
  this.setData({
202
210
  showProductList: true
203
211
  });
@@ -2,11 +2,11 @@
2
2
  <view class="live_portrait_player">
3
3
  <vhall-player sdkInstance="{{sdkInstance}}" objectFit="{{playerObjectFit}}"></vhall-player>
4
4
  </view>
5
- <view class="count_down_cover" wx:if="{{liveInfo.status==2}}">
5
+ <view class="count_down_cover" wx:if="{{webinarStatus==2}}">
6
6
  <start-countdown class="count_down" sdkInstance="{{sdkInstance}}"></start-countdown>
7
7
  </view>
8
8
  <!-- 聊天及其它菜单展示处理 -->
9
- <vhall-chat class="live_portrait_chat {{liveInfo.status==5?'live_back':''}}" wx:if="{{showChat}}" mode="{{0}}" bind:commentCheck="commentCheck" sdkInstance="{{sdkInstance}}">
9
+ <vhall-chat class="live_portrait_chat {{webinarStatus==5?'live_back':''}}" wx:if="{{showChat}}" mode="{{0}}" bind:commentCheck="commentCheck" sdkInstance="{{sdkInstance}}">
10
10
  <view class="gift-button" wx:if="{{giftAuth}}" bindtap="showGiftList">
11
11
  <image class="gift-icon" src="https://cnstatic01.e.vhall.com/common-static/saas-wap/static/img/icon_gift.020803f8.png" mode="aspectFit"></image>
12
12
  </view>
@@ -46,7 +46,7 @@
46
46
  <!-- 我的邀请明细 -->
47
47
  <my-invite-detail sdkInstance="{{sdkInstance}}"></my-invite-detail>
48
48
  <!-- 直播开始提示弹框 -->
49
- <vh-popup wx:if="{{liveInfo.status==2||liveInfo.status==3}}" visible="{{showStartDialog}}" showClose="{{false}}">
49
+ <vh-popup wx:if="{{webinarStatus==2||webinarStatus==3}}" visible="{{showStartDialog}}" showClose="{{false}}">
50
50
  <view class="start-dialog dialog-content">
51
51
  <view class="dialog-image">
52
52
  <image src="https://cnstatic01.e.vhall.com/common-static/images/mp/live_start.png" mode="widthFix" class="start_live_img" alt="开始直播"></image>
@@ -1 +1 @@
1
- .live_portrait{display:flex;flex-direction:column;height:100%}.live_portrait .live_portrait_player{display:block;height:100%;width:100vw;z-index:0}.live_portrait .live_portrait_chat{bottom:0;height:32vh;left:0;position:absolute;right:0;z-index:100}.live_portrait .live_portrait_chat.live_back{bottom:80rpx}.live_portrait .live_portrait_chat.live_back .chat-edit{padding-bottom:0}.live_portrait .nochat-bar{bottom:constant(safe-area-inset-bottom);bottom:env(safe-area-inset-bottom);display:flex;flex-direction:row;height:32px;padding-bottom:10px;padding-right:16px;position:absolute;right:0;z-index:100}.live_portrait .live-portrait-tab{box-sizing:border-box;display:flex;flex:1;height:calc(100vh - 56.25vw);padding-bottom:env(safe-area-inset-bottom);width:100vw}.live_portrait .live-portrait-tab .tab-action{color:#fff!important}.live_portrait .live-portrait-tab .tab-content{height:100%;overflow:auto;width:100%}.live_portrait .live-portrait-tab .tab-chat{display:block;height:100%;width:100%}.live_portrait .live-portrait-tab .tab-introduction{display:block;padding:20rpx}.live_portrait .count_down{color:#fff;height:100vh;left:0;margin-top:-52rpx;position:fixed;top:0;top:50%;width:100vw;z-index:100}.live_portrait .menu_icon{align-items:center;background-color:rgba(0,0,0,.14);border-radius:50%;display:flex;height:2rem;justify-content:center;margin-right:16rpx;width:2rem}.live_portrait .menu_icon .menu_icon_image{height:100%;width:100%}.live_portrait .start_live_img{margin-bottom:20rpx;width:150rpx}.live_portrait .gift-display{left:0;position:fixed;top:60vh}.menu-dialog{box-sizing:border-box;height:70%;padding:20rpx}.menu-dialog .weui-half-screen-dialog__ft,.menu-dialog .weui-half-screen-dialog__hd{display:none}.menu-dialog .content-box{display:flex;height:100%}.menu-dialog .content-box .live-protrait-tab{flex:1}.menu-dialog .content-box .live-protrait-tab .tab-content{box-sizing:border-box;height:100%;overflow:auto}.count_down_cover{background-color:rgba(0,0,0,.5);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:100}.start-dialog{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding-top:24rpx;width:520rpx}.start-dialog .light-button{border:none;color:#fb2626}.start-dialog .start-dialog-footer{margin-top:24rpx}.weui-dialog__btn{color:#fb2626!important}.dialog-content--expire{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding-top:24rpx;width:520rpx}.dialog-content--expire .dialog-image{margin-bottom:24rpx}.dialog-content--expire .dialog-image .image-item{width:200rpx}.dialog-content--expire .dialog-footer{margin-top:36rpx}.gift-button{align-items:center;background:rgba(6,6,6,.25);border-radius:50%;display:flex;justify-content:center;margin-right:16rpx;position:relative}.cart-button,.gift-button,.gift-icon{height:2rem;width:2rem}.cart-button{align-items:center;background:rgba(6,6,6,.25);border-radius:50%;display:flex;justify-content:center;margin-right:16rpx;position:relative}.cart-button .cart-icon{height:2rem;margin-top:-.8rem;width:2rem}.cart-button .cart-badge{align-items:center;background-color:#ff4757;border-radius:16rpx;color:#fff;display:flex;font-size:.79rem;font-weight:700;height:32rpx;justify-content:center;min-width:32rpx;padding:0 8rpx;position:absolute;right:-8rpx;top:-8rpx}.product-list-popup{display:flex;flex-direction:column;max-height:70vh;width:100%}.product-list-popup .popup-header{align-items:center;border-bottom:1rpx solid #f0f0f0;display:flex;justify-content:space-between;padding:24rpx 32rpx}.product-list-popup .popup-header .popup-title{color:#333;font-size:1.14rem;font-weight:700}.product-list-popup .popup-header .popup-count{color:#999;font-size:.93rem}.product-list-popup .product-scroll{flex:1;max-height:calc(70vh - 80rpx)}
1
+ .live_portrait{display:flex;flex-direction:column;height:100%;overflow:hidden}.live_portrait .live_portrait_player{display:block;height:100%;width:100vw;z-index:0}.live_portrait .live_portrait_chat{bottom:0;height:32vh;left:0;position:absolute;right:0;z-index:100}.live_portrait .live_portrait_chat.live_back{bottom:80rpx}.live_portrait .live_portrait_chat.live_back .chat-edit{padding-bottom:0}.live_portrait .nochat-bar{bottom:constant(safe-area-inset-bottom);bottom:env(safe-area-inset-bottom);display:flex;flex-direction:row;height:32px;padding-bottom:10px;padding-right:16px;position:absolute;right:0;z-index:100}.live_portrait .live-portrait-tab{box-sizing:border-box;display:flex;flex:1;height:calc(100vh - 56.25vw);padding-bottom:env(safe-area-inset-bottom);width:100vw}.live_portrait .live-portrait-tab .tab-action{color:#fff!important}.live_portrait .live-portrait-tab .tab-content{height:100%;overflow:auto;width:100%}.live_portrait .live-portrait-tab .tab-chat{display:block;height:100%;width:100%}.live_portrait .live-portrait-tab .tab-introduction{display:block;padding:20rpx}.live_portrait .count_down{color:#fff;height:100vh;left:0;margin-top:-52rpx;position:fixed;top:0;top:50%;width:100vw;z-index:100}.live_portrait .menu_icon{align-items:center;background-color:rgba(0,0,0,.14);border-radius:50%;display:flex;height:2rem;justify-content:center;margin-right:16rpx;width:2rem}.live_portrait .menu_icon .menu_icon_image{height:100%;width:100%}.live_portrait .start_live_img{margin-bottom:20rpx;width:150rpx}.live_portrait .gift-display{left:0;position:fixed;top:60vh}.menu-dialog{box-sizing:border-box;height:70%;padding:20rpx}.menu-dialog .weui-half-screen-dialog__ft,.menu-dialog .weui-half-screen-dialog__hd{display:none}.menu-dialog .content-box{display:flex;height:100%}.menu-dialog .content-box .live-protrait-tab{flex:1}.menu-dialog .content-box .live-protrait-tab .tab-content{box-sizing:border-box;height:100%;overflow:auto}.count_down_cover{background-color:rgba(0,0,0,.5);height:100vh;left:0;position:fixed;top:0;width:100vw;z-index:100}.start-dialog{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding-top:24rpx;width:520rpx}.start-dialog .light-button{border:none;color:#fb2626}.start-dialog .start-dialog-footer{margin-top:24rpx}.weui-dialog__btn{color:#fb2626!important}.dialog-content--expire{align-items:center;box-sizing:border-box;display:flex;flex-direction:column;justify-content:center;padding-top:24rpx;width:520rpx}.dialog-content--expire .dialog-image{margin-bottom:24rpx}.dialog-content--expire .dialog-image .image-item{width:200rpx}.dialog-content--expire .dialog-footer{margin-top:36rpx}.gift-button{align-items:center;background:rgba(6,6,6,.25);border-radius:50%;display:flex;justify-content:center;margin-right:16rpx;position:relative}.cart-button,.gift-button,.gift-icon{height:2rem;width:2rem}.cart-button{align-items:center;background:rgba(6,6,6,.25);border-radius:50%;display:flex;justify-content:center;margin-right:16rpx;position:relative}.cart-button .cart-icon{height:2rem;margin-top:-.8rem;width:2rem}.cart-button .cart-badge{align-items:center;background-color:#ff4757;border-radius:16rpx;color:#fff;display:flex;font-size:.79rem;font-weight:700;height:32rpx;justify-content:center;min-width:32rpx;padding:0 8rpx;position:absolute;right:-8rpx;top:-8rpx}.product-list-popup{display:flex;flex-direction:column;max-height:70vh;width:100%}.product-list-popup .popup-header{align-items:center;border-bottom:1rpx solid #f0f0f0;display:flex;justify-content:space-between;padding:24rpx 32rpx}.product-list-popup .popup-header .popup-title{color:#333;font-size:1.14rem;font-weight:700}.product-list-popup .popup-header .popup-count{color:#999;font-size:.93rem}.product-list-popup .product-scroll{flex:1;max-height:calc(70vh - 80rpx)}
@@ -53,7 +53,7 @@
53
53
  <view wx:if="{{showHistoryBadge}}" class="history-badge"></view>
54
54
  </view>
55
55
  <!-- 领奖弹框组件 -->
56
- <lottery-accept visible="{{showReceiveModal}}" lotteryId="{{currentLottery && (currentLottery.lottery_id || currentLottery.id)}}" sdkInstance="{{sdkInstance}}" publishWinner="{{currentLottery && currentLottery.publish_winner}}" bind:close="onReceiveModalClose" bind:success="onReceiveSuccess" bind:viewWinners="viewWinnersList"></lottery-accept>
56
+ <lottery-accept visible="{{showReceiveModal}}" lotteryId="{{currentLottery ? (currentLottery.lottery_id || currentLottery.id) : ''}}" sdkInstance="{{sdkInstance}}" publishWinner="{{currentLottery && currentLottery.publish_winner}}" bind:close="onReceiveModalClose" bind:success="onReceiveSuccess" bind:viewWinners="viewWinnersList"></lottery-accept>
57
57
  <!-- 抽奖历史弹窗组件 -->
58
58
  <lottery-history visible="{{showHistory}}" winLotteryHistory="{{winLotteryHistory}}" bind:takeAward="onTakeAward" bind:close="onHistoryClose" bind:itemClick="onHistoryItemClick"></lottery-history>
59
59
  <!-- 奖池底部弹窗 -->
@@ -75,4 +75,4 @@
75
75
  </view>
76
76
  </view>
77
77
  <!-- 中奖名单弹窗组件 -->
78
- <lottery-winners visible="{{showWinnersList}}" lotteryId="{{currentLottery && (currentLottery.lottery_id || currentLottery.id)}}" sdkInstance="{{sdkInstance}}" bind:close="onWinnersClose"></lottery-winners>
78
+ <lottery-winners visible="{{showWinnersList}}" lotteryId="{{currentLottery ? (currentLottery.lottery_id || currentLottery.id) : ''}}" sdkInstance="{{sdkInstance}}" bind:close="onWinnersClose"></lottery-winners>
@@ -142,6 +142,7 @@ Component({
142
142
  this.unlistener = this.sdkInstance.on(obj);
143
143
  },
144
144
  async checkAndFetchMallRewardInfo(from, extra) {
145
+ this.sdkInstance.BRSAgent?.customLog(`checkAndFetchMallRewardInfo from=${from}`, JSON.stringify(extra));
145
146
  log.info('mall-reward checkAndFetchMallRewardInfo start');
146
147
  const mallRewardServer = this.sdkInstance.get('mallRewardServer');
147
148
  if (!mallRewardServer) return;
@@ -10,17 +10,17 @@ export function createObservers() {
10
10
  _that.setData({
11
11
  liveInfo,
12
12
  });
13
- const options = _that.store.get('');
13
+ // const options = _that.store.get('');
14
14
  // console.log('liveInfo:', JSON.stringify(options));
15
- _that.initVhallPlayer(options);
15
+ // _that.initVhallPlayer(options);
16
16
  _that.setHot();
17
17
  },
18
- 'liveInfo.status': (status) => {
18
+ webinarStatus: (status) => {
19
19
  _that.setData({
20
- ['liveInfo.status']: status,
20
+ webinarStatus: status,
21
21
  });
22
+ _that.initVhallPlayer(_that.store.get(''));
22
23
  _that.setHot();
23
- // 直播结束
24
24
  if (status === 3) {
25
25
  _that.destroy();
26
26
  }
@@ -76,6 +76,11 @@ VeComponent({
76
76
  this.vhallPlayerCore?.destroy();
77
77
  },
78
78
  show() {
79
+ // 预约(webinarStatus===2)和结束(webinarStatus===3)状态不恢复上报,避免切后台/切前台把已停止的 30s 心跳重新拉起
80
+ if (this.data.webinarStatus === 2 || this.data.webinarStatus === 3) {
81
+ logger.debug('pageLifetimes show: live scheduled or ended, skip reporting resume');
82
+ return;
83
+ }
79
84
  logger.debug('pageLifetimes show');
80
85
  this.vhallPlayerCore?.resume();
81
86
  },
@@ -7,7 +7,7 @@
7
7
  }
8
8
  </wxs>
9
9
  <view class='vhall-layout-root' style='{{_style}}'>
10
- <player-main catchtap="onToggleControls" wx:if="{{liveInfo.status!=3}}" id='{{id}}' class='vhall-player-root' src='{{videoSrc}}' type='{{type}}' autoplay='{{autoplay}}' objectFit='{{objectFit}}' muted='{{mutedFlag}}' mode='{{liveDelayMode}}' pictureInPictureMode='{{pictureInPictureMode}}' poster='{{posterUrl}}' controls='{{controls}}' show-progress="{{showProgress}}" loop="{{loop}}" initialSeekTime='{{initialSeekTime}}' bindfullscreenchange='onfullscreenchange' bindpictureinpicturechange='onpictureinpicturechange' bindtimeupdate='ontimeupdate' bindplay='onplay' bindpause='onpause' bindended='onended' bindloadedmetadata='onloadedmetadata' binderror='onerror' bindwaiting='onwaiting' bindloadStart='onloadStart' bindreconnecting='onreconnecting'>
10
+ <player-main catchtap="onToggleControls" wx:if="{{webinarStatus!=3}}" id='{{id}}' class='vhall-player-root' src='{{videoSrc}}' type='{{type}}' autoplay='{{autoplay}}' objectFit='{{objectFit}}' muted='{{mutedFlag}}' mode='{{liveDelayMode}}' pictureInPictureMode='{{pictureInPictureMode}}' poster='{{posterUrl}}' controls='{{controls}}' show-progress="{{showProgress}}" loop="{{loop}}" initialSeekTime='{{initialSeekTime}}' bindfullscreenchange='onfullscreenchange' bindpictureinpicturechange='onpictureinpicturechange' bindtimeupdate='ontimeupdate' bindplay='onplay' bindpause='onpause' bindended='onended' bindloadedmetadata='onloadedmetadata' binderror='onerror' bindwaiting='onwaiting' bindloadStart='onloadStart' bindreconnecting='onreconnecting'>
11
11
  <block wx:if="{{type=='live'}}">
12
12
  <!-- 纯音频播放蒙层图片 -->
13
13
  <image wx:if='{{showAudioCover}}' class='vhall-player-audio-cover' mode='scaleToFill' src='https://cnstatic01.e.vhall.com/common-static/saas-watch/static/img/video.110b96d1.gif' />
@@ -38,9 +38,9 @@
38
38
  </block>
39
39
  </player-main>
40
40
  <slot name='vhall-player-01' />
41
- <view wx:if="{{liveInfo.status==2||liveInfo.status==3}}" class="webinar_warn">
41
+ <view wx:if="{{webinarStatus==2||webinarStatus==3}}" class="webinar_warn">
42
42
  <image class="cover_img" src="{{liveInfo.coverImg}}" />
43
- <view wx:if="{{liveInfo.status==3}}" class="webinar_status">
43
+ <view wx:if="{{webinarStatus==3}}" class="webinar_status">
44
44
  <image class="status-img" mode="widthFix" src="https://cnstatic01.e.vhall.com/common-static/images/mp/live_end.png" />
45
45
  <text class="status-text">直播已结束</text>
46
46
  </view>
@@ -46,6 +46,7 @@ Component({
46
46
  const filteredProducts = val.filter(product => product.push_status === 1);
47
47
  // 最多显示3个商品卡片
48
48
  const products = filteredProducts.slice(0, 3);
49
+ this.properties.sdkInstance.get('logReportServer').report('116999', { stage: 'productCardUpdate', logData: products });
49
50
  this.setData({
50
51
  products: products
51
52
  });
@@ -1 +1 @@
1
- .product-card-container{align-items:flex-end;bottom:180rpx;display:flex;flex-direction:column;gap:16rpx;position:fixed;right:20rpx;z-index:999}.product-card{animation:slideIn .3s ease-out forwards;background-color:#fff;border-radius:12rpx;box-shadow:0 4rpx 12rpx rgba(0,0,0,.15);opacity:0;overflow:hidden;position:relative;transform:translateX(100%);width:240rpx}.product-card:first-child{animation-delay:0s}.product-card:nth-child(2){animation-delay:.1s}.product-card:nth-child(3){animation-delay:.2s}@keyframes slideIn{0%{opacity:0;transform:translateX(100%)}to{opacity:1;transform:translateX(0)}}.product-card-badge{background-color:rgba(0,0,0,.6);border-radius:30rpx;color:#fff;font-size:.71rem;left:8rpx;padding:4rpx 20rpx;position:absolute;top:8rpx;z-index:10}.product-card-badge .product-card-badge-icon{height:20rpx}.product-card-close{color:#fff;font-size:1.14rem;padding:0 14rpx;position:absolute;right:0rpx;top:0rpx;z-index:10}.product-card-image{height:240rpx;position:relative;width:100%}.product-card-image .product-card-img{height:100%;object-fit:cover;width:100%}.product-card-info{padding:12rpx}.product-card-title{color:#333;display:block;font-size:.86rem;font-weight:500;margin-bottom:12rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.product-card-price-container{align-items:center;background:#fb2626;border-radius:8rpx;color:#fff;display:flex;height:50rpx;justify-content:space-between;margin-top:12rpx;padding-left:10rpx}.product-card-buy{background-color:#ff4d4f;border-radius:6rpx;color:#fff;cursor:pointer;font-size:.71rem;padding:8rpx 16rpx}.product-card-mask{align-items:center;background-color:rgba(0,0,0,.4);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.product-card-mask-text{border-radius:20rpx;color:#fff;font-size:.86rem;padding:8rpx 16rpx}.product-card-disabled{opacity:.7}.product-card-disabled .product-card-price{color:#fff}.product-card-disabled .product-card-price-container{opacity:.6}.buy-icon{display:block;height:100%}.product-card-small{width:180rpx}.product-card-small .product-card-image{height:180rpx}.product-card-small .product-card-price-container{height:40rpx}.product-card-small .product-card-badge{font-size:.64rem;padding:3rpx 16rpx}.product-card-small .product-card-close{font-size:1rem;padding:0 10rpx}.product-card-small .buy-icon{display:none}
1
+ .product-card-container{align-items:flex-end;bottom:180rpx;display:flex;flex-direction:column;gap:16rpx;position:fixed;right:20rpx;z-index:999}.product-card{background-color:#fff;border-radius:12rpx;box-shadow:0 4rpx 12rpx rgba(0,0,0,.15);overflow:hidden;position:relative;width:240rpx}.product-card-badge{background-color:rgba(0,0,0,.6);border-radius:30rpx;color:#fff;font-size:.71rem;left:8rpx;padding:4rpx 20rpx;position:absolute;top:8rpx;z-index:10}.product-card-badge .product-card-badge-icon{height:20rpx}.product-card-close{color:#fff;font-size:1.14rem;padding:0 14rpx;position:absolute;right:0rpx;top:0rpx;z-index:10}.product-card-image{height:240rpx;position:relative;width:100%}.product-card-image .product-card-img{height:100%;object-fit:cover;width:100%}.product-card-info{padding:12rpx}.product-card-title{color:#333;display:block;font-size:.86rem;font-weight:500;margin-bottom:12rpx;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.product-card-price-container{align-items:center;background:#fb2626;border-radius:8rpx;color:#fff;display:flex;height:50rpx;justify-content:space-between;margin-top:12rpx;padding-left:10rpx}.product-card-buy{background-color:#ff4d4f;border-radius:6rpx;color:#fff;cursor:pointer;font-size:.71rem;padding:8rpx 16rpx}.product-card-mask{align-items:center;background-color:rgba(0,0,0,.4);bottom:0;display:flex;justify-content:center;left:0;position:absolute;right:0;top:0}.product-card-mask-text{border-radius:20rpx;color:#fff;font-size:.86rem;padding:8rpx 16rpx}.product-card-disabled{opacity:.7}.product-card-disabled .product-card-price{color:#fff}.product-card-disabled .product-card-price-container{opacity:.6}.buy-icon{display:block;height:100%}.product-card-small{width:180rpx}.product-card-small .product-card-image{height:180rpx}.product-card-small .product-card-price-container{height:40rpx}.product-card-small .product-card-badge{font-size:.64rem;padding:3rpx 16rpx}.product-card-small .product-card-close{font-size:1rem;padding:0 10rpx}.product-card-small .buy-icon{display:none}
@@ -50,6 +50,7 @@ Component({
50
50
  this.unsub = this.properties.sdkInstance.store.get({
51
51
  productList: (val) => {
52
52
  if (val) {
53
+ this.properties.sdkInstance.get('logReportServer').report('116999', { stage: 'productListUpdate', logData: val });
53
54
  this.setData({ productList: val });
54
55
  }
55
56
  }
@@ -1,16 +1,8 @@
1
1
  <view class="product-container">
2
- <view class="product-list">
2
+ <scroll-view scroll-y class="product-list">
3
3
  <view wx:if="{{productList.length === 0}}" class="product-empty">暂无商品</view>
4
4
  <view wx:else>
5
- <product-item
6
- webinarId="{{webinarId}}"
7
- wx:for="{{productList}}"
8
- wx:key="{{item.id}}"
9
- index="{{index}}"
10
- product="{{item}}"
11
- bind:openDetail="openProductDetail"
12
- bind:buyClick="onBuyClick"
13
- />
5
+ <product-item webinarId="{{webinarId}}" wx:for="{{productList}}" wx:key="{{item.id}}" index="{{index}}" product="{{item}}" bind:openDetail="openProductDetail" bind:buyClick="onBuyClick" />
14
6
  </view>
15
- </view>
7
+ </scroll-view>
16
8
  </view>
@@ -127,6 +127,7 @@ Component({
127
127
  // 发起签到
128
128
  case 'sign_in_push':
129
129
  this.sdkInstance.BRSAgent?.customLog('sign_in_push');
130
+ this.sdkInstance.get('logReportServer').report('116999', { stage: "sign_in_push" });
130
131
  this.handleSigninPush(msg.data);
131
132
  break;
132
133
  // 结束签到
@@ -1,3 +1,4 @@
1
+ import { reloadCurrentPage } from '../../shared/mpUtils.js'
1
2
  const errorMap = {
2
3
  512002: {
3
4
  msg: '活动不存在或已删除'
@@ -121,26 +122,7 @@ Component({
121
122
  methods: {
122
123
  onTap() {
123
124
  if (this.data.code === 900004 && this.data.secondText > 0) return;
124
- // 获取页面栈
125
- const pageStack = getCurrentPages();
126
- const currentPage = pageStack[pageStack.length - 1];
127
- const route = currentPage.route;
128
- const options = currentPage.options;
129
-
130
- // 拼接路由参数
131
- let queryStr = '';
132
- const params = [];
133
- for (const key in options) {
134
- params.push(`${key}=${encodeURIComponent(options[key])}`);
135
- }
136
- if (params.length) {
137
- queryStr = '?' + params.join('&');
138
- }
139
-
140
- // redirectTo:关闭当前页面,重新打开同页面,页面栈层级不变
141
- wx.redirectTo({
142
- url: `/${route}${queryStr}`
143
- });
125
+ reloadCurrentPage();
144
126
  },
145
127
  },
146
128
  });
@@ -1 +1 @@
1
- !function(){"use strict";var t={d:function(n,e){for(var o in e)t.o(e,o)&&!t.o(n,o)&&Object.defineProperty(n,o,{enumerable:!0,get:e[o]})},o:function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r:function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},n={};t.r(n),t.d(n,{_PLATFORM:function(){return o},envConfig:function(){return e}});const e={production:{BASE_URL:"https://open-api.vhall.com",VHALLYUN_API_BASE:"https://api.vhallyun.com",LOG_REPORT_BASE_URL:"https://dc.e.vhall.com/login",PUBLIC_KEY:"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0eUJFtW3vryA2NXx4M4f\n1w7dg3PHwOCA6Kx7JVfD/9eBGfqLhqsp+pg4AXG4PhuQx8EsV+sncQIiQO5J2//T\n3pO8LftDtCQztLnxnhq+BjhbFeswgfez2CwV2YKLTX2zyZ69T1Vu/M4H4gWSLeiV\n1FcH6xycA2+jG+EvOxSSItCKYT9EkB9BZSKf5RU7gM+qPtzdPtJP5vlsMCa0WnpY\nI6Qrmu/w9CZkL0397gUek9nBpPHkyPYg7ZijF3Gj8EqCMCVVTYpX96k4dd/Rz1em\ns4OSPF5jDsYZi58p+LmTcc3g7W9bD3QWWxzn47ie/Dh9LbnWfCqpGjUaHd3d42vR\ncQIDAQAB\n-----END PUBLIC KEY-----"},test:{BASE_URL:"https://test01-open-api.vhou.tv",VHALLYUN_API_BASE:"https://test01-api.vhallyun.com",LOG_REPORT_BASE_URL:"https://t-dc.e.vhall.com/login",PUBLIC_KEY:"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxWGCgHz2NLdVNa91CsNX\nFfCsxfgkTx738t3yMpuPYLL/5wwuWRrX7hBfNsfC+R5BW5b13ISzD001NNt+BWGK\np3V5fdWO18j9M/AhaTV2Ao/IpdP5huvVoNFVWPUQvX70FHu0sPVTev8ycAZHUpKx\n+mm83wxOpWBN5vAMJYx75pRCQfidb73XbOm6JXLJlxN91TUTrTiblxBhRwH0AQyr\ns9dUr+IJUZ1ea2uU3fkB4uYh7V/cHuNDMsJowfLtEU2+9IqEuJY4OwqX0qdfPF72\nsGMjCgghgL0z/7kv7Qe1+tOkJTBQTzODXBheGTVbF7hH2+5XuZsK2TfgBIew0I4k\n1wIDAQAB\n-----END PUBLIC KEY-----"}},o=19;module.exports=n}();
1
+ "use strict";const envConfig={production:{BASE_URL:"https://open-api.vhall.com",VHALLYUN_API_BASE:"https://api.vhallyun.com",LOG_REPORT_BASE_URL:"https://dc.e.vhall.com/login",PUBLIC_KEY:"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0eUJFtW3vryA2NXx4M4f\n1w7dg3PHwOCA6Kx7JVfD/9eBGfqLhqsp+pg4AXG4PhuQx8EsV+sncQIiQO5J2//T\n3pO8LftDtCQztLnxnhq+BjhbFeswgfez2CwV2YKLTX2zyZ69T1Vu/M4H4gWSLeiV\n1FcH6xycA2+jG+EvOxSSItCKYT9EkB9BZSKf5RU7gM+qPtzdPtJP5vlsMCa0WnpY\nI6Qrmu/w9CZkL0397gUek9nBpPHkyPYg7ZijF3Gj8EqCMCVVTYpX96k4dd/Rz1em\ns4OSPF5jDsYZi58p+LmTcc3g7W9bD3QWWxzn47ie/Dh9LbnWfCqpGjUaHd3d42vR\ncQIDAQAB\n-----END PUBLIC KEY-----"},test:{BASE_URL:"https://test01-open-api.vhou.tv",VHALLYUN_API_BASE:"https://test01-api.vhallyun.com",LOG_REPORT_BASE_URL:"https://t-dc.e.vhall.com/login",PUBLIC_KEY:"-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxWGCgHz2NLdVNa91CsNX\nFfCsxfgkTx738t3yMpuPYLL/5wwuWRrX7hBfNsfC+R5BW5b13ISzD001NNt+BWGK\np3V5fdWO18j9M/AhaTV2Ao/IpdP5huvVoNFVWPUQvX70FHu0sPVTev8ycAZHUpKx\n+mm83wxOpWBN5vAMJYx75pRCQfidb73XbOm6JXLJlxN91TUTrTiblxBhRwH0AQyr\ns9dUr+IJUZ1ea2uU3fkB4uYh7V/cHuNDMsJowfLtEU2+9IqEuJY4OwqX0qdfPF72\nsGMjCgghgL0z/7kv7Qe1+tOkJTBQTzODXBheGTVbF7hH2+5XuZsK2TfgBIew0I4k\n1wIDAQAB\n-----END PUBLIC KEY-----"}};exports._PLATFORM=19,exports.envConfig=envConfig;