血透系统PC前端

serviceOrder.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639
  1. <template>
  2. <div v-loading='loading'>
  3. <div v-if="!isShowProbationPeriod&&!isShowFormal&&!isShowYj" class="topHint">
  4. <div class="top-text">
  5. 您未订购血透管理的服务<br>
  6. 逾期未订购血透管理将无法正常使用,如有疑问,请咨询客服:0755-86526342
  7. </div>
  8. </div>
  9. <div v-if="isShowProbationPeriod" class="topHint">
  10. <div class="top-text">
  11. 您的血透管理处于免费版,当前管理患者<span>{{this.subscibe.patients}}</span>位<br>
  12. 逾期未订购血透管理将无法正常使用,如有疑问,请咨询客服:0755-86526342
  13. </div>
  14. </div>
  15. <div v-if="isShowFormal" class="topHint">
  16. <div class="top-text">
  17. 您的血透管理处于标准版(<span>{{time}}</span>),当前管理患者<span>{{this.subscibe.patients}}</span>位<br>
  18. 逾期未订购血透管理将无法正常使用,如有疑问,请咨询客服:0755-86526342
  19. </div>
  20. </div>
  21. <div v-if="isShowZYPanel" class="topHint">
  22. <div class="top-text">
  23. 您的血透管理处于专业版(<span>{{time}}</span>),当前管理患者<span>{{this.subscibe.patients}}</span>位<br>
  24. 逾期未订购血透管理将无法正常使用,如有疑问,请咨询客服:0755-86526342
  25. </div>
  26. </div>
  27. <div v-if="isShowYj" class="topHint">
  28. <div class="top-text">
  29. 您的血透管理处于永久免费使用<br>
  30. 逾期未订购血透管理将无法正常使用,如有疑问,请咨询客服:0755-86526342
  31. </div>
  32. </div>
  33. <!-- <div class="online-edu">
  34. <div class="online-header">
  35. <div class="header-desc">
  36. <h3>
  37. 血透管理正式版
  38. </h3>
  39. </div>
  40. </div>
  41. </div> -->
  42. <div class="config-process">
  43. <ul class="process">
  44. <li tag="li" class="items" >
  45. <div class="inner">
  46. <h2 class="name">免费版</h2>
  47. <p class="text">最多可管理100位患者</p>
  48. <span class="price size">免费使用</span>
  49. <!-- <span @click="isSCRMClick = 1" v-if="isSCRMClick == 2" class="buy active">已选购</span> -->
  50. <span class="buy active">已开通</span>
  51. </div>
  52. </li>
  53. <li tag="li" class="items" >
  54. <div class="inner">
  55. <h2 class="name">标准版</h2>
  56. <p class="text">最多可管理200位患者</p>
  57. <span class="price"><i>¥</i>6980<span class="year">/ 年</span></span>
  58. <!-- <span @click="isWxClick = 1" v-if="isWxClick == 2" class="buy active">已选购</span> -->
  59. <!-- <span class="buy active">已开通</span> -->
  60. <!-- <span @click="selectXt(1)" v-if="isBZClick == 2" class="buy active">已选购</span> -->
  61. <span @click="selectXt(1)" class="buy " :class="bzactive||!bzflag?'active':''" >{{bztext}}</span>
  62. </div>
  63. </li>
  64. <li tag="li" class="items" >
  65. <div class="inner">
  66. <h2 class="name">专业版</h2>
  67. <p class="text">管理的患者数无限制</p>
  68. <span class="price"><i>¥</i>15800<span class="year">/ 年</span></span>
  69. <!-- <span class="price"><i>¥</i>23888<span class="year">/ 年</span></span> -->
  70. <!-- <span @click="selectXt(8)" v-if="isXTClick == 2" class="buy active">已选购</span>
  71. <span @click="selectXt(8)" v-if="isXTClick == 1" class="buy ">立即选购</span> -->
  72. <span @click="selectXt(8)" class="buy " :class="zyactive?'active':''" >{{zytext}}</span>
  73. </div>
  74. </li>
  75. </ul>
  76. </div>
  77. <div class="purchaseCart">
  78. <div class="content-part">
  79. <span>购买年数:</span>
  80. <el-input-number v-model="num1" @change="handleChange" :min="1" :max="1000" label="年"></el-input-number>
  81. <div class="total-price">
  82. 合计:
  83. <span v-if="isXTClick == 2">{{totalPrice}} 元</span>
  84. <span v-if="isXTClick == 1">0元</span>
  85. </div>
  86. <button v-if="bzactive||zyactive" class="go-to-purchase" @click="jumpToNewUrl">去结算</button>
  87. <button v-if="!bzactive&&!zyactive" class="go-to-purchase2" @click="jumpToNewUrl" disabled>去结算</button>
  88. </div>
  89. </div>
  90. </div>
  91. </template>
  92. <script>
  93. import {getProduct} from "@/api/service"
  94. export default {
  95. name: "ServiceOrder",
  96. created() {
  97. this.getProduct()
  98. },
  99. data() {
  100. return {
  101. loading:true,
  102. bzactive:false,
  103. bztext:'立即选购',
  104. bzflag:false,
  105. zyactive:false,
  106. zytext:'立即选购',
  107. isWxClick:1,
  108. isXTClick:2,
  109. isBZClick:2,
  110. isSCRMClick:1,
  111. flag: false,
  112. time:'',
  113. isShowProbationPeriod: false,
  114. isShowFormal: false,
  115. isShowZYPanel:false,
  116. isShowYj: false,
  117. leftTime:'',
  118. num1: 1,
  119. price:'',
  120. original_price:'',
  121. totalPrice:'',
  122. subscibe:{
  123. created_time: 0,
  124. id: 0,
  125. org_id: 0,
  126. patients: 0,
  127. period_end: 0,
  128. period_end_time: "0",
  129. period_start: 0,
  130. period_start_time: "0",
  131. state: 0,
  132. status: 0,
  133. updated_time: 0,
  134. },
  135. products: [
  136. ],
  137. productsMap:{},
  138. selectProduct:{},
  139. };
  140. },
  141. methods:{
  142. getProduct:function () {
  143. getProduct().then(response => {
  144. if (response.data.state == 0) {
  145. this.$message.error(response.data.msg);
  146. }else {
  147. this.subscibe = response.data.data.subscibe;
  148. if(this.subscibe.patients>60) {
  149. this.bzflag = false; //可否购买
  150. this.bztext = '无法选购';
  151. }else {
  152. this.bzflag = true;
  153. this.bztext = '立即选购';
  154. }
  155. if(this.subscibe.state == 1){//标准版
  156. this.isShowFormal = true
  157. this.isShowProbationPeriod = false
  158. this.isShowZYPanel = false;
  159. this.isShowYj = false;
  160. this.leftTime = response.data.data.subscibe.period_end - response.data.data.serviceTime
  161. if(this.leftTime < 0){
  162. this.flag = true
  163. this.time="已过期"
  164. }
  165. }else if(this.subscibe.state == 8){//专业版
  166. this.isShowProbationPeriod = false;
  167. this.isShowFormal = false;
  168. this.isShowZYPanel = true;
  169. this.isShowYj = false;
  170. this.leftTime = response.data.data.subscibe.period_end - response.data.data.serviceTime
  171. if(this.leftTime < 0){
  172. this.flag = true
  173. this.time="已过期"
  174. }
  175. }else if(this.subscibe.state == 2){//试用版
  176. this.isShowProbationPeriod = true
  177. this.isShowFormal = false
  178. this.isShowZYPanel = false;
  179. this.isShowYj = false;
  180. this.leftTime = response.data.data.subscibe.period_end - response.data.data.serviceTime
  181. if(this.leftTime < 0){
  182. this.flag = true
  183. this.time="已过期"
  184. }
  185. }if(this.subscibe.state == 9){//永乐免费版
  186. this.isShowProbationPeriod = false
  187. this.isShowFormal = false
  188. this.isShowZYPanel = false;
  189. this.isShowYj = true;
  190. }
  191. for(let i = 0; i < response.data.data.products.length; i++){
  192. this.products.unshift(response.data.data.products[i]);
  193. this.productsMap[response.data.data.products[i]['edition']] = response.data.data.products[i];
  194. // this.price = response.data.data.products[0].price
  195. // this.original_price = response.data.data.products[0].original_price
  196. }
  197. }
  198. this.loading = false;
  199. })
  200. },timeDown() {
  201. let leftTime = this.leftTime
  202. let d = parseInt(leftTime / (24 * 60 * 60))
  203. let h = this.formate(parseInt(leftTime / (60 * 60) % 24))
  204. let m = this.formate(parseInt(leftTime / 60 % 60))
  205. let s = this.formate(parseInt(leftTime % 60))
  206. if (leftTime <= 0) {
  207. this.flag = true
  208. }else {
  209. this.time = d + '天' + h + '小时' + m + '分' + s + '秒'
  210. }
  211. }, formate(time) {
  212. if (time >= 10) {
  213. return time
  214. } else {
  215. return `0${time}`
  216. }
  217. },
  218. handleChange:function (val) {
  219. this.totalPrice = this.price * val
  220. },
  221. jumpToNewUrl:function () {
  222. this.$router.push("/servicePay?amount="+this.num1+'&serve_id='+this.selectProduct['id']);
  223. },
  224. selectXt(type) {
  225. if(type==1 && this.bzflag) {
  226. if(!(type in this.productsMap)) {
  227. this.$message.error("没有此服务,无法订购");
  228. return false;
  229. }
  230. this.bzactive = true;
  231. this.bztext = '已选购';
  232. this.zyactive = false;
  233. this.zytext = '立即选购';
  234. this.selectProduct = this.productsMap[type];
  235. this.price = this.selectProduct['price'];
  236. this.totalPrice = this.price;
  237. this.num1 = 1;
  238. // this.isXTClick = 2;
  239. // this.isBZClick = 1;
  240. }else if(type==8) {
  241. if(!(type in this.productsMap)) {
  242. this.$message.error("没有此服务,无法订购");
  243. return false;
  244. }
  245. this.bzactive = false;
  246. this.bztext = this.bzflag?'立即选购':'无法选购';
  247. this.zyactive = true;
  248. this.zytext = '已选购';
  249. this.selectProduct = this.productsMap[type];
  250. this.price = this.selectProduct['price'];
  251. this.totalPrice = this.price;
  252. this.num1 = 1;
  253. }else {
  254. this.selectProduct = {};
  255. }
  256. }
  257. },
  258. mounted() {
  259. let time = setInterval(() => {
  260. if (this.flag == true) {
  261. clearInterval(time)
  262. }
  263. this.leftTime = this.leftTime - 1
  264. this.timeDown()
  265. }, 1000)
  266. },
  267. };
  268. </script>
  269. <style rel="stylesheet/scss" lang="scss" scoped>
  270. @mixin ellipsis {
  271. float: left;
  272. overflow: hidden;
  273. text-overflow: ellipsis;
  274. white-space: nowrap;
  275. }
  276. ::-webkit-scrollbar-track-piece {
  277. background: #e5e5e5;
  278. }
  279. ::-webkit-scrollbar {
  280. width: 6px;
  281. }
  282. ::-webkit-scrollbar-thumb {
  283. background: #ffffff;
  284. border-radius: 20px;
  285. }
  286. .topHint {
  287. padding: 0 10px;
  288. .top-text {
  289. width: 100%;
  290. line-height: 24px;
  291. background: rgba(255, 184, 94, 0.1);
  292. border: 1px solid #ffdeb4;
  293. border-radius: 2px;
  294. margin-top: 20px;
  295. padding: 10px;
  296. margin-bottom: 40px;
  297. font-size: 14px;
  298. color: #353535;
  299. span {
  300. color: #fb6161;
  301. }
  302. }
  303. }
  304. .online-edu {
  305. padding: 0 10px 30px 10px;
  306. .online-header {
  307. color: #fff;
  308. background: linear-gradient(90deg, #2abdb8, #2e99ce);
  309. text-align: center;
  310. border-radius: 4px;
  311. height: 50px;
  312. line-height: 50px;
  313. .header-desc {
  314. h3 {
  315. font-size: 14px;
  316. font-weight: normal;
  317. }
  318. }
  319. }
  320. }
  321. .header-price {
  322. padding: 20px 0 40px;
  323. background: #fff;
  324. border-radius: 4px;
  325. .price-view {
  326. text-align: center;
  327. h5 {
  328. color: #303133;
  329. span {
  330. font-size: 20px;
  331. font-weight: normal;
  332. }
  333. }
  334. p {
  335. color: #eee;
  336. margin-top: 10px;
  337. font-size: 14px;
  338. color: #888;
  339. }
  340. }
  341. .buy {
  342. margin-top: 15px;
  343. p {
  344. width: 210px;
  345. margin: 0 auto;
  346. cursor: pointer;
  347. font-size: 14px;
  348. padding: 10px 15px;
  349. text-align: center;
  350. border-radius: 4px;
  351. background: linear-gradient(90deg, #2abdb8, #2e99ce);
  352. color: #fff;
  353. }
  354. }
  355. }
  356. .config-process {
  357. width: 100%;
  358. padding-bottom: 60px;
  359. .process {
  360. display: -webkit-box;
  361. display: -ms-flexbox;
  362. display: flex;
  363. -webkit-box-align: flex-start;
  364. -ms-flex-align: flex-start;
  365. align-items: flex-start;
  366. padding-left: 0;
  367. width: 90%;
  368. margin: 0 auto;
  369. // height: 480px;
  370. // text-align: center;
  371. .items {
  372. list-style: none;
  373. box-shadow: 4px 4px 12px rgba(135, 135, 135, 0.15);
  374. margin: 0 10px;
  375. background: #fff;
  376. cursor: pointer;
  377. flex: 1;
  378. padding-bottom: 30px;
  379. .inner {
  380. display: -webkit-box;
  381. display: -ms-flexbox;
  382. display: flex;
  383. flex-direction: column;
  384. .name {
  385. font-size: 18px;
  386. color: #34495e;
  387. background: #e9f8f8;
  388. height:50px;
  389. line-height: 50px;
  390. border-top: 3px #2abdb8 solid;
  391. margin: 0;
  392. text-align: center;
  393. font-weight: bold;
  394. }
  395. .text {
  396. height: 166px;
  397. line-height: 22px;
  398. margin: 0;
  399. padding: 20px;
  400. display: flex;
  401. font-size: 15px;
  402. color: #353535;
  403. }
  404. .price{
  405. font-size: 32px;
  406. color: #383838;
  407. text-align: center;
  408. margin: 20px 0 10px 0;
  409. height: 36px;
  410. line-height: 36px;
  411. i{
  412. font-size:20px;
  413. }
  414. .year{
  415. font-size:18px;
  416. color: #999999;
  417. margin-left: 4px;
  418. }
  419. }
  420. .size{
  421. font-size:15px;
  422. color: #2abdb8;
  423. }
  424. .buy{
  425. font-size: 14px;
  426. text-align:center;
  427. width: 162px;
  428. height: 44px;
  429. line-height: 44px;
  430. color: #2abdb8;
  431. margin: 0 auto;
  432. border-radius: 30px;
  433. background: -webkit-gradient(linear, left top, right top, from(#2abdb8), to(#2e99ce));
  434. background: linear-gradient(90deg, #2abdb8, #2e99ce);
  435. color: #fff;
  436. &.active{
  437. background: #e9f8f8;
  438. color: #2abdb8;
  439. }
  440. }
  441. }
  442. }
  443. }
  444. }
  445. .purchaseCart {
  446. height: 60px;
  447. width: 100%;
  448. position: fixed;
  449. bottom: 0;
  450. left: 0;
  451. right: 0;
  452. border-top: 1px solid #eeeeee;
  453. padding-left: 160px;
  454. background-color: #ffffff;
  455. .content-part {
  456. height: 100%;
  457. width: 100%;
  458. padding-right: 40px;
  459. text-align: right;
  460. .chosen-service {
  461. display: inline-block;
  462. height: 60px;
  463. line-height: 60px;
  464. position: relative;
  465. margin-right: 30px;
  466. cursor: pointer;
  467. span {
  468. color: #fb6161;
  469. }
  470. .triangle {
  471. position: absolute;
  472. top: 25px;
  473. right: -15px;
  474. height: 0;
  475. width: 0;
  476. display: inline-block;
  477. border-bottom: 6px solid #c1c4ca;
  478. border-left: 5px solid transparent;
  479. border-right: 5px solid transparent;
  480. }
  481. }
  482. .total-price {
  483. display: inline-block;
  484. height: 60px;
  485. line-height: 60px;
  486. margin-right: 50px;
  487. span {
  488. color: #fb6161;
  489. }
  490. }
  491. .go-to-purchase {
  492. width: 86px;
  493. height: 36px;
  494. line-height: 36px;
  495. font-size: 14px;
  496. color: #ffffff;
  497. border: none;
  498. border-radius: 2px;
  499. text-align: center;
  500. user-select: none;
  501. background: #fb6161;
  502. }
  503. .go-to-purchase2 {
  504. width: 86px;
  505. height: 36px;
  506. line-height: 36px;
  507. font-size: 14px;
  508. color: #ffffff;
  509. border: none;
  510. border-radius: 2px;
  511. text-align: center;
  512. user-select: none;
  513. background: grey;
  514. }
  515. }
  516. .chosen-list-box {
  517. position: absolute;
  518. bottom: 65px;
  519. right: 45px;
  520. width: 510px;
  521. height: 300px;
  522. background: #fff;
  523. box-shadow: 0px 0 12px 0px rgba(0, 0, 0, 0.07),
  524. 0px 0px 4px 0px rgba(0, 0, 0, 0.05);
  525. border-radius: 2px;
  526. .box-title {
  527. width: 100%;
  528. height: 50px;
  529. line-height: 50px;
  530. padding: 0 20px;
  531. background: #f5f7fa;
  532. border-radius: 2px;
  533. .close-icon {
  534. width: 16px;
  535. height: 16px;
  536. float: right;
  537. margin: 17px 0 0;
  538. cursor: pointer;
  539. display: inline-block;
  540. background: url(../../assets/service/icon_Pop-ups_close.svg) center no-repeat;
  541. }
  542. }
  543. .chosen-list {
  544. height: 240px;
  545. width: 100%;
  546. padding: 10px 0 0 0;
  547. overflow-y: scroll;
  548. .service-item {
  549. height: 60px;
  550. width: 100%;
  551. margin-bottom: 10px;
  552. padding: 10px 0 10px 20px;
  553. line-height: 40px;
  554. font-size: 14px;
  555. position: relative;
  556. cursor: pointer;
  557. div {
  558. @include ellipsis;
  559. &.image {
  560. width: 40px;
  561. height: 40px;
  562. margin-right: 10px;
  563. img {
  564. width: 100%;
  565. height: 100%;
  566. float: left;
  567. }
  568. }
  569. &.name {
  570. color: #353535;
  571. width: 290px;
  572. }
  573. &.price {
  574. color: #353535;
  575. width: 130px;
  576. }
  577. }
  578. .delete-icon {
  579. display: none;
  580. width: 12px;
  581. height: 12px;
  582. position: absolute;
  583. top: 24px;
  584. right: 20px;
  585. background: url(../../assets/service/delete.png) center no-repeat;
  586. }
  587. &:hover {
  588. background: #f5f7fa;
  589. .delete-icon {
  590. display: block;
  591. }
  592. }
  593. }
  594. }
  595. }
  596. }
  597. </style>