Commit c12fe143 authored by 任建锋's avatar 任建锋

--

parent d9c0e1a9
<view class="getcardpanel "> <view class="getcardpanel ">
<view class={{show?"p_show":"p_hide"}}> <view class={{showCardBody?"p_show":"p_hide"}}>
<image class="getcardcontinuebtn " a:if={{doJoinData.drawLotteryStatus==1}} onTap="hiddenPanelEvent" data-value="getcardpanel" src={{resList['48d28917-741f-45d4-bcc9-322f29bcf5d8'].url}} /> <image class="getcardcontinuebtn " a:if={{doJoinData.drawLotteryStatus==1}} onTap="hiddenPanelEvent" data-value="getcardpanel" src={{resList['48d28917-741f-45d4-bcc9-322f29bcf5d8'].url}} />
<image class="getcardopenboxbtn " a:if={{doJoinData.drawLotteryStatus==2}} src={{resList['65d0f064-2527-4aef-8563-858eaf7ccf1e'].url}} /> <image class="getcardopenboxbtn " a:if={{doJoinData.drawLotteryStatus==2}} src={{resList['65d0f064-2527-4aef-8563-858eaf7ccf1e'].url}} />
<image class="dim51 " src={{resList['8c31274b-1016-4b8c-b413-9fc98174e118'].url}} /> <image class="dim51 " src={{resList['8c31274b-1016-4b8c-b413-9fc98174e118'].url}} />
...@@ -15,5 +15,5 @@ ...@@ -15,5 +15,5 @@
</view> </view>
</view> </view>
<canvas id="canvas" type="2d" onReady="onCanvasReady"></canvas>
</view> </view>
\ No newline at end of file
...@@ -42,59 +42,45 @@ Component({ ...@@ -42,59 +42,45 @@ Component({
hiddenPanelEvent(e){ hiddenPanelEvent(e){
this.props.onTapHiddenPanelEvent(e); this.props.onTapHiddenPanelEvent(e);
}, },
onCanvasReady() { // onCanvasReady() {
try{ // my.createCanvas({
my.alert({ // id: 'canvas',
title:"", // success: (canvas) => {
content:"11" // my.alert({
}); // title:"",
if(!my.createCanvas){ // content:"22"
my.alert({ // });
title:"", // lottie.setup(canvas);
content:"33" // let context = canvas.getContext('2d')
}); // let ani = lottie.loadAnimation({
} // loop: false, autoplay: true,
this.canvas=my.createCanvas({ // animationData: DataCenter.lottieData,
id: 'canvas', // rendererSettings: {context: context},
success: (canvas) => { // })
my.alert({ // ani.onComplete=()=>{
title:"",
content:"22"
});
lottie.setup(canvas);
const context = canvas.getContext('2d')
let ani = lottie.loadAnimation({
loop: true, autoplay: true,
animationData: DataCenter.lottieData,
rendererSettings: {context: context},
})
ani.onComplete=()=>{
// this.setData({ // this.setData({
// show:true // show:true
// }) // })
} // }
}, // },
}); // });
my.alert({ // },
title:"",
content:JSON.stringify(this.canvas)
});
}catch(e){
my.alert({
title:"",
content:JSON.stringify(e)
});
}
},
}, },
didMount(props) { didMount(props) {
console.log(DataCenter.doJoinData) console.log(DataCenter.doJoinData)
this.setData({ this.setData({
resList: resList, resList: resList,
showCardBody:false,
doJoinData:DataCenter.doJoinData?DataCenter.doJoinData.data:{} doJoinData:DataCenter.doJoinData?DataCenter.doJoinData.data:{}
}); });
setTimeout(()=>{
this.setData({
showCardBody:true
})
},1500)
// setTimeout(()=>{ // setTimeout(()=>{
// this.onCanvasReady() // this.onCanvasReady()
// },2000) // },2000)
......
...@@ -21,7 +21,8 @@ ...@@ -21,7 +21,8 @@
} }
.p_show{ .p_show{
opacity:1; opacity:1;
transition: 0.5s all;
} }
.p_hide{ .p_hide{
opacity:1; opacity:0;
} }
\ No newline at end of file
...@@ -82,5 +82,6 @@ ...@@ -82,5 +82,6 @@
<image class="indexrulebtn " onTap="showPanelEvent" data-value="{{'rulepanel'}}" src={{resList['abc5f112-fa04-42fa-bfec-f633567807c8'].url}} /> <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}} /> <image class="indexrecordbtn " src={{resList['5a6679e0-89f7-4582-a89b-116a35e9750a'].url}} />
</view> </view>
<panel showWinLists="{{showWinLists}}" CollectCardInfo={{CollectCardInfo}} onOpenTaskPanel="openTaskPanel" onTapHiddenPanelEvent="hiddenPanelEvent"/> <panel showWinLists={{showWinLists}} CollectCardInfo={{CollectCardInfo}} onOpenTaskPanel="openTaskPanel" onTapHiddenPanelEvent="hiddenPanelEvent"/>
<canvas id="canvas" type="2d" onReady="onCanvasReady"></canvas>
</view> </view>
\ No newline at end of file
...@@ -45,38 +45,37 @@ Page({ ...@@ -45,38 +45,37 @@ Page({
data: { data: {
showWinLists:[], showWinLists:[],
opacityState:"opacityShow", opacityState:"opacityShow",
showCardBody:false
}, },
onLoad(props) { onLoad(props) {
this.setData({ this.setData({
resList: resList, resList: resList,
showPanel:this.showPanel showPanel:this.showPanel
}); });
loadCloud("cloud://4028B2AAA0799F6D94C6A0398B238DE3//开卡效果.json", (data)=>{
DataCenter.lottieData=data
}, ()=>{})
//初始化首页信息 //初始化首页信息
this.getIndex() this.getIndex()
}, },
// onCanvasReady() { onCanvasReady() {
// my.createCanvas({ my.createCanvas({
// id: 'canvas', id: 'canvas',
// success: (canvas) => { success: (canvas) => {
// lottie.setup(canvas); loadCloud("cloud://4028B2AAA0799F6D94C6A0398B238DE3//开卡效果.json", (data)=>{
// const context = canvas.getContext('2d') lottie.setup(canvas);
// const { cloud } = getApp(); let context = canvas.getContext('2d')
// loadCloud("cloud://4028B2AAA0799F6D94C6A0398B238DE3//开卡效果.json", (data)=>{ this.ani = lottie.loadAnimation({
// let ani = lottie.loadAnimation({ loop: false, autoplay: false,
// loop: true, autoplay: true, animationData: data,
// animationData: data, rendererSettings: {context: context},
// rendererSettings: { context: context, }, })
// this.ani.onComplete=()=>{
// this.setData({
// showCardBody:true
// }) // })
// }, ()=>{})
// } // }
// }); }, ()=>{})
// }, },
});
},
/** /**
* 获取主接口 * 获取主接口
*/ */
...@@ -108,7 +107,6 @@ Page({ ...@@ -108,7 +107,6 @@ Page({
DataCenter.CollectCardInfo = CollectCardInfo.data; DataCenter.CollectCardInfo = CollectCardInfo.data;
this.setData({ this.setData({
BaseInfo, BaseInfo,
CollectCardInfo, CollectCardInfo,
...@@ -163,7 +161,6 @@ Page({ ...@@ -163,7 +161,6 @@ Page({
let CarouselList = await API.getAwardsCarouselList({ activityId }).catch(res => { let CarouselList = await API.getAwardsCarouselList({ activityId }).catch(res => {
commonToast(res && res.message); commonToast(res && res.message);
}) || {}; }) || {};
let {list}=CarouselList.data; let {list}=CarouselList.data;
this.setData({ this.setData({
CarouselListNow:list[0] CarouselListNow:list[0]
...@@ -228,7 +225,6 @@ Page({ ...@@ -228,7 +225,6 @@ Page({
this.showPanel("taskpanel") this.showPanel("taskpanel")
} }
}, },
/** /**
* 点击打开弹窗 * 点击打开弹窗
*/ */
...@@ -239,7 +235,6 @@ Page({ ...@@ -239,7 +235,6 @@ Page({
//立即翻拍 //立即翻拍
async doJoin(){ async doJoin(){
//抽卡 //抽卡
this.showPanel("getcardpanel");
const { activityId } = getApp(); const { activityId } = getApp();
let doJoin = await API.doJoin({ activityId }).catch(res => { let doJoin = await API.doJoin({ activityId }).catch(res => {
if(res&&res.code=="310003"){ if(res&&res.code=="310003"){
...@@ -255,6 +250,8 @@ Page({ ...@@ -255,6 +250,8 @@ Page({
if(doJoin&&doJoin.success){ if(doJoin&&doJoin.success){
DataCenter.doJoinData=doJoin; DataCenter.doJoinData=doJoin;
this.ani&&this.ani.goToAndStop(0);
this.ani&&this.ani.play();
this.showPanel("getcardpanel"); this.showPanel("getcardpanel");
} }
}, },
......
...@@ -6,7 +6,16 @@ ...@@ -6,7 +6,16 @@
position: relative !important; position: relative !important;
display: inline-block !important; display: inline-block !important;
} }
#canvas{
position:fixed;
top:0;
left:0;
bottom:0;
margin:auto;
width:750rpx;
height:1624rpx;
pointer-events: none;
}
.opacityShow{ .opacityShow{
opacity:1; opacity:1;
transition: 0.5s; transition: 0.5s;
......
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