溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

微信小程序如何實現(xiàn)登錄界面

發(fā)布時間:2022-05-23 09:16:11 來源:億速云 閱讀:132 作者:iii 欄目:開發(fā)技術

這篇文章主要介紹“微信小程序如何實現(xiàn)登錄界面”的相關知識,小編通過實際案例向大家展示操作過程,操作方法簡單快捷,實用性強,希望這篇“微信小程序如何實現(xiàn)登錄界面”文章能幫助大家解決問題。

注:這里使用的是原生微信小程序

使用wxss和wxml

index.wxml文件中代碼

<view class="v1">
 
<!-- v2父容器  子view使用絕對布局 -->
  <view class="v2">
    <view class="dltext">登錄</view>
 
    <!-- 手機號 -->
    <view class="phoneCs">
      <image src="/images/phone.png" class="ph"></image>
      <input placeholder="請輸入手機號" />
    </view>
 
    <!-- 密碼 -->
    <view class=passwordCs">
      <image src="/images/password.png" class="ps"></image>
      <input placeholder="請輸入密碼" />
      <image src="/images/eye-open.png" class="eye"></image>
    </view>
 
    <!-- 注冊 和忘記密碼  -->
    <view class="zhuce">
      <navigator>立即注冊</navigator>
      <navigator>忘記密碼?</navigator>
    </view>
 
    <!-- 登錄按鈕 -->
    <view class="denglu">
      <button class="btn-dl" type="primary">登錄</button>
    </view>
 
    <!-- 協(xié)議區(qū)  xieyi -->
    <view class="xieyi">
      <checkbox class="isXY"></checkbox>
      <view class="text-xy">同意小程序的《使用協(xié)議》</view>
    </view>
  </view>
 
<!-- 提示框  使用以下方式登錄 -->
  <view class="v3">
    <view class="line"></view>
    <view class="lText">您還可以使用以下方式登錄</view>
    <view class="line"></view>
  </view>
 
<!-- qq  weixin  weibo 圖標展示view -->
  <view class="qwwIcon">
    <image src="/images/weixin.png"></image>
    <image src="/images/qq.png"></image>
    <image src="/images/weibo.png"></image>
  </view>
 
</view>

index.wxss樣式文件代碼(使用絕對布局和相對布局)

/* 最大的父元素 */
.v1{
  display: block;
  position:absolute;
  height: 100%;
  width: 100%;
  background: #356363;
  /* 換圖片 */
  
}
/* 白色區(qū)域 */
.v1 .v2{
  position: relative;
  margin-top: 150rpx;
  left: 100rpx; 
  width: 545rpx;
  height: 750rpx;
  background: #FFFFFF;
  border-radius: 50rpx;
}
/* 白色區(qū)域內的登錄文本 */
.v1 .v2 .dltext{
  margin-top: 50rpx;
  position: absolute;
  margin-left:80rpx;
  width: 150rpx;
  height: 100rpx;
  font-size: 60rpx;
  font-family: Helvetica;
  color: #000000;
  line-height: 100rpx;
  letter-spacing: 2rpx;
}
/* 手機圖片+輸入框+下劃線的父容器view */
.v1 .v2 .phoneCs{
  margin-top: 200rpx;
  margin-left: 35rpx;
  position: absolute;
  display: flex;
  width:450rpx ;
  height: 80rpx ;
  border-bottom: 3rpx solid rgb(58, 57, 57);
}
/* 手機圖標 */
.v1 .v2 .phoneCs .ph{
  margin-top: 5rpx;
  margin-left: 30rpx;
  width: 55rpx;
  height: 55rpx;
}
/* 手機號輸入框 */
.v1 .v2 .phoneCs input{
  width: 200rpx;
  font-size: 25rpx ;
  margin-top: 15rpx;
  margin-left: 30rpx;
}
/* 密碼圖標+輸入框+小眼睛圖標+下劃線父容器view */
.v1 .v2 .passwordCs{
  margin-top: 400rpx;
  margin-left: 35rpx;
  position: absolute;
  display: flex;
  width:450rpx ;
  height: 80rpx ;
  border-bottom: 3rpx solid rgb(58, 57, 57);
}
/* 密碼圖標 */
.v1 .v2 .passwordCs .ps{
  margin-top: 5rpx;
  margin-left: 30rpx;
  width: 55rpx;
  height: 55rpx;
}
/* 眼睛 圖標*/
.v1 .v2 .passwordCs .eye{
  margin-top: 5rpx;
  margin-left: 65rpx;
  width: 55rpx;
  height: 55rpx;
}
/* 密碼輸入框 */
.v1 .v2 .passwordCs input{
  width: 200rpx;
  font-size: 25rpx ;
  margin-top: 15rpx;
  margin-left: 30rpx;
}
/* 注冊+忘記密碼父容器 */
.v1 .v2 .zhuce{
  font-size: 25rpx;
  margin-left: 85rpx;
  width: 370rpx;
  margin-top: 540rpx;
  position: absolute;
  display: flex;
  justify-content: space-between;
}
/* 登錄按鈕容器view */
.v1 .v2 .denglu{
  width: 350rpx;
  height: 50rpx;
  position: absolute;
  margin-top: 600rpx;
  margin-left: 85rpx;
  
}
/* 登錄按鈕 */
.v1 .v2 .denglu button{
  padding: 0rpx;
  line-height: 50rpx;
  font-size: 25rpx;
  width: 100%;
  height: 100%;
  border-radius: 30rpx;
}
/* 復選框+協(xié)議文字容器view */
.v1 .v2 .xieyi{
  margin-left: 10rpx;
  margin-top: 680rpx;
  width: 400rpx;
  display: flex;
  position: absolute;
}
/* 復選框 */
.v1 .v2 .xieyi .isXY{
  margin-left: 85rpx;
  /* 修改復選框的大小 */
  transform:scale(.6);
}
/* 協(xié)議文本 */
.v1 .v2 .xieyi .text-xy{
  margin-left: 10rpx;
  margin-top: 20rpx;
  color: #000000;
  font-size:18rpx;
}
/* 提示文本 */
.v3{
  padding-left: 100rpx;
  display: flex;
  position: relative;
  width: 100%;
  height: 60rpx;
  padding-top: 50rpx;
}
.v3 .line{
  margin-left: 5rpx;
  margin-top: 18rpx;
  width: 120rpx;
  height: 3rpx;
 background-color:#FFFFFF;
}
.v3 .lText{
  color: #FFFFFF;
  font-size: 25rpx;
}
/* qq wx wb */
.qwwIcon{
  margin-top: 100rpx;
  padding-top: 50rpx;
  position: relative;
  display: flex;
  width: 100%;
  height: 150rpx;
}
.qwwIcon image{
  padding-left: 120rpx;
  width: 80rpx;
  height: 80rpx;
}

結果圖

微信小程序如何實現(xiàn)登錄界面

關于“微信小程序如何實現(xiàn)登錄界面”的內容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關的知識,可以關注億速云行業(yè)資訊頻道,小編每天都會為大家更新不同的知識點。

向AI問一下細節(jié)

免責聲明:本站發(fā)布的內容(圖片、視頻和文字)以原創(chuàng)、轉載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關證據(jù),一經查實,將立刻刪除涉嫌侵權內容。

AI