login.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. <template>
  2. <view class="container">
  3. <image class="image"
  4. src="https://yossys22170.obs.cn-east-2.myhuaweicloud.com:443/202309251695606306772B2018b85b.jpg"
  5. mode="scaleToFill" />
  6. <view class="box">
  7. <view :style="{ height: height }" />
  8. <view class="logo">
  9. <u--image src="/static/img/LOGO-c1524a7d.svg" width="39.200vw" height="12.533vw" mode="scaleToFill">
  10. <template v-slot:loading>
  11. <u-loading-icon color="red"></u-loading-icon>
  12. </template>
  13. <view slot="error" style="font-size: 12px;">加载失败</view>
  14. </u--image>
  15. </view>
  16. <account :isAgreement="isAgreement" v-show="loginMethod == 'account'" />
  17. <phone :isAgreement="isAgreement" v-show="loginMethod == 'phone'" />
  18. <view style="height: 25px;" />
  19. <view class="agreement">
  20. <u-checkbox :checked="isAgreement" shape="circle" @change="changeAgreement" />
  21. <view @click="changeAgreement">
  22. 已阅读并同意
  23. </view>
  24. <text class="nav" @tap="checkTheAgreement">《隐私协议》</text>
  25. </view>
  26. <other-login :isAgreement="isAgreement" :loginMethod="loginMethod" @onChange="changeLoginMethod" />
  27. </view>
  28. </view>
  29. </template>
  30. <script>
  31. import account from "./modules/account.vue";
  32. import phone from "./modules/phone.vue";
  33. import otherLogin from "./modules/otherLogin.vue";
  34. export default {
  35. components: {
  36. account,
  37. phone,
  38. otherLogin
  39. },
  40. data() {
  41. return {
  42. loginMethod: "",
  43. height: this.usePort == 'h5' ? "100px" : "100px",
  44. isAgreement: false
  45. };
  46. },
  47. onLoad() {
  48. this.loginMethod = uni.getStorageSync('loginMethod') || 'account';//登录方式
  49. if (uni.getStorageSync("isAgreement")) this.isAgreement = true;
  50. },
  51. methods: {
  52. /* 修改登录方式 */
  53. changeLoginMethod(Method) {
  54. this.loginMethod = Method;
  55. },
  56. changeAgreement() {
  57. this.isAgreement = !this.isAgreement;
  58. },
  59. checkTheAgreement() {
  60. uni.showLoading({
  61. title: '加载中...',
  62. })
  63. uni.downloadFile({
  64. url: 'https://yossys22170.obs.cn-east-2.myhuaweicloud.com:443/202309261695715892017B6ef5bd76.docx',
  65. success: (res) => {
  66. uni.openDocument({
  67. filePath: res.tempFilePath,
  68. fileType: "docx",
  69. success: (s) => {
  70. uni.hideLoading();
  71. },
  72. fail: (err) => {
  73. console.log("openDocument", err)
  74. uni.hideLoading();
  75. uni.showToast({
  76. title: '读取失败,请稍后再试',
  77. icon: "none"
  78. })
  79. }
  80. })
  81. },
  82. fail: (err) => {
  83. console.log("downloadFile", err)
  84. uni.hideLoading();
  85. uni.showToast({
  86. title: '读取失败,请稍后再试',
  87. icon: "none"
  88. })
  89. }
  90. })
  91. }
  92. }
  93. }
  94. </script>
  95. <style lang="scss" scoped>
  96. .container {
  97. position: relative;
  98. .box {
  99. position: fixed;
  100. top: 0;
  101. left: 0;
  102. width: 100vw;
  103. box-sizing: border-box;
  104. z-index: 9;
  105. .logo {
  106. width: 147px;
  107. height: 42px;
  108. margin: 0 auto 50px;
  109. }
  110. .agreement {
  111. display: flex;
  112. justify-content: center;
  113. margin: 0 auto;
  114. height: 17px;
  115. font-size: 12px;
  116. font-weight: 400;
  117. color: #fff;
  118. .nav {
  119. color: #16FFF6;
  120. }
  121. }
  122. /deep/.u-checkbox__icon-wrap,
  123. /deep/.u-checkbox__icon-wrap--circle {
  124. width: 16px !important;
  125. height: 16px !important;
  126. .u-icon__icon {
  127. font-size: 10px !important;
  128. }
  129. }
  130. }
  131. .image {
  132. width: 100vw;
  133. height: 100vh;
  134. position: absolute;
  135. top: 0;
  136. z-index: 3;
  137. }
  138. }
  139. </style>