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.

209 lines
4.4 KiB

8 months ago
  1. <!-- 用户信息界面 -->
  2. <template>
  3. <view class="personal-info bx">
  4. <navbar :leftClick="leftClick"
  5. :title="$t('page.persionalInfo.title')"></navbar>
  6. <!-- 基本用户信息 -->
  7. <view class="base-info content">
  8. <view class="base-info-item">
  9. <view class="title">{{ $t('page.persionalInfo.profle-image') }}</view>
  10. <image :src="userInfo.headImage || headImage" mode="aspectFit"></image>
  11. </view>
  12. <view class="base-info-item">
  13. <view class="title">{{ $t('page.persionalInfo.username') }}</view>
  14. <view class="name">{{ userInfo.account }}</view>
  15. </view>
  16. </view>
  17. <!-- 修改用户信息按钮组 -->
  18. <view class="edit-user-info-btns content">
  19. <view @click="toModifyUser(0)" class="edit-item">
  20. <view class="edit-descript">{{ $t('page.persionalInfo.change-pin') }}</view>
  21. <uni-icons color="#B0C73B" type="right" size="30rpx"></uni-icons>
  22. </view>
  23. <view @click="toModifyUser(1)" class="edit-item">
  24. <view class="edit-descript">{{ $t('page.persionalInfo.change-password') }}</view>
  25. <uni-icons color="#B0C73B" type="right" size="30rpx"></uni-icons>
  26. </view>
  27. </view>
  28. <!-- 填写地址弹框 -->
  29. <u-popup :show="showAddress" mode="center" bgColor="black"
  30. @close="showAddress=false">
  31. <view class="address-content">
  32. <view class="address-top">
  33. <view class="title">{{ $t('page.center.Tips') }}</view>
  34. <uni-icons @click="showAddress=false"
  35. class="close-icon"
  36. color="#B0C73B" type="close"
  37. size="40rpx"></uni-icons>
  38. </view>
  39. <view class="address-detail">
  40. <view class="title">{{ $t('page.center.Address') }}:</view>
  41. <textarea
  42. :placeholder="$t('page.center.type-address')"></textarea>
  43. </view>
  44. <view
  45. class="save">{{ $t('page.center.save') }}</view>
  46. </view>
  47. </u-popup>
  48. </view>
  49. </template>
  50. <script>
  51. import navbar from '@/components/base/m-navbar.vue'
  52. export default {
  53. components: {
  54. navbar
  55. },
  56. data() {
  57. return {
  58. userInfo : {},
  59. username : '',
  60. headImage : '/static/personalInfo/user-image.png',
  61. showAddress : false
  62. }
  63. },
  64. onShow() {
  65. this.getUserInfo()
  66. },
  67. methods: {
  68. getUserInfo(){
  69. this.request('userInfo').then(res => {
  70. if(res.code == 200){
  71. this.userInfo = res.result.userInfo
  72. }
  73. })
  74. },
  75. leftClick() {
  76. uni.navigateTo({
  77. url: '/pages/home/home'
  78. })
  79. },
  80. updateUser(){
  81. this.request('userInfo').then(res => {
  82. if(res.code == 200){
  83. this.userInfo = res.result
  84. }
  85. })
  86. },
  87. //跳转修改用户信息页面(二合一)
  88. toModifyUser(type){
  89. this.$play()
  90. uni.navigateTo({
  91. url: `/pages/modifyUser/modifyUser?type=${type}`
  92. })
  93. }
  94. }
  95. }
  96. </script>
  97. <style lang="scss" scoped>
  98. .personal-info {
  99. width: 750rpx;
  100. min-height: 100vh;
  101. background-color: black;
  102. margin: 0 auto;
  103. // background-image: url('@/static/personalInfo/bg.png');
  104. background-size: 100%;
  105. background-repeat: no-repeat;
  106. .content {
  107. width: 96%;
  108. margin: 0 auto;
  109. }
  110. .base-info , .edit-user-info-btns{
  111. border: 1px solid #ffffff80;
  112. margin: 20rpx auto 30rpx auto;
  113. .base-info-item , .edit-item{
  114. display: flex;
  115. justify-content: space-between;
  116. align-items: center;
  117. height: 100rpx;
  118. padding: 15rpx 10rpx;
  119. border-bottom: 1px solid #ffffff80;
  120. .title , .edit-descript{
  121. color: #687527;
  122. font-size: 28rpx;
  123. }
  124. image{
  125. width: 100rpx;
  126. height: 100rpx;
  127. }
  128. .name{
  129. color: white;
  130. font-size: 28rpx;
  131. }
  132. }
  133. }
  134. }
  135. .address-content {
  136. box-sizing: border-box;
  137. border: 1px solid #ffffff80;
  138. padding: 15rpx;
  139. .address-top {
  140. position: relative;
  141. display: flex;
  142. align-items: center;
  143. justify-content: center;
  144. padding: 30rpx 0rpx;
  145. .title {
  146. font-size: 36rpx;
  147. color: #afc638;
  148. font-weight: bold;
  149. }
  150. .close-icon {
  151. position: absolute;
  152. top: 50%;
  153. right: 30rpx;
  154. transform: translateY(-50%);
  155. }
  156. }
  157. .address-detail {
  158. .title {
  159. color: #afc638;
  160. margin-bottom: 10rpx;
  161. font-size: 28rpx;
  162. }
  163. textarea {
  164. border: 1px solid #afc638;
  165. color: #afc638;
  166. border-radius: 25rpx;
  167. height: 150rpx;
  168. width: 560rpx;
  169. text-indent: 1em;
  170. }
  171. }
  172. .save{
  173. display: flex;
  174. align-items: center;
  175. justify-content: center;
  176. background: #afc638;
  177. height: 80rpx;
  178. margin: 20rpx auto;
  179. border-radius: 20rpx;
  180. color: black;
  181. font-size: 34rpx;
  182. }
  183. }
  184. </style>