user.vue 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. <template>
  2. <view class="userLayout pageBg" v-if="userinfo">
  3. <view :style="{height:getNavBarHeight()+'px'}"></view>
  4. <view class="userInfo">
  5. <view class="avatar">
  6. <image src="../../static/images/xxmLogo.png" mode="aspectFill"></image>
  7. </view>
  8. <view class="ip">{{userinfo.IP}}</view>
  9. <view class="address">来自于:
  10. {{ userinfo.address.city || userinfo.address.province || userinfo.address.country}}
  11. </view>
  12. </view>
  13. <view class="section">
  14. <view class="list">
  15. <navigator
  16. url="/pages/classlist/classlist?name=我的下载&type=download"
  17. class="row">
  18. <view class="left">
  19. <uni-icons type="download-filled" size="20" ></uni-icons>
  20. <view class="text">我的下载</view>
  21. </view>
  22. <view class="right">
  23. <view class="text">{{userinfo.downloadSize}}</view>
  24. <uni-icons type="right" size="15" color="#aaa"></uni-icons>
  25. </view>
  26. </navigator>
  27. <navigator
  28. url="/pages/classlist/classlist?name=我的评分&type=score"
  29. class="row">
  30. <view class="left">
  31. <uni-icons type="star-filled" size="20"></uni-icons>
  32. <view class="text">我的评分</view>
  33. </view>
  34. <view class="right">
  35. <view class="text">{{userinfo.scoreSize}}</view>
  36. <uni-icons type="right" size="15" color="#aaa"></uni-icons>
  37. </view>
  38. </navigator>
  39. <view class="row">
  40. <view class="left">
  41. <uni-icons type="chatboxes-filled" size="20"></uni-icons>
  42. <view class="text">联系客服</view>
  43. </view>
  44. <view class="right">
  45. <view class="text"></view>
  46. <uni-icons type="right" size="15" color="#aaa"></uni-icons>
  47. </view>
  48. <!-- #ifdef MP -->
  49. <button open-type="contact">联系客服</button>
  50. <!-- #endif -->
  51. <!-- #ifndef MP -->
  52. <button @click="clickContact">拨打电话</button>
  53. <!-- #endif -->
  54. </view>
  55. </view>
  56. </view>
  57. <view class="section">
  58. <view class="list">
  59. <navigator url="/pages/notice/detail?id=653507c6466d417a3718e94b" class="row">
  60. <view class="left">
  61. <uni-icons type="notification-filled" size="20"></uni-icons>
  62. <view class="text">订阅更新</view>
  63. </view>
  64. <view class="right">
  65. <view class="text"></view>
  66. <uni-icons type="right" size="15" color="#aaa"></uni-icons>
  67. </view>
  68. </navigator>
  69. <navigator url="/pages/notice/detail?id=6536358ce0ec19c8d67fbe82" class="row">
  70. <view class="left">
  71. <uni-icons type="flag-filled" size="20"></uni-icons>
  72. <view class="text">常见问题</view>
  73. </view>
  74. <view class="right">
  75. <view class="text"></view>
  76. <uni-icons type="right" size="15" color="#aaa"></uni-icons>
  77. </view>
  78. </navigator>
  79. </view>
  80. </view>
  81. </view>
  82. <view class="loadingLayout" v-else>
  83. <view :style="{height:getNavBarHeight()+'px'}"></view>
  84. <uni-load-more status="loading"></uni-load-more>
  85. </view>
  86. </template>
  87. <script setup>
  88. import {getNavBarHeight} from "@/utils/system.js"
  89. import {apiUserInfo} from "@/api/apis.js"
  90. import { ref } from "vue";
  91. const userinfo = ref(null)
  92. const clickContact = ()=>{
  93. uni.makePhoneCall({
  94. phoneNumber:"114"
  95. })
  96. }
  97. const getUserInfo = ()=>{
  98. apiUserInfo().then(res=>{
  99. console.log(res);
  100. userinfo.value = res.data
  101. })
  102. }
  103. getUserInfo();
  104. </script>
  105. <style lang="scss" scoped>
  106. .userLayout{
  107. .userInfo{
  108. display: flex;
  109. align-items: center;
  110. justify-content: center;
  111. flex-direction: column;
  112. padding:50rpx 0;
  113. .avatar{
  114. width: 160rpx;
  115. height: 160rpx;
  116. border-radius: 50%;
  117. overflow: hidden;
  118. image{
  119. width: 100%;
  120. height: 100%;
  121. }
  122. }
  123. .ip{
  124. font-size: 44rpx;
  125. color:#333;
  126. padding:20rpx 0 5rpx;
  127. }
  128. .address{
  129. font-size: 28rpx;
  130. color:#aaa;
  131. }
  132. }
  133. .section{
  134. width: 690rpx;
  135. margin:50rpx auto;
  136. border:1px solid #eee;
  137. border-radius: 10rpx;
  138. box-shadow: 0 0 30rpx rgba(0,0,0,0.05);
  139. .list{
  140. .row{
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: center;
  144. padding:0 30rpx;
  145. height: 100rpx;
  146. border-bottom: 1px solid #eee;
  147. position: relative;
  148. background: #fff;
  149. &:last-child{border-bottom:0}
  150. .left{
  151. display: flex;
  152. align-items: center;
  153. :deep(){
  154. .uni-icons{
  155. color:$brand-theme-color !important;
  156. }
  157. }
  158. .text{
  159. padding-left: 20rpx;
  160. color:#666
  161. }
  162. }
  163. .right{
  164. display: flex;
  165. align-items: center;
  166. .text{
  167. font-size: 28rpx;
  168. color:#aaa;
  169. }
  170. }
  171. button{
  172. position: absolute;
  173. top:0;
  174. left:0;
  175. height: 100rpx;
  176. width:100%;
  177. opacity: 0;
  178. }
  179. }
  180. }
  181. }
  182. }
  183. </style>