me_follow.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. <template style="background: #F6F6F6;">
  2. <view style="width: 100%;height: 100%;padding: 20rpx 28rpx;">
  3. <u-collapse :item-style="itemStyle" accordion ref="collapse">
  4. <u-collapse-item>
  5. <!-- 标题 -->
  6. <view slot="title" style="font-size: 30rpx;">
  7. <text style="font-weight: bold;margin-right: 20rpx;">关注医生</text>
  8. <text style="color: #666666;">{{followList.length}}</text>
  9. </view>
  10. <!-- 面板内容 -->
  11. <view v-for="(item, index) in followList" :key="index" style="display: flex;align-items: center;padding: 10rpx 0;">
  12. <!-- <image :src="item.docter.avatar" mode="aspectFit" style="height: 68rpx;width: 68rpx;border-radius: 50%;margin-right: 20rpx;"></image> -->
  13. <u-avatar :src="item.docter.avatar" mode="circle"></u-avatar>
  14. <text style="font-size: 28rpx;margin: 28rpx;color: #000000;">{{item.docter.name}}</text>
  15. <text style="font-size: 28rpx;margin-left: 10rpx;" v-for="(itm,idx) in item.docter.label" :key="idx">{{itm}}</text>
  16. </view>
  17. </u-collapse-item>
  18. </u-collapse>
  19. </view>
  20. </template>
  21. <script>
  22. export default {
  23. data() {
  24. return {
  25. itemStyle: {
  26. marginBottom: '20rpx',
  27. background: '#FFFFFF',
  28. padding: '28rpx',
  29. boxshadow: '0px 2px 12px 0px rgba(0, 0, 0, 0.04)',
  30. borderRadius: '12px',
  31. },
  32. followList: [],
  33. pageindex: 1
  34. }
  35. },
  36. mounted() {
  37. this.getfollow()
  38. },
  39. methods: {
  40. //关注
  41. follow(e) {
  42. console.log(this.tcTeam[e.currentTarget.dataset.index])
  43. },
  44. getfollow: async function() {
  45. let res = await this.$request.post("/api/v1/collection/collectList", {
  46. page: this.pageindex,
  47. type: 1
  48. })
  49. console.log(res)
  50. if (res.status == 0) {
  51. this.followList = res.data.data
  52. this.$nextTick(()=>{
  53. this.$refs.collapse.init()
  54. })
  55. }
  56. }
  57. },
  58. onShow() {
  59. for (var a = 0; a < this.followList.length; a++) {
  60. // console.log(this.followList[a]);
  61. this.followList[a].sum = this.followList[a].content.length
  62. console.log(this.followList[a].sum)
  63. }
  64. }
  65. }
  66. </script>
  67. <style>
  68. .list {
  69. margin-bottom: 20rpx;
  70. background-color: #FFFFFF;
  71. padding: 28rpx;
  72. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  73. border-radius: 12px;
  74. }
  75. </style>