Commit c2f31d76 authored by 王炽's avatar 王炽

66666

parent c84f7968
...@@ -30,15 +30,18 @@ export const fetchActivityStateJSON = () => api.get('/c/third/activity/state'); ...@@ -30,15 +30,18 @@ export const fetchActivityStateJSON = () => api.get('/c/third/activity/state');
export const getResourceList = () => api.get('/c/resource/list'); export const getResourceList = () => api.get('/c/resource/list');
//获取签到和任务信息接口 //获取签到和任务信息接口
export const getSigninAndTaskInfoJSON = () => api.get('/c/activity/todo/list'); export const getSigninAndTaskInfoJSON = () => api.get('/c/activity/todo/list', { mockTime:Date.now() });
//签到接口 //签到接口
export const checkInJSON = (activityId) => api.post('/c/activity/todo/checkIn', { activityId }); export const checkInJSON = (activityId) => api.post('/c/activity/todo/checkIn', { activityId, mockTime:Date.now() });
//获取秒杀列表 //获取秒杀列表
export const getSeckillList = () => api.get('/c/seckill/list'); export const getSeckillList = () => api.get('/c/seckill/list');
//完成任务接口 //完成任务接口
export const taskCompleteJSON = (activityId) => api.post('/c/activity/todo/complete', { activityId }); export const taskCompleteJSON = (activityId) => api.post('/c/activity/todo/complete', { activityId, mockTime:Date.now() });
//接收任务接口
export const taskReceiveJSON = (activityId) => api.post('/c/activity/todo/receive', { activityId, mockTime:Date.now()});
//获取异业券接口 //获取异业券接口
export const getPointsBenefitCouponJSON = (type) => api.get('/c/resource/pointsBenefit/coupon', { type }); export const getPointsBenefitCouponJSON = (type) => api.get('/c/resource/pointsBenefit/coupon', { type });
......
{
"code": "incididunt nulla",
"message": "Ut voluptate anim",
"ok": false,
"success": false
}
...@@ -125,7 +125,7 @@ import TaskCompleteTips from '@/components/renwu/TaskCompleteTips.vue'; ...@@ -125,7 +125,7 @@ import TaskCompleteTips from '@/components/renwu/TaskCompleteTips.vue';
import { useGlobalStore } from '@/stores/global.js'; import { useGlobalStore } from '@/stores/global.js';
import { useUserStore } from '@/stores/user.js'; import { useUserStore } from '@/stores/user.js';
import { jump, JumpType } from '../../utils'; import { jump, JumpType } from '../../utils';
import { taskCompleteJSON } from '../../api/integral'; import { taskCompleteJSON, taskReceiveJSON } from '../../api/integral';
import { useIntegralStore } from '@/stores/integral'; import { useIntegralStore } from '@/stores/integral';
import GongzhonghaoPop from '@/components/renwu/GongzhonghaoPop.vue'; import GongzhonghaoPop from '@/components/renwu/GongzhonghaoPop.vue';
...@@ -266,12 +266,24 @@ const handleTaskComplete = async (taskIdParam) => { ...@@ -266,12 +266,24 @@ const handleTaskComplete = async (taskIdParam) => {
const integralStore = useIntegralStore(); const integralStore = useIntegralStore();
const res = await taskCompleteJSON(taskIdParam); const res = await taskCompleteJSON(taskIdParam);
console.log('taskCompleteJSON res:', res); if (!res.success) {
globalStore.isShowTaskComplete = true; uni.showToast({
globalStore.taskCompletePoints = res?.data?.actualCredits; title: '完成任务失败',
globalStore.taskCompleteTitle = res?.data?.taskName; icon: 'none',
//刷新签到和任务信息 });
await integralStore.getSigninAndTaskInfo(); return;
}
console.log('taskCompleteJSON res:', integralStore.queryTodoResult);
console.log('integralStore.queryTodoResultServer res:', integralStore.queryTodoResult);
await integralStore.queryTodoResultServer();
if (integralStore.queryTodoResult?.success && integralStore.queryTodoResult?.data?.length > 0) {
globalStore.isShowTaskComplete = true;
globalStore.taskCompletePoints = integralStore.queryTodoResult.data[0]?.actualCredits;
globalStore.taskCompleteTitle = integralStore.queryTodoResult.data[0]?.taskName;
}else{
console.info('taskCompleteJSON res error:', integralStore.queryTodoResult);
}
}; };
onShow(async () => { onShow(async () => {
...@@ -414,6 +426,17 @@ const handleTaskClick = async (data) => { ...@@ -414,6 +426,17 @@ const handleTaskClick = async (data) => {
} }
// data.task.taskTodoExtra.type = 'FollowWx' // data.task.taskTodoExtra.type = 'FollowWx'
taskId.value = 0; taskId.value = 0;
const res = await taskReceiveJSON(data.task.id);
if (!res.success) {
uni.showToast({
title: '领取任务失败',
icon: 'none',
});
return;
}
switch (data.task.taskTodoExtra.type) { switch (data.task.taskTodoExtra.type) {
case 'Perfect': case 'Perfect':
globalStore.closeTaskPop(); // 先关闭TaskPop globalStore.closeTaskPop(); // 先关闭TaskPop
......
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