editphone.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <view class="main bg-white margin-top padding-tb-sm">
  3. <view class="flex justify-between align-center padding-lr-sm">
  4. <view class="flex-sub margin-right-sm">
  5. <u-input v-model="value" :type="type" placeholder="请输入原绑定电话验证码" :border="border" />
  6. </view>
  7. <u-verification-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-verification-code>
  8. <u-button @click="getCode">{{tips}}</u-button>
  9. </view>
  10. <view class="flex justify-between align-center margin-top-sm padding-lr-sm">
  11. <view class="flex-sub margin-right-sm">
  12. <u-input v-model="newphone" :type="type" placeholder="请输入新号码" :border="border" />
  13. </view>
  14. </view>
  15. <view class="flex justify-between align-center margin-top-sm padding-lr-sm">
  16. <view class="flex-sub margin-right-sm">
  17. <u-input v-model="newcode" :type="type" placeholder="请输入新号码验证码" :border="border" />
  18. </view>
  19. <u-verification-code :seconds="newseconds" @end="newend" @start="newstart" ref="newuCode" @change="codeChange1"></u-verification-code>
  20. <u-button @click="getnewCode">{{newtips}}</u-button>
  21. </view>
  22. <view class="cu-bar bg-white tabbar" style="position: fixed;bottom: 0;width: 100%;">
  23. <view class="submit" style="background-color: #0B73B9;color: white;" @click="">
  24. 立即保存
  25. </view>
  26. </view>
  27. <view class="cu-tabbar-height"></view>
  28. <view class="cu-tabbar-height"></view>
  29. </view>
  30. </template>
  31. <script>
  32. import store from '@/store'
  33. export default {
  34. onLoad(options) {
  35. },
  36. mounted() {
  37. this.info = store.getters['getusers']
  38. },
  39. data() {
  40. return {
  41. value: '',
  42. newphone: "",
  43. newcode: "",
  44. type: 'number',
  45. border: true,
  46. tips: '',
  47. newtips: "",
  48. seconds: 60,
  49. newseconds: 60,
  50. info: {}
  51. }
  52. },
  53. methods: {
  54. codeChange(text) {
  55. this.tips = text;
  56. },
  57. codeChange1(text) {
  58. this.newtips = text;
  59. },
  60. getCode() {
  61. if (this.$refs.uCode.canGetCode) {
  62. this.$refs.uCode.start();
  63. } else {
  64. uni.showToast({
  65. title: "结束后再发送",
  66. icon: "none"
  67. })
  68. }
  69. },
  70. getnewCode() {
  71. if (this.$refs.newuCode.canGetCode) {
  72. this.$refs.newuCode.start();
  73. } else {
  74. uni.showToast({
  75. title: "结束后再发送",
  76. icon: "none"
  77. })
  78. }
  79. },
  80. end() {
  81. uni.showToast({
  82. title: "倒计时结束",
  83. icon: "none"
  84. })
  85. },
  86. start: async function() {
  87. uni.showToast({
  88. title: "倒计时开始",
  89. icon: "none"
  90. })
  91. let res = await this.$request.post("/api/v1/common/sendVerifyCode",{
  92. })
  93. },
  94. newend() {
  95. uni.showToast({
  96. title: "倒计时结束",
  97. icon: "none"
  98. })
  99. },
  100. newstart() {
  101. uni.showToast({
  102. title: "倒计时开始",
  103. icon: "none"
  104. })
  105. }
  106. }
  107. };
  108. </script>
  109. <style lang="scss">
  110. page {
  111. background-color: #fff;
  112. }
  113. .main {}
  114. </style>