From 063842ab1a71d91b01151781b43c4c6a6422e3c8 Mon Sep 17 00:00:00 2001 From: luyisha Date: Fri, 10 Nov 2023 17:10:20 +0800 Subject: [PATCH] 1 --- pages/recordsList/recordsList.vue | 6 ++++-- pages/scratchCard/scratch.js | 8 +++++-- pages/scratchCard/scratchCard.vue | 35 +++++++++++++++++++++++-------- 3 files changed, 36 insertions(+), 13 deletions(-) diff --git a/pages/recordsList/recordsList.vue b/pages/recordsList/recordsList.vue index 5dcf617..418704e 100644 --- a/pages/recordsList/recordsList.vue +++ b/pages/recordsList/recordsList.vue @@ -20,7 +20,8 @@ 可提余额: 剩余: - 余额: + {{item.actual_type}}: + 余额: {{item.amount2}} @@ -166,7 +167,8 @@ amount1: item.actual_price, amount2: item.residue_amount, time: item.create_time, - zone_title: item.zone_title + zone_title: item.zone_title, + actual_type: item.actual_type } }); if(this.page===1){ diff --git a/pages/scratchCard/scratch.js b/pages/scratchCard/scratch.js index 2858167..97de1c2 100644 --- a/pages/scratchCard/scratch.js +++ b/pages/scratchCard/scratch.js @@ -1,6 +1,6 @@ class Scratch { - constructor (page, opts) { + constructor (page, opts, callback) { opts = opts || {} this.page = page this.canvasId = opts.canvasId || 'canvas' @@ -20,6 +20,7 @@ class Scratch { this.codeType = opts.codeType this.direction = opts.direction;//号码行数 this.transverse = opts.transverse;//每行个数 + this.callback = callback; this.init() // console.log(this.scale); } @@ -73,7 +74,10 @@ class Scratch { // this.ctx.drawImage(this.bgImg, Math.floor(sx), Math.floor(sy), Math.floor(swidth), Math.floor(sheight), x, y, Math.floor(width), Math.floor(height)); this.ctx.setFillStyle(this.maskColor) this.ctx.fillRect(0, 0, this.width, this.height) - this.ctx.draw() + this.ctx.draw(); + if(this.callback){ + this.callback(); + } } bindTouch () { diff --git a/pages/scratchCard/scratchCard.vue b/pages/scratchCard/scratchCard.vue index 13bedaf..0ba0f03 100644 --- a/pages/scratchCard/scratchCard.vue +++ b/pages/scratchCard/scratchCard.vue @@ -6,7 +6,7 @@ - + @@ -108,6 +108,7 @@ + @@ -174,10 +175,10 @@ export default { // console.log(n,o); if(n && n!=o){ - if(this.code==='digit_number_icon'){ - this.changeShowCount(); - return; - } + // if(this.code==='digit_number_icon'){ + // this.changeShowCount(); + // return; + // } this.showResult = true; this.gai = false; this.doPrizeScratchTicketFun(); @@ -259,6 +260,7 @@ export default { }, initCanvas () { + let _this = this; // 刮奖初始化信息必须在onReady后,不然h5不支持(小程序可在onLoad执行) this.guaCanvas = new Scratch(this, { canvasId: 'guagua', @@ -271,8 +273,13 @@ export default { codeType: this.code, direction: this.direction,//号码行数 transverse: this.transverse,//每行个数 - }) + }, function(){ + setTimeout(()=>{ + _this.showBackboard = true; + }, 1000) + }) if(this.code==='digit_number_icon'){ + return; this.guaCanvasL = new Scratch(this.$refs.leftCa, { canvasId: 'guaguaLeft', width: this.scratchTopWidthL, @@ -310,9 +317,6 @@ export default { this.prizeList = res.data.prizes_data; this.prizesIconList = res.data.prizes_icon_data; // console.log(this.dataList, 'dataList----'); - setTimeout(()=>{ - this.showBackboard = true; - }, 1000) }) }, // 请求刮奖结果 @@ -803,4 +807,17 @@ export default { transform: scale(1); } } +.backBtn{ + font-size: 14px; + padding: 10px 20px; + color: #12488a; + // background-color: #12488a; + position: fixed; + z-index: 999; + right: 10px; + bottom: 30px; + border-radius: 100px; + font-weight: bold; + text-shadow: 1px 1px 3px #fff; +} \ No newline at end of file