editPass.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <template>
  2. <view class="page">
  3. <view class="list_info">
  4. <view class="name">输入原密码:</view>
  5. <view class="item">
  6. <input type="password" class="input" placeholder="请输入原密码" v-model="password0" maxlength="32" />
  7. </view>
  8. <view class="name">请输入新密码:</view>
  9. <view class="item">
  10. <input type="password" class="input" placeholder="请输入新密码" v-model="password1" maxlength="32" />
  11. </view>
  12. <view class="name">请确认新密码:</view>
  13. <view class="item">
  14. <input type="password" class="input" placeholder="请再次输入新密码" v-model="password2" maxlength="32" />
  15. </view>
  16. <view class="blankHeight"></view>
  17. </view>
  18. <view class="btn_submit" @click="submitData">确定</view>
  19. <!-- 提示框 -->
  20. <DialogBox ref="DialogBox"></DialogBox>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. components: {},
  26. data() {
  27. return {
  28. title: '',
  29. sel: 1,
  30. mobile: '',
  31. password0: '',
  32. password1: '',
  33. password2: '',
  34. code: '',
  35. captchaTime: 0,
  36. }
  37. },
  38. onLoad() {},
  39. onShow() {
  40. // this.loadData();
  41. },
  42. methods: {
  43. onBack() {},
  44. submitData() {
  45. // if (this.mobile == "") {
  46. // uni.showToast({
  47. // title: "请输入手机号码",
  48. // icon: 'none'
  49. // });
  50. // return;
  51. // }
  52. if (this.password0 == "" || this.password1 == "" || this.password1 != this.password2) {
  53. uni.showToast({
  54. title: "请输入密码并确保两次密码一致",
  55. icon: 'none'
  56. });
  57. return;
  58. }
  59. // if (this.code == "") {
  60. // uni.showToast({
  61. // title: "请输入验证码",
  62. // icon: 'none'
  63. // });
  64. // return;
  65. // }
  66. uni.request({
  67. url: this.$apiHost + '/Member/editPass',
  68. data: {
  69. uuid: getApp().globalData.uuid,
  70. type: 'password',
  71. password0: this.password0,
  72. password1: this.password1,
  73. // code: this.code,
  74. },
  75. header: {
  76. 'content-type': 'application/json'
  77. },
  78. success: (res) => {
  79. console.log("----", res.data);
  80. uni.showToast({
  81. title: res.data.str,
  82. icon: 'none'
  83. });
  84. if (res.data.success == "yes") {
  85. this.password0 = "";
  86. this.password1 = "";
  87. this.password2 = "";
  88. }
  89. }
  90. });
  91. },
  92. }
  93. }
  94. </script>
  95. <style scoped lang="scss">
  96. @import 'normal.scss';
  97. </style>