Commit 707e931e authored by 任建锋's avatar 任建锋

赠卡和分享

parent c12fe143
{
"current": 1,
"modes": [
{
"title": "邀请",
"page": "pages/pageindexpage/pageindexpage",
"pageQuery": "inviteId=123"
},
{
"title": "赠卡",
"page": "pages/pageindexpage/pageindexpage",
"pageQuery": "cardId=12&cardType=1"
}
]
}
\ No newline at end of file
......@@ -113,6 +113,11 @@ const apiList = {
method: 'get',
isShowLoading: false
},
getShareInfo: {
handle: 'getShareInfo',
method: 'get',
isShowLoading: false
},
/**获取用户信息 */
getUserInfo: {
handle: 'getUserInfo',
......
<view class="givingcardpanel ">
<image class="dim6 " src={{resList['3474c828-84f0-4513-b32d-d1987a7d5e58'].url}} />
<image class="getgivingcardbtn " src={{resList['d3f306d2-fe7d-4167-8ce4-912b1e1f0782'].url}} />
<image class="wow_kao_bei " src={{resList['81c19179-8097-44d0-a296-5f89f3f77f70'].url}} />
<image class="givingcardimg " src={{resList['a6454fc5-1d34-4a29-9c0a-18cbe5454f19'].url}} />
<image class="givingcardclosebtn " src={{resList['17952009-08e1-4439-b51f-3e4e1e66333f'].url}} />
</view>
\ No newline at end of file
<image class="dim6 " src={{resList['3474c828-84f0-4513-b32d-d1987a7d5e58'].url}} />
<image class="getgivingcardbtn " src={{resList['d3f306d2-fe7d-4167-8ce4-912b1e1f0782'].url}} />
<image class="wow_kao_bei " src={{resList['81c19179-8097-44d0-a296-5f89f3f77f70'].url}} />
<image class="givingcardimg " src={{cardUrl}} />
<image class="givingcardclosebtn " onTap="hiddenPanelEvent" data-value="givingcardpanel" src={{resList['17952009-08e1-4439-b51f-3e4e1e66333f'].url}} />
</view>
\ No newline at end of file
'use strict';
import { DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList';
const app = getApp();
const { tbcc } = app;
import API from '../../api';
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Component({
props: {},
data: {},
methods: {},
onInit(props) {
methods: {
hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e);
},
async setCardUrl(){
const { activityId } = getApp();
let MyCardsInfo = await API.getMyCardsInfo({ activityId }).catch(res => {
commonToast(res && res.message);
}) || {};
if(MyCardsInfo&&MyCardsInfo.success){
for(let item of MyCardsInfo.data.list){
if(item.type== DataCenter.givingCardData.cardType){
this.setData({
cardUrl:item.image
})
}
}
}
}
},
didMount(props) {
this.setData({
resList: resList
resList: resList,
});
this.setCardUrl()
}
});
\ No newline at end of file
/* 程序样式 */
@import './your.acss';
.helpnoneprizepanel {
width: 739rpx;
height: 846rpx;
......
<view class="helpnoneprizepanel ">
<image class="dim85 " src={{resList['c22d4fcc-ebd6-463b-82d7-fb5b872b79da'].url}} />
<image class="helpnoneprizealsobtn " src={{resList['cedeaa81-51f0-488f-a1de-92d14c84cffc'].url}} />
<view class="xiao_biao_ti83 ">
<span class="hen_yi_han_ni_lai_wan_la_jiang_pin_liu_zou_la ">很遗憾,你来晚啦 奖品溜走啦......</span>
</view>
<image class="helpnoneprizeclosebtn " src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
<image class="dim85 " src={{resList['c22d4fcc-ebd6-463b-82d7-fb5b872b79da'].url}} />
<image class="helpnoneprizealsobtn " 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>
</view>
<image class="helpnoneprizeclosebtn " onTap="hiddenPanelEvent" data-value="helpnoneprizepanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
......@@ -4,11 +4,14 @@ import resList from '../../resconfig/resList';
Component({
props: {},
data: {},
methods: {},
onInit(props) {
methods: {
hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e);
}
},
didMount(props) {
this.setData({
resList: resList
resList: resList,
});
}
......
.helpnoneprizepanel{
height:1046rpx !important;
}
\ No newline at end of file
<view class="helppanel ">
<image class="dim13312 " src={{resList['855ea4d3-b407-4396-abcb-0eeeff27f6b0'].url}} />
<image class="helpbtn " src={{resList['2fea2f5b-cd74-4de1-a0cd-d829e1ca8c3a'].url}} />
<image class="helpclosebtn " src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
<image class="dim13312 " src={{resList['855ea4d3-b407-4396-abcb-0eeeff27f6b0'].url}} />
<image class="helpbtn " onTap="onTapHelpBtn" data-value="helppanel" src={{resList['2fea2f5b-cd74-4de1-a0cd-d829e1ca8c3a'].url}} />
<image class="helpclosebtn " onTap="hiddenPanelEvent" data-value="helppanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
'use strict';
import resList from '../../resconfig/resList';
Component({
props: {},
data: {},
methods: {},
onInit(props) {
methods: {
hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e);
},
onTapHelpBtn(e){
this.props.onTapHiddenPanelEvent(e);
this.props.onIndexDoHelp();
}
},
didMount(props) {
this.setData({
resList: resList
resList: resList,
});
}
......
/* 程序样式 */
@import './your.acss';
.helpprizepanel {
width: 739rpx;
height: 954rpx;
......
<view class="helpprizepanel ">
<image class="dim91 " src={{resList['12e4a261-7106-4bec-b9e9-6df026fcd440'].url}} />
<image class="helpprizealsojoinbtn " src={{resList['27a7f1d2-f272-4f12-8ff5-2cde96d149fd'].url}} />
<view class="xiao_biao_ti88 ">
<span class="gong_xi_ni_huo_de_yi_xia_jiang_li ">恭喜你获得以下奖励</span>
<span class="jiang_pin_yi_fa_fang_ke_zai_jiang_pin_zhong_cha_kan89 ">奖品已发放,可在【奖品】中查看</span>
</view>
<image class="helpprizeimg " src={{resList['944dc7c0-cd64-4901-a9aa-e85f3d8e97a8'].url}} />
<image class="helpprizepanelclosebtn " src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
<image class="dim91 " src={{resList['12e4a261-7106-4bec-b9e9-6df026fcd440'].url}} />
<image class="helpprizealsojoinbtn " src={{resList['27a7f1d2-f272-4f12-8ff5-2cde96d149fd'].url}} />
<view class="xiao_biao_ti88 ">
<text class="gong_xi_ni_huo_de_yi_xia_jiang_li ">恭喜你获得以下奖励</text>
<text class="jiang_pin_yi_fa_fang_ke_zai_jiang_pin_zhong_cha_kan89 ">奖品已发放,可在【奖品】中查看</text>
</view>
<image class="helpprizeimg " src={{doHelp.image}} />
<image class="helpprizepanelclosebtn " onTap="hiddenPanelEvent" data-value="helpprizepanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
'use strict';
import { DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList';
Component({
props: {},
data: {},
methods: {},
onInit(props) {
methods: {
hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e);
}
},
didMount(props) {
this.setData({
resList: resList
});
resList: resList,
doHelp: DataCenter.doHelp,
});
}
});
\ No newline at end of file
.helpprizepanel{
height:1254rpx !important;
}
\ No newline at end of file
/* 程序样式 */
@import './your.acss';
.invitesuccesspanel {
width: 739rpx;
height: 846rpx;
......
<view class="invitesuccesspanel ">
<image class="dim81 " src={{resList['111c9125-e420-4da8-8a2a-ece402a8407d'].url}} />
<view class="invitesuccesstitle ">
<span class="cheng_gong_yao_qingx_ming_hao_you ">成功邀请X名好友</span>
</view>
<image class="invitecontinueplaybtn " src={{resList['464252af-98b7-4451-8331-b3d5f9be3a5d'].url}} />
<span class="chi_da_jiang_jin_yi_bu_zhi_yao78 ">离大奖仅一步之遥</span>
<view class="xiao_biao_ti77 ">
<span class="fan_pai_ci_shu ">翻牌次数</span>
<span class="invitesuccesscount ">+ X</span>
</view>
<image class="invitesuccessclosebtn " src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
<image class="dim81 " src={{resList['111c9125-e420-4da8-8a2a-ece402a8407d'].url}} />
<view class="invitesuccesstitle ">
<text class="cheng_gong_yao_qingx_ming_hao_you ">成功邀请X名好友</text>
</view>
<image class="invitecontinueplaybtn " src={{resList['464252af-98b7-4451-8331-b3d5f9be3a5d'].url}} />
<text class="chi_da_jiang_jin_yi_bu_zhi_yao78 ">离大奖仅一步之遥</text>
<view class="xiao_biao_ti77 ">
<text class="fan_pai_ci_shu ">翻牌次数</text>
<text class="invitesuccesscount ">+ {{ShareInfo.rewards}}</text>
</view>
<image class="invitesuccessclosebtn " onTap="hiddenPanelEvent" data-value="invitesuccesspanel" src={{resList['878b3751-e6b3-4ae6-9811-77e938801873'].url}} />
</view>
\ No newline at end of file
'use strict';
import { DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList';
Component({
props: {},
data: {},
methods: {},
onInit(props) {
methods: {
hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e);
}
},
didMount(props) {
this.setData({
resList: resList
resList: resList,
ShareInfo:DataCenter.ShareInfo
});
}
});
\ No newline at end of file
.invitesuccesspanel{
height:1146rpx !important;
}
\ No newline at end of file
......@@ -6,8 +6,8 @@
<view class="mycarditembody ">
<image class="mcbgdisable " src={{resList['baba4718-16a8-4a77-a052-53af708bbb21'].url}} />
<image class="mcbg " src={{resList['8b2f6c1d-1fbd-4c64-b9a9-43549adbb472'].url}} />
<image class="mcgivingbtndisable " a:if={{giftCardStatus==2}} src={{resList['776b0825-6538-4ea4-8814-50149644f3bc'].url}} />
<image class="mcgivingbtn " a:if={{giftCardStatus==2}} src={{resList['9d853465-431f-407e-963c-97a0e2ce74da'].url}} />
<image class="mcgivingbtndisable " a:if={{giftCardStatus==2&&item.count<2}} src={{resList['776b0825-6538-4ea4-8814-50149644f3bc'].url}} />
<image class="mcgivingbtn " a:if={{giftCardStatus==2&&item.count>1}} onTap="onTapMcGivingBtn" data-value={{item.type}} src={{resList['9d853465-431f-407e-963c-97a0e2ce74da'].url}} />
<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}} />
......
......@@ -8,6 +8,10 @@ Component({
methods: {
hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e);
},
onTapMcGivingBtn(e){
DataCenter.cardType=e.target.dataset.value;
this.props.onGivingCard()
}
},
didMount(props) {
......
......@@ -5,27 +5,33 @@
<image class="dim8 " src={{resList['e670f6a8-3dee-493b-a55f-c61229c85cb5'].url}} />
<image class="taskicon " src={{localData[item.taskType].icon}} />
<view a:if(item.status=="3")>
<view a:if(item.status=="1")>
<!-- 去购买 -->
<image class="tasknonebuybtn "
a:if=={{(item.taskType=="orderGoods"||item.taskType=="orderDepositGoods")}}
a:if={{(item.taskType==="orderGoods")}}
src={{resList['befa9414-7e21-4e4a-a4d6-d42324525cd2'].url}} />
<!-- 去购买 -->
<image class="tasknonebuybtn "
a:elif={{(item.taskType==="orderDepositGoods")}}
src={{resList['befa9414-7e21-4e4a-a4d6-d42324525cd2'].url}} />
<!-- 去关注 -->
<image class="tasknonetofocusbtn "
a:elif=={{(item.taskType=="follow")}}
a:elif={{(item.taskType==="follow")}}
src={{resList['ba2793d6-94cd-4fe1-ae3d-11278e0a66f8'].url}} />
<!-- 去浏览 -->
<image class="tasknonetobrowsebtn "
a:elif=={{(item.taskType=="jumpLink")}}
a:elif={{(item.taskType==="jumpLink")}}
src={{resList['8473ab9f-df8e-4c4e-b249-8d1cad9f04ae'].url}} />
<!-- 去完成 -->
<image class="tasknonegotobtn "
a:else
onTap="onTapTaskNoneGotoBtn"
data-value={{item.taskType}}
src={{resList['f4a40fdc-4ac7-4917-bdca-704ac6e293d6'].url}} />
</view>
<!-- 待领取 -->
<image a:if={{(item.status=="2")}} class="taskreadybtn " src={{resList['00c28c88-7e7c-4c9b-a708-f0254dab619a'].url}} />
<image a:if={{(item.status=="2")}} class="taskreadybtn " onTap="onTapTaskReadyBtn" data-value=item.taskType src={{resList['00c28c88-7e7c-4c9b-a708-f0254dab619a'].url}} />
<view a:if={{(item.status=="3")}}>
<!-- 已完成 -->
......
......@@ -2,6 +2,11 @@
import { DataCenter } from '../../DataCenter';
import resList from '../../resconfig/resList';
const app = getApp();
const { tbcc } = app;
import API from '../../api';
const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Component({
props: {},
......@@ -9,42 +14,42 @@ Component({
localData:{
//关注店铺
follow:{
icon:"",
icon:"//yun.duiba.com.cn/spark/assets/baafb1f67edc52f284a85b8a8323dfc5efe3801b.png",
text:"翻牌次数",
},
//群聊
groupChat:{
icon:"",
icon:"//yun.duiba.com.cn/spark/assets/7d716f04bf882a49407954ac90c1f078eff7610b.png",
text:"翻牌次数",
},
//加入会员
member:{
icon:"",
icon:"//yun.duiba.com.cn/spark/assets/4f9f7caae773c7c4e26021814b2627e8039f8429.png",
text:"翻牌次数",
},
//下单商品
orderGoods:{
icon:"",
icon:"//yun.duiba.com.cn/spark/assets/e9d9910c4a908087582fa47cb78d4f9494d05a7f.png",
text:"每下单一个商品,翻牌次数",
},
//收藏商品
collectGoods:{
icon:"",
icon:"//yun.duiba.com.cn/spark/assets/f13484038dd0f510d4ffa3c5139b0e4c5eca72f5.png",
text:"每收藏一个商品,翻牌次数",
},
//下单定金商品
orderDepositGoods:{
icon:"",
icon:"//yun.duiba.com.cn/spark/assets/1e0b9df36f66d0c7387118ea9302bc5c0b889d1e.png",
text:"每下一笔定金,翻牌次数",
},
//邀请
invites:{
icon:"",
icon:"//yun.duiba.com.cn/spark/assets/17f4fce77b429659bedfdcd340c9afa0eb1add6f.png",
text:"每邀请一位,翻牌次数",
},
//跳转页面
jumpLink:{
icon:"",
icon:"//yun.duiba.com.cn/spark/assets/cd21972ddfd45755dddd76ff2990755dd03cfadb.png",
text:"翻牌次数",
},
}
......@@ -52,6 +57,23 @@ Component({
methods: {
hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e);
},
async onTapTaskReadyBtn(e){
//获取活动基础信息
const { activityId } = getApp();
let taskType=e.target.dataset.value;
let receiveTaskRewards = await API.receiveTaskRewards({ activityId,taskType }).catch(res => {
commonToast(res && res.message);
}) || {};
if(receiveTaskRewards&&receiveTaskRewards.success){
commonToast(`任务完成,翻牌次数+${receiveTaskRewards.data.rewards}`);
}
},
onTapTaskNoneGotoBtn(){
this.inviteTask()
},
inviteTask(){
this.props.onInviteTask()
}
},
didMount(props) {
......
{
"exclude": [
"server/**"
]
}
......@@ -3,9 +3,14 @@
<getcardpanel a:if={{showWinLists.indexOf("getcardpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<joinmemberpanel a:if={{showWinLists.indexOf("joinmemberpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<nonumberpanel a:if={{showWinLists.indexOf("nonumberpanel")!=-1}} onOpenTaskPanel="openTaskPanel" onTapHiddenPanelEvent="hiddenPanelEvent" />
<mycardpanel a:if={{showWinLists.indexOf("mycardpanel")!=-1}} CollectCardInfo={{CollectCardInfo}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<taskpanel a:if={{showWinLists.indexOf("taskpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<mycardpanel a:if={{showWinLists.indexOf("mycardpanel")!=-1}} onGivingCard="givingCard" CollectCardInfo={{CollectCardInfo}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<taskpanel a:if={{showWinLists.indexOf("taskpanel")!=-1}} onInviteTask="inviteTask" onTapHiddenPanelEvent="hiddenPanelEvent" />
<prizetipspanel a:if={{showWinLists.indexOf("prizetipspanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<prizepanel a:if={{showWinLists.indexOf("prizepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<noneprizepanel a:if={{showWinLists.indexOf("noneprizepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<invitesuccesspanel a:if={{showWinLists.indexOf("invitesuccesspanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<helppanel a:if={{showWinLists.indexOf("helppanel")!=-1}} onIndexDoHelp="indexDoHelp" onTapHiddenPanelEvent="hiddenPanelEvent" />
<helpnoneprizepanel a:if={{showWinLists.indexOf("helpnoneprizepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<helpprizepanel a:if={{showWinLists.indexOf("helpprizepanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
<givingcardpanel a:if={{showWinLists.indexOf("givingcardpanel")!=-1}} onTapHiddenPanelEvent="hiddenPanelEvent" />
</view>
......@@ -10,11 +10,16 @@ Component({
},
openTaskPanel(){
this.props.onOpenTaskPanel()
},
inviteTask(){
this.props.onInviteTask()
},
givingCard(){
this.props.onGivingCard()
},
indexDoHelp(){
this.props.onIndexDoHelp()
}
},
onInit(props) {
},
});
\ No newline at end of file
......@@ -9,6 +9,11 @@
"taskpanel":"../../components/comtaskpanel/comtaskpanel",
"prizetipspanel":"../../components/comprizetipspanel/comprizetipspanel",
"prizepanel":"../../components/comprizepanel/comprizepanel",
"noneprizepanel":"../../components/comnoneprizepanel/comnoneprizepanel"
"noneprizepanel":"../../components/comnoneprizepanel/comnoneprizepanel",
"invitesuccesspanel":"../../components/cominvitesuccesspanel/cominvitesuccesspanel",
"helppanel":"../../components/comhelppanel/comhelppanel",
"helpprizepanel":"../../components/comhelpprizepanel/comhelpprizepanel",
"helpnoneprizepanel":"../../components/comhelpnoneprizepanel/comhelpnoneprizepanel",
"givingcardpanel":"../../components/comgivingcardpanel/comgivingcardpanel"
}
}
\ No newline at end of file
......@@ -82,6 +82,13 @@
<image class="indexrulebtn " onTap="showPanelEvent" data-value="{{'rulepanel'}}" src={{resList['abc5f112-fa04-42fa-bfec-f633567807c8'].url}} />
<image class="indexrecordbtn " src={{resList['5a6679e0-89f7-4582-a89b-116a35e9750a'].url}} />
</view>
<panel showWinLists={{showWinLists}} CollectCardInfo={{CollectCardInfo}} onOpenTaskPanel="openTaskPanel" onTapHiddenPanelEvent="hiddenPanelEvent"/>
<panel
showWinLists={{showWinLists}}
CollectCardInfo={{CollectCardInfo}}
onOpenTaskPanel="openTaskPanel"
onInviteTask="inviteTask"
onGivingCard="givingCard"
onIndexDoHelp="indexDoHelp"
onTapHiddenPanelEvent="hiddenPanelEvent"/>
<canvas id="canvas" type="2d" onReady="onCanvasReady"></canvas>
</view>
\ No newline at end of file
......@@ -12,6 +12,7 @@ import lottie from '@tbminiapp/lottie-miniapp'
let time1,time2
async function loadCloud(url, onLoad, onError) {
if (url.indexOf("cloud://") == 0) {
//@ts-ignore
......@@ -47,14 +48,49 @@ Page({
opacityState:"opacityShow",
showCardBody:false
},
onLoad(props) {
doShare() { my.showSharePanel(); },
onLoad(query) {
this.inviteId = query.inviteId;
this.cardId = query.cardId;
this.cardType = query.cardType;
this.setData({
resList: resList,
showPanel:this.showPanel
});
//初始化首页信息
this.getIndex()
// //初始化首页信息
this.getAuth()
},
/**
* 获取用户授权信息
*/
async getAuth() {
const userInfo = await getAuthUserInfo().catch(err => {
console.log('未授权成功', err);
});
if (userInfo) {
console.log('userInfo', userInfo);
const { nickName, avatar } = userInfo;
app.nickName = nickName;
app.avatar = avatar;
this.login();
}
},
/**
* 登录接口
*/
async login() {
const { nickName, avatar, isFollow } = app;
const { success, data } = await API.login({ userNick: nickName, avatar, isFollow: true }).catch(res => {
commonToast(res && res.message);
}) || {};
if (success) {
const { openId } = data;
app.openId = openId;
this.getIndex();
}
},
onCanvasReady() {
my.createCanvas({
id: 'canvas',
......@@ -76,11 +112,56 @@ Page({
},
});
},
async indexDoHelp(){
//如果是首页弹出助力弹窗
if (this.inviteId) {
// commonToast('首页助力类型,这是被邀请人页面'+this.inviteId)
const { activityId } = getApp();
//获取活动基础信息
let doHelp = await API.doHelp({ activityId,inviteId:this.inviteId }).catch(res => {
commonToast(res && res.message);
}) || {};
DataCenter.doHelp=doHelp.data;
if(doHelp&&doHelp.success){
if(doHelp.data.type!=5){
this.showPanel("helpprizepanel")
}else{
this.showPanel("helpnoneprizepanel")
}
}
}else{
//commonToast('首页助力类型,这是邀请人页面')
}
},
isHelp(){
if (this.inviteId) {
this.showPanel("helppanel")
}else{
//commonToast('首页助力类型,这是邀请人页面')
}
},
isGivingCard(){
if (this.cardId&&this.cardType) {
DataCenter.givingCardData={
cardId:this.cardId,
cardType:this.cardType
}
this.showPanel("givingcardpanel")
}else{
//commonToast('首页助力类型,这是邀请人页面')
}
},
/**
* 获取主接口
*/
async getIndex() {
const { activityId } = getApp();
this.isHelp()
this.isGivingCard()
// await this.indexDoHelp()
//获取活动基础信息
let BaseInfo = await API.getActivityBaseInfoById({ activityId }).catch(res => {
commonToast(res && res.message);
......@@ -94,6 +175,17 @@ Page({
commonToast(res && res.message);
}) || {};
//获取助力信息
let ShareInfo = await API.getShareInfo().catch(res => {
commonToast(res && res.message);
}) || {};
DataCenter.ShareInfo=ShareInfo.data;
if(DataCenter.ShareInfo&&DataCenter.ShareInfo.rewards>0){
this.showPanel("invitesuccesspanel")
}
let {
joinedTimesPrizeList,
collectedCardTypePrizeList,
......@@ -130,6 +222,14 @@ Page({
let needTimes = e.target.dataset.value;
this.drawLotteryPrize(8,needTimes)
},
inviteTask(){
DataCenter.shareType="invite";
my.showSharePanel();
},
givingCard(){
DataCenter.shareType="givingCard";
my.showSharePanel();
},
async drawLotteryPrize(prizeDataType,need){
const { activityId } = getApp();
let data={ activityId,prizeDataType}
......@@ -174,11 +274,7 @@ Page({
clearTimeout(time2)
//通过计时器滚动中奖信息
time1=setInterval(()=>{
if(list[i]){
i++
}else{
i=0
}
if(list[i]){i++}else{i=0}
this.setData({
opacityState:"opacityShow"
})
......@@ -290,5 +386,22 @@ Page({
showWinLists
})
}
}, onShareAppMessage() {
//返回自定义分享信息
let {
path,
...rest
} = SHARE_CONFIG;
if (app.openId&&DataCenter.shareType=="invite") {
path += '?inviteId=' + app.openId;
}else if(app.openId&&DataCenter.shareType=="givingCard") {
path += '?cardId=' + app.openId+'&cardType='+DataCenter.cardType;
}
console.log('path', path)
return {
...rest,
path
}
}
});
\ No newline at end of file
{
"cloud": {
"type": "CLOUDAPP"
},
"miniprogramRoot": "./client",
"exclude": [
"server/**"
]
}
"cloud": {
"type": "CLOUDAPP"
},
"miniprogramRoot": "./client",
"exclude": [
"server/**"
],
"component2": false
}
\ 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