|
@@ -45,7 +45,6 @@ Page({
|
|
|
pkRecord,
|
|
|
isplayback: options.playback || false
|
|
|
})
|
|
|
- this.compareScore(pkRecordVOS)
|
|
|
this.innerAudioContext = wx.createInnerAudioContext()
|
|
|
this.innerAudioContext.onEnded(res => {
|
|
|
let label = this.data.currentType == 'victory' ? 'vStart' : 'dStart'
|
|
@@ -55,6 +54,9 @@ Page({
|
|
|
dState: false,
|
|
|
})
|
|
|
})
|
|
|
+ // this.compareScore()
|
|
|
+ this.compareScore(pkRecordVOS)
|
|
|
+
|
|
|
await userEvent({
|
|
|
action: 'WXPKSCORE',
|
|
|
})
|
|
@@ -62,7 +64,7 @@ Page({
|
|
|
compareScore(resultData) {
|
|
|
let first = resultData[0]
|
|
|
let second = resultData[1]
|
|
|
- /* let first = {
|
|
|
+ /* let first = {
|
|
|
"readMaskTemplate": null,
|
|
|
"user": {
|
|
|
"avatar": "http://reader-wx.ai160.com/images/reader/v3/boy.png",
|
|
@@ -219,7 +221,7 @@ Page({
|
|
|
"originVideo": "http://reader-wx.ai160.com/audio/reader/001/LD00103248/LD00103248005-2.mp3",
|
|
|
"playAmount": 0,
|
|
|
"resourcesType": null,
|
|
|
- "score": 19,
|
|
|
+ "score": 100,
|
|
|
"shareAmount": 0,
|
|
|
"shareImg": "",
|
|
|
"sort": 0,
|
|
@@ -229,7 +231,7 @@ Page({
|
|
|
"title": "一剪梅\n[ 宋 ] 李清照",
|
|
|
"traceId": "396d30110403fd2d8ee5b73f9b7853bc",
|
|
|
"type": "READ",
|
|
|
- "uid": "d83d947655f6455a96f4197d31afa6d4",
|
|
|
+ "uid": "9db2bedb2b9b47c5b0358bb9bec39145",
|
|
|
"videoPath": "https://reader-wx.ai160.com/reader/resource/video/1702345717919478.mp4"
|
|
|
},
|
|
|
"userReadExtend": {
|
|
@@ -248,14 +250,19 @@ Page({
|
|
|
let defeated = second.userRead.score < first.userRead.score ? second : first
|
|
|
let uid = wx.getStorageSync('uid')
|
|
|
let equal = first.userReadExtend.businessType != 2 ? first.userRead.score == second.userRead.score : true
|
|
|
+ let win = !equal && victory.userRead.uid == uid
|
|
|
this.setData({
|
|
|
victory,
|
|
|
defeated,
|
|
|
equal,
|
|
|
- win: !equal && victory.userRead.uid == uid,
|
|
|
+ win,
|
|
|
vEnd: setDuration(victory.userRead.duration),
|
|
|
dEnd: setDuration(defeated.userRead.duration),
|
|
|
})
|
|
|
+ if (!this.data.isplayback) {
|
|
|
+ this.innerAudioContext.src = win || equal ? '/static/music/win.mp3' : '/static/music/lose.mp3'
|
|
|
+ this.innerAudioContext.play();
|
|
|
+ }
|
|
|
},
|
|
|
playAudio({
|
|
|
currentTarget
|
|
@@ -340,7 +347,11 @@ Page({
|
|
|
}).exec((res) => {
|
|
|
const canvas = res[0].node;
|
|
|
const ctx = canvas.getContext('2d');
|
|
|
- const dpr = 0.84;
|
|
|
+ // #if MP
|
|
|
+ const dpr = wx.getSystemInfoSync().pixelRatio;
|
|
|
+ // #elif ANDROID
|
|
|
+ const dpr = 0.84
|
|
|
+ // #endif
|
|
|
canvas.width = res[0].width * dpr;
|
|
|
canvas.height = res[0].height * dpr;
|
|
|
ctx.scale(dpr, dpr);
|