Commit f1655e8c authored by wildfirecode13's avatar wildfirecode13

1

parent f0e0a7fa
{
"success": false,
"data": {
"value": "500",
"backTime": "1989897768",
"serverTime": "188888776"
},
"message":"fuck"
}
\ No newline at end of file
{
"success": false,
"data": {
"value": "500",
"backTime": "1989897768",
"serverTime": "188888776"
},
"message":"fuck"
}
\ No newline at end of file
......@@ -4,7 +4,7 @@
{
"completeTimes": 0,
"rewards": 1,
"status": 1,
"status": 3,
"taskRateType": 2,
"taskType": "sign",
"times": 1,
......@@ -34,7 +34,7 @@
"completeTimes": 0,
"itemIds": "",
"rewards": "2",
"status": 1,
"status":3,
"taskRateType": 2,
"taskType": "browseGoods",
"times": 1,
......@@ -46,7 +46,7 @@
{
"completeTimes": 0,
"rewards": "1",
"status": 2,
"status": 3,
"taskRateType": 1,
"taskType": "invites",
"times": 3,
......
{
"success": 1,
"data": {
"value": "500",
"backTime": "1989897768",
"serverTime": "188888776"
},
"message":"fuck"
}
\ No newline at end of file
......@@ -23,6 +23,11 @@ const request = tbccRequest({
// api handle 列表
const apiList = {
...capi,
doBrowseGoodsTask: {
handle: 'doBrowseGoodsTask',
method: 'get',
isShowLoading: false
},
receiveTaskRewards: {
handle: 'receiveTaskRewards',
method: 'get',
......
......@@ -9,7 +9,7 @@ cloud.init({
App({
env,
requestType: 'cloud', // yapi,cloud: 云函数
// requestType: 'local', // yapi,cloud: 云函数
requestType: 'local', // yapi,cloud: 云函数
cloudName: 'tmallCat', // 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
cloud,
......
......@@ -28,31 +28,59 @@ Component({
async didMount() {
my.showLoading();
await API.doSignTask().catch(() => { });
await this.getTaskList();
my.hideLoading();
},
methods: {
async getTaskList() {
const { success, data, message } = await API.getTaskList().catch(res => {
commonToast(res && res.message);
}) || {};
my.hideLoading();
//签到邀请关注浏览
let list = [
findTask('sign', data),
findTask('invites', data)
];
list = list.concat(findFollowTask('follow', data));
list.push(findTask('browseGoods', data));
list = list.concat(findFollowTask('follow', data));
if (success && data) {
this.setData({ list })
}
},
methods: {
handleTapReceiveBtn(e) {
async handleTapReceiveBtn(e) {
if (flag) return;
my.showLoading();
flag = 1;
const { item } = e.target.dataset;
console.log('handleTapReceiveBtn', item);
API.receiveTaskRewards({taskType:'sign'});
const { taskType } = item;
const { success, data, message } = await API.receiveTaskRewards({ taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
if (success && data) {
commonToast('领取成功~');
}
await this.getTaskList()
flag = 0;
},
handleTapGoBtn(e) {
async handleTapGoBtn(e) {
if (flag) return;
flag = 1;
const { item } = e.target.dataset;
console.log('handleTapGoBtn',item.type);
const {taskType}=item;
console.log('handleTapGoBtn', taskType);
switch (taskType) {
case 'browseGoods':
await this.handleGoBrowseGoods();
break;
default:
break;
}
},
async handleGoBrowseGoods(itemId) {
await API.doBrowseGoodsTask({itemId});
},
onModalClose() {
const { onModalClose } = this.props;
......
......@@ -8,15 +8,14 @@
<image class="task_receivebtn " data-item="{{item}}" onTap="handleTapReceiveBtn" a:if="{{item.status==2}}" src={{resList['b9f1cc3f-4620-44d8-85ae-187be0745ace'].url}} />
<image class="task_gobtn " data-item="{{item}}" onTap="handleTapGoBtn" a:if="{{item.status==1}}" src={{resList['9ee176ed-5204-4524-97f9-bf17ee698aa8'].url}} />
<image class="task_disabedbtn " a:if="{{item.status==3}}" src={{resList['0e0684af-21c7-48e2-9114-8599c1de33f1'].url}} />
<image class="task_sginicon " src={{resList['ca4c78b3-caf5-435b-ba32-f187f24d1795'].url}} />
<image class="task_inviteicon " src={{resList['61cf4c2c-54e4-4cde-aa16-78ee5d17ab06'].url}} />
<image class="task_focusicon " src={{resList['61cf4c2c-54e4-4cde-aa16-78ee5d17ab06'].url}} />
<image class="task_readicon " src={{resList['61cf4c2c-54e4-4cde-aa16-78ee5d17ab06'].url}} />
<image class="task_sginicon " a:if="{{item.taskType=='sign'}}" src={{resList['ca4c78b3-caf5-435b-ba32-f187f24d1795'].url}} />
<image class="task_inviteicon " a:if="{{item.taskType=='invites'}}" src={{resList['61cf4c2c-54e4-4cde-aa16-78ee5d17ab06'].url}} />
<image class="task_focusicon " a:if="{{item.taskType=='follow'}}" src={{resList['7f6ab236c2c0d17c38f1bfb5260d258ebf1cb630'].url}} />
<image class="task_readicon " a:if="{{item.taskType=='browseGoods'}}" src={{resList['91ef2cf1a80e41f9eeed67259f8e57ae5783afa6'].url}} />
<label class="task_title ">{{item.title}}</label>
<label class="task_award ">精力 +{{item.rewards}}</label>
<label class="task_progress ">({{item.todayCompleteTimes}}/{{item.times}})</label>
</view>
</view>
</view>
</view>
\ No newline at end of file
......@@ -47,6 +47,18 @@ const resList = {
uuid: '61cf4c2c-54e4-4cde-aa16-78ee5d17ab06',
url: '//yun.duiba.com.cn/spark/assets/47eae016fe3e9e31f63b8c60324f33114e009117.png'
},
'7f6ab236c2c0d17c38f1bfb5260d258ebf1cb630': {
name: 'task_followicon',
ext: '.png',
uuid: '7f6ab236c2c0d17c38f1bfb5260d258ebf1cb630',
url: '//yun.duiba.com.cn/aurora/assets/7f6ab236c2c0d17c38f1bfb5260d258ebf1cb630.png'
},
'91ef2cf1a80e41f9eeed67259f8e57ae5783afa6': {
name: 'task_readicon',
ext: '.png',
uuid: '91ef2cf1a80e41f9eeed67259f8e57ae5783afa6',
url: '//yun.duiba.com.cn/aurora/assets/91ef2cf1a80e41f9eeed67259f8e57ae5783afa6.png'
},
......
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