Commit 263cda1c authored by wildfirecode13's avatar wildfirecode13

Merge branch 'master' of gitlab2.dui88.com:wildfirecode13/icbcrpg

parents bf481ce5 5efcd2f4
...@@ -64,3 +64,12 @@ body { ...@@ -64,3 +64,12 @@ body {
transform-origin: center center; transform-origin: center center;
animation: heartbeats 0.775s infinite; animation: heartbeats 0.775s infinite;
} }
.diacontmidpos {
position: fixed;
top: 0%;
left: 0%;
bottom: 0%;
right: 0%;
margin: auto;
}
\ No newline at end of file
...@@ -124,7 +124,7 @@ class Select extends Component { ...@@ -124,7 +124,7 @@ class Select extends Component {
render() { render() {
const {nshowidx,changed,selected} = this.state; const {nshowidx,changed,selected} = this.state;
return ( return (
<div className="select " uuid="298ea3b7-efbb-42ac-adea-ee68aa1db627"> <div className="select diacontmidpos" uuid="298ea3b7-efbb-42ac-adea-ee68aa1db627">
<div className="cardone" uuid="36334c7a-26df-4f9e-83d3-6ac81e49d6db" ref="cardone"> <div className="cardone" uuid="36334c7a-26df-4f9e-83d3-6ac81e49d6db" ref="cardone">
<img <img
className="select_role1 " className="select_role1 "
......
.select { .select {
width: 656px; width: 656px;
height: 1140px; height: 1140px;
left: 47px; // left: 47px;
top: 50%; // top: 228px;
margin-top: -570px; // position: absolute;
position: absolute;
.cardone { .cardone {
transform-origin: 50% 50%; transform-origin: 50% 50%;
...@@ -106,15 +104,15 @@ ...@@ -106,15 +104,15 @@
animation: opacurAnilat 0.5 ease 0s 1 normal; animation: opacurAnilat 0.5 ease 0s 1 normal;
} }
.planame{ .planame{
width: 405px; width: 380px;
height: 63px; height: 65px;
position: absolute; position: absolute;
top:930px; top:930px;
left: 125px; left: 125px;
appearance: none; appearance: none;
font-size: 28px; font-size: 28px;
border-radius: 100px; border-radius: 100px;
border: 1px solid #c8cccf; border: 0px solid #c8cccf;
color: #6a6f77; color: #6a6f77;
outline: 0; outline: 0;
margin: auto; margin: auto;
......
...@@ -100,7 +100,7 @@ class Loading extends Component { ...@@ -100,7 +100,7 @@ class Loading extends Component {
render() { render() {
return ( return (
<div className="loading " uuid="b325d068-5750-48c1-8447-29b6f572e955"> <div className="loading diacontmidpos" uuid="b325d068-5750-48c1-8447-29b6f572e955">
<img <img
className="loading_bg " className="loading_bg "
uuid="caa1574c-edd4-4b5c-8332-18002df91464" uuid="caa1574c-edd4-4b5c-8332-18002df91464"
......
.loading { .loading {
width: 750px; // width: 750px;
height: 1624px; // height: 1624px;
position: absolute; // position: absolute;
.loading_bg { .loading_bg {
width: 750px; width: 750px;
height: 1624px; height: 1624px;
......
...@@ -61,7 +61,7 @@ var GameStage = /** @class */ (function (_super) { ...@@ -61,7 +61,7 @@ var GameStage = /** @class */ (function (_super) {
this.guideconfig = this.props['guideconfig']; this.guideconfig = this.props['guideconfig'];
this.skipbtn.addEventListener(MouseEvent.CLICK, this.skipGuide, this); this.skipbtn.addEventListener(MouseEvent.CLICK, this.skipGuide, this);
this.touchrect.addEventListener(MouseEvent.CLICK, this.toNextLevel, this); this.touchrect.addEventListener(MouseEvent.CLICK, this.toNextLevel, this);
this.setGuideShow(); this.dispatchOutEvent("canvasready", null);
}; };
/** /**
* 事件回调 * 事件回调
...@@ -69,16 +69,33 @@ var GameStage = /** @class */ (function (_super) { ...@@ -69,16 +69,33 @@ var GameStage = /** @class */ (function (_super) {
* @param payload * @param payload
*/ */
GameStage.prototype.onEvent = function (type, payload) { GameStage.prototype.onEvent = function (type, payload) {
console.error("游戏内监听===》", type, payload);
switch (type) { switch (type) {
case "setStepData": case "setStepData":
var step = payload.step; this.setStepData(payload);
var stepdata = payload.stepdata; break;
case "setStepConfig":
this.setStepConfig(payload);
break;
case "startGuide":
this.step = 1;
this.setGuideShow();
break; break;
default: default:
console.error("为定义监听类型===》", payload); console.error("为定义监听类型===》", payload);
break; break;
} }
}; };
//设定单个关卡
GameStage.prototype.setStepData = function (payload) {
var step = payload.step;
var stepdata = payload.stepdata;
this.guideconfig[step] = stepdata;
};
//一次设定所有的引导数据
GameStage.prototype.setStepConfig = function (payload) {
this.guideconfig = payload;
};
/** /**
* 销毁回调 * 销毁回调
*/ */
......
...@@ -73,17 +73,262 @@ class Main3 extends Component { ...@@ -73,17 +73,262 @@ class Main3 extends Component {
needguide: needguide needguide: needguide
}); });
} }
//引导数据
guideconfig = {};
onReady(widget) { onReady(widget) {
_widget = widget; _widget = widget;
}
//新手引导的位置设定
setGuideConfig() {
let clientWidth = document.body.clientWidth;
let clientHeight = document.body.clientHeight;
let canvaswid = 750;
let canvashei = clientHeight * 750 / clientWidth;
console.log("CANVAS宽高===》", canvaswid, canvashei);
let holedata = {
holetype: "cirect",
holex: 15,
holey: 33,
holesize: [
395,
112,
70
]
}
let txtdata = {
text: "您可以在此处编辑信息查看欢趣豆数量",
txtwidth: 750,
txtx: 0,
txty: 224,
txtalign: "center"
}
let roledata = [
{
rolex: 375,
roley: 911,
roletex: "guide2_1"
}
];
let nextbtndata = {
btnx: 485,
btny: 303,
btntex: "nextbtn"
}
let skipbtndata = {
skipx: (canvaswid - 107) / 2,
skipy: canvashei - 200,
skiplevel: 9,
skiptex: "skipbtn",
};
let touchdata = {
touchx: 0,
touchy: 0,
touchsize: [
canvaswid,
canvashei
]
}
this.guideconfig[1] = {
hole: null,
txt: null,
role: [
{
rolex: 40,
roley: (canvashei - 764) / 2,
roletex: "guide1"
}
],
nextbtn: null,
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 1,
stepdata: this.guideconfig[1]
});
this.guideconfig[2] = {
hole: {
holetype: "cirect",
holex: 15,
holey: 33,
holesize: [
395,
112,
70
]
},
txt: {
text: "您可以在此处编辑信息查看欢趣豆数量",
txtwidth: 750,
txtx: 0,
txty: 224,
txtalign: "center"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 485,
btny: 303,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 2,
stepdata: this.guideconfig[2]
});
this.guideconfig[3] = {
hole: {
holetype: "cirect",
holex: 600,
holey: 26,
holesize: [
135,
440,
40
]
},
txt: {
text: "点击图标您可查看规则、进行分享和签到\n \n偷偷告诉您,连签7天可获得大额欢趣豆哦~",
txtwidth: 455,
txtx: 100,
txty: 245,
txtalign: "left"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 100,
btny: 520,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 3,
stepdata: this.guideconfig[3]
});
this.guideconfig[4] = {
hole: {
holetype: "cir",
holex: 185,
holey: 465,
holesize: [
165,
440
]
},
txt: {
text: "欢趣豆可以兑换立减金,\n进入趣赶集即可进行\n兑换哦~",
txtwidth: 375,
txtx: 375,
txty: 357,
txtalign: "left"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 375,
btny: 536,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 4,
stepdata: this.guideconfig[4]
});
this.guideconfig[5] = {
hole: {
holetype: "cir",
holex: 540,
holey: 600,
holesize: [
165,
440
]
},
txt: {
text: "农场主集结~在这里\n就是向往的生活!\n收获成果的同时还可\n以兑换丰厚礼物哦",
txtwidth: 320,
txtx: 55,
txty: 580,
txtalign: "left"
},
role :[
{
rolex: 375,
roley: canvashei-550,
roletex: "guide2_1"
}
],
nextbtn: {
btnx: 55,
btny: 780,
btntex: "nextbtn"
},
skipbtn: skipbtndata,
touch: touchdata,
pagey: 0,
}
_widget && _widget.dispatchInEvent("setStepData", {
step: 5,
stepdata: this.guideconfig[5]
});
this.startGuide();
}
startGuide() {
_widget && _widget.dispatchInEvent("startGuide");
} }
onEvent(type, payload) { onEvent(type, payload) {
console.log(type, payload); console.log(type, payload);
switch (type) { switch (type) {
case "canvasready":
this.setGuideConfig();
break;
case "guidecomplete": case "guidecomplete":
dataCenter.setData(Store.needguide, false); dataCenter.setData(Store.needguide, false);
break; break;
default: default:
break; break;
} }
...@@ -99,7 +344,7 @@ class Main3 extends Component { ...@@ -99,7 +344,7 @@ class Main3 extends Component {
render() { render() {
const { avatar, nickname, num, needguide } = this.state; const { avatar, nickname, num, needguide } = this.state;
return ( return (
<div className="main3 " uuid="8754a9d1-7453-474b-b722-7cb71483ae85"> <div className="main3 diacontmidpos" uuid="8754a9d1-7453-474b-b722-7cb71483ae85">
<img <img
className="main3_bg " className="main3_bg "
uuid="25a6c3f8-3f78-4758-b2ab-5bcbfaa0d8bc" uuid="25a6c3f8-3f78-4758-b2ab-5bcbfaa0d8bc"
......
.main3 { .main3 {
width: 750px; // width: 750px;
height: 1624px; // height: 1624px;
position: absolute; // position: absolute;
overflow-x: hidden;
.main3_bg { .main3_bg {
width: 750px; width: 750px;
height: 1624px; height: 1624px;
......
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