choiceBox.vue 6.2 KB

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