Commit 80ca50a3 authored by wangzhujun's avatar wangzhujun

tiaozhuan

parent fa759fc8
......@@ -33,17 +33,17 @@
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
}
</script>
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1746968226438/assets/index-58DNo98O.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1746968226438/assets/vendor-BcaFA3fM.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1746968226438/assets/vendor-CWeaUrOh.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1746968226438/assets/index-DeWsH3SG.css">
<script type="module" crossorigin src="https://yun.duiba.com.cn/db_games/spark/v3/1746970226822/assets/index-BGdElu2H.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1746970226822/assets/vendor-DBco_1i3.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1746970226822/assets/vendor-CWeaUrOh.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1746970226822/assets/index-K9YGPby6.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/1746968226438/assets/polyfills-legacy-C2MhNPfJ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1746968226438/assets/index-legacy-D09RGcIT.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/1746970226822/assets/polyfills-legacy-C2MhNPfJ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1746970226822/assets/index-legacy-vGWp2zmi.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body>
</html>
......
......@@ -33,7 +33,6 @@ class App extends Component {
async componentDidMount() {
this.showDefaultPage();
musicStore.playSound(bgm, true);
await store.getFrontVariable();
initWx(store.frontVariable.shareInfo);
......
......@@ -3,3 +3,11 @@
export function isWeiXin() {
return /micromessenger/i.test(navigator.userAgent.toLowerCase());
}
export function isWechatMiniProgram(): boolean {
try {
// @ts-ignore
return typeof wx !== 'undefined' && wx.getSystemInfoSync;
} catch (e) {
return false;
}
}
\ No newline at end of file
......@@ -53,7 +53,8 @@ export async function initWx(shareInfo: IWxShareInfo) {
timestamp: data.wxTimestamp,
nonceStr: data.wxNonceStr,
signature: data.wxSignature,
jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage']
jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage'],
openTagList: ['wx-open-launch-weapp']
});
wx.error(function (res) {
......
......@@ -50,7 +50,7 @@
left: 0px;
top: 0px;
position: absolute;
object-fit: contain
object-fit: contain;
}
}
.prizename {
......
......@@ -8,7 +8,7 @@ import { PageCtrl } from '@/core/ctrls/PageCtrl';
import Prizepage from '@/pages/prizepage/prizepage';
type DrawprizepopProps = {
prizieimg: string;
optionImg: string;
optionName: string;
}
@observer
......@@ -29,7 +29,7 @@ class Drawprizepop extends React.Component<DrawprizepopProps> {
<span className="bg"></span>
<span className="prizelight"></span>
<span className="prizieimg">
<img src={this.props.prizieimg}></img>
<img src={this.props.optionImg}></img>
</span>
<span className="prizename">{this.props.optionName}</span>
<span className="tips">奖品可在首页 我的奖品 中查看</span>
......
......@@ -21,7 +21,21 @@ 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;
};
}
}
}
@observer
class HomePage extends React.Component<any, any> {
......@@ -146,10 +160,10 @@ class HomePage extends React.Component<any, any> {
<SvgaPlayer className='taskbg' src={taskSvga}></SvgaPlayer>
{
item.taskStatus == 2 ? <span className="taskfinishbtn"></span>
: item.taskStatus == 1 ? <span className="taskgetbtn" onClick={() => this.getTaskPrize(item)}></span>
: item.code == "invite" ? <span className="taskinvitebtn" onClick={() => this.doTask(item)}></span>
: item.code == "scan" ? <span className="taskscanbtn" onClick={() => this.doTask(item)}></span>
: <span className="taskgetbtn">{item.taskStatus}</span>
: item.taskStatus == 1 ? <Button className="taskgetbtn" onClick={() => this.getTaskPrize(item)}></Button>
: item.code == "invite" ? <Button className="taskinvitebtn" onClick={() => this.doTask(item)}></Button>
: item.code == "scan" ? <Button className="taskscanbtn" onClick={() => this.doTask(item)}></Button>
: ''// <span className="taskgetbtn">{item.taskStatus}</span>
}
<span className="tasktit">{item.title}({item.completedSize}/{item.intervalLimitSize})</span>
<span className="tasksub">{item.subTitle}</span>
......@@ -164,6 +178,19 @@ 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={{ width: '3.98rem', height: '1.87rem', position: 'absolute' }}
>
<template>
<style></style>
<img style={{ width: '3.98rem', height: '1.87rem', position: 'absolute' }} src="https://yun.duiba.com.cn/zhongherenshou/df17ab45-a411-45b5-8373-8bb506fd9dea.png"></img>
</template></wx-open-launch-weapp>
}
</div>;
}
}
......
......@@ -27,7 +27,8 @@ class FailPanel extends React.Component<IFailPanelProps> {
};
clickBtn = _asyncThrottle(async () => {
ModalCtrl.closeModal();
PageCtrl.changePage(HomePage);
});
render() {
......
......@@ -6,6 +6,7 @@ import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import Ranknoprizepop from '@/components/ranknoprizepop/ranknoprizepop';
import Rankprizepop from '@/components/rankprizepop/rankprizepop';
import { getUrlParam } from '@/utils/utils';
import { isWechatMiniProgram, isWeiXin } from '@/AppTools';
class Store {
......@@ -118,9 +119,18 @@ class Store {
this.prizeList = resp.data;
}
}
province :string = '';
city :string = '';
area :string = '';
province: string = '';
city: string = '';
area: string = '';
goMiniApp() {
if (isWechatMiniProgram()) {
// 小程序内跳转
} else if (isWeiXin()) {
// 微信内跳转
}
}
}
......
......@@ -126,6 +126,7 @@ declare namespace wx {
nonceStr: string; // 必填,生成签名的随机串
signature: string; // 必填,签名,见附录1
jsApiList: jsApiList; // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
openTagList?: string[] | undefined; // 可选,需要使用的开放标签列表,所有开放标签列表见附录3
}): void;
interface Resouce {
......
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