editpassword.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. <template>
  2. <view>
  3. <scroll-view scroll-y class="page">
  4. <cu-custom bgColor="bg-gradual-pink" :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 { ACCESS_TOKEN,USER_NAME,USER_INFO } from "@/common/util/constants"
  34. import api from '@/api/api.js'
  35. export default {
  36. data() {
  37. return {
  38. imageStyles: {
  39. width: 84,
  40. height: 84,
  41. border: {
  42. radius: '50%'
  43. }
  44. },
  45. listStyles: {
  46. // 是否显示边框
  47. border: true,
  48. // 是否显示分隔线
  49. dividline: true,
  50. // 线条样式
  51. borderStyle: {
  52. width: 1,
  53. color: 'blue',
  54. style: 'dashed',
  55. radius: 2
  56. }
  57. },
  58. fileLists: [{
  59. //url: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/b7c7f970-517d-11eb-97b7-0dc4655d6e68.jpg',
  60. url:'/static/touxiang.jpg',
  61. extname: 'png',
  62. name: 'shuijiao.png'
  63. }],
  64. password:"",
  65. again:"",
  66. };
  67. },
  68. onLoad() {
  69. this.user=uni.getStorageSync(USER_INFO);
  70. //this.loadinfo()
  71. console.log(this.user)
  72. },
  73. methods: {
  74. submit(){
  75. if(!this.password || this.password.length<6){
  76. this.$tip.alert('正确输入密码');
  77. return false
  78. }
  79. if(this.password != this.again){
  80. this.$tip.alert('两次输入不一致');
  81. return false
  82. }
  83. let data={
  84. "userIds": [
  85. this.user.employee.id,
  86. ],
  87. "newPassword": this.password,
  88. "repeatPassword": this.again,
  89. "primitivePassword": "",
  90. "reset": 1
  91. };
  92. let that=this;
  93. this.$http.post("/ibps/platform/v3/user/change/passwd",data).then(res=>{
  94. if(res.data.state==200){
  95. that.$tip.toast("修改成功")
  96. uni.navigateTo({
  97. url:"/pages/index/index"
  98. })
  99. }else{
  100. this.$tip.toast("发送异常");
  101. }
  102. });
  103. }
  104. }
  105. }
  106. </script>
  107. <style>
  108. .page {
  109. height: 100Vh;
  110. width: 100vw;
  111. }
  112. .page.show {
  113. overflow: hidden;
  114. }
  115. .switch-sex::after {
  116. content: "\e716";
  117. }
  118. .switch-sex::before {
  119. content: "\e7a9";
  120. }
  121. .switch-music::after {
  122. content: "\e66a";
  123. }
  124. .switch-music::before {
  125. content: "\e6db";
  126. }
  127. .example-body {
  128. padding: 10px;
  129. padding-top: 0;
  130. }
  131. .custom-image-box {
  132. /* #ifndef APP-NVUE */
  133. display: flex;
  134. /* #endif */
  135. flex-direction: row;
  136. justify-content: space-between;
  137. align-items: center;
  138. }
  139. .text {
  140. font-size: 14px;
  141. color: #333;
  142. }
  143. </style>