663 lines
35 KiB
PHP
663 lines
35 KiB
PHP
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport"
|
|
content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
|
|
<meta http-equiv="X-UA-Compatible" content="ie=edge">
|
|
<title><?= $_title ?></title>
|
|
<link rel="stylesheet" href="/css/h5/syt/live.css?v=2022513">
|
|
<link rel="stylesheet" href="https://qs.liche.cn/web/javascript/swiper/css/swiper.min.css">
|
|
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/jquery.3.4.1.min.js"></script>
|
|
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/vue.2.6.10.min.js"></script>
|
|
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/mDialog.js"></script>
|
|
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/md5.min.js"></script>
|
|
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/swiper/js/swiper.min.js"></script>
|
|
<script type="text/javascript" src="//player.polyv.net/livesdk/polyv-live.min.js"></script>
|
|
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
|
|
<? if ($info['checkua'] == 'wxwork') { ?>
|
|
<script type="text/javascript" src="https://open.work.weixin.qq.com/wwopen/js/jwxwork-1.0.0.js"></script>
|
|
<? } ?>
|
|
</head>
|
|
|
|
<body class="bg-fff">
|
|
<div id="app">
|
|
<div class="container"
|
|
style="background-image:url(https://qs.liche.cn/web/images/special/liche/20220329-zhibo/bd-bg.png)">
|
|
<div class="pl25 pr25">
|
|
<!-- Swiper -->
|
|
<div class="pt30 pb30">
|
|
<div class="swiper-container winInfo-swiper" v-if="info.winInfo.length > 0 ">
|
|
<div class="swiper-wrapper">
|
|
<div class="swiper-slide relative pr60" v-for="item in info.winInfo">
|
|
<div class="text-nowrap font-28 color-fff">{{item.title}}</div>
|
|
<div class="absolute right-0 box-middle imgsize-25X25 icon-arrow-right"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end Swiper -->
|
|
<div>
|
|
<img class="block wp100" :src="info.banner" alt="#"/>
|
|
</div>
|
|
<div v-if="info.l_status==2" class="player pt20 pb20"><img
|
|
src="https://liveimages.videocc.net/uploaded/images/2022/02/g6w0bwga4p.png"></div>
|
|
<div v-show="info.l_status!=2" id="player" class="player pt20 pb20"></div>
|
|
<div class="inner30 bg-fff9ea ulib-r10">
|
|
<div class="font-36">{{info.rule.title}}</div>
|
|
<div class="mt10 font-24 line-height-18 color-666" v-html="info.rule.content"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div v-if="info.l_status!=1" style="padding-top:30vw">
|
|
<div class="fixed left-0 right-0 bottom-0 ml25 mr25">
|
|
<div class="pt40 pb60 bg-fff ulib-rt20">
|
|
<div class="relative pl130 pr130 text-center">
|
|
<a class="block absolute left-0 box-middle ml30" @click="showMyPrize">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-gift.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">我的盲盒</div>
|
|
</a>
|
|
<a v-if="info.biz_id" class="block absolute right-0 box-middle mr30" @click="jumpBiz">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-flag.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">活动数据</div>
|
|
</a>
|
|
<a v-else class="block absolute right-0 box-middle mr30"
|
|
@click="isShowService=!isShowService">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-service.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">添加客服</div>
|
|
</a>
|
|
<a class="block red-fe8980-ffb97f pt20 pb20 font-36 text-bold text-italic color-fff ulib-r750">{{info.l_status_name}}</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div v-else :style="'padding-top:'+ [!info.isOpen&&info.e_time <=0?'70vw':'30vw']">
|
|
<div class="fixed left-0 right-0 bottom-0 ml25 mr25">
|
|
<div class="pb20 bg-fff ulib-rt20" v-if="!info.isOpen">
|
|
<div class="draw-bg" v-if="info.e_time <=0 ">
|
|
<div class="draw-gift pl30 pr30 text-center fn-flex">
|
|
<div class="fn-flex-item"><img class="imgsize-160X160"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/gift.png"
|
|
alt="#"/></div>
|
|
<div class="fn-flex-item"><img class="imgsize-160X160"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/gift.png"
|
|
alt="#"/></div>
|
|
<div class="fn-flex-item"><img class="imgsize-160X160"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/gift.png"
|
|
alt="#"/></div>
|
|
</div>
|
|
<div class="relative pl130 pr130 text-center">
|
|
<a class="block absolute left-0 box-middle ml30" @click="showMyPrize">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-gift.png"
|
|
alt="#"/>
|
|
<div class="mt10 font-18 color-666">我的盲盒</div>
|
|
</a>
|
|
<a v-if="info.biz_id" class="block absolute right-0 box-middle mr30" @click="jumpBiz">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-flag.png"
|
|
alt="#"/>
|
|
<div class="mt10 font-18 color-666">活动数据</div>
|
|
</a>
|
|
<a v-else class="block absolute right-0 box-middle mr30"
|
|
@click="isShowService=!isShowService">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-service.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">添加客服</div>
|
|
</a>
|
|
<a class="block red-ff7300-fd1401 pt20 pb20 font-36 text-bold text-italic color-fff ulib-r750"
|
|
@click="runLottery">开启试驾盲盒</a>
|
|
<div class="mt20 font-22 color-666" v-html="showTime"></div>
|
|
</div>
|
|
</div>
|
|
<div class="pt40 pb30" v-else>
|
|
<div class="relative pl130 pr130 text-center">
|
|
<a class="block absolute left-0 box-middle ml30" @click="showMyPrize">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-gift.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">我的盲盒</div>
|
|
</a>
|
|
<a v-if="info.biz_id" class="block absolute right-0 box-middle mr30" @click="jumpBiz">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-flag.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">活动数据</div>
|
|
</a>
|
|
<a v-else class="block absolute right-0 box-middle mr30"
|
|
@click="isShowService=!isShowService">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-service.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">添加客服</div>
|
|
</a>
|
|
<a class="block red-fe8980-ffb97f pt20 pb20 font-36 text-bold text-italic color-fff ulib-r750">开启试驾盲盒</a>
|
|
<div class="mt20 font-22 color-666" v-html="showTime"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="pt40 pb60 bg-fff ulib-rt20" v-else>
|
|
<div class="relative pl130 pr130 text-center">
|
|
<a class="block absolute left-0 box-middle ml30" @click="showMyPrize">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-gift.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">我的盲盒</div>
|
|
</a>
|
|
<a v-if="info.biz_id" class="block absolute right-0 box-middle mr30" @click="jumpBiz">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-flag.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">活动数据</div>
|
|
</a>
|
|
<a v-else class="block absolute right-0 box-middle mr30"
|
|
@click="isShowService=!isShowService">
|
|
<img class="imgsize-40X40"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/icon-service.png"
|
|
alt="#"/>
|
|
<div class="font-18 color-666">添加客服</div>
|
|
</a>
|
|
<a class="block red-fe8980-ffb97f pt20 pb20 font-36 text-bold text-italic color-fff ulib-r750">已开启试驾盲盒</a>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<transition name="fade">
|
|
<div class="msg msg-text" style="display: none;" v-show="isShowMsgText">
|
|
<div class="msgBg"></div>
|
|
<div class="msgMain">
|
|
<div class="bg-fff ulib-r20" style="width:78vw;">
|
|
<div class="inner40">
|
|
<h2 class="pt40 pb20 text-center font-34 color-333 line-height-18" v-html="msgText.title"></h2>
|
|
<!-- <div class="pt20 pb20 text-center font-24 color-666" v-html="msgText.content"></div> -->
|
|
</div>
|
|
<div class="pb70 text-center">
|
|
<div class="inline-block pt25 pb25 pl100 pr100 red-ff7300-fd1401 font-32 color-fff ulib-r750"
|
|
@click="isShowMsgText=!isShowMsgText">知道了
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</transition>
|
|
|
|
<transition name="fade">
|
|
<div class="msg msg-text" style="display:none;" v-show="isShowMsgWin">
|
|
<div class="msgBg"></div>
|
|
<div class="msgMain">
|
|
<div class="relative bg-fff bg-no-repeat bg-size-fullwidth bg-pos-top ulib-r20"
|
|
style="width:78vw;background-image:url(https://qs.liche.cn/web/images/special/liche/20220329-zhibo/mag-tt.png);">
|
|
<img class="absolute wp100 top-0 left-0"
|
|
src="https://qs.liche.cn/web/images/special/liche/20220329-zhibo/fireworks.png" alt="#"/>
|
|
<div class="inner40 pb20 text-center">
|
|
<div style="height:27vw;">
|
|
<h2 class="text-center font-48 color-fff line-height-18">{{msgWin.title1}}</h2>
|
|
<div class="font-32 color-fff">{{msgWin.title2}}</div>
|
|
</div>
|
|
<div><img class="imgsize-350X180" :src="msgWin.img" alt="#"/></div>
|
|
<div class="mt20 font-32 text-block">{{msgWin.name}}</div>
|
|
<div class="pt20 pb20 text-center font-24 color-666" v-html="msgWin.content"></div>
|
|
</div>
|
|
<div class="pb70 text-center">
|
|
<div class="inline-block pt25 pb25 pl100 pr100 red-ff7300-fd1401 font-32 color-fff ulib-r750"
|
|
@click="isShowMsgWin=!isShowMsgWin,isShowMsgReg=!isReg">知道了
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</transition>
|
|
|
|
<transition name="fade">
|
|
<div class="msg msg-text" style="display:none;" v-show="isShowMsgMyPrize">
|
|
<div class="msgBg"></div>
|
|
<div class="msgMain">
|
|
<i class="close" @click="isShowMsgMyPrize=!isShowMsgMyPrize"></i>
|
|
<div class="bg-fff ulib-r20" style="width:78vw;">
|
|
<div class="inner40 text-center" v-if="info.msgMyPrize.lottery.title==''">
|
|
<h2 class="pt20 pb20 font-34 color-333 line-height-18">暂时未中奖</h2>
|
|
</div>
|
|
<div class="inner40 text-center" v-else>
|
|
<h2 class="pb20 font-34 color-333 line-height-18" v-html="info.msgMyPrize.title"></h2>
|
|
<div class="swiper-slide relative">
|
|
<div><img class="imgsize-350X180" :src="info.msgMyPrize.lottery.img" alt="#"/></div>
|
|
<div class="mt20 font-32 text-bold">{{info.msgMyPrize.lottery.title}}</div>
|
|
<div class="relative mt10 font-28">{{info.msgMyPrize.lottery.price}}</div>
|
|
<div class="relative mt30 font-28">{{info.msgMyPrize.lottery.time.title}}</div>
|
|
<div class="mt10 font-28 color-666" v-html="info.msgMyPrize.lottery.time.content"></div>
|
|
<template v-if="!info.lottery && info.msgMyPrize.lottery.other.content">
|
|
<div class="relative mt30 font-32">{{info.msgMyPrize.lottery.other.title}}</div>
|
|
<div class="mt10 font-28 color-666"
|
|
v-html="info.msgMyPrize.lottery.other.content"></div>
|
|
</template>
|
|
</div>
|
|
<div class="mt20 mb10 font-32 text-underline color-fd1401"
|
|
@click="isShowMsgMyPrize=!isShowMsgMyPrize,isShowMsgReg=true">登记信息
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</transition>
|
|
|
|
<transition name="fade">
|
|
<div class="msg msg-text" style="display:none;" v-show="isShowMsgReg">
|
|
<div class="msgBg" @click="isShowMsgReg=!isShowMsgReg"></div>
|
|
<div class="msgMain">
|
|
<div class="content">
|
|
<div class="word">
|
|
<div class="pt10 pb10 font-36 text-center">登记信息</div>
|
|
<div class="mt30 relative bg-f6 ulib-r10">
|
|
<input v-if="info.lottery" class="wp100 inner30 font-30 bg-f6 bds-none ulib-r10" type="text"
|
|
v-model="info.msgMyPrize.lottery.name" disabled="disabled"/>
|
|
<input v-else class="wp100 inner30 font-30 bg-f6 bds-none ulib-r10" type="text"
|
|
v-model="info.msgMyPrize.lottery.name" placeholder="请输入您的姓名"/>
|
|
</div>
|
|
<div class="mt30 relative bg-f6 ulib-r10">
|
|
<input v-if="info.lottery" class="wp100 inner30 font-30 bg-f6 bds-none ulib-r10" type="tel"
|
|
v-model="info.msgMyPrize.lottery.mobile" disabled="disabled"/>
|
|
<input v-else class="wp100 inner30 font-30 bg-f6 bds-none ulib-r10" type="tel"
|
|
v-model="info.msgMyPrize.lottery.mobile" placeholder="请输入您的手机号"/>
|
|
</div>
|
|
</div>
|
|
<div class="mt40 pb20 pl40 pr40 text-center">
|
|
<div class="inline-block pt25 pb25 pl100 pr100 red-ff7300-fd1401 font-32 color-fff ulib-r750"
|
|
@click="enroll">确认
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</transition>
|
|
|
|
<!--添加客服-->
|
|
<transition name="fade">
|
|
<div class="msg msg-text" style="display: none;" v-show="isShowService">
|
|
<div class="msgBg" @click="isShowService=!isShowService"></div>
|
|
<div class="msgMain">
|
|
<div class="bg-fff ulib-r20" style="width:78vw;">
|
|
<div class="inner40 text-center">
|
|
<img class="mt20 imgsize-300X300" :src="info.serviceCode" alt="#"/>
|
|
<div class="pt20 text-center font-24 color-666">添加客服</div>
|
|
</div>
|
|
<div class="pb50 text-center">
|
|
<div class="inline-block pt20 pb20 pl100 pr100 bg-b5 font-32 color-fff ulib-r750"
|
|
@click="isShowService=!isShowService">知道了
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</transition>
|
|
|
|
</div>
|
|
|
|
<script type="text/javascript">
|
|
var app = new Vue({
|
|
el: '#app',
|
|
data: {
|
|
info: <?=json_encode($info)?>,
|
|
bundleIntervalEvent: '',//倒计时
|
|
isShowMsgText: false,//是否显示文字提示弹框
|
|
msgText: {//文字提示弹框参数
|
|
title: '',
|
|
content: '',
|
|
},
|
|
isShowMsgWin: false,//是否显示中奖
|
|
msgWin: {//中奖提示弹框参数
|
|
title1: '', title2: '', name: '', content: '', img: ''
|
|
},
|
|
isShowMsgMyPrize: false,//我的奖品
|
|
isShowMsgReg: false,//是否显示登记信息弹框
|
|
isReg: false,//是否已登记信息
|
|
isSubmiting: false,
|
|
isShowService: false,//是否客服弹框
|
|
},
|
|
created() {
|
|
},
|
|
computed: {
|
|
//用计算属性显示结果
|
|
showTime() {
|
|
//剩余秒数<=0
|
|
if (this.info.e_time <= 0) {
|
|
return "点击开启盲盒";
|
|
}
|
|
// 剩余秒数>0
|
|
else {
|
|
let day = Math.floor(this.info.e_time / 86400);
|
|
let hour = Math.floor((this.info.e_time % 86400) / 3600);
|
|
let min = Math.floor(((this.info.e_time % 86400) % 3600) / 60);
|
|
let sec = Math.floor(((this.info.e_time % 86400) % 3600) % 60);
|
|
if (day > 0) {
|
|
return ("<span class='text-middle'>倒计时:</span><em class='text-middle color-ff7200 pl5 pr5'" + day + "</em><em class='text-middle'>天</em><em class='text-middle color-ff7200 pl5 pr5'>" + (hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
|
10 ? "0" : "") + sec + "</em><em class='text-middle'>秒</em>后可开启盲盒");
|
|
} else if (hour > 0) {
|
|
return ("<span class='text-middle'>倒计时:</span><em class='text-middle color-ff7200 pl5 pr5'>" + (hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
|
10 ? "0" : "") + sec + "</em><em class='text-middle'>秒</em>后可开启盲盒");
|
|
} else if (min > 0) {
|
|
return ("<span class='text-middle'>倒计时:</span><em class='text-middle color-ff7200 pl5 pr5'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
|
10 ? "0" : "") + sec + "</em><em class='text-middle'>秒</em>后可开启盲盒");
|
|
} else if (sec > 0) {
|
|
return ("<span class='text-middle'>倒计时:</span><em class='text-middle color-ff7200 pl5 pr5'>" + (sec <
|
|
10 ? "0" : "") + sec + "</em><em class='text-middle'>秒</em>后可开启盲盒");
|
|
}
|
|
}
|
|
}
|
|
},
|
|
mounted() {
|
|
//倒计时
|
|
this.bundleIntervalEvent = setInterval(this.intervalEvent, 1000);
|
|
//中奖信息滚动
|
|
if ($('.winInfo-swiper .swiper-slide').length > 1) {
|
|
var swiper = new Swiper('.winInfo-swiper', {
|
|
loop: true,
|
|
lazy: true,
|
|
direction: 'vertical',
|
|
centeredSlides: true,
|
|
autoplay: {
|
|
delay: 2000,
|
|
stopOnLastSlide: false,
|
|
disableOnInteraction: true,
|
|
},
|
|
});
|
|
}
|
|
},
|
|
beforeDestroy() {
|
|
clearInterval(this.bundleIntervalEvent);
|
|
},
|
|
methods: {
|
|
//跳转门店
|
|
jumpBiz() {
|
|
let that = this;
|
|
window.location.href = '/h5/syt/live/statistics?id=' + that.info.id;
|
|
},
|
|
//开启试驾盲盒
|
|
runLottery() {
|
|
let that = this;
|
|
if (that.info.l_status != 1) {
|
|
mDialog.msg({content: that.info.l_status_name});
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: '/h5/syt/live/lottery',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {id: that.info.id},
|
|
beforeSend: function () {
|
|
},
|
|
success: function (data) {
|
|
if (200 == data['code']) {
|
|
//接口请求成功需要修改开奖状态,更新我的中奖产品
|
|
that.info.isOpen = true;
|
|
//没有中奖
|
|
// that.isShowMsgText=true;
|
|
// that.msgText.title = '很遗憾没有中奖!';
|
|
//中奖了
|
|
that.isShowMsgWin = true;
|
|
that.msgWin = data['msgWin'];
|
|
if (data['msgMyPrize']) {
|
|
that.info.msgMyPrize = data['msgMyPrize'];
|
|
}
|
|
} else {
|
|
mDialog.msg({content: data.msg});
|
|
}
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
},
|
|
//登记信息
|
|
enroll() {
|
|
let that = this;
|
|
if (that.info.l_status != 1) {
|
|
mDialog.msg({content: that.info.l_status_name});
|
|
return;
|
|
}
|
|
if (that.info.lottery) {
|
|
this.isShowMsgReg = false;
|
|
return;
|
|
}
|
|
if (this.isSubmiting) return;
|
|
if (!that.msgWin.id) {
|
|
mDialog.msg({content: "请先开启试驾盲盒"});
|
|
return;
|
|
}
|
|
if (!that.info.msgMyPrize.lottery.name) {
|
|
mDialog.msg({content: "请输入您的姓名"});
|
|
return;
|
|
}
|
|
if (!/^1[3456789]\d{9}$/.test(that.info.msgMyPrize.lottery.mobile)) {
|
|
mDialog.msg({content: "请输入正确的手机号"});
|
|
return;
|
|
}
|
|
$.ajax({
|
|
url: '/h5/syt/live/enroll',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {
|
|
id: that.info.id,
|
|
name: that.info.msgMyPrize.lottery.name,
|
|
mobile: that.info.msgMyPrize.lottery.mobile,
|
|
cf_uid: that.info.cf_uid,
|
|
biz_id: that.info.cf_biz_id,
|
|
prize_id: that.msgWin.id
|
|
},
|
|
beforeSend: function () {
|
|
},
|
|
success: function (data) {
|
|
mDialog.msg({content: data.msg});
|
|
if (200 == data['code']) {
|
|
this.isShowMsgReg = false;
|
|
that.info.lottery = true;
|
|
}
|
|
},
|
|
complete: function () {
|
|
this.isSubmiting = true;
|
|
}
|
|
});
|
|
},
|
|
//显示我的礼品
|
|
showMyPrize() {
|
|
let that = this;
|
|
if (that.info.l_status == 0) {
|
|
mDialog.msg({content: that.info.l_status_name});
|
|
return;
|
|
}
|
|
if (!that.info.isOpen) {
|
|
mDialog.msg({content: "未开启试驾盲盒"});
|
|
return;
|
|
}
|
|
this.isShowMsgMyPrize = true;//我的奖品
|
|
},
|
|
//盲盒生成倒计时
|
|
intervalEvent() {
|
|
if (this.info.e_time > 0) {
|
|
this.info.e_time--;
|
|
} else {
|
|
clearInterval(this.bundleIntervalEvent);
|
|
}
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
<? if ($info['l_status'] != 2) { ?>
|
|
<script type="text/javascript">
|
|
var liveSdk = null;
|
|
window.onload = function () {
|
|
var liveSdk = new PolyvLiveSdk({
|
|
channelId: "<?= $info['liveSdk']['channelId'] ?>",
|
|
sign: "<?= $info['liveSdk']['sign'] ?>", // 频道验证签名
|
|
timestamp: "<?= $info['liveSdk']['timestamp'] ?>", // 毫秒级时间戳
|
|
appId: "<?= $info['liveSdk']['appId'] ?>", // polyv 后台的appId
|
|
user: {
|
|
userId: "<?= $info['liveSdk']['user']['userId'] ?>",
|
|
userName: "<?= $info['liveSdk']['user']['userName'] ?>",
|
|
pic: "<?= $info['liveSdk']['user']['pic'] ?>",
|
|
},
|
|
});
|
|
// 监听频道信息读取完成事件,初始化播放器
|
|
liveSdk.on(PolyvLiveSdk.EVENTS.CHANNEL_DATA_INIT, (event, data) => {
|
|
liveSdk.setupPlayer({
|
|
el: "#player",
|
|
type: "auto",
|
|
autoplay: true, // 设置自动播放
|
|
});
|
|
// liveSdk.player.on('ended', function() {
|
|
// console.log('播放结束');
|
|
// });
|
|
// // 监听流状态变化刷新播放器
|
|
// liveSdk.on(PolyvLiveSdk.EVENTS.STREAM_UPDATE, function() {
|
|
// liveSdk.reloadPlayer();
|
|
// console.log('----------->reloadPlayer');
|
|
// });
|
|
if (!app.info.session_id && data.sessionId && data.status == 'Y') {
|
|
set_l_status(data.sessionId, 1);
|
|
} else if (app.info.session_id == data.sessionId && data.status == 'N') {
|
|
set_l_status(data.sessionId, 2);
|
|
}
|
|
console.log(data);
|
|
});
|
|
};
|
|
|
|
function set_l_status(session_id, l_status) {
|
|
$.ajax({
|
|
url: '/h5/syt/live/l_status',
|
|
type: 'post',
|
|
dataType: 'json',
|
|
data: {
|
|
id: app.info.id,
|
|
session_id: session_id,
|
|
l_status: l_status,
|
|
},
|
|
beforeSend: function () {
|
|
},
|
|
success: function (re) {
|
|
if (200 == re['code']) {
|
|
app.info.l_status = re['l_status'];
|
|
app.info.l_status_name = re['l_status_name'];
|
|
app.info.session_id = re['session_id'];
|
|
console.log('更新l_status=' + re['l_status']);
|
|
}
|
|
},
|
|
complete: function () {
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
<? } ?>
|
|
<? if ($info['checkua'] == 'wxwork') { ?>
|
|
<script type="text/javascript">
|
|
wx.config({
|
|
beta: true,// 必须这么写,否则wx.invoke调用形式的jsapi会有问题
|
|
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
|
appId: "<?=$sign_package['appId']?>", // 必填,企业微信的corpID
|
|
timestamp: "<?=$sign_package['timestamp']?>", // 必填,生成签名的时间戳
|
|
nonceStr: "<?=$sign_package['nonceStr']?>", // 必填,生成签名的随机串
|
|
signature: "<?=$sign_package['signature']?>",// 必填,签名,见 附录-JS-SDK使用权限签名算法
|
|
jsApiList: ["onMenuShareAppMessage", "onMenuShareWechat", "onMenuShareTimeline"] // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
|
|
});
|
|
wx.ready(function () {
|
|
//转发
|
|
wx.onMenuShareAppMessage({
|
|
title: '<?=$share['title']?>', // 分享标题
|
|
desc: '<?=$share['desc']?>', // 分享描述
|
|
link: '<?=$share['url']?>', // 分享链接;在微信上分享时,该链接的域名必须与企业某个应用的可信域名一致
|
|
imgUrl: '<?=$share['img']?>', // 分享图标
|
|
success: function () {
|
|
alert(option.title);
|
|
},
|
|
cancel: function () {
|
|
}
|
|
});
|
|
//微信
|
|
wx.onMenuShareWechat({
|
|
title: '<?=$share['title']?>', // 分享标题
|
|
desc: '<?=$share['desc']?>', // 分享描述
|
|
link: '<?=$share['url']?>', // 分享链接
|
|
imgUrl: '<?=$share['img']?>', // 分享图标
|
|
success: function () {
|
|
alert(option.title);
|
|
},
|
|
cancel: function () {
|
|
}
|
|
});
|
|
//分享到朋友圈
|
|
wx.onMenuShareTimeline({
|
|
title: '<?=$share['title']?>', // 分享标题
|
|
link: '<?=$share['url']?>', // 分享链接
|
|
imgUrl: '<?=$share['img']?>', // 分享图标
|
|
success: function () {
|
|
alert(option.title);
|
|
},
|
|
cancel: function () {
|
|
}
|
|
});
|
|
});
|
|
wx.error(function (res) {
|
|
console.log('res', res);
|
|
});
|
|
</script>
|
|
<? }elseif ($info['checkua'] == 'wx') { ?>
|
|
<script type="text/javascript">
|
|
wx.config({
|
|
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印
|
|
appId: "<?=$sign_package['appId']?>", // 必填,公众号的唯一标识
|
|
timestamp: "<?=$sign_package['timestamp']?>", // 必填,生成签名的时间戳
|
|
nonceStr: "<?=$sign_package['nonceStr']?>", // 必填,生成签名的随机串
|
|
signature: "<?=$sign_package['signature']?>",// 必填,签名
|
|
jsApiList: ["openLocation", "updateAppMessageShareData", "updateTimelineShareData"], // 必填,需要使用的JS接口列表
|
|
openTagList: ['wx-open-launch-weapp'] // 可选,需要使用的开放标签列表,例如['wx-open-launch-app']
|
|
});
|
|
wx.ready(function () {
|
|
//自定义“分享到朋友圈”及“分享到QQ空间”按钮的分享内容
|
|
wx.updateTimelineShareData({
|
|
title: '<?=$share['title']?>', // 分享标题
|
|
link: '<?=$share['url']?>', // 分享链接
|
|
imgUrl: '<?=$share['img']?>', // 分享图标
|
|
desc: '<?=$share['desc']?>', // 分享描述
|
|
success: function () {
|
|
// 用户成功分享后执行的回调函数
|
|
//alert(option.title);
|
|
//option.success()
|
|
},
|
|
cancel: function () {
|
|
// 用户取消分享后执行的回调函数
|
|
//option.error()
|
|
}
|
|
});
|
|
//自定义“分享给朋友”及“分享到QQ”按钮的分享内容
|
|
wx.updateAppMessageShareData({
|
|
title: '<?=$share['title']?>', // 分享标题
|
|
link: '<?=$share['url']?>', // 分享链接
|
|
imgUrl: '<?=$share['img']?>', // 分享图标
|
|
desc: '<?=$share['desc']?>', // 分享描述
|
|
success: function () {
|
|
// 用户成功分享后执行的回调函数
|
|
//alert(option.title);
|
|
//option.success()
|
|
},
|
|
cancel: function () {
|
|
// 用户取消分享后执行的回调函数
|
|
//option.error()
|
|
}
|
|
});
|
|
});
|
|
wx.error(function (res) {
|
|
console.log('res', res);
|
|
// config信息验证失败会执行error函数,如签名过期导致验证失败,具体错误信息可以打开config的debug模式查看,也可以在返回的res参数中查看,对于SPA可以在这里更新签名。
|
|
});
|
|
</script>
|
|
<? } ?>
|
|
</body>
|
|
</html>
|