bayi 1 年之前
父節點
當前提交
f97460ab84
共有 2 個文件被更改,包括 19 次插入10 次删除
  1. 8 1
      pages/pkResult/index.js
  2. 11 9
      pages/pkResult/index.wxml

+ 8 - 1
pages/pkResult/index.js

@@ -24,7 +24,6 @@ Page({
         dState: false,
         dStart: '00:00',
         dEnd: '00:00',
-        dProgress: 0,
         currentType: '',
         victory: {},
         defeated: {},
@@ -48,6 +47,14 @@ Page({
         })
         this.compareScore(pkRecordVOS)
         this.innerAudioContext = wx.createInnerAudioContext()
+        this.innerAudioContext.onEnded(res => {
+            let label = this.data.currentType == 'victory' ? 'vStart' : 'dStart'
+            this.setData({
+                [label]: '00:00',
+                vState: false,
+                dState: false,
+            })
+        })
         await userEvent({
             action: 'WXPKSCORE',
         })

+ 11 - 9
pages/pkResult/index.wxml

@@ -2,9 +2,10 @@
 <view class="pkResult">
     <view class="body">
         <view class="userBox left">
-            <image src="" class="avatar avatarL" />
-            <view class="bodyTitle textOver">名字名字名字</view>
-            <view class="bodyScore">100分</view>
+            <image src="{{victory.user.avatar}}" class="avatar avatarL" />
+            <view class="bodyTitle textOver">{{victory.user.nickName||victory.user.eid}}</view>
+            <view class="bodyScore" wx:if="{{victory.userReadExtend.businessType!=2}}">{{victory.userRead.score}}分
+            </view>
             <view class="duration">
                 <image src="{{vState?'/static/play-big2.png':'/static/play-big.png'}}" class="bodyPlay"
                     bindtap="playAudio" data-type="victory" />
@@ -12,13 +13,14 @@
             </view>
         </view>
         <view class="userBox right">
-            <image src="" class="avatar avatarL" />
-            <view class="bodyTitle textOver">名字名字名字</view>
-            <view class="bodyScore">100分</view>
+            <image src="{{defeated.user.avatar}}" class="avatar avatarL" />
+            <view class="bodyTitle textOver">{{defeated.user.nickName||defeated.user.eid}}</view>
+            <view class="bodyScore" wx:if="{{victory.userReadExtend.businessType!=2}}">{{defeated.userRead.score}}分
+            </view>
             <view class="duration">
-                <image src="{{vState?'/static/play-big2.png':'/static/play-big.png'}}" class="bodyPlay"
-                    bindtap="playAudio" data-type="victory" />
-                <view class="time">{{vStart}}/{{vEnd}}</view>
+                <image src="{{dState?'/static/play-big2.png':'/static/play-big.png'}}" class="bodyPlay"
+                    bindtap="playAudio" data-type="defeated" />
+                <view class="time">{{dStart}}/{{dEnd}}</view>
             </view>
         </view>
     </view>