choiceBox.vue 6.7 KB

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