Commit 3d30ebf8 authored by yanghui1's avatar yanghui1

测试

parent 766ca522
<!doctype html><html lang="zh"><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"><link rel="dns-prefetch" href="//yun.duiba.com.cn"/><link rel="preconnect" href="//embedlog.duiba.com.cn"><title>活动标题</title><script>if (localStorage && localStorage.isWebp) {
document
.getElementsByTagName('html')[0]
.setAttribute('duiba-webp', 'true');
}</script><script src="//yun.duiba.com.cn/spark/v2/spark.base.fz.wxpollyfill.js"></script><script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script><script src="//yun.duiba.com.cn/h5/lib/zepto.min.js"></script><script>"use strict";
var CFG = CFG || {};
CFG.projectId = location.pathname.split('/')[2] || '1';
function getUrlParam(name) {
var search = window.location.search;
var matched = search.slice(1).match(new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i'));
return search.length ? matched && matched[2] : null;
}
CFG.appID = '${APPID}';
if (!getUrlParam("appID")) {// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
}</script><link href="//yun.duiba.com.cn/spark/v2/temp_base/1651112891659/styles/main.f298a0cb5716ac3469de.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script src="//yun.duiba.com.cn/spark/v2/temp_base/1651112891659/js/runtime-main.93b7d9da.js" crossorigin="anonymous"></script><script src="//yun.duiba.com.cn/spark/v2/temp_base/1651112891659/js/vendors.879cb3e7.js" crossorigin="anonymous"></script><script src="//yun.duiba.com.cn/spark/v2/temp_base/1651112891659/js/main.38456f32.js" crossorigin="anonymous"></script></body></html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
!function(e){function r(r){for(var n,a,l=r[0],i=r[1],p=r[2],c=0,s=[];c<l.length;c++)a=l[c],Object.prototype.hasOwnProperty.call(o,a)&&o[a]&&s.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(f&&f(r);s.length;)s.shift()();return u.push.apply(u,p||[]),t()}function t(){for(var e,r=0;r<u.length;r++){for(var t=u[r],n=!0,l=1;l<t.length;l++){var i=t[l];0!==o[i]&&(n=!1)}n&&(u.splice(r--,1),e=a(a.s=t[0]))}return e}var n={},o={1:0},u=[];function a(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,a),t.l=!0,t.exports}a.m=e,a.c=n,a.d=function(e,r,t){a.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,r){if(1&r&&(e=a(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(a.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)a.d(t,n,function(r){return e[r]}.bind(null,n));return t},a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,"a",r),r},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},a.p="//yun.duiba.com.cn/spark/v2/temp_base/1651112891659/";var l=window.webpackJsonp=window.webpackJsonp||[],i=l.push.bind(l);l.push=r,l=l.slice();for(var p=0;p<l.length;p++)r(l[p]);var f=i;t()}([]);
//# sourceMappingURL=runtime-main.93b7d9da.js.map
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap"],"names":["webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","executeModules","i","resolves","length","Object","prototype","hasOwnProperty","call","installedChunks","push","modules","parentJsonpFunction","shift","deferredModules","apply","checkDeferredModules","result","deferredModule","fulfilled","j","depId","splice","__webpack_require__","s","installedModules","1","exports","module","l","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","p","jsonpArray","window","oldJsonpFunction","slice"],"mappings":"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","file":"js/runtime-main.93b7d9da.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n \t\tvar executeModules = data[2];\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(Object.prototype.hasOwnProperty.call(installedChunks, chunkId) && installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t\t// add entry modules from loaded chunk to deferred list\n \t\tdeferredModules.push.apply(deferredModules, executeModules || []);\n\n \t\t// run deferred modules when all chunks ready\n \t\treturn checkDeferredModules();\n \t};\n \tfunction checkDeferredModules() {\n \t\tvar result;\n \t\tfor(var i = 0; i < deferredModules.length; i++) {\n \t\t\tvar deferredModule = deferredModules[i];\n \t\t\tvar fulfilled = true;\n \t\t\tfor(var j = 1; j < deferredModule.length; j++) {\n \t\t\t\tvar depId = deferredModule[j];\n \t\t\t\tif(installedChunks[depId] !== 0) fulfilled = false;\n \t\t\t}\n \t\t\tif(fulfilled) {\n \t\t\t\tdeferredModules.splice(i--, 1);\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = deferredModule[0]);\n \t\t\t}\n \t\t}\n\n \t\treturn result;\n \t}\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n \tvar deferredModules = [];\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"//yun.duiba.com.cn/spark/v2/temp_base/1651112891659/\";\n\n \tvar jsonpArray = window[\"webpackJsonp\"] = window[\"webpackJsonp\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// run deferred modules from other chunks\n \tcheckDeferredModules();\n"],"sourceRoot":""}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
*{margin:0;padding:0}body,html{font-size:.24rem;width:100%;height:100%;-webkit-text-size-adjust:100%!important;-ms-text-size-adjust:100%!important;text-size-adjust:100%!important;-moz-text-size-adjust:100%!important}.modal-hoc-bg{position:fixed;top:0;bottom:0;right:0;left:0;background-color:rgba(0,0,0,.8);z-index:1000}.loadingDemo{top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.loadingDemo,.loadingDemo .bg174{width:7.5rem;height:16.24rem;left:0;position:absolute}.loadingDemo .bg174{top:0;background:url(//yun.duiba.com.cn/spark/v2/temp_base/1651112884768/loadingDemo/%E8%83%8C%E6%99%AF.jpg) no-repeat 0 0/100% 100%}[duiba-webp=true] .loadingDemo .bg174{background:url(//yun.duiba.com.cn/spark/v2/temp_base/1651112884768/loadingDemo/%E8%83%8C%E6%99%AF.jpg?x-oss-process=image%2Fformat%2Cwebp) no-repeat 0 0/100% 100%}.loadingDemo .progressBar{width:5.24rem;height:.22rem;left:1.13rem;top:7.17rem;position:absolute;overflow:hidden;border-radius:.06rem}.loadingDemo .progressBar .atBottom{width:5.24rem;height:.22rem;left:0;top:0;position:absolute;background:url(//yun.duiba.com.cn/spark/v2/temp_base/1651112884768/loadingDemo/%E5%BA%95%E9%83%A8173.png) no-repeat 0 0/100% 100%}[duiba-webp=true] .loadingDemo .progressBar .atBottom{background:url(//yun.duiba.com.cn/spark/v2/temp_base/1651112884768/loadingDemo/%E5%BA%95%E9%83%A8173.png?x-oss-process=image%2Fformat%2Cwebp) no-repeat 0 0/100% 100%}.loadingDemo .progressBar .loadingBg{width:5.16rem;height:.14rem;left:.05rem;top:.04rem;overflow:hidden;position:absolute;border-radius:.06rem}.loadingDemo .progressBar .above{display:block;position:relative;width:5.16rem;height:.14rem;background:url(//yun.duiba.com.cn/spark/v2/temp_base/1651112884768/loadingDemo/%E4%B8%8A%E9%9D%A2.png) no-repeat 0 0/100% 100%;border-radius:.06rem}[duiba-webp=true] .loadingDemo .progressBar .above{background:url(//yun.duiba.com.cn/spark/v2/temp_base/1651112884768/loadingDemo/%E4%B8%8A%E9%9D%A2.png?x-oss-process=image%2Fformat%2Cwebp) no-repeat 0 0/100% 100%}.loadingDemo .inLoad{width:1.17rem;height:.23rem;left:3.22rem;top:7.58rem;position:absolute;font-size:.24rem;line-height:.23rem;color:#fff}@-webkit-keyframes loading{0%{-webkit-transform:translateX(-5.2rem);transform:translateX(-5.2rem)}to{-webkit-transform:translateX(0);transform:translateX(0)}}@keyframes loading{0%{-webkit-transform:translateX(-5.2rem);transform:translateX(-5.2rem)}to{-webkit-transform:translateX(0);transform:translateX(0)}}
\ No newline at end of file
This diff is collapsed.
...@@ -10,11 +10,11 @@ MD(); ...@@ -10,11 +10,11 @@ MD();
//此处为spark-cli动态生成 //此处为spark-cli动态生成
import LoadingDemo from "@src/pages/loadingDemo/loadingDemo"; import LoadingDemo from "@src/pages/loadingDemo/loadingDemo";
import HomeDemo from "@src/pages/homeDemo/homeDemo"; import HomePage from './pages/homePage/homePage'
const pageMap = { const pageMap = {
loading: <LoadingDemo />, loading: <LoadingDemo />,
homePage: <HomeDemo/>, homePage: <HomePage/>,
} }
@observer @observer
class App extends Component { class App extends Component {
......
{"preLoadImg":[],"asyncLoadImg":[]} {"preLoadImg":[],"asyncLoadImg":["图-白天/IP口味王色系.png","图-白天/周二.png","图-白天/活动规则.png","图-白天/签到区.png","图-白天/组8292.png"]}
\ No newline at end of file \ No newline at end of file
import React, { Component } from "react"; import React, { Component } from "react";
import './modal.less'; import './modal.less';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import modalStore from '../store/modal'; import modalStore from '../store/modal';
import { toJS } from 'mobx'; import { toJS } from 'mobx';
export const cfg = { export const cfg = {};
};
@observer @observer
class Modal extends Component { class Modal extends Component {
...@@ -14,31 +11,32 @@ class Modal extends Component { ...@@ -14,31 +11,32 @@ class Modal extends Component {
super(props); super(props);
} }
componentDidMount() { } componentDidMount() {}
render() { render() {
const list = toJS(modalStore.popList); const list = toJS(modalStore.popList);
if (!list.length) { if (!list.length) {
//TODO:此处根据需要自行修改 //TODO:此处根据需要自行修改
document.body.style.overflow='auto'; document.body.style.overflow = 'auto';
return <section></section>; return <section></section>;
} }
let PopUpMulti, popUpMultiData; let PopUpMulti, popUpMultiData;
if (list.length > 1 && list[list.length - 1].isMulti == true) { if (list.length > 1 && list[list.length - 1].isMulti == true) {
const popObj2 = list[list.length - 1]; const popObj2 = list[list.length - 1];
PopUpMulti = cfg[popObj2.key]; PopUpMulti = cfg[popObj2.key];
popUpMultiData = popObj2.data; popUpMultiData = popObj2.data;
} }
const popObj = list[0]; const popObj = list[0];
const PopUp = cfg[popObj.key]; const PopUp = cfg[popObj.key];
const popData = popObj.data; const popData = popObj.data;
if (PopUp || PopUpMulti) { if (PopUp || PopUpMulti) {
document.body.style.overflow='hidden'; document.body.style.overflow = 'hidden';
} }
return <section className="modal-hoc-bg" style={{ return <section className="modal-hoc-bg" style={{
zIndex: modalStore.popList.length ? 1000 : -1, zIndex: modalStore.popList.length ? 1000 : -1,
......
'use strict';
import React from 'react';
import { observer } from 'mobx-react';
import './homeDemo.less';
@observer
class HomeDemo extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div className="homeDemo">
当前为活动首页
</div>
);
}
}
export default HomeDemo;
@import "../../res.less";
.homeDemo {}
'use strict';
import React from 'react';
import { RES_PATH } from '../../../sparkrc.js';
import { observer } from 'mobx-react';
import store from '../../store/index';
import modalStore from '@src/store/modal';
import API from '../../api';
import './homePage.less';
@observer
class HomePage extends React.Component {
constructor(props) {
super(props);
}
render() {
return (
<div className="homePage">
<span className="group8292"></span>
<span className="ipTasteKingColorSystem"></span>
<span className="checkinArea"></span>
<span className="tuesday"></span>
<span className="activityRules"></span>
</div>
);
}
}
export default HomePage;
@import "../../res.less";
.homePage {
width: 750px;
height: 1240px;
left: 0px;
top: 0px;
position: absolute;
.group8292 {
width: 750px;
height: 1240px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("图-白天/组8292.png");
}
.ipTasteKingColorSystem {
width: 192px;
height: 221px;
left: 527px;
top: 223px;
position: absolute;
.sparkBg("图-白天/IP口味王色系.png");
}
.checkinArea {
width: 697px;
height: 218px;
left: 27px;
top: 363px;
position: absolute;
.sparkBg("图-白天/签到区.png");
}
.tuesday {
width: 515px;
height: 93px;
left: 0px;
top: 258px;
position: absolute;
.sparkBg("图-白天/周二.png");
}
.activityRules {
width: 102px;
height: 31px;
left: 648px;
top: 240px;
position: absolute;
.sparkBg("图-白天/活动规则.png");
}
}
import { makeAutoObservable } from 'mobx'; import { makeAutoObservable } from 'mobx';
import API from '../api/index'; import API from '../api/index';
const store = makeAutoObservable({ const store = makeAutoObservable({
ruleInfo: '', ruleInfo: '',
frontVariable: {}, //前端开发配置 frontVariable: {},
curPage: 'loading', //前端开发配置
setRule(ruleInfo) { curPage: 'loading',
this.ruleInfo = ruleInfo setRule(ruleInfo) {
}, this.ruleInfo = ruleInfo;
changePage(page, callback) { },
this.curPage = page; changePage(page, callback) {
callback && callback(); this.curPage = page;
}, callback && callback();
async initRule() { },
// 模拟获取远程的数据 async initRule() {
const { data } = await API.getRule(); // 模拟获取远程的数据
this.setRule(data) const { data } = await API.getRule();
}, this.setRule(data);
async getFrontVariable() { },
// 获取前端开发配置 async getFrontVariable() {
const { data } = await API.getFrontVariable(); // 获取前端开发配置
this.frontVariable = data || {}; const { data } = await API.getFrontVariable();
console.log('前端开发配置', data) this.frontVariable = data || {};
} console.log('前端开发配置', data);
}) },
export default store; });
\ No newline at end of file export default store;
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