Commit d2f7fa0f authored by cc's avatar cc

更改登录后置 待上线

parent 068efc19
......@@ -20,6 +20,7 @@ export default [
storeLimitNum: 1000,
continueSignDays: 3,
todaySignFlag: false,
login: false,
signRecords: new Array(7).fill(1).map((_, index) => {
return {
id: index,
......
......@@ -40,6 +40,7 @@ class Check extends React.Component<any, any> {
// 按钮
handlegofinish = async (type, n, code, title, jumpUrl, id) => {
if (!store.checkLoginStatus()) return;
handleLogClick(4, id)
const { jfNum = 0, qgNum = 0 } = store?.baseInfo || {};
if (type === "xhqg") {
......@@ -69,6 +70,7 @@ class Check extends React.Component<any, any> {
handlegosign = _asyncThrottle((hasChallengeDay, resignJf, resignQg, type) => {
if (!store.checkLoginStatus()) return;
if (type === 'task') handleLogClick(5)
// else if (type === 'calendar') handleLogClick(6)
ModalCtrl.showModal(Renewmodule, { hasChallengeDay, resignJf, resignQg });
......@@ -79,6 +81,7 @@ class Check extends React.Component<any, any> {
})
handlesubscribe = _asyncThrottle(() => {
if (!store.checkLoginStatus()) return;
// if (store?.homeInfo?.subscribe) return console.log('buxing');
// @ts-ignore
wx.miniProgram.reLaunch({ url: CFG.subUrl })
......
......@@ -30,22 +30,27 @@ class HomePage extends React.Component<any, any> {
}
clickPrize = () => {
if (!store.checkLoginStatus()) return;
PageCtrl.changePage(MyPrize);
}
clickRule = () => {
if (!store.checkLoginStatus()) return;
PageCtrl.changePage(Rule);
}
clickCredits = () => {
if (!store.checkLoginStatus()) return;
wx.miniProgram.navigateTo({ url: "/packages/user/points?source=duiba" });
}
clickActPre = () => {
if (!store.checkLoginStatus()) return;
Toast.show("活动未开始");
}
clickActEnd = () => {
if (!store.checkLoginStatus()) return;
Toast.show("活动已结束");
}
......
......@@ -15,6 +15,7 @@ class Sign extends React.Component<any, any> {
}
clickSign = _asyncThrottle(async () => {
if (!store.checkLoginStatus()) return;
const { todaySignFlag } = store.indexData;
if (todaySignFlag) return;
......
......@@ -94,6 +94,7 @@ class Store {
storeLimitNum?: number,
continueSignDays?: number,
todaySignFlag?: boolean,
login?: boolean,
signRecords?: {
id: string,
day: number,
......@@ -139,7 +140,25 @@ class Store {
}
}
/**
* 校验登录状态
*/
checkLoginStatus() {
const { login } = this.indexData || {};
if (login === false) {
// 可能会有助力参数啥的 或者打开的是落地页 所以直接把当前href传过去吧
let midUrl = location.origin + CFG.loginMidUrl + encodeURIComponent(location.href);
if (getUrlParam('version')) midUrl += `&version=${getUrlParam('version')}`;
const url = `/packages/login/loginPage?source=duiba&sourcePath=${encodeURIComponent(midUrl)}`;
console.info('跳登录页面url:', url);
wx.miniProgram.navigateTo({ url });
return false;
}
return true;
}
/**
* 更新首页信息,给倒计时用的
*/
......
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