Commit e5fc36de authored by wangzhujun's avatar wangzhujun

ceshi

parent 29496921
......@@ -33,17 +33,17 @@
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
}
</script>
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1747017879345/assets/index-CQ3ncbFf.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747017879345/assets/vendor-oKQis8Xd.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747017879345/assets/vendor-CWeaUrOh.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747017879345/assets/index-C5j9btB3.css">
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1747020272554/assets/index-BYgRNr4P.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747020272554/assets/vendor-Cp3UQKqt.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747020272554/assets/vendor-CWeaUrOh.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747020272554/assets/index-DQJZ8wQ5.css">
<script type="module">import.meta.url;import("_").catch(()=>1);(async function*(){})().next();if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script>
<script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
</head>
<body>
<div id="root"></div>
<script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1747017879345/assets/polyfills-legacy-C2MhNPfJ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1747017879345/assets/index-legacy-V0vbnKVu.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
<script nomodule crossorigin id="vite-legacy-polyfill" src="https://yun.duiba.com.cn/db_games/spark/v3/1747020272554/assets/polyfills-legacy-C2MhNPfJ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1747020272554/assets/index-legacy-Ds49zfd7.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body>
</html>
......
......@@ -48,7 +48,7 @@ export async function initWx(shareInfo: IWxShareInfo) {
return;
}
wx.config({
debug: false,
debug: true,
appId: data.wxAppId,
timestamp: data.wxTimestamp,
nonceStr: data.wxNonceStr,
......
@import "../../res.less";
.wxOpenModule {
width: 100%;
height: 100%;
left: 0px;
top: 0;
position: absolute;
overflow: hidden;
}
"use strict";
import React, { forwardRef, ForwardedRef } from "react";
import { observer } from "mobx-react";
import "./wxOpenModule.less";
// 定义 props 的类型
interface WxOpenModuleProps {
id: string;
username: string;
appid: string;
path: string;
envVersion?: string;
}
// 扩展 JSX 命名空间,添加 wx-open-launch-weapp 组件类型定义
declare global {
namespace JSX {
interface IntrinsicElements {
"wx-open-launch-weapp": {
id: string;
username: string;
path: string;
appid: string;
"env-version": string;
style?: React.CSSProperties;
children?: React.ReactNode;
ref?: ForwardedRef<unknown>;
};
}
}
}
const WxOpenModule = observer(
forwardRef((props: WxOpenModuleProps, ref: ForwardedRef<unknown>) => {
return (
<div className="wxOpenModule">
<wx-open-launch-weapp
id={props.id}
ref={ref}
username={props.username}
appid={props.appid}
path={props.path}
env-version={props.envVersion || "release"}
style={{
width: "100%",
height: "100%",
position: "absolute",
top: "0",
left: "0",
display: "block",
border: "none",
background: "none",
opacity: 0,
overflow: "hidden",
}}
>
<script type="text/wxtag-template">
<button
style={{
width: "100%",
height: "100px",
color: "red",
display: "block",
border: "none",
background: "none",
opacity: 0,
}}
>
拉起小程序
</button>
</script>
</wx-open-launch-weapp>
</div>
);
})
);
export default WxOpenModule;
\ No newline at end of file
......@@ -21,22 +21,8 @@ import API from '@/api';
import Rankpage from '../rankpage/rankpage';
import Rulepop from '@/components/rulepop/rulepop';
import Prizepage from '../prizepage/prizepage';
// 扩展 JSX 命名空间,添加 wx-open-launch-weapp 组件类型定义
declare global {
namespace JSX {
interface IntrinsicElements {
'wx-open-launch-weapp': {
id: string;
username: string;
path: string;
style?: React.CSSProperties;
// 添加 children 属性
children?: React.ReactNode;
onClick?: (event: React.MouseEvent<HTMLButtonElement>) => void;
};
}
}
}
import WxOpenModule from '@/components/wxOpenModule/wxOpenModule';
@observer
class HomePage extends React.Component<any, any> {
......@@ -78,8 +64,9 @@ class HomePage extends React.Component<any, any> {
ModalCtrl.showModal(Drawpop, {});
}
clickShop = () => {
if (!store.judgeActTime()) return;
miniGoUrl(store.frontVariable.shopUrl)
console.info('shop')
// if (!store.judgeActTime()) return;
// miniGoUrl(store.frontVariable.shopUrl)
}
doTask = _asyncThrottle((item: { code: string; }) => {
if (!store.judgeActTime()) return;
......@@ -143,7 +130,14 @@ class HomePage extends React.Component<any, any> {
<span className="mianimg"></span>
<span className="mainnum">剩余次数:{remainTimes || 0}</span>
</Button>
<Button className="shopbtn" onClick={this.clickShop}></Button>
<Button className="shopbtn" onClick={this.clickShop}>
<WxOpenModule
id={"sharewxbtn"}
appid={'wxb3b1041867218f81'}
username={'gh_706a4c5cb211'}
envVersion={'release'}
path={'/pages/unify/unify?orgId=200282401019674482&targetUrl=%2Fpages%2Fcoupon%2Fcoupons-list'}></WxOpenModule>
</Button>
<Button className="drawbtn" onClick={this.clickDraw}>
<span className="drawimg"></span>
<div className="drawnum">
......@@ -178,17 +172,7 @@ class HomePage extends React.Component<any, any> {
<span className="tasktitle"></span>
<span className="logo"></span>
<SvgaPlayer className='homesvga' src={homeSvga}></SvgaPlayer>
{
<wx-open-launch-weapp
id="launch-btn"
username="gh_57d1c303c3b4"
path='/pages/collectStep/collectStep'
style={{ backgroundColor:'#000', width: '3.98rem', height: '1.87rem',top:'6.57rem', position: 'absolute' }}
onClick={() => {
console.info("点击了微信小程序")
}}
></wx-open-launch-weapp>
}
</div>;
}
......
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