packs_details.vue 10 KB

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