reviseUserInfo.vue 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="contentBox">
  3. <button type="primary" class="submitBtn" @click="loginout">退出绑定</button>
  4. </view>
  5. </template>
  6. <script>
  7. import {changeUser, toLoginout} from "../../api/index.js"
  8. export default{
  9. data(){
  10. return {
  11. username:"",
  12. phone:""
  13. }
  14. },
  15. methods:{
  16. loginout(){
  17. toLoginout().then(res => {
  18. if(res.error_code === 200){
  19. uni.clearStorage();
  20. this.$store.commit('change_userinfo',{})
  21. uni.redirectTo({
  22. url:"/pages/index/index"
  23. })
  24. }else{
  25. uni.showToast({
  26. title:"退出绑定失败",
  27. icon:"none"
  28. })
  29. }
  30. })
  31. }
  32. }
  33. }
  34. </script>
  35. <style lang="scss">
  36. page{
  37. width: 100%;
  38. height: 100%;
  39. background: $uni-bg-color-normal;
  40. }
  41. .contentBox{
  42. padding: 0 51rpx;
  43. }
  44. .labelTitle{
  45. display: block;
  46. font-size: 34rpx;
  47. color: #4D4D4D;
  48. margin-top: 62rpx;
  49. margin-bottom: 41rpx;
  50. }
  51. .input{
  52. width: calc(100% - 2px - 102rpx);
  53. height: 76rpx;
  54. line-height: 76rpx;
  55. padding: 0 41rpx;
  56. font-size: 26rpx;
  57. border: 1px solid #999999;
  58. border-radius: 3px;
  59. background: #FFFFFF;
  60. }
  61. .inputHolder{
  62. color: #DDDDDD;
  63. }
  64. .submitBtn{
  65. width: 432rpx;
  66. height: 76rpx;
  67. line-height: 76rpx;
  68. background: $uni-btn-bg-color !important;
  69. margin-top: 50rpx;
  70. font-size: 32rpx;
  71. }
  72. </style>