editPassword.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="container">
  3. <form @submit="onSubmit">
  4. <view class="page-block">
  5. <view class="page-title-block">
  6. </view>
  7. <view class="content">
  8. <view class="cell flex flex-y-center">
  9. <view class="title-block required">
  10. <text>原密码</text>
  11. </view>
  12. <view class="desc">
  13. <input type="text" class="input-box" name="password_old" placeholder="请输入"
  14. placeholder-class="desc-placeholder">
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="page-block">
  20. <view class="page-title-block">
  21. </view>
  22. <view class="content">
  23. <view class="cell flex flex-y-center">
  24. <view class="title-block required">
  25. <text>设置新密码</text>
  26. </view>
  27. <view class="desc">
  28. <input type="text" name="password" class="input-box" placeholder="请输入"
  29. placeholder-class="desc-placeholder">
  30. </view>
  31. </view>
  32. <view class="cell flex flex-y-center">
  33. <view class="title-block required">
  34. <text>确认新密码</text>
  35. </view>
  36. <view class="desc">
  37. <input type="text" name="password_confirm" class="input-box" password placeholder="请输入"
  38. placeholder-class="desc-placeholder">
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="footer-bar">
  44. <view class="content flex flex-center" style="background: none;">
  45. <button class="btn" hover-class="none" form-type="submit">
  46. 立即提交
  47. </button>
  48. </view>
  49. </view>
  50. </form>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. }
  58. },
  59. methods: {
  60. onSubmit(e) {
  61. if (!e.detail.value.password_old||!e.detail.value.password||!e.detail.value.password_confirm) {
  62. uni.showToast({
  63. title: "必填项不能为空",
  64. icon: 'none'
  65. })
  66. return false
  67. }
  68. let data=e.detail.value;
  69. data.id=uni.getStorageSync("admin_id");
  70. this.request({
  71. url:"Smdcshop/editshoppassword",
  72. data,
  73. }).then(res => {
  74. if (res.code == 200) {
  75. uni.showToast({
  76. title: res.message,
  77. icon: 'none'
  78. })
  79. setTimeout(() => {
  80. uni.navigateBack()
  81. }, 2000)
  82. }
  83. }).catch((res) => {
  84. uni.showToast({
  85. title: res.message,
  86. icon: 'none'
  87. })
  88. });
  89. }
  90. }
  91. }
  92. </script>
  93. <style>
  94. @import url("../static/css/common.css");
  95. page {
  96. background-color: #F4F5F7;
  97. }
  98. .sub-btn {
  99. width: 690rpx;
  100. height: 100rpx;
  101. background: linear-gradient(315deg, #3387ff 2%, #569bff 99%);
  102. border-radius: 8rpx;
  103. box-shadow: 0px 0px 8rpx 0px rgba(51, 135, 255, 0.20);
  104. text-align: center;
  105. line-height: 100rpx;
  106. color: #fff;
  107. font-size: 36rpx;
  108. font-weight: bold;
  109. position: fixed;
  110. left: 50%;
  111. bottom: 70rpx;
  112. transform: translateX(-50%);
  113. }
  114. </style>