Files
liche/home/views/h5/syt/special.php
T
xiaoyu 6a9316dd64 0507
2025-05-07 12:39:07 +08:00

786 lines
40 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<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/special.css?v=20210416">
<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/axios.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="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/qs.js"></script>
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/vue-mugen-scroll.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/LArea/js/LAreaData1.js"></script>
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/LArea/js/LAreaData2.js"></script>
<script type="text/javascript" src="https://qs.liche.cn/web/javascript/LArea/js/LArea.js"></script>
</head>
<body>
<div id="app">
<div class="index" :style="'background-color:'+bg_color">
<div class="relative">
<img class="wp100 block" :src="bg_img"/>
</div>
<div v-if="list.length > 0" class="pl30 pr30 container">
<block v-for="(specialist,modIndex) in list">
<div class="fn-flex fn-flex-wrap mb30" v-if="specialist.style == 4 && specialist.ads.length > 0">
<a v-for="ads in specialist.ads"
:class="specialist.ads.length>3?'wp33 pt15 pb15 text-center font-26 index-nav-item':'wp33 mt30 text-center font-26 index-nav-item fn-flex-item'"
:href="ads.url">
<img class='img-140x140 ulib-r20' :src='ads.img'/>
<div class="mt10 text-nowrap font-28 color-fff">{{ads.title}}</div>
</a>
</div>
<div :class="[modIndex==list.length-1 ?'':'mb30','relative ']"
:style="'background:'+[specialist.bg_color !=''?specialist.bg_color:'']+';'">
<div v-if="specialist.title_img !=''">
<img class="wp100 block" :src="specialist.title_img"/>
</div>
<div :class="[specialist.bg_color !=''?'inner30 pt0':'']">
<!--富文本-->
<div v-if="specialist.bg_color !=''">
<div class="mt20 font-28 color-666 line-height-17" v-if="specialist.descrip != ''"
v-html="specialist.descrip"></div>
<div class="mt20 font-28 color-666 line-height-17" v-if="specialist.content != ''"
v-html="specialist.content"></div>
</div>
<!--图片-->
<div v-if="specialist.ads.length > 0">
<!--单图-->
<div v-if="specialist.style==0">
<div v-for="ads in specialist.ads">
<div v-if="ads.miniProgram != ''" v-html='ads.miniProgram'></div>
<div v-else-if="ads.jump_type==1" @click="showReg">
<img class="wp100 block" :src="ads.img"/>
</div>
<a v-else @click="ImgHref(ads)">
<img class="wp100 block" :src="ads.img"/>
</a>
</div>
</div>
<!--左右两张图-->
<div class="fn-flex mb-20" v-if="specialist.style==1">
<div class="fn-flex-item pr10">
<div v-for="(ads,adsIndex) in specialist.ads" v-if="adsIndex%2 == 0">
<div v-if="ads.miniProgram != ''" v-html='ads.miniProgram'></div>
<div v-else-if="ads.jump_type==1" @click="showReg">
<img class="wp100 block" :src="ads.img"/>
</div>
<a v-else @click="ImgHref(ads)">
<img class="wp100 block" :src="ads.img"/>
</a>
</div>
</div>
<div class="fn-flex-item pl10">
<div v-for="(ads,adsIndex) in specialist.ads" v-if="adsIndex%2 != 0">
<div v-if="ads.miniProgram != ''" v-html='ads.miniProgram'></div>
<div v-else-if="ads.jump_type==1" @click="showReg">
<img class="wp100 block" :src="ads.img"/>
</div>
<a v-else @click="ImgHref(ads)">
<img class="wp100 block" :src="ads.img"/>
</a>
</div>
</div>
</div>
<!--三张LOGO图-->
<div class="fn-flex pt10 pb10" v-if="specialist.style==2">
<div class="fn-flex-item pl5 pr5">
<div class="mt10" v-for="(ads,adsIndex) in specialist.ads" v-if="adsIndex%3 == 0">
<div v-if="ads.miniProgram != ''" v-html='ads.miniProgram'></div>
<div v-else-if="ads.jump_type==1" @click="showReg">
<img class="wp100 block" :src="ads.img"/>
</div>
<a v-else :href="ads.url">
<img class="wp100 block bds-f3" :src="ads.img"/>
</a>
</div>
</div>
<div class="fn-flex-item pl5 pr5">
<div class="mt10" v-for="(ads,adsIndex) in specialist.ads" v-if="adsIndex%3 == 1">
<div v-if="ads.miniProgram != ''" v-html='ads.miniProgram'></div>
<div v-else-if="ads.jump_type==1" @click="showReg">
<img class="wp100 block" :src="ads.img"/>
</div>
<a v-else :href="ads.url">
<img class="wp100 block bds-f3" :src="ads.img"/>
</a>
</div>
</div>
<div class="fn-flex-item pl5 pr5">
<div class="mt10" v-for="(ads,adsIndex) in specialist.ads" v-if="adsIndex%3 == 2">
<div v-if="ads.miniProgram != ''" v-html='ads.miniProgram'></div>
<div v-else-if="ads.jump_type==1" @click="showReg">
<img class="wp100 block" :src="ads.img"/>
</div>
<a v-else :href="ads.url">
<img class="wp100 block bds-f3" :src="ads.img"/>
</a>
</div>
</div>
</div>
</div>
<!--报名-->
<div v-if="specialist.type == 'enroll'">
<div class="bg-f5e5e5 mt20 pt15 pb15 ulib-r10" v-if="specialist.record.length>0">
<div class="relative j-swiper">
<div class="swiper-container left-0 top-0">
<div class="swiper-wrapper">
<div class="swiper-slide bg-f5e5e5 pl30 pr30"
v-for="item in specialist.record">
<div class="text-center font-24 color-980002 text-nowrap"
:style="'color:'+bg_color">{{item}}
</div>
</div>
</div>
</div>
</div>
</div>
<div class="pl160 bbs-eee relative">
<div class="absolute left-0 box-middle font-30">报名昵称</div>
<div><input class="wp100 inp-reg pt30 pb30 font-30" type="text" v-model="name"
placeholder="请输入报名昵称"/></div>
</div>
<div class="pl160 bbs-eee relative pr200">
<div class="absolute left-0 box-middle font-30">手机号码</div>
<div><input class="wp100 inp-reg pt30 pb30 font-30" type="tel" v-model="telPhone"
placeholder="请输入手机号"/></div>
<button v-if="specialist.if_code==0"
:class="[codeState ?'color-980002':'color-999','absolute right-0 bg-none border-none box-middle font-30']"
:style="codeState?'color:'+mButton.b_color:''"
:disabled="!codeState" @click="getcode(specialist.status.value)">{{codeTx}}
</button>
</div>
<div class="pl160 bbs-eee relative" v-if="specialist.if_code==0">
<div class="absolute left-0 box-middle font-30">验证码</div>
<div><input class="wp100 inp-reg pt30 pb30 font-30" type="number" v-model="vCode"
placeholder="请输入验证码"/></div>
</div>
<div class="pt40 text-center">
<button class="wp100 bg-9d0002 border-none pt20 pb20 font-32 color-fff ulib-r10"
:style="'background-color:'+mButton.b_color"
@click="submit(modIndex)">{{specialist.status.title}}
</button>
</div>
</div>
</div>
</div>
</block>
</div>
<div class="text-center pt40 pb40 font-22 color-bbb">
<span class="pl5 pr5 text-middle">Powered by</span>
<img class='inline-block img-30x21 text-middle'
src='https://qs.liche.cn/wechat_app/common/hdy-logo-gray.png'/>
<span class="pl5 pr5 text-middle">狸车科技</span>
</div>
<div class="fixed top-0 right-0 mt110 z-index-4">
<a v-if="mCountdown.b_s_time" class="relative viewlive ulib-rl10" @click="showCode" href="javascript:">
<div class="absolute left-0 pl15 pb5 box-middle"><img class='inline-block img-52x52 text-middle'
src='/img/h5/syt/icon-live.gif'/></div>
<div class="absolute right-0 pt5 pr10 box-middle font-18 color-fff">
<div>订阅</div>
<div>直播</div>
</div>
</a>
<a v-if="posters" class="relative mt10 viewlive ulib-rl10"
:href="'/h5/syt/special/poster?skey='+c_skey">
<div class="absolute left-0 pl15 pb5 box-middle"><img class='inline-block img-52x52 text-middle'
src='/img/h5/syt/icon-poster.gif'/></div>
<div class="absolute right-0 pt5 pr10 box-middle font-18 color-fff">
<div>分享</div>
<div>海报</div>
</div>
</a>
<a v-if="t_skey!= ''" class="relative mt10 viewlive ulib-rl10"
:href="'/h5/syt/team/mine?skey='+t_skey">
<div class="absolute left-0 pl15 pb5 box-middle"><img class='inline-block img-52x52 text-middle'
src='/img/h5/syt/icon-team.png'/></div>
<div class="absolute right-0 pt5 pr10 box-middle font-18 color-fff">
<div>我的</div>
<div>团队</div>
</div>
</a>
<a v-if="uid && !mp_app_id && ebiz" class="fixed icon-mine img-cover z-index-4"
style="background-image:url(/img/h5/syt/icon-mine.png);" @click="showLoginCode"
href="javascript:"></a>
</div>
<div v-if="mCountdown.b_e_time > 0 || mButton.b_title">
<div style="height:70px;"></div>
<div class="fixed left-0 bottom-0 right-0 bg-000-op80 pl30 pr30 text-center z-index-4"
style="height:65px;padding-top:10px;">
<div v-if="mButton.type == 2"
style="width:100%;height:45px;background-color:#f55537;-webkit-border-radius:750px;border-radius:750px;">
<button @click="showReg"
style="width:100%;height:45px;background-color:<?= $topic['mButton']['b_color'] ?>;border:none;line-height:45px;font-size:16px;color:#fff;-webkit-border-radius:750px;border-radius:750px;">
{{mButton.b_title}}
</button>
</div>
<div v-else-if="mCountdown.b_e_time > 0"
class="absolute left-0 right-0 box-middle text-center font-24 color-fff">
<span class="text-middle" v-html="showTime"></span>
<a class="inline-block ml10 pt15 pb15 pl20 pr20 text-middle color-fff ulib-r750"
:style="'background-color:'+mButton.b_color" @click="showCode" href="javascript:">
<img class='inline-block img-30x30 text-middle' src='/img/h5/syt/icon-live2.png'/>
<span class="text-middle">订阅直播</span>
</a>
</div>
<div v-else
style="width:100%;height:45px;background-color:#f55537;-webkit-border-radius:750px;border-radius:750px;">
<div v-if="mButton.b_ghid">
<wx-open-launch-weapp @error="handleErrorFn" @launch="handleLaunchFn" id="launch-btn"
:username="mButton.b_ghid"
:path="mButton.b_url">
<script type="text/wxtag-template" v-if="mButton.type == 0">
<button style="min-width:250px;width:100%;height:45px;background-color:<?= $topic['mButton']['b_color'] ?>;border:none;line-height:45px;font-size:16px;color:#fff;-webkit-border-radius:750px;border-radius:750px;">
{{mButton.b_title}}
</button>
</script>
<script type="text/wxtag-template" v-else>
<img src="<?= $topic['mButton']['b_img'] ?>" style="width:100%;height:45px;">
</script>
</wx-open-launch-weapp>
</div>
<div v-else>
<button v-if="mButton.type == 0" @click="watch(mButton.b_url,mButton.b_url_mini)"
style="width:100%;height:45px;background-color:<?= $topic['mButton']['b_color'] ?>;border:none;line-height:45px;font-size:16px;color:#fff;-webkit-border-radius:750px;border-radius:750px;">
{{mButton.b_title}}
</button>
<img @click="watch(mButton.b_url,mButton.b_url_mini)" v-else :src="mButton.b_img"
style="width:100%;height:60px;">
</div>
</div>
</div>
</div>
</div>
<div class="msg fn-hide" :style="msgisShowCode?'display:block':'display:none'" v-if="msgisShowCode">
<div class="msgBg" @click="closeCode"></div>
<div class="msgMain">
<div class="content">
<div class="word">
<div class="pt10 text-center">
<img v-if="qrcode" class='inline-block img-220x220' :src='qrcode'/>
</div>
<div class="pt30 pb20 pl20 pr20 font-24 color-666 line-height-15"><img
class='inline-block mr5 text-middle img-50x50' src='/img/h5/syt/icon-finger.png'/>长按识别二维码,关注{{mp_app_name}}服务号。即可接收直播提醒,还有更多福利不定期放送哦~
</div>
</div>
<div class="opt pl40 pr40">
<a class="block pt25 pb25 text-center font-32 color-fff ulib-r750" style="background-color:#f55537;"
@click="closeCode" href="javascript:">知道了</a>
</div>
</div>
</div>
</div>
<div class="msg fn-hide" :style="msgisLoginShowCode?'display:block':'display:none'" v-if="msgisLoginShowCode">
<div class="msgBg" @click="closeLoginCode"></div>
<div class="msgMain">
<div class="content">
<div class="word">
<div class="font-36 text-center">绑定手机号</div>
<div class="mt30 relative bg-f6 ulib-r10">
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="tel"
v-model="logintelPhone" placeholder="请输入常用手机号码"/>
</div>
<div class="mt30 relative bg-f6 ulib-r10 pr200">
<div><input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="number"
v-model="loginvCode" placeholder="请输入验证码"/></div>
<button :class="[logincodeState ?'color-980002':'color-999','absolute right-0 bg-none border-none box-middle font-30']"
:style="codeState?'color:'+mButton.b_color:''"
:disabled="!logincodeState" @click="getlogincode()">{{logincodeTx}}
</button>
</div>
</div>
<div class="mt20 opt pl40 pr40">
<a class="block pt25 pb25 text-center font-32 color-fff ulib-r750"
:style="'background-color:'+mButton.b_color"
@click="loginsubmit()" href="javascript:">确定</a>
</div>
</div>
</div>
</div>
<div class="msg fn-hide" :style="msgisRegShow?'display:block':'display:none'" v-if="msgisRegShow && msgisReg">
<div class="msgBg" @click="closeReg"></div>
<div class="msgMain">
<div class="content">
<div class="word">
<div class="font-36 text-center">{{msgisReg.title}}</div>
<div class="mt30 relative bg-f6 ulib-r10">
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="text" v-model="name"
placeholder="请输入报名昵称"/>
</div>
<div class="mt30 relative bg-f6 ulib-r10">
<input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="tel" v-model="telPhone"
placeholder="请输入手机号"/>
</div>
<div class="mt30 relative bg-f6 ulib-r10 pr200" v-if="msgisReg.if_code==0">
<div><input class="wp100 inner30 font-30 bg-f6 border-none ulib-r10" type="number"
v-model="vCode" placeholder="请输入验证码"/></div>
<button :class="[codeState ?'color-980002':'color-999','absolute right-0 bg-none border-none box-middle font-30']"
:style="codeState?'color:'+mButton.b_color:''"
:disabled="!codeState" @click="getcode(msgisReg.status.value)">{{codeTx}}
</button>
</div>
</div>
<div class="mt20 opt pl40 pr40">
<a class="block pt25 pb25 text-center font-32 color-fff ulib-r750"
:style="'background-color:'+mButton.b_color" @click="submit(0)">{{msgisReg.status.title}}</a>
</div>
</div>
</div>
</div>
</div>
<? if ($topic['stat_code']) { ?>
<div style="display: none">
<?= $topic['stat_code'] ?>
</div>
<? } ?>
<script type="text/javascript">
var loading = 0;
var app = new Vue({
el: '#app',
data: <?=json_encode($topic)?>,
computed: {
//用计算属性显示结果
showTime() {
if (this.mCountdown.b_e_time <= 0) {//剩余秒数<=0
return "已结束";
} else { // 剩余秒数>0
let day = Math.floor(this.mCountdown.b_e_time / 86400);
let hour = Math.floor((this.mCountdown.b_e_time % 86400) / 3600);
let min = Math.floor(((this.mCountdown.b_e_time % 86400) % 3600) / 60);
let sec = Math.floor(((this.mCountdown.b_e_time % 86400) % 3600) % 60);
return ("<span class='text-middle'><?= $topic['mCountdown']['b_title'] ?></span><em class='time-pin ulib-r5' style='background-color:#fe506a'>" + day + "</em><em class='text-middle'>天</em><em class='time-pin ulib-r5' style='background-color:#fe506a'>" + (hour < 10 ? "0" : "") + hour + "</em><em class='text-middle'>时</em><em class='time-pin ulib-r5' style='background-color:#fe506a'>" + (min < 10 ? "0" : "") + min + "</em><em class='text-middle'>分</em><em class='time-pin ulib-r5' style='background-color:#fe506a'>" + (sec <
10 ? "0" : "") + sec + "</em><em class='text-middle'>秒</em>");
}
},
},
mounted() {
var Timer;
var swiper = new Swiper('.j-swiper .swiper-container', {
loop: true,
direction: 'vertical',
autoplay: {
delay: 3000,
stopOnLastSlide: false,
disableOnInteraction: true,
}
});
this.bundleIntervalEvent = setInterval(this.intervalEvent, 1000);
let that = this;
// $.ajax({
// url: '/h5/syt/special/ckbind',
// type: 'post',
// dataType: 'json',
// success: function (data) {
// if (data.code == 200) {
// that.needLogin = data.data.needLogin;
// }
// },
// });
},
beforeDestroy() {
clearInterval(this.bundleIntervalEvent);
},
methods: {
ImgHref: function (value) {
if (value.url) {
if (value.is_item && this.needLogin) {
this.loginBackurl = value.url;
this.showLoginCode();
} else {
window.location.href = value.url;
}
}
},
showReg: function () {
this.msgisRegShow = true
},
closeReg: function () {
this.msgisRegShow = false
},
showCode: function () {
let that = this;
if (that.subscribemsg == '已订阅直播') {
mDialog.msg({content: that.subscribemsg});
return;
}
if (!that.mp_app_id) {
window.location.href = "" + that.subscribemsg;
return;
}
that.msgisShowCode = true;
$.ajax({
url: '/h5/syt/special/qrcode',
type: 'post',
dataType: 'json',
data: {
a_id: that.a_id,
cf_uid: that.cf_uid,
biz_id: that.biz_id,
skey: that.a_skey,
mp_app_id: that.mp_app_id
},
beforeSend: function () {
},
success: function (data) {
if (data.code == 200) {
that.qrcode = data.qrcode;
}
},
complete: function () {
}
});
},
showLoginCode: function () {
if (this.needLogin) {
this.msgisLoginShowCode = true
} else {
window.location.href = "/h5/syt/ucenter?__skey=" + this.a_skey;
}
},
closeLoginCode: function () {
this.msgisLoginShowCode = false
},
/**
* 登录生成倒计时
*/
loginIntervalEvent() {
if (this.e_time > 0) {
this.e_time--;
} else {
clearInterval(this.loginBundleIntervalEvent);
}
},
loginCountDownTime(time) {
let that = this;
if (time > 1) {
time--;
this.logincodeState = false;
this.logincodeTx = time + "s后重新获取";
loginTimer = setTimeout(function () {
that.loginCountDownTime(time);
}, 1000)
} else {
clearTimeout(loginTimer);
that.logincodeState = true;
that.logincodeTx = "获取验证码";
}
},
getlogincode() {
if (!/^1[3456789]\d{9}$/.test(this.logintelPhone)) {
mDialog.msg({content: "请输入正确手机号"});
} else {
var that = this;
$.ajax({
url: '/h5/syt/special/mcode',
type: 'get',
dataType: 'json',
data: {mobile: this.logintelPhone, type: 'login'},
beforeSend: function () {
},
success: function (data) {
mDialog.msg({content: data.msg});
if (200 == data['code']) {
//按钮倒计时
that.loginCountDownTime(30)
}
},
complete: function () {
}
});
}
},
loginsubmit() {
if (this.isSubmiting) return;
if (!/^1[3456789]\d{9}$/.test(this.logintelPhone)) {
mDialog.msg({content: "请输入正确手机号"});
} else if (!this.loginvCode) {
mDialog.msg({content: "请输入验证码"});
} else {
var that = this
this.isSubmiting = true
var loading = mDialog.load({
shade: false,
text: "",
});
$.ajax({
url: '/h5/syt/special/bind',
type: 'post',
dataType: 'json',
data: {
mobile: this.logintelPhone, code: this.loginvCode
},
success: function (data) {
loading && mDialog.close(loading); //关闭加载
mDialog.msg({content: data.msg, pause: 8000});
if (200 == data['code']) {
if (that.loginBackurl) {
window.location.href = that.loginBackurl;
} else {
window.location.href = "/h5/syt/ucenter?__skey=" + that.a_skey;
}
}
},
complete: function () {
that.isSubmiting = false;
}
});
//mDialog.close(loading); //关闭加载
//this.closeLoginCode() //关闭弹框
}
},
closeCode: function () {
this.msgisShowCode = false
window.location.href = "" + this.subscribemsg;//跳转一次性订阅
},
/**
* 生成倒计时
*/
intervalEvent() {
if (this.mCountdown.b_e_time > 0) {
this.mCountdown.b_e_time--;
} else {
clearInterval(this.bundleIntervalEvent);
}
},
handleErrorFn(e) {
mDialog.msg({content: e.detail});
},
handleLaunchFn(e) {
this.watch('', '');
},
watch(url, url_mini) {
let that = this;
$.ajax({
url: '/h5/syt/special/watch',
type: 'post',
dataType: 'json',
data: {a_id: that.a_id, cf_uid: that.cf_uid, biz_id: that.biz_id},
beforeSend: function () {
},
success: function (data) {
},
complete: function () {
if (url) {
var ua = navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == "micromessenger") {//ios的ua中无miniProgram,但都有MicroMessenger(表示是微信浏览器)
wx.miniProgram.getEnv(function (res) {
if (res.miniprogram && url_mini) {
wx.miniProgram.navigateTo({
url: url_mini,//跳转回小程序的页面
success: function () {
console.log('success');
},
fail: function () {
console.log('fail');
}
});
} else {
location.href = url;
}
});
} else {
location.href = url;
}
}
}
});
},
countDownTime(time) {
let that = this;
if (time > 1) {
time--;
this.codeState = false;
this.codeTx = time + "s后重新获取";
Timer = setTimeout(function () {
that.countDownTime(time);
}, 1000)
} else {
clearTimeout(Timer);
that.codeState = true;
that.codeTx = "获取验证码";
}
},
getcode(status) {
if (status != 0) return;
let that = this;
var mobile = that.telPhone;
if (!/^1\d{10}$/.test(mobile)) {
mDialog.msg({content: "请输入正确手机号"})
} else {
$.ajax({
url: '/h5/syt/special/mcode',
type: 'get',
dataType: 'json',
data: {mobile: mobile, title: "<?= $_title ?>"},
beforeSend: function () {
},
success: function (data) {
mDialog.msg({content: data.msg});
if (200 == data['code']) {
that.countDownTime(30); //按钮倒计时
}
loading && mDialog.close(loading); //关闭加载
},
complete: function () {
}
});
}
},
submit(index) {
let that = this;
var status = 1;
var if_code = 0;
if (index) {
status = that.list[index].status.value;
if_code = that.list[index].if_code;
} else {
status = that.msgisReg.status.value;
if_code = that.msgisReg.if_code;
}
if (that.isSubmiting || status != 0) return;
var mobile = that.telPhone;
if (!that.name) {
mDialog.msg({content: "请输入昵称"})
} else if (!/^1\d{10}$/.test(mobile)) {
mDialog.msg({content: "请输入正确手机号"})
} else if (!that.vCode && !if_code) {
mDialog.msg({content: "请输入验证码"})
} else {
that.isSubmiting = true;
loading = mDialog.load({shade: false, text: "",});
$.ajax({
url: '/h5/syt/special/enroll',
type: 'post',
dataType: 'json',
data: {
mobile: mobile,
code: that.vCode,
nickname: that.name,
a_id: that.a_id,
cf_uid: that.cf_uid,
biz_id: that.biz_id,
uid: that.uid,
if_code: if_code,
},
beforeSend: function () {
},
success: function (data) {
mDialog.msg({content: data.msg});
if (200 == data['code']) {
if (index) {
that.list[index].status.title = "已报名";
that.list[index].status.value = 1;
} else {
that.msgisReg.status.title = "已报名";
that.msgisReg.status.value = 1;
that.closeReg();
}
if (that.a_id == 17) {//统计
meteor.track('form', {convert_id: 1699532670201934});
}else if (that.a_id == 18) {
formSuccess();
}
}
},
complete: function () {
that.isSubmiting = false;
loading && mDialog.close(loading); //关闭加载
}
});
}
},
},
})
</script>
<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']?>', // 分享标题
desc: '<?=$share['desc']?>', // 分享描述
link: '<?=$share['url']?>', // 分享链接
imgUrl: '<?=$share['img']?>', // 分享图标
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>