微信小程序自定義用戶登錄彈窗_第1頁
微信小程序自定義用戶登錄彈窗_第2頁
微信小程序自定義用戶登錄彈窗_第3頁
微信小程序自定義用戶登錄彈窗_第4頁
微信小程序自定義用戶登錄彈窗_第5頁
已閱讀5頁,還剩4頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

第微信小程序自定義用戶登錄彈窗本文實例為大家分享了微信小程序自定義用戶登錄彈窗的具體代碼,供大家參考,具體內(nèi)容如下

view

button

bindtap="powerDrawer"data-statu="open"立即進入/button

!--mask:彈出框--

viewbindtap="powerDrawer"data-statu="close"wx:if="{{showModalStatus}}"/view

!--content--

!--使用animation屬性指定需要執(zhí)行的動畫--

viewanimation="{{animationData}}"wx:if="{{showModalStatus}}"

!--drawercontent--

view請?zhí)顚?view

view

!--denglu

--

view/view

view姓名/view

input

type="text"placeholder='請輸入答題人姓名'maxlength='12'value=""bindinput="userNameInput"/input

view/view

view手機號/view

inputtype="text"placeholder='請輸入手機號'maxlength='11'value=""bindinput="mobileInput"/input

view/view

/view

buttontype="submit"bindtap='btnclick'快速進入/button

viewbindtap="powerDrawer"data-statu="close"取消/view

/view

css

/*css*/

.drawer_screen{

width:100%;

height:100%;

position:fixed;

top:0;

left:0;

z-index:1000;

background:#000;

opacity:0.75;

overflow:hidden;

.drawer_box{

width:650rpx;

overflow:hidden;

position:fixed;

top:50%;

left:0;

z-index:1001;

background:#FAFAFA;

margin:-150px50rpx050rpx;

border-radius:15px;

.drawer_title{

padding:15px;

font:20px"microsoftyahei";

text-align:center;

font-size:30rpx;

.drawer_content{

height:170px;

overflow-y:scroll;/*超出父盒子高度可滾動*/

.btn_ok{

padding:10px;

font:30rpx"microsoftyahei";

text-align:center;

border-top:1pxsolid#E8E8EA;

color:#3CC51F;

.top{

padding-top:8px;

.bottom{

padding-bottom:8px;

.title{

height:30px;

line-height:30px;

width:160rpx;

text-align:center;

display:inline-block;

font:30028rpx/30px"microsoftyahei";

.input_base{

border:2rpxsolid#ccc;

padding-left:10rpx;

margin-right:50rpx;

.input_h30{

height:30px;

line-height:30px;

.input_h60{

height:60px;

.input_view{

font:12px"microsoftyahei";

background:#E8E8EA;

color:#000;

line-height:30px;

input{

font:12px"microsoftyahei";

background:#E8E8EA;

color:#000;

radio{

margin-right:20px;

.grid{display:-webkit-box;display:box;}

.col-0{-webkit-box-flex:0;box-flex:0;}

.col-1{-webkit-box-flex:1;box-flex:1;}

.fl{float:left;}

.fr{float:right;}

.name{

text-align:center;

font-size:30rpx;

width:90%;

margin:auto;

margin-top:30rpx;

.btn{

text-align:center;

font-size:30rpx;

height:60rpx;

width:90%;

margin:auto;

margin-top:20rpx;

background-color:#FAFAFA;

border-bottom:1rpxsolid#999999;

.call{

font-size:30rpx;

text-align:center;

width:90%;

margin:auto;

margin-top:45rpx;

}

js

//自定義彈框

powerDrawer:function(e){

//wx.removeStorageSync('xingming')

//wx.removeStorageSync('phone')

varcurrentStatu=e.currentTarget.dataset.statu;

this.util(currentStatu)

},

util:function(currentStatu){

/*動畫部分*/

//第1步:創(chuàng)建動畫實例

varanimation=wx.createAnimation({

duration:200,//動畫時長

timingFunction:"linear",//線性

delay:0//0則不延遲

});

//第2步:這個動畫實例賦給當前的動畫實例

this.animation=animation;

//第3步:執(zhí)行第一組動畫

animation.opacity(0).rotateX(-100).step();

//第4步:導出動畫對象賦給數(shù)據(jù)對象儲存

this.setData({

animationData:animation.export()

})

//第5步:設置定時器到指定時候后,執(zhí)行第二組動畫

setTimeout(function(){

//執(zhí)行第二組動畫

animation.opacity(1).rotateX(0).step();

//給數(shù)據(jù)對象儲存的第一組動畫,更替為執(zhí)行完第二組動畫的動畫對象

this.setData({

animationData:animation

})

//關(guān)閉

if(currentStatu=="close"){

this.setData(

{

showModalStatus:false

}

);

}

}.bind(this),200)

//顯示

if(currentStatu=="open"){

this.setData(

{

showModalStatus:true

}

);

}

},

//登錄

userNameInput:function(e){

this.setData({

userName:e.detail.value

})

mobileInput:function(e){

this.setData({

mobile:e.detail.value

})

btnclick:function(){

varuserName=this.data.userName;

varmobile=this.data.mobile;

varflag=true;

varphonetel=/^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;

varname=/^[u4E00-u9FA5]+$/;

if(userName==''){

wx.showToast({

title:'請輸入用戶名',

icon:'none',

duration:2000,

mask:true

})

flag=false;

}elseif(mobile==''){

wx.showToast({

icon:'none',

duration:2000,

title:'手機號不能為空',

})

flag=false;

}

elseif(mobile.length!=11){

wx.showToast({

title:'手機號長度有誤!',

icon:'none',

duration:2000,

})

flag=false;

}

varmyreg=/^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;

if(!myreg.test(mobile)){

wx.showToast({

title:'請輸入正確信息!',

icon:'none',

duration:2000,

})

flag=false;

}

if(flag==true){

//console.log(this.data.userNa

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論