suizhijia пре 5 година
родитељ
комит
0b379e1c5d
4 измењених фајлова са 95 додато и 54 уклоњено
  1. +45
    -20
      496_dongfengqichen/pages/poster/poster.js
  2. +6
    -5
      496_dongfengqichen/pages/poster/poster.wxml
  3. +30
    -17
      496_dongfengqichen/pages/poster/poster.wxss
  4. +14
    -12
      496_dongfengqichen/pages/star/star.js

+ 45
- 20
496_dongfengqichen/pages/poster/poster.js Прегледај датотеку

@@ -11,7 +11,7 @@ Page({
posterBg:[false,false,false],//海报背景
qrCodeUrl:"",//二维码图片
userHead: app.globalData.userInfoData ? app.globalData.userInfoData.avatarUrl : null,//用户头像
rankNum: '0000',//缓存数字
rankNum: '0',//缓存数字
windowScale:0,//屏幕缩放比
windowW: 0,//屏幕宽度
windowH: 0,//屏幕高度
@@ -21,7 +21,8 @@ Page({
userInfoData: app.globalData.userInfoData,
posterState:false,//海报是否合成完毕
posterBottom:null,
selectType:1
selectType:1,
numBg:["","","",""],
},

/**
@@ -70,12 +71,38 @@ Page({
}
})
}
wx.getImageInfo({//缓存数字背景
src: this.data.imgUrl + '/images/posterNum.png?v=004',
// wx.getImageInfo({//缓存数字背景
// src: this.data.imgUrl + '/images/posterNum.png?v=004',
// success: res => {
// this.data.numBg = res.path;
// }
// })
wx.getImageInfo({//缓存数字背景1
src: this.data.imgUrl + '/newImages3/posterNum1.png?v=004',
success: res => {
this.data.numBg = res.path;
this.data.numBg[0] = res.path;
}
})
wx.getImageInfo({//缓存数字背景2
src: this.data.imgUrl + '/newImages3/posterNum2.png?v=004',
success: res => {
this.data.numBg[1] = res.path;
}
})
wx.getImageInfo({//缓存数字背景3
src: this.data.imgUrl + '/newImages3/posterNum3.png?v=004',
success: res => {
this.data.numBg[2] = res.path;
}
})
wx.getImageInfo({//缓存数字背景4
src: this.data.imgUrl + '/newImages3/51.png?v=005',
success: res => {
this.data.numBg[3] = res.path;
}
})


wx.getImageInfo({//缓存海报底部图片
src: this.data.imgUrl + "/newImages/posterBottom.png?v=002",
success: res => {
@@ -220,12 +247,15 @@ Page({
ctx.setTextAlign('left');
ctx.fillText(app.globalData.userInfoData ? app.globalData.userInfoData.nickName : "", scale * 174, scale *960);
//我是第XXX星探
ctx.drawImage(this.data.numBg, scale * 86, scale * 1010, scale * 563, scale * 124);
// ctx.drawImage(this.data.numBg, scale * 86, scale * 1010, scale * 563, scale * 124);
ctx.drawImage(this.data.numBg[0], scale * 86, scale * 1016, scale * 172, scale * 55);
ctx.drawImage(this.data.numBg[1], scale * (303+this.data.rankNum.length*58), scale * 1016, scale * 111, scale * 54);
ctx.drawImage(this.data.numBg[2], scale * 86, scale * 1098, scale * 308, scale * 32);
//排名数字
ctx.drawImage(this.data.rankNum[0], scale * 286, scale * 1012, scale * 52, scale * 70);
ctx.drawImage(this.data.rankNum[1], scale * 343, scale * 1012, scale * 52, scale * 70);
ctx.drawImage(this.data.rankNum[2], scale * 401, scale * 1012, scale * 52, scale * 70);
ctx.drawImage(this.data.rankNum[3], scale * 459, scale * 1012, scale * 52, scale * 70);
for(let i=0;i<this.data.rankNum.length;i++){
ctx.drawImage(this.data.numBg[3], scale * (283+i*58), scale * 1010, scale * 58, scale * 77);
ctx.drawImage(this.data.rankNum[i], scale * (285+i*59), scale * 1012, scale * 52, scale * 70);
}
//二维码
ctx.drawImage(this.data.posterBottom, 0, scale * 1213, scale * 750, scale * 167);
ctx.drawImage(this.data.qrCodeUrl, scale * 566, scale * 1220, scale * 140, scale * 140);
@@ -275,20 +305,15 @@ Page({
if(res.code==200){
if(res.data){
if (res.data.certificationNum){
if (res.data.certificationNum<10){
this.data.rankNum = ("000" + res.data.certificationNum.toString()).split("");
} else if (res.data.certificationNum < 100) {
this.data.rankNum = ("00" + res.data.certificationNum.toString()).split("");
} else if (res.data.certificationNum < 1000) {
this.data.rankNum = ("0" + res.data.certificationNum.toString()).split("");
} else {
res.data.certificationNum = 9990;
this.data.rankNum = res.data.certificationNum.toString().split("");
}
// console.log(this.data.rankNum);
// }
}else{
this.data.rankNum = "0000".split("");
this.data.rankNum = "0".split("");
}
}else{
this.data.rankNum = "0000".split("");
this.data.rankNum = "0".split("");
}
this.setData({
rankNum: this.data.rankNum

+ 6
- 5
496_dongfengqichen/pages/poster/poster.wxml Прегледај датотеку

@@ -25,12 +25,13 @@
<view class="userNickName">{{userInfoData.nickName?userInfoData.nickName:""}}</view>
</view>
<view class="userNumber">
<image class="posterNum" src="{{imgUrl+'/images/posterNum.png'}}"></image>
<image class="posterNum" style="display:none;" src="{{imgUrl+'/images/posterNum.png'}}"></image>
<image class="posterNum1" src="{{imgUrl+'/newImages3/posterNum1.png'}}"></image>
<image class="posterNum2" style="left:{{105+(rankNum.length*40)}}rpx" src="{{imgUrl+'/newImages3/posterNum2.png'}}"></image>
<image class="posterNum3" src="{{imgUrl+'/newImages3/posterNum3.png'}}"></image>
<view class="numberGroup">
<image class="numberNum numberNum1" src="{{imgUrl+'/images/nums/'+rankNum[0]+'.png'}}"></image>
<image class="numberNum numberNum2" src="{{imgUrl+'/images/nums/'+rankNum[1]+'.png'}}"></image>
<image class="numberNum numberNum3" src="{{imgUrl+'/images/nums/'+rankNum[2]+'.png'}}"></image>
<image class="numberNum numberNum4" src="{{imgUrl+'/images/nums/'+rankNum[3]+'.png'}}"></image>
<image class="newImages3-51" style="left:{{100+40*index}}rpx" wx:for="{{rankNum}}" wx:key="index" src="{{imgUrl+'/newImages3/51.png?v=002'}}"></image>
<image class="numberNum" style="left:{{103+40*index}}rpx" wx:for="{{rankNum}}" wx:key="index" src="{{imgUrl+'/images/nums/'+rankNum[index]+'.png'}}"></image>
</view>
</view>
<image class="posterBottom" mode="widthFix" src="{{imgUrl + '/newImages/posterBottom.png?v=002'}}"></image>

+ 30
- 17
496_dongfengqichen/pages/poster/poster.wxss Прегледај датотеку

@@ -164,8 +164,8 @@ view{
position: absolute;
left: 50rpx;
top: 598rpx;
width: 333rpx;
height: 74rpx;
/* width: 333rpx;
height: 74rpx; */
}
.posterNum{
position: absolute;
@@ -174,6 +174,34 @@ view{
width: 100%;
height: 100%;
}
.posterNum1{
position: absolute;
left: 0;
top: 9rpx;
width: 93rpx;
height: 30rpx;
}
.posterNum2{
position: absolute;
left: 0;
top: 9rpx;
width: 62rpx;
height: 30rpx;
}
.posterNum3{
position: absolute;
left: 0;
top: 52rpx;
width: 193rpx;
height: 20rpx;
}
.newImages3-51{
position: absolute;
left: 0;
top: -4rpx;
width: 38rpx;
height: 50rpx;
}
.numberGroup{
width: 100%;
height: 100%;
@@ -183,21 +211,6 @@ view{
width: 32rpx;
height: 40rpx;
position: absolute;
}
.numberNum1{
left: 120rpx;
top: 4rpx;
}
.numberNum2{
left: 155rpx;
top: 4rpx;
}
.numberNum3{
left: 188rpx;
top: 4rpx;
}
.numberNum4{
left: 223rpx;
top: 4rpx;
}
.posterBottom{

+ 14
- 12
496_dongfengqichen/pages/star/star.js Прегледај датотеку

@@ -133,30 +133,32 @@ Page({
console.log(res)
if (res.code == 200) {
if (res.data){
this.data.starNumber = res.data.total-1000<0?0:res.data.total-1000;
this.setData({
stopNumber: res.data.total ? res.data.total : '0000'
stopNumber: res.data.total ? res.data.total : '0'
})
} else {
this.setData({
stopNumber: '0000'
})
}
if (this.data.stopNumber < 10000) {
this.setData({
numList: [4, 0, 0, 0]
})
} else {
this.setData({
numList: [0, 4, 0, 0, 0]
stopNumber: '0'
})
}
// if (this.data.stopNumber < 10000) {
// this.setData({
// numList: [4, 0, 0, 0]
// })
// } else {
// this.setData({
// numList: [0, 4, 0, 0, 0]
// })
// }
this.getNumber = setInterval(this.vCodeDownTime, 20);
}
}, this);
},
vCodeDownTime(){
var numb = this.data.starNumber;
numb=Math.floor(this.data.starNumber+(this.data.stopNumber-4000)/80);
// numb=Math.floor(this.data.starNumber+(this.data.stopNumber-4000)/80);
numb=Math.floor(this.data.starNumber+this.data.stopNumber/80);
if(numb>=this.data.stopNumber){
numb=this.data.stopNumber;
clearInterval(this.getNumber);

Loading…
Откажи
Сачувај