移动端
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.

160 lines
6.1 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. <div @click="userMessage" 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;display: flex;align-items: center;">
  22. <van-icon :name="require('../../assets/images/housesteadSurvey/btn3.png')" size="18"/>
  23. <p style="font-size: 14px;color: #666666;margin-left: 5px;">个人信息</p>
  24. </div>
  25. <div @click="showPassword=true,oldPassword='',newPassword='',confirmPassword='' " 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;display: flex;align-items: center;">
  26. <van-icon :name="require('../../assets/images/housesteadSurvey/btn2.png')" size="18"/>
  27. <p style="font-size: 14px;color: #666666;margin-left: 5px;">修改密码</p>
  28. </div>
  29. <!-- <div @click="showUpload = 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;display: flex;align-items: center;">
  30. <van-icon :name="require('../../assets/images/housesteadSurvey/btn3.png')" size="18"/>
  31. <p style="font-size: 14px;color: #666666;margin-left: 5px;">上传设置</p>
  32. </div>-->
  33. <div @click="logout" 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;display: flex;align-items: center;">
  34. <van-icon :name="require('../../assets/images/housesteadSurvey/btn4.png')" size="18"/>
  35. <p style="font-size: 14px;color: #666666;margin-left: 5px;">退出软件</p>
  36. </div>
  37. <van-popup v-model:show="showPassword" position="bottom" style="width:100%;padding:20px;">
  38. <van-cell-group >
  39. <van-field v-model="oldPassword" label="原密码" type="password" placeholder="请输入" />
  40. <van-field v-model="newPassword" label="新密码" type="password" placeholder="请输入" />
  41. <van-field v-model="confirmPassword" label="确认新密码" type="password" placeholder="请输入" />
  42. <van-row style="text-align: center;margin-top: 40px">
  43. <van-button round block color="#7AC943" @click="submit">保存</van-button>
  44. </van-row>
  45. </van-cell-group>
  46. </van-popup>
  47. <van-popup v-model:show="showMessage" position="bottom" style="width:100%;padding:20px;">
  48. <van-cell-group >
  49. <van-field v-model="userName" label="账号" readonly />
  50. <van-field v-model="nickName" label="昵称" readonly/>
  51. <van-row style="text-align: center;margin-top: 40px">
  52. <van-button round block color="#7AC943" @click="cancelMessage">关闭</van-button>
  53. </van-row>
  54. </van-cell-group>
  55. </van-popup>
  56. <van-popup v-model:show="showUpload" position="bottom" style="width:100%;padding:20px;">
  57. <van-cell center title="批量上传">
  58. <template #right-icon>
  59. <van-switch v-model="checked" size="24" @change="changeUpload"/>
  60. </template>
  61. </van-cell>
  62. </van-popup>
  63. </div>
  64. </template>
  65. <script>
  66. import {updateUserPwd} from "../../api/onlineHome/my";
  67. import {logout} from "../../api/login";
  68. export default {
  69. name: "homesteadSettle",
  70. data(){
  71. return{
  72. showPassword:false,
  73. showMessage:false,
  74. userName:null,
  75. nickName:null,
  76. jsName:null,
  77. oldPassword: "",
  78. newPassword: "",
  79. confirmPassword: "",
  80. checked:$cookies.get("upload")!=null?true:false,
  81. showUpload:false,
  82. }},
  83. methods:{
  84. logout() {
  85. logout().then(res => {
  86. this.$router.push({path:"../homesteadLogin"})
  87. })
  88. },
  89. changeUpload(){
  90. if(this.checked){
  91. this.$cookies.set("upload",1)
  92. }else{
  93. this.$cookies.set("upload",0)
  94. }
  95. },
  96. userMessage(){
  97. this.userName = this.$store.getters.name;
  98. this.nickName = this.$store.getters.nickName;
  99. this.showMessage = true;
  100. },
  101. cancelMessage(){
  102. this.showMessage = false;
  103. },
  104. submit() {
  105. if(this.confirmPassword
  106. !=this.newPassword){
  107. this.$toast({
  108. icon: 'error', // 找到自己需要的图标
  109. message: '两次密码不同,请重新输入',
  110. duration:"1000",
  111. onClose:function(){
  112. this.oldPassword=""
  113. this.newPassword=""
  114. this.confirmPassword=""
  115. return false;
  116. }
  117. })
  118. }else{
  119. updateUserPwd(this.oldPassword, this.newPassword).then(
  120. response => {
  121. let _this =this
  122. this.$toast({
  123. icon: 'success', // 找到自己需要的图标
  124. message: '修改成功',
  125. duration:"1000",
  126. onClose:function(){
  127. _this.showPassword = false
  128. }
  129. })
  130. }
  131. );
  132. }
  133. }
  134. }
  135. }
  136. </script>
  137. <style scoped>
  138. >>> .bannerBg{
  139. width: 100%;
  140. color:#fff;
  141. padding:10px;
  142. background: linear-gradient(134deg,#7ac943 1%, #22b7f2);
  143. }
  144. >>> .van-hairline--bottom::after {
  145. border-bottom-width: 0;
  146. }
  147. </style>