|
@@ -5,6 +5,9 @@
|
|
|
import krpanoVideo from "@/components/krpanoVideo/index.vue";
|
|
|
import commonPageMethod from '@/mixins/commonPageMethod.js';
|
|
|
import lottie from "lottie-web"; //lottie
|
|
|
+ import {
|
|
|
+ Toast
|
|
|
+ } from 'mint-ui';
|
|
|
// import commonPageMethod from '@/common/commonPageMethod.js';
|
|
|
export default {
|
|
|
components: {
|
|
@@ -50,7 +53,7 @@
|
|
|
showLottery:false,//是否显示中红包状态
|
|
|
result:{
|
|
|
"amount": 0, //抢的红包金额
|
|
|
- "status": 0, //状态 1:成功抢到红包,2:已经抢过,3:红包已经被抢完了,4已经过期
|
|
|
+ "status": 0, //状态 1:领取成功,2:已经领过了,3:礼盒领完了,4:礼盒已过期,5:网络异常"
|
|
|
}, //中奖
|
|
|
showAnim:false, //是否添加lottie动画
|
|
|
anim:null,
|
|
@@ -86,10 +89,10 @@
|
|
|
// this.scale = this.$route.query.scale || '1';
|
|
|
this.type = this.$route.query.type || '';
|
|
|
|
|
|
- this.AIPeople = this.$route.query.AIPeople ? JSON.parse(this.$route.query.AIPeople) : '';
|
|
|
- this.AIPet = this.$route.query.AIPet ? JSON.parse(this.$route.query.AIPet) : '';
|
|
|
- this.bgMusic = this.$route.query.bgMusic ? JSON.parse(this.$route.query.bgMusic) : '';
|
|
|
- this.redBox = this.$route.query.redBox ? JSON.parse(this.$route.query.redBox) : '';
|
|
|
+ this.AIPeople = this.$route.query.AIPeople ? JSON.parse(this.$route.query.AIPeople) : {};
|
|
|
+ this.AIPet = this.$route.query.AIPet ? JSON.parse(this.$route.query.AIPet) : {};
|
|
|
+ this.bgMusic = this.$route.query.bgMusic ? JSON.parse(this.$route.query.bgMusic) : {};
|
|
|
+ this.redBox = this.$route.query.redBox ? JSON.parse(this.$route.query.redBox) : {};
|
|
|
this.initAI();
|
|
|
},
|
|
|
methods: {
|
|
@@ -112,6 +115,8 @@
|
|
|
},
|
|
|
closeLottery(){
|
|
|
this.showLottery = false;
|
|
|
+ lottie.destroy("lottieView");
|
|
|
+ this.showAnim = false;
|
|
|
},
|
|
|
//用户选中了红包,要派奖了
|
|
|
async winLottery(){
|
|
@@ -120,20 +125,31 @@
|
|
|
console.warn("***no-leavePhoneCustomerId***")
|
|
|
return false
|
|
|
}
|
|
|
- if(!this.$route.query.redpackId){
|
|
|
- console.warn("***no-redpackId***")
|
|
|
+ if(!this.$route.query.boxNo){
|
|
|
+ console.warn("***no-boxNo***")
|
|
|
return false
|
|
|
}
|
|
|
let res = await requestConfig("rob", {
|
|
|
"brandId": $config.brandId,
|
|
|
- "redpackId": this.$route.query.redpackId,
|
|
|
+ "boxNo": this.$route.query.boxNo,
|
|
|
"userId": this.$route.query.leavePhoneCustomerId,
|
|
|
+ "openId": this.$route.query.openid,
|
|
|
+ "worksId": this.$route.query.worksId || '', //作品id
|
|
|
+ "sharer": this.$route.query.sharer || '', //分享者秘钥
|
|
|
});
|
|
|
if (res.success) {
|
|
|
this.result = res.single;
|
|
|
this.showLottery = true;
|
|
|
if(this.result.status==1){
|
|
|
this.lottieAni()
|
|
|
+ }else if(this.result.status==5){
|
|
|
+ Toast({
|
|
|
+ message: '已达到限制!',
|
|
|
+ });
|
|
|
+ }else if(this.result.status==2){
|
|
|
+ Toast({
|
|
|
+ message: '已经领过了!',
|
|
|
+ });
|
|
|
}
|
|
|
}else{
|
|
|
this.result = null;
|
|
@@ -150,14 +166,14 @@
|
|
|
container: element,
|
|
|
name: "lottieView",
|
|
|
renderer: "svg",
|
|
|
- loop: false,
|
|
|
+ loop: true,
|
|
|
autoplay: true,
|
|
|
path: this.specialList[lottieIndex].url, //动画json
|
|
|
});
|
|
|
- setTimeout(()=>{
|
|
|
- lottie.destroy("lottieView");
|
|
|
- this.showAnim = false;
|
|
|
- },2000)
|
|
|
+ // setTimeout(()=>{
|
|
|
+ // lottie.destroy("lottieView");
|
|
|
+ // this.showAnim = false;
|
|
|
+ // },2000)
|
|
|
}
|
|
|
|
|
|
}
|