作者 anyv

5

... ... @@ -341,7 +341,7 @@ class PersonalcenterController extends WeChatBaseController{
$data['uid'] = cmf_get_current_user_id();
$inser = Db::name('sale_audit') -> insert($data);
if($inser){
Db::name('my_user') -> where('uid',$data['uid']) -> update(['status'=>5]);
Db::name('my_user') -> where('uid',$data['uid']) -> update(['status'=>5,'phone'=>$data['phone']]);
return 1;
}else{
return 2;
... ... @@ -682,7 +682,36 @@ class PersonalcenterController extends WeChatBaseController{
die(json_encode($result,JSON_UNESCAPED_UNICODE));
}
/**
*判断是否首次提现
*/
public function id_first_withdrawal(){
$uid = cmf_get_current_user_id();
$my_user = Db::name('my_user') -> where('uid',$uid) -> find();
if($my_user['is_withdrawal'] == '1'){
return true;
}else{
return false;
}
}
/**
* 首次提现手机验证码判断
*/
public function is_money_code(){
$uid = cmf_get_current_user_id();
$code = session('code');
if($code == $_POST['yzm']){
Db::name('my_user') -> where('uid',$uid) -> update(['is_withdrawal'=>2]);
return true;
}else{
return false;
}
}
... ...
... ... @@ -89,44 +89,6 @@
</div>
</div>
</div>
<!-- 弹窗 -->
<!--<div class="tx_mask">-->
<!--<div class="tx_maskCon">-->
<!--<div class="tx_maskConImg">-->
<!--<img src="__TMPL__/public/assets/images/90.png" alt=""/>-->
<!--</div>-->
<!--<div class="tx_maskCon2">-->
<!--<div class="log_three_model">-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">配送时间</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入开始配送时间"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">配送时间</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入结束配送时间"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">快递公司</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入快递公司"/>-->
<!--</div>-->
<!--</div>-->
<!--<div class="log_three_model_one time">-->
<!--<div class="log_three_model_left">快递单号</div>-->
<!--<div class="log_psong">-->
<!--<input type="text" value="" placeholder="请输入快递单号"/>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<!--&lt;!&ndash; 确定 &ndash;&gt;-->
<!--<div class="tx_maskOk confirm" data-id="">确定</div>-->
<!--</div>-->
<!--</div>-->
<!--</div>-->
<div class="tx_masktwo" style="display: none;">
<div class="tx_maskCon">
<div class="tx_maskConImg">
... ... @@ -275,11 +237,11 @@
</div>
<a href="{:url('get_one',array('id'=>$vo['id']))}">
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
<div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
<div class="log_three_list_center_left" style="width: 1.44rem;height:1.44rem">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_list_center_right" style="margin-left: 0.16rem;">
<div class="log_three_center_one">
{$i_g.book_name}
</div>
... ... @@ -348,11 +310,11 @@
</div>
<a href="{:url('get_one',array('id'=>$vo['id']))}">
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
<div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
<div class="log_three_list_center_left" style="width: 1.44rem;height:1.44rem">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_list_center_right" style="margin-left: 0.16rem;">
<div class="log_three_center_one">
{$i_g.book_name}
</div>
... ... @@ -421,11 +383,11 @@
</div>
<a href="{:url('get_one',array('id'=>$vo['id']))}">
<foreach name="$vo.indent_goods" item="i_g">
<div class="log_three_list_center">
<div class="log_three_list_center_left">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/>
<div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
<div class="log_three_list_center_left" style="width: 1.44rem;height:1.44rem">
<img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
</div>
<div class="log_three_list_center_right">
<div class="log_three_list_center_right" style="margin-left: 0.16rem;">
<div class="log_three_center_one">
{$i_g.book_name}
</div>
... ... @@ -667,11 +629,11 @@
var indent_goods_data = result[i].indent_goods;
var indent_goods_html = '';
for (var i3 = 0; i3 < indent_goods_data.length; i3++) {
indent_goods_html += "<div class=\"log_three_list_center\">\n" +
" <div class=\"log_three_list_center_left\">\n" +
" <img src=\"{:cmf_get_image_url('')}" + indent_goods_data[i3].thumbnail + "\" alt=\"\"/>\n" +
indent_goods_html += "<div class=\"log_three_list_center\" style=\"display: flex;justify-content: flex-start;\">\n" +
" <div class=\"log_three_list_center_left\" style=\"width: 1.44rem;height:1.44rem\">\n" +
" <img src=\"" + indent_goods_data[i3].thumbnail + "\" alt=\"\" style=\"width: 100%;height: 100%;\"/>\n" +
" </div>\n" +
" <div class=\"log_three_list_center_right\">\n" +
" <div class=\"log_three_list_center_right\" style=\"margin-left: 0.16rem;\">\n" +
" <div class=\"log_three_center_one\">\n" +
" " + indent_goods_data[i3].book_name + "\n" +
" </div>\n" +
... ...
... ... @@ -86,7 +86,7 @@
<div class="tation_towImg">
<img src="{$val.avatar}" alt="">
</div>
<span class="tation_towTxt2">学生</span>
<span class="tation_towTxt2">{$val.user_nickname}</span>
<!--<p class="recordTxt2">平台订单</p>-->
</div>
<p class="recordNum">佣金+{$val.indent_money}</p>
... ...
... ... @@ -9,7 +9,21 @@
<link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
<link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
</head>
<style>
.tx_maskPhone {
display: none;
z-index: 2;
width: 100%;
height: 100%;
position: fixed;
background-color: rgba(0, 0, 0, 0.5);
}
.btn{
margin-top: 0.15rem;
background: #fff;
color: #0090FF;
}
</style>
<body>
<!-- 弹窗 -->
<div class="tx_mask">
... ... @@ -21,7 +35,7 @@
<!-- 输入金额 -->
<input class="tx_maskInput" type="text" placeholder="输入提现金额" id="money" onblur="messagess()"/>
<!-- 确定 -->
<div class="tx_maskOk" onclick="sure_to()">确定</div>
<div class="tx_maskOk tx_maskYeah" onclick="sure_to()">确定</div>
<!-- 提现说明 -->
<div class="tx_maskTxt">
<div class="tx_maskTxt1">
... ... @@ -35,6 +49,25 @@
</div>
</div>
</div>
<div class="tx_maskPhone">
<div class="tx_maskCon">
<div class="tx_maskConImg">
<img src="__TMPL__/public/assets/images/70.png" alt="" />
</div>
<div class="tx_maskCon2">
<!-- 输入手机号 -->
<input class="tx_maskInput" style="margin-bottom: 0.25rem;" type="text" placeholder="请输入手机号" maxlength="11" id="phone" onblur="checkPhone()" />
<input class="tx_maskInput" style="margin-bottom: 0.25rem;" id="Ver_code" type="text" placeholder="请输入验证码" />
<input type="button" class="btn" id="code" value="获取验证码" onclick="codeButton()">
<!-- 确定 -->
<div class="tx_maskOk tx_maskYes" onclick="Message_validation()">确定</div>
</div>
</div>
</div>
<div class="log_nine_top">
<div class="log_top_co">
<!-- 顶部 -->
... ... @@ -144,6 +177,9 @@
</if>
</div>
<!-- 按钮 -->
<div class="log_seven_btn">
... ... @@ -156,6 +192,29 @@
<script src="__TMPL__/public/assets/js/base.js"></script>
<script>
/**
*手机号验证点击确定时
*/
function Message_validation(){
yzm = $('#Ver_code').val();
phone = $('#phone').val();
if(yzm == ''){
alert('请输入验证码');
}else if(phone == ''){
alert('请输入手机号');
}else{
$.post("{:url('Personalcenter/is_money_code')}",{yzm:yzm},function(data){
if(data){
}else{
alert('验证码错误!');
}
});
}
}
</script>
<script>
/**
*当光标离开
*/
function messagess(){
... ... @@ -163,7 +222,7 @@
if(money < 0){
alert('提现金额错误');
}else if(money>{$balance}){
alert('提现金额超出余额');
alert('提现金额超出余额');
}
}
... ... @@ -190,16 +249,76 @@
}
</script>
<script>
<!--验证弹窗-->
var state;
$.post("{:url('Personalcenter/id_first_withdrawal')}",{},function(data){
state = data
});
$(".log_seven_btn_contant").click(function() {
$(".tx_mask").css({
display: "block"
if(state != false){
$(".tx_maskPhone").css("display","block");
}else{
$(".tx_mask").css("display","block");
return false;
}
});
// 提现弹窗
$(".tx_maskYeah").click(function () {
$(".tx_mask").css("display","none");
$(".tx_maskPhone").css("display","none");
});
$(".tx_maskOk").click(function() {
$(".tx_mask").css({
display: "none"
// 手机验证弹窗
$(".tx_maskYes").click(function(){
var one = $("#phone").val();
var two = $("#Ver_code").val();
if(one!=""&&two!=""){
$(".tx_maskPhone").css("display","none");
$(".tx_mask").css("display","block")
}else{
return false;
console.log(123)
}
});
function checkPhone() {
var phone = document.getElementById('phone').value;
if(!(/^1[34578]\d{9}$/.test(phone))) {
alert("手机号码有误,请重填");
return false;
}
}
//短信验证码
function codeButton() {
var code = $("#code");
code.attr("disabled", "disabled");
phone = $('#phone').val();
if(phone == ''){
alert('手机号不能为空');
}else{
$.post("{:url('Personalcenter/send_message')}",{phone:phone},function(data){
if(data){
setTimeout(function() {
code.css("opacity", "0.8");
}, 1000);
var time = 60;
var set = setInterval(function() {
code.val("(" + --time + ")秒后重新获取");
}, 1000);
setTimeout(function() {
code.attr("disabled", false).val("重新获取验证码");
clearInterval(set);
}, 60000);
}else{
alert('发送失败!');
}
});
}
}
</script>
</body>
... ...