index.vue 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <template>
  2. <view class="home" :style="homeBj">
  3. <view class="bjBox" :style="bjBoxBj">
  4. <view class="text">
  5. 青田干部信息管理系统
  6. </view>
  7. <view class="passwordBox">
  8. <hackout-draw-lock :width='width' background="rgba(0,0,0,0)" :circle-width="64"
  9. line-color="rgb(129, 129, 129)" line-background="rgba(152, 152, 152, 0.5)" :height='height'
  10. @change="success" @start="startDraw"></hackout-draw-lock>
  11. </view>
  12. </view>
  13. </view>
  14. </template>
  15. <script>
  16. import hackoutDrawLock from "@/components/hackout-draw-lock/hackout-draw-lock.vue"
  17. export default {
  18. components: {
  19. hackoutDrawLock,
  20. // videoPlayer
  21. },
  22. data() {
  23. return {
  24. homeBj: {
  25. background: "url('../../static/imgs/qidong.png') no-repeat",
  26. backgroundSize: "100% 100%"
  27. },
  28. bjBoxBj: {
  29. background: "url('../../static/imgs/dengruk.png') no-repeat",
  30. backgroundSize: "100% 100%"
  31. },
  32. width: 320,
  33. height: 320,
  34. pass: '',
  35. isPass: false,
  36. lineError: false,
  37. password: '12369',
  38. };
  39. },
  40. onLoad() {
  41. if (uni.getStorageSync('line_pass')) {
  42. this.password = uni.getStorageSync('line_pass')
  43. }
  44. },
  45. mounted() {
  46. },
  47. methods: {
  48. //图形密码绘制完成
  49. success(data) {
  50. //验证图形密码
  51. this.pass = data.join('')
  52. if (this.pass != this.password) {
  53. uni.showToast({
  54. title: '密码错误',
  55. icon: 'none'
  56. })
  57. return
  58. }
  59. uni.reLaunch({
  60. url: '/pages/home/home'
  61. })
  62. },
  63. startDraw() {
  64. this.lineError = false
  65. this.pass = ''
  66. }
  67. }
  68. }
  69. </script>
  70. <style lang="scss" scoped>
  71. .home {
  72. width: 100%;
  73. height: 100%;
  74. position: relative;
  75. .bjBox {
  76. width: 55%;
  77. height: 88%;
  78. padding-top: 300rpx;
  79. position: absolute;
  80. top: 50%;
  81. left: 50%;
  82. transform: translate(-50%, -50%);
  83. .text {
  84. font-size: 50rpx;
  85. text-align: center;
  86. letter-spacing: 5rpx;
  87. }
  88. .passwordBox {
  89. width: 80%;
  90. height: 80%;
  91. margin: 0 auto;
  92. }
  93. }
  94. }
  95. </style>