vhall-mini-sdk 0.1.0 → 0.1.1
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.
- package/lib/components/player/components/online-hot/index.js +2 -2
- package/lib/sdk/main/index.js +1 -0
- package/package.json +2 -4
- package/postinstall.js +21 -51
- package/dist/components/chat/chat-edit/chat-edit.js +0 -127
- package/dist/components/chat/chat-edit/chat-edit.json +0 -4
- package/dist/components/chat/chat-edit/chat-edit.wxml +0 -7
- package/dist/components/chat/chat-edit/chat-edit.wxss +0 -1
- package/dist/components/chat/chat-item/chat-item.js +0 -253
- package/dist/components/chat/chat-item/chat-item.json +0 -3
- package/dist/components/chat/chat-item/chat-item.wxml +0 -96
- package/dist/components/chat/chat-item/chat-item.wxss +0 -1
- package/dist/components/chat/chat-list/chat-list.js +0 -216
- package/dist/components/chat/chat-list/chat-list.json +0 -6
- package/dist/components/chat/chat-list/chat-list.wxml +0 -9
- package/dist/components/chat/chat-list/chat-list.wxss +0 -1
- package/dist/components/chat/chat.js +0 -98
- package/dist/components/chat/chat.json +0 -7
- package/dist/components/chat/chat.wxml +0 -7
- package/dist/components/chat/chat.wxss +0 -1
- package/dist/components/gift/gift-display/gift-display.js +0 -118
- package/dist/components/gift/gift-display/gift-display.json +0 -3
- package/dist/components/gift/gift-display/gift-display.wxml +0 -16
- package/dist/components/gift/gift-display/gift-display.wxss +0 -1
- package/dist/components/gift/gift-sender/gift-sender.js +0 -63
- package/dist/components/gift/gift-sender/gift-sender.json +0 -6
- package/dist/components/gift/gift-sender/gift-sender.wxml +0 -19
- package/dist/components/gift/gift-sender/gift-sender.wxss +0 -1
- package/dist/components/introduction/introduction.js +0 -43
- package/dist/components/introduction/introduction.json +0 -3
- package/dist/components/introduction/introduction.wxml +0 -8
- package/dist/components/introduction/introduction.wxss +0 -1
- package/dist/components/invite-rank/img/bronze.png +0 -0
- package/dist/components/invite-rank/img/gold.png +0 -0
- package/dist/components/invite-rank/img/silver.png +0 -0
- package/dist/components/invite-rank/index.js +0 -135
- package/dist/components/invite-rank/index.json +0 -8
- package/dist/components/invite-rank/index.wxml +0 -42
- package/dist/components/invite-rank/index.wxss +0 -1
- package/dist/components/invite-rank/invite-rank-item.js +0 -12
- package/dist/components/invite-rank/invite-rank-item.json +0 -4
- package/dist/components/invite-rank/invite-rank-item.wxml +0 -21
- package/dist/components/invite-rank/invite-rank-item.wxss +0 -1
- package/dist/components/invite-rank/my-invite-detail.js +0 -82
- package/dist/components/invite-rank/my-invite-detail.json +0 -7
- package/dist/components/invite-rank/my-invite-detail.wxml +0 -27
- package/dist/components/invite-rank/my-invite-detail.wxss +0 -1
- package/dist/components/invite-rank/util.wxs +0 -21
- package/dist/components/live-landscape/live-landscape.js +0 -216
- package/dist/components/live-landscape/live-landscape.json +0 -39
- package/dist/components/live-landscape/live-landscape.wxml +0 -73
- package/dist/components/live-landscape/live-landscape.wxss +0 -1
- package/dist/components/live-portrait/live-portrait.js +0 -274
- package/dist/components/live-portrait/live-portrait.json +0 -38
- package/dist/components/live-portrait/live-portrait.wxml +0 -106
- package/dist/components/live-portrait/live-portrait.wxss +0 -1
- package/dist/components/lottery/lottery-accept/index.js +0 -249
- package/dist/components/lottery/lottery-accept/index.json +0 -4
- package/dist/components/lottery/lottery-accept/index.wxml +0 -49
- package/dist/components/lottery/lottery-accept/index.wxss +0 -1
- package/dist/components/lottery/lottery-history/index.js +0 -36
- package/dist/components/lottery/lottery-history/index.json +0 -3
- package/dist/components/lottery/lottery-history/index.wxml +0 -28
- package/dist/components/lottery/lottery-history/index.wxss +0 -1
- package/dist/components/lottery/lottery-shake/lottery-shake.js +0 -328
- package/dist/components/lottery/lottery-shake/lottery-shake.json +0 -1
- package/dist/components/lottery/lottery-shake/lottery-shake.wxml +0 -52
- package/dist/components/lottery/lottery-shake/lottery-shake.wxss +0 -1
- package/dist/components/lottery/lottery-slot/lottery-slot.js +0 -230
- package/dist/components/lottery/lottery-slot/lottery-slot.json +0 -1
- package/dist/components/lottery/lottery-slot/lottery-slot.wxml +0 -62
- package/dist/components/lottery/lottery-slot/lottery-slot.wxss +0 -1
- package/dist/components/lottery/lottery-wheel/lottery-wheel.js +0 -153
- package/dist/components/lottery/lottery-wheel/lottery-wheel.json +0 -4
- package/dist/components/lottery/lottery-wheel/lottery-wheel.wxml +0 -91
- package/dist/components/lottery/lottery-wheel/lottery-wheel.wxss +0 -1
- package/dist/components/lottery/lottery-winners/index.js +0 -101
- package/dist/components/lottery/lottery-winners/index.json +0 -4
- package/dist/components/lottery/lottery-winners/index.wxml +0 -39
- package/dist/components/lottery/lottery-winners/index.wxss +0 -1
- package/dist/components/lottery/lottery.js +0 -388
- package/dist/components/lottery/lottery.json +0 -11
- package/dist/components/lottery/lottery.wxml +0 -78
- package/dist/components/lottery/lottery.wxss +0 -1
- package/dist/components/lottery/wheel.json +0 -49
- package/dist/components/mall-reward/common/reward-card.wxss +0 -0
- package/dist/components/mall-reward/duration-icon/index.js +0 -101
- package/dist/components/mall-reward/duration-icon/index.json +0 -3
- package/dist/components/mall-reward/duration-icon/index.wxml +0 -7
- package/dist/components/mall-reward/duration-icon/index.wxss +0 -1
- package/dist/components/mall-reward/f-count-down/index.js +0 -61
- package/dist/components/mall-reward/f-count-down/index.json +0 -3
- package/dist/components/mall-reward/f-count-down/index.wxml +0 -9
- package/dist/components/mall-reward/f-count-down/index.wxss +0 -1
- package/dist/components/mall-reward/f-empty/index.js +0 -11
- package/dist/components/mall-reward/f-empty/index.json +0 -3
- package/dist/components/mall-reward/f-empty/index.wxml +0 -8
- package/dist/components/mall-reward/f-empty/index.wxss +0 -1
- package/dist/components/mall-reward/f-history/index.js +0 -84
- package/dist/components/mall-reward/f-history/index.json +0 -4
- package/dist/components/mall-reward/f-history/index.wxml +0 -38
- package/dist/components/mall-reward/f-history/index.wxss +0 -1
- package/dist/components/mall-reward/f-open/index.js +0 -36
- package/dist/components/mall-reward/f-open/index.json +0 -3
- package/dist/components/mall-reward/f-open/index.wxml +0 -10
- package/dist/components/mall-reward/f-open/index.wxss +0 -1
- package/dist/components/mall-reward/f-receive/index.js +0 -36
- package/dist/components/mall-reward/f-receive/index.json +0 -3
- package/dist/components/mall-reward/f-receive/index.wxml +0 -9
- package/dist/components/mall-reward/f-receive/index.wxss +0 -1
- package/dist/components/mall-reward/index.js +0 -374
- package/dist/components/mall-reward/index.json +0 -8
- package/dist/components/mall-reward/index.wxml +0 -4
- package/dist/components/mall-reward/index.wxss +0 -0
- package/dist/components/mall-reward/main-popup/index.js +0 -46
- package/dist/components/mall-reward/main-popup/index.json +0 -12
- package/dist/components/mall-reward/main-popup/index.wxml +0 -16
- package/dist/components/mall-reward/main-popup/index.wxss +0 -1
- package/dist/components/player/assets/image/arrow-left.png +0 -0
- package/dist/components/player/assets/image/arrow-right.png +0 -0
- package/dist/components/player/assets/image/enterFullScreen.png +0 -0
- package/dist/components/player/assets/image/exitFullScreen.png +0 -0
- package/dist/components/player/assets/image/fullscreen_1.png +0 -0
- package/dist/components/player/assets/image/fullscreen_2.png +0 -0
- package/dist/components/player/assets/image/pause.png +0 -0
- package/dist/components/player/assets/image/pause_1.png +0 -0
- package/dist/components/player/assets/image/play.png +0 -0
- package/dist/components/player/assets/image/play_1.png +0 -0
- package/dist/components/player/assets/image/refresh.png +0 -0
- package/dist/components/player/assets/image/refresh_1.png +0 -0
- package/dist/components/player/assets/image/subtitle_close.png +0 -0
- package/dist/components/player/assets/image/subtitle_default.png +0 -0
- package/dist/components/player/assets/image/volume-off.png +0 -0
- package/dist/components/player/assets/image/volume-on.png +0 -0
- package/dist/components/player/common/config.js +0 -7
- package/dist/components/player/common/veComponent.js +0 -4
- package/dist/components/player/components/barrage/barrage-canvas.js +0 -488
- package/dist/components/player/components/barrage/barrage-dom.js +0 -471
- package/dist/components/player/components/barrage/index.js +0 -62
- package/dist/components/player/components/barrage/index.json +0 -4
- package/dist/components/player/components/barrage/index.wxml +0 -39
- package/dist/components/player/components/barrage/index.wxss +0 -1
- package/dist/components/player/components/barrage/utils.js +0 -71
- package/dist/components/player/components/controls/controls.js +0 -93
- package/dist/components/player/components/controls/controls.json +0 -6
- package/dist/components/player/components/controls/controls.wxml +0 -60
- package/dist/components/player/components/controls/controls.wxss +0 -1
- package/dist/components/player/components/danmaku/danmaku.js +0 -23
- package/dist/components/player/components/danmaku/danmaku.json +0 -4
- package/dist/components/player/components/danmaku/danmaku.wxml +0 -1
- package/dist/components/player/components/danmaku/danmaku.wxss +0 -0
- package/dist/components/player/components/error/error.js +0 -15
- package/dist/components/player/components/error/error.json +0 -3
- package/dist/components/player/components/error/error.wxml +0 -6
- package/dist/components/player/components/error/error.wxss +0 -1
- package/dist/components/player/components/loading/loading.js +0 -9
- package/dist/components/player/components/loading/loading.json +0 -3
- package/dist/components/player/components/loading/loading.wxml +0 -4
- package/dist/components/player/components/loading/loading.wxss +0 -1
- package/dist/components/player/components/main/extensions/data.js +0 -8
- package/dist/components/player/components/main/extensions/export.js +0 -83
- package/dist/components/player/components/main/extensions/methods.js +0 -110
- package/dist/components/player/components/main/extensions/observers.js +0 -41
- package/dist/components/player/components/main/extensions/props.js +0 -177
- package/dist/components/player/components/main/index.js +0 -44
- package/dist/components/player/components/main/index.json +0 -4
- package/dist/components/player/components/main/index.wxml +0 -7
- package/dist/components/player/components/main/index.wxss +0 -1
- package/dist/components/player/components/marquee/marquee.js +0 -304
- package/dist/components/player/components/marquee/marquee.json +0 -4
- package/dist/components/player/components/marquee/marquee.wxml +0 -14
- package/dist/components/player/components/marquee/marquee.wxss +0 -1
- package/dist/components/player/components/online-hot/assets/line-hot.png +0 -0
- package/dist/components/player/components/online-hot/assets/line-user.png +0 -0
- package/dist/components/player/components/online-hot/index.js +0 -66
- package/dist/components/player/components/online-hot/index.json +0 -3
- package/dist/components/player/components/online-hot/index.wxml +0 -15
- package/dist/components/player/components/online-hot/index.wxss +0 -1
- package/dist/components/player/components/poster/poster.js +0 -12
- package/dist/components/player/components/poster/poster.json +0 -3
- package/dist/components/player/components/poster/poster.wxml +0 -5
- package/dist/components/player/components/poster/poster.wxss +0 -1
- package/dist/components/player/components/watermark/watermark.js +0 -52
- package/dist/components/player/components/watermark/watermark.json +0 -4
- package/dist/components/player/components/watermark/watermark.wxml +0 -8
- package/dist/components/player/components/watermark/watermark.wxss +0 -1
- package/dist/components/player/extensions/data.js +0 -63
- package/dist/components/player/extensions/export.js +0 -325
- package/dist/components/player/extensions/methods.js +0 -406
- package/dist/components/player/extensions/observers.js +0 -114
- package/dist/components/player/extensions/props.js +0 -162
- package/dist/components/player/player.js +0 -83
- package/dist/components/player/player.json +0 -33
- package/dist/components/player/player.wxml +0 -48
- package/dist/components/player/player.wxss +0 -1
- package/dist/components/praise/praise.js +0 -150
- package/dist/components/praise/praise.json +0 -5
- package/dist/components/praise/praise.wxml +0 -17
- package/dist/components/praise/praise.wxss +0 -1
- package/dist/components/product/product-card/product-card.js +0 -109
- package/dist/components/product/product-card/product-card.json +0 -3
- package/dist/components/product/product-card/product-card.wxml +0 -47
- package/dist/components/product/product-card/product-card.wxss +0 -1
- package/dist/components/product/product-detail/product-detail.js +0 -127
- package/dist/components/product/product-detail/product-detail.json +0 -3
- package/dist/components/product/product-detail/product-detail.wxml +0 -57
- package/dist/components/product/product-detail/product-detail.wxss +0 -1
- package/dist/components/product/product-item/product-item.js +0 -56
- package/dist/components/product/product-item/product-item.json +0 -3
- package/dist/components/product/product-item/product-item.wxml +0 -35
- package/dist/components/product/product-item/product-item.wxss +0 -1
- package/dist/components/product/product-list/product-list.js +0 -67
- package/dist/components/product/product-list/product-list.json +0 -6
- package/dist/components/product/product-list/product-list.wxml +0 -16
- package/dist/components/product/product-list/product-list.wxss +0 -1
- package/dist/components/product/product-order/product-order.js +0 -394
- package/dist/components/product/product-order/product-order.json +0 -3
- package/dist/components/product/product-order/product-order.wxml +0 -75
- package/dist/components/product/product-order/product-order.wxss +0 -1
- package/dist/components/signin/signin-dialog.js +0 -305
- package/dist/components/signin/signin-dialog.json +0 -7
- package/dist/components/signin/signin-dialog.wxml +0 -19
- package/dist/components/signin/signin-dialog.wxss +0 -1
- package/dist/components/top-notify/index.js +0 -14
- package/dist/components/top-notify/index.json +0 -3
- package/dist/components/top-notify/index.wxml +0 -2
- package/dist/components/top-notify/index.wxss +0 -1
- package/dist/pubComponents/countdown/countdown.js +0 -97
- package/dist/pubComponents/countdown/countdown.json +0 -5
- package/dist/pubComponents/countdown/countdown.wxml +0 -19
- package/dist/pubComponents/countdown/countdown.wxss +0 -1
- package/dist/pubComponents/error-page/index.js +0 -146
- package/dist/pubComponents/error-page/index.json +0 -5
- package/dist/pubComponents/error-page/index.wxml +0 -37
- package/dist/pubComponents/error-page/index.wxss +0 -1
- package/dist/pubComponents/popup/popup.js +0 -161
- package/dist/pubComponents/popup/popup.json +0 -5
- package/dist/pubComponents/popup/popup.wxml +0 -17
- package/dist/pubComponents/popup/popup.wxss +0 -1
- package/dist/pubComponents/tabs/index.js +0 -95
- package/dist/pubComponents/tabs/index.json +0 -4
- package/dist/pubComponents/tabs/index.wxml +0 -22
- package/dist/pubComponents/tabs/index.wxss +0 -1
- package/dist/sdk/config/index.js +0 -1
- package/dist/sdk/main/index.js +0 -1
- package/dist/sdk/player/index.js +0 -1
- package/dist/sdk/plugins/ChatServer.js +0 -1
- package/dist/sdk/plugins/CustomMenuServer.js +0 -1
- package/dist/sdk/plugins/InteractServer.js +0 -1
- package/dist/sdk/plugins/InviteCardServer.js +0 -1
- package/dist/sdk/plugins/LotteryServer.js +0 -1
- package/dist/sdk/plugins/MallRewardServer.js +0 -1
- package/dist/sdk/plugins/ProductServer.js +0 -1
- package/dist/shared/RequestUtil.js +0 -1
- package/dist/shared/SerializableMap.js +0 -1
- package/dist/shared/base.server.js +0 -1
- package/dist/shared/cacheUtil.js +0 -1
- package/dist/shared/dateUtil.js +0 -1
- package/dist/shared/logger.js +0 -1
- package/dist/shared/mpUtils.js +0 -1
- package/dist/shared/utils.js +0 -1
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
<view class="order-container" catchtap="">
|
|
2
|
-
<view class="order-header">
|
|
3
|
-
<text class="order-title">确认订单</text>
|
|
4
|
-
</view>
|
|
5
|
-
<scroll-view class="order-content" scroll-y>
|
|
6
|
-
<view class="product-section">
|
|
7
|
-
<view class="product-card">
|
|
8
|
-
<image class="product-img" src="{{product.cover_img || 'https://cnstatic01.e.vhall.com/common-static/images/default_avatar.png'}}" mode="aspectFill"></image>
|
|
9
|
-
<view class="product-detail">
|
|
10
|
-
<text class="product-name">{{product.name || '商品名称'}}</text>
|
|
11
|
-
<text class="product-desc">{{product.description || '商品描述'}}</text>
|
|
12
|
-
<!-- 价格显示逻辑 -->
|
|
13
|
-
<block wx:if="{{product.covered_status === 1}}">
|
|
14
|
-
<text class="covered-price">¥?待开价</text>
|
|
15
|
-
</block>
|
|
16
|
-
<block wx:else>
|
|
17
|
-
<view wx:if="{{product.discount_price && product.price && product.discount_price !== product.price}}" class="product-price-row">
|
|
18
|
-
<text class="product-discount-price">¥{{product.discount_price}}</text>
|
|
19
|
-
<text class="product-original-price">¥{{product.price}}</text>
|
|
20
|
-
</view>
|
|
21
|
-
<text wx:else class="product-price">¥{{product.discount_price || product.price || 0}}</text>
|
|
22
|
-
</block>
|
|
23
|
-
</view>
|
|
24
|
-
</view>
|
|
25
|
-
</view>
|
|
26
|
-
|
|
27
|
-
<view class="quantity-section">
|
|
28
|
-
<text class="section-title">购买数量</text>
|
|
29
|
-
<view class="quantity-control">
|
|
30
|
-
<view class="qty-btn" bindtap="decreaseQty">
|
|
31
|
-
<text class="qty-btn-text">-</text>
|
|
32
|
-
</view>
|
|
33
|
-
<text class="qty-value">{{quantity}}</text>
|
|
34
|
-
<view class="qty-btn" bindtap="increaseQty">
|
|
35
|
-
<text class="qty-btn-text">+</text>
|
|
36
|
-
</view>
|
|
37
|
-
</view>
|
|
38
|
-
</view>
|
|
39
|
-
|
|
40
|
-
<view class="amount-section">
|
|
41
|
-
<view class="amount-row">
|
|
42
|
-
<text class="amount-label">商品小计</text>
|
|
43
|
-
<text class="amount-value">¥{{subtotalText}}</text>
|
|
44
|
-
</view>
|
|
45
|
-
<view class="amount-row total">
|
|
46
|
-
<text class="amount-label">实付金额</text>
|
|
47
|
-
<text class="amount-value">¥{{totalText}}</text>
|
|
48
|
-
</view>
|
|
49
|
-
</view>
|
|
50
|
-
|
|
51
|
-
<!-- 用户信息输入区域 -->
|
|
52
|
-
<view class="user-info-section" wx:if="{{enableUsername || enablePhone || enableRemark}}">
|
|
53
|
-
<view class="input-item" wx:if="{{enableUsername}}">
|
|
54
|
-
<text class="input-label"><text class="required-mark">*</text>用户信息</text>
|
|
55
|
-
<input class="input-value" placeholder="请输入姓名" value="{{username}}" bindinput="onUsernameInput" />
|
|
56
|
-
</view>
|
|
57
|
-
<view class="input-item" wx:if="{{enablePhone}}">
|
|
58
|
-
<text class="input-label"><text class="required-mark">*</text>联系电话</text>
|
|
59
|
-
<input class="input-value" type="number" placeholder="请输入手机号" value="{{phone}}" bindinput="onPhoneInput" />
|
|
60
|
-
</view>
|
|
61
|
-
<view class="input-item input-item-top" wx:if="{{enableRemark}}">
|
|
62
|
-
<text class="input-label">留言备注</text>
|
|
63
|
-
<textarea class="textarea-value" maxlength="50" placeholder="请输入备注" value="{{remark}}" bindinput="onRemarkInput" />
|
|
64
|
-
</view>
|
|
65
|
-
</view>
|
|
66
|
-
</scroll-view>
|
|
67
|
-
|
|
68
|
-
<view class="order-footer">
|
|
69
|
-
<view class="footer-left">
|
|
70
|
-
<text class="footer-label">合计:</text>
|
|
71
|
-
<text class="footer-total">¥{{totalText}}</text>
|
|
72
|
-
</view>
|
|
73
|
-
<view class="submit-btn" bindtap="submitOrder">提交订单</view>
|
|
74
|
-
</view>
|
|
75
|
-
</view>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.order-mask{align-items:flex-end;background-color:rgba(0,0,0,.5);bottom:0;display:flex;left:0;position:fixed;right:0;top:0;z-index:1000}.order-container{background-color:#fff;border-radius:24rpx 24rpx 0 0;display:flex;flex-direction:column;max-height:80vh;width:100%}.order-header{align-items:center;border-bottom:1rpx solid #f5f5f5;display:flex;justify-content:space-between}.order-title{color:#333;font-size:1.29rem;font-weight:700}.order-close{align-items:center;display:flex;height:60rpx;justify-content:center;width:60rpx}.close-icon{color:#999;font-size:1.71rem;line-height:1}.order-content{box-sizing:border-box;flex:1;overflow-y:auto;padding:30rpx 40rpx}.product-section{margin-bottom:30rpx}.product-card{background-color:#fafafa;border-radius:16rpx;display:flex;padding:20rpx}.product-img{border-radius:12rpx;height:160rpx;margin-right:20rpx;width:160rpx}.product-detail{display:flex;flex:1;flex-direction:column;justify-content:space-between}.product-name{-webkit-line-clamp:2;-webkit-box-orient:vertical;color:#333;display:-webkit-box;font-size:1.14rem;font-weight:500;line-height:1.43rem;overflow:hidden}.product-desc{color:#999;font-size:.93rem;margin-top:8rpx}.product-price-row{align-items:baseline;display:flex;margin-top:12rpx}.product-price{color:#fb2626;font-size:1.29rem;font-weight:700}.product-discount-price{color:#fb2626;font-size:1.14rem}.product-original-price{color:#999;font-size:.86rem;margin-left:12rpx;text-decoration:line-through}.covered-price{color:#999;font-size:1rem}.quantity-section{align-items:center;border-bottom:1rpx solid #f5f5f5;display:flex;justify-content:space-between;padding:20rpx 0}.section-title{color:#333;font-size:1.07rem}.qty-btn,.quantity-control{align-items:center;display:flex}.qty-btn{background-color:#f5f5f5;border-radius:50%;height:56rpx;justify-content:center;width:56rpx}.qty-btn .qty-btn-text{color:#333;font-size:1.29rem;line-height:1}.qty-value{color:#333;font-size:1.14rem;margin:0 20rpx;min-width:60rpx;text-align:center}.amount-section{margin-top:20rpx}.amount-row{align-items:center;display:flex;justify-content:space-between;padding:16rpx 0}.amount-row.total{border-top:1rpx dashed #e0e0e0;margin-top:10rpx;padding-top:26rpx}.amount-label{color:#666;font-size:1rem}.amount-row.total .amount-label{color:#333;font-size:1.07rem}.amount-value{color:#333;font-size:1rem}.amount-row.total .amount-value{color:#fb2626;font-size:1.29rem;font-weight:700}.order-footer{align-items:center;background-color:#fff;border-top:1rpx solid #f5f5f5;display:flex;justify-content:space-between;padding:24rpx 40rpx}.footer-left{align-items:baseline;display:flex}.footer-label{color:#666;font-size:1rem}.footer-total{color:#fb2626;font-size:1.43rem;font-weight:700;margin-left:8rpx}.submit-btn{background:linear-gradient(135deg,#fb2626,#ff6b6b);border-radius:48rpx;color:#fff;font-size:1.14rem;font-weight:500;padding:24rpx 80rpx}.submit-btn:active{opacity:.8}.user-info-section{border-top:1rpx solid #f5f5f5;margin-top:30rpx;padding-top:30rpx}.input-item{align-items:center;border-bottom:1rpx solid #f5f5f5;display:flex;padding:20rpx 0}.input-item:last-child{border-bottom:none}.input-item-top{align-items:flex-start}.input-label{color:#333;font-size:1.07rem;margin-right:20rpx;text-align:right;width:138rpx}.input-value,.textarea-value{color:#333;flex:1;font-size:1.07rem}.textarea-value{min-height:100rpx}.required-mark{color:#fb2626;margin-left:4rpx}
|
|
@@ -1,305 +0,0 @@
|
|
|
1
|
-
import { debounce } from '../../shared/utils';
|
|
2
|
-
const DEFAULT_SIGIN_TITLE = '主持人发起了签到';
|
|
3
|
-
const DEFAULT_SIGIN_SUCCESS_TIP = '签到成功';
|
|
4
|
-
const app = getApp();
|
|
5
|
-
|
|
6
|
-
const circleSize = 200; //圆环粗细
|
|
7
|
-
const circleRadius = 90;
|
|
8
|
-
const lineWidth = 16; //粗细
|
|
9
|
-
|
|
10
|
-
Component({
|
|
11
|
-
properties: {
|
|
12
|
-
sdkInstance: {
|
|
13
|
-
type: Object,
|
|
14
|
-
value: null,
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
data: {
|
|
18
|
-
ctx: null, // cavans绘制对象上下文
|
|
19
|
-
show: false, // 是否显示签到对话框
|
|
20
|
-
signId: '', // 签到id
|
|
21
|
-
siginTitle: DEFAULT_SIGIN_TITLE,
|
|
22
|
-
signinSuccessTips: DEFAULT_SIGIN_SUCCESS_TIP,
|
|
23
|
-
totalTime: 30, // 初始总秒数
|
|
24
|
-
remainingTime: 30, // 初始剩余秒数
|
|
25
|
-
showTime: 30, // 当前展示的秒杀
|
|
26
|
-
formattedTime: '00:30', // 格式化显示的showTime
|
|
27
|
-
timer: null, // 计时器
|
|
28
|
-
|
|
29
|
-
signed: false, // 是否签到
|
|
30
|
-
},
|
|
31
|
-
lifetimes: {
|
|
32
|
-
ready() {
|
|
33
|
-
this.initCanvas();
|
|
34
|
-
},
|
|
35
|
-
detached() {
|
|
36
|
-
this.destoryEventListener();
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
observers: {
|
|
40
|
-
sdkInstance: function sdkInstance(_sdkInstance) {
|
|
41
|
-
if (!_sdkInstance) return;
|
|
42
|
-
|
|
43
|
-
this.sdkInstance = _sdkInstance;
|
|
44
|
-
this.store = _sdkInstance.store;
|
|
45
|
-
this.initEventListener();
|
|
46
|
-
|
|
47
|
-
this.checkAndShowSignInPanel();
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
methods: {
|
|
51
|
-
// 初始化Canvas
|
|
52
|
-
async initCanvas() {
|
|
53
|
-
const query = wx.createSelectorQuery().in(this);
|
|
54
|
-
query
|
|
55
|
-
.select('#myCanvas')
|
|
56
|
-
.fields({ node: true, size: true })
|
|
57
|
-
.exec((res) => {
|
|
58
|
-
const canvas = res[0]?.node;
|
|
59
|
-
if (canvas) {
|
|
60
|
-
const ctx = canvas.getContext('2d');
|
|
61
|
-
// 适配高清屏幕
|
|
62
|
-
const dpr = wx.getWindowInfo().pixelRatio;
|
|
63
|
-
canvas.width = circleSize * dpr;
|
|
64
|
-
canvas.height = circleSize * dpr;
|
|
65
|
-
ctx.scale(dpr, dpr);
|
|
66
|
-
this.setData({ ctx });
|
|
67
|
-
this.drawProgress(0);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
},
|
|
71
|
-
initEventListener() {
|
|
72
|
-
this.sdkInstance.on(this.sdkInstance.EVENT.ROOM_MSG, this.dispatchRoomMsg.bind(this));
|
|
73
|
-
// 监听 store 中签到信息变化(如切前台刷新补偿带来的新签到),变化时重新处理面板
|
|
74
|
-
this._unsubSigninInfo = this.store.get({
|
|
75
|
-
signinInfo: (val) => this.onSigninInfoChange(val),
|
|
76
|
-
});
|
|
77
|
-
},
|
|
78
|
-
destoryEventListener() {
|
|
79
|
-
if (!this.sdkInstance) return;
|
|
80
|
-
this.sdkInstance.off(this.sdkInstance.EVENT.ROOM_MSG, this.dispatchRoomMsg.bind(this));
|
|
81
|
-
if (this._unsubSigninInfo) {
|
|
82
|
-
this._unsubSigninInfo();
|
|
83
|
-
this._unsubSigninInfo = null;
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
// 检查当前是否有正在进行签到,如果有展示签到面板
|
|
87
|
-
checkAndShowSignInPanel() {
|
|
88
|
-
const signinInfo = this.store.get('signinInfo');
|
|
89
|
-
if (signinInfo && !signinInfo.is_signed && signinInfo.id) {
|
|
90
|
-
this.resetCountdown();
|
|
91
|
-
|
|
92
|
-
const totalTime = signinInfo.show_time;
|
|
93
|
-
const remainingTime = signinInfo.is_auto_sign == 1 ? signinInfo.auto_sign_time_ttl : signinInfo.sign_time_ttl;
|
|
94
|
-
if (signinInfo.is_auto_sign == 1 && remainingTime < 1) {
|
|
95
|
-
return;
|
|
96
|
-
}
|
|
97
|
-
this.setData({
|
|
98
|
-
signId: signinInfo.id,
|
|
99
|
-
siginTitle: signinInfo.sign_tips || DEFAULT_SIGIN_TITLE,
|
|
100
|
-
signinSuccessTips: signinInfo.sign_in_success_tips || DEFAULT_SIGIN_SUCCESS_TIP,
|
|
101
|
-
totalTime,
|
|
102
|
-
remainingTime,
|
|
103
|
-
showTime: remainingTime,
|
|
104
|
-
formattedTime: this.formatTime(remainingTime),
|
|
105
|
-
});
|
|
106
|
-
this.startCountdown();
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
// store.signinInfo 变化时的处理(如切前台刷新补偿、新发起签到等)
|
|
110
|
-
onSigninInfoChange(val) {
|
|
111
|
-
const newId = val?.id;
|
|
112
|
-
// 签到信息为空,说明签到已结束(如后台结束后切回前台刷新补偿),关闭倒计时面板
|
|
113
|
-
if (!newId) {
|
|
114
|
-
this._currentSignId = '';
|
|
115
|
-
this.closeCountdown();
|
|
116
|
-
return;
|
|
117
|
-
}
|
|
118
|
-
// 仅当签到 id 变化(新发起/切换签到)才重新展示,避免进行中签到被重复重置倒计时
|
|
119
|
-
if (newId !== this._currentSignId) {
|
|
120
|
-
this._currentSignId = newId;
|
|
121
|
-
this.checkAndShowSignInPanel();
|
|
122
|
-
}
|
|
123
|
-
},
|
|
124
|
-
dispatchRoomMsg(msg) {
|
|
125
|
-
const msgDataType = msg?.data?.type;
|
|
126
|
-
switch (msgDataType) {
|
|
127
|
-
// 发起签到
|
|
128
|
-
case 'sign_in_push':
|
|
129
|
-
this.sdkInstance.BRSAgent?.customLog('sign_in_push');
|
|
130
|
-
this.handleSigninPush(msg.data);
|
|
131
|
-
break;
|
|
132
|
-
// 结束签到
|
|
133
|
-
case 'sign_end':
|
|
134
|
-
// 直播结束
|
|
135
|
-
case 'live_over':
|
|
136
|
-
this.sdkInstance.BRSAgent?.customLog(`${msgDataType}`);
|
|
137
|
-
this.handleSigninEnd(msg.data);
|
|
138
|
-
break;
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
// 接收到“发起签到”消息的处理
|
|
142
|
-
handleSigninPush(msgData) {
|
|
143
|
-
const time = Number(msgData.sign_show_time);
|
|
144
|
-
this._currentSignId = msgData.sign_id; // 标记当前签到,避免 store 订阅回调重复处理
|
|
145
|
-
this.sdkInstance.store.set('signinInfo', msgData); //签到信息
|
|
146
|
-
this.setData({
|
|
147
|
-
signId: msgData.sign_id,
|
|
148
|
-
siginTitle: msgData.title || DEFAULT_SIGIN_TITLE,
|
|
149
|
-
signinSuccessTips: msgData.sign_in_success_tips || DEFAULT_SIGIN_SUCCESS_TIP,
|
|
150
|
-
totalTime: time,
|
|
151
|
-
remainingTime: time,
|
|
152
|
-
showTime: time,
|
|
153
|
-
formattedTime: this.formatTime(time),
|
|
154
|
-
});
|
|
155
|
-
this.startCountdown();
|
|
156
|
-
|
|
157
|
-
if (msgData.sound_status == 1) {
|
|
158
|
-
setTimeout(() => {
|
|
159
|
-
// 播放签到提示音
|
|
160
|
-
this.playSound();
|
|
161
|
-
}, 1000);
|
|
162
|
-
}
|
|
163
|
-
},
|
|
164
|
-
// 接收到“结束签到”消息的处理
|
|
165
|
-
handleSigninEnd(msgData) {
|
|
166
|
-
this.closeCountdown();
|
|
167
|
-
},
|
|
168
|
-
// 格式化时间为00:00
|
|
169
|
-
formatTime(seconds) {
|
|
170
|
-
const mins = Math.floor(seconds / 60)
|
|
171
|
-
.toString()
|
|
172
|
-
.padStart(2, '0');
|
|
173
|
-
const secs = (seconds % 60).toString().padStart(2, '0');
|
|
174
|
-
return `${mins}:${secs}`;
|
|
175
|
-
},
|
|
176
|
-
// 绘制进度条
|
|
177
|
-
drawProgress(percentage) {
|
|
178
|
-
const { ctx } = this.data;
|
|
179
|
-
if (!ctx) return;
|
|
180
|
-
const centerX = circleSize / 2;
|
|
181
|
-
const centerY = circleSize / 2;
|
|
182
|
-
const startAngle = -Math.PI / 2;
|
|
183
|
-
const endAngle = startAngle + Math.PI * 2 * percentage;
|
|
184
|
-
// 清除之前绘制
|
|
185
|
-
ctx.clearRect(0, 0, circleSize, circleSize);
|
|
186
|
-
// 绘制进度条
|
|
187
|
-
ctx.beginPath();
|
|
188
|
-
ctx.lineWidth = lineWidth;
|
|
189
|
-
ctx.strokeStyle = '#FF4D4F';
|
|
190
|
-
ctx.lineCap = 'round';
|
|
191
|
-
ctx.arc(centerX, centerY, circleRadius, startAngle, endAngle);
|
|
192
|
-
ctx.stroke();
|
|
193
|
-
},
|
|
194
|
-
|
|
195
|
-
// 开始倒计时
|
|
196
|
-
startCountdown() {
|
|
197
|
-
// 初始绘制一次
|
|
198
|
-
const percentage = 1 - this.data.showTime / this.data.totalTime;
|
|
199
|
-
this.drawProgress(percentage);
|
|
200
|
-
|
|
201
|
-
this.signed = false;
|
|
202
|
-
clearInterval(this.data.timer);
|
|
203
|
-
this.data.timer = setInterval(() => {
|
|
204
|
-
const currentTime = Date.now();
|
|
205
|
-
if (!this.startTime) {
|
|
206
|
-
// 如果还没记录开始时间,说明是刚启动定时器,记录当前时间作为开始时间
|
|
207
|
-
this.startTime = currentTime;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
// 计时,延时问题处理
|
|
211
|
-
const elapsedSeconds = Math.round((currentTime - this.startTime) / 1000);
|
|
212
|
-
const remainingSeconds = this.data.remainingTime - elapsedSeconds;
|
|
213
|
-
if (remainingSeconds <= 0) {
|
|
214
|
-
this.closeCountdown();
|
|
215
|
-
// wx.showToast({ title: '倒计时结束', icon: 'none' });
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
let showTime = this.data.showTime == remainingSeconds ? remainingSeconds - 1 : remainingSeconds;
|
|
219
|
-
const percentage = 1 - showTime / this.data.totalTime;
|
|
220
|
-
this.drawProgress(percentage);
|
|
221
|
-
|
|
222
|
-
this.setData({
|
|
223
|
-
show: true,
|
|
224
|
-
showTime,
|
|
225
|
-
formattedTime: this.formatTime(showTime),
|
|
226
|
-
});
|
|
227
|
-
}, 1000);
|
|
228
|
-
},
|
|
229
|
-
|
|
230
|
-
// 重置倒计时
|
|
231
|
-
resetCountdown() {
|
|
232
|
-
clearInterval(this.data.timer);
|
|
233
|
-
this.startTime = 0;
|
|
234
|
-
this.setData({
|
|
235
|
-
show: false,
|
|
236
|
-
remainingTime: this.data.totalTime,
|
|
237
|
-
formattedTime: this.formatTime(this.data.totalTime),
|
|
238
|
-
});
|
|
239
|
-
this.drawProgress(0);
|
|
240
|
-
},
|
|
241
|
-
|
|
242
|
-
closeCountdown() {
|
|
243
|
-
this.resetCountdown();
|
|
244
|
-
|
|
245
|
-
//开启未签到踢出&&没有签到 直接踢出
|
|
246
|
-
const signinInfo = this.store.get('signinInfo');
|
|
247
|
-
if (signinInfo && signinInfo.auto_kick_unsigned == 1 && !this.signed) {
|
|
248
|
-
this.sdkInstance._handleBizErrorCode(900004);
|
|
249
|
-
this.sdkInstance.emit(this.sdkInstance.EVENT.KICKOUT);
|
|
250
|
-
}
|
|
251
|
-
},
|
|
252
|
-
|
|
253
|
-
// 立即签到
|
|
254
|
-
onTap: debounce(async function (e) {
|
|
255
|
-
const watchInitData = this.sdkInstance.store.get('watchInitData');
|
|
256
|
-
const params = {
|
|
257
|
-
room_id: watchInitData.interact.room_id,
|
|
258
|
-
sign_id: this.data.signId,
|
|
259
|
-
interact_token: watchInitData.interact.interact_token,
|
|
260
|
-
email: watchInitData.join_info.email,
|
|
261
|
-
phone: watchInitData.join_info.phone,
|
|
262
|
-
};
|
|
263
|
-
try {
|
|
264
|
-
this.sdkInstance.BRSAgent?.customLog('click signin');
|
|
265
|
-
this.signed = true; // 标识签到过
|
|
266
|
-
const res = await this.sdkInstance.wxApi.sendPost('/v3/interacts/sign/user-sign', params);
|
|
267
|
-
// 不管成功失败都显示成功(原观看端逻辑如此)
|
|
268
|
-
wx.showToast({
|
|
269
|
-
title: this.data.signinSuccessTips || DEFAULT_SIGIN_SUCCESS_TIP,
|
|
270
|
-
icon: 'success',
|
|
271
|
-
});
|
|
272
|
-
this.closeCountdown();
|
|
273
|
-
if (res?.code != 200) {
|
|
274
|
-
this.sdkInstance.BRSAgent?.customLog('click signin failed:', JSON.stringify(res));
|
|
275
|
-
}
|
|
276
|
-
} catch (error) {
|
|
277
|
-
this.sdkInstance.BRSAgent?.customLog('click signin error:', ex?.message);
|
|
278
|
-
wx.showToast({
|
|
279
|
-
title: '网络异常!',
|
|
280
|
-
icon: 'none',
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
}, 300),
|
|
284
|
-
|
|
285
|
-
// 播放签到提示音
|
|
286
|
-
playSound() {
|
|
287
|
-
const audio = wx.createInnerAudioContext();
|
|
288
|
-
// 设置音频源(支持本地和网络路径)
|
|
289
|
-
audio.src = 'https://cnstatic01.e.vhall.com/common-static/media/notification_signin.mp3'; // 网络音频
|
|
290
|
-
// 监听音频可播放事件
|
|
291
|
-
audio.onCanplay(() => {
|
|
292
|
-
audio.play(); // 确保此时调用 play
|
|
293
|
-
});
|
|
294
|
-
audio.onEnded(() => {
|
|
295
|
-
console.log('播放结束,销毁实例');
|
|
296
|
-
audio.destroy(); // 主动销毁
|
|
297
|
-
});
|
|
298
|
-
// 错误处理
|
|
299
|
-
audio.onError((err) => {
|
|
300
|
-
this.sdkInstance.BRSAgent?.customLog('playSound error:', err.errMsg);
|
|
301
|
-
console.error('播放签到提示音失败:', err.errMsg);
|
|
302
|
-
});
|
|
303
|
-
},
|
|
304
|
-
},
|
|
305
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<mp-half-screen-dialog extClass="signin-dialog" closabled="{{false}}" bindbuttontap="buttontap" show="{{show}}" maskClosable="{{false}}">
|
|
2
|
-
<!-- 主内容区 -->
|
|
3
|
-
<view slot="desc">
|
|
4
|
-
<view class="sigin-title">{{siginTitle}}</view>
|
|
5
|
-
<!-- 倒计时容器 -->
|
|
6
|
-
<view class="countdown-container">
|
|
7
|
-
<view class="circle-background"></view>
|
|
8
|
-
<canvas canvas-id="myCanvas" id="myCanvas" type="2d" class="progress-canvas"></canvas>
|
|
9
|
-
<!-- 中央时间显示 -->
|
|
10
|
-
<view class="time-display">{{formattedTime}}</view>
|
|
11
|
-
<cover-view class="start-marker"></cover-view>
|
|
12
|
-
</view>
|
|
13
|
-
</view>
|
|
14
|
-
<!-- 底部区 -->
|
|
15
|
-
<view slot="footer">
|
|
16
|
-
<button class="weui-btn" type="primary" bindtap="onTap">立即签到</button>
|
|
17
|
-
</view>
|
|
18
|
-
</mp-half-screen-dialog>
|
|
19
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.signin-dialog{background-color:#fff;background-image:url(https://cnstatic01.e.vhall.com/common-static/images/mp/signin_dialog_bg.png);background-position:top;background-repeat:no-repeat;background-size:cover}.signin-dialog .weui-half-screen-dialog__hd{min-height:64rpx}.signin-dialog .sigin-title{font-size:16px;text-align:center}.signin-dialog .countdown-container{height:200rpx;margin:60rpx auto 10rpx;overflow:hidden;position:relative;width:200rpx}.signin-dialog .countdown-container .start-marker{background-color:#fff;border-radius:50%;height:12rpx;left:50%;margin-left:-6rpx;margin-top:4rpx;position:absolute;top:0;width:12rpx;z-index:3}.signin-dialog .countdown-container .circle-background{border:20rpx solid #eee;border-radius:50%;box-sizing:border-box;height:100%;width:100%}.signin-dialog .countdown-container .progress-canvas{height:200rpx;left:0;position:absolute;top:0;width:200rpx;z-index:1}.signin-dialog .countdown-container .time-display{color:#000;font-family:sans-serif;font-size:1.57rem;left:50%;position:absolute;top:50%;transform:translate(-50%,-50%)}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.top-notify{align-items:center;background:#fff2f0;color:#fb2626;display:flex;font-size:14px;height:36px;justify-content:center;width:100%}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { timeToTimestamp } from '../../shared/utils.js';
|
|
2
|
-
Component({
|
|
3
|
-
properties: {
|
|
4
|
-
sdkInstance: {
|
|
5
|
-
type: Object,
|
|
6
|
-
value: null,
|
|
7
|
-
},
|
|
8
|
-
},
|
|
9
|
-
data: {
|
|
10
|
-
days: '00',
|
|
11
|
-
hours: '00',
|
|
12
|
-
minutes: '00',
|
|
13
|
-
seconds: '00',
|
|
14
|
-
timer: null,
|
|
15
|
-
},
|
|
16
|
-
observers: {
|
|
17
|
-
sdkInstance(_sdkInstance) {
|
|
18
|
-
if (!_sdkInstance) return;
|
|
19
|
-
this.sdkInstance = _sdkInstance;
|
|
20
|
-
this.store = _sdkInstance.store;
|
|
21
|
-
|
|
22
|
-
this.unsub = this.store.get({
|
|
23
|
-
liveInfo: (val) => {
|
|
24
|
-
val.startTime && this.initCountdown(timeToTimestamp(val.startTime));
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
lifetimes: {
|
|
30
|
-
detached() {
|
|
31
|
-
// 组件销毁时清除定时器
|
|
32
|
-
this.unsub && this.unsub();
|
|
33
|
-
if (this.data.timer) {
|
|
34
|
-
clearInterval(this.data.timer);
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
|
|
39
|
-
methods: {
|
|
40
|
-
// 初始化倒计时
|
|
41
|
-
initCountdown(time) {
|
|
42
|
-
// 清除已有的定时器
|
|
43
|
-
if (this.data.timer) {
|
|
44
|
-
clearInterval(this.data.timer);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// 计算并更新倒计时
|
|
48
|
-
this.updateCountdown(time);
|
|
49
|
-
|
|
50
|
-
// 设置定时器,每秒更新一次
|
|
51
|
-
this.setData({
|
|
52
|
-
timer: setInterval(() => {
|
|
53
|
-
this.updateCountdown(time);
|
|
54
|
-
}, 1000),
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
|
|
58
|
-
// 更新倒计时显示
|
|
59
|
-
updateCountdown(time) {
|
|
60
|
-
const now = Date.now();
|
|
61
|
-
const target = time;
|
|
62
|
-
const diff = target - now;
|
|
63
|
-
|
|
64
|
-
// 计算剩余的天、时、分、秒
|
|
65
|
-
let days = '00',
|
|
66
|
-
hours = '00',
|
|
67
|
-
minutes = '00',
|
|
68
|
-
seconds = '00';
|
|
69
|
-
|
|
70
|
-
if (diff > 0) {
|
|
71
|
-
days = Math.floor(diff / (1000 * 60 * 60 * 24));
|
|
72
|
-
const remaining = diff % (1000 * 60 * 60 * 24);
|
|
73
|
-
|
|
74
|
-
hours = Math.floor(remaining / (1000 * 60 * 60));
|
|
75
|
-
const remaining2 = remaining % (1000 * 60 * 60);
|
|
76
|
-
|
|
77
|
-
minutes = Math.floor(remaining2 / (1000 * 60));
|
|
78
|
-
seconds = Math.floor((remaining2 % (1000 * 60)) / 1000);
|
|
79
|
-
|
|
80
|
-
// 补零处理
|
|
81
|
-
days = days.toString().padStart(2, '0');
|
|
82
|
-
hours = hours.toString().padStart(2, '0');
|
|
83
|
-
minutes = minutes.toString().padStart(2, '0');
|
|
84
|
-
seconds = seconds.toString().padStart(2, '0');
|
|
85
|
-
} else {
|
|
86
|
-
// 倒计时结束,显示00,并清除定时器
|
|
87
|
-
clearInterval(this.data.timer);
|
|
88
|
-
this.setData({ timer: null });
|
|
89
|
-
// 触发倒计时结束事件
|
|
90
|
-
this.triggerEvent('countdownEnd');
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// 更新数据
|
|
94
|
-
this.setData({ days, hours, minutes, seconds });
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
});
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<view class="countdown-container">
|
|
2
|
-
<text class="unit">距离开播</text>
|
|
3
|
-
<view class="countdown-item" wx:if="{{days > 0}}">
|
|
4
|
-
<text class="number">{{days}}</text>
|
|
5
|
-
<text class="unit">天</text>
|
|
6
|
-
</view>
|
|
7
|
-
<view class="countdown-item">
|
|
8
|
-
<text class="number">{{hours}}</text>
|
|
9
|
-
<text class="unit">时</text>
|
|
10
|
-
</view>
|
|
11
|
-
<view class="countdown-item">
|
|
12
|
-
<text class="number">{{minutes}}</text>
|
|
13
|
-
<text class="unit">分</text>
|
|
14
|
-
</view>
|
|
15
|
-
<view class="countdown-item">
|
|
16
|
-
<text class="number">{{seconds}}</text>
|
|
17
|
-
<text class="unit">秒</text>
|
|
18
|
-
</view>
|
|
19
|
-
</view>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.countdown-container{gap:8rpx;justify-content:center;padding:16rpx}.countdown-container,.countdown-item{align-items:baseline;display:flex}.number{font-size:2.14rem;font-weight:600;margin:0 10rpx}.unit{font-size:.86rem}
|