Commit 3eeda169 authored by zhangjinzhou's avatar zhangjinzhou

代码暂存

parent 73b5ffc0
{ {
"pages": [ "pages": [
"pages/pagegamemain/pagegamemain", "pages/pagepageindex/pagepageindex",
"pages/pagepageindex/pagepageindex", "pages/pagegamemain/pagegamemain",
"pages/pagepagerank/pagepagerank", "pages/pagepagerank/pagepagerank",
"pages/tbccDemo/tbccDemo", "pages/tbccDemo/tbccDemo",
"pages/goodsPage/goodsPage", "pages/goodsPage/goodsPage",
"pages/myprize/myprize" "pages/myprize/myprize"
], ],
"window": { "window": {
"enableSkia": "true", "enableSkia": "true",
"allowsBounceVertical": "NO" "allowsBounceVertical": "NO"
} }
} }
\ No newline at end of file
<view class="gameinvitemodal "> <view class="gameinvitemodal ">
<image class="gameinvitebg " src={{resList['cb276914-4e1e-4153-96a2-038ce9e6b89a'].url}} /> <image class="gameinvitebg " src={{resList['cb276914-4e1e-4153-96a2-038ce9e6b89a'].url}} />
<view class="gameinvitetext "> <view class="gameinvitetext ">
<span class="gameinvitetitle ">恭喜你</span> <label class="gameinvitetitle ">恭喜你</label>
<span class="gameinvitecnt ">成功邀请了X名好友</span> <label class="gameinvitecnt ">成功邀请了{{invitenum}}名好友</label>
<span class="gameinvitetemp ">队伍升温了XX度</span> <label class="gameinvitetemp ">队伍升温了{{warmprize}}度</label>
</view> </view>
<image class="gameinvitebtn " src={{resList['bbbfb7af-4106-4835-b44e-d98b9b93b632'].url}} /> <image class="gameinvitebtn " src={{resList['bbbfb7af-4106-4835-b44e-d98b9b93b632'].url}} onTap="onClose" />
<image class="gameinviteclose " src={{resList['5eee69bb-482c-4ce0-beb1-c7c38cdb6fe4'].url}} /> <image class="gameinviteclose " src={{resList['5eee69bb-482c-4ce0-beb1-c7c38cdb6fe4'].url}} onTap="onClose" />
</view> </view>
\ No newline at end of file
...@@ -2,14 +2,26 @@ ...@@ -2,14 +2,26 @@
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
Component({ Component({
props: {}, props: {
data: {},
methods: {},
onInit(props) { },
data: {
resList: resList,
invitenum:0,
warmprize:0,
},
methods: {
onClose() {
const { onClose } = this.props;
onClose && onClose();
},
},
didMount() {
let {chacount,chawarm} = this.props.inviteData;
this.setData({ this.setData({
resList: resList invitenum:chacount,
warmprize:chawarm
}); });
} }
}); });
\ No newline at end of file
.gcanvas {
width:100%;
height:100%;
z-index: 99;
pointer-events: none;
}
.gamemain { .gamemain {
top: 0rpx; top: 0rpx;
left: 0rpx; left: 0rpx;
...@@ -500,6 +506,54 @@ letter-spacing: 3rpx; ...@@ -500,6 +506,54 @@ letter-spacing: 3rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
} }
.gamemain .gamembot .gamemsharegro .gamemhrolei {
width: 80rpx;
height: 80rpx;
opacity: 1;
display: block;
left: 2.5rpx;
top: 2rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
mask-image: url(//yun.duiba.com.cn/spark/assets/gamea1toobg1.2de09b090890e833c949d3b8fe17f5192461aee7.png);
mask-size: 80rpx 80rpx;
}
.gamemain .gamembot .gamemsharegro .gamenrolei1 {
width: 80rpx;
height: 80rpx;
opacity: 1;
display: block;
left: 112.5rpx;
top: 2rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
mask-image: url(//yun.duiba.com.cn/spark/assets/gamea1toobg1.2de09b090890e833c949d3b8fe17f5192461aee7.png);
mask-size: 80rpx 80rpx;
}
.gamemain .gamembot .gamemsharegro .gamenrolei2 {
width: 80rpx;
height: 80rpx;
opacity: 1;
display: block;
left: 222.5rpx;
top: 2rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
mask-image: url(//yun.duiba.com.cn/spark/assets/gamea1toobg1.2de09b090890e833c949d3b8fe17f5192461aee7.png);
mask-size: 80rpx 80rpx;
}
.gamemain .gamembot .gamemsharegro .gamenrolei3 {
width: 80rpx;
height: 80rpx;
opacity: 1;
display: block;
left: 332.5rpx;
top: 2rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
mask-image: url(//yun.duiba.com.cn/spark/assets/gamea1toobg1.2de09b090890e833c949d3b8fe17f5192461aee7.png);
mask-size: 80rpx 80rpx;
}
.gamemain .gamembot .gamemsharegro .gamemsharebtn { .gamemain .gamembot .gamemsharegro .gamemsharebtn {
width: 404rpx; width: 404rpx;
height: 74rpx; height: 74rpx;
...@@ -713,10 +767,11 @@ letter-spacing: 3rpx; ...@@ -713,10 +767,11 @@ letter-spacing: 3rpx;
opacity: 1; opacity: 1;
display: block; display: block;
left: 0rpx; left: 0rpx;
top: 0rpx; top: 405rpx;
letter-spacing: 2rpx;
position: absolute; position: absolute;
font-size: 37rpx; font-size: 37rpx;
color: #000000; color: #ffffff;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
text-align: center; text-align: center;
} }
...@@ -770,6 +825,54 @@ letter-spacing: 3rpx; ...@@ -770,6 +825,54 @@ letter-spacing: 3rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
} }
.gamemain .gamempipei .gamemppload .gamemppimga1 {
width: 110rpx;
height: 110rpx;
opacity: 1;
display: block;
left: 94rpx;
top: 4rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
mask-image: url(//yun.duiba.com.cn/spark/assets/gamea1toobg1.2de09b090890e833c949d3b8fe17f5192461aee7.png);
mask-size: 110rpx 110rpx;
}
.gamemain .gamempipei .gamemppload .gamemppimga2 {
width: 110rpx;
height: 110rpx;
opacity: 1;
display: block;
left: 242rpx;
top: 4rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
mask-image: url(//yun.duiba.com.cn/spark/assets/gamea1toobg1.2de09b090890e833c949d3b8fe17f5192461aee7.png);
mask-size: 110rpx 110rpx;
}
.gamemain .gamempipei .gamemppload .gamemppimga3 {
width: 110rpx;
height: 110rpx;
opacity: 1;
display: block;
left: 390rpx;
top: 4rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
mask-image: url(//yun.duiba.com.cn/spark/assets/gamea1toobg1.2de09b090890e833c949d3b8fe17f5192461aee7.png);
mask-size: 110rpx 110rpx;
}
.gamemain .gamempipei .gamemppload .gamemppimga4 {
width: 110rpx;
height: 110rpx;
opacity: 1;
display: block;
left: 538rpx;
top: 4rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
mask-image: url(//yun.duiba.com.cn/spark/assets/gamea1toobg1.2de09b090890e833c949d3b8fe17f5192461aee7.png);
mask-size: 110rpx 110rpx;
}
.blackWhiteFilter{ .blackWhiteFilter{
filter: grayscale(100%); filter: grayscale(100%);
} }
<scroll-view class="gamemain" scroll-y={{true}} scroll-top={{86}} disable-scroll={{false}}> <scroll-view class="gamemain" scroll-y={{true}} scroll-top={{86}} disable-scroll={{false}}>
<image class="gamembg" a:if="{{show_v!=1}}" src={{resList['8bcca487-d698-4e01-93e1-8e78ae10107d'].url}} /> <image class="gamembg" a:if="{{show_v!=1}}" src={{resList['8bcca487-d698-4e01-93e1-8e78ae10107d'].url}} />
<canvas disable-scroll="true" id="gcanvas" class="gcanvas" onReady="canvasOnReady">
</canvas>
<view class="gamemcont" a:if="{{show_v!=1}}"> <view class="gamemcont" a:if="{{show_v!=1}}">
<view class="gamemdaojishi"> <view class="gamemdaojishi">
<image class="gamemdjsbg" src={{resList['6a67309c-0c54-47e3-8955-9756ed4e8c21'].url}} /> <image class="gamemdjsbg" src={{resList['6a67309c-0c54-47e3-8955-9756ed4e8c21'].url}} />
...@@ -51,10 +53,14 @@ ...@@ -51,10 +53,14 @@
</view> </view>
<view class="gamemsharegro"> <view class="gamemsharegro">
<image class="gamemhrole" onTap="invitefriends" data-sidx=0 src={{invitedata[0]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} /> <image class="gamemhrole" onTap="invitefriends" data-sidx=0 src={{invitedata[0]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} />
<image class="gamenrole1" onTap="invitefriends" data-sidx=0 src={{invitedata[1]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} /> <image class="gamenrole1" onTap="invitefriends" data-sidx=1 src={{invitedata[1]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} />
<image class="gamenrole2" onTap="invitefriends" data-sidx=0 src={{invitedata[2]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} /> <image class="gamenrole2" onTap="invitefriends" data-sidx=2 src={{invitedata[2]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} />
<image class="gamenrole3" onTap="invitefriends" data-sidx=0 src={{invitedata[3]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} /> <image class="gamenrole3" onTap="invitefriends" data-sidx=3 src={{invitedata[3]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} />
<image class="gamenrole4" onTap="invitefriends" data-sidx=0 src={{invitedata[4]?resList['7b03a2af-445c-4ce6-b57b-a900e1eedfed'].url:resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} /> <image class="gamenrole4" onTap="invitefriends" data-sidx=4 src={{resList['b33526ac-42e8-4f93-b8e8-dc5d44dce6aa'].url}} />
<image class="gamemhrolei" a:if="{{invitedata[0]}}" src={{invitedata[0].avatar}} />
<image class="gamenrolei1" a:if="{{invitedata[1]}}" src={{invitedata[1].avatar}} />
<image class="gamenrolei2" a:if="{{invitedata[2]}}" src={{invitedata[2].avatar}} />
<image class="gamenrolei3" a:if="{{invitedata[3]}}" src={{invitedata[3].avatar}} />
<image class="gamemsharebtn" onTap="shareact" src={{resList['8c1a94d3-8181-41f4-9d47-1eb0c7719f3d'].url}} /> <image class="gamemsharebtn" onTap="shareact" src={{resList['8c1a94d3-8181-41f4-9d47-1eb0c7719f3d'].url}} />
</view> </view>
<view class="gamemtask"> <view class="gamemtask">
...@@ -85,9 +91,14 @@ ...@@ -85,9 +91,14 @@
<label class="gamempptxt">正在努力寻找玩家,请稍后</label> <label class="gamempptxt">正在努力寻找玩家,请稍后</label>
<view class="gamemppload"> <view class="gamemppload">
<image class="gamemppimg1" src={{resList['e1e081d9-bda3-4cba-bef3-85bebd352ee2'].url}} /> <image class="gamemppimg1" src={{resList['e1e081d9-bda3-4cba-bef3-85bebd352ee2'].url}} />
<image class="gamemppimg2" src={{resList['e1e081d9-bda3-4cba-bef3-85bebd352ee2'].url}} /> <image class="gamemppimg2" style="{{roomnums==2?'left:534rpx':roomnums==3?'left:315.5rpx':'left:238rpx'}}" src={{resList['e1e081d9-bda3-4cba-bef3-85bebd352ee2'].url}} />
<image class="gamemppimg3" src={{resList['e1e081d9-bda3-4cba-bef3-85bebd352ee2'].url}} /> <image class="gamemppimg3" a:if="{{roomnums>2}}" style="{{roomnums==3?'left:534rpx':'left:386rpx'}}" src={{resList['e1e081d9-bda3-4cba-bef3-85bebd352ee2'].url}} />
<image class="gamemppimg4" src={{resList['e1e081d9-bda3-4cba-bef3-85bebd352ee2'].url}} /> <image class="gamemppimg4" a:if="{{roomnums>3}}" src={{resList['e1e081d9-bda3-4cba-bef3-85bebd352ee2'].url}} />
<image class="gamemppimga1" src={{avatar1}} />
<image class="gamemppimga2" src={{avatar2}} style="{{roomnums==2?'left:538rpx':roomnums==3?'left:319.5rpx':'left:242rpx'}}" />
<image class="gamemppimga3" a:if="{{roomnums>2}}" src={{avatar3}} style="{{roomnums==3?'left:538rpx':'left:390rpx'}}" />
<image class="gamemppimga4" a:if="{{roomnums>3}}" src={{avatar4}} />
</view> </view>
</view> </view>
</scroll-view> </scroll-view>
...@@ -97,4 +108,5 @@ ...@@ -97,4 +108,5 @@
<view class="popcontainer" a:if="{{pkshow4_v}}"><pksuccessnoprize-modal onClose="closetohome" gameOverData="{{pk4data}}"></pksuccessnoprize-modal></view> <view class="popcontainer" a:if="{{pkshow4_v}}"><pksuccessnoprize-modal onClose="closetohome" gameOverData="{{pk4data}}"></pksuccessnoprize-modal></view>
<view class="popcontainer" a:if="{{toolshow_v}}"><tempitem-modal onClose="usetool1"></tempitem-modal></view> <view class="popcontainer" a:if="{{toolshow_v}}"><tempitem-modal onClose="usetool1"></tempitem-modal></view>
<view class="popcontainer_down" a:if="{{taskshow_v}}"><task-modal onClose="closeTask"></task-modal></view> <view class="popcontainer_down" a:if="{{taskshow_v}}"><task-modal onClose="closeTask"></task-modal></view>
<view class="popcontainer" a:if="{{lockstepshow_v}}"><lockstep-modal onCloseModal="closetohome"></lockstep-modal></view> <view class="popcontainer" a:if="{{lockstepshow_v}}"><lockstep-modal onCloseModal="closetohome"></lockstep-modal></view>
\ No newline at end of file <view class="popcontainer" a:if="{{invite_v}}"><gameinvite-modal onClose="closeInvite" inviteData="{{inviteshowdata}}"></gameinvite-modal></view>
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
import resList from '../../resconfig/resList'; //import API from '../../api'; import resList from '../../resconfig/resList'; //import API from '../../api';
import API from '../../api'; import API from '../../api';
import * as FYGE from "fyge-tbmini";
import * as SvgaParser from "svga-parser";
import { import {
modalType, SHARE_CONFIG modalType, SHARE_CONFIG
} from '../../tbcc-sdk/lib/constants'; } from '../../tbcc-sdk/lib/constants';
...@@ -20,6 +22,10 @@ const toolwarm = 1;//升温道具+温度值 ...@@ -20,6 +22,10 @@ const toolwarm = 1;//升温道具+温度值
const taskwarm = 1;//任务+温度值 const taskwarm = 1;//任务+温度值
const invitewarm = 1;//邀请+温度值 const invitewarm = 1;//邀请+温度值
const toolcd = 5;// const toolcd = 5;//
const paple1 = "cloud://50A61CFE9CCC27602FFD480B36839784//paple1.svga";
const paple2 = "cloud://48FEB56992D156E3C9C05DC07DFEAC5C//paple2.svga";
const paple3 = "cloud://003C0A5953796DA010090F2745FA02B5//paple3.svga";
const paple4 = "cloud://1FFE377B99BB73F6D837D258262405DF//paple4.svga";
Page({ Page({
data: { data: {
resList: resList, resList: resList,
...@@ -36,7 +42,7 @@ Page({ ...@@ -36,7 +42,7 @@ Page({
attionlist: [ attionlist: [
], ],
showattionlist:[ showattionlist: [
],//实际展示的list ],//实际展示的list
iswin: false,// iswin: false,//
...@@ -73,6 +79,7 @@ Page({ ...@@ -73,6 +79,7 @@ Page({
pkshow4_v: false, pkshow4_v: false,
toolshow_v: false, toolshow_v: false,
taskshow_v: false, taskshow_v: false,
invite_v: false,
pk1data: { pk1data: {
warms: 0, warms: 0,
isWin: false, isWin: false,
...@@ -88,11 +95,26 @@ Page({ ...@@ -88,11 +95,26 @@ Page({
pk4data: { pk4data: {
}, },
inviteshowdata: {
},
avatar1: "",
avatar2: "",
avatar3: "",
avatar4: "",
}, },
onLoad(props) { onLoad(props) {
console.log("onLoad========>", app, props);
let step = 1; let step = 1;
let roomnums = [2, 3, 4][step - 1]; let roomnums = [2, 3, 4][step - 1];
if (roomnums == 2) {
} else if (roomnums == 3) {
} else if (roomnums == 4) {
}
let roomdata = []; let roomdata = [];
for (let i = 0; i < roomnums; i++) { for (let i = 0; i < roomnums; i++) {
let idata = { let idata = {
...@@ -102,16 +124,17 @@ Page({ ...@@ -102,16 +124,17 @@ Page({
} }
// console.log("onload=========>",roomnums,roomdata); // console.log("onload=========>",roomnums,roomdata);
this.setData({ this.setData({
avatar1: app.avatar,
step: step, step: step,
roomnums: roomnums, roomnums: roomnums,
roomdata: roomdata, roomdata: roomdata,
attionlist:[], attionlist: [],
showattionlist:[], showattionlist: [],
}); });
let attiontxt1 = "游戏开始啦,共有" + roomnums + "名玩家加入游戏,快来升温队伍拿奖励吧。"; let attiontxt1 = "游戏开始啦,共有" + roomnums + "名玩家加入游戏,快来升温队伍拿奖励吧。";
this.addAttionTxt(attiontxt1); this.addAttionTxt(attiontxt1);
// this.changePashow(); this.changePashow();
this.updateAct(); this.updateAct();
// this.updateActInfo(); // this.updateActInfo();
this.doAiControl(); this.doAiControl();
...@@ -126,24 +149,24 @@ Page({ ...@@ -126,24 +149,24 @@ Page({
let roomnums = this.data.roomnums - 1; let roomnums = this.data.roomnums - 1;
console.log("aicontrol==============>", roomnums); console.log("aicontrol==============>", roomnums);
for (let i = 0; i < roomnums; i++) { for (let i = 0; i < roomnums; i++) {
let chatime = Math.ceil(Math.random()*5)+2; let chatime = Math.ceil(Math.random() * 5) + 2;
let itime1 = Number((Math.random() * chatime).toFixed(2)) * 1000; let itime1 = Number((Math.random() * chatime).toFixed(2)) * 1000;
this.aiuseTool(itime1, i,chatime); this.aiuseTool(itime1, i, chatime);
//ai邀请 //ai邀请
let inviterange = [0,5]; let inviterange = [0, 5];
let invitenums = Math.round(Math.random()*inviterange[1])+inviterange[0]; let invitenums = Math.round(Math.random() * inviterange[1]) + inviterange[0];
console.log("邀请的温度值",invitenums); console.log("邀请的温度值", invitenums);
this.ainvite(invitenums,i); this.ainvite(invitenums, i);
//ai任务 //ai任务
let taskrange = [1,5]; let taskrange = [1, 5];
let tasknums = Math.round(Math.random()*taskrange[1])+taskrange[0]; let tasknums = Math.round(Math.random() * taskrange[1]) + taskrange[0];
this.aitask(tasknums,i); this.aitask(tasknums, i);
} }
}, },
//机器使用道具 //机器使用道具
aiuseTool(time, i,chatime) { aiuseTool(time, i, chatime) {
setTimeout(() => { setTimeout(() => {
console.log("ai"+i+"使用道具升温度"); console.log("ai" + i + "使用道具升温度");
let itxt = "玩家" + (i + 1) + "使用道具获得了" + toolwarm + "温度值"; let itxt = "玩家" + (i + 1) + "使用道具获得了" + toolwarm + "温度值";
this.addAttionTxt(itxt); this.addAttionTxt(itxt);
let inroomidx = i + 1; let inroomidx = i + 1;
...@@ -152,49 +175,49 @@ Page({ ...@@ -152,49 +175,49 @@ Page({
this.updateRolewd(i + 2, inwd); this.updateRolewd(i + 2, inwd);
let lesstime = this.data.gametime*1000; let lesstime = this.data.gametime * 1000;
let itime1 = Number((Math.random() * chatime).toFixed(2)) * 1000; let itime1 = Number((Math.random() * chatime).toFixed(2)) * 1000;
let nexttooltime = toolcd*1000+itime1; let nexttooltime = toolcd * 1000 + itime1;
if(nexttooltime<lesstime){ if (nexttooltime < lesstime) {
return this.aiuseTool(nexttooltime,i,chatime); return this.aiuseTool(nexttooltime, i, chatime);
} }
}, time); }, time);
}, },
//机器邀请人 //机器邀请人
ainvite(invitenums,i){ ainvite(invitenums, i) {
let chatime = Math.floor(gameatime/invitenums)*1000; let chatime = Math.floor(gameatime / invitenums) * 1000;
for(let i1=0;i1<invitenums;i1++){ for (let i1 = 0; i1 < invitenums; i1++) {
let i1start = i1*chatime; let i1start = i1 * chatime;
let i1end = (i1+1)*chatime-5000; let i1end = (i1 + 1) * chatime - 5000;
let rangetime = Math.floor(Math.random()*(i1end-i1start))+i1start; let rangetime = Math.floor(Math.random() * (i1end - i1start)) + i1start;
console.log(rangetime); console.log(rangetime);
setTimeout(() => { setTimeout(() => {
console.log("ai"+i+"邀请好友升温度"); console.log("ai" + i + "邀请好友升温度");
let itxt = "玩家"+(i+1)+"邀请了一位好友,获得了"+invitewarm+"温度值"; let itxt = "玩家" + (i + 1) + "邀请了一位好友,获得了" + invitewarm + "温度值";
this.addAttionTxt(itxt); this.addAttionTxt(itxt);
let inroomidx = i+1; let inroomidx = i + 1;
let inwd = this.data.roomdata[inroomidx]["wd"]; let inwd = this.data.roomdata[inroomidx]["wd"];
inwd += invitewarm; inwd += invitewarm;
this.updateRolewd(i+2,inwd); this.updateRolewd(i + 2, inwd);
}, rangetime); }, rangetime);
} }
}, },
//机器人完成任务 //机器人完成任务
aitask(tasknums,i){ aitask(tasknums, i) {
let chatime = Math.floor(gameatime/tasknums)*1000; let chatime = Math.floor(gameatime / tasknums) * 1000;
for(let i1=0;i1<tasknums;i1++){ for (let i1 = 0; i1 < tasknums; i1++) {
let i1start = i1*chatime; let i1start = i1 * chatime;
let i1end = (i1+1)*chatime-5000; let i1end = (i1 + 1) * chatime - 5000;
let rangetime = Math.floor(Math.random()*(i1end-i1start))+i1start; let rangetime = Math.floor(Math.random() * (i1end - i1start)) + i1start;
setTimeout(()=>{ setTimeout(() => {
let itxt = "玩家"+(i+1)+"完成了一个任务,获得了"+taskwarm+"温度值"; let itxt = "玩家" + (i + 1) + "完成了一个任务,获得了" + taskwarm + "温度值";
this.addAttionTxt(itxt); this.addAttionTxt(itxt);
let inroomidx = i+1; let inroomidx = i + 1;
let inwd = this.data.roomdata[inroomidx]["wd"]; let inwd = this.data.roomdata[inroomidx]["wd"];
inwd += taskwarm; inwd += taskwarm;
this.updateRolewd(i+2,inwd); this.updateRolewd(i + 2, inwd);
},rangetime); }, rangetime);
} }
}, },
onShow() { onShow() {
...@@ -228,6 +251,10 @@ Page({ ...@@ -228,6 +251,10 @@ Page({
//全局的update //全局的update
updateAct() { updateAct() {
let update = function () { let update = function () {
if (this.data.show_v == 1) {
return false;
}
let ntime = this.data.gametime - 50 / 1000; let ntime = this.data.gametime - 50 / 1000;
if (ntime < 0) { if (ntime < 0) {
ntime = 0; ntime = 0;
...@@ -364,7 +391,7 @@ Page({ ...@@ -364,7 +391,7 @@ Page({
let dataset = e.currentTarget.dataset; let dataset = e.currentTarget.dataset;
if (dataset) { if (dataset) {
let sidx = Number(dataset.sidx); let sidx = Number(dataset.sidx);
if (this.data.invitedata[sidx]) { if (this.data.invitedata[sidx] && sidx != 4) {
} else { } else {
this.shareact(); this.shareact();
...@@ -489,6 +516,13 @@ Page({ ...@@ -489,6 +516,13 @@ Page({
let iattiontxt = ""; let iattiontxt = "";
if (type == "invite") { if (type == "invite") {
iattiontxt = "邀请" + chacount + "人" + "获得了" + chawarm + "温度值"; iattiontxt = "邀请" + chacount + "人" + "获得了" + chawarm + "温度值";
this.setData({
inviteshowdata: {
chacount: chacount,
chawarm: chawarm
}
});
this.openInvite();
} else if (type == "tool") { } else if (type == "tool") {
iattiontxt = "使用道具" + chacount + "次" + "获得了" + chawarm + "温度值"; iattiontxt = "使用道具" + chacount + "次" + "获得了" + chawarm + "温度值";
} else if (type == "follow") { } else if (type == "follow") {
...@@ -516,7 +550,7 @@ Page({ ...@@ -516,7 +550,7 @@ Page({
let showattionlist = attionlist.slice(-10); let showattionlist = attionlist.slice(-10);
this.setData({ this.setData({
attionlist: attionlist, attionlist: attionlist,
showattionlist:showattionlist showattionlist: showattionlist
}); });
}, },
//获取邀请人 //获取邀请人
...@@ -606,26 +640,138 @@ Page({ ...@@ -606,26 +640,138 @@ Page({
pkshow4_v: false pkshow4_v: false
}) })
}, },
openTask(){ openTask() {
this.setData({ this.setData({
taskshow_v:true taskshow_v: true
}) })
}, },
closeTask(){ closeTask() {
this.setData({ this.setData({
taskshow_v:false taskshow_v: false
}) })
}, },
openLockStep(){ openLockStep() {
this.setData({ this.setData({
lockstepshow_v:true lockstepshow_v: true
}) })
}, },
closeLockStep(){ closeLockStep() {
this.setData({ this.setData({
lockstepshow_v:false lockstepshow_v: false
})
},
openInvite() {
this.setData({
invite_v: true
})
},
closeInvite() {
this.setData({
invite_v: false
})
},
canvasOnReady() {
console.log("onCanvas Ready")
this.createMain();
},
/**添加canvas,用来显示svga */
async createMain() {
console.log(123)
var canvas = await new Promise((r) => {
my.createCanvas({
id: 'canvas',
success: (ccc) => {
const dpr = my.getSystemInfoSync().pixelRatio
const windowWidth = my.getSystemInfoSync().windowWidth;
const windowHeight = my.getSystemInfoSync().windowHeight;
ccc.width = windowWidth * dpr + dpr; //重新修改会有误差
ccc.height = windowHeight * dpr + dpr;
r(ccc);
}
}) })
})
console.log(111)
FYGE.initedByCanvas(canvas)
var sysInfo = my.getSystemInfoSync()
//建舞台
var stage = new FYGE.Stage(
canvas,
750, //设计宽度,按设计搞给的就行
1624, //设计高度
sysInfo && sysInfo.windowWidth || document.body.clientWidth,
sysInfo && sysInfo.windowHeight || document.body.clientHeight,
FYGE.RENDERER_TYPE.CANVAS
);
//stage初始化
stage.addEventListener(FYGE.Event.INIT_STAGE, () => {
SvgaParser.loadSvga(
paple1,
(v) => {
console.log("svga" + v);
var mv = stage.addChild(new FYGE.MovieClip(v));
mv.x = 400;
mv.y = 390;
console.log("svgmv", mv)
},
(err) => {
console.log(err);
}
)
SvgaParser.loadSvga(
paple2,
(v) => {
console.log("svga" + v);
var mv = stage.addChild(new FYGE.MovieClip(v));
mv.x = 100;
mv.y = 450;
console.log("svgmv", mv)
},
(err) => {
console.log(err);
}
)
SvgaParser.loadSvga(
paple3,
(v) => {
console.log("svga" + v);
var mv = stage.addChild(new FYGE.MovieClip(v));
mv.x = 240;
mv.y = 540;
console.log("svgmv", mv)
},
(err) => {
console.log(err);
}
)
SvgaParser.loadSvga(
paple4,
(v) => {
console.log("svga" + v);
var mv = stage.addChild(new FYGE.MovieClip(v));
mv.x = 450;
mv.y = 590;
console.log("svgmv", mv)
},
(err) => {
console.log(err);
}
)
}, this);
//循环
loop();
function loop() {
FYGE.Tween.flush()
stage.flush();
FYGE.getRequestAnimationFrame()(loop);
}
}, },
}); });
\ No newline at end of file
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
"pksuccessnoprize-modal": "/components/compksuccessnoprizemodal/compksuccessnoprizemodal", "pksuccessnoprize-modal": "/components/compksuccessnoprizemodal/compksuccessnoprizemodal",
"tempitem-modal": "/components/comtempitemmodal/comtempitemmodal", "tempitem-modal": "/components/comtempitemmodal/comtempitemmodal",
"task-modal": "/components/comtask/comtask", "task-modal": "/components/comtask/comtask",
"lockstep-modal": "/components/comunlockstepmodal/comunlockstepmodal" "lockstep-modal": "/components/comunlockstepmodal/comunlockstepmodal",
"gameinvite-modal": "/components/comgameinvitemodal/comgameinvitemodal"
} }
} }
\ No newline at end of file
...@@ -4,51 +4,51 @@ ...@@ -4,51 +4,51 @@
"data": [ "data": [
{ {
"openId": "ex laboris reprehenderit enim in", "openId": "ex laboris reprehenderit enim in",
"avatar": "aliqua incididunt nulla laborum fugiat", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "sit consectetur enim" "userNick": "sit consectetur enim"
}, },
{ {
"openId": "id Ut culpa", "openId": "id Ut culpa",
"avatar": "consequat ex eu officia veniam", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "cillum officia consequat in" "userNick": "cillum officia consequat in"
}, },
{ {
"openId": "id do esse", "openId": "id do esse",
"avatar": "Excepteur sit Lorem ipsum", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "ut Ut fugiat" "userNick": "ut Ut fugiat"
}, },
{ {
"openId": "anim dolor", "openId": "anim dolor",
"avatar": "ut irure dolor cillum aliqua", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "non ex" "userNick": "non ex"
}, },
{ {
"openId": "eiusmod exercitation nisi sit laborum", "openId": "eiusmod exercitation nisi sit laborum",
"avatar": "nostrud sunt laboris cupidatat minim", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "est in" "userNick": "est in"
}, },
{ {
"openId": "proident id reprehenderit Ut dolor", "openId": "proident id reprehenderit Ut dolor",
"avatar": "sed in", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "veniam" "userNick": "veniam"
}, },
{ {
"openId": "irure non ut", "openId": "irure non ut",
"avatar": "in ullamco", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "cupidatat" "userNick": "cupidatat"
}, },
{ {
"openId": "ullamco magna nisi", "openId": "ullamco magna nisi",
"avatar": "id laboris aliqua reprehenderit pariatur", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "pariatur dolore nisi" "userNick": "pariatur dolore nisi"
}, },
{ {
"openId": "dolore occaecat elit", "openId": "dolore occaecat elit",
"avatar": "aute ullamco", "avatar": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"userNick": "Excepteur esse Ut voluptate est" "userNick": "Excepteur esse Ut voluptate est"
}, },
{ {
"openId": "occaecat", "openId": "http://wwc.alicdn.com/avatar/getAvatar.do?userIdStr=OFhhPCIYMFleO8*IXHQbv0c4vkxLMCc0vmNyvmg0MmQT&width=80&height=80&type=sns",
"avatar": "veniam dolore Ut laborum", "avatar": "veniam dolore Ut laborum",
"userNick": "in" "userNick": "in"
} }
......
...@@ -4,8 +4,8 @@ ...@@ -4,8 +4,8 @@
"data": { "data": {
"total": 0, "total": 0,
"invite": { "invite": {
"count": 0, "count": 2,
"warms": 0 "warms": 3
}, },
"tool": { "tool": {
"count": 0, "count": 0,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment