getCode.vue 635 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <template>
  2. <text class="getCode" @click="getCode">{{isSendCodeUse?sendCodeTime:"获取验证码"}}</text>
  3. </template>
  4. <script>
  5. import { sendCode } from "@/static/js/business.js"
  6. export default {
  7. props:{
  8. phone:{
  9. type:String,
  10. default:""
  11. }
  12. },
  13. data() {
  14. return {
  15. sendCodeTime:60,
  16. isSendCodeUse:false
  17. }
  18. },
  19. methods:{
  20. getCode(){
  21. let _self = this
  22. let data = {
  23. phone:_self.phone
  24. }
  25. _self.$emit("submit",{sendCode,t:_self})
  26. // sendCode.call(_self,data)
  27. }
  28. }
  29. }
  30. </script>
  31. <style lang="scss">
  32. .getCode{
  33. color:$base-color;
  34. width:140rpx;
  35. text-align:center;
  36. }
  37. </style>