home_doctor.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  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" :key="index">{{itm}}</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. }
  66. },
  67. onReachBottom() {
  68. this.gethome_doctor()
  69. },
  70. methods: {
  71. //关注
  72. follow: async function(e) {
  73. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  74. type: 1,
  75. relation_id: e.currentTarget.dataset.id
  76. })
  77. if (res.status == 0) {
  78. if (res.data.is_collect == 0) {
  79. uni.showToast({
  80. title: "取消成功",
  81. icon: "none"
  82. })
  83. this.doctorList[e.currentTarget.dataset.index].docter.is_collect = res.data.is_collect
  84. } else {
  85. uni.showToast({
  86. title: "关注成功",
  87. icon: "none"
  88. })
  89. this.doctorList[e.currentTarget.dataset.index].docter.is_collect = res.data.is_collect
  90. }
  91. }
  92. },
  93. gethome_doctor: async function() {
  94. let res = await this.$request.post("/api/v1/user/familyDocterList", {
  95. page: this.pageindex
  96. })
  97. console.log(res)
  98. if (res.status == 0) {
  99. if (this.pageindex > res.data.last_page) {
  100. uni.showToast({
  101. title: "没有更多了",
  102. icon: "none"
  103. })
  104. } else {
  105. this.doctorList = this.doctorList.concat(res.data.data)
  106. this.pageindex++
  107. }
  108. }
  109. if (this.doctorList.length == 0) {
  110. this.show = true
  111. } else {
  112. this.show = false
  113. }
  114. },
  115. clicklist(e) {
  116. uni.navigateTo({
  117. url: "../doctor_related/doctor_info?id=" + e.currentTarget.dataset.id
  118. })
  119. }
  120. }
  121. }
  122. </script>
  123. <style lang="scss">
  124. .list {
  125. margin: 20rpx 0 10rpx 0;
  126. display: flex;
  127. width: 100%;
  128. height: 200rpx;
  129. border-radius: 15rpx;
  130. background-color: #FFFFFF;
  131. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  132. .portrait {
  133. width: 30%;
  134. height: 100%;
  135. display: flex;
  136. justify-content: center;
  137. align-items: center;
  138. .img {
  139. width: 100rpx;
  140. height: 100rpx;
  141. border-radius: 50%;
  142. }
  143. .bun_true {
  144. text-align: center;
  145. width: 80rpx;
  146. height: 36rpx;
  147. background-color: #D92975;
  148. margin: 0 10rpx;
  149. border-radius: 60rpx;
  150. position: relative;
  151. top: -20rpx;
  152. font-size: 20rpx;
  153. color: #FFFFFF;
  154. padding: 3rpx 0;
  155. }
  156. .bun_false {
  157. border: 1rpx solid #D92975;
  158. text-align: center;
  159. width: 80rpx;
  160. height: 36rpx;
  161. background-color: #FFFFFF;
  162. margin: 0 10rpx;
  163. border-radius: 60rpx;
  164. position: relative;
  165. top: -20rpx;
  166. font-size: 20rpx;
  167. color: #D92975;
  168. padding: 3rpx 0;
  169. }
  170. }
  171. //文字
  172. .text {
  173. width: 70%;
  174. height: 100%;
  175. padding: 20rpx 0;
  176. //名字+标签
  177. .name {
  178. font-size: 30rpx;
  179. font-weight: bold;
  180. display: flex;
  181. align-items: center;
  182. .label {
  183. font-weight: 400;
  184. margin-right: 15rpx;
  185. background-color: #E5F5FF;
  186. color: #0B73B9;
  187. width: 100rpx;
  188. height: 28rpx;
  189. font-size: 20rpx;
  190. border-radius: 10rpx;
  191. text-align: center;
  192. align-items: center;
  193. }
  194. }
  195. //科室
  196. .department {
  197. padding: 20rpx 0;
  198. color: #666666;
  199. text {
  200. margin-right: 15rpx;
  201. }
  202. }
  203. // 选项
  204. .option {
  205. display: flex;
  206. view {
  207. background-color: #E4E4E4;
  208. width: 100rpx;
  209. height: 48rpx;
  210. border-radius: 12px;
  211. margin-right: 15rpx;
  212. display: flex;
  213. justify-content: center;
  214. align-items: center;
  215. }
  216. }
  217. }
  218. }
  219. </style>