兼兼街公众号代码
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.

152 lines
3.1 KiB

  1. <template>
  2. <view>
  3. <view style="margin-bottom: 50rpx;">
  4. <view class="user-from">
  5. <view class="user-from-line">
  6. <view class="line-lable">头像</view>
  7. <view class="line-value" @click="upImg">
  8. <image class="user-img" :src="userData.headImage" mode=""></image>
  9. </view>
  10. </view>
  11. <view class="user-from-line">
  12. <view class="line-lable">名称</view>
  13. <view class="line-value">
  14. <u--input
  15. placeholder="请输入名称"
  16. v-model="userData.nickName"
  17. border="none"
  18. inputAlign="right"
  19. ></u--input>
  20. </view>
  21. </view>
  22. <view class="user-from-line">
  23. <view class="line-lable">手机号</view>
  24. <view class="line-value">
  25. <u--input
  26. placeholder="请输入手机号"
  27. v-model="userData.phone"
  28. border="none"
  29. inputAlign="right"
  30. ></u--input>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="modify-but">
  36. <u-button :custom-style="modifyStyle" shape="circle" hover-class="none" @click="submit">保存</u-button>
  37. <u-button :custom-style="modifyStyleQuxiao" shape="circle" hover-class="none" @click="outLogin">退出登陆</u-button>
  38. </view>
  39. </view>
  40. </template>
  41. <script>
  42. export default {
  43. data() {
  44. return {
  45. value:'',
  46. modifyStyle: {
  47. width: '670rpx',
  48. height: '85rpx',
  49. background: '#00CCCC',
  50. color: '#fff',
  51. fontSize: '32rpx'
  52. },
  53. modifyStyleQuxiao: {
  54. width: '670rpx',
  55. height: '85rpx',
  56. background: '#f4f4f4',
  57. color: '#333',
  58. fontSize: '32rpx',
  59. marginTop: '40rpx'
  60. },
  61. userData:{}
  62. }
  63. },
  64. onLoad() {
  65. },
  66. onShow() {
  67. this.getMyInfo()
  68. },
  69. // 隐藏微信h5的标题栏
  70. onReady() {
  71. this.$com.displayNav()
  72. },
  73. methods: {
  74. upImg(){
  75. uni.chooseImage({
  76. count: 1, // 只选一张,目前 SDK 不支持一次发送多张图片
  77. success: (res) => {
  78. uni.uploadFile({
  79. url: 'https://api.chemu90.com/xcx/oss/upload', //仅为示例,非真实的接口地址
  80. filePath: res.tempFilePaths[0],
  81. name: 'file',
  82. success: (uploadFileRes) => {
  83. this.form.pic = JSON.parse(uploadFileRes.data).result
  84. }
  85. });
  86. }
  87. })
  88. },
  89. getMyInfo(){
  90. this.$api('myInfo')
  91. .then(res=>{
  92. if(res.code == 200){
  93. this.userData = res.result;
  94. }
  95. })
  96. },
  97. outLogin(){
  98. uni.clearStorageSync();
  99. this.$Toast('退出成功!')
  100. setTimeout(()=>{
  101. uni.switchTab({
  102. url:'/pages/my/index'
  103. })
  104. },500)
  105. }
  106. }
  107. }
  108. </script>
  109. <style lang="scss" scoped>
  110. .user-from {
  111. padding: 0 24rpx;
  112. .user-from-line {
  113. display: flex;
  114. align-items: center;
  115. justify-content: space-between;
  116. border-bottom: 1px solid #f4f4f4;
  117. height: 100rpx;
  118. .line-lable {
  119. font-size: 30rpx;
  120. }
  121. .line-value {
  122. .user-img {
  123. width: 70rpx;
  124. height: 70rpx;
  125. }
  126. .erweima {
  127. width: 333rpx;
  128. height: 333rpx;
  129. }
  130. }
  131. }
  132. .heightAuto {
  133. height: auto;
  134. border: none;
  135. align-items: flex-start;
  136. padding-top: 30rpx;
  137. }
  138. }
  139. .modify-but {
  140. }
  141. </style>