home_doctor.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. <template>
  2. <view style="height: 100%;width: 100%; padding: 20rpx 30rpx;">
  3. <view class="list" v-for="item,index in doctorList" :key='index' @click.stop="clicklist" :data-id="item.docter.id"
  4. :data-index="index">
  5. <!-- 头像 -->
  6. <view class="portrait">
  7. <view style="padding-top: 20rpx;">
  8. <image class="img" :src="item.docter.avatar"></image>
  9. <view class="bun_true" @click.stop="follow" :data-index="index" :data-id="item.docter.id" v-if="item.docter.is_collect==0">关注</view>
  10. <view class="bun_false" @click.stop="follow" :data-index="index" :data-id="item.docter.id" v-else>已关注</view>
  11. </view>
  12. </view>
  13. <!-- 文字 -->
  14. <view class="text">
  15. <!-- 名字+标签 -->
  16. <view class="name">
  17. <view style="margin-right: 15rpx;">{{item.docter.name}}</view>
  18. <view class="label" v-for="(itm,idx) in item.docter.label_texts" :key="index">{{itm.label_name}}</view>
  19. </view>
  20. <!-- 科室 -->
  21. <view class="department">
  22. <text>科室:</text>
  23. <text style="color: #333333;">{{item.docter.office.name||'暂无'}}</text>
  24. <text style="color: #333333;">{{item.docter.qualification.name||'暂无'}}</text>
  25. </view>
  26. <!-- 选项 -->
  27. <view class="option">
  28. <view v-if="item.docter.is_chat==1">图文</view>
  29. <view v-if="item.docter.is_phone==1">电话</view>
  30. <view v-if="item.docter.is_appoint==1">门诊</view>
  31. </view>
  32. </view>
  33. </view>
  34. <u-empty text="暂无数据" :show="show" mode="order" margin-top="250"></u-empty>
  35. <u-no-network></u-no-network>
  36. <view class="cu-tabbar-height"></view>
  37. <view class="cu-tabbar-height"></view>
  38. </view>
  39. </template>
  40. <script>
  41. export default {
  42. mounted() {
  43. this.gethome_doctor()
  44. },
  45. data() {
  46. return {
  47. //关注
  48. isfollow: false,
  49. //协议
  50. num: 1,
  51. imgitem: {
  52. istrue: false,
  53. name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  54. },
  55. tcID: '套餐一', //ID
  56. tcTime: '一年', //套餐有效期
  57. tcContent: { //套餐内容
  58. content: '套餐一包含包含疫苗接种、门诊预约、儿保预约三项服务', //内容
  59. scope: '使用范围:家医团队可用,有效期内无限次、300元额度以内门诊预约与儿保预约无限制', //范围
  60. giving: '赠送XXXX保险:保险介绍' //赠送
  61. },
  62. tcTeam: [],
  63. doctorList: [],
  64. pageindex: 1,
  65. show:false
  66. }
  67. },
  68. onReachBottom() {
  69. this.gethome_doctor()
  70. },
  71. methods: {
  72. //关注
  73. follow: async function(e) {
  74. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  75. type: 1,
  76. relation_id: e.currentTarget.dataset.id
  77. })
  78. if (res.status == 0) {
  79. if (res.data.is_collect == 0) {
  80. uni.showToast({
  81. title: "取消成功",
  82. icon: "none"
  83. })
  84. this.doctorList[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  85. } else {
  86. uni.showToast({
  87. title: "关注成功",
  88. icon: "none"
  89. })
  90. this.doctorList[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  91. }
  92. }
  93. },
  94. gethome_doctor: async function() {
  95. let res = await this.$request.post("/api/v1/user/familyDocterList", {
  96. page: this.pageindex,
  97. // is_pack_docter:1
  98. })
  99. console.log(res)
  100. if (res.status == 0) {
  101. if (this.pageindex > res.data.last_page) {
  102. uni.showToast({
  103. title: "没有更多了",
  104. icon: "none"
  105. })
  106. } else {
  107. this.doctorList = this.doctorList.concat(res.data.data)
  108. this.pageindex++
  109. }
  110. }
  111. if (this.doctorList.length == 0) {
  112. this.show = true
  113. } else {
  114. this.show = false
  115. }
  116. console.log(this.doctorList)
  117. },
  118. clicklist(e) {
  119. uni.navigateTo({
  120. url: "../doctor_related/doctor_info?id=" + e.currentTarget.dataset.id+"&index=1"
  121. })
  122. }
  123. }
  124. }
  125. </script>
  126. <style lang="scss">
  127. .list {
  128. margin: 20rpx 0 10rpx 0;
  129. display: flex;
  130. width: 100%;
  131. height: 200rpx;
  132. border-radius: 15rpx;
  133. background-color: #FFFFFF;
  134. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  135. .portrait {
  136. width: 30%;
  137. height: 100%;
  138. display: flex;
  139. justify-content: center;
  140. align-items: center;
  141. .img {
  142. width: 100rpx;
  143. height: 100rpx;
  144. border-radius: 50%;
  145. }
  146. .bun_true {
  147. text-align: center;
  148. width: 80rpx;
  149. height: 36rpx;
  150. background-color: #D92975;
  151. margin: 0 10rpx;
  152. border-radius: 60rpx;
  153. position: relative;
  154. top: -20rpx;
  155. font-size: 20rpx;
  156. color: #FFFFFF;
  157. padding: 3rpx 0;
  158. }
  159. .bun_false {
  160. border: 1rpx solid #D92975;
  161. text-align: center;
  162. width: 80rpx;
  163. height: 36rpx;
  164. background-color: #FFFFFF;
  165. margin: 0 10rpx;
  166. border-radius: 60rpx;
  167. position: relative;
  168. top: -20rpx;
  169. font-size: 20rpx;
  170. color: #D92975;
  171. padding: 3rpx 0;
  172. }
  173. }
  174. //文字
  175. .text {
  176. width: 70%;
  177. height: 100%;
  178. padding: 20rpx 0;
  179. //名字+标签
  180. .name {
  181. font-size: 30rpx;
  182. font-weight: bold;
  183. display: flex;
  184. align-items: center;
  185. .label {
  186. font-weight: 400;
  187. margin-right: 15rpx;
  188. background-color: #E5F5FF;
  189. color: #0B73B9;
  190. // width: 120rpx;
  191. height: 28rpx;
  192. font-size: 20rpx;
  193. border-radius: 10rpx;
  194. display: flex;
  195. justify-content: center;
  196. align-items: center;
  197. }
  198. }
  199. //科室
  200. .department {
  201. padding: 20rpx 0;
  202. color: #666666;
  203. text {
  204. margin-right: 15rpx;
  205. }
  206. }
  207. // 选项
  208. .option {
  209. display: flex;
  210. view {
  211. background-color: #E4E4E4;
  212. width: 100rpx;
  213. height: 48rpx;
  214. border-radius: 12px;
  215. margin-right: 15rpx;
  216. display: flex;
  217. justify-content: center;
  218. align-items: center;
  219. }
  220. }
  221. }
  222. }
  223. </style>