You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

141 lines
2.9 KiB

1 year ago
  1. <template>
  2. <view>
  3. <u-navbar
  4. :title="$t('page.setting.updatePayPassword.title')"
  5. :safeAreaInsetTop="false"
  6. placeholder
  7. @leftClick="leftClick"
  8. >
  9. </u-navbar>
  10. <u--form
  11. labelPosition="left"
  12. :model="model1"
  13. :rules="rules"
  14. class="line"
  15. ref="uForm"
  16. >
  17. <u-form-item
  18. :label="$t('page.setting.updatePayPassword.OldPassword')"
  19. prop="payPass"
  20. borderBottom
  21. labelWidth="80px"
  22. >
  23. <u--input
  24. v-model="model1.payPass"
  25. type="password"
  26. :placeholder="$t('page.setting.updatePayPassword.OldPassword-Placeholder')"
  27. ></u--input>
  28. </u-form-item>
  29. <u-form-item
  30. :label="$t('page.setting.updatePayPassword.newPassword')"
  31. prop="newPass"
  32. borderBottom
  33. labelWidth="80px"
  34. >
  35. <u--input
  36. v-model="model1.newPass"
  37. type="password"
  38. :placeholder="$t('page.setting.updatePayPassword.newPassword-Placeholder')"
  39. ></u--input>
  40. </u-form-item>
  41. <u-form-item
  42. :label="$t('page.setting.updatePayPassword.confirmPassword')"
  43. prop="okPayPass"
  44. borderBottom
  45. labelWidth="80px"
  46. >
  47. <u--input
  48. v-model="model1.okPayPass"
  49. type="password"
  50. :placeholder="$t('page.setting.updatePayPassword.newPassword-Placeholder')"
  51. ></u--input>
  52. </u-form-item>
  53. </u--form>
  54. <u-button class="submit"
  55. size="large" @click="submit"
  56. :text="$t('page.walletRecharge.submit')"></u-button>
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. model1: {
  64. id : 1,
  65. payPass: '',
  66. newPass: '',
  67. okPayPass : ''
  68. },
  69. rules: {
  70. 'payPass': {
  71. type: 'string',
  72. required: true,
  73. message: this.$t('page.setting.updatePayPassword.OldPassword-Placeholder'),
  74. trigger: ['blur', 'change']
  75. },
  76. 'newPass': {
  77. type: 'string',
  78. required: true,
  79. message: this.$t('page.setting.updatePayPassword.newPassword-Placeholder'),
  80. trigger: ['blur', 'change']
  81. },
  82. 'okPayPass': {
  83. type: 'string',
  84. required: true,
  85. message: this.$t('page.setting.updatePayPassword.newPassword-Placeholder'),
  86. trigger: ['blur', 'change']
  87. },
  88. },
  89. }
  90. },
  91. methods: {
  92. leftClick(){
  93. uni.navigateTo({
  94. url: '/pages/setting/setting'
  95. })
  96. },
  97. editPayPassword(){
  98. this.request('editPayPass',this.model1).then(res=>{
  99. if(res.code === 200){
  100. uni.$u.toast(this.$t('page.setting.updatePayPassword.edit-success'))
  101. setTimeout(()=>{
  102. uni.switchTab({
  103. url: '/pages/home/home'
  104. })
  105. },1000)
  106. }
  107. })
  108. },
  109. submit(){
  110. this.$refs.uForm.validate().then(res => {
  111. this.editPayPassword();
  112. })
  113. },
  114. }
  115. }
  116. </script>
  117. <style scoped lang="scss">
  118. .line{
  119. background-color: #fff;
  120. padding: 5px 10px;
  121. margin-top: 10px;
  122. .celi{
  123. border-radius: 10px;
  124. margin: 10px 0;
  125. }
  126. }
  127. .submit{
  128. border-radius: 30px;
  129. background-color: #ED762F;
  130. color: #fff;
  131. margin: 10px;
  132. width: calc(100% - 20px);
  133. }
  134. </style>