register.vue 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. <template>
  2. <view style="position: relative;">
  3. <view class="back" @click="$back">
  4. <u-icon name="arrow-left" size="50" color="#919191"></u-icon>
  5. </view>
  6. <view class="content">
  7. <view class="top">
  8. <view class="title">
  9. <text>注册联兑通账号</text>
  10. <text>请输入手机号进行注册</text>
  11. </view>
  12. </view>
  13. <view style="width: 76%;margin-top: 80rpx;">
  14. <u-form >
  15. <u-form-item label-position="top" label="手机号" prop="phone" label-width="150">
  16. <view style="border-bottom: 1rpx solid #DDDDDD;">
  17. <u-input :border="false" placeholder="请输入手机号" v-model="phone" type="number"></u-input>
  18. </view>
  19. </u-form-item>
  20. <u-form-item label-position="top" label="验证码" prop="code" label-width="150">
  21. <view class="flex" style="border-bottom: 1rpx solid #DDDDDD;">
  22. <u-input style="width: 100%;" :border="false" placeholder="请输入验证码" v-model="code" type="text"></u-input>
  23. <u-button shape="circle" slot="right" :custom-style="customStyle" size="mini" @click="getCode">{{codeTips}}</u-button>
  24. </view>
  25. </u-form-item>
  26. <u-form-item label-position="top" label="密码" prop="phone" label-width="150">
  27. <view style="border-bottom: 1rpx solid #DDDDDD;">
  28. <u-input :border="false" placeholder="请设置登录密码" v-model="password" type="password"></u-input>
  29. </view>
  30. </u-form-item>
  31. </u-form>
  32. </view>
  33. <view style="width: 86%;margin-top: 80rpx;">
  34. <view @click="login" class="btn cu-btn round" style="width:100%;height: 90rpx;font-size: 34rpx;">
  35. 立即登录
  36. </view>
  37. <view class="center" style="margin-top: 100rpx;">
  38. <text style="color: #949494;">确认注册即代表已阅读并同意</text>
  39. <text style="color: #0000ff;">《软件服务协议》</text>
  40. </view>
  41. </view>
  42. </view>
  43. <u-verification-code seconds="60" ref="uCode" @change="codeChange"></u-verification-code>
  44. </view>
  45. </template>
  46. <script>
  47. export default {
  48. data() {
  49. return {
  50. customStyle:{
  51. 'backgroundColor':'#d18c42',
  52. 'color':'#ffffff'
  53. },
  54. codeTips: '',
  55. phone:'',
  56. password:'',
  57. code:'',
  58. }
  59. },
  60. methods: {
  61. login(){
  62. uni.reLaunch({
  63. url:"/pages/index/index"
  64. })
  65. },
  66. codeChange(text) {
  67. this.codeTips = text;
  68. },
  69. // 获取验证码
  70. getCode() {
  71. if(this.$refs.uCode.canGetCode) {
  72. // 模拟向后端请求验证码
  73. uni.showLoading({
  74. title: '正在获取验证码',
  75. mask: true
  76. })
  77. setTimeout(() => {
  78. uni.hideLoading();
  79. // 这里此提示会被this.start()方法中的提示覆盖
  80. this.$u.toast('验证码已发送');
  81. // 通知验证码组件内部开始倒计时
  82. this.$refs.uCode.start();
  83. }, 2000);
  84. } else {
  85. this.$u.toast('倒计时结束后再发送');
  86. }
  87. },
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. $color:#d18c42;
  93. page{
  94. background-color: #FFFFFF;
  95. }
  96. .btn{
  97. background-color: $color;
  98. color:#FFFFFF;
  99. }
  100. .btn{
  101. background-color: $color;
  102. color:#FFFFFF;
  103. }
  104. .bg{
  105. z-index: 99;
  106. height: 440rpx;
  107. width: 440rpx;
  108. position: absolute;
  109. right: -240rpx;
  110. top: -240rpx;
  111. background-color: #d18c42;
  112. border-radius: 50%;
  113. box-shadow: 0rpx 0rpx 50rpx #c5803b;
  114. }
  115. .bg1{
  116. height: 500rpx;
  117. width: 500rpx;
  118. position: absolute;
  119. right: -240rpx;
  120. top: -240rpx;
  121. background-color: #d18c42;
  122. border-radius: 50%;
  123. box-shadow: #c6813b;
  124. }
  125. .back{
  126. position: absolute;
  127. top: var(--status-bar-height);
  128. left: 20rpx;
  129. padding-top: var(--status-bar-height);
  130. }
  131. .content{
  132. height: 96vh;
  133. display: flex;
  134. flex-direction: column;
  135. justify-content: center;
  136. align-items: center;
  137. .top{
  138. width: 76%;
  139. display: flex;
  140. .title{
  141. margin-right: 20rpx;
  142. display: flex;
  143. flex-direction: column;
  144. justify-content: center;
  145. align-items: flex-start;
  146. text-align: left;
  147. text:first-child{
  148. font-weight: 800;
  149. font-size: 60rpx;
  150. color: #000;
  151. margin-bottom: 20rpx;
  152. }
  153. text:last-child{
  154. font-size: 28rpx;
  155. color: #7f7f7f;
  156. }
  157. }
  158. }
  159. }
  160. </style>