choiceBox.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293
  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.pack_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.pack_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.pack_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. let res = await this.$request.post("/api/v1/order/orderDetail", {
  125. order_id: this.service.service_pack_id
  126. })
  127. console.log(res)
  128. if (res.status == 0) {
  129. this.packs = res.data.order_pack
  130. }
  131. }
  132. }
  133. }
  134. </script>
  135. <style lang="scss">
  136. .footer {
  137. width: 100%;
  138. height: auto;
  139. display: flex;
  140. position: fixed;
  141. bottom: 0;
  142. }
  143. .round {
  144. height: 45rpx;
  145. width: 50rpx;
  146. border-radius: 50%;
  147. background-color: #ececec;
  148. }
  149. .card {
  150. padding: 30rpx 30rpx;
  151. box-sizing: border-box;
  152. .card_view {
  153. width: 100%;
  154. background-color: #ffffff;
  155. border-radius: 15rpx;
  156. .title {
  157. width: 100%;
  158. height: 20vh;
  159. display: flex;
  160. flex-direction: column;
  161. justify-content: center;
  162. align-items: center;
  163. .img {
  164. width: 90%;
  165. height: 90%;
  166. }
  167. }
  168. .describe {
  169. width: 100%;
  170. height: 1;
  171. padding: 100rpx 40rpx 20rpx 40rpx;
  172. }
  173. }
  174. }
  175. .list {
  176. margin: 20rpx 0 10rpx 0;
  177. display: flex;
  178. width: 100%;
  179. height: 200rpx;
  180. border-radius: 15rpx;
  181. background-color: #FFFFFF;
  182. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  183. .portrait {
  184. width: 30%;
  185. height: 100%;
  186. display: flex;
  187. justify-content: center;
  188. align-items: center;
  189. .img {
  190. width: 100rpx;
  191. height: 100rpx;
  192. border-radius: 50%;
  193. }
  194. .bun_true {
  195. text-align: center;
  196. width: 80rpx;
  197. height: 36rpx;
  198. background-color: #D92975;
  199. margin: 0 10rpx;
  200. border-radius: 60rpx;
  201. position: relative;
  202. top: -20rpx;
  203. font-size: 20rpx;
  204. color: #FFFFFF;
  205. padding: 3rpx 0;
  206. }
  207. .bun_false {
  208. border: 1rpx solid #D92975;
  209. text-align: center;
  210. width: 80rpx;
  211. height: 36rpx;
  212. background-color: #FFFFFF;
  213. margin: 0 10rpx;
  214. border-radius: 60rpx;
  215. position: relative;
  216. top: -20rpx;
  217. font-size: 20rpx;
  218. color: #D92975;
  219. padding: 3rpx 0;
  220. }
  221. }
  222. //文字
  223. .text {
  224. width: 70%;
  225. height: 100%;
  226. padding: 20rpx 0;
  227. //名字+标签
  228. .name {
  229. font-size: 30rpx;
  230. font-weight: bold;
  231. display: flex;
  232. align-items: center;
  233. .label {
  234. font-weight: 400;
  235. margin-right: 15rpx;
  236. background-color: #E5F5FF;
  237. color: #0B73B9;
  238. width: 100rpx;
  239. height: 28rpx;
  240. font-size: 20rpx;
  241. border-radius: 10rpx;
  242. text-align: center;
  243. }
  244. }
  245. //科室
  246. .department {
  247. padding: 20rpx 0;
  248. color: #666666;
  249. text {
  250. margin-right: 15rpx;
  251. }
  252. }
  253. // 选项
  254. .option {
  255. display: flex;
  256. view {
  257. background-color: #E4E4E4;
  258. width: 100rpx;
  259. height: 48rpx;
  260. border-radius: 12px;
  261. margin-right: 15rpx;
  262. display: flex;
  263. justify-content: center;
  264. align-items: center;
  265. }
  266. }
  267. }
  268. }
  269. </style>