choiceBox.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  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-index="idx" :data-id="ite.id" v-if="ite.is_collect==0">关注</view>
  35. <view class="bun_false" @click="submitCollect" :data-index="idx" :data-id="ite.id" 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" :key="idex">{{itm}}</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. this.service = JSON.parse(op.data)
  73. console.log(this.service)
  74. },
  75. mounted() {
  76. this.getservice()
  77. },
  78. data() {
  79. return {
  80. //关注
  81. isfollow: false,
  82. //协议
  83. num: 1,
  84. imgitem: {
  85. istrue: false,
  86. name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  87. },
  88. packs: {},
  89. serviceid: "",
  90. service:""
  91. }
  92. },
  93. methods: {
  94. //关注
  95. submitCollect: async function(e) {
  96. console.log(e)
  97. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  98. type: 1,
  99. relation_id: e.currentTarget.dataset.id
  100. })
  101. if (res.status == 0) {
  102. if (res.data.is_collect == 0) {
  103. uni.showToast({
  104. title: "取消成功",
  105. icon: "none"
  106. })
  107. this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  108. } else {
  109. uni.showToast({
  110. title: "关注成功",
  111. icon: "none"
  112. })
  113. this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  114. }
  115. }
  116. },
  117. getservice: async function() {
  118. let res = await this.$request.post("/api/v1/ServicePack/servicePackDetail", {
  119. service_pack_id: this.service.service_pack_id
  120. })
  121. console.log(res)
  122. if (res.status == 0) {
  123. this.packs = res.data
  124. }
  125. }
  126. }
  127. }
  128. </script>
  129. <style lang="scss">
  130. .footer {
  131. width: 100%;
  132. height: auto;
  133. display: flex;
  134. position: fixed;
  135. bottom: 0;
  136. }
  137. .round {
  138. height: 45rpx;
  139. width: 50rpx;
  140. border-radius: 50%;
  141. background-color: #ececec;
  142. }
  143. .card {
  144. padding: 30rpx 30rpx;
  145. box-sizing: border-box;
  146. .card_view {
  147. width: 100%;
  148. background-color: #ffffff;
  149. border-radius: 15rpx;
  150. .title {
  151. width: 100%;
  152. height: 20vh;
  153. display: flex;
  154. flex-direction: column;
  155. justify-content: center;
  156. align-items: center;
  157. .img {
  158. width: 90%;
  159. height: 90%;
  160. }
  161. }
  162. .describe {
  163. width: 100%;
  164. height: 1;
  165. padding: 100rpx 40rpx 20rpx 40rpx;
  166. }
  167. }
  168. }
  169. .list {
  170. margin: 20rpx 0 10rpx 0;
  171. display: flex;
  172. width: 100%;
  173. height: 200rpx;
  174. border-radius: 15rpx;
  175. background-color: #FFFFFF;
  176. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  177. .portrait {
  178. width: 30%;
  179. height: 100%;
  180. display: flex;
  181. justify-content: center;
  182. align-items: center;
  183. .img {
  184. width: 100rpx;
  185. height: 100rpx;
  186. border-radius: 50%;
  187. }
  188. .bun_true {
  189. text-align: center;
  190. width: 80rpx;
  191. height: 36rpx;
  192. background-color: #D92975;
  193. margin: 0 10rpx;
  194. border-radius: 60rpx;
  195. position: relative;
  196. top: -20rpx;
  197. font-size: 20rpx;
  198. color: #FFFFFF;
  199. padding: 3rpx 0;
  200. }
  201. .bun_false {
  202. border: 1rpx solid #D92975;
  203. text-align: center;
  204. width: 80rpx;
  205. height: 36rpx;
  206. background-color: #FFFFFF;
  207. margin: 0 10rpx;
  208. border-radius: 60rpx;
  209. position: relative;
  210. top: -20rpx;
  211. font-size: 20rpx;
  212. color: #D92975;
  213. padding: 3rpx 0;
  214. }
  215. }
  216. //文字
  217. .text {
  218. width: 70%;
  219. height: 100%;
  220. padding: 20rpx 0;
  221. //名字+标签
  222. .name {
  223. font-size: 30rpx;
  224. font-weight: bold;
  225. display: flex;
  226. align-items: center;
  227. .label {
  228. font-weight: 400;
  229. margin-right: 15rpx;
  230. background-color: #E5F5FF;
  231. color: #0B73B9;
  232. width: 100rpx;
  233. height: 28rpx;
  234. font-size: 20rpx;
  235. border-radius: 10rpx;
  236. text-align: center;
  237. }
  238. }
  239. //科室
  240. .department {
  241. padding: 20rpx 0;
  242. color: #666666;
  243. text {
  244. margin-right: 15rpx;
  245. }
  246. }
  247. // 选项
  248. .option {
  249. display: flex;
  250. view {
  251. background-color: #E4E4E4;
  252. width: 100rpx;
  253. height: 48rpx;
  254. border-radius: 12px;
  255. margin-right: 15rpx;
  256. display: flex;
  257. justify-content: center;
  258. align-items: center;
  259. }
  260. }
  261. }
  262. }
  263. </style>