otherLogin.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view class="container">
  3. <u-divider text="其他登录方式" textSize="3.2vw" textColor="#fff" lineColor="#fff" />
  4. <view class="grid-box">
  5. <view class="item">
  6. 微信
  7. </view>
  8. <view class="item" @click="changeLoginMethod">
  9. {{ loginMethod == 'phone' ? '账号' : '手机' }}
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. name: "OtherLogin",
  17. props: {
  18. "loginMethod": String,
  19. onChange: Function
  20. },
  21. methods: {
  22. /* 改变登录方式 */
  23. changeLoginMethod() {
  24. this.$emit("onChange", this.loginMethod == 'account' ? 'phone' : 'account')
  25. }
  26. },
  27. }
  28. </script>
  29. <style lang="scss" scoped>
  30. .container {
  31. width: 275px !important;
  32. margin: -20px auto 0;
  33. .grid-box {
  34. display: flex;
  35. width: 100%;
  36. justify-content: center;
  37. flex-wrap: wrap;
  38. .item {
  39. width: 40px;
  40. height: 40px;
  41. border-radius: 50%;
  42. background-color: red;
  43. flex-shrink: 0;
  44. margin: 0 7px 7px;
  45. text-align: center;
  46. line-height: 40px;
  47. color: #fff;
  48. }
  49. }
  50. }
  51. </style>