最新国产好看的视频,伊人天堂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)容,希望對大家的學習有所幫助,也希望大家多多支持腳本之家。

相關文章

  • 使用CSS3的scale實現(xiàn)網(wǎng)頁整體縮放

    使用CSS3的scale實現(xiàn)網(wǎng)頁整體縮放

    QQ郵箱的網(wǎng)頁整體縮放效果,原來實現(xiàn)方法如此簡單,下面有個實現(xiàn)示例,大家可以參考下
    2014-03-03
  • Track Image Loading效果代碼分析

    Track Image Loading效果代碼分析

    Track Image Loading效果代碼分析...
    2007-08-08
  • html+css+js實現(xiàn)簡易版ChatGPT聊天機器人

    html+css+js實現(xiàn)簡易版ChatGPT聊天機器人

    OpenAI的一款聊天機器人模型ChatGPT爆火,本篇文章用一百行html+css+js代碼給大家制作一款簡易的聊天機器人。
    2023-02-02
  • 微信小程序自定義菜單導航實現(xiàn)樓梯效果

    微信小程序自定義菜單導航實現(xiàn)樓梯效果

    在html開發(fā)中,我們可以用到a標簽錨點實現(xiàn),jq的動畫相結(jié)合實現(xiàn)類似效果。在框架中vant UI框架也為我們實現(xiàn)了這一效果。接下來通過本文給大家介紹微信小程序自定義菜單導航實現(xiàn)樓梯效果,感興趣的朋友一起看看吧
    2021-12-12
  • 在JS循環(huán)中使用async/await的方法

    在JS循環(huán)中使用async/await的方法

    async / await是ES7的重要特性之一,也是目前社區(qū)里公認的優(yōu)秀異步解決方案。這篇文章主要介紹了在JS循環(huán)中使用async/await的方法,需要的朋友可以參考下
    2018-10-10
  • 詳解如何通過JavaScript實現(xiàn)函數(shù)重載

    詳解如何通過JavaScript實現(xiàn)函數(shù)重載

    這篇文章主要為大家詳細介紹了如何通過JavaScript實現(xiàn)函數(shù)重載,文中的示例代碼講解詳細,對我們學習JavaScript有一定的幫助,感興趣的可以了解一下
    2023-01-01
  • uni-app h5端在jenkins構建報錯解決

    uni-app h5端在jenkins構建報錯解決

    這篇文章主要為大家介紹了uni-app h5端在jenkins構建報錯解決,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2023-06-06
  • 一文詳解preact的高性能狀態(tài)管理Signals

    一文詳解preact的高性能狀態(tài)管理Signals

    這篇文章主要介紹了一文詳解preact的高性能狀態(tài)管理Signals,文章圍繞主題展開詳細的內(nèi)容介紹,具有一定的參考價值,感興趣的朋友可以參考一下
    2022-09-09
  • bootstrap weebox 支持ajax的模態(tài)彈出框

    bootstrap weebox 支持ajax的模態(tài)彈出框

    本篇介紹的bootstrap weebox(支持ajax的模態(tài)彈出框),歷經(jīng)多次修改,目前版本已經(jīng)穩(wěn)定,整合了bootstrap的響應式,界面簡單,功能卻無比豐富,支持ajax、圖片預覽等等
    2017-02-02
  • JS計算兩個時間相差分鐘數(shù)的方法示例

    JS計算兩個時間相差分鐘數(shù)的方法示例

    這篇文章主要介紹了JS計算兩個時間相差分鐘數(shù)的方法,結(jié)合完整實例形式分析了javascript針對日期時間的轉(zhuǎn)換與計算相關操作技巧,需要的朋友可以參考下
    2018-01-01

最新評論

绥棱县| 林口县| 筠连县| 馆陶县| 克什克腾旗| 丁青县| 文登市| 城口县| 北川| 蒙城县| 泸溪县| 仁布县| 洪洞县| 渝北区| 长治县| 综艺| 宁河县| 兴隆县| 新民市| 凤阳县| 牙克石市| 射洪县| 侯马市| 嘉祥县| 顺义区| 抚顺县| 莱州市| 黄大仙区| 沂南县| 高青县| 奉化市| 孟村| 顺昌县| 江源县| 方山县| 宜丰县| 绵竹市| 漳州市| 永修县| 郓城县| 济南市|