Commit 441901c2 authored by 任建锋's avatar 任建锋

--

parent a37e1adb
......@@ -153,6 +153,11 @@ const apiList = {
method: 'get',
isShowLoading: false
},
doGiftCard: {
handle: 'doGiftCard',
method: 'get',
isShowLoading: false
},
/**获取用户信息 */
getUserInfo: {
handle: 'getUserInfo',
......
......@@ -8,7 +8,7 @@ cloud.init({
App({
env,
requestType: 'cloud', // cloud,cloud: 云函数
requestType: 'cloud', // yapi,cloud: 云函数
// requestType: 'local', // yapi,cloud: 云函数
cloudName: 'collectCard', // 主云函数项目名 tmallCat
// cloudName: 'bubbleSurviva', // 主云函数项目名 tmallCat
......
<view class="getcardpanel ">
<view class={{showCardBody?"p_show":"p_hide"}}>
<image class="dim51 " src={{resList['8c31274b-1016-4b8c-b413-9fc98174e118'].url}} />
<image class="xi_you_qia_dim50 " src={{resList['a47a9645-1d0d-482b-af10-154def15e9f9'].url}} />
<text class="getcardtitle comWinTitle" a:if={{doJoinData.isNewCard&&doJoinData.drawLotteryStatus==1}}> 运气爆棚!\n解锁一张新卡牌</text>
<text class="getcardtitle comWinTitle" a:if={{doJoinData.isNewCard&&doJoinData.drawLotteryStatus==2}}> 恭喜你解锁{{doJoinData.cardTypeCollectedCount}}张卡牌</text>
<text class="getcardtitle comWinTitle" a:if={{!doJoinData.isNewCard}}> 恭喜你获得以下卡牌</text>
<text class="getcardtitle comWinTitle" a:if={{doJoinData.isNewCard&&doJoinData.drawLotteryStatus==1}}>运气爆棚!\n解锁一张新卡牌</text>
<text class="getcardtitle comWinTitle" a:if={{doJoinData.isNewCard&&doJoinData.drawLotteryStatus==2}}>恭喜你解锁{{doJoinData.cardTypeCollectedCount}}张卡牌</text>
<text class="getcardtitle comWinTitle" a:if={{!doJoinData.isNewCard}}>恭喜你获得以下卡牌</text>
<view class="fu_biao_ti45 ">
<image class="yuan_jiao_ju368847 " src={{resList['d7329665-f4f6-42bc-ab46-0af63a0837eb'].url}} />
<text class="getcardcontenttext ">再抽取{{doJoinData.restCardTypeCount}}张不同卡牌即可领取奖励</text>
<text class="getcardcontenttext fontVerticalCenter" a:if={{doJoinData.drawLotteryStatus==2}}>获得1次抽卡机会</text>
<text class="getcardcontenttext fontVerticalCenter" a:if={{doJoinData.drawLotteryStatus==1}}>再抽取{{doJoinData.restCardTypeCount}}张不同卡牌即可领取奖励</text>
</view>
<view class="getcardclosebtn " onTap="hiddenPanelEvent" data-value="{{'getcardpanel'}}"></view>
<image class="getcardimg " src={{doJoinData.image}} />
......
......@@ -24,3 +24,7 @@
top: 0!important;
position: fixed!important;
}
.getcardpanel .fu_biao_ti45 .getcardcontenttext{
top:0 !important;
height: 41rpx !important;
}
\ No newline at end of file
......@@ -36,7 +36,8 @@ Component({
let GiftCard = await API.getGiftCard({
activityId,
type:DataCenter.givingCardData.cardType,
inviteId:DataCenter.givingCardData.cardId
inviteId:DataCenter.givingCardData.cardId,
giftId:DataCenter.givingCardData.giftId
}).catch(res => {
if(res&&res.code=="430008"){
//不能领取自己的卡片
......
......@@ -2,7 +2,7 @@
<image class="dim85 " src={{resList['c22d4fcc-ebd6-463b-82d7-fb5b872b79da'].url}} />
<image class="helpnoneprizealsobtn " onTap="hiddenPanelEvent" data-value="helpnoneprizepanel" src={{resList['cedeaa81-51f0-488f-a1de-92d14c84cffc'].url}} />
<view class="xiao_biao_ti83 ">
<text class="hen_yi_han_ni_lai_wan_la_jiang_pin_liu_zou_la ">很遗憾,你来晚啦 奖品溜走啦......</text>
<text class="hen_yi_han_ni_lai_wan_la_jiang_pin_liu_zou_la ">很遗憾,你来晚啦\n奖品溜走啦......</text>
</view>
<image class="helpnoneprizeclosebtn " onTap="hiddenPanelEvent" data-value="helpnoneprizepanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
'use strict';
import { DataCenter } from '../../DataCenter';
import { BuriedClick, BuriedType, DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList';
const app = getApp();
const { tbcc } = app;
import API from '../../api';
import events from '../../events';
const { commonToast, getAuthUserInfo, navigateToOutside,favorShop} = tbcc.tb;
Component({
props: {},
data: {},
methods: {
hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e);
},
//领取奖励
async taskAutoPrize(taskType){
const { activityId } = getApp();
events.emit("doDisibleAll",true)
let receiveTaskRewards = await API.receiveTaskRewards({ activityId,taskType,rewardsKey:"gameTimes" }).catch(res => {
commonToast(res && res.message);
}) || {};
events.emit("doDisibleAll",false)
}
},
didMount(props) {
......@@ -15,5 +29,6 @@ Component({
resList: resList,
ShareInfo:DataCenter.ShareInfo
});
this.taskAutoPrize("invites")
}
});
\ No newline at end of file
......@@ -11,7 +11,7 @@
<image class="mccardimg " src={{item.image}} />
<view class="mccardcount ">
<image class="wo_de_qia_pai_shu_liang_bei_jing_huang9 " src={{resList['f75d533c-113b-4717-8411-ea37d224a9c0'].url}} />
<text class="mccardcounttext fontVerticalCenter">{{item.count}}</text>
<text class="mccardcounttext fontVerticalCenter">{{item.count>99?"99+":item.count}}</text>
</view>
</view>
</view>
......
......@@ -2,6 +2,12 @@
import { DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList';
const app = getApp();
const { tbcc } = app;
import API from '../../api';
import events from '../../events';
const { commonToast, getAuthUserInfo, navigateToOutside,favorShop} = tbcc.tb;
Component({
props: {},
data: {},
......@@ -10,10 +16,20 @@ Component({
this.props.onTapHiddenPanelEvent(e);
},
//点击赠送卡片按钮
onTapMcGivingBtn(e){
async onTapMcGivingBtn(e){
DataCenter.cardType=e.target.dataset.value;
const { activityId } = getApp();
//获取活动基础信息
events.emit("doDisibleAll",true)
let GiftCard = await API.doGiftCard({ activityId,type:DataCenter.cardType}).catch(res => {
commonToast(res && res.message);
}) || {};
events.emit("doDisibleAll",false)
if(GiftCard&&GiftCard.success){
DataCenter.giftId=GiftCard.data.giftId;
this.props.onGivingCard()
}
}
},
didMount(props) {
let {
......
/* 程序样式 */
@import './your.acss';
.prizetipspanel {
width: 564rpx;
height: 575rpx;
......
<view class="prizetipspanel " >
<text class="zheng_zai_jin_xing_zhong comWinTitle">正在进行中...</text>
<text class="prizetipsnumberremainingtext comWinTitle">(剩余{{CollectCardInfo.cardTypeCount-CollectCardInfo.cardTypeCollectedCount}}张解锁奖励)</text>
<text class="prizetipsprize1text ">{{prizeList[0].name}}</text>
<text class={{!prizeList[1]?"prizetipsprize1text prizetipsprize1textOne":"prizetipsprize1text"}}>{{prizeList[0].name}}</text>
<text class="prizetipsprize2text ">{{prizeList[1].name}}</text>
<image class="prizetipsclosebtn " onTap="hiddenPanelEvent" data-value="prizetipspanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
<image class="prizetipsprize1 " src={{prizeList[0].image}} />
<image class="prizetipsprize2 " src={{prizeList[1].image}} />
<text class="prizetipstips ">数量有限,先到先得</text>
<image class={{!prizeList[1]?"prizetipsprize1 prizetipsprize1One":"prizetipsprize1"}} src={{prizeList[0].image}} />
<image class="prizetipsprize2" src={{prizeList[1].image}} />
<text class={{!prizeList[1]?"prizetipstips prizetipstipsOne":"prizetipstips"}}>数量有限,先到先得</text>
</view>
\ No newline at end of file
.prizetipspanel .prizetipsprize1One{
left:140rpx !important;
}
.prizetipspanel .prizetipsprize1textOne {
left: 1.46rem !important;
}
.prizetipspanel .prizetipstipsOne {
left: 1.12rem !important;
}
\ No newline at end of file
......@@ -6,13 +6,13 @@
<image class="taskicon " src={{localData[item.taskType].icon}} />
<view a:if(item.status=="1")>
<!-- 去购买 -->
<!-- 下单去购买 -->
<image class="tasknonebuybtn "
a:if={{(item.taskType==="orderGoods")}}
onTap="onTapTaskNoneGotoBtn"
data-value={{item}}
src={{resList['befa9414-7e21-4e4a-a4d6-d42324525cd2'].url}} />
<!-- 去购买 -->
<!-- 定金去购买 -->
<image class="tasknonebuybtn "
a:elif={{(item.taskType==="orderDepositGoods")}}
onTap="onTapTaskNoneGotoBtn"
......@@ -26,10 +26,22 @@
src={{resList['ba2793d6-94cd-4fe1-ae3d-11278e0a66f8'].url}} />
<!-- 去浏览 -->
<image class="tasknonetobrowsebtn "
a:elif={{(item.taskType==="jumpLink")}}
a:elif={{(item.taskType==="browseGoods")}}
onTap="onTapTaskNoneGotoBtn"
data-value={{item}}
src={{resList['8473ab9f-df8e-4c4e-b249-8d1cad9f04ae'].url}} />
<!-- 去邀请 -->
<image class="tasknonegotobtn "
a:elif={{(item.taskType==="invites")}}
onTap="onTapTaskNoneGotoBtn"
data-value={{item}}
src={{resList['ca0d98f5-5e4c-43ff-a2a9-b3a02548c9f7'].url}} />
<!-- 去加入 -->
<image class="tasknonegotobtn "
a:elif={{(item.taskType==="member")}}
onTap="onTapTaskNoneGotoBtn"
data-value={{item}}
src={{resList['34e9a26b-6288-4779-8eef-ad3698aab8df'].url}} />
<!-- 去完成 -->
<image class="tasknonegotobtn "
a:else
......
......@@ -63,9 +63,11 @@ Component({
const { activityId } = getApp();
//获取活动基础信息
let taskType=e.target.dataset.value;
events.emit("doDisibleAll",true)
let receiveTaskRewards = await API.receiveTaskRewards({ activityId,taskType,rewardsKey:"gameTimes" }).catch(res => {
commonToast(res && res.message);
}) || {};
events.emit("doDisibleAll",false)
if(receiveTaskRewards&&receiveTaskRewards.success){
commonToast(`任务完成,翻牌次数+${receiveTaskRewards.data.rewards}`);
await this.updateData()
......@@ -75,14 +77,18 @@ Component({
async onTapTaskNoneToFocusbtn(e){
const { activityId } = getApp();
console.log("app.sellerId",app.sellerId)
events.emit("doDisibleAll",true)
const favorStatus = await favorShop(app.sellerId).catch(err => {
console.log('关注店铺失败', err);
});
events.emit("doDisibleAll",false)
if(favorStatus){
let taskType=e.target.dataset.value;
events.emit("doDisibleAll",true)
let doCompleteTask = await API.doCompleteTask({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
events.emit("doDisibleAll",false)
if(doCompleteTask&&doCompleteTask.success){
commonToast("关注成功");
await this.updateData()
......@@ -127,9 +133,11 @@ Component({
//加群任务
async groupChatTask(taskType,url){
const { activityId } = getApp();
events.emit("doDisibleAll",true)
let doCompleteTask = await API.doCompleteTask({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
events.emit("doDisibleAll",false)
await this.updateData()
if(doCompleteTask&&doCompleteTask.success){
my.navigateTo({
......@@ -140,9 +148,11 @@ Component({
//跳转任务
async jumpLinkTask(taskType,url){
const { activityId } = getApp();
events.emit("doDisibleAll",true)
let doCompleteTask = await API.doCompleteTask({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
events.emit("doDisibleAll",false)
await this.updateData()
if(doCompleteTask&&doCompleteTask.success){
my.navigateTo({
......@@ -153,9 +163,11 @@ Component({
//加入会员
async memberTask(taskType,url){
const { activityId } = getApp();
events.emit("doDisibleAll",true)
let doCompleteTask = await API.doCompleteTask({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
events.emit("doDisibleAll",false)
await this.updateData()
if(doCompleteTask&&doCompleteTask.success){
my.navigateTo({
......@@ -170,9 +182,11 @@ Component({
//更新任务列表
async updateData(){
const { activityId } = getApp();
events.emit("doDisibleAll",true)
let TaskList = await API.getTaskList({ activityId }).catch(res => {
commonToast(res && res.message);
}) || {};
events.emit("doDisibleAll",false)
if(TaskList&&TaskList.success){
DataCenter.TaskList=TaskList.data.list;
this.setData({
......
......@@ -58,6 +58,7 @@ Page({
this.inviteId = query.inviteId;
this.cardId = query.cardId;
this.cardType = query.cardType;
this.giftId = query.giftId;
DataCenter.doDisibleAll=this.doDisibleAll;
//缓存全局资源
......@@ -198,10 +199,11 @@ Page({
},
//页面如果包含赠卡行为则弹出赠卡弹窗
isGivingCard(){
if (this.cardId&&this.cardType) {
if (this.cardId&&this.cardType&&this.giftId) {
DataCenter.givingCardData={
cardId:this.cardId,
cardType:this.cardType
cardType:this.cardType,
giftId:this.giftId
}
this.showPanel("givingcardpanel")
}
......@@ -298,6 +300,7 @@ Page({
if(DataCenter.ShareInfo&&DataCenter.ShareInfo.rewards>0){
this.showPanel("invitesuccesspanel")
}
this.resetShare()
},
//需要卡牌种类的数量
onTapUnlockPrizesItem(e){
......@@ -355,6 +358,18 @@ Page({
shareSubtitle:DataCenter.BaseInfo.shareSubtitle
}
my.showSharePanel();
setTimeout(()=>{
this.resetShare()
},500)
},
resetShare(){
DataCenter.shareType="invite";
DataCenter.shareData={
shareImage:DataCenter.BaseInfo.tasks.invites.shareImage,
shareTitle:DataCenter.BaseInfo.tasks.invites.shareTitle,
shareSubtitle:DataCenter.BaseInfo.tasks.invites.shareSubtitle
}
},
//阶梯奖励抽奖
async drawLotteryPrize(prizeDataType,need){
......@@ -565,7 +580,7 @@ Page({
path += '?inviteId=' + app.openId;
}else if(app.openId&&DataCenter.shareType=="givingCard") {
//如果是赠卡行为
path += '?cardId=' + app.openId+'&cardType='+DataCenter.cardType;
path += '?cardId=' + app.openId+'&cardType='+DataCenter.cardType+'&giftId='+DataCenter.giftId;
}
return {
...rest,
......
......@@ -329,12 +329,6 @@ const resList = {
uuid: 'e670f6a8-3dee-493b-a55f-c61229c85cb5',
url: '//yun.duiba.com.cn/spark/assets/867c357779cb92b0326f41662cccf907c5f9329d.png'
},
'6ec4da36-beba-4eea-ba56-e5d59c1e77dd': {
name: '图标m',
ext: '.png',
uuid: '6ec4da36-beba-4eea-ba56-e5d59c1e77dd',
url: '//yun.duiba.com.cn/spark/assets/42532b81ed255b9e6c0f18bc110a109f9d439e95.png'
},
'befa9414-7e21-4e4a-a4d6-d42324525cd2': {
name: '去购买m',
ext: '.png',
......@@ -562,6 +556,120 @@ const resList = {
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/8ec0442a36a6d59685245ba9742d39b7366e18bb.png',
uuid: '7441ff80-fd13-40de-b4db-9e5d3c013b9b'
},
'63419b94-9002-40af-957f-2d737c47f221': {
name: '图标4',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/1e0b9df36f66d0c7387118ea9302bc5c0b889d1e.png',
uuid: '63419b94-9002-40af-957f-2d737c47f221'
},
'9fc10b1d-f837-42f5-ade0-d2e5a00eaf88': {
name: '图标9',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/cd21972ddfd45755dddd76ff2990755dd03cfadb.png',
uuid: '9fc10b1d-f837-42f5-ade0-d2e5a00eaf88'
},
'f51b064b-2e90-40cc-b8c3-d9508363afc5': {
name: '图标13',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/4f9f7caae773c7c4e26021814b2627e8039f8429.png',
uuid: 'f51b064b-2e90-40cc-b8c3-d9508363afc5'
},
'3dfa4023-a302-4136-b88e-936299a0af11': {
name: '图标52',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/7d716f04bf882a49407954ac90c1f078eff7610b.png',
uuid: '3dfa4023-a302-4136-b88e-936299a0af11'
},
'61a98c20-7c6f-44e8-bb70-d16489322c03': {
name: '图标44',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/e9d9910c4a908087582fa47cb78d4f9494d05a7f.png',
uuid: '61a98c20-7c6f-44e8-bb70-d16489322c03'
},
'c87592fc-8b9e-474e-b61e-c034819f3fd3': {
name: '图标36',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/17f4fce77b429659bedfdcd340c9afa0eb1add6f.png',
uuid: 'c87592fc-8b9e-474e-b61e-c034819f3fd3'
},
'1372da7a-bb7c-43fe-be8c-d0cd71804869': {
name: '图标22',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/baafb1f67edc52f284a85b8a8323dfc5efe3801b.png',
uuid: '1372da7a-bb7c-43fe-be8c-d0cd71804869'
},
'566126bd-aec8-4e43-b1c0-bdf30f37a88a': {
name: '图标29',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/f13484038dd0f510d4ffa3c5139b0e4c5eca72f5.png',
uuid: '566126bd-aec8-4e43-b1c0-bdf30f37a88a'
},
'a8208dec-0e2c-4fae-84a5-f0a3a1aa84b3': {
name: '按钮状态',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/e158e8c9d0343f2beee909820a3948f52c00d19e.png',
uuid: 'a8208dec-0e2c-4fae-84a5-f0a3a1aa84b3'
},
'83bfcd16-3715-4043-a8b4-e6c32fbf0ad2': {
name: 'logisticsBth',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/743acdfa0d596a0d2d04b989e84b756a587a8235.png',
uuid: '83bfcd16-3715-4043-a8b4-e6c32fbf0ad2'
},
'a4be81bc-3b50-443b-b737-e036a5408e0e': {
name: 'getBth',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/f710c4170feac9e38992c7b79df8b20dffa151d6.png',
uuid: 'a4be81bc-3b50-443b-b737-e036a5408e0e'
},
'153bcdf7-c637-4f0c-ae90-e7624fa589da': {
name: 'addressBth',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/a1f0d3f252236a599d0dc37d04f9abf1167b0afd.png',
uuid: '153bcdf7-c637-4f0c-ae90-e7624fa589da'
},
'4b55f9db-386a-418d-960c-994665757af9': {
name: 'invalidBtn',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/cfc0a1ecb5f5fc1465058861102430a708d75f34.png',
uuid: '4b55f9db-386a-418d-960c-994665757af9'
},
'9d785f8e-5a92-4c6f-8c34-aa66c42b4c02': {
name: '已领取',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/54b4d0638d4da4a438a5fee5cbf826f4cb832883.png',
uuid: '9d785f8e-5a92-4c6f-8c34-aa66c42b4c02'
},
'e14ed59b-73af-40ec-b54d-ae8989e45ce6': {
name: 'useBtn',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/1f00b5a8dd5a24529eb3e11227b0d661e7bc5cf9.png',
uuid: 'e14ed59b-73af-40ec-b54d-ae8989e45ce6'
},
'55080417-7ed5-49aa-a94a-eb2c64a11a7e': {
name: '标题__m',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/3a8e39ddef151ce8583508d40d2916715beb7dd6.png',
uuid: '55080417-7ed5-49aa-a94a-eb2c64a11a7e'
},
'9f60b016-2bce-4869-b25c-1b25808d9219': {
name: 'copyIcon',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/7ac9b1ca4bdea23b5f8b69b46e373900d56562e2.png',
uuid: '9f60b016-2bce-4869-b25c-1b25808d9219'
},
'ca0d98f5-5e4c-43ff-a2a9-b3a02548c9f7': {
name: '去邀请',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/9865da63a5cada15dcb794c00192405376dd8ac3.png',
uuid: 'ca0d98f5-5e4c-43ff-a2a9-b3a02548c9f7'
},
'34e9a26b-6288-4779-8eef-ad3698aab8df': {
name: '去加入',
ext: '.png',
url: '//yun.duiba.com.cn/spark/assets/85c30f739eeb5a28b9d717f70c6f8266d1ffb95d.png',
uuid: '34e9a26b-6288-4779-8eef-ad3698aab8df'
}
};
export default resList;
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