google-verification.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <template>
  2. <view>
  3. <!-- 头部 -->
  4. <headContent>
  5. <template #left>
  6. <view class="head-revers-back iconfont" @click.stop="reversBackBtn()">&#xe604;</view>
  7. </template>
  8. <template #content>
  9. <view class="haed-title">安全验证</view>
  10. </template>
  11. </headContent>
  12. <view class="page-content">
  13. <text class="login-title">谷歌验证</text>
  14. <text class="login-content">谷歌验证具有时效性,请于限时前输入</text>
  15. <view class="form-item">
  16. <input class="form-input" v-model="code" placeholder-class="form-input-place" :placeholder="`请输入验证码`" />
  17. </view>
  18. <view :class="['form-btn' , code ? '' : 'invalid-form-btn']" style="margin-top: 28rpx;"
  19. @click.stop="formSubmit">
  20. 确定
  21. </view>
  22. </view>
  23. </view>
  24. </template>
  25. <script>
  26. import {
  27. reverseBack
  28. } from "@/utils/common.js"
  29. import {
  30. Api_checkGoogle
  31. } from "@/api/index.js"
  32. export default {
  33. name: 'google-verification',
  34. data() {
  35. return {
  36. code: '',
  37. };
  38. },
  39. onLoad(opt) {
  40. },
  41. methods: {
  42. reversBackBtn() {
  43. reverseBack()
  44. },
  45. formSubmit() {
  46. uni.showLoading({
  47. title: '',
  48. mask: true
  49. });
  50. Api_checkGoogle({
  51. code: this.code
  52. }).then(res => {
  53. setTimeout(() => {
  54. uni.showToast({
  55. title: `验证成功`,
  56. icon: "none"
  57. })
  58. setTimeout(() => {
  59. uni.reLaunch({
  60. url: '/pages/content/mine'
  61. });
  62. }, 1000)
  63. }, 300)
  64. }).catch(err =>{}).finally(() => {
  65. setTimeout(() => {
  66. uni.hideLoading()
  67. }, 200)
  68. })
  69. // Api_checkGoogle().then(res => {
  70. // setTimeout(() => {
  71. // uni.showToast({
  72. // title: `验证成功`,
  73. // icon: "none"
  74. // })
  75. // setTimeout(() => {
  76. // uni.reLaunch({
  77. // url: '/pages/content/mine'
  78. // });
  79. // }, 1000)
  80. // }, 300)
  81. // }).catch(err => {
  82. // }).failly(() => {
  83. // setTimeout(() => {
  84. // uni.hideLoading()
  85. // }, 200)
  86. // })
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss" scoped>
  92. .head-revers-back {
  93. font-size: 52rpx;
  94. color: #000;
  95. }
  96. .page-content {
  97. width: 100%;
  98. padding: 30rpx 60rpx 0;
  99. .login-title {
  100. display: block;
  101. font-size: 68rpx;
  102. font-family: PingFang SC, PingFang SC-Bold;
  103. font-weight: 700;
  104. color: #333333;
  105. line-height: 1.2;
  106. letter-spacing: 0.96rpx;
  107. }
  108. .login-content {
  109. display: block;
  110. font-size: 28rpx;
  111. font-family: PingFang SC, PingFang SC-Regular;
  112. font-weight: 400;
  113. color: #808080;
  114. line-height: 1.2;
  115. letter-spacing: 0.56rpx;
  116. padding: 20rpx 0 40rpx;
  117. }
  118. }
  119. .tab-box {
  120. padding-bottom: 44rpx;
  121. }
  122. .tab {
  123. width: 100%;
  124. display: flex;
  125. align-items: center;
  126. padding-top: 46rpx;
  127. .tab-item {
  128. font-size: 30rpx;
  129. font-family: PingFang SC, PingFang SC-Bold;
  130. font-weight: 700;
  131. color: #1a1a1a;
  132. line-height: 38rpx;
  133. letter-spacing: 0.6rpx;
  134. +.tab-item {
  135. margin-left: 50rpx;
  136. }
  137. }
  138. .active-tab-item {
  139. color: $Theme-Color;
  140. position: relative;
  141. &::before {
  142. position: absolute;
  143. left: 0;
  144. bottom: -11rpx;
  145. content: '';
  146. width: 100%;
  147. height: 6rpx;
  148. border-radius: 2rpx;
  149. background-color: $Theme-Color;
  150. }
  151. }
  152. }
  153. .form-lable-icon {
  154. margin-left: 4px;
  155. font-size: 18rpx;
  156. }
  157. .login-form {
  158. width: 100%;
  159. .form-item {
  160. width: 100%;
  161. height: 90rpx;
  162. padding: 0 20rpx;
  163. display: flex;
  164. align-items: center;
  165. background-color: $box-bg;
  166. border-radius: 6rpx;
  167. margin-top: 20rpx;
  168. &:first-child {
  169. margin-top: 0;
  170. }
  171. .form-lable {
  172. width: 140rpx;
  173. height: 100%;
  174. font-size: 24rpx;
  175. flex-wrap: 700;
  176. display: flex;
  177. align-items: center;
  178. }
  179. .form-input {
  180. flex: 1;
  181. height: 100%;
  182. font-size: 28rpx;
  183. }
  184. .form-input-place {
  185. font-size: 28rpx;
  186. color: #938989;
  187. }
  188. }
  189. }
  190. .form-agreement {
  191. width: 100%;
  192. display: flex;
  193. align-items: center;
  194. font-size: 26rpx;
  195. color: #938989;
  196. padding: 26rpx 0;
  197. .agreement-confirm {
  198. width: 30rpx;
  199. height: 30rpx;
  200. background-color: $box-bg;
  201. margin-right: 10rpx;
  202. border-radius: 6rpx;
  203. .confirm-icon {
  204. width: 100%;
  205. height: 100%;
  206. background-color: $Theme-Color;
  207. color: #fff;
  208. display: flex;
  209. justify-content: center;
  210. align-items: center;
  211. font-size: 24rpx;
  212. }
  213. }
  214. .agreement-name {
  215. color: $Theme-Color;
  216. }
  217. }
  218. .form-btn {
  219. width: 100%;
  220. height: 90rpx;
  221. background-color: $Theme-Color;
  222. border-radius: 8rpx;
  223. text-align: center;
  224. line-height: 90rpx;
  225. color: #fff;
  226. font-size: 32rpx;
  227. font-weight: bold;
  228. }
  229. .invalid-form-btn {
  230. background-color: #e3e0e0;
  231. }
  232. .form-hint {
  233. width: 100%;
  234. padding: 46rpx 0 0;
  235. font-size: 24rpx;
  236. line-height: 1.2;
  237. color: #c1c1c1;
  238. display: flex;
  239. justify-content: center;
  240. align-items: stretch;
  241. .hint-btn {
  242. color: $Theme-Color;
  243. }
  244. .form-hint-link {
  245. margin: 0 10px;
  246. width: 1rpx;
  247. background-color: #cfcfcf;
  248. }
  249. }
  250. .code-box {
  251. width: 100%;
  252. margin-top: 50rpx;
  253. .code-hint {
  254. margin-top: 50rpx;
  255. font-size: 28rpx;
  256. display: inline-block;
  257. color: #666;
  258. }
  259. }
  260. .login-title {
  261. font-size: 34rpx !important;
  262. }
  263. .login-content {
  264. padding-bottom: 0 !important;
  265. }
  266. .form-lable {
  267. min-width: 100rpx;
  268. text-align: center;
  269. padding: 0 20rpx;
  270. flex-shrink: 0;
  271. }
  272. .form-item {
  273. width: 100%;
  274. min-height: 100rpx;
  275. display: flex;
  276. justify-content: space-between;
  277. align-items: center;
  278. border-bottom: 1rpx solid $border-color4;
  279. .form-input {
  280. flex: 1;
  281. font-size: 26rpx;
  282. }
  283. .form-input-place {
  284. font-size: 26rpx;
  285. font-weight: 800;
  286. }
  287. .form-code {
  288. flex-shrink: 0;
  289. padding-left: 10rpx;
  290. font-size: 26rpx;
  291. color: $Theme-Color;
  292. }
  293. }
  294. .form-btn {
  295. margin-top: 80rpx !important;
  296. }
  297. </style>