Commit 7fed68ac authored by cc's avatar cc

update

parent d78090e9
......@@ -17,6 +17,7 @@
</script>
<script src="//yun.duiba.com.cn/js-libs/rem/1.1.3/rem.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script src="https://m.picclife.cn/Life-H5/html/clause/PICCLifeJsBrage.js"></script>
<script src="//res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script>
var CFG = CFG || {};
......
......@@ -11,11 +11,14 @@ import { ModalCtrl } from '@/core/ctrls/ModalCtrl';
import {Axios} from 'axios';
import FillAddress from '@/panels/FillAddress/FillAddress.jsx';
import { LOG_KEY, MatterShareOpt, MatterViewOpt, pageView, sensorLog,MatterViewDuration } from '../../utils/sensors.js';
import shareStore from '@/store/share.js';
const apiAxios = new Axios({
timeout: 10000,
});
@observer
class MyPrize extends React.Component<any, any> {
projectId: string | null;
constructor(props) {
super(props);
this.state = {
......@@ -56,7 +59,7 @@ class MyPrize extends React.Component<any, any> {
prod: CFG.env == "prod"
};
}
const res = await API.prize(params);
const res:any = await API.prize(params);
if (res?.success) {
let tabList = [];
let PrizeList = [];
......@@ -197,7 +200,7 @@ class MyPrize extends React.Component<any, any> {
this.projectId = val?.projectId;
} else {
// 全部
await this.getPrize();
await this.getPrize('');
this.projectId = null;
}
this.setState({
......
......@@ -254,85 +254,5 @@ const shareStore = makeAutoObservable({
"&isBindManager=1&isNeedAuth=1&operate_type=3"
);
},
/** 烟花分享 */
async doFireShare(fireType, fireLab, withGuide = true) {
const shareInfo = JSON.parse(store.frontVariable.fireShareInfo);
if (isWeChat()) {
// 微信环境分享
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.fireShareUrl}${`&ykCode=${CFG.workerCode || CFG.agentCode || ""
}`}${`&channel=${CFG.defaultChannel}`}&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId
}&fireType=${fireType}&fireLab=${encodeURIComponent(encodeURIComponent(fireLab))}`
)}`;
console.info("分享链接", _url);
if (isMiniprogram()) {
const query = JSON.stringify({
imgUrl: shareInfo?.imgUrl,
isYKShare: "1",
link: _url,
title: shareInfo?.title,
});
// 小程序
wx.miniProgram.navigateTo({
url: `/subpackages/h5/miniProgramWebShare/index?YKMiniprogramShare=${encodeURIComponent(query)}`,
});
} else if (isEnterpriseWeChat()) {
//微通 (企业微信)
location.href = `https://m.picclife.cn/refactor-web/index.html?v=${Date.now()}#/duibaSharePage?link=${encodeURIComponent(
_url
)}&title=${shareInfo?.title}&desc=${shareInfo?.content}&imgUrl=${shareInfo?.imgUrl}`;
} else {
if(withGuide){
showShareGuide();
}
//H5
onUpdateShare({
...shareInfo,
url: _url, // 带授权链接的活动链接
});
}
} else {
// app分享
// app参数
const _url = `${CFG.domain}${CFG.indexLogin}${encodeURIComponent(
`${CFG.domain}${CFG.fireShareUrl}${`&ykCode=${CFG.workerCode || CFG.agentCode || ""
}`}${`&channel=${CFG.defaultChannel}`}&agentCode=${CFG.agentCode}&actPlatforms=${CFG.actPlatforms}&actId=${CFG.actId
}&fireType=${fireType}&fireLab=${encodeURIComponent(fireLab)}`
)}`;
console.info("分享链接", _url);
if (CFG.channel == "1") {
//管家
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
shareUrl: _url,
thumbUrl: shareInfo.thumbnail,
shareType: "0", // 1分享网页 2分享图片 3分享视频4分享音乐 5分享文本
};
window.PICCLifeJsBrage.callNative({
module: "Share",
method: "options",
params: JSON.stringify(params),
callback: "",
});
}
if (CFG.channel == "6") {
//e通
const params = {
title: shareInfo.title,
description: shareInfo.content || "",
url: _url,
thumbImage: shareInfo.thumbnail,
};
window.inAppShare({
type: "shareLink",
activity: "richMan",
params: JSON.stringify(params),
});
}
}
},
});
export default shareStore;
......@@ -12,10 +12,17 @@ import { Toast } from "@grace/ui";
import { ModalCtrl } from "@/core/ctrls/ModalCtrl";
import LongImgPop from "@/panels/longImgPop/longImgPop.jsx";
interface TaskItem {
jumpUrl?: string;
code?: string;
id?: string;
prizePendingCode?: string;
}
const taskStore = makeAutoObservable({
/** 当前任务 */
curTask: {},
setCurTask(data) {
curTask: {} as TaskItem,
setCurTask(data: TaskItem) {
this.curTask = data;
},
......@@ -28,7 +35,7 @@ const taskStore = makeAutoObservable({
code: getUrlParam("ykCode") || getUrlParam("code") || "",
from: CFG.channel,
});
if ((success, data)) {
if ((success && data)) {
this.taskList = data?.item || [];
}
},
......@@ -146,7 +153,7 @@ const taskStore = makeAutoObservable({
},
/** 完成任务 */
async complete(item, time) {
async complete(item, time=0) {
const { id, code } = item || {};
let params = {
taskCode: code,
......
......@@ -24,7 +24,7 @@ import {
/** 判断微信环境 */
export function isWeChat() {
const ua = window.navigator.userAgent.toLowerCase()
return ua.match(/MicroMessenger/i) == 'micromessenger'
return ua.match(/MicroMessenger/i) !== null
}
/**
* 初始化分享
......
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