You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zhishifufei_php/application/wap/view/first/spread/become_promoter.html

97 lines
4.4 KiB

10 months ago
<!-- +---------------------------------------------------------------------- -->
<!-- | 天诚科技 [ 刘海东 17600099397赋能开发者,助力企业发展 ] -->
<!-- +---------------------------------------------------------------------- -->
<!-- | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -->
<!-- +---------------------------------------------------------------------- -->
<!-- | Licensed 该系统并不是自由软件,未经许可不能去掉相关版权 -->
<!-- +---------------------------------------------------------------------- -->
<!-- | Author:甘肃天诚志信电子商务有限公司 刘海东 联系电话维系17600099397 -->
<!-- +---------------------------------------------------------------------- -->
{extend name="public/container"}
{block name='head_top'}
<style>
body{background-color:#fff;}
</style>
{/block}
{block name='title'}开启学习旅程{/block}
{block name="content"}
<div class="become-promoter" id="app">
<div style="text-align: center">
<img :src="logo" height="120">
</div>
<div class="phone">
<ul class="list">
<li class="item"><input type="text" placeholder="输入手机号" v-model="phone"></li>
<li class="item itemCode acea-row row-between-wrapper">
<input type="number" placeholder="输入验证码" v-model="code_num">
<button class="code acea-row row-center-wrapper" :disabled="active" :class="active == true?'on':''" @click="code" v-text="timetext">获取验证码</button>
</li>
</ul>
<div class="bnt acea-row row-center-wrapper" @click="save_promoter">加入学习</div>
</div>
<quick-menu></quick-menu>
</div>
{/block}
{block name="foot"}
<script>
var spread_uid={$spread_uid},logo='{$home_logo}';
require(['vue','helper','store','reg-verify','{__WAP_PATH}zsff/js/quick.js'],function(Vue,$h,app,$reg) {
new Vue({
el: '#app',
data: {
active:false,
timetext:'获取验证码',
phone:'',
code_num:'',
logo: logo
},
methods:{
save_promoter:function(){
var that=this;
if(!this.phone) return $h.pushMsgOnce('请输入手机号码');
if(!$reg.isPhone(this.phone)) return $h.pushMsgOnce('您输入的手机号码不正确');
if(!that.code_num) return $h.pushMsgOnce('请输入验证码');
$h.loadFFF();
app.basePost($h.U({c:'spread',a:'save_promoter',q:{spread_uid:spread_uid}}),{phone:this.phone,code:this.code_num},function (res) {
$h.loadClear();
$h.pushMsg(res.data.msg, function () {
window.location.assign($h.U({c:'index',a:'index'}));
});
},function () {
$h.loadClear();
});
},
code:function () {
var that = this;
if(!that.phone) return $h.pushMsgOnce('请输入手机号码');
if(!$reg.isPhone(that.phone)) return $h.pushMsgOnce('请输入正确的手机号码');
that.active = true;
var n = 60;
app.baseGet($h.U({c:'auth_api',a:'code',q:{phone:that.phone}}),function (res){
var data=res.data.data;
if(data.Message=='OK' || data.Code=='OK'){
var run =setInterval(function(){
n--;
if(n<0){
clearInterval(run);
}
that.timetext = "剩余 "+n+"s";
if(that.timetext<"剩余 "+0+"s"){
that.active = false;
that.timetext = "重发";
}
},1000);
}else{
$h.pushMsgOnce(data.Message);
that.active =false;
}
},function (res) {
that.active =false;
});
}
}
});
})
</script>
{/block}