Commit 553a8276 authored by wildfirecode13's avatar wildfirecode13

1

parent 6823c823
{
"view": {
"children": [
{
"name": "_frontpage",
"uuid": "2f70966f-cac6-4651-9d72-00d24a09b2b5",
"rect": {
"x": 0,
"y": 0,
"width": 300,
"height": 300
},
"componentName": "Div",
"viewType": "Scene",
"children": [
{
"name": "Div",
"uuid": "7275da9c-f8ff-42b9-b085-8f86a24d5cb7",
"componentName": "Div",
"viewType": "Element",
"rect": {
"x": 0,
"y": 0,
"width": 300,
"height": 300
},
"children": [],
"properties": {
"attrs": {},
"className": "",
"style": {
"width": 300,
"height": 300,
"opacity": 1,
"display": "block",
"position": "absolute",
"backgroundColor": "#ff6600",
"transformOrigin": "0px 0px 0px",
"top": 278,
"left": -142
}
}
},
{
"name": "Image",
"uuid": "e529a2b0-2d0b-4849-9d95-b2f8fa663fa1",
"rect": {
"x": 0,
"y": 0,
"width": 300,
"height": 300
},
"componentName": "Image",
"viewType": "Element",
"properties": {
"attrs": {
"source": "asset://eb602b5e-fd36-4968-bed0-ec786cd8e1c0",
"url": "//yun.duiba.com.cn/spark-prod/assets/资源.7ec4dc0a776a20da7e58e0cee4fab560dea0ec76.png"
},
"className": "",
"style": {
"width": 276,
"height": 275,
"opacity": 1,
"display": "block",
"position": "absolute",
"transformOrigin": "0px 0px 0px",
"left": -184,
"top": -134
}
}
}
],
"properties": {
"attrs": {},
"className": "",
"name": "空视图",
"style": {
"width": 750,
"height": 1624,
"display": "block",
"position": "absolute",
"transformOrigin": "0px 0px 0px",
"left": 228,
"top": 146
}
}
},
{
"name": "rulePanel",
"properties": {
"style": {
"top": 0,
"left": 0,
"width": 750,
"height": 1624,
"display": "block",
"position": "absolute"
},
"attrs": {},
"className": "",
"name": "空视图"
},
"uuid": "5b0e5310-cca9-4b9a-87e8-1fec149a951f",
"rect": {
"x": 0,
"y": 0,
"width": 300,
"height": 300
},
"componentName": "Div",
"viewType": "Panel",
"children": [
{
"name": "Image2",
"uuid": "de9588ea-da5f-4f33-a686-6db277050c5d",
"componentName": "Image",
"viewType": "Element",
"properties": {
"style": {
"width": 300,
"height": 300,
"opacity": 1,
"display": "block",
"left": 0,
"top": 0,
"position": "absolute",
"transformOrigin": "0px 0px 0px"
},
"attrs": {
"source": "asset://eb602b5e-fd36-4968-bed0-ec786cd8e1c0"
},
"className": ""
},
"rect": {
"x": 0,
"y": 0,
"width": 300,
"height": 300
}
}
]
}
]
},
"assets": [
{
"name": "资源",
"ext": ".png",
"url": "//yun.duiba.com.cn/spark-prod/assets/资源.7ec4dc0a776a20da7e58e0cee4fab560dea0ec76.png",
"uuid": "eb602b5e-fd36-4968-bed0-ec786cd8e1c0"
}
],
"dependencies": {
"duiba-api": "0.0.1",
"log": "0.0.1",
"browser": "0.0.2",
"duiba": "0.0.2",
"ui": "0.0.2"
}
}
\ No newline at end of file
.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
package-lock=false
registry = http://registry.npm.taobao.org/
\ No newline at end of file
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": "spark-project-create",
"version": "0.1.0",
"private": true,
"scripts": {
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'"
},
"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"
},
"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>
function getApp(){
return {
cloud:{},
cloudName:"clientTemplate2C",
requestType:"mock"
}
}
var CFG = CFG || {};
CFG.projectId = location.pathname.split('/')[2] || '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>
<script src="//yun.duiba.com.cn/db_games/activity/md5/zepto_security_downloadApp.min.js"></script>
</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 }))
: (config.params = { ...config.params });
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 Pagefrontpage from "./pages/pagefrontpage/pagefrontpage.jsx";
class App extends Component {
render() {
return (
<Pagefrontpage></Pagefrontpage>
);
}
}
ReactDOM.render(<App />, document.getElementById("root"));
* {
margin: 0;
padding: 0;
}
html,
body {
font-size: 24px;
width: 100%;
height: 100%;
}
const resCanvasList = {};
export default resCanvasList;
'use strict';
import React, { Component } from 'react';
import resList from '../../resconfig/resList';
import './comrulepanel.less';
class Comrulepanel extends Component {
constructor(props) {
super(props);
this.state = this.state || { resList: resList };
}
render() {
return (
<div className="rulepanel">
<img className="image2" src={this.state.resList['eb602b5e-fd36-4968-bed0-ec786cd8e1c0'].url} />
</div>
);
}
}
export default Comrulepanel;
.rulepanel {
top: 0px;
left: 0px;
width: 750px;
height: 1624px;
display: block;
position: absolute;
.image2 {
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 './pagefrontpage.less';
class Pagefrontpage extends Component {
constructor(props) {
super(props);
this.state = this.state || { resList: resList };
}
render() {
return (
<div className="frontpage">
<div className="div" />
<img className="image" src={this.state.resList['eb602b5e-fd36-4968-bed0-ec786cd8e1c0'].url} />
</div>
);
}
}
export default Pagefrontpage;
.frontpage {
width: 750px;
height: 1624px;
display: block;
position: absolute;
transform-origin: 0px 0px 0px;
left: 228px;
top: 146px;
.div {
width: 300px;
height: 300px;
opacity: 1;
display: block;
position: absolute;
background-color: #ff6600;
transform-origin: 0px 0px 0px;
top: 278px;
left: -142px;
}
.image {
width: 276px;
height: 275px;
opacity: 1;
display: block;
position: absolute;
transform-origin: 0px 0px 0px;
left: -184px;
top: -134px;
}
}
/**
* 目前没有用到
* @param {*} resList
* @param {*} uuid
*/
const getSrcByUuid = (resList, uuid) => {
resList = resList || [];
for (let i = 0; i < resList.length; i++) {
if (resList[i].uuid == uuid) {
return resList[i].url
}
}
}
module.exports = {
getSrcByUuid
}
\ No newline at end of file
const resList = {
'eb602b5e-fd36-4968-bed0-ec786cd8e1c0': {
name: '资源',
ext: '.png',
url: '//yun.duiba.com.cn/spark-prod/assets/资源.7ec4dc0a776a20da7e58e0cee4fab560dea0ec76.png',
uuid: 'eb602b5e-fd36-4968-bed0-ec786cd8e1c0',
},
};
export default resList;
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