home_doctor.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. </view>
  35. </template>
  36. <script>
  37. export default {
  38. mounted() {
  39. this.gethome_doctor()
  40. },
  41. data() {
  42. return {
  43. //关注
  44. isfollow: false,
  45. //协议
  46. num: 1,
  47. imgitem: {
  48. istrue: false,
  49. name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  50. },
  51. tcID: '套餐一', //ID
  52. tcTime: '一年', //套餐有效期
  53. tcContent: { //套餐内容
  54. content: '套餐一包含包含疫苗接种、门诊预约、儿保预约三项服务', //内容
  55. scope: '使用范围:家医团队可用,有效期内无限次、300元额度以内门诊预约与儿保预约无限制', //范围
  56. giving: '赠送XXXX保险:保险介绍' //赠送
  57. },
  58. tcTeam: [{
  59. id: '1',
  60. name: '熊大',
  61. label1: '熊',
  62. label2: '主角',
  63. department1: '外科',
  64. department2: '主任医师',
  65. follow: false
  66. }, {
  67. id: '2',
  68. name: '熊二',
  69. label1: '熊',
  70. label2: '主角',
  71. department1: '外科',
  72. department2: '主任医师',
  73. follow: false
  74. }, {
  75. id: '3',
  76. name: '光头强',
  77. label1: '人',
  78. label2: '主角',
  79. department1: '外科',
  80. department2: '主任医师',
  81. follow: false
  82. }, {
  83. id: '4',
  84. name: '李老板',
  85. label1: '人',
  86. label2: '配角',
  87. department1: '外科',
  88. department2: '主任医师',
  89. follow: false
  90. }, {
  91. id: '5',
  92. name: '吉吉国王',
  93. label1: '猴子',
  94. label2: '配角',
  95. department1: '外科',
  96. department2: '主任医师',
  97. follow: false
  98. }, {
  99. id: '6',
  100. name: '毛毛',
  101. label1: '猴子',
  102. label2: '配角',
  103. department1: '外科',
  104. department2: '主任医师',
  105. follow: false
  106. }, {
  107. id: '7',
  108. name: '蹦蹦',
  109. label1: '猴子',
  110. label2: '配角',
  111. department1: '外科',
  112. department2: '主任医师',
  113. follow: false
  114. }],
  115. doctorList: []
  116. }
  117. },
  118. methods: {
  119. //关注
  120. follow: async function(e) {
  121. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  122. type: 1,
  123. relation_id: e.currentTarget.dataset.id
  124. })
  125. if (res.status == 0) {
  126. if (res.data.is_collect == 0) {
  127. uni.showToast({
  128. title: "取消成功",
  129. icon: "none"
  130. })
  131. this.doctorList[e.currentTarget.dataset.index].docter.is_collect = res.data.is_collect
  132. } else {
  133. uni.showToast({
  134. title: "关注成功",
  135. icon: "none"
  136. })
  137. this.doctorList[e.currentTarget.dataset.index].docter.is_collect = res.data.is_collect
  138. }
  139. }
  140. },
  141. gethome_doctor: async function() {
  142. let res = await this.$request.post("/api/v1/user/familyDocterList")
  143. console.log(res)
  144. if (res.status == 0) {
  145. this.doctorList = res.data.data
  146. }
  147. },
  148. clicklist(e) {
  149. uni.navigateTo({
  150. url: "../doctor_related/doctor_info?id=" + e.currentTarget.dataset.id
  151. })
  152. }
  153. }
  154. }
  155. </script>
  156. <style lang="scss">
  157. .list {
  158. margin: 20rpx 0 10rpx 0;
  159. display: flex;
  160. width: 100%;
  161. height: 200rpx;
  162. border-radius: 15rpx;
  163. background-color: #FFFFFF;
  164. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  165. .portrait {
  166. width: 30%;
  167. height: 100%;
  168. display: flex;
  169. justify-content: center;
  170. align-items: center;
  171. .img {
  172. width: 100rpx;
  173. height: 100rpx;
  174. border-radius: 50%;
  175. }
  176. .bun_true {
  177. text-align: center;
  178. width: 80rpx;
  179. height: 36rpx;
  180. background-color: #D92975;
  181. margin: 0 10rpx;
  182. border-radius: 60rpx;
  183. position: relative;
  184. top: -20rpx;
  185. font-size: 20rpx;
  186. color: #FFFFFF;
  187. padding: 3rpx 0;
  188. }
  189. .bun_false {
  190. border: 1rpx solid #D92975;
  191. text-align: center;
  192. width: 80rpx;
  193. height: 36rpx;
  194. background-color: #FFFFFF;
  195. margin: 0 10rpx;
  196. border-radius: 60rpx;
  197. position: relative;
  198. top: -20rpx;
  199. font-size: 20rpx;
  200. color: #D92975;
  201. padding: 3rpx 0;
  202. }
  203. }
  204. //文字
  205. .text {
  206. width: 70%;
  207. height: 100%;
  208. padding: 20rpx 0;
  209. //名字+标签
  210. .name {
  211. font-size: 30rpx;
  212. font-weight: bold;
  213. display: flex;
  214. align-items: center;
  215. .label {
  216. font-weight: 400;
  217. margin-right: 15rpx;
  218. background-color: #E5F5FF;
  219. color: #0B73B9;
  220. width: 100rpx;
  221. height: 28rpx;
  222. font-size: 20rpx;
  223. border-radius: 10rpx;
  224. text-align: center;
  225. align-items: center;
  226. }
  227. }
  228. //科室
  229. .department {
  230. padding: 20rpx 0;
  231. color: #666666;
  232. text {
  233. margin-right: 15rpx;
  234. }
  235. }
  236. // 选项
  237. .option {
  238. display: flex;
  239. view {
  240. background-color: #E4E4E4;
  241. width: 100rpx;
  242. height: 48rpx;
  243. border-radius: 12px;
  244. margin-right: 15rpx;
  245. display: flex;
  246. justify-content: center;
  247. align-items: center;
  248. }
  249. }
  250. }
  251. }
  252. </style>