index.vue 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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="50" :head-border-bottom="false" :show-head="false" :show-foot="false">
  6. <view slot="body">
  7. <u-field v-model="tel" icon="phone-fill" placeholder="请填写手机号">
  8. </u-field>
  9. <u-field v-model="code" icon="lock-fill" placeholder="请填写验证码">
  10. </u-field>
  11. </view>
  12. </u-card>
  13. <button @tap="submit" :style="[inputStyle]" class="getCaptcha">获取短信验证码</button>
  14. <view class="alternative">
  15. <view class="password">密码登录</view>
  16. <view class="issue">遇到问题</view>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. tel: '',
  26. code:''
  27. }
  28. },
  29. computed: {
  30. inputStyle() {
  31. let style = {};
  32. if (this.tel) {
  33. style.color = "#fff";
  34. style.backgroundColor = this.$u.color['warning'];
  35. }
  36. return style;
  37. }
  38. },
  39. methods: {
  40. submit() {
  41. if (this.$u.test.mobile(this.tel)) {
  42. this.$u.route({
  43. url: 'pages/template/login/code'
  44. })
  45. }
  46. }
  47. }
  48. };
  49. </script>
  50. <style lang="scss" scoped>
  51. .content {
  52. position: relative;
  53. top: -300rpx;
  54. }
  55. </style>