packs_details.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  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="imghos+packs.image" 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;" @click.stop="gotoxieyi">《熙宝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. this.$util.getAgreement().then(res => {
  91. this.service_protocol = res.data.service_protocol
  92. this.phone = res.data.phone
  93. }).catch(err => {
  94. })
  95. this.imghos = this.$imgHost
  96. },
  97. mounted() {
  98. this.getservice()
  99. },
  100. data() {
  101. return {
  102. //关注
  103. isfollow: false,
  104. //协议
  105. num: 1,
  106. imgitem: {
  107. istrue: false,
  108. name: "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  109. },
  110. packs: {},
  111. serviceid: "",
  112. show: false,
  113. customStyle: {
  114. width: '600rpx',
  115. marginTop: "35rpx"
  116. },
  117. service_protocol:"",
  118. phone:"",
  119. imghos:""
  120. }
  121. },
  122. methods: {
  123. gotoxieyi(){
  124. uni.navigateTo({
  125. url: "../index/agreement?data=" + this.service_protocol
  126. })
  127. },
  128. playphone() {
  129. uni.makePhoneCall({
  130. phoneNumber: this.phone
  131. })
  132. this.show = false
  133. },
  134. //关注
  135. submitCollect: async function(e) {
  136. console.log(e)
  137. let res = await this.$request.post("/api/v1/collection/submitCollect", {
  138. type: 1,
  139. relation_id: e.currentTarget.dataset.id
  140. })
  141. if (res.status == 0) {
  142. if (res.data.is_collect == 0) {
  143. uni.showToast({
  144. title: "取消成功",
  145. icon: "none"
  146. })
  147. this.packs.team[e.currentTarget.dataset.itemindex].docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  148. } else {
  149. uni.showToast({
  150. title: "关注成功",
  151. icon: "none"
  152. })
  153. this.packs.team[e.currentTarget.dataset.itemindex].docter[e.currentTarget.dataset.index].is_collect = res.data.is_collect
  154. }
  155. }
  156. },
  157. getservice: async function() {
  158. let res = await this.$request.post("/api/v1/ServicePack/servicePackDetail", {
  159. service_pack_id: this.serviceid
  160. })
  161. console.log(res)
  162. if (res.status == 0) {
  163. this.packs = res.data
  164. }
  165. },
  166. isqueren() {
  167. this.num++
  168. if (this.num % 2 == 0) {
  169. this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyixuan.png"
  170. this.imgitem.istrue = true
  171. } else {
  172. this.imgitem.name = "https://zhengda.oss-cn-chengdu.aliyuncs.com/baoma/static/img/xieyi.png"
  173. this.imgitem.istrue = false
  174. }
  175. },
  176. next(e) {
  177. if (!this.imgitem.istrue) {
  178. uni.showToast({
  179. icon: 'none',
  180. position: 'bottom',
  181. title: '请先同意《协议》'
  182. });
  183. } else {
  184. let obj = {
  185. id: this.packs.id,
  186. price: this.packs.price,
  187. is_need_insure:this.packs.is_need_insure
  188. }
  189. uni.navigateTo({
  190. url: '/pages/service_packs/packs_information?data=' + JSON.stringify(obj)
  191. })
  192. }
  193. }
  194. }
  195. }
  196. </script>
  197. <style lang="scss">
  198. .footer {
  199. width: 100%;
  200. height: auto;
  201. display: flex;
  202. position: fixed;
  203. bottom: 0;
  204. }
  205. .round {
  206. height: 45rpx;
  207. width: 50rpx;
  208. border-radius: 50%;
  209. background-color: #ececec;
  210. }
  211. .card {
  212. padding: 30rpx 30rpx;
  213. box-sizing: border-box;
  214. .card_view {
  215. width: 100%;
  216. background-color: #ffffff;
  217. border-radius: 15rpx;
  218. .title {
  219. width: 100%;
  220. height: 20vh;
  221. display: flex;
  222. justify-content: center;
  223. align-items: flex-end;
  224. .img {
  225. width: 90%;
  226. height: 90%;
  227. }
  228. }
  229. .describe {
  230. width: 100%;
  231. height: 1;
  232. padding: 100rpx 40rpx 20rpx 40rpx;
  233. }
  234. }
  235. }
  236. .list {
  237. margin: 20rpx 0 10rpx 0;
  238. display: flex;
  239. width: 100%;
  240. height: 200rpx;
  241. border-radius: 15rpx;
  242. background-color: #FFFFFF;
  243. box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.08);
  244. .portrait {
  245. width: 30%;
  246. height: 100%;
  247. display: flex;
  248. justify-content: center;
  249. align-items: center;
  250. .img {
  251. width: 100rpx;
  252. height: 100rpx;
  253. border-radius: 50%;
  254. }
  255. .bun_true {
  256. text-align: center;
  257. width: 80rpx;
  258. height: 36rpx;
  259. background-color: #D92975;
  260. margin: 0 10rpx;
  261. border-radius: 60rpx;
  262. position: relative;
  263. top: -20rpx;
  264. font-size: 20rpx;
  265. color: #FFFFFF;
  266. padding: 3rpx 0;
  267. }
  268. .bun_false {
  269. border: 1rpx solid #D92975;
  270. text-align: center;
  271. width: 80rpx;
  272. height: 36rpx;
  273. background-color: #FFFFFF;
  274. margin: 0 10rpx;
  275. border-radius: 60rpx;
  276. position: relative;
  277. top: -20rpx;
  278. font-size: 20rpx;
  279. color: #D92975;
  280. padding: 3rpx 0;
  281. }
  282. }
  283. //文字
  284. .text {
  285. width: 70%;
  286. height: 100%;
  287. padding: 20rpx 0;
  288. //名字+标签
  289. .name {
  290. font-size: 30rpx;
  291. font-weight: bold;
  292. display: flex;
  293. align-items: center;
  294. .label {
  295. font-weight: 400;
  296. margin-right: 15rpx;
  297. background-color: #E5F5FF;
  298. color: #0B73B9;
  299. width: 100rpx;
  300. height: 28rpx;
  301. font-size: 20rpx;
  302. border-radius: 10rpx;
  303. display: flex;
  304. justify-content: center;
  305. align-items: center;
  306. }
  307. }
  308. //科室
  309. .department {
  310. padding: 20rpx 0;
  311. color: #666666;
  312. text {
  313. margin-right: 15rpx;
  314. }
  315. }
  316. // 选项
  317. .option {
  318. display: flex;
  319. view {
  320. background-color: #E4E4E4;
  321. width: 100rpx;
  322. height: 48rpx;
  323. border-radius: 12px;
  324. margin-right: 15rpx;
  325. display: flex;
  326. justify-content: center;
  327. align-items: center;
  328. }
  329. }
  330. }
  331. }
  332. </style>