Commit 2939f828 authored by wildfirecode13's avatar wildfirecode13

11

parent 52077a12
export const airballText=[
["爱我大首都","您吃了吗?","我爱北京天安门"],
["长得蛮灵","木桑变漂亮","点亮魔都"],
["小芽儿","雷峰塔到勒","木牢牢好看","法海不懂爱","西湖的水","龙井茶好喝"],
["好塞雷","世界之窗","深圳速度"],
["好靓女","雷猴啊","来食早茶"],
["熊猫养成基地","巴适得很","钵钵鸡"],
["吃鸭大户","中山陵","一城梧桐树"],
["没有火锅搞不定","幺妹儿","去洪崖洞逛逛","勒是雾都","3D立体城市"],
["过早了没","黄鹤楼到此一游","热干面来一份","周黑鸭"],
["来个肉夹馍","兵马俑","大唐不夜城","羊肉泡馍好香","biangbiang面"],
["快板这么一打阿","天津之眼","煎饼果子来一套","狗不理","干嘛呢"],
]
\ No newline at end of file
export const ajaxImg = (url, data) => {
return new Promise((resolve, reject) => {
var xhr = new XMLHttpRequest();
xhr.timeout = 20000;
xhr.open('post', url);
xhr.responseType = 'json';
xhr.onreadystatechange = function () {
if (xhr.readyState == 4) {
if (xhr.status == 200) {
if (!xhr.response) {
reject({ success: false, msg: "文件丢失" });
return;
}
resolve(xhr.response);
} else {
reject({ success: false, msg: "请求失败[" + xhr.status + "]" });
}
}
};
xhr.setRequestHeader("content-Type", "application/json");
xhr.send(data);
// console.log(data)
});
};
\ No newline at end of file
const Datas = new Map();
const dataCenter = {
setData: (key, value) => {
Datas.set(key, value);
},
getData: (key) => {
return Datas.get(key)
}
}
export default dataCenter
export default () => {
const str = location.search.slice(1);
const arr = str.split('&');
const result = {};
for (const item of arr) {
const arr2 = item.split('=');
result[arr2[0]]=arr2[1];
}
console.log('getQueryParams fuc',result)
return result;
}
\ No newline at end of file
export const getavatar=()=>{return '//yun.duiba.com.cn/aurora/assets/0d53dadde9d78734eff3d32212d4e57f6da84a6b.png'}
\ No newline at end of file
// const {
// trackAction,
// trackPage,
// hljurl,
// go,
// setShare,
// getAppImage,
// getPlatform,
// doShare
// } = window.hlj_open_sdk;
// ios
// android
//weapp
//wap h5
export const getPlatformFrom = () => {
const str = window.hlj_open_sdk.getPlatform();
if (str == 'wap') return 4;
if (str == 'weapp') return 3;
return 1;
}
\ No newline at end of file
import getQueryParams from "./getQueryParams";
/**
* 跳到星速台页面
* @argument type transfer:入口页;
*/
export const navigateToActivityPage = (type) => {
location.replace(`index.html?page=${type}`);
}
export const navigateToLogin = (type) => {
const uri = `https://85684.activity-17.m.duiba.com.cn/projectx/pc794224b/index.html`;
location.href = `https://m.helijia.com/sign-login.html?redirect_uri=${encodeURIComponent(uri)}&type=duiba&auto_login=https%3A%2F%2F85684.activity-17.m.duiba.com.cn%2FautoLogin%2Fautologin`
}
export const navigateToShareLogin = (type) => {
const inviteCode= getQueryParams().inviteCode||getQueryParams().shareCode
console.log('跳转登录页,这里要带助力的参数,如果有的话', inviteCode);
//跳转还是跳到page=sharepage,然后带上sharecode,只是要用星速台页面
const uri = `https://85684.activity-17.m.duiba.com.cn/projectx/pc794224b/index.html?page=sharepage&inviteCode=${inviteCode}`;
location.href = `https://m.helijia.com/sign-login.html?redirect_uri=${encodeURIComponent(uri)}&type=duiba&auto_login=https%3A%2F%2F85684.activity-17.m.duiba.com.cn%2FautoLogin%2Fautologin`
}
export const openApp = () => {
console.log("唤端");
const url ='https://85684.activity-17.m.duiba.com.cn/customShare/share?id=5325&page=loading';
window.location.href = "https://isa.helijia.com/?channel=duiba&disableNextLink=1&jsonData={\"type\":4,\"data\":{\"url1\":\""+url+"\"}}";
}
\ No newline at end of file
export const citylist = [
{
"nolight": "//yun.duiba.com.cn/spark/assets/b9fb13b1e83b3f391b851376573484a20b4d25b4.png",
"light": "//yun.duiba.com.cn/spark/assets/9b38b87558dcf588959648ab25173e97eb6a7614.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/5a76d9e5636bb7fbb1888fc0adb61d2577dde1da.png",
"light": "//yun.duiba.com.cn/spark/assets/8cd6acebe420270fb74e4504b6e06e03991c1669.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/5f42603cc1e72039e14dc9eee47551f11753484b.png",
"light": "//yun.duiba.com.cn/spark/assets/5a3111ed2a8be9d29cf68495a1323fc73ce9e886.png",
},
{
// "nolight": "//yun.duiba.com.cn/spark/assets/90e2dcfcec15e36211ff79607a9461656042af4a.png",
"light": "//yun.duiba.com.cn/spark/assets/acd39aed8daf9d753111eea37884b0662b43a19c.png",
"nolight": "//yun.duiba.com.cn/spark/assets/3170713e66eb7338c4d9fc6e82f63e290bdb8f0c.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/dd0a53cddf7700b51828203c42fcb51d90e7a0bf.png",
"light": "//yun.duiba.com.cn/spark/assets/d27c02011954689b22dd45e9c397324fe5916c9b.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/64c7e8edab4ac86311a4c286fd7bfad85e6be666.png",
"light": "//yun.duiba.com.cn/spark/assets/137a6eb3e1c38c65ccff47c69c32508b540fa1eb.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/b130dead4d25b9d89f973d38268a5d79032aa20b.png",
"light": "//yun.duiba.com.cn/spark/assets/16454d98f7443803a048e18066c2be3e075b60f2.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/977b64bde2d4696ece1223fc7927de6593a2f665.png",
"light": "//yun.duiba.com.cn/spark/assets/6d6add27232d3fd030ae8921a950bef610907bc6.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/3383b9c02ce5bf88c62a84437032bb121c3de7a0.png",
"light": "//yun.duiba.com.cn/spark/assets/888f86ae27d85d25ab709b29b108349969dd0ed5.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/0d7f3be6d87edc6535be156dd0f3925d32157d17.png",
"light": "//yun.duiba.com.cn/spark/assets/398cd1974b1e7e50cc2884853ac793a7cbd46f04.png",
},
{
"nolight": "//yun.duiba.com.cn/spark/assets/881dd6d3188285b563f10512d15d448b406b9734.png",
"light": "//yun.duiba.com.cn/spark/assets/c2caa9d89419255acca7658f6484f33f991ac2cf.png",
},
];
import { start, Weixin, updateShare } from '@spark/share'
export function initShare(){
start([Weixin]).then(() => {
console.log('初始化成功');
//更新分享内容,多用于被动式分享,比如微信
updateShare({
title: '吹一波你的城市美', //分享标题
content: '点亮你的城市,赢iPhone13、宙斯美容仪等万元大奖', //分享内容
url: location.href, //分享链接
thumbnail: 'https://yun.duiba.com.cn/spark/assets/0e62584646024c21b77998533085f8491325f57c.jpg', //分享缩略图
});
}).catch(() => {
console.log('初始化失败了');
})
}
\ No newline at end of file
export const tool = {
fomatFloat: function (value, n) {
var f = Math.round(value * Math.pow(10, n)) / Math.pow(10, n);
var s = f.toString();
var rs = s.indexOf(".");
if (rs < 0) {
s += ".";
}
for (var i = s.length - s.indexOf("."); i <= n; i++) {
s += "0";
}
return s;
},
/**鼠标点击延迟,name:节点的类名,delay:延迟时间(ms) */
clickDelay: (name, delay = 2300) => {
let node;
node = document.getElementsByClassName(name)[0];
node.style.pointerEvents = "none";
setTimeout(() => {
if (node) node.style.pointerEvents = "";
}, delay);
},
/**
* 随机获取数组中六个值
*/
getRandomArrayElements: (arr, count) => {
var shuffled = arr.slice(0),
i = arr.length,
min = i - count,
temp,
index;
while (i-- > min) {
index = Math.floor((i + 1) * Math.random());
temp = shuffled[index];
shuffled[index] = shuffled[i];
shuffled[i] = temp;
}
return shuffled.slice(min);
},
};
import React, { Component } from 'react';
import ReactDOM from "react-dom";
// 页面
import Homepage from '../pages/homepage/homepage.jsx';
import Personalrankingboard from "../pages/personalrankingboard/personalrankingboard.jsx";
import Expansionaredenvelope from '../pages/expansionaredenvelope/expansionaredenvelope.jsx';
import Lottery from '../pages/lottery/lottery.jsx'
import Money from '@src/pages/money/money.jsx';
export const Dia = {
Homepage: 'Homepage',
Select: 'Select',
Personalrankingboard: 'Personalrankingboard',
Expansionaredenvelope:'Expansionaredenvelope',
Money:'Money',
Lottery:'Lottery'
}
export let popMap = new Map();
popMap.set(Dia.Homepage, Homepage);
popMap.set(Dia.Personalrankingboard, Personalrankingboard);
popMap.set(Dia.Expansionaredenvelope, Expansionaredenvelope);
popMap.set(Dia.Lottery, Lottery);
export const ViewCtrl = {
/**弹出弹窗 */
showWin: (enumComKey, data = {}, call, call1) => {
let T = popMap.get(enumComKey)
var m = document.createElement('div');
m.className = "popcontainer";
// let diabox = document.getElementById("diabox");
document.body.appendChild(m);
// document.getElementById("diabox").style.zIndex = 999;
document.getElementsByTagName("body")[0].style.overflow = "hidden";
document.getElementsByTagName("body")[0].style.position = "fixed";
/**
* @param {function} cb
*/
const closeWin = (cb) => {
document.body.removeChild(m);
document.getElementsByTagName("body")[0].style.overflow = "auto";
document.getElementsByTagName("body")[0].style.position = "static";
// document.getElementById("diabox").style.zIndex = 1;
if (typeof cb == 'function') {
try {
cb()
} catch (error) {
console.log(error)
}
}
}
T = <T
closeWin={closeWin} data={data} call={call} call1={call1} />
ReactDOM.render(T, m);
},
changePage:(enumComKey,data) => {
// console.info(enumComKey,data)
let event = new CustomEvent('changePage',{detail:{id:enumComKey,data}});
document.dispatchEvent(event);
}
}
\ No newline at end of file
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