Commit 76a0c6a9 authored by 徐士卿's avatar 徐士卿

merge

parent 69824a78
......@@ -37,7 +37,20 @@
CFG.isNewMiniVersion = CFG.version == 'hg';
CFG.subUrl = (CFG.isNewMiniVersion ? `/packages/activityCenter/subscibe` : `/pagesNews/subscribeMiddlePage/subscribeNews`) +
"?source=duiba&subId=1922853657613651969&activeNo=" + CFG.projectId + "&activityUrl=" + encodeURI(location.href)
"?source=duiba&subId=1922853657613651969&activeNo=" + CFG.projectId + "&activityUrl=" + encodeURI(location.href)
CFG.index = '/projectx/' + CFG.projectId + '/index.html?appID=' + CFG.appID;
// 免登中间页id
CFG.loginMidId = "Did1NjAwMDc"; // 线上正式
if (location.href.indexOf("duibatest") > -1) {
CFG.loginMidId = "Did1MTM2NTU"; // 测试
} else if (CFG.projectId == 'p555448e6') { // TODO 线上测试id
CFG.loginMidId = "Did1NTk5OTk"; // 线上测试
}
// 免登中间页
CFG.loginMidUrl = "/customShare/share?id=" + CFG.loginMidId + "&source=duiba&projectId=" + CFG.projectId + "&redirectUrl=";
if (!getUrlParam("appID")) {
// alert("【警告】检测到活动url中没有appID参数\n缺少该参数会导致埋点、分享、app信息获取错误。")
......
......@@ -11,6 +11,7 @@ export default [
"choosedChallengeId": "2",
"challengeStartTime": 27404105.225178465,
"challengeEndTime": -87229323.37597737,
"boolShowFailPop": false,
"challengeConfigList": [
{
"challengeId": "1",
......@@ -59,6 +60,7 @@ export default [
"intervalLimitSize": 1,
"intervalType": -18649400.705077305,
"jumUrl": '',
"boolShowCompletePop": false,
},
{
"code": "xhqg_{200}",
......@@ -69,6 +71,7 @@ export default [
"intervalLimitSize": 1,
"intervalType": 69737947.09434697,
"jumUrl": '',
"boolShowCompletePop": false,
},
{
"code": "xhjf_{300}",
......@@ -79,6 +82,7 @@ export default [
"intervalLimitSize": 1,
"intervalType": 15800400.399293274,
"jumUrl": '',
"boolShowCompletePop": false,
},
{
"code": "yqzl",
......@@ -89,6 +93,7 @@ export default [
"intervalLimitSize": 6,
"intervalType": -54395962.26549375,
"jumUrl": '',
"boolShowCompletePop": false,
},
{
"code": "yqzl_new",
......@@ -99,6 +104,7 @@ export default [
"intervalLimitSize": 6,
"intervalType": -54395962.26549375,
"jumUrl": '',
"boolShowCompletePop": false,
},
{
"code": "scan",
......@@ -109,6 +115,7 @@ export default [
"intervalLimitSize": 6,
"intervalType": -54395962.26549375,
"jumUrl": '',
"boolShowCompletePop": false,
},
{
"code": "browse_{x}",
......@@ -119,9 +126,10 @@ export default [
"intervalLimitSize": 6,
"intervalType": -54395962.26549375,
"jumUrl": '',
"boolShowCompletePop": false,
},
],
"boolNeedChallengeCompletePop": false,
"boolNeedChallengeCompletePop": true,
"boolOpenChallenge": true,
}
}
......@@ -194,7 +202,7 @@ export default [
"success": true,
"message": "officia",
"data": {
"inviteCode": "consequat"
"inviteCode": "111"
}
}
},
......@@ -202,7 +210,7 @@ export default [
{
url: "/challenge/assist.do",
method: 'post',
method: 'get',
response: ({ query }) => {
return {
"code": "velit in ullamco enim",
......
......@@ -25,11 +25,18 @@ export default [
"test_config_02": "111",
// 规则长图
"ruleImg": '//yun.duiba.com.cn/polaris/bg.18539c61e0103e01a339dd268558b2559ab178ba.png',
shareInfo: {
"title": '守护权益对对碰',
"desc": '2025年“3·15”金融消费者权益保护教育宣传活动',
"imgUrl": 'https://yun.duiba.com.cn/polaris/shareImg.721503d9417b09af6346ae018493aec558ca31af.png'
},
shareInfo: [
{
"title": 'normal',
"desc": '2025年“3·15”金融消费者权益保护教育宣传活动',
"imgUrl": '//yun.duiba.com.cn/polaris/image.42930d3760a71de0c9b80cb7481767718dca11d3.png'
},
{
"title": 'invite',
"desc": '2025年“3·15”金融消费者权益保护教育宣传活动',
"imgUrl": '//yun.duiba.com.cn/polaris/image%20(1).aba678324b060ee2050bbdaf83c05c8ddb3a3dd2.png'
}
],
shopUrl: 'https://'
}
}
......
......@@ -29,6 +29,9 @@ importers:
'@spark/dbdomain':
specifier: ^1.0.25
version: 1.0.25
'@spark/share':
specifier: ^2.0.340
version: 2.0.340
'@tailwindcss/postcss':
specifier: ^4.0.6
version: 4.0.6
......@@ -1665,9 +1668,27 @@ packages:
resolution: {integrity: sha1-n7OjzzEyMoFR81PeRjLgHlIQK+o=}
engines: {node: '>=6'}
'@spark/api-base@2.0.36':
resolution: {integrity: sha512-2LXzILQqpLyxUIp+cly1s2MJF1n4qIpMLypwh0kO4l3r+vX1lsfUGmwaxLZaTGDdSPTpgpbgIXyX8FhFAdHcbw==, tarball: http://npm.dui88.com:80/@spark%2fapi-base/-/api-base-2.0.36.tgz}
'@spark/api-common@2.0.22':
resolution: {integrity: sha512-lKTdfDhS38NrgEJaNagk1zgVX69hH8ZAi9vdpD3+G20EI5S+4W7bB/L+G9BpwsltJpeKAhOxnK0d31DGgD2zRg==, tarball: http://npm.dui88.com:80/@spark%2fapi-common/-/api-common-2.0.22.tgz}
'@spark/common-helpers@1.0.26':
resolution: {integrity: sha512-bMBx2kLGgEyy4t8B6Ui5GsPxmdJmDSkoerQ8wypxZZv69pCLk39AFErZ3KqCnF1HR6FvyPl9JGOIqYcUhEEenw==, tarball: http://npm.dui88.com:80/@spark%2fcommon-helpers/-/common-helpers-1.0.26.tgz}
'@spark/dbdomain@1.0.25':
resolution: {integrity: sha512-sOiwm3ihBJYpv97SFFfc2EHMCWws8xAxxAx5Q5yTteokvJMQKfoCzWXEm2q42zeITgzEjcoT5BjljnKb/qayGA==}
'@spark/projectx@2.0.13':
resolution: {integrity: sha512-ow8ATHzlq7SXVJveP4LdLpF+k2eGwKpKrDTr2scfp+LMtlxbLQIXZL/D7RQVwTwJnk7zIYw6gKlpaTKmdXqfmg==, tarball: http://npm.dui88.com:80/@spark%2fprojectx/-/projectx-2.0.13.tgz}
'@spark/share@2.0.340':
resolution: {integrity: sha512-QcsKfi9PSmV9LI4WVCQjQ11FvVsGFp7AfvSw7P96VIiLLaAEzoKsVgpvMxa27iG4L3FYaLjkEUCsOgXLWxiR5Q==, tarball: http://npm.dui88.com:80/@spark%2fshare/-/share-2.0.340.tgz}
'@spark/utils@2.0.88':
resolution: {integrity: sha512-+wxYTWja1p1ndOr/Ui+AdnlcGMhWYckm9Ona2wBaw56M71EHMQ/8oU0fWT0QKiOYO8NEiOhM7UiORvQldg5hTQ==, tarball: http://npm.dui88.com:80/@spark%2futils/-/utils-2.0.88.tgz}
'@swc/helpers@0.3.17':
resolution: {integrity: sha512-tb7Iu+oZ+zWJZ3HJqwx8oNwSDIU440hmVMDPhpACWQWnrZHK99Bxs70gT1L2dnr5Hg50ZRWEFkQCAnOVVV0z1Q==}
......@@ -2438,6 +2459,9 @@ packages:
resolution: {integrity: sha512-47qPchRCykZC03FhkYAhrvwU4xDBFIj1QPqaarj6mdM/hgUzfPHcpkHJOn3mJAufFeeAxAzeGsr5X0M4k6fLZQ==}
engines: {node: '>=12'}
duiba-utils@1.0.13:
resolution: {integrity: sha512-VEFzmfiujSZcl40jgRhkuv1lAsvLxhfArENFbI1NXxAz9iihdGOH1SdTektWaH5hrwsWvy/6kB088KzxJ+QvtA==, tarball: http://npm.dui88.com:80/duiba-utils/-/duiba-utils-1.0.13.tgz}
duiba-utils@2.0.2:
resolution: {integrity: sha512-xik6sEQfyiUBYhJZV96AYzy6/p7bYZAzHUBCPfHOFe6iHHUIibvBW2bA/NgSpvRdQ3+Sb5oWtOoLPGPH5+dtzQ==}
......@@ -2832,6 +2856,12 @@ packages:
howler@2.2.4:
resolution: {integrity: sha512-iARIBPgcQrwtEr+tALF+rapJ8qSc+Set2GJQl7xT1MQzWaVkFebdJhR3alVlSiUf5U7nAANKuj3aWpwerocD5w==}
html-observer@1.0.5:
resolution: {integrity: sha512-mAEB5Pu/AxJl0cRrK2HB37h7U98FHy7vungNJSFvczNjx6Rd81YUkDLT6aAGLaX37+ulDwwLqJmY1r01A22aQQ==, tarball: http://npm.dui88.com:80/html-observer/-/html-observer-1.0.5.tgz}
html-shot@1.0.32:
resolution: {integrity: sha512-to8GOLqWSskBLd1b7AMGIyK/KWNi+b+fWpYsL3xfZiLtVqVp4o7a8MhNIsVgDTLL0MnUphyS+3eaRi+fY2jt2w==, tarball: http://npm.dui88.com:80/html-shot/-/html-shot-1.0.32.tgz}
html2canvas@1.4.1:
resolution: {integrity: sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==}
engines: {node: '>=8.0.0'}
......@@ -3054,6 +3084,9 @@ packages:
js-binary-schema-parser@2.0.3:
resolution: {integrity: sha512-xezGJmOb4lk/M1ZZLTR/jaBHQ4gG/lqQnJqdIv4721DMggsa1bDVlHXNeHYogaIEHD9vCRv0fcL4hMA+Coarkg==}
js-md5@0.7.3:
resolution: {integrity: sha1-tPL7sLMnRV9ZjWcn447Ccs0Jw/I=, tarball: http://npm.dui88.com:80/js-md5/-/js-md5-0.7.3.tgz}
js-tokens@4.0.0:
resolution: {integrity: sha1-GSA/tZmR35jjoocFDUZHzerzJJk=}
......@@ -3119,6 +3152,9 @@ packages:
resolution: {integrity: sha1-rkViwAdHO5MqYgDUAyaN0v/8at4=}
engines: {node: '>= 0.8.0'}
light-sdk@2.0.36:
resolution: {integrity: sha512-r4OPZbYH9MEMUYXFd+gACyZLI41Jg+7OAwrh2jysKm3QayJqI5xOztJPrT7m1I+LHW56NVGSPpHvLd7wAXgbnw==, tarball: http://npm.dui88.com:80/light-sdk/-/light-sdk-2.0.36.tgz}
lightningcss-darwin-arm64@1.29.1:
resolution: {integrity: sha512-HtR5XJ5A0lvCqYAoSv2QdZZyoHNttBpa5EP9aNuzBQeKGfbyH5+UipLWvVzpP4Uml5ej4BYs5I9Lco9u1fECqw==, tarball: http://npm.dui88.com:80/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.29.1.tgz}
engines: {node: '>= 12.0.0'}
......@@ -6029,8 +6065,50 @@ snapshots:
'@sindresorhus/is@0.14.0': {}
'@spark/api-base@2.0.36':
dependencies:
'@spark/common-helpers': 1.0.26
'@spark/utils': 2.0.88
'@spark/api-common@2.0.22':
dependencies:
'@spark/api-base': 2.0.36
'@spark/common-helpers': 1.0.26
'@spark/utils': 2.0.88
duiba-utils: 1.0.13
'@spark/common-helpers@1.0.26':
dependencies:
'@babel/runtime': 7.26.9
'@spark/api-base': 2.0.36
'@spark/projectx': 2.0.13
duiba-utils: 1.0.13
'@spark/dbdomain@1.0.25': {}
'@spark/projectx@2.0.13':
dependencies:
'@spark/api-base': 2.0.36
'@spark/common-helpers': 1.0.26
'@spark/utils': 2.0.88
'@spark/share@2.0.340':
dependencies:
'@spark/api-base': 2.0.36
'@spark/api-common': 2.0.22
'@spark/utils': 2.0.88
duiba-utils: 1.0.13
light-sdk: 2.0.36
'@spark/utils@2.0.88':
dependencies:
'@spark/api-base': 2.0.36
duiba-utils: 1.0.13
howler: 2.2.4
html-observer: 1.0.5
html-shot: 1.0.32
js-md5: 0.7.3
'@swc/helpers@0.3.17':
dependencies:
tslib: 2.8.1
......@@ -6900,6 +6978,8 @@ snapshots:
dotenv@16.4.7: {}
duiba-utils@1.0.13: {}
duiba-utils@2.0.2: {}
dunder-proto@1.0.1:
......@@ -7365,6 +7445,12 @@ snapshots:
howler@2.2.4: {}
html-observer@1.0.5:
dependencies:
tslib: 2.8.1
html-shot@1.0.32: {}
html2canvas@1.4.1:
dependencies:
css-line-break: 2.1.0
......@@ -7564,6 +7650,8 @@ snapshots:
js-binary-schema-parser@2.0.3: {}
js-md5@0.7.3: {}
js-tokens@4.0.0: {}
js-yaml@4.1.0:
......@@ -7629,6 +7717,8 @@ snapshots:
prelude-ls: 1.2.1
type-check: 0.4.0
light-sdk@2.0.36: {}
lightningcss-darwin-arm64@1.29.1:
optional: true
......
......@@ -40,7 +40,7 @@ class App extends Component {
loadFont(zzgfyht);
await store.getFrontVariable();
initWx(store.frontVariable.shareInfo);
store.initShare()
}
componentWillUnmount() {
......
......@@ -15,6 +15,7 @@ interface IRes {
success: boolean;
data: any;
msg?: string;
message?: string;
code?: number | string;
timeStamp?: number;
timestamp?: number;
......
......@@ -33,35 +33,47 @@ function invokeWX(shareInfo: IWxShareInfo) {
export async function initWx(shareInfo: IWxShareInfo) {
if (!isWeiXin()) {
return;
const param = {
title: shareInfo.title,
desc: shareInfo.desc,
link: shareInfo.link,
imgUrl: shareInfo.imgUrl,
}
const {
success,
// @ts-ignore
data,
timestamp,
} = await API.getShareInfo({wxdebug: false, url: shareInfo.link,isMiniApp:true,apk:'2J2Dt6DHw8bGf2vZb14E34Uthr6q',});
// wxappid, wxtimestamp, wxnonceStr, wxsignature
if (!success) {
return;
}
wx.config({
debug: false,
appId: data.wxAppId,
timestamp: data.wxTimestamp,
nonceStr: data.wxNonceStr,
signature: data.wxSignature,
jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage']
});
console.info('分享信息', param)
wx.error(function (res) {
console.error("wx error", res);
});
// @ts-ignore
wx.miniProgram.postMessage(param);
wx.ready(function () {
invokeWX(shareInfo);
});
// if (!isWeiXin()) {
// return;
// }
// const {
// success,
// // @ts-ignore
// data,
// timestamp,
// } = await API.getShareInfo({wxdebug: false, url: shareInfo.link,isMiniApp:true,apk:'2J2Dt6DHw8bGf2vZb14E34Uthr6q',});
// // wxappid, wxtimestamp, wxnonceStr, wxsignature
// if (!success) {
// return;
// }
// wx.config({
// debug: false,
// appId: data.wxAppId,
// timestamp: data.wxTimestamp,
// nonceStr: data.wxNonceStr,
// signature: data.wxSignature,
// jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage']
// });
// wx.error(function (res) {
// console.error("wx error", res);
// });
// wx.ready(function () {
// invokeWX(shareInfo);
// });
}
......@@ -13,9 +13,9 @@ export const DEFAULT_NET_ERROR = '网络异常,请稍后再试';
const FAIL_TEXT = {
// todo
// 助力已达上限 同一用户每天只可助力1次
100020: "无法为自己助力",
// 活动已结束
500322: "每日只能为同一好友助力一次哦",
// 100020: "无法为自己助力",
// // 活动已结束
// 500322: "每日只能为同一好友助力一次哦",
};
@observer
......@@ -29,7 +29,9 @@ class Assist_fail extends React.Component {
};
render() {
const { code, message } = this.props.popData || {}
const { code, message } = this.props || {}
console.log(this.props);
return (
<div className="assist_fail modal_center">
<span className="bg"></span>
......
......@@ -17,7 +17,7 @@ class Consume_credits extends React.Component {
super(props);
}
handleclock = async (n, code, title) => {
handleclock = async (n, code) => {
await pre_reduce_score(
{
toPlaywayId: "challenge",
......@@ -32,7 +32,6 @@ class Consume_credits extends React.Component {
});
if (success) {
ModalCtrl.closeModal();
ModalCtrl.showModal(Finish_task, { title });
}
}
);
......
......@@ -16,11 +16,10 @@ class Consume_qg extends React.Component {
super(props);
}
handleclock = async (code, title) => {
handleclock = async (code) => {
const {success } = await API.getChallenegeComplate({ taskCode: code });
if (success) {
ModalCtrl.closeModal();
ModalCtrl.showModal(Finish_task, {title});
}
store.getTaskInfo();
};
......@@ -38,7 +37,7 @@ class Consume_qg extends React.Component {
<span className="tip1">消耗{n}青果</span>
<span className="tip2">完成打卡</span>
<Button className="close" onClick={this.handleclose} />
<Button className="clock" onClick={() => this.handleclock(code, title)} />
<Button className="clock" onClick={() => this.handleclock(code)} />
<span className="icon"></span>
<span className="ditu"></span>
</div>
......
......@@ -6,6 +6,10 @@ import './finish_resign.less';
import { Button } from "@grace/ui";
import { PageCtrl } from "@/core/ctrls/PageCtrl";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import { SvgaPlayer } from '@grace/svgaplayer';
import lightSvga from "../../assets/svga/1通用弹窗氛围.svga";
@observer
class Finish_resign extends React.Component {
......@@ -25,7 +29,7 @@ class Finish_resign extends React.Component {
return (
<div className="finish_resign modal_center">
<span className="ditu"></span>
<span className="dongxiao"></span>
<SvgaPlayer className="dongxiao" src={lightSvga}/>
<span className="bg"></span>
<Button className="close" onClick={this.handleclose} />
<span className="title"></span>
......
......@@ -15,11 +15,11 @@
}
.dongxiao {
width: 750px;
height: 1589px;
height: 1624px;
left: 0px;
top: 0px;
position: absolute;
.sparkBg("finish_resign/dongxiao.png");
// position: absolute;
// .sparkBg("finish_resign/dongxiao.png");
}
.bg {
width: 682px;
......
......@@ -23,6 +23,8 @@ class Finish_task extends React.Component {
render() {
const { title } = this.props;
console.log(title);
return (
<div className="finish_task modal_center">
......
......@@ -12,6 +12,7 @@ import Consume_qg from '../../../components/consume_qg/consume_qg';
import Consume_credits from '../../../components/consume_credits/consume_credits';
import Renewmodule from '../../../components/renewmodule/renewmodule';
import { unwatchPageVisibility, watchPageVisibility } from '@/core/page-visibility-notify';
import { initWx } from '@/built-in/share/weixin/weixin';
@observer
class Check extends React.Component<any, any> {
......@@ -21,9 +22,6 @@ class Check extends React.Component<any, any> {
}
componentDidMount() {
store.getTaskInfo()
store.getBaseIndex()
watchPageVisibility(this.onPageVisibilityChange)
}
......@@ -54,12 +52,9 @@ class Check extends React.Component<any, any> {
} else {
Toast.show("很抱歉,您的积分不足");
}
} else if (type === "yqzl") {
// todo
} else if (type === "yqzl_new") {
// todo
} else if (type === "yqzl" || type === "yqzl_new") {
store.doInvite(code)
} else if (type === "scan") {
// todo
wx.miniProgram.switchTab({ url: jumpUrl });
} else if (type === "browse") {
await API.getChallenegeComplate({ taskCode: code });
......
......@@ -33,14 +33,16 @@ import ObtainPanel from "@/panels/ObtainPanel/ObtainPanel.tsx";
import NewcomerPanel from "@/panels/NewcomerPanel/NewcomerPanel.tsx";
import GuidePanel from "@/panels/GuidePanel/GuidePanel.tsx";
@observer
class HomePage extends React.Component<any, any> {
root: HTMLDivElement;
componentDidMount() {
async componentDidMount () {
await store.doAssist();
store.updateIndex();
store.getTaskInfo()
store.getBaseIndex()
// store.queryTask()
// if (getUrlParam('inviteCode')) {
// store.doAssist()
......@@ -59,23 +61,23 @@ class HomePage extends React.Component<any, any> {
const { creditsNum, guideFlag } = store.indexData
return <>
<div className="homepage" ref={(el) => this.root = el}>
<div className="homeRoot">
<Top/>
<div className="homeRoot">
<Top />
<SvgaPlayer className="homeSvga" src={lightSvga}/>
<SvgaPlayer className="homeSvga" src={lightSvga} />
<Sign/>
<Check/>
<Sign />
<Check />
<Button className="credits">{creditsNum}</Button>
{/*<Button className="cash"><span>¥</span>32.88</Button>*/}
<Button className="credits">{creditsNum}</Button>
{/*<Button className="cash"><span>¥</span>32.88</Button>*/}
<Button className="rule" onClick={this.clickRule} />
<Button className="prize" onClick={this.clickPrize} />
</div>
<Button className="rule" onClick={this.clickRule} />
<Button className="prize" onClick={this.clickPrize} />
</div>
</div>
{!guideFlag && <GuidePanel/>}
{!guideFlag && <GuidePanel />}
</>;
}
}
......
import { makeAutoObservable, } from 'mobx';
import API from '../api/index';
import { Toast } from "@grace/ui";
import { IWxShareInfo } from "@/built-in/share/weixin/weixin.ts";
import { initWx, IWxShareInfo } from "@/built-in/share/weixin/weixin.ts";
import { _asyncThrottle, _debounce, getUrlParam } from '@/utils/utils';
import { PageCtrl } from '@/core/ctrls/PageCtrl';
import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
......@@ -9,12 +9,18 @@ import Choice_challenge from '../../src/components/choice_challenge/choice_chall
import SkyFullGoldPanel from "@/panels/SkyFullGoldPanel/SkyFullGoldPanel.tsx";
import Renewmodule from '../../src/components/renewmodule/renewmodule';
import Finish_challenge from '../../src/components/finish_challenge/finish_challenge';
import Finish_task from '../../src/components/finish_task/finish_task';
import { IBubbleInfo } from "@/pages/HomePage/Top/Components/Bubble.ts";
import { IOverflowBubbleInfo } from "@/pages/HomePage/Top/Components/OverflowBubble.ts";
import ReturnAwardPanel from "@/panels/ReturnAwardPanel/ReturnAwardPanel.tsx";
import NewcomerPanel from "@/panels/NewcomerPanel/NewcomerPanel.tsx";
import WedExpPanel from "@/panels/WedExpPanel/WedExpPanel.tsx";
import SignSucPanel from "@/panels/SignSucPanel/SignSucPanel.tsx";
import { getDomain } from '@spark/dbdomain';
import { showShareGuide } from '@spark/share';
import Assist_succeed from "../../src/components/assist_succeed/assist_succeed"
import Assist_fail from "../../src/components/assist_fail/assist_fail"
import Fail_challenge from "../../src/components/fail_challenge/fail_challenge"
class Store {
......@@ -26,13 +32,12 @@ class Store {
/** 前端开发配置 */
frontVariable: {
shareInfo: IWxShareInfo,
shareInfo: any,
ruleImg?: string,
} = {
shareInfo: {
title: "",
desc: "",
link: "",
imgUrl: "",
},
};
......@@ -118,7 +123,7 @@ class Store {
}, 500);
async doSign (){
async doSign() {
const { success, data } = await API.sign();
this.updateIndex();
if (!success) return;
......@@ -174,6 +179,7 @@ class Store {
intervalLimitSize: number;
intervalType: number;
jumpUrl?: string;
boolShowCompletePop?: boolean;
}>;
boolNeedChallengeCompletePop?: boolean;
latestChallengeSuccessTime?: number;
......@@ -193,6 +199,7 @@ class Store {
const { success, data } = await API.getChallengeIndex();
if (success && data) {
this.taskInfo = data
const { boolOpenChallenge = 0,
choosedChallengeId = 0,
hasChallengeDay = 0,
......@@ -224,15 +231,69 @@ class Store {
if (data.boolNeedChallengeCompletePop) {
ModalCtrl.showModal(Finish_challenge, { prizeName, prizeImg })
}
if (data.boolShowFailPop) {
ModalCtrl.showModal(Fail_challenge)
}
taskInfoList.forEach(task => {
if (task.boolShowCompletePop) {
const { title } = task
ModalCtrl.showModal(Finish_task, { title });
}
});
}
};
/** 普通分享 */
async initShare() {
const domain = await getDomain();
console.error('看下域名', domain);
let url = `${domain || location.origin}${CFG.index}`;
const shareInfo = this.frontVariable?.shareInfo?.[0]
let option = {
title: shareInfo?.title,
// 标题
desc: shareInfo?.desc || '',
// 描述
imgUrl: shareInfo?.imgUrl,
link: url
};
option.link = (domain || location.origin) + CFG.loginMidUrl + encodeURIComponent(url);
initWx(option);
}
/** 邀请好友 */
async doInvite(taskCode) {
const domain = await getDomain();
console.error('看下域名', domain);
let url = `${domain || location.origin}${CFG.index}`;
const shareInfo = this.frontVariable?.shareInfo?.[1]
let option = {
title: shareInfo?.title,
// 标题
desc: shareInfo?.desc || '',
// 描述
imgUrl: shareInfo?.imgUrl,
link: url
};
showShareGuide();
const res = await API.getChallengeInviteCode({ taskCode: taskCode })
url += `&inviteCode=${res.data.inviteCode}`;
option.link = (domain || location.origin) + CFG.loginMidUrl + encodeURIComponent(url);
initWx(option);
}
async doAssist() {
let code = getUrlParam('inviteCode')
const { success, data } = await API.doAssist({ inviteCode: code });
let inviteCode = getUrlParam('inviteCode')
const { success, message, code } = await API.getChallengeAssist({ inviteCode: inviteCode });
if (success) {
Toast.show("成功为好友助力,一起来参与活动吧~");
}
ModalCtrl.showModal(Assist_succeed);
} else {ModalCtrl.showModal(Assist_fail, { code, message });}
history.replaceState({}, '', location.href.replace(new RegExp(`[?&]inviteCode=[^&]*`), ''));
}
......
......@@ -36,6 +36,9 @@ declare namespace wx {
fail?: (...args: any[]) => void;
complete?: (...args: any[]) => void;
}): void;
postMessage(params: {
[key: string]: any;
}): void;
}
const miniProgram: MiniProgram;
......
......@@ -33,6 +33,9 @@ export default defineConfig(({mode}): UserConfig => {
const prodBase = `${CDN_DOMAIN}/${UPLOAD_DIR}/${versionStamp}/`;
return {
define: {
'process.env': {}
},
base: !isDev ? prodBase : "",
server: {
host: "0.0.0.0",
......
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