• uniapp小程序中的登录完整代码(兼容小程序和app)


    前言

            伴随着互联网的快速发展,移动端应用领域也发生了翻天覆地的变化,随之而来的是各式各样的APP应用程序、轻应用、小程序等项目产品,人们的移动生活也变得更加丰富多彩!本文旨在帮助快速构建uniapp登录页面,仅提供参考价值。喜欢帮忙一键三联,谢谢!

    正文

    效果如下:

    一、index.vue

    1.布局代码:

    采用小程序原生,结合u-view

    2.JS骨架代码

    3.样式文件引入

    1. <style src="./login.css">style>

    二、main.js

    1. import Vue from 'vue'
    2. import App from './index'
    3. const app = new Vue(App)
    4. app.$mount()

    三、login.css

    1. .contentMain {
    2. height: 100%;
    3. background: #fff;
    4. overflow: hidden;
    5. }
    6. .loginPage {
    7. margin-top: 60px;
    8. display: flex;
    9. justify-content: center;
    10. flex-wrap: wrap;
    11. align-items: center;
    12. }
    13. .logingap {
    14. width: 100%;
    15. margin-top: 20px;
    16. }
    17. .section {
    18. height: 100rpx;
    19. line-height: 100rpx;
    20. border-bottom: 2rpx solid #eee;
    21. position: relative;
    22. font-size: 30rpx;
    23. color: #333;
    24. box-sizing: border-box;
    25. display: flex;
    26. flex-direction: row;
    27. align-items: center;
    28. /* padding-left: 24rpx; */
    29. padding: 0 24rpx;
    30. }
    31. .section__title {
    32. width: 150rpx!important;
    33. display: flex;
    34. align-items: center;
    35. justify-content: flex-start;
    36. }
    37. .content {
    38. width: 80%;
    39. text-align: center;
    40. font-size: 14px;
    41. margin-top: 20px;
    42. padding: 10px;
    43. border: 1px solid #eee;
    44. text-align: left;
    45. border-radius: 8px;
    46. color: rgba(0, 0, 0, 0.7);
    47. font-size: 12px;
    48. }
    49. .content i {
    50. width: 8rpx;
    51. height: 8rpx;
    52. background: #999;
    53. margin-right: 16rpx;
    54. position: relative;
    55. top: -6rpx;
    56. border-radius: 50%;
    57. display: inline-block;
    58. }

    四、main.json

    总结

            本登录页面全部代码仅仅用于参考,为简单的密码登录,因项目无需获取用户信息和权限,不涉及小程序的授权登录!

  • 相关阅读:
    【ORACLE】Oracle里有“time”数据类型吗?--关于对Oracle数据类型的一点研究
    【JavaScript高级】内存管理与闭包:垃圾回收GC、闭包定义、访问和执行过程、内存泄漏
    Leecode刷题 383.赎金信——哈希表
    Clion新增子模块库代码跳转
    【模型压缩】Distiller学习-初认识
    目标检测(7)—— YOLO系列V3
    社区系统项目复盘-5
    c语言map的详细用法
    C++Qt中qmake的详解
    富文本编辑器(添加表格)
  • 原文地址:https://blog.csdn.net/XU441520/article/details/133907186