Commit 3f7b6896 authored by haiyoucuv's avatar haiyoucuv

Merge remote-tracking branch 'origin/master'

parents f86dc7ec 10d195c1
......@@ -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/1747015531064/assets/index-CiPsAcMm.js"></script>
<link rel="modulepreload" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747015531064/assets/vendor-BjYcJ-ln.js">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747015531064/assets/vendor-CWeaUrOh.css">
<link rel="stylesheet" crossorigin href="https://yun.duiba.com.cn/db_games/spark/v3/1747015531064/assets/index-bNW9k31h.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/1747015531064/assets/polyfills-legacy-C2MhNPfJ.js"></script>
<script nomodule crossorigin id="vite-legacy-entry" data-src="https://yun.duiba.com.cn/db_games/spark/v3/1747015531064/assets/index-legacy-DrXTYk7D.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
......@@ -42,8 +42,8 @@ export async function initWx(shareInfo: IWxShareInfo) {
// @ts-ignore
data,
timestamp,
} = await API.getShareInfo({wxdebug: false, url: shareInfo.link,isMiniApp:true,apk:'2J2Dt6DHw8bGf2vZb14E34Uthr6q',});
// wxappid, wxtimestamp, wxnonceStr, wxsignature
} = await API.getShareInfo({wxdebug: false, url:location.href,isMiniApp:true,apk:'2J2Dt6DHw8bGf2vZb14E34Uthr6q',});
// wxappid, wxtimestamp, wxnonceStr, wxsignature shareInfo.link
if (!success) {
return;
}
......@@ -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>
......
......@@ -43,23 +43,23 @@ class Inputinfomodal extends React.Component<InputInfoModalProps, InputInfoModal
// 指定 field 的类型为 InputInfoModalState 的键名
handleChange = (field: keyof InputInfoModalState, value: string) => {
// 这里使用类型断言确保类型匹配
this.setState({ [field]: value } as Pick<InputInfoModalState, typeof field>);
// this.setState({ [field]: value } as Pick<InputInfoModalState, typeof field>);
store[field] = value
}
confirm = async () => {
/**判空 */
if (!this.state.name || !this.state.phone || !this.state.detail || !store.province || !store.city) {
if (!store.name || !store.phone || !store.detail || !store.province || !store.city) {
Toast.show("请输入完整信息")
return
}
/**只判断11位手机号 */
if (!/^1[3456789]\d{9}$/.test(this.state.phone)) {
if (!/^1[3456789]\d{9}$/.test(store.phone)) {
Toast.show("请输入正确的手机号")
return
}
let { name, phone, detail } = this.state
let { province, city, area } = store
let { name, phone, detail,province, city, area } = store
if (province == '北京市' || province == '上海市' || province == '天津市' || province == '重庆市') {
city = province
......@@ -77,12 +77,13 @@ class Inputinfomodal extends React.Component<InputInfoModalProps, InputInfoModal
if (resp.success && resp.data) {
Toast.show("领取成功")
ModalCtrl.closeModal()
this.props?.receiveSuc && this.props?.receiveSuc()
// this.props?.receiveSuc && this.props?.receiveSuc()
store.getPrizeList()
} else {
Toast.show("领取失败,请联系客服")
ModalCtrl.closeModal()
}
console.warn(this.state)
// console.warn(this.state)
}
doSelect = ({ province, city, area }) => {
......@@ -97,6 +98,7 @@ class Inputinfomodal extends React.Component<InputInfoModalProps, InputInfoModal
store.province = province
store.city = city
store.area = area
// console.info(this.state)
}
......@@ -123,7 +125,7 @@ class Inputinfomodal extends React.Component<InputInfoModalProps, InputInfoModal
type="text"
className="inputinfomodaldetailconplaceholder"
placeholder="请输入详细地址"
value={this.state.detail}
value={store.detail}
onChange={(e) => this.handleChange('detail', e.target.value)}
/>
</div>
......@@ -133,7 +135,7 @@ class Inputinfomodal extends React.Component<InputInfoModalProps, InputInfoModal
type="tel"
className="inputinfomodalphoneconplaceholder"
placeholder="请输入手机号"
value={this.state.phone}
value={store.phone}
onChange={(e) => this.handleChange('phone', e.target.value)}
/>
</div>
......@@ -143,7 +145,7 @@ class Inputinfomodal extends React.Component<InputInfoModalProps, InputInfoModal
type="text"
className="inputinfomodalnameconplaceholder"
placeholder="请输入姓名"
value={this.state.name}
value={store.name}
onChange={(e) => this.handleChange('name', e.target.value)}
/>
</div>
......@@ -154,14 +156,14 @@ class Inputinfomodal extends React.Component<InputInfoModalProps, InputInfoModal
className="inputinfomodalareaprovinceconplaceholder"
placeholder="请输入"
value={store.province}
onChange={(e) => this.handleChange('province', e.target.value)}
// onChange={(e) => this.handleChange('province', e.target.value)}
/>
<input
type="text"
className="inputinfomodalareacityconplaceholder"
placeholder="请输入"
value={store.city}
onChange={(e) => this.handleChange('city', e.target.value)}
// onChange={(e) => this.handleChange('city', e.target.value)}
/>
<input
type="text"
......@@ -170,7 +172,7 @@ class Inputinfomodal extends React.Component<InputInfoModalProps, InputInfoModal
value={store.area}
onChange={(e) => {
console.log(e.target.value)
this.handleChange('area', e.target.value)
// this.handleChange('area', e.target.value)
}
}
/>
......
......@@ -21,7 +21,22 @@ 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;
};
}
}
}
@observer
class HomePage extends React.Component<any, any> {
......@@ -88,6 +103,7 @@ class HomePage extends React.Component<any, any> {
if (success) {
Toast.show("游戏次数+" + data.options[0].sendCount)
store.updateIndex()
store.queryTask()
}
})
......@@ -144,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>
......@@ -162,6 +178,18 @@ 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>;
}
}
......
......@@ -129,8 +129,8 @@ class Rankpage extends React.Component<{}, RankpageState> {
<span className="ranktitle"></span>
<div className="list" style={{ height: `${(689 - (1624 - document.body.clientHeight * 750 / document.body.clientWidth) / 2) / 100}rem` }}>
{
myRank.index != -1 && <div className="myinfo">
<span className="myrank">{myRank.index > 999 ? '999+' : myRank.index}</span>
rankInfos.length != 0 && <div className="myinfo">
<span className="myrank">{myRank.index == -1 ? '未上榜' : (myRank.index > 999 ? '999+' : myRank.index)}</span>
<span className="myname">{myRank.userName}(我)</span>
<span className="myscore">{myRank.score}</span>
<span className="mybg"></span>
......
......@@ -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,21 @@ class Store {
this.prizeList = resp.data;
}
}
province :string = '';
city :string = '';
area :string = '';
province: string = '';
city: string = '';
area: string = '';
name: string = '';
phone: string = '';
detail: 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