wages.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <template>
  2. <div>
  3. <!-- <div class="top" @click="ret()">
  4. <div style="width: 10%;height: 5px;"></div>
  5. <div style="margin-left: 10px;">
  6. <span style="float: left;width: 20px;height: 20px;">
  7. <image src="../../static/icon/fanhui3.png" style="width: 18px;height: 18px;"></image>
  8. </span>
  9. <div style="margin-top: 5px;">
  10. <span style="color: #FFFFFF;">返回</span>
  11. </div>
  12. </div>
  13. <div style="text-align: center;margin-top: -22px;">
  14. <span style="color: #FFFFFF;">薪资查询</span>
  15. </div>
  16. </div> -->
  17. <cu-custom bgColor="bg-gradual-pink" :isBack="true">
  18. <block slot="backText">返回</block>
  19. <block slot="content">薪资查询</block>
  20. </cu-custom>
  21. <br>
  22. <div class="dt">
  23. <ul style="margin-left: -45px;">
  24. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.1s'}]">
  25. <li >
  26. <view class="cu-form-group" >
  27. <view class="title" style="margin-top: 10px;"><image src="../../static/eml.png" class="imgs"></image></view>
  28. <input placeholder="请输入邮箱" v-model="name" ></input>
  29. </view>
  30. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div>
  31. </li>
  32. </view>
  33. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.2s'}]">
  34. <li >
  35. <view class="cu-form-group" >
  36. <view class="title" style="margin-top: 10px;"><image src="../../static/yzm.png" class="imgs"></image></view>
  37. <input placeholder="邮箱验证码" v-model="code" ></input>
  38. <span style="float: right;color: #0081FF;font-size: 15px;" @click="getCode" v-if="show">获取验证码</span>
  39. <span v-if="!show" style="color: #D7D9E0;float: right;font-size: 15px;">已发送({{ times }})</span>
  40. </view>
  41. <div style="width: 100%; height: 1px; border-top: solid #ACC0D8 1px;"></div>
  42. </li>
  43. </view>
  44. </ul>
  45. </div>
  46. <br>
  47. <view class="cu-item animation-slide-bottom" :style="[{animationDelay: '0.5s'}]">
  48. <button style="background-color: #3C7AD8;color: #FFFFFF; width: 90%;" @click="save()">确定</button>
  49. <br>
  50. </view>
  51. </div>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. name: null,
  58. code: null,
  59. times: 60,
  60. show: true,
  61. userUrl: '/sys/user/sendEamilCode',
  62. emlCode: '/sys/user/GetEamilCode'
  63. }
  64. },
  65. methods: {
  66. getCode() {
  67. let checkEmail = /^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+)*\.[a-zA-Z0-9]{2,6}$/;
  68. if (this.name == "" || this.name == null) {
  69. this.$tip.alert("邮箱不能为空");
  70. return false;
  71. }
  72. /*if (!checkEmail.test(this.name)) {
  73. this.$tip.alert('请输入正确的邮箱地址');
  74. return false
  75. } */
  76. this.$http.get(this.userUrl, {
  77. params: {
  78. email: this.name
  79. }
  80. }).then(res => {
  81. console.log(res)
  82. if (res.data!="0"&&res.data!=0) {
  83. this.$tip.success('发送成功!')
  84. this.times = 60;
  85. this.show = false
  86. this.timer = setInterval(() => {
  87. this.times--
  88. if (this.times === 0) {
  89. this.show = true
  90. clearInterval(this.timer)
  91. }
  92. }, 1000)
  93. } else {
  94. this.$tip.alert('发送失败!')
  95. }
  96. }).catch(err => {
  97. console.log(err);
  98. });
  99. },
  100. save() {
  101. // this.$router.push({
  102. // name: 'wagesdetail'
  103. // });
  104. if (this.name == "" || this.name == null) {
  105. this.$tip.alert("邮箱不能为空");
  106. return false;
  107. }
  108. if (this.code == null || this.code == "") {
  109. this.$tip.alert("验证码不能为空");
  110. return false;
  111. }
  112. this.$http.get(this.emlCode, {
  113. params: {
  114. email: this.name,
  115. emailCode: this.code
  116. }
  117. }).then(res => {
  118. console.log(res)
  119. if (res.data == "ok"||res.data ==ok) {
  120. this.$router.push({
  121. name: 'wagesdetails'
  122. });
  123. }else{
  124. this.$tip.alert('邮箱或验证码错误!')
  125. }
  126. }).catch(err => {
  127. console.log(err);
  128. });
  129. }
  130. }
  131. }
  132. </script>
  133. <style>
  134. .dt{
  135. background-color: #FFFFFF;
  136. width: 90%;
  137. margin: 0 auto;
  138. margin-top: 20px;
  139. }
  140. .top {
  141. background-color: #5677AC;
  142. width: 100%;
  143. height: 40px;
  144. }
  145. ul li {
  146. list-style-type: none;
  147. }
  148. /* .img {
  149. width: 25px;
  150. height: 25px;
  151. background-size: 100% 100%;
  152. } */
  153. .img{
  154. width: 25px;
  155. height: 25px;
  156. background-size:100% 100%;
  157. }
  158. .imgs{
  159. width: 20px;
  160. height: 20px;
  161. background-size:100% 100%;
  162. }
  163. </style>