Commit b4433048 authored by huangwenjie's avatar huangwenjie

适配

parent be2cb536
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<title>React App</title>
<script>
!(function (e, i) {
var t = e.documentElement,
n = navigator.userAgent.match(/iphone|ipod|ipad/gi),
a = n ? Math.min(i.devicePixelRatio, 3) : 1,
m = 'orientationchange' in window ? 'orientationchange' : 'resize';
t.dataset.dpr = a;
for (
var d, l, c = !1, o = e.getElementsByTagName('meta'), r = 0; r < o.length; r++
)
(l = o[r]), 'viewport' == l.name && ((c = !0), (d = l));
if (c)
d.content =
'width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no';
else {
var o = e.createElement('meta');
(o.name = 'viewport'),
(o.content =
'width=device-width,initial-scale=1.0,maximum-scale=1.0, minimum-scale=1.0,user-scalable=no'),
t.firstElementChild.appendChild(o);
}
var s = function () {
var e = t.clientWidth;
e / a > 750 && (e = 750 * a),
(window.remScale = e / 750),
(t.style.fontSize = 100 * (e / 750) + 'px');
};
s(), e.addEventListener && i.addEventListener(m, s, !1);
})(document, window);
</script>
<script>
function getApp() {
return {
cloud: {},
cloudName: "clientTemplate2C",
requestType: "mock"
}
}
var CFG = CFG || {};
CFG.projectId = location.pathname.split('/')[2] || '1';
</script>
<link href="//yun.duiba.com.cn/spark/v2/niuqichongtian/1610022727462/styles/main.1fdede45e39c372588ef.css"
rel="stylesheet">
</head>
<body><noscript>You need to enable JavaScript to run this app.</noscript>
<script>
// document.body.addEventListener('touchstart', function(){});
</script>
<div id="root"></div>
<script src="//yun.duiba.com.cn/spark/v2/niuqichongtian/1610022727462/js/runtime-main.18997b31.js"></script>
<script src="//yun.duiba.com.cn/spark/v2/niuqichongtian/1610022727462/js/vendors.0b926fe5.js"></script>
<script src="//yun.duiba.com.cn/spark/v2/niuqichongtian/1610022727462/js/main.bf4bf1f0.js"></script>
</body>
<script src="//yun.duiba.com.cn/db_games/activity/md5/zepto_security_downloadApp.min.js"></script>
</html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){function r(r){for(var t,i,a=r[0],l=r[1],c=r[2],p=0,s=[];p<a.length;p++)i=a[p],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&s.push(o[i][0]),o[i]=0;for(t in l)Object.prototype.hasOwnProperty.call(l,t)&&(e[t]=l[t]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,c||[]),n()}function n(){for(var e,r=0;r<u.length;r++){for(var n=u[r],t=!0,a=1;a<n.length;a++){var l=n[a];0!==o[l]&&(t=!1)}t&&(u.splice(r--,1),e=i(i.s=n[0]))}return e}var t={},o={1:0},u=[];function i(r){if(t[r])return t[r].exports;var n=t[r]={i:r,l:!1,exports:{}};return e[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}i.m=e,i.c=t,i.d=function(e,r,n){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var t in e)i.d(n,t,function(r){return e[r]}.bind(null,t));return n},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="//yun.duiba.com.cn/spark/v2/niuqichongtian/1610022727462/";var a=window.webpackJsonp=window.webpackJsonp||[],l=a.push.bind(a);a.push=r,a=a.slice();for(var c=0;c<a.length;c++)r(a[c]);var f=l;n()}([]);
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -24,10 +24,10 @@ body {
position: absolute;
width: 750px;
height: 1624px;
top: 50%;
left: 50%;
margin-left:-375px;
margin-top:-812px;
// top: 50%;
// left: 50%;
// margin-left:-375px;
// margin-top:-812px;
}
#root1 {
......@@ -45,7 +45,7 @@ body {
margin-left:-375px;
margin-top:-812px;
background: rgba(0, 0, 0, 0.7);
}
.popcontainer_empty {
......
......@@ -1743,7 +1743,12 @@ var Main = (function () {
FYGE.initedByCanvas(canvas);
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.WEBGL);
var type = FYGE.RENDERER_TYPE.WEBGL;
var can = document.createElement("canvas");
var ctx = can.getContext("webgl");
if (!ctx)
type = FYGE.RENDERER_TYPE.CANVAS;
var stage = new FYGE.Stage(canvas, 750, 1624, sysInfo && sysInfo.windowWidth || document.body.clientWidth, sysInfo && sysInfo.windowHeight || document.body.clientHeight, type);
this.stage = stage;
stage.addEventListener(FYGE.Event.INIT_STAGE, this.onAddToStage, this);
var self = this;
......@@ -2108,7 +2113,7 @@ var StartScene = (function (_super) {
_this._emojiState = 0;
_this._score = 0;
_this._preTimerNum = 3;
_this._timerNum = 30;
_this._timerNum = 20;
_this.rains = [];
_this.hasLuckyBag = false;
_this.pause = false;
......@@ -2135,7 +2140,7 @@ var StartScene = (function (_super) {
_this.isGameOver = false;
_this.count = 0;
_this.rainLuckyBag = false;
_this.rainConfig = ['redPacket', 'redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot'];
_this.rainConfig = ['redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot'];
return _this;
}
StartScene.prototype.res = function (name) {
......@@ -2274,7 +2279,7 @@ var StartScene = (function (_super) {
this.countDownTxt.textWidth = 200;
this.countDownTxt.textAlign = "center";
this.countDownTxt.x = 275;
this.countDownTxt.y = 760;
this.countDownTxt.y = 755;
this.pause = true;
if (GTool_1.GTool.readCache("isNQCTGuide")) {
this.guideLevel = 2;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -36,7 +36,7 @@
"watch": "webpack --watch",
"dev": "webpack-dev-server --open --config webpack.dev.js --host 0.0.0.0",
"buildTS": "webpack --config webpack.prod.js && node scripts/mergeJs",
"buildTSAndCopy": "webpack --config webpack.prod.js && node scripts/mergeJs && node scripts/copyJs",
"bc": "webpack --config webpack.prod.js && node scripts/mergeJs && node scripts/copyJs",
"copyJs": "node scripts/copyJs"
},
"author": "MrKwon",
......
......@@ -1744,7 +1744,12 @@ var Main = (function () {
FYGE.initedByCanvas(canvas);
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.WEBGL);
var type = FYGE.RENDERER_TYPE.WEBGL;
var can = document.createElement("canvas");
var ctx = can.getContext("webgl");
if (!ctx)
type = FYGE.RENDERER_TYPE.CANVAS;
var stage = new FYGE.Stage(canvas, 750, 1624, sysInfo && sysInfo.windowWidth || document.body.clientWidth, sysInfo && sysInfo.windowHeight || document.body.clientHeight, type);
this.stage = stage;
stage.addEventListener(FYGE.Event.INIT_STAGE, this.onAddToStage, this);
var self = this;
......@@ -2109,7 +2114,7 @@ var StartScene = (function (_super) {
_this._emojiState = 0;
_this._score = 0;
_this._preTimerNum = 3;
_this._timerNum = 30;
_this._timerNum = 20;
_this.rains = [];
_this.hasLuckyBag = false;
_this.pause = false;
......@@ -2136,7 +2141,7 @@ var StartScene = (function (_super) {
_this.isGameOver = false;
_this.count = 0;
_this.rainLuckyBag = false;
_this.rainConfig = ['redPacket', 'redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot'];
_this.rainConfig = ['redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot'];
return _this;
}
StartScene.prototype.res = function (name) {
......@@ -2275,7 +2280,7 @@ var StartScene = (function (_super) {
this.countDownTxt.textWidth = 200;
this.countDownTxt.textAlign = "center";
this.countDownTxt.x = 275;
this.countDownTxt.y = 760;
this.countDownTxt.y = 755;
this.pause = true;
if (GTool_1.GTool.readCache("isNQCTGuide")) {
this.guideLevel = 2;
......
......@@ -30,6 +30,10 @@ export class Main {
//@ts-ignore 存在my就初始化
sysInfo = my.getSystemInfoSync()
}
var type = FYGE.RENDERER_TYPE.WEBGL;
var can = document.createElement("canvas");
var ctx = can.getContext("webgl");
if (!ctx) type = FYGE.RENDERER_TYPE.CANVAS;
//建舞台
var stage = new FYGE.Stage(
canvas,
......@@ -37,7 +41,7 @@ export class Main {
1624,//设计高度
sysInfo && sysInfo.windowWidth || document.body.clientWidth,
sysInfo && sysInfo.windowHeight || document.body.clientHeight,
FYGE.RENDERER_TYPE.WEBGL
type
);
this.stage = stage;
//开始循环
......
......@@ -35,7 +35,7 @@ export class StartScene extends Scene {
_emojiState = 0
_score = 0
_preTimerNum = 3
_timerNum = 30
_timerNum = 20
skipGuideBtn
rains = []
hasLuckyBag = false
......@@ -221,7 +221,7 @@ export class StartScene extends Scene {
this.countDownTxt.textWidth = 200
this.countDownTxt.textAlign = "center"
this.countDownTxt.x = 275
this.countDownTxt.y = 760
this.countDownTxt.y = 755
this.pause = true
......@@ -486,7 +486,7 @@ export class StartScene extends Scene {
count = 0
rainLuckyBag = false
// rainConfig = ['redPacket', 'redPacket', 'redPacket', 'redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot']
rainConfig = ['redPacket', 'redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot']
rainConfig = ['redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot']
raining() {
if (this.pause) {
return
......
......@@ -30,6 +30,9 @@ class PageIndex extends Component {
//组件加载
componentDidMount() {
var that = this;
document.getElementById("root").addEventListener("touchmove", (e) => {
e.preventDefault()
})
that.initData();
sendLogBuji(1, true)
......@@ -241,7 +244,7 @@ class PageIndex extends Component {
render() {
return (
<div className="zhu_jie_mian ">
<img className="bg " src={this.state.resList['abb461e6-9eab-4333-88ed-3aea3977591d'].url} />
{/* <img className="bg " src={this.state.resList['abb461e6-9eab-4333-88ed-3aea3977591d'].url} /> */}
<img className="ruleBtn" src={this.state.resList['a917146f-76a3-412e-9168-6d2e19320ffc'].url} onClick={this.openRule.bind(this)} />
<img className="recordBtn " src={this.state.resList['c158698f-450a-463e-9529-154a144a8369'].url} onClick={this.openRecordPage.bind(this)} />
<img className="startBtn " src={this.state.resList['87bb7cc6-970b-4b5a-8495-c05668d12dc6'].url} onClick={this.judgeCanStartGame.bind(this)} />
......
.zhu_jie_mian {
width: 750px;
height: 1624px;
width: 100vw;
height: 100vh;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
background:url("//yun.duiba.com.cn/spark/assets/846ad694833be1131e37d3f5b9598d454a2935e3.png");
background-size: cover;
background-position: center;
.bg {
width: 750px;
height: 1624px;
......@@ -37,8 +40,9 @@
opacity: 1;
vertical-center: 544.5;
left: 141px;
top: 1264px;
position: absolute;
// top: 1264px;
bottom:30px;
position: fixed;
transform-origin: 0px 0px 0px;
}
.remainTimes {
......@@ -48,8 +52,9 @@
opacity: 1;
vertical-center: 448;
left: 0px;
top: 1188px;
position: absolute;
// top: 1188px;
bottom:180px;
position: fixed;
transform-origin: 0px 0px 0px;
font-size: 35px;
color: rgba(255, 159, 126, 1);
......
......@@ -1744,7 +1744,12 @@ var Main = (function () {
FYGE.initedByCanvas(canvas);
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.WEBGL);
var type = FYGE.RENDERER_TYPE.WEBGL;
var can = document.createElement("canvas");
var ctx = can.getContext("webgl");
if (!ctx)
type = FYGE.RENDERER_TYPE.CANVAS;
var stage = new FYGE.Stage(canvas, 750, 1624, sysInfo && sysInfo.windowWidth || document.body.clientWidth, sysInfo && sysInfo.windowHeight || document.body.clientHeight, type);
this.stage = stage;
stage.addEventListener(FYGE.Event.INIT_STAGE, this.onAddToStage, this);
var self = this;
......@@ -2109,7 +2114,7 @@ var StartScene = (function (_super) {
_this._emojiState = 0;
_this._score = 0;
_this._preTimerNum = 3;
_this._timerNum = 30;
_this._timerNum = 20;
_this.rains = [];
_this.hasLuckyBag = false;
_this.pause = false;
......@@ -2136,7 +2141,7 @@ var StartScene = (function (_super) {
_this.isGameOver = false;
_this.count = 0;
_this.rainLuckyBag = false;
_this.rainConfig = ['redPacket', 'redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot'];
_this.rainConfig = ['redPacket', 'redPacket', 'luckyBag', 'ingot', 'ingot'];
return _this;
}
StartScene.prototype.res = function (name) {
......@@ -2275,7 +2280,7 @@ var StartScene = (function (_super) {
this.countDownTxt.textWidth = 200;
this.countDownTxt.textAlign = "center";
this.countDownTxt.x = 275;
this.countDownTxt.y = 760;
this.countDownTxt.y = 755;
this.pause = true;
if (GTool_1.GTool.readCache("isNQCTGuide")) {
this.guideLevel = 2;
......
import React, { Component } from 'react';
import React, {
Component
} from 'react';
import ReactDOM from "react-dom";
import config from './config';
import Enum from './enum';
......@@ -8,7 +10,7 @@ import Toast from '../components/toast/toast.jsx';
import Waitting from '../components/waitting/waitting.jsx';
const ViewCtrl = {
showToast:(msg = "活动异常火爆,请稍后再试")=>{
showToast: (msg = "活动异常火爆,请稍后再试") => {
let T = Toast;
var m = document.createElement('div');
m.className = "popcontainer_empty"
......@@ -22,12 +24,15 @@ const ViewCtrl = {
document.body.removeChild(m)
}, 500);
}, 1500);
T = <T msg={msg} />
T = < T msg = {
msg
}
/>
ReactDOM.render(T, m);
},
initWaiting:()=>{
if(document.getElementById("waittingId")) return;
initWaiting: () => {
if (document.getElementById("waittingId")) return;
let T = Waitting;
var m = document.createElement('div');
m.className = "popcontainer_empty"
......@@ -36,17 +41,17 @@ const ViewCtrl = {
m.style.opacity = 0;
m.style.pointerEvents = "none";
document.body.appendChild(m);
T = <T />
ReactDOM.render(T, m);
T = < T / >
ReactDOM.render(T, m);
},
showWaiting:()=>{
showWaiting: () => {
let node = document.getElementById("waittingId");
node.style.pointerEvents = "";
node.style.opacity = 1;
},
hideWaiting:()=>{
hideWaiting: () => {
let node = document.getElementById("waittingId");
node.style.pointerEvents = "none";
node.style.opacity = 0;
......@@ -76,18 +81,23 @@ const ViewCtrl = {
/**弹出弹窗 */
showWin: (enumComKey, data = {},call) => {
showWin: (enumComKey, data = {}, call) => {
let T = config.comMap.get(enumComKey)
var m = document.createElement('div');
m.className = "popcontainer"
document.body.appendChild(m);
let root = document.getElementById("root")
if (!root) {
root = document.getElementById("root1")
}
root.style.position = "fixed"
/**
* @param {function} cb
*/
const closeWin = (cb) => {
document.body.removeChild(m);
root.style.position = "absolute"
if (typeof cb == 'function') {
try {
cb()
......@@ -96,7 +106,16 @@ const ViewCtrl = {
}
}
}
T = <T closeWin={closeWin} data={data} call={call} />
T = < T closeWin = {
closeWin
}
data = {
data
}
call = {
call
}
/>
ReactDOM.render(T, m);
},
......@@ -109,11 +128,15 @@ const ViewCtrl = {
/**切换页面 */
changePage: (enumPageKey = -1) => {
let event = new CustomEvent("changePage", { detail: { id: enumPageKey } });
let event = new CustomEvent("changePage", {
detail: {
id: enumPageKey
}
});
document.dispatchEvent(event)
}
}
......
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