index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <view>
  3. <u-image src="../../static/sailun/login_bg.png" mode="widthFix"></u-image>
  4. <view class="content">
  5. <u-card padding="70" :head-border-bottom="false" :show-head="false" :show-foot="false" :border="false" box-shadow="0px 1px 10px rgba(0,0,0,0.2)"
  6. border-radius="20" margin="20rpx 50rpx">
  7. <view slot="body">
  8. <view style="margin-top: 20rpx;">
  9. <u-field v-model="tel" placeholder="请填写手机号" label-width="50">
  10. <u-icon slot="icon" name="account" size="36" color="#666666"></u-icon>
  11. </u-field>
  12. </view>
  13. <view style="margin-top: 30rpx;">
  14. <u-field v-model="code" placeholder="请填写验证码" label-width="50">
  15. <u-icon slot="icon" name="lock" size="36" color="#666666"></u-icon>
  16. <u-button size="mini" slot="right" type="primary" @click="getCode" shape="circle">{{codeText}}</u-button>
  17. </u-field>
  18. </view>
  19. <u-verification-code ref="uCode" @change="codeChange"></u-verification-code>
  20. <view style="margin-top: 80rpx;">
  21. <u-button type="primary" :ripple="true" ripple-bg-color="#99d4ff" shape="circle">登录</u-button>
  22. </view>
  23. <view style="margin-top: 100rpx;display: flex;justify-content: center;">
  24. <view style="color: rgba(0,160,234,0.5)">
  25. 还没有账号?
  26. </view>
  27. <view style="color: #00A0EA">
  28. 立即注册
  29. </view>
  30. </view>
  31. </view>
  32. </u-card>
  33. </view>
  34. <view class="foot">
  35. <view class="u-flex u-row-center u-col-center">
  36. <u-line color="#0095FF" length="15%"/>
  37. <view style="margin: 0 20rpx;color:#0095FF;font-family: Source Han Sans CN;">
  38. 赛轮店管家11
  39. </view>
  40. <u-line color="#0095FF" length="15%" />
  41. </view>
  42. </view>
  43. </view>
  44. </template>
  45. <script>
  46. export default {
  47. data() {
  48. return {
  49. tel: '',
  50. code: '',
  51. codeText: '',
  52. pact: false
  53. }
  54. },
  55. computed: {},
  56. methods: {
  57. submit() {
  58. if (this.$u.test.mobile(this.tel)) {
  59. this.$u.route({
  60. url: 'pages/template/login/code'
  61. })
  62. }
  63. },
  64. codeChange(text) {
  65. this.codeText = text;
  66. },
  67. getCode() {
  68. if (this.$refs.uCode.canGetCode) {
  69. // 模拟向后端请求验证码
  70. uni.showLoading({
  71. title: '正在获取验证码',
  72. mask:"true"
  73. })
  74. setTimeout(() => {
  75. uni.hideLoading();
  76. // 通知验证码组件内部开始倒计时
  77. this.$refs.uCode.start();
  78. }, 1000);
  79. } else {
  80. this.$u.toast('倒计时结束后再发送');
  81. }
  82. }
  83. }
  84. };
  85. </script>
  86. <style lang="scss" scoped>
  87. .content {
  88. position: relative;
  89. top: -400rpx;
  90. }
  91. .foot {
  92. position: fixed;
  93. bottom: 10rpx;
  94. width: 100%;
  95. }
  96. </style>