my.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="page" :style="{'min-height':h+'px', 'padding-top':mt+'px'}">
  3. <cus-header title='我的' bgColor="transparent" :showback="false"></cus-header>
  4. <div class="info adffcacjc">
  5. <div class="i_avatar">
  6. <image src="@/static/avatar.png"></image>
  7. </div>
  8. <div class="i_name">{{userName}}</div>
  9. <div class="i_phone">手机号:{{mobile}}</div>
  10. </div>
  11. <div class="box">
  12. <div class="tabs adf">
  13. <div class="pre" :class="{'active':tidx===1}" @tap="changeTab(1)">收藏</div>
  14. <div class="pre" :class="{'active':tidx===2}" @tap="changeTab(2)">评论</div>
  15. <div class="pre" :class="{'active':tidx===3}" @tap="changeTab(3)">报告</div>
  16. </div>
  17. <div class="list" :style="{'height':'calc(100vh - '+(356+mt)+'px)'}">
  18. <block v-if="tidx===1">
  19. <u-list @scrolltolower="stCollect" v-if="collectList.length">
  20. <u-list-item v-for="(item, index) in collectList" :key="index">
  21. <div class="l_item adfacjb">
  22. <div class="li_l">
  23. <div class="title">{{'撰写企业管理方案'}}</div>
  24. <div class="intro">{{'帮我写一篇关于企业管理的方案'}}</div>
  25. <div class="date">{{'4/25'}}</div>
  26. </div>
  27. <div class="li_r"></div>
  28. </div>
  29. </u-list-item>
  30. </u-list>
  31. <template v-else>
  32. <page-empty :height="'calc(100vh - '+(356+mt)+'px)'"></page-empty>
  33. </template>
  34. </block>
  35. <block v-else-if="tidx===2">
  36. <u-list @scrolltolower="stComment" v-if="commentList.length"></u-list>
  37. <template v-else>
  38. <page-empty :height="'calc(100vh - '+(356+mt)+'px)'"></page-empty>
  39. </template>
  40. </block>
  41. <block v-else-if="tidx===3">
  42. <u-list @scrolltolower="stReport" v-if="reportList.length"></u-list>
  43. <template v-else>
  44. <page-empty :height="'calc(100vh - '+(356+mt)+'px)'"></page-empty>
  45. </template>
  46. </block>
  47. </div>
  48. </div>
  49. <Tabbar :tabbarIndex="2"></Tabbar>
  50. </view>
  51. </template>
  52. <script>
  53. import Tabbar from '@/components/CusTabbar/index.vue'
  54. import pageEmpty from '@/components/pageEmpty/index.vue'
  55. export default {
  56. components:{ Tabbar, pageEmpty },
  57. data(){
  58. return {
  59. userName:'',
  60. mobile:'',
  61. tidx:1,
  62. collectList:[],
  63. commentList:[],
  64. reportList:[],
  65. }
  66. },
  67. onLoad() {
  68. if(uni.getStorageSync('userInfo')){
  69. this.userName = JSON.parse(uni.getStorageSync('userInfo')).realName||'';
  70. this.mobile = JSON.parse(uni.getStorageSync('userInfo')).mobile||'';
  71. }
  72. },
  73. methods:{
  74. changeTab(index){
  75. this.tidx = index;
  76. }
  77. }
  78. }
  79. </script>
  80. <style scoped lang="less">
  81. .page{
  82. box-sizing: border-box;
  83. background: linear-gradient( 270deg, #EEEFF8 0%, #F6ECF4 100%, #F6ECF4 100%);
  84. .info{
  85. width: 100%;
  86. height: 410rpx;
  87. box-sizing: border-box;
  88. padding-bottom: 64rpx;
  89. .i_avatar{
  90. width: 188rpx;
  91. height: 188rpx;
  92. border-radius: 50%;
  93. background: #FFFFFF;
  94. margin-top: 30rpx;
  95. image{
  96. width: 100%;
  97. height: 100%;
  98. border-radius: 50%;
  99. }
  100. }
  101. .i_name{
  102. font-family: PingFang-SC, PingFang-SC;
  103. font-weight: bold;
  104. font-size: 40rpx;
  105. color: #252525;
  106. line-height: 40rpx;
  107. margin-top: 40rpx;
  108. }
  109. .i_phone{
  110. font-family: PingFangSC, PingFang SC;
  111. font-weight: 400;
  112. font-size: 28rpx;
  113. color: #6B7280;
  114. line-height: 28rpx;
  115. margin-top: 20rpx;
  116. }
  117. }
  118. .box{
  119. width: 100%;
  120. border-radius: 32rpx 32rpx 0 0;
  121. background: #FFFFFF;
  122. .tabs{
  123. padding: 38rpx calc((100% - 510rpx) / 2) 40rpx;
  124. border-bottom: 1rpx solid #E5E7EB;
  125. .pre{
  126. width: 170rpx;
  127. font-family: PingFang-SC, PingFang-SC;
  128. font-weight: bold;
  129. font-size: 32rpx;
  130. color: #252525;
  131. line-height: 32rpx;
  132. text-align: center;
  133. position: relative;
  134. &.active{
  135. color: #761E6A;
  136. &::after{
  137. content:'';
  138. width: 120rpx;
  139. height: 4rpx;
  140. background: #833478;
  141. border-radius: 2rpx;
  142. position: absolute;
  143. left: 50%;
  144. margin-left: -60rpx;
  145. bottom: -40rpx;
  146. }
  147. }
  148. }
  149. }
  150. .list{
  151. overflow-y: auto;
  152. .l_item{
  153. padding: 30rpx 36rpx;
  154. border-bottom: 1rpx solid #E5E7EB;
  155. .li_l{
  156. width: calc(100% - 186rpx);
  157. .title{
  158. font-family: PingFang-SC, PingFang-SC;
  159. font-weight: bold;
  160. font-size: 32rpx;
  161. color: #252525;
  162. line-height: 32rpx;
  163. overflow: hidden;
  164. white-space: nowrap;
  165. text-overflow: ellipsis;
  166. }
  167. .intro{
  168. font-family: PingFangSC, PingFang SC;
  169. font-weight: 400;
  170. font-size: 28rpx;
  171. color: #252525;
  172. line-height: 32rpx;
  173. margin-top: 20rpx;
  174. overflow: hidden;
  175. white-space: nowrap;
  176. text-overflow: ellipsis;
  177. }
  178. .date{
  179. font-family: PingFangSC, PingFang SC;
  180. font-weight: 400;
  181. font-size: 26rpx;
  182. color: #999999;
  183. line-height: 32rpx;
  184. margin-top: 28rpx;
  185. }
  186. }
  187. .li_r{
  188. width: 166rpx;
  189. height: 166rpx;
  190. }
  191. }
  192. }
  193. }
  194. }
  195. </style>