移动端
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 

105 rindas
3.8 KiB

  1. <template>
  2. <div class="app-container">
  3. <div class="bannerBg" style="">
  4. <van-nav-bar
  5. style="background:transparent;border-bottom-width:0;"
  6. @click-left="$router.back(-1)"
  7. >
  8. <template #left>
  9. <van-icon name="arrow-left" size="18" color="#fff" />
  10. </template>
  11. <template #title>
  12. <p style="color:#fff">设置</p>
  13. </template>
  14. </van-nav-bar>
  15. </div>
  16. <!-- <van-cell title="个人信息" is-link style="border-radius: 16px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px;background:#fff;padding:20px;">
  17. <template #icon>
  18. <van-icon :name="require('../../assets/images/housesteadSurvey/little1.png')" size="18" color="#fff" style="margin:10px;"/>
  19. </template>
  20. </van-cell>-->
  21. <van-cell title="修改密码" @click="showPassword=true" style="border-radius: 16px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px;background:#fff;padding:20px;">
  22. <template #icon>
  23. <van-icon :name="require('../../assets/images/housesteadSurvey/little2.png')" size="18" color="#fff" style="margin:10px;"/>
  24. </template>
  25. </van-cell>
  26. <van-cell title="退出软件" is-link to="/homesteadLogin" style="border-radius: 16px;box-shadow: 0px 3px 5px 0px rgba(0,0,0,0.16); width:calc( 100% - 40px);margin:20px;background:#fff;padding:20px;">
  27. <template #icon>
  28. <van-icon :name="require('../../assets/images/housesteadSurvey/little2.png')" size="18" color="#fff" style="margin:10px;"/>
  29. </template>
  30. </van-cell>
  31. <van-popup v-model:show="showPassword" position="bottom" style="width:100%;padding:20px;">
  32. <van-cell-group >
  33. <van-field v-model="oldPassword" label="原密码" type="password" placeholder="请输入" />
  34. <van-field v-model="newPassword" label="新密码" type="password" placeholder="请输入" />
  35. <van-field v-model="confirmPassword" label="确认新密码" type="password" placeholder="请输入" />
  36. <van-row style="text-align: center;margin-top: 40px">
  37. <van-button round block color="#7AC943" @click="submit">保存</van-button>
  38. </van-row>
  39. </van-cell-group>
  40. </van-popup>
  41. </div>
  42. </template>
  43. <script>
  44. import {updateUserPwd} from "../../api/onlineHome/my";
  45. export default {
  46. name: "homesteadSettle",
  47. data(){
  48. return{
  49. showPassword:false,
  50. oldPassword: "",
  51. newPassword: "",
  52. confirmPassword: "",
  53. }},
  54. methods:{
  55. submit() {
  56. if(this.confirmPassword
  57. !=this.newPassword){
  58. this.$toast({
  59. icon: 'error', // 找到自己需要的图标
  60. message: '两次密码不同,请重新输入',
  61. duration:"1000",
  62. onClose:function(){
  63. this.oldPassword=""
  64. this.newPassword=""
  65. this.confirmPassword=""
  66. return false;
  67. }
  68. })
  69. }else{
  70. updateUserPwd(this.oldPassword, this.newPassword).then(
  71. response => {
  72. let _this =this
  73. this.$toast({
  74. icon: 'success', // 找到自己需要的图标
  75. message: '修改成功',
  76. duration:"1000",
  77. onClose:function(){
  78. _this.showPassword = false
  79. }
  80. })
  81. }
  82. );
  83. }
  84. }
  85. }
  86. }
  87. </script>
  88. <style scoped>
  89. >>> .bannerBg{
  90. width: 100%;
  91. color:#fff;
  92. padding:10px;
  93. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  94. }
  95. >>> .van-hairline--bottom::after {
  96. border-bottom-width: 0;
  97. }
  98. </style>