实验八智能手机互联网程序设计(微信程序方向)实验报告

  • 请在上一次实验的基础之上完成"手机快速注册"页面、"企业用户注册"页面,并实现点击手机快速注册和企业用户注册后转跳至该页面
  • 在"手机快速注册"页面,输入框内输入内容并失去焦点后,下方的按钮会变化
  • 在企业用户注册页面,用户名输入框输入内容并失去焦点后,注册按钮也会发生变化

、实验步骤与结果(给出对应的代码或运行结果截图)

index.js

Page({

data:{

disabled:true,

btnstate:"default",

account:"",

password:""

},

accountInput:function(e){

var content = e.detail.value;

console.log(content);

if(content != ''){

this.setData({disabled:false,btnstate:"primary",account:content});

}else{

this.setData({disabled:true,btnstate:"default"});

}

},

pwdBlur:function(e){

var password = e.detail.value;

if(password != ''){

this.setData({password:password});

}

}

})

index.wxml

<view class="content">

<view class="account">

<view class="title">账号</view>

<view class="num"><input bindinput="accountInput" placeholder="用户名/邮箱/手机号" placeholder-style="color:#999999;"/></view>

</view>

<view class="hr"></view>

<view class="account">

<view class="title">密码</view>

<view class="num"><input bindblur="pwdBlur" placeholder="请输入密码" password placeholder-style="color:#999999;"/></view>

<view class="see">

<image src="/images/see.jpg" style="width:42px;height:30px;"></image>

</view>

</view>

<view class="hr"></view>

<button class="btn" disabled="{{disabled}}" type="{{btnstate}}" bindtap="login">登录</button>

<view class="operate">

<view><navigator url="../logs/logs">手机快速注册</navigator></view>

<view><navigator url="../company/company">企业用户注册</navigator></view>

<view>找回密码</view>

</view>

<view class="login">

<view><image src="/images/wxlogin.png" style="width:70px;height:98px;"></image></view>

<view><image src="/images/qqlogin.png" style="width:70px;height:98px;"></image></view>

</view>

</view>

Index.wxss

.content{

margin-top: 40px;

}

.account{

display: block;

padding-left: 20px;

padding-top: 20px;

padding-bottom: 10px;

width: 90%;

}

.title{

float: left;

margin-right: 30px;

font-weight: bold;

}

.hr{

border: 1px solid #cccccc;

opacity: 0.2;

width: 90%;

margin: 0 auto;

}

.see{

position: absolute;

right: 20px;

}

.btn{

width: 90%;

margin-top:40px;

color: #999999;

}

.operate{

display: block;

}

.operate view{

display: inline-block;

width: 33%; /* Assuming there are three items, each can take one-third of the container width */

text-align: center;

margin-top: 40px;

font-size: 14px;

color: #333333;

}

.login{

display: block;

margin-top: 150px;

text-align: center;

}

.login view{

display: inline-block;

}

logs.js

Page({

/**

* 页面的初始数据

*/

data: {

mobile:"",

disabled:true,

type:"default"

},

mobileblur:function(e){

var content = e.detail.value;

if(content !=""){

this.setData({

disabled:false,type:"primary",mobile:content

});

}else{

this.setData({

disabled:true,type:"default",mobile:null

});

}

console.log("注册成功,电话为:"+this.data.mobile)

}

})

logs.wxml

<view class="content">

<view class="hr"></view>

<view class="numbg">

<view>+86</view>

<view><input bindblur="mobileblur" placeholder="" maxlength="11" /></view>

</view>

<view>

<view class="xieyi">

<icon type="success" color="red" size="18"></icon>

<text class="agree">同意</text>

<text class="opinion">京东用户注册协议</text>

</view>

</view>

<button class="btn" disabled="{{disabled}}" type="{{type}}">下一步</button>

</view>

logs.wxss

.contene{

width: 100%;

height: 600px;

color: #f2f2f2;

}

.hr{

padding: 20px;

}

.numbg{

border: 1px solid #cccccc;

width: 90%;

margin: 0 auto;

background-color: white;

border-radius: 5px;

display: flex;

flex-direction: row;

height: 50px;

}

.numbg view{

margin-left: 20px;

margin-top: 14px;

}

.xieyi{

margin-left: 15px;

margin-top: 15px;

}

.agree{

font-size: 13px;

margin-left: 5px;

color: #666666;

}

.opinion{

font-size: 13px;

color: black;

font-weight: bold;

}

.btn{

width: 90%;

margin-top: 30px;

}

效果图

相关推荐
翻滚吧键盘40 分钟前
js代码09
开发语言·javascript·ecmascript
Amy.Wang2 小时前
前端如何实现电子签名
前端·javascript·html5
海天胜景2 小时前
vue3 el-table 行筛选 设置为单选
javascript·vue.js·elementui
今天又在摸鱼2 小时前
Vue3-组件化-Vue核心思想之一
前端·javascript·vue.js
百锦再2 小时前
Vue中对象赋值问题:对象引用被保留,仅部分属性被覆盖
前端·javascript·vue.js·vue·web·reactive·ref
jingling5552 小时前
面试版-前端开发核心知识
开发语言·前端·javascript·vue.js·面试·前端框架
FogLetter2 小时前
图片懒加载:让网页飞起来的魔法技巧 ✨
前端·javascript·css
拾光拾趣录2 小时前
JavaScript 加载对浏览器渲染的影响
前端·javascript·浏览器
浪裡遊4 小时前
Sass详解:功能特性、常用方法与最佳实践
开发语言·前端·javascript·css·vue.js·rust·sass
夏梦春蝉5 小时前
ES6从入门到精通:常用知识点
前端·javascript·es6