1
0

2 Commits 59e35ac839 ... bec1d6bc68

Autor SHA1 Nachricht Datum
  bayi bec1d6bc68 开发pk动画与音乐 vor 1 Jahr
  bayi 149946da33 开发 vor 1 Jahr

+ 17 - 6
pages/pkResult/index.js

@@ -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);

+ 8 - 2
pages/pkResult/index.less

@@ -13,7 +13,6 @@
         width: 600rpx;
         height: 674rpx;
 
-
         .userBox {
             position: absolute;
             bottom: 0;
@@ -74,7 +73,6 @@
         .right {
             right: 0;
             padding-left: 70rpx;
-            background-color: rgba(255, 166, 0, 0.212);
 
             .duration {
                 padding-right: 20rpx;
@@ -85,6 +83,14 @@
                 }
             }
         }
+
+        .celebrate {
+            position: absolute;
+            left:20rpx;
+            top: -160rpx;
+            width: 600rpx;
+            height: 600rpx;
+        }
     }
 
     .body-win {

+ 9 - 2
pages/pkResult/index.wxml

@@ -1,6 +1,7 @@
 <wxs src="../../utils/filter.wxs" module="filters" />
 <view class="pkResult">
     <view class="body {{win?'body-win':equal?'body-equal':'body-lose'}}">
+        <image src="https://reader-wx.ai160.com/images/reader/v3/biu.gif" class="celebrate" wx:if="{{win||equal}}"/>
         <view class="userBox left">
             <image src="{{victory.user.avatar}}" class="avatar avatarL" />
             <view class="bodyTitle textOver">{{victory.user.nickName||victory.user.eid}}</view>
@@ -35,8 +36,14 @@
         </button>
     </view>
     <view class="footer" wx:else>
-        <view class="stBtn" bindtap="result" data-type="wantPlay">我也要玩</view>
-        <view class="btn" bindtap="result" data-type="index">回到首页</view>
+        <view class="stBtn" bindtap="result" data-type="wantPlay">
+            <image src="/static/pr1.png" class="imgBtn" />
+            <view class="text">我也要玩</view>
+        </view>
+        <view class="stBtn" bindtap="result" data-type="index">
+            <image src="/static/pr2.png" class="imgBtn" />
+            <view class="text">回到首页</view>
+        </view>
     </view>
 </view>
 <canvas id='share' type="2d"> </canvas>

+ 7 - 1
pages/pkResult/index.wxss

@@ -64,7 +64,6 @@
 .pkResult .body .right {
   right: 0;
   padding-left: 70rpx;
-  background-color: rgba(255, 166, 0, 0.212);
 }
 .pkResult .body .right .duration {
   padding-right: 20rpx;
@@ -73,6 +72,13 @@
 .pkResult .body .right .duration .time {
   justify-content: flex-end;
 }
+.pkResult .body .celebrate {
+  position: absolute;
+  left: 20rpx;
+  top: -160rpx;
+  width: 600rpx;
+  height: 600rpx;
+}
 .pkResult .body-win {
   background: url('https://reader-wx.ai160.com/images/reader/v3/win.png') no-repeat;
   background-size: 100% 100%;

BIN
static/music/lose.mp3


BIN
static/music/win.mp3


+ 5 - 5
utils/request.js

@@ -6,19 +6,19 @@ const {
         envVersion
     }
 } = wx.getAccountInfoSync();
-if (envVersion == 'develop') {
+/* if (envVersion == 'develop') {
     baseUrl = 'https://reader-api.efunbox.cn/wx'
     oldUrl = 'https://reader-api.efunbox.cn'
-} else {
+} else { */
     baseUrl = 'https://reader-api.ai160.com/wx'
     oldUrl = 'https://reader-api.ai160.com'
-}
+// }
 
 function request(url, method, data, oldBaseUrl = false, intercept = true) {
     let header = {
         'uid': wx.getStorageSync('uid') || '',
-        // 'channelCode': wx.getStorageSync('user').channel == '4001' ? '4001' : '3001'
-        'channelCode': 3006
+        'channelCode': wx.getStorageSync('user').channel == '4001' ? '4001' : '3001'
+        // 'channelCode': 3006
     }
     return new Promise((reslove, reject) => {
         wx.request({

+ 4 - 3
小咖秀公众号支付/index.html

@@ -51,15 +51,16 @@
       border-color: #ff935e;
     }
     .c-1 {
-      background: url('http://reader-wx.ai160.com/images/reader/v3/299.png') no-repeat;
-      background-size: contain;
+      background-size: contain;  
+      background: url('http://reader-wx.ai160.com/images/reader/v3/15.png') no-repeat;
     }
     .c-2 {
       background: url('http://reader-wx.ai160.com/images/reader/v3/99.png') no-repeat;
       background-size: contain;
     }
     .c-3 {
-      background: url('http://reader-wx.ai160.com/images/reader/v3/15.png') no-repeat;
+    
+      background: url('http://reader-wx.ai160.com/images/reader/v3/299.png') no-repeat;
       background-size: contain;
     }
     .payBox {