index.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view class="normal-login-container">
  3. <view class="title-content">
  4. <text class="title">哈密市重点项目<br>建设及工作可视<br>化管理平台</text>
  5. </view>
  6. <view class="login-form-content">
  7. <view class="welcome-text" @click="goToLogin()">
  8. <u-icon name="arrow-left" color="#C6C6CD" size="26"></u-icon>
  9. <text>更换服务地址</text>
  10. </view>
  11. <view class="item-text">输入新的服务地址</view>
  12. <view class="input-item flex align-center">
  13. <input v-model="serverAddress" class="input" type="text" placeholder="不填写将使用系统默认地址" maxlength="30" />
  14. </view>
  15. <button class="login-btn cu-btn block bg-blue lg round" @click="setServerAddress()">设置</button>
  16. </view>
  17. </view>
  18. </template>
  19. <script setup>
  20. import {
  21. ref
  22. } from "vue";
  23. import {
  24. onLoad,
  25. } from "@dcloudio/uni-app"
  26. function goToLogin() {
  27. uni.navigateBack({})
  28. }
  29. let serverAddress = ref(null)
  30. function setServerAddress() {
  31. try {
  32. uni.setStorageSync('serverAddress', serverAddress.value)
  33. uni.showToast({
  34. title: "更改成功,即将重启。",
  35. icon: "error",
  36. duration: 2000
  37. })
  38. setTimeout(() => {
  39. plus.runtime.restart();
  40. // uni.reLaunch({
  41. // url: '/pages/login/index'
  42. // })
  43. }, 2000)
  44. } catch {
  45. uni.showToast({
  46. title: "设置服务地址失败。",
  47. icon: "error",
  48. duration: 2000
  49. })
  50. }
  51. }
  52. onLoad(() => {
  53. serverAddress.value = uni.getStorageSync('serverAddress');
  54. })
  55. </script>
  56. <style lang="scss">
  57. page {
  58. height: 100%;
  59. background-color: #EAF0FA;
  60. }
  61. .normal-login-container {
  62. position: relative;
  63. width: 100%;
  64. height: 100%;
  65. background: linear-gradient(108deg, #192DE8 0%, #1DA0FF 53%, #84D8FF 100%);
  66. .title-content {
  67. width: 100%;
  68. height: 46%;
  69. z-index: 1;
  70. background: url('@/static/login_bg.png');
  71. background-size: 100% 100%;
  72. .title {
  73. position: absolute;
  74. top: 8.5%;
  75. left: 7.4%;
  76. font-size: 52rpx;
  77. font-weight: 700;
  78. color: #FFFFFF;
  79. }
  80. }
  81. .login-form-content {
  82. position: absolute;
  83. top: 32%;
  84. left: 0;
  85. width: 100%;
  86. height: 68%;
  87. padding: 40rpx 7%;
  88. background-color: #fff;
  89. border-radius: 40rpx 40rpx 0rpx 0rpx;
  90. .welcome-text {
  91. display: flex;
  92. align-items: center;
  93. margin: 60rpx 0;
  94. font-size: 44rpx;
  95. font-weight: 700;
  96. color: #C6C6CD;
  97. text {
  98. margin-left: 20rpx;
  99. }
  100. }
  101. .item-text {
  102. font-size: 36rpx;
  103. font-weight: 400;
  104. font-family: Source Han Sans CN-Regular, Source Han Sans CN;
  105. color: #343437;
  106. }
  107. .input-item {
  108. height: 90rpx;
  109. margin: 20rpx auto 30rpx;
  110. font-size: 28rpx;
  111. background-color: #f5f6f7;
  112. border-radius: 16rpx;
  113. .input {
  114. width: 100%;
  115. font-size: 14px;
  116. line-height: 20px;
  117. text-align: left;
  118. padding-left: 15px;
  119. }
  120. }
  121. .forget-pass-item {
  122. text-align: right;
  123. }
  124. .forget-pass {
  125. color: #1869F6;
  126. border-bottom: 2rpx solid #1869F6;
  127. }
  128. .login-btn {
  129. margin-top: 50rpx;
  130. height: 45px;
  131. background: #1869F6;
  132. border-radius: 16rpx;
  133. }
  134. .xieyi {
  135. color: #333;
  136. margin-top: 20px;
  137. }
  138. .login-code {
  139. height: 38px;
  140. float: right;
  141. .login-code-img {
  142. height: 38px;
  143. position: absolute;
  144. margin-left: 10px;
  145. width: 200rpx;
  146. }
  147. }
  148. }
  149. }
  150. </style>