Commit d2f7fa0f authored by cc's avatar cc

更改登录后置 待上线

parent 068efc19
...@@ -20,6 +20,7 @@ export default [ ...@@ -20,6 +20,7 @@ export default [
storeLimitNum: 1000, storeLimitNum: 1000,
continueSignDays: 3, continueSignDays: 3,
todaySignFlag: false, todaySignFlag: false,
login: false,
signRecords: new Array(7).fill(1).map((_, index) => { signRecords: new Array(7).fill(1).map((_, index) => {
return { return {
id: index, id: index,
......
...@@ -40,6 +40,7 @@ class Check extends React.Component<any, any> { ...@@ -40,6 +40,7 @@ class Check extends React.Component<any, any> {
// 按钮 // 按钮
handlegofinish = async (type, n, code, title, jumpUrl, id) => { handlegofinish = async (type, n, code, title, jumpUrl, id) => {
if (!store.checkLoginStatus()) return;
handleLogClick(4, id) handleLogClick(4, id)
const { jfNum = 0, qgNum = 0 } = store?.baseInfo || {}; const { jfNum = 0, qgNum = 0 } = store?.baseInfo || {};
if (type === "xhqg") { if (type === "xhqg") {
...@@ -69,6 +70,7 @@ class Check extends React.Component<any, any> { ...@@ -69,6 +70,7 @@ class Check extends React.Component<any, any> {
handlegosign = _asyncThrottle((hasChallengeDay, resignJf, resignQg, type) => { handlegosign = _asyncThrottle((hasChallengeDay, resignJf, resignQg, type) => {
if (!store.checkLoginStatus()) return;
if (type === 'task') handleLogClick(5) if (type === 'task') handleLogClick(5)
// else if (type === 'calendar') handleLogClick(6) // else if (type === 'calendar') handleLogClick(6)
ModalCtrl.showModal(Renewmodule, { hasChallengeDay, resignJf, resignQg }); ModalCtrl.showModal(Renewmodule, { hasChallengeDay, resignJf, resignQg });
...@@ -79,6 +81,7 @@ class Check extends React.Component<any, any> { ...@@ -79,6 +81,7 @@ class Check extends React.Component<any, any> {
}) })
handlesubscribe = _asyncThrottle(() => { handlesubscribe = _asyncThrottle(() => {
if (!store.checkLoginStatus()) return;
// if (store?.homeInfo?.subscribe) return console.log('buxing'); // if (store?.homeInfo?.subscribe) return console.log('buxing');
// @ts-ignore // @ts-ignore
wx.miniProgram.reLaunch({ url: CFG.subUrl }) wx.miniProgram.reLaunch({ url: CFG.subUrl })
......
...@@ -30,22 +30,27 @@ class HomePage extends React.Component<any, any> { ...@@ -30,22 +30,27 @@ class HomePage extends React.Component<any, any> {
} }
clickPrize = () => { clickPrize = () => {
if (!store.checkLoginStatus()) return;
PageCtrl.changePage(MyPrize); PageCtrl.changePage(MyPrize);
} }
clickRule = () => { clickRule = () => {
if (!store.checkLoginStatus()) return;
PageCtrl.changePage(Rule); PageCtrl.changePage(Rule);
} }
clickCredits = () => { clickCredits = () => {
if (!store.checkLoginStatus()) return;
wx.miniProgram.navigateTo({ url: "/packages/user/points?source=duiba" }); wx.miniProgram.navigateTo({ url: "/packages/user/points?source=duiba" });
} }
clickActPre = () => { clickActPre = () => {
if (!store.checkLoginStatus()) return;
Toast.show("活动未开始"); Toast.show("活动未开始");
} }
clickActEnd = () => { clickActEnd = () => {
if (!store.checkLoginStatus()) return;
Toast.show("活动已结束"); Toast.show("活动已结束");
} }
......
...@@ -15,6 +15,7 @@ class Sign extends React.Component<any, any> { ...@@ -15,6 +15,7 @@ class Sign extends React.Component<any, any> {
} }
clickSign = _asyncThrottle(async () => { clickSign = _asyncThrottle(async () => {
if (!store.checkLoginStatus()) return;
const { todaySignFlag } = store.indexData; const { todaySignFlag } = store.indexData;
if (todaySignFlag) return; if (todaySignFlag) return;
......
...@@ -94,6 +94,7 @@ class Store { ...@@ -94,6 +94,7 @@ class Store {
storeLimitNum?: number, storeLimitNum?: number,
continueSignDays?: number, continueSignDays?: number,
todaySignFlag?: boolean, todaySignFlag?: boolean,
login?: boolean,
signRecords?: { signRecords?: {
id: string, id: string,
day: number, day: number,
...@@ -139,7 +140,25 @@ class Store { ...@@ -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