Commit 45b561b7 authored by wildfirecode13's avatar wildfirecode13

1

parent 3906d059
.DS_Store
node_modules/
coverage/
dist/
npm-debug.log
selenium-debug.log
.idea
.builds
.project
.vscode
yarn-error.log
.yarn
.package-lock
yarn.lock
.cache
packages/**/package-lock.json
import MD from 'spark-utils/out/md/index.js';
let appId = CFG.appID;
const dcm = '202.' + CFG.projectId + '.0.0';
const domain = '//embedlog.duiba.com.cn';
let MDList = [
{
ele: `.test-md1`,
data: {
dpm: `${appId}.110.5.1`,
dcm,
domain,
appId
},
once: false
}
];
export default () =>
MD({
show: MDList, // 曝光
click: MDList // 点击
});
export const join = {
"success": true,
"data": {
message: "参与成功"
}
};
export * from './rule';
import { Random } from 'mockjs';
export const rule = {
"success": true,
"data": `活动规则: ${Random.cparagraph(20, 40)}`
};
import Mock from 'mockjs';
import proxy from './proxy';
Object.keys(proxy).map(method => {
Object.keys(proxy[method]).map(URI => {
let data = proxy[method][URI];
Mock.mock(new RegExp(URI), method, opt => {
console.log(`%c[mock] 链接:${opt.url} 类型:${method} 参数:${method === 'post' && JSON.stringify(opt.body) || ''}`, "color: rgb(63, 172, 203)", data);
return data
});
})
})
\ No newline at end of file
import * as common from './common';
import * as collect_0722 from './collect_0722';
let projectId = window.CFG.projectId || '';
export default {
get: {
[`/projectx/${projectId}/projectRule.query`]: common.rule
},
post: {
[`/projectx/${projectId}/join.do`]: collect_0722.join
}
};
\ No newline at end of file
{
"name": "tbgame",
"name": "sparkproject-1606025587972",
"version": "1.0.0",
"description": "",
"main": "index.html",
"devDependencies": {
"ali-oss": "^4.11.4",
"chalk": "^2.3.0",
"co": "^4.6.0",
"del": "^2.2.1",
"fs": "0.0.2",
"imagemin": "^7.0.1",
"imagemin-mozjpeg": "^8.0.0",
"imagemin-pngquant": "^8.0.0",
"mock-webpack-plugin": "^2.0.0",
"path": "^0.12.7",
"progress": "^2.0.0",
"ts-loader": "^4.0.0",
"tslint": "^5.9.1",
"typescript": "^2.7.2",
"webpack": "^4.1.0",
"webpack-cli": "^3.1.1",
"webpack-dev-server": "^3.1.0",
"webpack-merge": "^4.1.2",
"uglifyjs-webpack-plugin": "^2.1.2",
"psd": "^3.2.0"
"private": true,
"scripts": {},
"dependencies": {
"axios": "^0.19.2",
"css-loader": "^3.6.0",
"fyge-tbmini": "^1.3.1",
"postcss-loader": "^3.0.0",
"prettier": "^2.0.5",
"qs": "^6.9.4",
"react": "^16.4.1",
"react-dom": "^16.4.1",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-thunk": "^2.3.0",
"style-loader": "^1.2.1",
"spark-utils": "git+ssh://git@gitlab2.dui88.com:spark/spark-utils.git"
},
"dependencies": {},
"scripts": {
"psd": "node scripts/psdH.js && node scripts/flushRes",
"createModule": "node scripts/createModule",
"flushRes": "node scripts/flushRes",
"handleRes": "node scripts/delRel && node scripts/copyRes && node scripts/createTm && node scripts/textureMerge && node scripts/delTm && node scripts/imageMin",
"upload": "node scripts/upload",
"build": "npm run handleRes && node scripts/mergeJson && npm run upload && npm run buildTS",
"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",
"copyJs": "node scripts/copyJs"
},
"author": "MrKwon",
"license": "ISC"
"devDependencies": { "mockjs": "^1.1.0" }
}
<!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 = 200 * (e / 750) + 'px');
};
s(), e.addEventListener && i.addEventListener(m, s, !1);
})(document, window);
</script>
<script src="//yun.duiba.com.cn/h5/lib/zepto.min.js"></script>
<script>
function getApp(){
return {
cloud:{},
cloudName:"clientTemplate2C",
requestType:"mock"
}
}
var CFG = CFG || {};
CFG.projectId = location.pathname.split('/')[2] || '1';
function getUrlParam(name) {
const search = window.location.search;
const matched = search
.slice(1)
.match(new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'));
return search.length ? matched && matched[2] : null;
}
CFG.appID = getUrlParam("appID")||1
</script>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
module.exports = {
OUTPUT_DIR: "dist",
SOURCE_DIR: "src",
TEMP_DIR: "./.temp",
ENTRY: "src/app.jsx",
TEMPLATE: "./public/index.html",
MOCK_STATUS: true
};
let projectId = window.CFG.projectId || '';
const apiCfg = {
getRule:`/projectx/${projectId}/projectRule.query`,
doJoin: {
uri: `/projectx/${projectId}/join.do`,
method: "post"
}
}
export default apiCfg;
\ No newline at end of file
import apiCfg from './apicfg';
import request from './request';
const apiList = {
...apiCfg
}
const API = generateAPI(apiList);
export default API;
function getRequestParams(value) {
if (typeof value === 'string') {
return {
uri: value,
method: 'get'
}
} else if (typeof value === 'object') {
const { uri, method = 'post' } = value;
return {
uri,
method
}
} else {
console.error('getRequestParams: 传参有误');
}
};
function generateAPI(apiList) {
const api = {};
Object.entries(apiList).forEach(([key, value]) => {
const { method, uri } = getRequestParams(value);
api[key] = params => request[method](uri, method === 'post' ? params : { params });
});
return api;
}
import Qs from "qs";
import axios from "axios";
const TIMEOUT = 10000;
const instance = axios.create({
timeout: TIMEOUT, // 请求超时时间
});
instance.interceptors.request.use(
(config) => {
if (config.method === "get") {
config.data = true;
}
config.method === "post"
? (config.data = Qs.stringify({ ...config.data, _t: Date.now() }))
: (config.params = { ...config.params, _t: Date.now() });
config.headers["Content-Type"] = "application/x-www-form-urlencoded";
return config;
},
(error) => {
//请求错误处理
Promise.reject(error);
}
);
// 响应拦截器
instance.interceptors.response.use(
// 请求成功
(res) => {
const { status } = res || -1000;
return (status >= 200 && status <= 400) ? res.data : res
}
);
export default instance;
import React, { Component } from "react";
import ReactDOM from "react-dom";
import "./app.less";
import { MOCK_STATUS } from '../sparkrc';
MOCK_STATUS && (require('../mock/index'));
import MD from '../MD';
MD();
//此处为spark-cli动态生成
import Pagepic1 from "./pages/pagepic1/pagepic1.jsx";
class App extends Component {
render() {
return (
<Pagepic1></Pagepic1>
);
}
}
ReactDOM.render(<App />, document.getElementById("root"));
* {
margin: 0;
padding: 0;
}
html,
body {
font-size: 24px;
width: 100%;
height: 100%;
}
{
"name": "tbgame",
"version": "1.0.0",
"description": "",
"main": "index.html",
"devDependencies": {
"ali-oss": "^4.11.4",
"chalk": "^2.3.0",
"co": "^4.6.0",
"del": "^2.2.1",
"fs": "0.0.2",
"imagemin": "^7.0.1",
"imagemin-mozjpeg": "^8.0.0",
"imagemin-pngquant": "^8.0.0",
"mock-webpack-plugin": "^2.0.0",
"path": "^0.12.7",
"progress": "^2.0.0",
"ts-loader": "^4.0.0",
"tslint": "^5.9.1",
"typescript": "^2.7.2",
"webpack": "^4.1.0",
"webpack-cli": "^3.1.1",
"webpack-dev-server": "^3.1.0",
"webpack-merge": "^4.1.2",
"uglifyjs-webpack-plugin": "^2.1.2",
"psd": "^3.2.0"
},
"dependencies": {},
"scripts": {
"psd": "node scripts/psdH.js && node scripts/flushRes",
"createModule": "node scripts/createModule",
"flushRes": "node scripts/flushRes",
"handleRes": "node scripts/delRel && node scripts/copyRes && node scripts/createTm && node scripts/textureMerge && node scripts/delTm && node scripts/imageMin",
"upload": "node scripts/upload",
"build": "npm run handleRes && node scripts/mergeJson && npm run upload && npm run buildTS",
"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",
"copyJs": "node scripts/copyJs"
},
"author": "MrKwon",
"license": "ISC"
}
'use strict';
import React, { Component } from 'react';
import './output.js';
//import API from '../../api';
class PageCanvas extends Component {
constructor(props) {
super(props);
this.state = this.state || { };
}
componentDidMount() {
let main = this.spark_startEngine();
//main.addEventListener....
}
/**
* 模板自动生成。不参与转换,请勿在此方法内修改逻辑。
*/
spark_startEngine() {
if(typeof Main !== 'function')
{
console.error("ERROR::::先发布引擎后,将output.js放入同目录下");
return null;
}
var canvas = document.getElementById("canvas");
canvas.width = document.body.clientWidth * (window.devicePixelRatio || 1)
canvas.height = document.body.clientHeight * (window.devicePixelRatio || 1);
var main = new Main(canvas);
var mouseEvent = main.stage.onMouseEvent.bind(main.stage);
canvas.addEventListener("touchstart", mouseEvent, false);
canvas.addEventListener('touchmove', mouseEvent, false);
canvas.addEventListener('touchend', mouseEvent, false);
return main;
}
render() {
return (<div>
<canvas id="canvas" style={{ width: "100%", height: "100%" }}></canvas>
</div>)
}
}
export default PageCanvas;
'use strict';
import React, { Component } from 'react';
import resList from '../../resconfig/resList';
//import API from '../../api';
import './pageindex.less';
class Pageindex extends Component {
constructor(props) {
super(props);
this.state = { resList: resList };
}
render() {
return (
<div className="index ">
<div>
<canvas id="canvas" style={{ width: '100%', height: '100%' }}></canvas>
</div>
</div>
);
}
}
export default Pageindex;
.index {
top: 0px;
left: 0px;
width: 750px;
height: 1624px;
display: block;
position: absolute;
.canvas {
width: 300px;
height: 300px;
opacity: 1;
display: block;
left: 0px;
top: 0px;
position: absolute;
transform-origin: 0px 0px 0px;
}
}
'use strict';
import React, { Component } from 'react';
import resList from '../../resconfig/resList';
//import API from '../../api';
import './pagepic1.less';
class Pagepic1 extends Component {
constructor(props) {
super(props);
this.state = { resList: resList };
}
render() {
return (
<div className="pic1 ">
<img className="pic1bg " src={this.state.resList['569dd998-f2f7-45fa-abe9-63a8b7f84371'].url} />
<div className="pic1clickobjects ">
<img className="pic1clickobjects1 " src={this.state.resList['6ec2639f-35d5-4c26-a370-4e4acfdcc731'].url} />
<img className="pic1clickobjects2 " src={this.state.resList['85562d92-4b5a-425b-958f-7c9bfed9da40'].url} />
<img className="pic1clickobjects3 " src={this.state.resList['559e8c4e-dee7-4b52-898c-6b494b873026'].url} />
<img className="pic1clickobjects4 " src={this.state.resList['de5562b9-3560-4996-ad5d-ea6b5416ce1d'].url} />
<img className="pic1clickobjects5 " src={this.state.resList['eeaa0816-191d-4d58-b770-dc2d6af66926'].url} />
<img className="pic1clickobjects6 " src={this.state.resList['5bff68d3-5c43-496d-86fb-b00f3a0b89a2'].url} />
<img className="pic1clickobjects7 " src={this.state.resList['246ad7a2-5bac-46e7-8f8f-b38ee2207f96'].url} />
<img className="pic1clickobjects8 " src={this.state.resList['9d61972e-4985-4286-b387-be505f6418e2'].url} />
<img className="pic1clickobjects9 " src={this.state.resList['4c22719d-a6e1-451b-ae86-127312c6e956'].url} />
</div>
<div className="pic1envobjects ">
<img className="pic1envobjects17 " src={this.state.resList['40a81cea-fe18-4429-afb9-7f4d4edf640a'].url} />
<img className="pic1envobjects16 " src={this.state.resList['d453b644-86d2-421a-93a9-374eb72c6353'].url} />
<img className="pic1envobjects15 " src={this.state.resList['6fc51884-53ab-4498-bb9a-c6eccdd3c2a8'].url} />
<img className="pic1envobjects14 " src={this.state.resList['5d5d78ea-dc43-4bd8-bc66-04c2d899ef43'].url} />
<img className="pic1envobjects13 " src={this.state.resList['39cedd6b-851b-4161-a3f6-cd438fd8ae91'].url} />
<img className="pic1envobjects12 " src={this.state.resList['83d54e97-df2b-452a-810d-0e64ba2a9c51'].url} />
<img className="pic1envobjects11 " src={this.state.resList['13b3d54f-e921-4775-9c36-3a8aa4088802'].url} />
<img className="pic1envobjects10 " src={this.state.resList['225aaae9-8ce6-4487-aa74-ca5f9f891059'].url} />
<img className="pic1envobjects9 " src={this.state.resList['ed9cc172-48e0-428f-869f-a7e2e3a6f7e7'].url} />
<img className="pic1envobjects8 " src={this.state.resList['a2fe8b7a-cd2a-4707-89dd-1383382dd83d'].url} />
<img className="pic1envobjects7 " src={this.state.resList['b8bf9264-dc1d-482d-a7a5-e6d46edf4d45'].url} />
<img className="pic1envobjects6 " src={this.state.resList['c083297d-dba4-4139-a35f-20cb9e0d9f07'].url} />
<img className="pic1envobjects5 " src={this.state.resList['b3cff974-882d-420b-adb8-55cd14e3a9f4'].url} />
<img className="pic1envobjects4 " src={this.state.resList['d21d05e4-b249-4593-bcc4-fa320115c80e'].url} />
<img className="pic1envobjects3 " src={this.state.resList['6a4a63d3-ec27-4e63-bf96-20089100af06'].url} />
<img className="pic1envobjects2 " src={this.state.resList['f87ef793-3c48-43d4-a68c-e5017e89038f'].url} />
<img className="pic1envobjects1 " src={this.state.resList['2d80b2aa-276b-4e3f-a950-cdaecb6fa5c4'].url} />
</div>
<img className="pic1front " src={this.state.resList['4d13240d-50ca-4fba-801b-85f3e6ce5695'].url} />
</div>
);
}
}
export default Pagepic1;
.pic1 {
width: 1500px;
height: 2000px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
left: 0px;
top: 0px;
.pic1bg {
width: 1500px;
height: 2000px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects {
width: 1301px;
height: 1511px;
opacity: 1;
left: 157px;
top: 181px;
position: absolute;
transform-origin: 0px 0px 0px;
.pic1clickobjects1 {
width: 405px;
height: 258px;
opacity: 1;
left: 38px;
top: 1194px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects2 {
width: 480px;
height: 318px;
opacity: 1;
top: 859px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects3 {
width: 289px;
height: 301px;
opacity: 1;
left: 109px;
top: 661px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects4 {
width: 123px;
height: 117px;
opacity: 1;
left: 203px;
top: 627px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects5 {
width: 151px;
height: 401px;
opacity: 1;
left: 954px;
top: 1110px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects6 {
width: 308px;
height: 205px;
opacity: 1;
left: 967px;
top: 778px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects7 {
width: 170px;
height: 596px;
opacity: 1;
left: 755px;
top: 618px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects8 {
width: 252px;
height: 325px;
opacity: 1;
left: 1049px;
top: 296px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1clickobjects9 {
width: 222px;
height: 303px;
opacity: 1;
left: 791px;
position: absolute;
transform-origin: 0px 0px 0px;
}
}
.pic1envobjects {
width: 1399px;
height: 1800px;
opacity: 1;
top: 104px;
position: absolute;
transform-origin: 0px 0px 0px;
.pic1envobjects17 {
width: 254px;
height: 293px;
opacity: 1;
left: 924px;
top: 1507px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects16 {
width: 174px;
height: 138px;
opacity: 1;
left: 895px;
top: 1283px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects15 {
width: 249px;
height: 522px;
opacity: 1;
left: 636px;
top: 1130px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects14 {
width: 167px;
height: 320px;
opacity: 1;
top: 1430px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects13 {
width: 152px;
height: 221px;
opacity: 1;
left: 66px;
top: 1090px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects12 {
width: 478px;
height: 274px;
opacity: 1;
left: 158px;
top: 977px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects11 {
width: 146px;
height: 64px;
opacity: 1;
left: 1253px;
top: 1083px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects10 {
width: 317px;
height: 99px;
opacity: 1;
left: 806px;
top: 1089px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects9 {
width: 139px;
height: 80px;
opacity: 1;
left: 54px;
top: 926px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects8 {
width: 216px;
height: 391px;
opacity: 1;
left: 92px;
top: 578px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects7 {
width: 239px;
height: 227px;
opacity: 1;
left: 736px;
top: 527px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects6 {
width: 143px;
height: 101px;
opacity: 1;
left: 1037px;
top: 469px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects5 {
width: 205px;
height: 467px;
opacity: 1;
left: 480px;
top: 336px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects4 {
width: 319px;
height: 287px;
opacity: 1;
left: 713px;
top: 154px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects3 {
width: 133px;
height: 95px;
opacity: 1;
left: 731px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects2 {
width: 225px;
height: 166px;
opacity: 1;
left: 487px;
top: 97px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.pic1envobjects1 {
width: 273px;
height: 420px;
opacity: 1;
left: 147px;
top: 116px;
position: absolute;
transform-origin: 0px 0px 0px;
}
}
.pic1front {
width: 1500px;
height: 1907px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
}
}
This diff is collapsed.
This diff is collapsed.
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