Commit 9d6dc9d0 authored by zhangjinzhou's avatar zhangjinzhou

Merge branch 'jiaoneiqunuan' of gitlab2.dui88.com:wanghongyuan/new_taobao into jiaoneiqunuan

# Conflicts:
#	taobao_jn/client/pages/pagegamemain/pagegamemain.json
parents ab2c0fff 1b7dbfa1
'use strict';
import React, { Component } from 'react';
import resList from '../../resconfig/resList';
import './comunlockstepmodal.less';
class Comunlockstepmodal extends Component {
constructor(props) {
super(props);
this.state = { resList: resList };
}
render() {
return (
<div className="unlockstepmodal ">
<img className="unlockstepbg " src={this.state.resList['cae8e0bb-e05f-4bc7-b77d-24b9f1e9492c'].url} />
<div className="unlocksteptext ">
<span className="unlocksteptitle1 ">恭喜您解锁7系赛段</span>
<span className="unlocksteptitle2 ">进入三人场</span>
<span className="unlockstepprizedesc ">奖品可在 我的奖品 中查看</span>
<span className="unlockstepname ">产品六字名称</span>
</div>
<img className="unlockstepbtn " src={this.state.resList['3078345c-9a38-4d1f-9361-eb7a2587d99e'].url} />
<img className="unlockstepclose " src={this.state.resList['90b5f539-4c56-4210-937e-8dd359fbb2b0'].url} />
<img className="unlockstepprizeimg " />
</div>
);
}
}
export default Comunlockstepmodal;
\ No newline at end of file
.unlockstepmodal {
width: 527px;
height: 802px;
opacity: 1;
left: 111px;
top: 338px;
position: absolute;
transform-origin: 0px 0px 0px;
.unlockstepbg {
width: 527px;
height: 688px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
}
.unlocksteptext {
width: 366px;
height: 586px;
opacity: 1;
left: 80px;
top: 58px;
position: absolute;
transform-origin: 0px 0px 0px;
.unlocksteptitle1 {
width: 366px;
height: 40px;
opacity: 1;
position: absolute;
transform-origin: 0px 0px 0px;
font-size: 42px;
color: rgba(0, 0, 0, 1);
}
.unlocksteptitle2 {
width: 312px;
height: 24px;
opacity: 1;
left: 26px;
top: 62px;
position: absolute;
transform-origin: 0px 0px 0px;
font-size: 24px;
color: rgba(0, 0, 0, 1);
text-align: center;
}
.unlockstepprizedesc {
width: 245px;
height: 20px;
opacity: 1;
left: 60px;
top: 566px;
position: absolute;
transform-origin: 0px 0px 0px;
font-size: 20px;
color: rgba(0, 0, 0, 1);
display: none;
}
.unlockstepname {
width: 218px;
height: 35px;
opacity: 1;
left: 72px;
top: 397px;
position: absolute;
transform-origin: 0px 0px 0px;
font-size: 36px;
color: rgba(0, 0, 0, 1);
}
}
.unlockstepbtn {
width: 363px;
height: 73px;
opacity: 1;
left: 82px;
top: 534px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.unlockstepclose {
width: 72px;
height: 72px;
opacity: 1;
left: 227px;
top: 730px;
position: absolute;
transform-origin: 0px 0px 0px;
}
.unlockstepprizeimg {
width: 262px;
height: 262px;
opacity: 1;
display: block;
left: 134px;
top: 180px;
position: absolute;
transform-origin: 0px 0px 0px;
}
}
\ No newline at end of file
...@@ -39,6 +39,11 @@ const apiList = { ...@@ -39,6 +39,11 @@ const apiList = {
method: 'get', method: 'get',
isShowLoading: false isShowLoading: false
}, },
doCollectGoodsTask: {
handle: 'doCollectGoodsTask',
method: 'get',
isShowLoading: false
},
receiveTaskRewards: { receiveTaskRewards: {
handle: 'receiveTaskRewards', handle: 'receiveTaskRewards',
method: 'get', method: 'get',
...@@ -74,6 +79,21 @@ const apiList = { ...@@ -74,6 +79,21 @@ const apiList = {
method: 'get', method: 'get',
isShowLoading: false isShowLoading: false
}, },
getCollectGoodsList: {
handle: 'getCollectGoodsList',
method: 'get',
isShowLoading: false
},
getItemListByItemIds: {
handle: 'getItemListByItemIds',
method: 'get',
isShowLoading: false
},
login: {
handle: 'login',
method: 'get',
isShowLoading: false
},
/**获取游戏信息 */ /**获取游戏信息 */
getGameInfo: { getGameInfo: {
handle: 'getGameInfo', handle: 'getGameInfo',
......
...@@ -27,13 +27,15 @@ page { ...@@ -27,13 +27,15 @@ page {
left: 50%; left: 50%;
margin-left:-375rpx; margin-left:-375rpx;
margin-top:-812rpx; margin-top:-812rpx;
z-index: 100;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
} }
.popcontainer_down { .popcontainer_down {
position: fixed; position: fixed;
width: 750rpx; width: 750rpx;
height: 1624rpx; height: 2000rpx;
bottom:0rpx; bottom:0rpx;
z-index: 100;
background: rgba(0, 0, 0, 0.5); background: rgba(0, 0, 0, 0.5);
} }
.btn:active { .btn:active {
......
...@@ -24,23 +24,34 @@ ...@@ -24,23 +24,34 @@
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
} }
.task .task_close { .task .task_close {
width: 57rpx; width: 72rpx;
height: 57rpx; height: 72rpx;
opacity: 1; opacity: 1;
left: 684rpx; left: 651rpx;
top: 53rpx; top: -91rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
} }
.task .taskmodaltitle {
width: 750rpx;
height: 39rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 42rpx;
color: rgba(0, 0, 0, 1);
text-align: center;
top: 24rpx;
}
.task_list { .task_list {
width: 100%; width: 100%;
height: 620rpx; height: 640rpx;
/* background-color: black; */ /* background-color: black; */
display: flex; display: flex;
flex-flow: row wrap; flex-flow: row wrap;
align-content: flex-start; align-content: flex-start;
margin-top: 162rpx; margin-top: 122rpx;
padding: 0rpx 0 0 41rpx; padding: 0rpx 0 0 41rpx;
overflow-x: auto; overflow-x: auto;
} }
...@@ -122,16 +133,26 @@ ...@@ -122,16 +133,26 @@
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
} }
.task .task_item .task_favoricon {
width: 90rpx;
height: 91rpx;
opacity: 1;
left: 25rpx;
top: 25rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.task .task_item .task_title { .task .task_item .task_title {
/* width: 52rpx; */ /* width: 52rpx; */
height: 26rpx; height: 26rpx;
opacity: 1; opacity: 1;
left: 139rpx; left: 139rpx;
top: 36rpx; top: 20rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
font-size: 28rpx; font-size: 28rpx;
color: #685b4e; color: #685b4e;
font-weight: bolder;
} }
.task .task_item .task_award { .task .task_item .task_award {
width: 118rpx; width: 118rpx;
...@@ -142,7 +163,7 @@ ...@@ -142,7 +163,7 @@
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 0rpx 0rpx 0rpx;
font-size: 26rpx; font-size: 26rpx;
color: #39abed; color: #685b4e;
} }
.task .task_item .task_progress { .task .task_item .task_progress {
width: 200rpx; width: 200rpx;
......
...@@ -3,141 +3,188 @@ ...@@ -3,141 +3,188 @@
import resList from '../../resconfig/resList'; import resList from '../../resconfig/resList';
import API from '../../api'; import API from '../../api';
const app = getApp(); const app = getApp();
const { tbcc } = app; const {
const { commonToast, favorShop, navigateToOutside } = tbcc.tb; tbcc
} = app;
const {
commonToast,
favorShop,
navigateToOutside
} = tbcc.tb;
let flag = 0; let flag = 0;
const findTask = (key, list) => { const findTask = (key, list) => {
const result = list.filter(i => i.taskType == key); const result = list.filter(i => i.taskType == key);
if (!result || result.length == 0) throw new Error(`不存在key=${key}的任务,请检查接口`) if (!result || result.length == 0) throw new Error(`不存在key=${key}的任务,请检查接口`)
return result[0] return result[0]
}; };
const findFollowTask = (key, list) => { const findFollowTask = (key, list) => {
const result = list.filter(i => i.taskType == key); const result = list.filter(i => i.taskType == key);
if (!result || result.length == 0) throw new Error(`不存在key=${key}的任务,请检查接口`) if (!result || result.length == 0) throw new Error(`不存在key=${key}的任务,请检查接口`)
return result; return result;
}; };
Component({ Component({
props: {}, props: {},
data: { data: {
resList: resList, list: [] resList: resList,
}, list: []
},
async didMount() { async didMount() {
my.showLoading(); my.showLoading();
await this.getTaskList(); await this.getTaskList();
my.hideLoading(); my.hideLoading();
}, },
methods: { methods: {
async getTaskList() { async getTaskList() {
const { success, data, message } = await API.getTaskList().catch(res => { const {
commonToast(res && res.message); success,
}) || {}; data,
message
} = await API.getTaskList().catch(res => {
commonToast(res && res.message);
}) || {};
if (success && data) {
//签到邀请关注浏览
let list = [
findTask('sign', data),
findTask('follow', data)
// findTask('invites', data)
];
list.push(findTask('browseGoods', data));
list = list.concat(findFollowTask('collectGoods', data));
console.log(list);
this.setData({
list
})
}
},
async handleTapReceiveBtn(e) {
if (flag) return;
// my.showLoading();
flag = 1;
const {
item
} = e.target.dataset;
const {
taskType,
sellerId
} = item;
const {
success,
data,
message
} = await API.receiveTaskRewards({
taskType,
sellerId
}).catch(res => {
commonToast(res && res.message);
}) || {};
// my.hideLoading();
if (success && data) {
let str;
// switch (taskType) {
// case 'sign':
// break;
// case 'browseGoods':
// break;
// case 'follow':
// break;
// case 'invites':
// break;
//签到邀请关注浏览 // default:
let list = [ // break;
findTask('sign', data),
findTask('invites', data)
];
list.push(findTask('browseGoods', data));
list = list.concat(findFollowTask('follow', data));
if (success && data) {
this.setData({ list })
}
},
async handleTapReceiveBtn(e) {
if (flag) return;
// my.showLoading();
flag = 1;
const { item } = e.target.dataset;
const { taskType, sellerId } = item;
const { success, data, message } = await API.receiveTaskRewards({ taskType, sellerId }).catch(res => {
commonToast(res && res.message);
}) || {};
// my.hideLoading();
if (success && data) {
let str;
// switch (taskType) {
// case 'sign':
// break;
// case 'browseGoods':
// break;
// case 'follow':
// break;
// case 'invites':
// break;
// default: // }
// break; console.log('taskType', taskType)
if (taskType == 'invites')
str = `成功邀请${data.times}名好友,奖励为精力值+${data.energy}`
commonToast(str || '领取成功');
}
/**领取成功,增加温暖值 */
// } await this.getTaskList()
console.log('taskType',taskType) flag = 0;
if (taskType == 'invites') },
str = `成功邀请${data.times}名好友,奖励为精力值+${data.energy}` async handleTapGoBtn(e) {
commonToast(str || '领取成功'); if (flag) return;
} flag = 1;
my.__updateUserInfo__(); const {
await this.getTaskList() item
flag = 0; } = e.target.dataset;
}, const {
async handleTapGoBtn(e) { taskType,
if (flag) return; sellerId,
flag = 1; itemId,
const { item } = e.target.dataset; url,
const { taskType, sellerId, itemId, url } = item; itemIds
} = item;
switch (taskType) { switch (taskType) {
case 'browseGoods': case 'collectGoods':
navigateToOutside(url); await this.handleGoColletcGoods(itemIds);
await this.handleGoBrowseGoods(); await this.getTaskList();
await this.getTaskList(); break;
break; case 'browseGoods':
case 'follow': await this.handleGoBrowseGoods(itemIds);
await this.handleGoFollow(sellerId); await this.getTaskList();
await this.getTaskList(); break;
break; case 'follow':
case 'invites': setTimeout(() => {
my.showSharePanel(); flag = 0;
break; }, 1000);
case 'sign': await this.handleGoFollow(sellerId);
await this.handleGoSign(); await this.getTaskList();
await this.getTaskList(); break;
break; case 'sign':
default: await this.handleGoSign();
console.log('handleTapGoBtn', taskType); await this.getTaskList();
break; break;
} default:
flag = 0; console.log('handleTapGoBtn', taskType);
}, break;
async handleGoSign() { }
await API.doSignTask( ).catch(res => { flag = 0;
commonToast(res && res.message); },
}) || {}; async handleGoColletcGoods(itemIds) {
}, my.navigateTo({
async handleGoBrowseGoods(itemId) { url: '/pages/goodsPage/goodsPage?taskType=collectGoods&&itemIds=' + itemIds
await API.doBrowseGoodsTask({ itemId }).catch(res => { })
commonToast(res && res.message); },
}) || {}; async handleGoSign() {
}, await API.doSignTask().catch(res => {
async handleGoFollow(sellerId) { commonToast(res && res.message);
console.log('handleGoFollow',sellerId) }) || {};
const favorStatus = await favorShop(sellerId).catch(err => { },
console.log('关注店铺失败', err); async handleGoBrowseGoods(itemIds) {
}); my.navigateTo({
commonToast(favorStatus ? '关注成功' : '关注失败'); url: '/pages/goodsPage/goodsPage?taskType=browseGoods&&itemIds=' + itemIds
if (favorStatus) { })
await API.doFollowTask({ sellerId }).catch(res => { },
commonToast(res && res.message); async handleGoFollow(sellerId) {
}) || {}; console.log('handleGoFollow', sellerId)
} const favorStatus = await favorShop(sellerId).catch(err => {
}, console.log('关注店铺失败', err);
onModalClose() { });
const { onModalClose } = this.props; commonToast(favorStatus ? '关注成功' : '关注失败');
onModalClose && onModalClose(); if (favorStatus) {
// console.log('com task onModalClose') await API.doFollowTask({
sellerId
}).catch(res => {
commonToast(res && res.message);
}) || {};
}
},
onModalClose() {
const {
onModalClose
} = this.props;
onModalClose && onModalClose();
// console.log('com task onModalClose')
}
} }
}
}); });
\ No newline at end of file
<view class="taskcontainer "> <view class="taskcontainer ">
<view class="task "> <view class="task ">
<image class="task_bg " src={{resList['7d24398f-622f-4f20-9d7e-2d7237d7bc6b'].url}} /> <image class="task_bg " src={{resList['feaed213-a6d1-4e32-8444-5c823923f299'].url}} />
<image class="task_close " onTap="onModalClose" src={{resList['33778cbf-8c4f-4d6f-a8e8-9ebc6f0c5cd0'].url}} /> <image class="task_close " onTap="onModalClose" src={{resList['8797382d-2b38-432e-85d3-6a2160304723'].url}} />
<label class="taskmodaltitle">任务中心</label>
<view class="task_list"> <view class="task_list">
<view class="task_item " a:for="{{list}}"> <view class="task_item " a:for="{{list}}">
<image class="task_itembg " src={{resList['b44bac8c-652f-496d-9bc1-165e30d71b02'].url}} /> <image class="task_itembg " src={{resList['726bc3e9-0f05-4d3f-8812-d9cb87c5efd1'].url}} />
<image class="task_receivebtn " data-item="{{item}}" onTap="handleTapReceiveBtn" a:if="{{item.status==2}}" src={{resList['b9f1cc3f-4620-44d8-85ae-187be0745ace'+(item.taskType=='sign' ? '':'')].url}} /> <image class="task_receivebtn " data-item="{{item}}" onTap="handleTapReceiveBtn" a:if="{{item.status==2}}" src={{resList['437257fe-ed18-4a3c-a428-5459ea4e9736'].url}} />
<image class="task_gobtn " data-item="{{item}}" onTap="handleTapGoBtn" a:if="{{item.status==1}}" src={{resList['9ee176ed-5204-4524-97f9-bf17ee698aa8-'+item.taskType].url}} /> <image class="task_gobtn " data-item="{{item}}" onTap="handleTapGoBtn" a:if="{{item.status==1}}" src={{resList['24b5da2e-3b36-476a-9e74-090cc96542cf'].url}} />
<image class="task_disabedbtn " a:if="{{item.status==3}}" src={{resList['9c4565f2-d6f8-4a33-9cea-c04c5f3cd7a1'].url}} />
<image class="task_sginicon " a:if="{{item.taskType=='sign'}}" src={{resList['8825062d-8f99-4eae-b961-e52ad9707a80'].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['55bfd46b-b5d5-4942-aecb-ff63633cbbdc'].url}} />
<image class="task_readicon " a:if="{{item.taskType=='browseGoods'}}" src={{resList['e3bef9e1-07a4-408d-b387-a9ac08c4b7f0'].url}} />
<image class="task_favoricon " a:if="{{item.taskType=='collectGoods'}}" src={{resList['a03d17c7-c4f0-42e0-9430-be61f5eb68d5'].url}} />
<image class="task_disabedbtn " a:if="{{item.status==3}}" src={{resList['0e0684af-21c7-48e2-9114-8599c1de33f1'+ (item.taskType=='follow' ? '-follow':'') ].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_title ">{{item.title}}</label>
<label class="task_award ">精力 +{{item.rewards}}</label> <label class="task_award ">温暖值 +{{item.rewards}}</label>
<block> <block>
<label class="task_progress " a:if="{{item.taskType=='invites'}}">(不限次数)</label> <!-- <label class="task_progress " a:if="{{item.taskType=='invites'}}">(不限次数)</label>
<label class="task_progress " a:elif="{{item.taskType!='follow'}}">({{item.todayCompleteTimes}}/{{item.times}})</label> <label class="task_progress " a:elif="{{item.taskType!='follow'}}">({{item.todayCompleteTimes}}/{{item.times}})</label>
<label class="task_progress " a:else>({{item.completeTimes}}/1)</label> <label class="task_progress " a:else>({{item.completeTimes}}/1)</label> -->
</block> </block>
</view> </view>
</view> </view>
......
.unlockstepmodal {
width: 527rpx;
height: 802rpx;
opacity: 1;
left: 111rpx;
top: 388rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.unlockstepmodal .unlockstepbg {
width: 527rpx;
height: 688rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.unlockstepmodal .unlocksteptext {
width: 366rpx;
height: 586rpx;
opacity: 1;
left: 80rpx;
top: 58rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
.unlockstepmodal .unlocksteptext .unlocksteptitle1 {
width: 366rpx;
height: 40rpx;
opacity: 1;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 42rpx;
color: #000000;
}
.unlockstepmodal .unlocksteptext .unlocksteptitle2 {
width: 312rpx;
height: 24rpx;
opacity: 1;
left: 26rpx;
top: 62rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 24rpx;
color: #000000;
text-align: center;
}
.unlockstepmodal .unlocksteptext .unlockstepprizedesc {
width: 245rpx;
height: 20rpx;
opacity: 1;
left: 60rpx;
top: 566rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 20rpx;
color: #000000;
display: none;
}
.unlockstepmodal .unlocksteptext .unlockstepname {
width: 218rpx;
height: 35rpx;
opacity: 1;
left: 72rpx;
top: 397rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
font-size: 36rpx;
color: #000000;
text-align: center;
}
.unlockstepmodal .unlockstepbtn {
width: 363rpx;
height: 73rpx;
opacity: 1;
left: 82rpx;
top: 534rpx;
position: absolute;
transform-origin: 50% 50% 0rpx;
}
.unlockstepmodal .unlockstepclose {
width: 72rpx;
height: 72rpx;
opacity: 1;
left: 227rpx;
top: 730rpx;
position: absolute;
transform-origin: 50% 50% 0rpx;
}
.unlockstepmodal .unlockstepprizeimg {
width: 262rpx;
height: 262rpx;
opacity: 1;
display: block;
left: 134rpx;
top: 180rpx;
position: absolute;
transform-origin: 0rpx 0rpx 0rpx;
}
<view class="unlockstepmodal ">
<image class="unlockstepbg " src={{resList['cae8e0bb-e05f-4bc7-b77d-24b9f1e9492c'].url}} />
<view class="unlocksteptext ">
<label class="unlocksteptitle1 ">{{title1}}</label>
<label class="unlocksteptitle2 ">{{title2}}</label>
<label class="unlockstepprizedesc ">奖品可在 我的奖品 中查看</label>
<label class="unlockstepname ">人气商品</label>
</view>
<image class="unlockstepbtn btn" onTap="redirectToIndex" src={{resList['3078345c-9a38-4d1f-9361-eb7a2587d99e'].url}} />
<image class="unlockstepclose btn" onTap="redirectToIndex" src={{resList['90b5f539-4c56-4210-937e-8dd359fbb2b0'].url}} />
<image class="unlockstepprizeimg " onTap="navigateToGoodsDetail" src={{resList['a37987f0-dcaf-4538-be27-90ebd6e21156-'+unLockStep].url}} />
</view>
\ No newline at end of file
'use strict';
import resList from '../../resconfig/resList';
const app = getApp();
const { tbcc } = app;
const {
navigateToOutside,
} = tbcc.tb;
Component({
props: {
unLockStep:2
},
data: {
resList: resList,
unLockStep:0,
title1:'',
title2:''
},
methods: {
redirectToIndex(){
my.redirectTo({url:'/pages/pagepageindex/pagepageindex'})
},
navigateToGoodsDetail(){
const unLockStep = this.props.unLockStep;
let url = unLockStep==2?'https://detail.tmall.com/item.htm?spm=a212k0.12153887.0.0.4e60687dPr2HpU&id=625400191293':'https://detail.tmall.com/item.htm?spm=a212k0.12153887.0.0.4e60687dPr2HpU&id=627409975355'
navigateToOutside(url)
}
},
didMount(){
const unLockStep = this.props.unLockStep;
let str = unLockStep==2?'恭喜您解锁5系赛段':'恭喜您解锁7系赛段';
let str1 = unLockStep==3?'进入三人场':'进入四人场';
this.setData({
unLockStep:unLockStep,
title1:str,
title2:str1
})
}
});
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
...@@ -12,13 +12,13 @@ ...@@ -12,13 +12,13 @@
<view class="goods-modal-container__content-item__name" style="{{{'color':task.color}}}">{{item.name}}</view> <view class="goods-modal-container__content-item__name" style="{{{'color':task.color}}}">{{item.name}}</view>
<view class="goods-modal-container__content-item__price"> <view class="goods-modal-container__content-item__price">
<view class="goods-modal-container__content-item__price-num"><text>¥</text>{{item.price}}</view> <view class="goods-modal-container__content-item__price-num"><text>¥</text>{{item.price}}</view>
<view a:if="{{task.taskType == 'collectGoods'}}" <!-- <view a:if="{{task.taskType == 'collectGoods1'}}"
data-item="{{item}}" data-item="{{item}}"
onTap="goToCollectGoods" onTap="goToCollectGoods"
class="{{item.collected ? 'goods-modal-container__content-item__price-collect' : 'goods-modal-container__content-item__price-no-collect'}}" class="{{item.collected ? 'goods-modal-container__content-item__price-collect' : 'goods-modal-container__content-item__price-no-collect'}}"
> >
<image mode="scaleToFill" src="{{item.collected?task.image.collect:task.image.no_collect}}"/> <image mode="scaleToFill" src="{{item.collected?task.image.collect:task.image.no_collect}}"/>
</view> </view> -->
</view> </view>
</view> </view>
</view> </view>
...@@ -26,5 +26,5 @@ ...@@ -26,5 +26,5 @@
</view> </view>
<!-- 倒计时 --> <!-- 倒计时 -->
<count-down-modal a:if="{{isShowCountdown && task.taskType == 'browseGoods'}}" percent="{{percent}}" usePercent="{{usePercent}}" styleType="{{'01'}}" /> <count-down-modal a:if="{{isShowCountdown && task.taskType == 'browseGoods'}}" style="{{{'z-index':999}}}" percent="{{percent}}" usePercent="{{usePercent}}" styleType="{{'01'}}" />
</view> </view>
\ No newline at end of file
...@@ -2,101 +2,132 @@ ...@@ -2,101 +2,132 @@
* 任务类型(taskType):collectGoods、orderGoods、browseGoods、exchangeCredits * 任务类型(taskType):collectGoods、orderGoods、browseGoods、exchangeCredits
*/ */
const app = getApp(); const app = getApp();
const { tbcc } = app; const {
const { openDetail, collectGoods, checkGoodsCollectedStatus } = tbcc.tb; tbcc
} = app;
const {
openDetail,
collectGoods,
checkGoodsCollectedStatus
} = tbcc.tb;
Component({ Component({
mixins: [], collectGoods: [],
timer: null, notCollectGoods: [],
data: { mixins: [],
usePercent: 0, // 已进行的进度条 timer: null,
percent: 0,// 进度条 data: {
isShowCountdown: true, // 是否显示倒计时 usePercent: 0, // 已进行的进度条
isFlag: 1 percent: 0, // 进度条
}, isShowCountdown: true, // 是否显示倒计时
props: { isFlag: 1
isBackFlag: 0,
goodsList: [1,2,3],
task: {
itemId: '617724147979,617724563528,617300295119,614139753189',
taskType: 'browseGoods',
type: '02',
bannerHeight: 430,
image: {
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
banner: '//yun.dui88.com/taobaomini/clientCTest/goods_banner@2x.png',
title: '//yun.dui88.com/taobaomini/clientCTest/goods_title@2x.png',
collect: '//yun.dui88.com/taobaomini/clientCTest/goods_collection@2x.png',
no_collect: '//yun.dui88.com/taobaomini/clientCTest/collection_no_collect@2x.png',
img: '//yun.dui88.com/taobaomini/clientCTest/goods_img@2x.png',
},
color: '#181818'
}, },
onCompleteTask: () => {} props: {
}, isBackFlag: 0,
didMount() { goodsList: [1, 2, 3],
const { taskType } = this.props.task task: {
this.setData({ isFlag: this.props.isBackFlag }) // itemId: '617724147979,617724563528,617300295119,614139753189',
console.log(this.props.goodsList) // taskType: 'collectGoods',
if(taskType == 'browseGoods') { // type: '02',
this.browseGoodsTimes() // bannerHeight: 430,
} // image: {
}, // bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
didUpdate(prevProps,prevData) { // banner: '//yun.dui88.com/taobaomini/clientCTest/goods_banner@2x.png',
if(prevData.isFlag && prevProps.isBackFlag != prevData.isFlag) { // title: '//yun.dui88.com/taobaomini/clientCTest/goods_title@2x.png',
console.log(3) // collect: '//yun.dui88.com/taobaomini/clientCTest/goods_collection@2x.png',
if(!this.timer) { // no_collect: '//yun.dui88.com/taobaomini/clientCTest/collection_no_collect@2x.png',
this.setData({ usePercent: this.data.percent }) // img: '//yun.dui88.com/taobaomini/clientCTest/goods_img@2x.png',
this.browseGoodsTimes() // },
console.log(10 - this.usePercent) // color: '#181818'
} },
} onCompleteTask: () => {}
},
didUnmount() {
clearTimeout(this.timer)
},
methods: {
/**
* 跳转商品详情页
*/
async goToGoodsDetail(e) {
clearInterval(this.timer)
this.setData({
percent: this.data.usePercent,
})
const { itemId } = e.target.dataset.item
await openDetail(String(itemId))
},
/**
* 收藏商品
*/
async goToCollectGoods(e) {
const { itemId, collected } = e.target.dataset.item
const { taskType } = this.props.task
if(collected) return;
let result = await collectGoods(itemId)
if(result) {
this.props.onCompleteTask(taskType, itemId)
}
}, },
/** didMount() {
* 浏览商品倒计时 const {
*/ taskType
browseGoodsTimes() { } = this.props.task
const { taskType } = this.props.task
this.timer = setInterval(() => {
this.setData({ this.setData({
usePercent: this.data.usePercent + 1 isFlag: this.props.isBackFlag
}, () => {
if (this.data.usePercent >= 10) {
console.log(this.data.usePercent)
this.props.onCompleteTask(taskType)
clearInterval(this.timer)
}
}) })
},1000) // console.log(this.props.goodsList)
} if (taskType == 'browseGoods') {
}, this.browseGoodsTimes()
}); }
},
didUpdate(prevProps, prevData) {
const {
taskType
} = this.props.task
if (prevData.isFlag && prevProps.isBackFlag != prevData.isFlag) {
console.log(3)
if (!this.timer) {
this.setData({
usePercent: this.data.percent
})
if (taskType == 'browseGoods') {
this.browseGoodsTimes()
}
console.log(10 - this.usePercent)
}
}
},
didUnmount() {
clearTimeout(this.timer)
},
methods: {
/**
* 跳转商品详情页
*/
async goToGoodsDetail(e) {
clearInterval(this.timer)
this.setData({
percent: this.data.usePercent,
})
const {
itemId
} = e.target.dataset.item
const {
onSetNotColletArr
} = this.props;
onSetNotColletArr && await onSetNotColletArr(itemId)
await openDetail(String(itemId))
},
/**
* 收藏商品
*/
async goToCollectGoods(e) {
const {
itemId,
collected
} = e.target.dataset.item
const {
taskType
} = this.props.task
if (collected) return;
let result = await collectGoods(itemId)
if (result) {
this.props.onCompleteTask(taskType, itemId)
}
},
/**
* 浏览商品倒计时
*/
browseGoodsTimes() {
const {
taskType
} = this.props.task
this.timer = setInterval(() => {
this.setData({
usePercent: this.data.usePercent + 1
}, () => {
if (this.data.usePercent >= 10) {
console.log(this.data.usePercent)
this.props.onCompleteTask(taskType)
clearInterval(this.timer)
}
})
}, 1000)
}
},
});
\ No newline at end of file
This diff is collapsed.
...@@ -3,5 +3,7 @@ ...@@ -3,5 +3,7 @@
isBackFlag="{{isBackFlag}}" isBackFlag="{{isBackFlag}}"
goodsList="{{goodsList}}" goodsList="{{goodsList}}"
task="{{task}}" task="{{task}}"
onSetNotColletArr="setNotColletArr"
onSetColletArr="setColletArr"
onCompleteTask="onCompleteTask" /> onCompleteTask="onCompleteTask" />
</view> </view>
\ No newline at end of file
/** /**
* 任务类型(taskType):collectGoods、orderGoods、browseGoods、exchangeCredits * 任务类型(taskType):collectGoods、orderGoods、browseGoods、exchangeCredits
* task: { * task: {
* itemId: //商品ID * itemId: //商品ID
* taskType: //任务类型 * taskType: //任务类型
* type: //头部样式(02——banner,01——标题) * type: //头部样式(02——banner,01——标题)
* image: {//图片 * image: {//图片
* bg: //集合页背景 * bg: //集合页背景
* banner: //头部banner * banner: //头部banner
* title: //头部title * title: //头部title
* collect: //商品以收藏 * collect: //商品以收藏
* no_collect: //商品未收藏 * no_collect: //商品未收藏
* } * }
* color: //商品名称:文字颜色 * color: //商品名称:文字颜色
* } * }
*/ */
const app = getApp(); const app = getApp();
const { tbcc } = app; const {
const { openDetail, collectGoods, checkGoodsCollectedStatus, commonToast } = tbcc.tb; tbcc
} = app;
const {
openDetail,
collectGoods,
checkGoodsCollectedStatus,
commonToast
} = tbcc.tb;
import API from '../../api'; import API from '../../api';
Page({ Page({
data: { collectGoodsArr: [],
query: {}, notCollectGoodsArr: [],
task: {}, curItemId: 0,
isBackFlag: 1, data: {
goodsList: [] query: {},
}, task: {},
onLoad(query) { isBackFlag: 1,
this.query = query || {} goodsList: []
this.init() },
}, onLoad(query) {
onShow() { this.query = query || {}
//重新回到页面开启倒计时 this.init()
this.setData({ isBackFlag: Math.floor((Math.random() * 100)) == this.data.isBackFlag ? 101 : Math.floor((Math.random() * 100)) }) },
}, onShow() {
init() { const {
const { itemId, taskType } = this.query itemId,
this.setData({ taskType
task: { } = this.query
itemId, //重新回到页面开启倒计时
taskType: 'browseGoods', this.setData({
type: '01', isBackFlag: Math.floor((Math.random() * 100)) == this.data.isBackFlag ? 101 : Math.floor((Math.random() * 100))
image: { })
bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png', if(taskType == 'collectGoods'){
banner: '//yun.dui88.com/taobaomini/clientCTest/goods_banner@2x.png', this.isCanCompleteCollectTask();
title: '//yun.dui88.com/taobaomini/clientCTest/goods_title@2x.png', }
collect: '//yun.dui88.com/taobaomini/clientCTest/goods_collection@2x.png', },
no_collect: '//yun.dui88.com/taobaomini/clientCTest/collection_no_collect@2x.png', init() {
img: '//yun.dui88.com/taobaomini/clientCTest/goods_img@2x.png', const {
}, itemId,
color: '#181818' taskType
} } = this.query
}) this.setData({
this.initPage() task: {
}, itemId,
async initPage() { taskType: taskType,
const { activityId } = app type: '01',
const { taskType, itemIds } = this.query image: {
let goodsList = [ bg: '//yun.dui88.com/taobaomini/clientCTest/goods_bg@2x.png',
{ banner: '//yun.dui88.com/taobaomini/clientCTest/goods_banner@2x.png',
image: '', title: '//yun.dui88.com/taobaomini/clientCTest/goods_title@2x.png',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品', collect: '//yun.dui88.com/taobaomini/clientCTest/goods_collection@2x.png',
price: '388', no_collect: '//yun.dui88.com/taobaomini/clientCTest/collection_no_collect@2x.png',
itemId: 617724147979, img: '//yun.dui88.com/taobaomini/clientCTest/goods_img@2x.png',
collected: false },
}, color: '#181818'
{ }
image: '', })
name: '商品名商品名商品名商品名商品名商品名商品名商品商品', this.initPage()
price: '388', },
collected: true, async initPage() {
itemId: 617724563528, const {
}, activityId
{ } = app
image: '', const {
name: '商品名商品名商品名商品名商品名商品名商品名商品商品', taskType,
price: '388', itemIds
collected: false, } = this.query
itemId: 617300295119, let goodsList = [{
}, image: '',
{ name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
image: '', price: '388',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品', itemId: 617724147979,
price: '388', collected: false
collected: true, },
itemId: 614139753189, {
}, image: '',
{ name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
image: '', price: '388',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品', collected: true,
price: '388', itemId: 617724563528,
itemId: 617724147979, },
}, {
] image: '',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
this.setData({ goodsList }) price: '388',
collected: false,
itemId: 617300295119,
},
{
image: '',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
price: '388',
collected: true,
itemId: 614139753189,
},
{
image: '',
name: '商品名商品名商品名商品名商品名商品名商品名商品商品',
price: '388',
itemId: 617724147979,
},
]
let handel = taskType == 'collectGoods' ? 'getCollectItemList' : 'getItemListByItemIds' // this.setData({
const { success, data } = await API[handel]({ activityId, itemIds }).catch(res => { // goodsList
res && commonToast(res) // })
}) || {} console.log("aaaaaaaaa", taskType)
if(success) { let handel = taskType == 'collectGoods' ? 'getCollectGoodsList' : 'getItemListByItemIds'
this.setData({ goodsList: data || [] }) const {
} success,
}, data
//任务完成 } = await API[handel]({
async onCompleteTask(taskType,itemId) { itemIds
console.log(taskType,itemId) }).catch(res => {
const { activityId } = app res && commonToast(res)
switch(taskType) {
case 'collectGoods':
let { success, data } = await API.doCollectGoodsTask({ activityId, taskType, itemId }).catch(res => {
res && commonToast(res)
}) || {} }) || {}
if(success) { if (success) {
this.initPage() this.setData({
goodsList: data || []
})
} }
break; if(taskType == 'collectGoods'){
case 'browseGoods': this.isCanCompleteCollectTask();
let browsResult = await API.doCollectGoodsTask({ activityId, taskType, itemId }).catch(res => { }
res && commonToast(res) },
}) || {} /**判断收藏商品任务是否完成 */
console.log(browsResult) async isCanCompleteCollectTask(itemId) {
if(browsResult.success) { // let result = await checkGoodsCollectedStatus(itemId);
commonToast('任务完成,请到任务中心查看奖励') // if(!result){
// this.curItemId = itemId;
// this.notCollectGoodsArr.push(itemId);
// }
console.log("判断收藏任务是否完成")
console.log(this.data.goodsList)
const list = this.data.goodsList;
let num = 0;
for (let i = 0; i < list; i++) {
if(list[i].collected){
num++;
if(num>=3){
this.onCompleteTask("collectGoods")
}
}
}
},
//任务完成
async onCompleteTask(taskType, itemId) {
console.log(taskType, itemId)
const {
activityId
} = app
switch (taskType) {
case 'collectGoods':
let {
success, data
} = await API.doCollectGoodsTask({
taskType,
itemId
}).catch(res => {
res && commonToast(res)
}) || {}
if (success) {
this.initPage()
}
break;
case 'browseGoods':
let browsResult = await API.doBrowseGoodsTask({
taskType,
itemId
}).catch(res => {
res && commonToast(res)
}) || {}
console.log(browsResult)
if (browsResult.success) {
commonToast('任务完成,请到任务中心查看奖励')
}
break;
} }
break;
} }
} });
}); \ No newline at end of file
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
"pknoprize-modal": "/components/compknoprizemodal/compknoprizemodal", "pknoprize-modal": "/components/compknoprizemodal/compknoprizemodal",
"pkfailnoprize-modal": "/components/compkfailnoprizemodal/compkfailnoprizemodal", "pkfailnoprize-modal": "/components/compkfailnoprizemodal/compkfailnoprizemodal",
"pksuccessnoprize-modal": "/components/compksuccessnoprizemodal/compksuccessnoprizemodal", "pksuccessnoprize-modal": "/components/compksuccessnoprizemodal/compksuccessnoprizemodal",
"tempitem-modal": "/components/comtempitemmodal/comtempitemmodal" "tempitem-modal": "/components/comtempitemmodal/comtempitemmodal",
"task-modal": "/components/comtask/comtask"
} }
} }
\ No newline at end of file
.canvas { .canvas {
width:100%; width:100%;
height:100%; height:100%;
z-index: 999; z-index: 99;
pointer-events: none; pointer-events: none;
} }
.page-game { .page-game {
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
<image class="pkbtn " src={{resList['bf922d14-54e9-41d2-8c47-281963554715'].url}} /> <image class="pkbtn " src={{resList['bf922d14-54e9-41d2-8c47-281963554715'].url}} />
<image class="assisdebtn btn" onTap="openModal" data-item="inviteList" src={{resList['3ed92e80-21fa-4557-aaf1-92519d445f97'].url}} /> <image class="assisdebtn btn" onTap="openModal" data-item="inviteList" src={{resList['3ed92e80-21fa-4557-aaf1-92519d445f97'].url}} />
<image class="unlockbtn2 " a:if="{{curGameStep<2}}" src={{resList['b167ddb3-23b8-4290-ba90-196bbe63daba'].url}} /> <!-- <image class="unlockbtn2 " a:if="{{curGameStep<2}}" src={{resList['b167ddb3-23b8-4290-ba90-196bbe63daba'].url}} /> -->
<image class="lockbtn2 " a:if="{{curGameStep<2}}" src={{resList['62f291e9-e8c8-40f8-9d4d-a0445f085fdc'].url}} /> <image class="lockbtn2 " a:if="{{curGameStep<2}}" src={{resList['62f291e9-e8c8-40f8-9d4d-a0445f085fdc'].url}} />
<image class="unlockbtn3 " a:if="{{curGameStep<3}}" src={{resList['b167ddb3-23b8-4290-ba90-196bbe63daba'].url}} /> <!-- <image class="unlockbtn3 " a:if="{{curGameStep<3}}" src={{resList['b167ddb3-23b8-4290-ba90-196bbe63daba'].url}} /> -->
<image class="lockbtn3 " a:if="{{curGameStep<3}}" src={{resList['62f291e9-e8c8-40f8-9d4d-a0445f085fdc'].url}} /> <image class="lockbtn3 " a:if="{{curGameStep<3}}" src={{resList['62f291e9-e8c8-40f8-9d4d-a0445f085fdc'].url}} />
<view class="wen_zi2 "> <view class="wen_zi2 ">
...@@ -29,15 +29,22 @@ ...@@ -29,15 +29,22 @@
<image class="rankbtn btn" onTap="navigateTo" data-item="pagepagerank" src={{resList['c57b33fc-8a26-4f7c-9a62-d0d16cae3406'].url}} /> <image class="rankbtn btn" onTap="navigateTo" data-item="pagepagerank" src={{resList['c57b33fc-8a26-4f7c-9a62-d0d16cae3406'].url}} />
<image class="rule btn" onTap="openModal" data-item="rule" src={{resList['8bc27234-3326-4564-9697-31beca682da8'].url}} /> <image class="rule btn" onTap="openModal" data-item="rule" src={{resList['8bc27234-3326-4564-9697-31beca682da8'].url}} />
<image class="myprize btn" onTap="navigateTo" data-item="myprize" src={{resList['49f550d3-50eb-492a-9fe3-79014e2c42a4'].url}} /> <image class="myprize btn" onTap="navigateTo" data-item="myprize" src={{resList['49f550d3-50eb-492a-9fe3-79014e2c42a4'].url}} />
</view> </view>
<view disable-scroll="true" class="page-game"> <view disable-scroll="true" class="page-game">
<canvas disable-scroll="true" id="canvas" class="canvas" onReady="canvasOnReady"> <canvas disable-scroll="true" id="canvas" class="canvas" onReady="canvasOnReady">
</canvas> </canvas>
</view>
</view>
<view class="popcontainer" a:if="{{modalStatus}}"> <view class="popcontainer" a:if="{{modalStatus}}">
<rule-modal a:if="{{modalStatus==1}}" onCloseModal="closeModal"></rule-modal> <rule-modal a:if="{{modalStatus==1}}" onCloseModal="closeModal"></rule-modal>
</view> </view>
<view class="popcontainer_down" a:if="{{modalStatus==2}}"> <view class="popcontainer_down" a:if="{{modalStatus==2}}">
<invitelist-modal a:if="{{modalStatus==2}}" onCloseModal="closeModal"></invitelist-modal> <invitelist-modal a:if="{{modalStatus==2}}" onCloseModal="closeModal"></invitelist-modal>
</view> </view>
<view class="popcontainer" >
<lockstep-modal onCloseModal="closeModal"></lockstep-modal>
</view>
...@@ -136,14 +136,15 @@ Page({ ...@@ -136,14 +136,15 @@ Page({
} = userInfo; } = userInfo;
app.nickName = nickName; app.nickName = nickName;
app.avatar = avatar; app.avatar = avatar;
this.judgeDoHelp(); // this.judgeDoHelp();
// this.login(); this.login();
} }
}, },
/** /**
* 登录接口 * 登录接口
*/ */
async login() { async login() {
my.showLoading();
const { const {
nickName, nickName,
avatar avatar
...@@ -154,10 +155,12 @@ Page({ ...@@ -154,10 +155,12 @@ Page({
userNick: nickName, userNick: nickName,
avatar avatar
}).catch(res => { }).catch(res => {
my.hideLoading();
commonToast(res && res.message); commonToast(res && res.message);
}) || {}; }) || {};
if (success) { if (success) {
my.hideLoading();
this.getActivityBaseInfoById(); this.getActivityBaseInfoById();
} }
}, },
...@@ -182,10 +185,6 @@ Page({ ...@@ -182,10 +185,6 @@ Page({
}, },
/**判断是否是助力 */ /**判断是否是助力 */
judgeDoHelp() { judgeDoHelp() {
setInterval(()=>{
},undefined);
console.log("aaa");
this.updateGameInfo(); this.updateGameInfo();
}, },
......
{ {
"usingComponents": { "usingComponents": {
"rule-modal": "/components/comrulemodal/comrulemodal", "rule-modal": "/components/comrulemodal/comrulemodal",
"invitelist-modal": "/components/cominvitelistmodal/cominvitelistmodal" "invitelist-modal": "/components/cominvitelistmodal/cominvitelistmodal",
"lockstep-modal": "/components/comunlockstepmodal/comunlockstepmodal"
} }
} }
\ No newline at end of file
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
left: 81rpx; left: 81rpx;
top: 1236rpx; top: 1236rpx;
position: absolute; position: absolute;
transform-origin: 0rpx 0rpx 0rpx; transform-origin: 50% 50% 0rpx;
} }
.pagerank .ranktex { .pagerank .ranktex {
width: 596rpx; width: 596rpx;
......
<view class="pagerank "> <view class="pagerank ">
<image class="rankbg " src={{resList['eb407995-cc98-4846-bf45-d7ac37e9037e'].url}} /> <image class="rankbg " src={{resList['eb407995-cc98-4846-bf45-d7ac37e9037e'].url}} />
<image class="rankreturnbtn " src={{resList['071da23d-ca97-4979-91d1-533fe386eef7'].url}} /> <image class="rankreturnbtn btn" onTap="navigateToIndex" src={{resList['071da23d-ca97-4979-91d1-533fe386eef7'].url}} />
<view class="ranktex "> <view class="ranktex ">
<view class="myrank "> <view class="myrank ">
<label class="rankid ">{{myRankInfo.userNick}}</label> <label class="rankid ">{{myRankInfo.userNick}}</label>
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<view class="ranktit2 "> <view class="ranktit2 ">
<label class="ranktit4 ">抱团取暖冲榜赢大奖</label> <label class="ranktit4 ">抱团取暖冲榜赢大奖</label>
<label class="ranktit3 ">赢取清空购物车终极大奖</label> <label class="ranktit3 ">赢取清空购物车终极大奖</label>
<label class="ranktim ">活动时间:2020.10.01-2020.11.11</label> <label class="ranktim ">{{activtyTime}}</label>
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -13,34 +13,69 @@ const { ...@@ -13,34 +13,69 @@ const {
getSystemInfo getSystemInfo
} = tbcc.tb; } = tbcc.tb;
Page({ Page({
data: { data: {
rankList:[], rankList: [],
myRankInfo:{}, myRankInfo: {},
myRank:'' myRank: '',
}, activtyTime: ''
},
onLoad(props) { onLoad(props) {
this.setData({ this.setData({
resList: resList resList: resList
}); });
my.showLoading(); my.showLoading();
this.getRankList(); this.getActivtyTime();
}, this.getRankList();
},
/**获取排行榜 */
async getRankList() {
const {
success,
data
} = await API.getUserRankList().catch(r => {
my.hideLoading();
commonToast(r && r.message);
}) || {};
if (success) {
my.hideLoading();
let myrank = data.myRankInfo.rank >= 500 ? '500+' : data.myRankInfo.rank;
this.setData({
rankList: data.list,
myRankInfo: data.myRankInfo,
myRank: myrank
})
}
},
async getRankList(){ /**获取活动时间 */
const {success,data} = await API.getUserRankList().catch(r=>{ getActivtyTime() {
my.hideLoading(); const {
commonToast(r&&r.message); startTime,
})||{}; endTime
if(success){ } = app.activityInfo;
my.hideLoading(); let startStr = this.getTime1(startTime);
let myrank = data.myRankInfo.rank>=500?'500+':data.myRankInfo.rank; let endStr = this.getTime1(endTime);
this.setData({ this.setData({
rankList:data.list, activtyTime:'活动时间:'+startStr+'-'+endStr
myRankInfo:data.myRankInfo,
myRank:myrank
}) })
},
// 转换时间
getTime1(time) {
const yy = new Date(time).getFullYear();
const mm = new Date(time).getMonth() + 1 + '';
const dd = new Date(time).getDate() + '';
let m = mm.padStart(2, '0');
let d = dd.padStart(2, '0');
const t1 = `${yy}.${m}.${d} `;
let date = t1;
return date;
},
navigateToIndex() {
my.navigateBack();
} }
}
}); });
\ No newline at end of file
...@@ -491,6 +491,49 @@ const resList = { ...@@ -491,6 +491,49 @@ const resList = {
ext: '.png', ext: '.png',
uuid: '78ed2fc7-6125-47e5-8120-15fd90f36c0d', uuid: '78ed2fc7-6125-47e5-8120-15fd90f36c0d',
url: '//yun.duiba.com.cn/spark/assets/e5d745b7b64877323cbe22be1c9e0f7ef00f145c.png' url: '//yun.duiba.com.cn/spark/assets/e5d745b7b64877323cbe22be1c9e0f7ef00f145c.png'
} },
'9c4565f2-d6f8-4a33-9cea-c04c5f3cd7a1': {
name: 'tastDisableBtn',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/tastDisableBtn.cf49568e24ad82bd76ea6e34cb0fcd2809c5102d.png',
uuid: '9c4565f2-d6f8-4a33-9cea-c04c5f3cd7a1'
},
'a37987f0-dcaf-4538-be27-90ebd6e21156-2': {
name: 'battle5Prize',
ext: '.jpg',
url: '//yun.duiba.com.cn/spark/assets/battle5Prize.41a119c76c81b8bd6573fa896ea97f93012d1152.jpg',
uuid: 'a37987f0-dcaf-4538-be27-90ebd6e21156-2'
},
'a37987f0-dcaf-4538-be27-90ebd6e21156-3': {
name: 'battle7Prize',
ext: '.jpg',
url: '//yun.duiba.com.cn/spark/assets/battle7Prize.3dee8d1b75ebb1123be947ce899baa089b00d18f.jpg',
uuid: 'a37987f0-dcaf-4538-be27-90ebd6e21156-3'
},
'e41300b7-bee4-4224-9f12-7a8513ce8fe9': {
name: 'tempItem',
ext: '.jpg',
url: '//yun.duiba.com.cn/spark/assets/tempItem.bbfdc4aba5cb3e614da1c2cc07af0b64973c94f8.jpg',
uuid: 'e41300b7-bee4-4224-9f12-7a8513ce8fe9'
},
'cae8e0bb-e05f-4bc7-b77d-24b9f1e9492c': {
name: 'unlockstepBg',
ext: '.png',
uuid: 'cae8e0bb-e05f-4bc7-b77d-24b9f1e9492c',
url: '//yun.duiba.com.cn/spark/assets/3a99ad2efd6aa7b74eaf584c20115af1918f0992.png'
},
'3078345c-9a38-4d1f-9361-eb7a2587d99e': {
name: 'unlockstepbtn',
ext: '.png',
uuid: '3078345c-9a38-4d1f-9361-eb7a2587d99e',
url: '//yun.duiba.com.cn/spark/assets/247ca5d4a478f800713a5e46ec59bf9fdaafc09d.png'
},
'90b5f539-4c56-4210-937e-8dd359fbb2b0': {
name: 'unlockstepclose',
ext: '.png',
uuid: '90b5f539-4c56-4210-937e-8dd359fbb2b0',
url: '//yun.duiba.com.cn/spark/assets/e277525ee0fc79fd8ba839f2787c58dc4c94421b.png'
},
}; };
export default resList; export default resList;
\ No newline at end of file
This diff is collapsed.
{
"success": true,
"message": "mollit ullamco reprehenderit Lorem",
"code": "proident",
"data": {
"_id": "aliquip eiusmod incididunt sed in",
"itemId": 64428322.20401496,
"createTime": 1598358838171,
"openId": "esse ad",
"deleteStatus": -23608916.698887765,
"rule": "ea tempor",
"startTime": 1603618015419,
"updateTime": 1615179172515,
"endTime": 1605377741394,
"title": "aute cillum veniam sint",
"awardReceiveExpiredTime": 1611557075775
}
}
\ No newline at end of file
{
"success": true,
"data": [
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": true
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": true
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": true
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
}
]
}
\ No newline at end of file
{
"success": true,
"data": [
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
},
{
"image": "",
"name": "商品名商品名商品名商品名商品名商品名商品名商品商品",
"price": "388",
"itemId": 617724147979,
"collected": false
}
]
}
\ No newline at end of file
{
"success": true,
"code": "nulla laborum",
"data": [
{
"taskType": "follow",
"title": "关注蕉内店铺",
"rewards": 2,
"taskRateType": 2,
"waitReceive": 3069919.1181313694,
"status": 3,
"completeTimes": 1,
"times": "3",
"todayCompleteTimes": 50139175.796117544,
"itemIds": "fugiat et magna",
"url": "commodo incididunt in sunt"
},
{
"taskType": "sign",
"title": "每日登录",
"rewards": 2,
"taskRateType": 2,
"waitReceive": -37886750.95893747,
"status": 1,
"completeTimes": 1,
"times": "3",
"todayCompleteTimes": 11323128.027142286,
"itemIds": "tempor sunt consequat consectetur ipsum",
"url": "laborum ad ex"
},
{
"taskType": "browseGoods",
"title": "浏览指定页面",
"rewards": 2,
"taskRateType": 2,
"waitReceive": -5871225.0604195,
"status": 1,
"completeTimes": 1,
"times": "3",
"todayCompleteTimes": -92181455.51032442,
"itemIds": "ullamco enim ipsum eu",
"url": "irure sed"
},
{
"taskType": "collectGoods",
"title": "收藏商品",
"rewards": 2,
"taskRateType": 2,
"waitReceive": 26400312.822579414,
"status": 1,
"completeTimes": 3,
"times": "3",
"todayCompleteTimes": 76741045.15144086,
"itemIds": "ullamco",
"url": "nisi occaecat aute sit ut"
}
],
"message": "sit tempor anim"
}
\ No newline at end of file
{
"code": -94257443.72901161,
"success": true,
"data": {
"inviteStep": "veniam nostrud",
"openId": "consectetur",
"inviteId": "dolor minim adipisicing laboris amet"
}
}
\ No newline at end of file
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