作者 anyv

5

@@ -341,7 +341,7 @@ class PersonalcenterController extends WeChatBaseController{ @@ -341,7 +341,7 @@ class PersonalcenterController extends WeChatBaseController{
341 $data['uid'] = cmf_get_current_user_id(); 341 $data['uid'] = cmf_get_current_user_id();
342 $inser = Db::name('sale_audit') -> insert($data); 342 $inser = Db::name('sale_audit') -> insert($data);
343 if($inser){ 343 if($inser){
344 - Db::name('my_user') -> where('uid',$data['uid']) -> update(['status'=>5]); 344 + Db::name('my_user') -> where('uid',$data['uid']) -> update(['status'=>5,'phone'=>$data['phone']]);
345 return 1; 345 return 1;
346 }else{ 346 }else{
347 return 2; 347 return 2;
@@ -682,7 +682,36 @@ class PersonalcenterController extends WeChatBaseController{ @@ -682,7 +682,36 @@ class PersonalcenterController extends WeChatBaseController{
682 die(json_encode($result,JSON_UNESCAPED_UNICODE)); 682 die(json_encode($result,JSON_UNESCAPED_UNICODE));
683 } 683 }
684 684
  685 + /**
  686 + *判断是否首次提现
  687 + */
  688 + public function id_first_withdrawal(){
  689 +
  690 + $uid = cmf_get_current_user_id();
  691 + $my_user = Db::name('my_user') -> where('uid',$uid) -> find();
  692 + if($my_user['is_withdrawal'] == '1'){
  693 + return true;
  694 + }else{
  695 + return false;
  696 + }
  697 +
  698 + }
685 699
  700 + /**
  701 + * 首次提现手机验证码判断
  702 + */
  703 + public function is_money_code(){
  704 +
  705 + $uid = cmf_get_current_user_id();
  706 + $code = session('code');
  707 + if($code == $_POST['yzm']){
  708 + Db::name('my_user') -> where('uid',$uid) -> update(['is_withdrawal'=>2]);
  709 + return true;
  710 + }else{
  711 + return false;
  712 + }
  713 +
  714 + }
686 715
687 716
688 717
@@ -89,44 +89,6 @@ @@ -89,44 +89,6 @@
89 </div> 89 </div>
90 </div> 90 </div>
91 </div> 91 </div>
92 -<!-- 弹窗 -->  
93 -<!--<div class="tx_mask">-->  
94 -<!--<div class="tx_maskCon">-->  
95 -<!--<div class="tx_maskConImg">-->  
96 -<!--<img src="__TMPL__/public/assets/images/90.png" alt=""/>-->  
97 -<!--</div>-->  
98 -<!--<div class="tx_maskCon2">-->  
99 -<!--<div class="log_three_model">-->  
100 -<!--<div class="log_three_model_one time">-->  
101 -<!--<div class="log_three_model_left">配送时间</div>-->  
102 -<!--<div class="log_psong">-->  
103 -<!--<input type="text" value="" placeholder="请输入开始配送时间"/>-->  
104 -<!--</div>-->  
105 -<!--</div>-->  
106 -<!--<div class="log_three_model_one time">-->  
107 -<!--<div class="log_three_model_left">配送时间</div>-->  
108 -<!--<div class="log_psong">-->  
109 -<!--<input type="text" value="" placeholder="请输入结束配送时间"/>-->  
110 -<!--</div>-->  
111 -<!--</div>-->  
112 -<!--<div class="log_three_model_one time">-->  
113 -<!--<div class="log_three_model_left">快递公司</div>-->  
114 -<!--<div class="log_psong">-->  
115 -<!--<input type="text" value="" placeholder="请输入快递公司"/>-->  
116 -<!--</div>-->  
117 -<!--</div>-->  
118 -<!--<div class="log_three_model_one time">-->  
119 -<!--<div class="log_three_model_left">快递单号</div>-->  
120 -<!--<div class="log_psong">-->  
121 -<!--<input type="text" value="" placeholder="请输入快递单号"/>-->  
122 -<!--</div>-->  
123 -<!--</div>-->  
124 -<!--</div>-->  
125 -<!--&lt;!&ndash; 确定 &ndash;&gt;-->  
126 -<!--<div class="tx_maskOk confirm" data-id="">确定</div>-->  
127 -<!--</div>-->  
128 -<!--</div>-->  
129 -<!--</div>-->  
130 <div class="tx_masktwo" style="display: none;"> 92 <div class="tx_masktwo" style="display: none;">
131 <div class="tx_maskCon"> 93 <div class="tx_maskCon">
132 <div class="tx_maskConImg"> 94 <div class="tx_maskConImg">
@@ -275,11 +237,11 @@ @@ -275,11 +237,11 @@
275 </div> 237 </div>
276 <a href="{:url('get_one',array('id'=>$vo['id']))}"> 238 <a href="{:url('get_one',array('id'=>$vo['id']))}">
277 <foreach name="$vo.indent_goods" item="i_g"> 239 <foreach name="$vo.indent_goods" item="i_g">
278 - <div class="log_three_list_center">  
279 - <div class="log_three_list_center_left">  
280 - <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/> 240 + <div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
  241 + <div class="log_three_list_center_left" style="width: 1.44rem;height:1.44rem">
  242 + <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
281 </div> 243 </div>
282 - <div class="log_three_list_center_right"> 244 + <div class="log_three_list_center_right" style="margin-left: 0.16rem;">
283 <div class="log_three_center_one"> 245 <div class="log_three_center_one">
284 {$i_g.book_name} 246 {$i_g.book_name}
285 </div> 247 </div>
@@ -348,11 +310,11 @@ @@ -348,11 +310,11 @@
348 </div> 310 </div>
349 <a href="{:url('get_one',array('id'=>$vo['id']))}"> 311 <a href="{:url('get_one',array('id'=>$vo['id']))}">
350 <foreach name="$vo.indent_goods" item="i_g"> 312 <foreach name="$vo.indent_goods" item="i_g">
351 - <div class="log_three_list_center">  
352 - <div class="log_three_list_center_left">  
353 - <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/> 313 + <div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
  314 + <div class="log_three_list_center_left" style="width: 1.44rem;height:1.44rem">
  315 + <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
354 </div> 316 </div>
355 - <div class="log_three_list_center_right"> 317 + <div class="log_three_list_center_right" style="margin-left: 0.16rem;">
356 <div class="log_three_center_one"> 318 <div class="log_three_center_one">
357 {$i_g.book_name} 319 {$i_g.book_name}
358 </div> 320 </div>
@@ -421,11 +383,11 @@ @@ -421,11 +383,11 @@
421 </div> 383 </div>
422 <a href="{:url('get_one',array('id'=>$vo['id']))}"> 384 <a href="{:url('get_one',array('id'=>$vo['id']))}">
423 <foreach name="$vo.indent_goods" item="i_g"> 385 <foreach name="$vo.indent_goods" item="i_g">
424 - <div class="log_three_list_center">  
425 - <div class="log_three_list_center_left">  
426 - <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt=""/> 386 + <div class="log_three_list_center" style="display: flex;justify-content: flex-start;">
  387 + <div class="log_three_list_center_left" style="width: 1.44rem;height:1.44rem">
  388 + <img src="{:cmf_get_image_url($i_g.thumbnail)}" alt="" style="width: 100%;height: 100%;"/>
427 </div> 389 </div>
428 - <div class="log_three_list_center_right"> 390 + <div class="log_three_list_center_right" style="margin-left: 0.16rem;">
429 <div class="log_three_center_one"> 391 <div class="log_three_center_one">
430 {$i_g.book_name} 392 {$i_g.book_name}
431 </div> 393 </div>
@@ -667,11 +629,11 @@ @@ -667,11 +629,11 @@
667 var indent_goods_data = result[i].indent_goods; 629 var indent_goods_data = result[i].indent_goods;
668 var indent_goods_html = ''; 630 var indent_goods_html = '';
669 for (var i3 = 0; i3 < indent_goods_data.length; i3++) { 631 for (var i3 = 0; i3 < indent_goods_data.length; i3++) {
670 - indent_goods_html += "<div class=\"log_three_list_center\">\n" +  
671 - " <div class=\"log_three_list_center_left\">\n" +  
672 - " <img src=\"{:cmf_get_image_url('')}" + indent_goods_data[i3].thumbnail + "\" alt=\"\"/>\n" + 632 + indent_goods_html += "<div class=\"log_three_list_center\" style=\"display: flex;justify-content: flex-start;\">\n" +
  633 + " <div class=\"log_three_list_center_left\" style=\"width: 1.44rem;height:1.44rem\">\n" +
  634 + " <img src=\"" + indent_goods_data[i3].thumbnail + "\" alt=\"\" style=\"width: 100%;height: 100%;\"/>\n" +
673 " </div>\n" + 635 " </div>\n" +
674 - " <div class=\"log_three_list_center_right\">\n" + 636 + " <div class=\"log_three_list_center_right\" style=\"margin-left: 0.16rem;\">\n" +
675 " <div class=\"log_three_center_one\">\n" + 637 " <div class=\"log_three_center_one\">\n" +
676 " " + indent_goods_data[i3].book_name + "\n" + 638 " " + indent_goods_data[i3].book_name + "\n" +
677 " </div>\n" + 639 " </div>\n" +
@@ -86,7 +86,7 @@ @@ -86,7 +86,7 @@
86 <div class="tation_towImg"> 86 <div class="tation_towImg">
87 <img src="{$val.avatar}" alt=""> 87 <img src="{$val.avatar}" alt="">
88 </div> 88 </div>
89 - <span class="tation_towTxt2">学生</span> 89 + <span class="tation_towTxt2">{$val.user_nickname}</span>
90 <!--<p class="recordTxt2">平台订单</p>--> 90 <!--<p class="recordTxt2">平台订单</p>-->
91 </div> 91 </div>
92 <p class="recordNum">佣金+{$val.indent_money}</p> 92 <p class="recordNum">佣金+{$val.indent_money}</p>
@@ -9,7 +9,21 @@ @@ -9,7 +9,21 @@
9 <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" /> 9 <link rel="stylesheet" href="__TMPL__/public/assets/css/reset.css" />
10 <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" /> 10 <link rel="stylesheet" href="__TMPL__/public/assets/css/log.css" />
11 </head> 11 </head>
12 - 12 +<style>
  13 + .tx_maskPhone {
  14 + display: none;
  15 + z-index: 2;
  16 + width: 100%;
  17 + height: 100%;
  18 + position: fixed;
  19 + background-color: rgba(0, 0, 0, 0.5);
  20 + }
  21 + .btn{
  22 + margin-top: 0.15rem;
  23 + background: #fff;
  24 + color: #0090FF;
  25 + }
  26 +</style>
13 <body> 27 <body>
14 <!-- 弹窗 --> 28 <!-- 弹窗 -->
15 <div class="tx_mask"> 29 <div class="tx_mask">
@@ -21,7 +35,7 @@ @@ -21,7 +35,7 @@
21 <!-- 输入金额 --> 35 <!-- 输入金额 -->
22 <input class="tx_maskInput" type="text" placeholder="输入提现金额" id="money" onblur="messagess()"/> 36 <input class="tx_maskInput" type="text" placeholder="输入提现金额" id="money" onblur="messagess()"/>
23 <!-- 确定 --> 37 <!-- 确定 -->
24 - <div class="tx_maskOk" onclick="sure_to()">确定</div> 38 + <div class="tx_maskOk tx_maskYeah" onclick="sure_to()">确定</div>
25 <!-- 提现说明 --> 39 <!-- 提现说明 -->
26 <div class="tx_maskTxt"> 40 <div class="tx_maskTxt">
27 <div class="tx_maskTxt1"> 41 <div class="tx_maskTxt1">
@@ -35,6 +49,25 @@ @@ -35,6 +49,25 @@
35 </div> 49 </div>
36 </div> 50 </div>
37 </div> 51 </div>
  52 +
  53 +<div class="tx_maskPhone">
  54 + <div class="tx_maskCon">
  55 + <div class="tx_maskConImg">
  56 + <img src="__TMPL__/public/assets/images/70.png" alt="" />
  57 + </div>
  58 + <div class="tx_maskCon2">
  59 + <!-- 输入手机号 -->
  60 + <input class="tx_maskInput" style="margin-bottom: 0.25rem;" type="text" placeholder="请输入手机号" maxlength="11" id="phone" onblur="checkPhone()" />
  61 + <input class="tx_maskInput" style="margin-bottom: 0.25rem;" id="Ver_code" type="text" placeholder="请输入验证码" />
  62 + <input type="button" class="btn" id="code" value="获取验证码" onclick="codeButton()">
  63 + <!-- 确定 -->
  64 + <div class="tx_maskOk tx_maskYes" onclick="Message_validation()">确定</div>
  65 + </div>
  66 + </div>
  67 +</div>
  68 +
  69 +
  70 +
38 <div class="log_nine_top"> 71 <div class="log_nine_top">
39 <div class="log_top_co"> 72 <div class="log_top_co">
40 <!-- 顶部 --> 73 <!-- 顶部 -->
@@ -144,6 +177,9 @@ @@ -144,6 +177,9 @@
144 </if> 177 </if>
145 178
146 179
  180 +
  181 +
  182 +
147 </div> 183 </div>
148 <!-- 按钮 --> 184 <!-- 按钮 -->
149 <div class="log_seven_btn"> 185 <div class="log_seven_btn">
@@ -156,6 +192,29 @@ @@ -156,6 +192,29 @@
156 <script src="__TMPL__/public/assets/js/base.js"></script> 192 <script src="__TMPL__/public/assets/js/base.js"></script>
157 <script> 193 <script>
158 /** 194 /**
  195 + *手机号验证点击确定时
  196 + */
  197 + function Message_validation(){
  198 + yzm = $('#Ver_code').val();
  199 + phone = $('#phone').val();
  200 + if(yzm == ''){
  201 + alert('请输入验证码');
  202 + }else if(phone == ''){
  203 + alert('请输入手机号');
  204 + }else{
  205 + $.post("{:url('Personalcenter/is_money_code')}",{yzm:yzm},function(data){
  206 + if(data){
  207 +
  208 + }else{
  209 + alert('验证码错误!');
  210 +
  211 + }
  212 + });
  213 + }
  214 + }
  215 +</script>
  216 +<script>
  217 + /**
159 *当光标离开 218 *当光标离开
160 */ 219 */
161 function messagess(){ 220 function messagess(){
@@ -163,7 +222,7 @@ @@ -163,7 +222,7 @@
163 if(money < 0){ 222 if(money < 0){
164 alert('提现金额错误'); 223 alert('提现金额错误');
165 }else if(money>{$balance}){ 224 }else if(money>{$balance}){
166 - alert('提现金额超出余额'); 225 + alert('提现金额超出余额');
167 } 226 }
168 } 227 }
169 228
@@ -190,16 +249,76 @@ @@ -190,16 +249,76 @@
190 } 249 }
191 </script> 250 </script>
192 <script> 251 <script>
  252 + <!--验证弹窗-->
  253 + var state;
  254 + $.post("{:url('Personalcenter/id_first_withdrawal')}",{},function(data){
  255 + state = data
  256 + });
193 $(".log_seven_btn_contant").click(function() { 257 $(".log_seven_btn_contant").click(function() {
194 - $(".tx_mask").css({  
195 - display: "block" 258 + if(state != false){
  259 + $(".tx_maskPhone").css("display","block");
  260 + }else{
  261 + $(".tx_mask").css("display","block");
  262 + return false;
  263 + }
196 }); 264 });
  265 +// 提现弹窗
  266 + $(".tx_maskYeah").click(function () {
  267 +
  268 + $(".tx_mask").css("display","none");
  269 + $(".tx_maskPhone").css("display","none");
  270 +
197 }); 271 });
198 - $(".tx_maskOk").click(function() {  
199 - $(".tx_mask").css({  
200 - display: "none" 272 +
  273 +// 手机验证弹窗
  274 + $(".tx_maskYes").click(function(){
  275 + var one = $("#phone").val();
  276 + var two = $("#Ver_code").val();
  277 + if(one!=""&&two!=""){
  278 + $(".tx_maskPhone").css("display","none");
  279 + $(".tx_mask").css("display","block")
  280 + }else{
  281 + return false;
  282 + console.log(123)
  283 + }
  284 +
  285 +
201 }); 286 });
  287 + function checkPhone() {
  288 + var phone = document.getElementById('phone').value;
  289 + if(!(/^1[34578]\d{9}$/.test(phone))) {
  290 + alert("手机号码有误,请重填");
  291 + return false;
  292 + }
  293 + }
  294 + //短信验证码
  295 + function codeButton() {
  296 + var code = $("#code");
  297 + code.attr("disabled", "disabled");
  298 + phone = $('#phone').val();
  299 + if(phone == ''){
  300 + alert('手机号不能为空');
  301 + }else{
  302 + $.post("{:url('Personalcenter/send_message')}",{phone:phone},function(data){
  303 + if(data){
  304 + setTimeout(function() {
  305 + code.css("opacity", "0.8");
  306 + }, 1000);
  307 + var time = 60;
  308 + var set = setInterval(function() {
  309 + code.val("(" + --time + ")秒后重新获取");
  310 + }, 1000);
  311 + setTimeout(function() {
  312 + code.attr("disabled", false).val("重新获取验证码");
  313 + clearInterval(set);
  314 + }, 60000);
  315 + }else{
  316 + alert('发送失败!');
  317 + }
202 }); 318 });
  319 + }
  320 +
  321 + }
203 322
204 </script> 323 </script>
205 </body> 324 </body>