choiceBox.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. <template>
  2. <view style="width: 100%;height: 100%;background-color: #ececec;">
  3. <!-- 卡券 -->
  4. <view class="card">
  5. <view class="card_view">
  6. <!-- 放图片 标题 -->
  7. <view class="title">
  8. <view class="">
  9. {{packs.name}}
  10. </view>
  11. <view class="">
  12. </view>
  13. </view>
  14. <!-- 放描述 -->
  15. <view class="describe">
  16. <view style="font-size: 40rpx;font-weight: bold;">{{packs.name}}</view>
  17. <view style="font-size: 28rpx;font-weight: bold;padding-top: 60rpx;">有效期</view>
  18. <view style="font-size: 26rpx;color: #999999;padding-top: 30rpx;">自购买服务起{{packs.effective_days}}天</view>
  19. <view style="font-size: 28rpx;font-weight: bold;padding-top: 50rpx;">服务包内容介绍</view>
  20. <view style="font-size: 26rpx;color: #999999;">
  21. <view style="padding: 27rpx 0 12rpx 0;">{{packs.intro}}</view>
  22. <rich-text style="padding: 12rpx 0;" :nodes="packs.desc"></rich-text>
  23. </view>
  24. <view style="font-size: 28rpx;font-weight: bold;padding-top: 60rpx;">服务包绑定者</view>
  25. <view style="font-size: 28rpx;font-weight: bold;">监护人:{{service.guardian_name}}</view>
  26. <view class="" v-for="(item,index) in packs.team" :key="index">
  27. <view style="font-size: 28rpx;font-weight: bold;padding-top: 48rpx;">{{item.name}}</view>
  28. <view class="list" v-for="(ite,idx) in item.docter" :key="idx" @click="gotodocterinfo(ite)">
  29. <!-- 头像 -->
  30. <view class="portrait">
  31. <view style="padding-top: 20rpx;">
  32. <image class="img" :src="ite.avatar"></image>
  33. <view class="bun_true" @click="submitCollect" :data-itemindex="index" :data-index="idx" :data-id="ite.id" v-if="ite.is_collect==0">关注</view>
  34. <view class="bun_false" @click="submitCollect" :data-itemindex="index" :data-index="idx" :data-id="ite.id"
  35. v-else>已关注</view>
  36. </view>
  37. </view>
  38. <!-- 文字 -->
  39. <view class="text">
  40. <!-- 名字+标签 -->
  41. <view class="name">
  42. <view style="margin-right: 15rpx;">{{ite.name}}</view>
  43. <view class="label" v-for="(itm,idex) in ite.label_texts" :key="idex">{{itm.label_name}}</view>
  44. </view>
  45. <!-- 科室 -->
  46. <view class="department">
  47. <text>科室:</text>
  48. <text style="color: #333333;">{{ite.office.name}}</text>
  49. <text style="color: #333333;">{{ite.qualification.name}}</text>
  50. </view>
  51. <!-- 选项 -->
  52. <view class="option">
  53. <view v-if="ite.is_chat">图文</view>
  54. <view v-if="ite.is_phone">电话</view>
  55. <view v-if="ite.is_appoint">门诊</view>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- 两个半圆 -->
  64. <view class="round" style="position:absolute;top: 25vh;right:0;"></view>
  65. <view class="round" style="position:absolute;top: 25vh;"></view>
  66. </view>
  67. </template>
  68. <script>
  69. export default {
  70. name: 'productdetailspage',
  71. onLoad(op) {
  72. console.log(op.data)
  73. this.service = JSON.parse(op.data)
  74. console.log(this.service)
  75. },
  76. mounted() {
  77. this.getservice()
  78. },
  79. data() {
  80. return {
  81. //关注
  82. isfollow: false,
  83. //协议
  84. num: 1,
  85. imgitem: {
  86. istrue: false,
  87. name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  88. },
  89. packs: {},
  90. serviceid: "",
  91. service: ""
  92. }
  93. },
  94. methods: {
  95. gotodocterinfo(item) {
  96. uni.navigateTo({
  97. url: "../doctor_related/doctor_info?id=" + item.id + "&index=1"
  98. })
  99. },
  100. //关注
  101. submitCollect: async function(e) {
  102. console.log(e)
  103. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  104. type: 1,
  105. relation_id: e.currentTarget.dataset.id
  106. })
  107. if (res.status == 0) {
  108. if (res.data.is_collect == 0) {
  109. uni.showToast({
  110. title: "取消成功",
  111. icon: "none"
  112. })
  113. this.packs.team[e.currentTarget.dataset.itemindex].docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  114. } else {
  115. uni.showToast({
  116. title: "关注成功",
  117. icon: "none"
  118. })
  119. this.packs.team[e.currentTarget.dataset.itemindex].docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  120. }
  121. }
  122. },
  123. getservice: async function() {
  124. console.log(this.service)
  125. let res = await this.$request.post("/api/v1/ServicePack/servicePackDetail", {
  126. service_pack_id: this.service.service_pack_id
  127. })
  128. console.log(res)
  129. if (res.status == 0) {
  130. this.packs = res.data
  131. }
  132. }
  133. }
  134. }
  135. </script>
  136. <style lang="scss">
  137. .footer {
  138. width: 100%;
  139. height: auto;
  140. display: flex;
  141. position: fixed;
  142. bottom: 0;
  143. }
  144. .round {
  145. height: 45rpx;
  146. width: 50rpx;
  147. border-radius: 50%;
  148. background-color: #ececec;
  149. }
  150. .card {
  151. padding: 30rpx 30rpx;
  152. box-sizing: border-box;
  153. .card_view {
  154. width: 100%;
  155. background-color: #ffffff;
  156. border-radius: 15rpx;
  157. .title {
  158. width: 100%;
  159. height: 20vh;
  160. display: flex;
  161. flex-direction: column;
  162. justify-content: center;
  163. align-items: center;
  164. .img {
  165. width: 90%;
  166. height: 90%;
  167. }
  168. }
  169. .describe {
  170. width: 100%;
  171. height: 1;
  172. padding: 100rpx 40rpx 20rpx 40rpx;
  173. }
  174. }
  175. }
  176. .list {
  177. margin: 20rpx 0 10rpx 0;
  178. display: flex;
  179. width: 100%;
  180. height: 200rpx;
  181. border-radius: 15rpx;
  182. background-color: #FFFFFF;
  183. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  184. .portrait {
  185. width: 30%;
  186. height: 100%;
  187. display: flex;
  188. justify-content: center;
  189. align-items: center;
  190. .img {
  191. width: 100rpx;
  192. height: 100rpx;
  193. border-radius: 50%;
  194. }
  195. .bun_true {
  196. text-align: center;
  197. width: 80rpx;
  198. height: 36rpx;
  199. background-color: #D92975;
  200. margin: 0 10rpx;
  201. border-radius: 60rpx;
  202. position: relative;
  203. top: -20rpx;
  204. font-size: 20rpx;
  205. color: #FFFFFF;
  206. padding: 3rpx 0;
  207. }
  208. .bun_false {
  209. border: 1rpx solid #D92975;
  210. text-align: center;
  211. width: 80rpx;
  212. height: 36rpx;
  213. background-color: #FFFFFF;
  214. margin: 0 10rpx;
  215. border-radius: 60rpx;
  216. position: relative;
  217. top: -20rpx;
  218. font-size: 20rpx;
  219. color: #D92975;
  220. padding: 3rpx 0;
  221. }
  222. }
  223. //文字
  224. .text {
  225. width: 70%;
  226. height: 100%;
  227. padding: 20rpx 0;
  228. //名字+标签
  229. .name {
  230. font-size: 30rpx;
  231. font-weight: bold;
  232. display: flex;
  233. align-items: center;
  234. .label {
  235. font-weight: 400;
  236. margin-right: 15rpx;
  237. background-color: #E5F5FF;
  238. color: #0B73B9;
  239. width: 100rpx;
  240. height: 28rpx;
  241. font-size: 20rpx;
  242. border-radius: 10rpx;
  243. text-align: center;
  244. }
  245. }
  246. //科室
  247. .department {
  248. padding: 20rpx 0;
  249. color: #666666;
  250. text {
  251. margin-right: 15rpx;
  252. }
  253. }
  254. // 选项
  255. .option {
  256. display: flex;
  257. view {
  258. background-color: #E4E4E4;
  259. width: 100rpx;
  260. height: 48rpx;
  261. border-radius: 12px;
  262. margin-right: 15rpx;
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. }
  267. }
  268. }
  269. }
  270. </style>