packs_details.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  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. <rich-text style="padding: 12rpx 0;" :nodes="packs.desc"></rich-text>
  19. </view>
  20. <view class="" v-for="(item,index) in packs.team" :key="index">
  21. <view style="font-size: 28rpx;font-weight: bold;padding-top: 48rpx;">{{item.name}}</view>
  22. <view class="list" v-for="(ite,idx) in item.docter" :key="idx">
  23. <!-- 头像 -->
  24. <view class="portrait">
  25. <view style="padding-top: 20rpx;">
  26. <image class="img" :src="ite.avatar"></image>
  27. <view class="bun_true" @click="submitCollect" :data-index="idx" :data-id="ite.id" v-if="ite.is_collect==0">关注</view>
  28. <view class="bun_false" @click="submitCollect" :data-index="idx" :data-id="ite.id" v-else>已关注</view>
  29. </view>
  30. </view>
  31. <!-- 文字 -->
  32. <view class="text">
  33. <!-- 名字+标签 -->
  34. <view class="name">
  35. <view style="margin-right: 15rpx;">{{ite.name}}</view>
  36. <view class="label" v-for="(itm,idex) in ite.label_texts" :key="idex">{{itm.label_name}}</view>
  37. </view>
  38. <!-- 科室 -->
  39. <view class="department">
  40. <text>科室:</text>
  41. <text style="color: #333333;">{{ite.office.name||'暂无'}}</text>
  42. <text style="color: #333333;">{{ite.qualification.name||'暂无'}}</text>
  43. </view>
  44. <!-- 选项 -->
  45. <view class="option">
  46. <view v-if="ite.is_chat">图文</view>
  47. <view v-if="ite.is_phone">电话</view>
  48. <view v-if="ite.is_appoint">门诊</view>
  49. </view>
  50. </view>
  51. </view>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <!-- 协议 -->
  57. <view style="height: 200rpx;width: 100%;display: flex;justify-content: left;">
  58. <view @click="isqueren" style="height: 35rpx;width: auto;font-size: 24rpx;margin-left: 30rpx;display: flex;align-items: center;">
  59. <image :src="imgitem.name" mode="" style="width: 30rpx;height: 30rpx;margin-right: 10rpx;"></image>
  60. <text style="color: #999999;">已阅读并同意</text>
  61. <text style="color: #0B73B9;">《熙宝HMO》</text>
  62. <text style="color: #999999;">服务协议</text>
  63. </view>
  64. </view>
  65. <!-- 两个半圆 -->
  66. <view class="round" style="position:absolute;top: 25vh;right:0;"></view>
  67. <view class="round" style="position:absolute;top: 25vh;"></view>
  68. <!-- 底部按钮 -->
  69. <view class="footer">
  70. <view class="cu-bar bg-white tabbar border shop" style="width: 100%;">
  71. <button class="action" @click="show=true" style="width: 33%;">
  72. <view class="cuIcon-service text-green">
  73. </view>
  74. 客服
  75. </button>
  76. <view class="submit" @click="next" style="background-color: #0B73B9; color: #FFFFFF;">下一步</view>
  77. </view>
  78. </view>
  79. <u-popup v-model="show" mode="bottom" border-radius="14" height="300rpx">
  80. <u-button open-type="contact" :custom-style="customStyle">会话客服</u-button>
  81. <u-button @click="playphone" :custom-style="customStyle">电话客服</u-button>
  82. </u-popup>
  83. </view>
  84. </template>
  85. <script>
  86. export default {
  87. name: 'productdetailspage',
  88. onLoad(op) {
  89. this.serviceid = op.id
  90. },
  91. mounted() {
  92. this.getservice()
  93. },
  94. data() {
  95. return {
  96. //关注
  97. isfollow: false,
  98. //协议
  99. num: 1,
  100. imgitem: {
  101. istrue: false,
  102. name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  103. },
  104. packs: {},
  105. serviceid: "",
  106. show: false,
  107. customStyle: {
  108. width: '600rpx',
  109. marginTop: "35rpx"
  110. }
  111. }
  112. },
  113. methods: {
  114. playphone() {
  115. uni.makePhoneCall({
  116. phoneNumber: "123456"
  117. })
  118. this.show = false
  119. },
  120. //关注
  121. submitCollect: async function(e) {
  122. console.log(e)
  123. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  124. type: 1,
  125. relation_id: e.currentTarget.dataset.id
  126. })
  127. if (res.status == 0) {
  128. if (res.data.is_collect == 0) {
  129. uni.showToast({
  130. title: "取消成功",
  131. icon: "none"
  132. })
  133. this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  134. } else {
  135. uni.showToast({
  136. title: "关注成功",
  137. icon: "none"
  138. })
  139. this.packs.team.docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  140. }
  141. }
  142. },
  143. getservice: async function() {
  144. let res = await this.$request.post("/api/v1/ServicePack/servicePackDetail", {
  145. service_pack_id: this.serviceid
  146. })
  147. console.log(res)
  148. if (res.status == 0) {
  149. this.packs = res.data
  150. }
  151. },
  152. isqueren() {
  153. this.num++
  154. if (this.num % 2 == 0) {
  155. this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyixuan.png"
  156. this.imgitem.istrue = true
  157. } else {
  158. this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  159. this.imgitem.istrue = false
  160. }
  161. },
  162. next(e) {
  163. if (!this.imgitem.istrue) {
  164. uni.showToast({
  165. icon: 'none',
  166. position: 'bottom',
  167. title: '请先同意《协议》'
  168. });
  169. } else {
  170. let obj = {
  171. id: this.packs.id,
  172. price: this.packs.price
  173. }
  174. uni.navigateTo({
  175. url: '/pages/service_packs/packs_information?data=' + JSON.stringify(obj)
  176. })
  177. }
  178. }
  179. }
  180. }
  181. </script>
  182. <style lang="scss">
  183. .footer {
  184. width: 100%;
  185. height: auto;
  186. display: flex;
  187. position: fixed;
  188. bottom: 0;
  189. }
  190. .round {
  191. height: 45rpx;
  192. width: 50rpx;
  193. border-radius: 50%;
  194. background-color: #ececec;
  195. }
  196. .card {
  197. padding: 30rpx 30rpx;
  198. box-sizing: border-box;
  199. .card_view {
  200. width: 100%;
  201. background-color: #ffffff;
  202. border-radius: 15rpx;
  203. .title {
  204. width: 100%;
  205. height: 20vh;
  206. display: flex;
  207. justify-content: center;
  208. align-items: flex-end;
  209. .img {
  210. width: 90%;
  211. height: 90%;
  212. }
  213. }
  214. .describe {
  215. width: 100%;
  216. height: 1;
  217. padding: 100rpx 40rpx 20rpx 40rpx;
  218. }
  219. }
  220. }
  221. .list {
  222. margin: 20rpx 0 10rpx 0;
  223. display: flex;
  224. width: 100%;
  225. height: 200rpx;
  226. border-radius: 15rpx;
  227. background-color: #FFFFFF;
  228. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  229. .portrait {
  230. width: 30%;
  231. height: 100%;
  232. display: flex;
  233. justify-content: center;
  234. align-items: center;
  235. .img {
  236. width: 100rpx;
  237. height: 100rpx;
  238. border-radius: 50%;
  239. }
  240. .bun_true {
  241. text-align: center;
  242. width: 80rpx;
  243. height: 36rpx;
  244. background-color: #D92975;
  245. margin: 0 10rpx;
  246. border-radius: 60rpx;
  247. position: relative;
  248. top: -20rpx;
  249. font-size: 20rpx;
  250. color: #FFFFFF;
  251. padding: 3rpx 0;
  252. }
  253. .bun_false {
  254. border: 1rpx solid #D92975;
  255. text-align: center;
  256. width: 80rpx;
  257. height: 36rpx;
  258. background-color: #FFFFFF;
  259. margin: 0 10rpx;
  260. border-radius: 60rpx;
  261. position: relative;
  262. top: -20rpx;
  263. font-size: 20rpx;
  264. color: #D92975;
  265. padding: 3rpx 0;
  266. }
  267. }
  268. //文字
  269. .text {
  270. width: 70%;
  271. height: 100%;
  272. padding: 20rpx 0;
  273. //名字+标签
  274. .name {
  275. font-size: 30rpx;
  276. font-weight: bold;
  277. display: flex;
  278. align-items: center;
  279. .label {
  280. font-weight: 400;
  281. margin-right: 15rpx;
  282. background-color: #E5F5FF;
  283. color: #0B73B9;
  284. width: 100rpx;
  285. height: 28rpx;
  286. font-size: 20rpx;
  287. border-radius: 10rpx;
  288. display: flex;
  289. justify-content: center;
  290. align-items: center;
  291. }
  292. }
  293. //科室
  294. .department {
  295. padding: 20rpx 0;
  296. color: #666666;
  297. text {
  298. margin-right: 15rpx;
  299. }
  300. }
  301. // 选项
  302. .option {
  303. display: flex;
  304. view {
  305. background-color: #E4E4E4;
  306. width: 100rpx;
  307. height: 48rpx;
  308. border-radius: 12px;
  309. margin-right: 15rpx;
  310. display: flex;
  311. justify-content: center;
  312. align-items: center;
  313. }
  314. }
  315. }
  316. }
  317. </style>