最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

微信小程序自定義用戶登錄彈窗

 更新時間:2022年06月29日 17:13:46   作者:kleinBlue.  
這篇文章主要為大家詳細介紹了微信小程序自定義用戶登錄彈窗,文中示例代碼介紹的非常詳細,具有一定的參考價值,感興趣的小伙伴們可以參考一下

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

view

<button ? class="btn" bindtap="powerDrawer" data-statu="open">立即進入</button>
<!--mask:彈出框-->
<view class="drawer_screen" bindtap="powerDrawer" data-statu="close" wx:if="{{showModalStatus}}"></view>
<!--content-->
<!--使用animation屬性指定需要執(zhí)行的動畫-->
<view animation="{{animationData}}" class="drawer_box" wx:if="{{showModalStatus}}">
?<!--drawer content-->
?<view class="drawer_title">請?zhí)顚?lt;/view>
?<view class="drawer_content">
?<!-- denglu ?-->
? ? <view class='top_line'></view>
? ? <view class='name'>姓名</view>
? ? <input class='btn' ?type="text" placeholder='請輸入答題人姓名' maxlength='12'value="" bindinput ="userNameInput" ></input>
? ? <view class='line'></view>
? ? <view class='call'>手機號</view>
? ? <input class='btn' type="text" placeholder='請輸入手機號' maxlength='11 'value="" bindinput ="mobileInput" ></input>
? ? <view class='line'></view>
?</view>
?<button class='btn_ok' type="submit" bindtap='btnclick' >快速進入</button>
?<view class="btn_ok" bindtap="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: -150px 50rpx 0 50rpx;
? border-radius: 15px;
?}
??
?.drawer_title{
? padding:15px;
? font: 20px "microsoft yahei";
? text-align: center;
? font-size: 30rpx;
?}
?.drawer_content {
? height: 170px;
? overflow-y: scroll; /*超出父盒子高度可滾動*/
?}
?.btn_ok{
? padding: 10px;
? font: 30rpx "microsoft yahei";
? text-align: center;
? border-top: 1px solid #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: 300 28rpx/30px "microsoft yahei";
?}
??
?.input_base {
? ?border: 2rpx solid #ccc;
? ?padding-left: 10rpx;
? ?margin-right: 50rpx;
?}
?.input_h30{
? ?height: 30px;
? ?line-height: 30px;
?}
?.input_h60{
? ?height: 60px;
?}
?.input_view{
? ?font: 12px "microsoft yahei";
? ?background: #E8E8EA;
? ?color:#000;
? ?line-height: 30px;
?}
??
?input {
? ?font: 12px "microsoft yahei";
? ?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: 1rpx solid #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')
? ? var currentStatu = e.currentTarget.dataset.statu;
? ? this.util(currentStatu)
? ?},
? ?util: function(currentStatu){
? ? /* 動畫部分 */
? ? // 第1步:創(chuàng)建動畫實例
? ? var animation = 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
? ? ?}) ?
? ? ?//關閉
? ? ?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(){
? ? var userName = this.data.userName;
? ? var mobile = this.data.mobile;
? ? var flag = true;
? ? var phonetel = /^(((13[0-9]{1})|(15[0-9]{1})|(18[0-9]{1})|(17[0-9]{1}))+\d{8})$/;
? ? var name = /^[u4E00-u9FA5]+$/;
? ? if (userName == '') {
? ? ? wx.showToast({
? ? ? ? title: '請輸入用戶名',
? ? ? ? icon: 'none',
? ? ? ? duration: 2000,
? ? ? ? mask: true
? ? ? })
? ? ? flag = false;
? ? } else if (mobile == '') {
? ? ? wx.showToast({
? ? ? ? icon: 'none',
? ? ? ? duration: 2000,
? ? ? ? title: '手機號不能為空',
? ? ? })
? ? ? flag = false;
? ? }?
? ? else if (mobile.length != 11) {
? ? ? wx.showToast({
? ? ? ? title: '手機號長度有誤!',
? ? ? ? icon: 'none',
? ? ? ? duration: 2000,
? ? ? })
? ? ? flag = false;
? ? }
? ? var myreg = /^(((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.userName)
? ? ? // console.log(this.data.mobile)
? ? ? wx.setStorageSync('xingming',this.data.userName)
? ? ? wx.setStorageSync('phone',this.data.mobile)
? ? ? ?wx.navigateTo({
? ? ? ? ?url: '/pages/wenda/wenda',
? ? ? ?})
? ? }
? },

以上就是本文的全部內(nèi)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

最新評論

辽宁省| 五河县| 吉水县| 潮安县| 探索| 清新县| 莱阳市| 阿拉善盟| 白山市| 大同市| 吕梁市| 桐乡市| 涿州市| 双桥区| 都江堰市| 东阿县| 蓬莱市| 太原市| 韶关市| 津市市| 家居| 长葛市| 呼伦贝尔市| 东辽县| 江川县| 营山县| 武功县| 通道| 潜山县| 年辖:市辖区| 宁远县| 修水县| 乐至县| 泾川县| 策勒县| 沙湾县| 新闻| 张家口市| 磐石市| 济阳县| 阜阳市|