packs_details.vue 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  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-itemindex="index" :data-index="idx" :data-id="ite.id" v-if="ite.is_collect==0">关注</view>
  28. <view class="bun_false" @click="submitCollect" :data-itemindex="index" :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[e.currentTarget.dataset.itemindex].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[e.currentTarget.dataset.itemindex].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. is_need_insure:this.packs.is_need_insure
  174. }
  175. uni.navigateTo({
  176. url: '/pages/service_packs/packs_information?data=' + JSON.stringify(obj)
  177. })
  178. }
  179. }
  180. }
  181. }
  182. </script>
  183. <style lang="scss">
  184. .footer {
  185. width: 100%;
  186. height: auto;
  187. display: flex;
  188. position: fixed;
  189. bottom: 0;
  190. }
  191. .round {
  192. height: 45rpx;
  193. width: 50rpx;
  194. border-radius: 50%;
  195. background-color: #ececec;
  196. }
  197. .card {
  198. padding: 30rpx 30rpx;
  199. box-sizing: border-box;
  200. .card_view {
  201. width: 100%;
  202. background-color: #ffffff;
  203. border-radius: 15rpx;
  204. .title {
  205. width: 100%;
  206. height: 20vh;
  207. display: flex;
  208. justify-content: center;
  209. align-items: flex-end;
  210. .img {
  211. width: 90%;
  212. height: 90%;
  213. }
  214. }
  215. .describe {
  216. width: 100%;
  217. height: 1;
  218. padding: 100rpx 40rpx 20rpx 40rpx;
  219. }
  220. }
  221. }
  222. .list {
  223. margin: 20rpx 0 10rpx 0;
  224. display: flex;
  225. width: 100%;
  226. height: 200rpx;
  227. border-radius: 15rpx;
  228. background-color: #FFFFFF;
  229. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  230. .portrait {
  231. width: 30%;
  232. height: 100%;
  233. display: flex;
  234. justify-content: center;
  235. align-items: center;
  236. .img {
  237. width: 100rpx;
  238. height: 100rpx;
  239. border-radius: 50%;
  240. }
  241. .bun_true {
  242. text-align: center;
  243. width: 80rpx;
  244. height: 36rpx;
  245. background-color: #D92975;
  246. margin: 0 10rpx;
  247. border-radius: 60rpx;
  248. position: relative;
  249. top: -20rpx;
  250. font-size: 20rpx;
  251. color: #FFFFFF;
  252. padding: 3rpx 0;
  253. }
  254. .bun_false {
  255. border: 1rpx solid #D92975;
  256. text-align: center;
  257. width: 80rpx;
  258. height: 36rpx;
  259. background-color: #FFFFFF;
  260. margin: 0 10rpx;
  261. border-radius: 60rpx;
  262. position: relative;
  263. top: -20rpx;
  264. font-size: 20rpx;
  265. color: #D92975;
  266. padding: 3rpx 0;
  267. }
  268. }
  269. //文字
  270. .text {
  271. width: 70%;
  272. height: 100%;
  273. padding: 20rpx 0;
  274. //名字+标签
  275. .name {
  276. font-size: 30rpx;
  277. font-weight: bold;
  278. display: flex;
  279. align-items: center;
  280. .label {
  281. font-weight: 400;
  282. margin-right: 15rpx;
  283. background-color: #E5F5FF;
  284. color: #0B73B9;
  285. width: 100rpx;
  286. height: 28rpx;
  287. font-size: 20rpx;
  288. border-radius: 10rpx;
  289. display: flex;
  290. justify-content: center;
  291. align-items: center;
  292. }
  293. }
  294. //科室
  295. .department {
  296. padding: 20rpx 0;
  297. color: #666666;
  298. text {
  299. margin-right: 15rpx;
  300. }
  301. }
  302. // 选项
  303. .option {
  304. display: flex;
  305. view {
  306. background-color: #E4E4E4;
  307. width: 100rpx;
  308. height: 48rpx;
  309. border-radius: 12px;
  310. margin-right: 15rpx;
  311. display: flex;
  312. justify-content: center;
  313. align-items: center;
  314. }
  315. }
  316. }
  317. }
  318. </style>