微信小程序登陆、注册在同一页面进行表单提交

登陆注册

针对下面同意按钮监听两个表单问题给出建议:

  <view class="sumbit-btn">
    <button class="button" 
    style="background-color: #33ccff;font-size: 30rpx;" 
    type="primary">立即{{current==1?'登录':'注册'}}</button>
  </view>

在同一个按钮监听两个表单数据是不行的,所以按我下面修改就OK,把按钮拆开,一个按钮对应一个表单。

.wxml代码:

<view class="top-box">
  <view class="next-text1">这里是薄纸人AI</view>
  <view class="next-text2">欢迎你来使用!</view>
</view>
<!-- 登录、注册 -->
<view class="center-box">
  <view class="nav">
    <view class="left {{current==1?'select':''}}" bindtap="click" data-code="1">
      <text>登录</text>
    </view>
    <view class="right {{current==0?'select':''}}" bindtap="click" data-code="0">
      <text>注册</text>
    </view>
  </view>
  <!-- 登录 -->
  <form id="oneform" bindsubmit="doLogin">
    <view>
      <view class="input-box" hidden="{{current==0}}">
        <view class="wei-input">
          <icon type="waiting" color="#44ADFB" size="16"></icon>
          <input name="username" class="input" auto-focus placeholder="请输入您的账号" />
        </view>
        <view class="wei-input">
          <icon type="success" color="#44ADFB" size="16"></icon>
          <input name="password" password class="input" auto-focus placeholder="请输入登录密码" />
        </view>
        <view class="forget">
          <!-- <text>忘记密码?</text> -->
        </view>
        <view class="sumbit-btn">
          <button form-type="submit" type="primary" style="background-color: #33ccff;font-size: 30rpx;">立即登录</button>
        </view>

      </view>
    </view>
  </form>

  <!-- 注册 -->
  <form id="towform" bindsubmit="MeUserLogin">
    <view class="input-box" hidden="{{current==1}}">
      <view class="wei-input">
        <icon type="success" color="#44ADFB" size="16"></icon>
        <input name="username" class="input" auto-focus placeholder="请输入账号" />
      </view>
      <view class="wei-input">
        <icon type="waiting" color="#44ADFB" size="16"></icon>
        <input name="phone" class="input" auto-focus placeholder="请输入手机号" />
      </view>
      <view class="wei-input">
        <icon type="waiting" color="#44ADFB" size="16"></icon>
        <input class="input" auto-focus placeholder="请输入6位验证码" />
        <text class="input-code" bindtap="getCode">{{codeText}}</text>
      </view>
      <view class="wei-input">
        <icon type="success" color="#44ADFB" size="16"></icon>
        <input name="password" password  class="input" auto-focus placeholder="请输入密码" />
      </view>
      <view class="wei-input">
        <icon type="success" color="#44ADFB" size="16"></icon>
        <input name="checkpass" password class="input" auto-focus placeholder="请确认密码" />
      </view>
      <view class="wei-input">
        <icon type="success" color="#44ADFB" size="16"></icon>
        <input name="name" class="input" auto-focus placeholder="请输入姓名" />
      </view>
      <view class="gender">
        <radio-group name="gender" bindchange="bandleChange" >
          <icon class="gender-icon" type="success" color="#44ADFB" size="16"></icon>
          <text class="gender-text">性别 </text>
          <radio class="gender-radio" style="color: brown;" value='1'></radio>
          <text class="gender-texts">男</text>
          <radio class="gender-radio" value='0'></radio>
          <text class="gender-texts">女</text>
        </radio-group>
      </view>

      <view>
        <button form-type="submit" type="primary" style="background-color: #33ccff;font-size: 30rpx;" >立即注册</button>
        <!-- <button>立即注册</button> -->
      </view>
    </view>
  </form>


</view>
<!-- 重影 -->
<view class="shadow shadow-1"></view>
<view class="shadow shadow-2"></view>










  <!-- <view class="input-box" hidden="{{current==0}}">
    <view class="wei-input">
      <icon type="waiting" color="#44ADFB" size="16"></icon>
      <input class="input" auto-focus placeholder="请输入手机号/登录名" />
    </view>
    <view class="wei-input">
      <icon type="success" color="#44ADFB" size="16"></icon>
      <input class="input" auto-focus placeholder="请输入登录密码" />
    </view>
    <view class="forget">
      <text>忘记密码?</text>
    </view>
  </view> -->

.wxss代码

page{
  height: 100%;
  background-color: white;
  margin: 0px;
  padding: 0px;
}
/* 顶部背景 */
.top-box{
  height: 25%;
  background-image: linear-gradient( #000000,#0400ff);
  padding: 30rpx;
  color: rgba(134, 133, 133, 0.849);
  font-weight: bold;
  font-family: "楷体";
  /* margin-left: 10rpx; */
}
.next-text1{
  margin-top: 15rpx;
  margin-left: 15rpx;
}
.next-text2{
  margin-top: 15rpx;
  margin-left: 5rpx;
}
/* 内容 */
.center-box{
  background-color: white;
  margin: -20% 20rpx 0rpx 20rpx;
  padding: 25rpx;
  border-radius: 70rpx;
  -webkit-filter: drop-shadow(0 0 8rpx #000000);
  filter: drop-shadow(0 0 8rpx #44ADFB);
}
/* 导航 */
.nav{
  display: flex;
  text-align: center;
  font-size: 32rpx;
  margin-bottom: 8%;
}
.left{
  flex: 1;
  font-weight: bold;
}
.right{
  flex: 1;
  font-weight: bold;
}
.select{
  font-weight: bold;
  color: #33ccff;
}
.select text{
  padding-bottom: 5rpx;
  border-bottom-left-radius: 10rpx;
  border-bottom-right-radius: 10rpx;
  border-bottom: 5rpx solid #33ccff;
}
.wei-input{
  display: flex;
  flex-direction: row;
  align-items: center;
  margin-top: 40rpx;
  padding-bottom: 20rpx;
  border-bottom: 1rpx solid #f1f1f1;
}
.input-box{
  margin: 20rpx;
}
.input{
  padding-left: 20rpx;
  font-size: 30rpx;
}
.input-code{
  position: absolute;
  right: 40rpx;
  font-size: 26rpx;
  padding: 10rpx 15rpx;
  color: white;
  background-color: #FF8C69;
  border-radius: 10rpx;
}
.forget{
  font-size: 26rpx;
  color: #33ccff;
  margin-top: 20rpx;
  text-align: right;
}
.sumbit-btn{
  margin: 6% 30rpx 30rpx 30rpx;
}
.gender-radio{
  /* background-color: #33ccff; */
  color: #5e5e5e;
  margin-left: 20rpx;
  left: 20rpx;
  transform: scale(0.8);
  /* flex: 10rpx; */
  /* width: 100rpx;
  height: 10rpx; */
  
}
.gender-text{
  margin-left: 20rpx;
  font-size: 30rpx;
}
.gender-texts{
  margin-left: 10rpx;
  font-size: 30rpx;
}
/* .gender-icon{
  margin-top: 100rpx;
} */
/* 性别单选框 */
.gender{
  
  /* left: 10rpx; */
  margin-top: 20rpx;
  margin-bottom: 20rpx;
  color: #776d6d;
  font-size: 31rpx;
  /* size: 26rpx; */
}
/* 重影 */
.shadow{
  box-shadow: 0rpx 0rpx 10rpx 0rpx #44ADFB;
  border-radius: 25rpx;
  background-color: white;
}
.shadow-1{
  height: 40rpx;
  margin: -20rpx 50rpx 0 50rpx;
}
.shadow-2{
  position: relative;
  z-index: -888;
  height: 50rpx;
  margin: -30rpx 80rpx 0 80rpx;
}
/* 最底部 */
.bottom-box{
  position:fixed; 
  bottom: 10rpx;
  width:100%;
  font-size: 24rpx;
  color: gray;
  display: flex;
  justify-content: center;
}

  • 4
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 4
    评论
S-CMS电子商城系统(双语带手机版)以php+mysql进行开发,网站安装简、快捷。程序特色:一、使搜索引擎更加容易抓取和索引二、提供更多的功能,提高用户的友好体验三、可用性的提高,提高用户的友好体验使用方法:将文件上传至PHP空间或服务器,运行http://你的域名/install.php进行安装。只需两步即可安装完成,为了保证网站安全,请修改默认后台路径及数据库名称。S-CMS电子商城系统系统(含微信小程序)v3.0 bulid20190604更新说明:1.优化:对支付部分的敏感传入参数(如订金额)进行了加密,防止恶意篡改2.优化:对后台登录的二次验证进行优化,仅验证IP前三段,避免因开启CDN导致多次验证3.优化:后台自动数据备份仅保留最近十日,避免占用空间过大,手动备份不受影响S-CMS电子商城系统系统(含微信小程序)v3.0 bulid20190611更新说明:1.优化:后台选择上传素材时加入了名称显示和筛选排序功能2.修复:修复了在开启静态的状态下手机版分页功能显示错误的问题3.新增:加入了自动备份的开关,无需自动备份的用户可以关闭该功能S-CMS电子商城系统系统(含微信小程序)v3.0 bulid20190618更新说明:1.新增:新增充值卡功能,可以在会员中心充值界面使用充值卡进行余额充值2.修复:对部分核心程序语句进行了修改,修复了部分主机误报问题3.修复:修复网站URL二维码扫码错误的问题S-CMS电子商城系统系统(含微信小程序)v3.0 bulid20190702更新说明:1.修复:修复了在少数情况下新闻和产品列页会出现负数页码的情况2.新增:后台查询系统增加关联内容的提交信息,方便在同一页面查看3.新增:万能系统在提交之前增加预览功能,方便用户比对信息S-CMS电子商城系统系统(含微信小程序)v3.0 bulid20190709更新说明:1.新增:新增产品品牌功能,管理员可以自行增删或编辑产品品牌2.新增:新增会员类型功能,管理员可以自行增删或编辑会员类型3.新增:会员中心的新闻投稿栏目编辑器支持上传图片

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值