tanyanfei 4 роки тому
батько
коміт
f88916f2ab

+ 26 - 1
pages/eventDetail/eventDetail.js

@@ -21,7 +21,8 @@ Page({
     page:1,
     proof_img:'',
     user_id:'',   //用户id
-    apply_id:''   //报名ID
+    apply_id:'',   //报名ID
+    phone:''
   },
 
   /**
@@ -110,6 +111,30 @@ Page({
       },
     })
   },
+  phoneChange:function(e){
+    this.setData({
+      phone: e.detail.value
+    })
+  },
+  sendcode:function(){
+    wx.request({
+      url: host + '/api/phcode',
+      method: 'POST',
+      data: { phone: this.data.phone},
+      success: function (res) {
+          if(res.code == 0){
+              wx.showToast({
+                title: '验证码已发送',
+              })
+          }else{
+            wx.showToast({
+              title: '发送失败',
+              icon: 'none'
+            })
+          }
+      },
+    })
+  },
   bindMultiPickerColumnChange:function(e){
     console.log('修改的列为', e.detail.column, ',值为', e.detail.value);
     var list = this.data.list, i = e.detail.value, j = e.detail.column;

+ 2 - 2
pages/eventDetail/eventDetail.wxml

@@ -68,10 +68,10 @@
             </picker>
         </view>
         <view class="item">
-            <label>手机号:</label><input name='phone' placeholder-style='color:#999;' placeholder="请输入手机号"></input><text class="code">发送验证码</text>
+            <label>手机号:</label><input bindinput="phoneChange" name='phone' placeholder-style='color:#999;' placeholder="请输入手机号"></input><text bindtap="sendcode" class="code">发送验证码</text>
         </view>
         <view class="item">
-            <label>验证码:</label><input placeholder-style='color:#999;' placeholder="请输入验证码"></input>
+            <label>验证码:</label><input name='code' placeholder-style='color:#999;' placeholder="请输入验证码"></input>
         </view>
         <view class="item">
             <label>邮箱:</label><input name='email' placeholder-style='color:#999;' placeholder="请输入邮箱"></input>

+ 1 - 0
pages/eventDetail/eventDetail.wxss

@@ -128,6 +128,7 @@ page{
   right: 24rpx;
   top: 0;
   line-height: 72rpx;
+  z-index: 99;
 }
 .close{
   width: 50rpx;