me_follow.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 open="true">
  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. <u-no-network></u-no-network>
  20. </view>
  21. </template>
  22. <script>
  23. export default {
  24. data() {
  25. return {
  26. itemStyle: {
  27. marginBottom: '20rpx',
  28. background: '#FFFFFF',
  29. padding: '28rpx',
  30. boxshadow: '0px 2px 12px 0px rgba(0, 0, 0, 0.04)',
  31. borderRadius: '12px',
  32. },
  33. followList: [],
  34. pageindex: 1
  35. }
  36. },
  37. mounted() {
  38. this.getfollow()
  39. },
  40. methods: {
  41. //关注
  42. follow(e) {
  43. console.log(this.tcTeam[e.currentTarget.dataset.index])
  44. },
  45. getfollow: async function() {
  46. let res = await this.$request.post("/api/v1/collection/collectList", {
  47. page: this.pageindex,
  48. type: 1
  49. })
  50. console.log(res)
  51. if (res.status == 0) {
  52. this.followList = res.data.data
  53. this.$nextTick(()=>{
  54. this.$refs.collapse.init()
  55. })
  56. }
  57. }
  58. },
  59. onShow() {
  60. for (var a = 0; a < this.followList.length; a++) {
  61. // console.log(this.followList[a]);
  62. this.followList[a].sum = this.followList[a].content.length
  63. console.log(this.followList[a].sum)
  64. }
  65. }
  66. }
  67. </script>
  68. <style>
  69. .list {
  70. margin-bottom: 20rpx;
  71. background-color: #FFFFFF;
  72. padding: 28rpx;
  73. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.04);
  74. border-radius: 12px;
  75. }
  76. </style>