my.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view>
  3. <view class="con">
  4. <view class="flex item">
  5. <view>用户名:</view>
  6. <input v-model="person.name" />
  7. </view>
  8. <view class="flex item">
  9. <view>性别:</view>
  10. <input v-model="person.name" />
  11. </view>
  12. <view class="flex item">
  13. <view>年龄:</view>
  14. <input v-model="person.name" />
  15. </view>
  16. <view class="flex item">
  17. <view>手机号:</view>
  18. <input v-model="person.phone" />
  19. </view>
  20. <view class="flex item">
  21. <view>互助组:</view>
  22. <input v-model="person.name" />
  23. </view>
  24. <view class="flex item">
  25. <view>角色:</view>
  26. <input v-model="person.name" />
  27. </view>
  28. <view class="flex item" style="border: none;">
  29. <view>地址:</view>
  30. <input v-model="person.name" />
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. person: {}
  40. }
  41. },
  42. onLoad() {
  43. this.getSelfInfo()
  44. },
  45. methods: {
  46. // 查看个人信息
  47. getSelfInfo() {
  48. this.http.request({
  49. url: '/sp-admin/app/AppUser/getSelfInfo',
  50. success: res => {
  51. this.person = res.data.data
  52. }
  53. });
  54. },
  55. // 修改个人信息
  56. updateUser(){
  57. this.http.request({
  58. url: '/sp-admin/app/AppUser/update',
  59. success: res => {
  60. uni.showModal({
  61. content: '修改成功',
  62. showCancel: false
  63. }),
  64. this.getSelfInfo()
  65. }
  66. });
  67. }
  68. }
  69. }
  70. </script>
  71. <style lang="scss">
  72. page {
  73. background-color: $pg;
  74. }
  75. .con{
  76. background-color: #fff;
  77. margin: 20px;
  78. padding: 10px;
  79. border-radius: 10px;
  80. border: 1px #fff solid;
  81. }
  82. .item{
  83. height: 50px;
  84. display: flex;
  85. align-items: center;
  86. border-bottom: 1px #dcdcdc solid;
  87. }
  88. </style>