转自:https://idig8.com/2018/08/27/xiaochengxujavashizhanxiaochengxuzhucejiemiandekaifa29/

小程序基本所有的常用组件已经了解的差不多了,基本可以实战了,本次就开始小程序的真正实战,完成小程序的一个注册页面的设计。源码:https://github.com/limingios/wxProgram.git 中的No.15

开发最重要的就是实操!

开发人员很少人懂美工

我就懂css 其实也设计不出来什么好看的,在网上找了个参照物,自己自己模仿这搞了下

  • 创建一个新项目删除其中初始化的一些无用的项目。

userRegister.wxml

<view>
<view class="login-icon">
<image class="login-img" src="../../resource/images/dsp.jpg"></image>
</view>
<view class="login-from">
<form bindsubmit='doRegist'>
<!--账号-->
<view class="inputView">
<image class="nameImage" src="../../resource/images/username.png"></image>
<label class="loginLabel">账号</label>
<input name="username" type="text" class="inputText" placeholder="请输入账号"/>
</view> <view class="line"></view> <!--密码-->
<view class="inputView">
<image class="keyImage" src="../../resource/images/password.png"></image>
<label class="loginLabel">密码</label>
<input name="password" type="text" class="inputText" password="{{true}}" placeholder="请输入密码"/>
</view> <!--按钮-->
<view>
<button class="loginBtn" type="primary" form-type='submit'>注册</button>
</view> <view>
<button class="goLoginBtn" type="warn" bindtap="goLoginPage">返回登录</button>
</view>
</form>
</view>
</view>

userRegister.js

const app = getApp()

Page({
data: { }, doRegist: function(e) {
var me = this;
var formObject = e.detail.value;
var username = formObject.username;
var password = formObject.password; // 简单验证
if (username.length == 0 || password.length == 0) {
wx.showToast({
title: '用户名或密码不能为空',
icon: 'none',
duration: 3000
})
}
},
goLoginPage:function(e){
console.log("跳转到登录");
}
})
page {
background-color: whitesmoke;
} .login-img {
width: 750rpx;
} /*表单内容*/
.inputView {
background-color: white;
line-height: 45px;
} /*输入框*/
.nameImage, .keyImage {
margin-left: 22px;
width: 20px;
height: 20px;
} .loginLabel {
margin: 15px 15px 15px 10px;
color: gray;
font-size: 15px;
} .inputText {
float: right;
text-align: right;
margin-right: 22px;
margin-top: 11px;
font-size: 15px;
} .line {
width: 100%;
height: 1px;
background-color: gainsboro;
margin-top: 1px;
} /*按钮*/
.loginBtn {
width: 80%;
margin-top: 35px;
} .goLoginBtn {
width: 80%;
margin-top: 15px;
}

PS:这个就是简单的注册页面,其实很多元素我也抄的网上的,但是要理解这个设计的思路很理念,别搬砖都不知道去哪里找,那就尴尬了。

「小程序JAVA实战」小程序注册界面的开发(29)的更多相关文章

  1. 「小程序JAVA实战」小程序我的个人信息页面开发(41)

    转自:https://idig8.com/2018/09/05/xiaochengxujavashizhanxiaochengxuwodegerenxinxiyemiankaifa40/ 已经完成了登 ...

  2. 「小程序JAVA实战」小程序注册与后端联调(35)

    转自:https://idig8.com/2018/09/01/xiaochengxujavashizhanxiaochengxuzhuceyuhouduanliandiao35/ 小程序的后端spr ...

  3. 「小程序JAVA实战」小程序的flex布局(22)

    转自:https://idig8.com/2018/08/09/xiaochengxu-chuji-22/ 之前已经把小程序的框架说完了,接下来说说小程序的组件,在说组件之前,先说说布局吧.源码:ht ...

  4. 「小程序JAVA实战」小程序的留言和评价功能(70)

    转自:https://idig8.com/2018/10/28/xiaochengxujavashizhanxiaochengxudeliuyanhepingjiagongneng69/ 目前小程序这 ...

  5. 「小程序JAVA实战」小程序的举报功能开发(68)

    转自:https://idig8.com/2018/09/25/xiaochengxujavashizhanxiaochengxudeweixinapicaidancaozuo66-2/ 通过点击举报 ...

  6. 「小程序JAVA实战」小程序的个人信息作品,收藏,关注(66)

    转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudegerenxinxizuopinshoucangguanzhu65 ...

  7. 「小程序JAVA实战」小程序的关注功能(65)

    转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudeguanzhugongneng64/ 在个人页面,根据发布者个人和 ...

  8. 「小程序JAVA实战」小程序的视频点赞功能开发(62)

    转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudeshipindianzangongnengkaifa61/ 视频点 ...

  9. 「小程序JAVA实战」小程序的springboot后台拦截器(61)

    转自:https://idig8.com/2018/09/24/xiaochengxujavashizhanxiaochengxudespringboothoutailanjieqi60/ 之前咱们把 ...

  10. 「小程序JAVA实战」小程序首页视频(49)

    转自:https://idig8.com/2018/09/21/xiaochengxujavashizhanxiaochengxushouyeshipin48/ 视频显示的内容是视频的截图,用户的头像 ...

随机推荐

  1. .NET实现CORS跨域

    1.NuGet:Install-Package Microsoft.AspNet.WebApi.Cors 2.Application_Start中增加(包含在#if DEBUG中):GlobalCon ...

  2. Ubuntu12.04中在桌面建立指向网页的链接文件的方法

    #cd /usr/share/applications #cp firefox.desktop ~/Desktop #cd ~/Desktop #chmod +x firefox.desktop 右键 ...

  3. maven scope-一览表

  4. ios逆向工程-动态分析

    先说说为什么要分析应用吧,如果你想从一个ios应用中获取有用的信息,或者你想修改该应用的一些功能,前提当然是要先知道该app的逻辑和结构了. 动态分享工具比较少,我们先分析个简单的,全民工具Cycri ...

  5. Django 资源文件配置

    staticfiles: 这是一个静态资源管理的app,django.contrib.staticfiles.老的版本中,静态资源管理一直是一个问题,部分app发布的时候 需要带上静态资源,在部署的时 ...

  6. Mat代码操作

    #include<opencv2/opencv.hpp> #include<iostream> using namespace std; using namespace cv; ...

  7. 1.Python3关于文件的操作

    1.写了一个简单的Demo,就是向txt文本写入内容,最初代码如下: file = open("D:/Users/nancy/python.txt","wb") ...

  8. Windows10+CUDA8.0+VS2015+CUDNN5下配置caffe

    [转]https://blog.csdn.net/zhj_matlab/article/details/69943869

  9. C++ 命名空间解释

    using关键字 如果在程序中需要多次引用某个命名空间的成员,那么按照之前的说法,我们每次都要使用范围解析符来指定该命名空间,这是一件很麻烦的事情.为了解决这个问题,人们引入了using关键字.usi ...

  10. 干货:这也许是最全面透彻的一篇RabbitMQ指南!

    本文大纲: RabbitMQ 历史 RabbitMQ 应用场景 RabbitMQ 系统架构 RabbitMQ 基本概念 RabbitMQ 细节阐明 历史-从开始到现在 RabbitMQ是一个Erlan ...