editpassword.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. <template>
  2. <view>
  3. <scroll-view scroll-y class="page">
  4. <cu-custom bgColor="bg-luohu" :isBack="true">
  5. <block slot="backText">返回</block>
  6. <block slot="content">修改密码</block>
  7. <!-- <view slot="right" @tap="rightClick">编辑</view> -->
  8. </cu-custom>
  9. <view class="example-body " style="display: flex;justify-content: center; margin-top: 80rpx;">
  10. <uni-file-picker readonly :value="fileLists" :imageStyles="imageStyles" file-mediatype="image">
  11. </uni-file-picker>
  12. </view>
  13. <!-- list列表 -->
  14. <uni-card>
  15. <view class="cu-list menu">
  16. <view class="cu-form-group">
  17. <view class="title">密码</view>
  18. <input placeholder="请输入六位以上密码" name="input" type="password" v-model="password"></input>
  19. </view>
  20. <view class="cu-form-group">
  21. <view class="title">确认</view>
  22. <input placeholder="请再输入一遍密码" name="input" type="password" v-model="again"></input>
  23. </view>
  24. </view>
  25. </uni-card>
  26. <view class="padding flex flex-direction" style="margin-bottom: 100rpx;">
  27. <button class="cu-btn bg-blue lg" @click="submit">确认修改</button>
  28. </view>
  29. </scroll-view>
  30. </view>
  31. </template>
  32. <script>
  33. import {
  34. ACCESS_TOKEN,
  35. USER_NAME,
  36. USER_INFO
  37. } from "@/common/util/constants"
  38. import api from '@/api/api.js'
  39. export default {
  40. data() {
  41. return {
  42. imageStyles: {
  43. width: 84,
  44. height: 84,
  45. border: {
  46. radius: '50%'
  47. }
  48. },
  49. listStyles: {
  50. // 是否显示边框
  51. border: true,
  52. // 是否显示分隔线
  53. dividline: true,
  54. // 线条样式
  55. borderStyle: {
  56. width: 1,
  57. color: 'blue',
  58. style: 'dashed',
  59. radius: 2
  60. }
  61. },
  62. fileLists: [{
  63. //url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b7c7f970-517d-11eb-97b7-0dc4655d6e68.jpg',
  64. url: '/static/touxiang.jpg',
  65. extname: 'png',
  66. name: 'shuijiao.png'
  67. }],
  68. password: "",
  69. again: "",
  70. };
  71. },
  72. onLoad() {
  73. this.user = uni.getStorageSync(USER_INFO);
  74. //this.loadinfo()
  75. console.log(this.user)
  76. },
  77. methods: {
  78. submit() {
  79. if (!this.password || this.password.length < 6) {
  80. this.$tip.alert('正确输入密码');
  81. return false
  82. }
  83. if (this.password != this.again) {
  84. this.$tip.alert('两次输入不一致');
  85. return false
  86. }
  87. let data = {
  88. "userIds": [
  89. this.user.employee.id,
  90. ],
  91. "newPassword": this.password,
  92. "repeatPassword": this.again,
  93. "primitivePassword": "",
  94. "reset": 1
  95. };
  96. let that = this;
  97. this.$http.post("/ibps/platform/v3/user/change/passwd", data).then(res => {
  98. if (res.data.state == 200) {
  99. that.$tip.toast("修改成功")
  100. uni.navigateTo({
  101. url: "/pages/index/index"
  102. })
  103. } else {
  104. this.$tip.toast("发送异常");
  105. }
  106. });
  107. }
  108. }
  109. }
  110. </script>
  111. <style>
  112. .page {
  113. height: 100Vh;
  114. width: 100vw;
  115. }
  116. .page.show {
  117. overflow: hidden;
  118. }
  119. .switch-sex::after {
  120. content: "\e716";
  121. }
  122. .switch-sex::before {
  123. content: "\e7a9";
  124. }
  125. .switch-music::after {
  126. content: "\e66a";
  127. }
  128. .switch-music::before {
  129. content: "\e6db";
  130. }
  131. .example-body {
  132. padding: 10px;
  133. padding-top: 0;
  134. }
  135. .custom-image-box {
  136. /* #ifndef APP-NVUE */
  137. display: flex;
  138. /* #endif */
  139. flex-direction: row;
  140. justify-content: space-between;
  141. align-items: center;
  142. }
  143. .text {
  144. font-size: 14px;
  145. color: #333;
  146. }
  147. </style>