Commit f0e0a7fa authored by wildfirecode13's avatar wildfirecode13

1

parent f2a8884a
......@@ -16,7 +16,7 @@
"completeTimes": 0,
"rewards": 10,
"sellerId": "oooo",
"status": 1,
"status":3,
"taskRateType": 1,
"taskType": "follow",
"title": "关注店铺"
......@@ -25,7 +25,7 @@
"completeTimes": 0,
"rewards": 10,
"sellerId": "wwwww",
"status": 1,
"status":3,
"taskRateType": 1,
"taskType": "follow",
"title": "关注店铺"
......@@ -46,7 +46,7 @@
{
"completeTimes": 0,
"rewards": "1",
"status": 1,
"status": 2,
"taskRateType": 1,
"taskType": "invites",
"times": 3,
......
......@@ -23,6 +23,16 @@ const request = tbccRequest({
// api handle 列表
const apiList = {
...capi,
receiveTaskRewards: {
handle: 'receiveTaskRewards',
method: 'get',
isShowLoading: false
},
doSignTask: {
handle: 'doSignTask',
method: 'get',
isShowLoading: false
},
getTaskList: {
handle: 'getTaskList',
method: 'get',
......
<view class="taskcontainer ">
<view class="task ">
<image class="task_bg " src={{resList['7d24398f-622f-4f20-9d7e-2d7237d7bc6b'].url}} />
<image class="task_close " onTap="onModalClose" src={{resList['33778cbf-8c4f-4d6f-a8e8-9ebc6f0c5cd0'].url}} />
<view class="task_list">
<view class="task_item " a:for="{{list}}">
<image class="task_itembg " src={{resList['b44bac8c-652f-496d-9bc1-165e30d71b02'].url}} />
<image class="task_receivebtn " src={{resList['b9f1cc3f-4620-44d8-85ae-187be0745ace'].url}} />
<image class="task_gobtn " src={{resList['9ee176ed-5204-4524-97f9-bf17ee698aa8'].url}} />
<image class="task_disabedbtn " 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}} />
<label class="task_title ">{{item.title}}</label>
<label class="task_award ">精力 +{{item.rewards}}</label>
<label class="task_progress ">(10/10)</label>
</view>
</view>
</view>
</view>
\ No newline at end of file
<task-list
list="{{list}}"
onHandleTapReceiveBtn="handleTapReceiveBtn"
onHandleTapGoBtn="handleTapGoBtn"
onModalClose="onModalClose"
></task-list>
......@@ -6,6 +6,7 @@ const app = getApp();
const { tbcc } = app;
const { commonToast } = tbcc.tb;
let flag = 0;
const findTask = (key, list) => {
const result = list.filter(i => i.taskType == key);
if (!result || result.length == 0) throw new Error(`不存在key=${key}的任务,请检查接口`)
......@@ -25,9 +26,12 @@ Component({
},
async didMount() {
my.showLoading();
await API.doSignTask().catch(() => { });
const { success, data, message } = await API.getTaskList().catch(res => {
commonToast(res && res.message);
}) || {};
my.hideLoading();
//签到邀请关注浏览
let list = [
findTask('sign', data),
......@@ -41,11 +45,19 @@ Component({
},
methods: {
handleTapReceiveBtn(e) {
const { item } = e.target.dataset;
console.log('handleTapReceiveBtn', item);
API.receiveTaskRewards({taskType:'sign'});
},
handleTapGoBtn(e) {
const { item } = e.target.dataset;
console.log('handleTapGoBtn',item.type);
},
onModalClose() {
const { onModalClose } = this.props;
onModalClose && onModalClose();
// console.log('com task onModalClose')
}
}
});
\ No newline at end of file
{
"component": true,
"usingComponents": {}
"usingComponents": {
"task-list": "/components/comtasklist/comtasklist"
}
}
\ No newline at end of file
.taskcontainer {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
z-index: 20;
background: rgba(0, 0, 0, 0.5);
}
.task {
width: 750rpx;
height: 792rpx;
opacity: 1;
top: 100%;
margin-top: -792rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_bg {
width: 750rpx;
height: 792rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_close {
width: 57rpx;
height: 57rpx;
opacity: 1;
left: 684rpx;
top: 53rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task_list {
width: 100%;
height: auto;
/* background-color: black; */
display: flex;
flex-flow: row wrap;
align-content: flex-start;
padding: 162rpx 0 0 41rpx;
}
.task .task_item {
width: 668rpx;
height: 141rpx;
opacity: 1;
margin: 0 0rpx 16rpx 0;
position: relative;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_itembg {
width: 668rpx;
height: 141rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_receivebtn {
width: 165rpx;
height: 61rpx;
opacity: 1;
left: 479rpx;
top: 25rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_gobtn {
width: 165rpx;
height: 61rpx;
opacity: 1;
left: 479rpx;
top: 25rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_disabedbtn {
width: 165rpx;
height: 61rpx;
opacity: 1;
left: 479rpx;
top: 26rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_sginicon {
width: 90rpx;
height: 91rpx;
opacity: 1;
left: 25rpx;
top: 25rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_inviteicon {
width: 90rpx;
height: 91rpx;
opacity: 1;
left: 25rpx;
top: 25rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_focusicon {
width: 90rpx;
height: 91rpx;
opacity: 1;
left: 25rpx;
top: 25rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_readicon {
width: 90rpx;
height: 91rpx;
opacity: 1;
left: 25rpx;
top: 25rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_title {
/* width: 52rpx; */
height: 26rpx;
opacity: 1;
left: 139rpx;
top: 36rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 28rpx;
color: #685b4e;
}
.task .task_item .task_award {
width: 118rpx;
height: 24rpx;
opacity: 1;
left: 138rpx;
top: 78rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 26rpx;
color: #39abed;
}
.task .task_item .task_progress {
width: 90rpx;
height: 22rpx;
opacity: 1;
left: 517rpx;
top: 95rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 24rpx;
color: #685b4e;
}
<view class="taskcontainer ">
<view class="task ">
<image class="task_bg " src={{resList['7d24398f-622f-4f20-9d7e-2d7237d7bc6b'].url}} />
<image class="task_close " onTap="onModalClose" src={{resList['33778cbf-8c4f-4d6f-a8e8-9ebc6f0c5cd0'].url}} />
<view class="task_list">
<view class="task_item " a:for="{{list}}">
<image class="task_itembg " src={{resList['b44bac8c-652f-496d-9bc1-165e30d71b02'].url}} />
<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}} />
<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
'use strict';
import resList from '../../resconfig/resList';
Component({
props: {
list: null,
},
data: {
resList: resList
},
methods: {
handleTapReceiveBtn(e) {
this.props.onHandleTapReceiveBtn(e);
},
handleTapGoBtn(e) {
this.props.onHandleTapGoBtn(e);
},
onModalClose() {
this.props.onModalClose();
}
}
});
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
......@@ -46,28 +46,6 @@ Page({
flag = 0;
},
// async onItemExchange(_id) {
// const { success, data, message } = await API.exchangeGood({ _id }).catch(res => {
// commonToast(res && res.message)
// }) || {};
// // API.exchangeGood({ _id })
// // .then(() => {
// // _list.forEach(item => {
// // if (item._id == _id) {
// // item.exchanged = true;
// // }
// // })
// // console.log('_list', _list)
// // this.setData({ list: [] });
// // // this.updateData();
// // })
// // .catch(res => {
// // });
// },
async getExchangeGoodList() {
const { data: { list, happyCoin } } = await API.exchangeGoodList();
list.forEach(item => {
......
......@@ -2,5 +2,8 @@
"cloud": {
"type": "CLOUDAPP"
},
"miniprogramRoot": "./client"
"miniprogramRoot": "./client",
"exclude": [
"server/**"
]
}
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