input_trade_password.vue 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <template>
  2. <view class="page">
  3. <view class="page">
  4. <pay-keyboard :set_info = "set_info" :show_key="show_key" ref="payKeyboard" :set_msg="set_msg" @hideFun="hideFun" @getPassword="getPassword" :password="password"></pay-keyboard>
  5. </view>
  6. </view>
  7. </template>
  8. <script>
  9. import payKeyboard from '../../components/uni-keyword/uni-keyword';
  10. import _get from '../../common/_get';
  11. import _hook from '../../common/_hook';
  12. export default {
  13. components: {
  14. payKeyboard
  15. },
  16. data() {
  17. return {
  18. title: '请再次输入交易密码',
  19. show_key: true,
  20. password:'',
  21. set_msg:'请再次输入交易密码',
  22. set_info:'请再次输入交易密码,以确认身份',
  23. page_params:{},
  24. click:true
  25. }
  26. },
  27. onLoad(options) {
  28. this.page_params = options;
  29. },
  30. onShow(){
  31. _hook.routeSonHook();
  32. },
  33. methods: {
  34. showFun() {
  35. this.show_key = true
  36. },
  37. hideFun() {
  38. this.show_key = false
  39. },
  40. getPassword(n) {
  41. let _this = this;
  42. if(_this.page_params.password != n.password){
  43. return uni.showToast({
  44. title: '两次密码输入不一致!',
  45. duration:2000,
  46. icon:'none',
  47. success:function () {
  48. setTimeout(function () {
  49. _this.$refs.payKeyboard.cleanNum();
  50. uni.$emit('clean_password_data');
  51. uni.redirectTo({url:"/pages/my/foget_trade_password?show_key="+1})
  52. },1000)
  53. }
  54. });
  55. }
  56. _this.page_params.confirmPassword = n.password;
  57. _get.updateUserTradePassword(_this.page_params,function (res) {
  58. uni.showToast({
  59. title: '操作成功',
  60. duration:2000,
  61. icon:'none',
  62. success:function () {
  63. _this.$refs.payKeyboard.cleanNum();
  64. uni.navigateBack();
  65. }
  66. });
  67. },function (ret) {
  68. uni.showToast({
  69. title: ret.msg,
  70. duration:2000,
  71. icon:'none',
  72. success:function () {
  73. setTimeout(function () {
  74. _this.$refs.payKeyboard.cleanNum();
  75. uni.$emit('clean_password_data');
  76. uni.redirectTo({url:"/pages/my/foget_trade_password"})
  77. },1000)
  78. }
  79. });
  80. })
  81. },
  82. cleanNum(){
  83. this.$refs.payKeyboard.cleanNum();
  84. }
  85. }
  86. }
  87. </script>