choiceBox.vue 6.4 KB

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