priceComparison.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715
  1. <template>
  2. <view style="height: 100vh;position: relative;">
  3. <view class="page" id="panelcanvas">
  4. <image src="../../static/image/car-insure/bijiadan.png" mode=""
  5. style="width: 100%;height: 450px;position: absolute;"></image>
  6. <view class="content">
  7. <view class="price dis a-c j-c">
  8. <image src="../../static/image/car-insure/bijia.png" mode="" style="width: 20px;height: 20px;">
  9. </image>
  10. <text style="font-weight: bold;margin-left: 6px; font-size: 16px;">比价报价单</text>
  11. </view>
  12. <view
  13. style="background-color: #fff;border-radius:0 0 6px 6px ; box-shadow: 0px 4px 10px 0px rgba(123,160,239,0.2);"
  14. class="dis a-c j-c p-2 ">
  15. <view style="font-size: 15px;font-weight: bold;" class="dis j-s a-c ">
  16. <text style="color: #232832;">订单编号:{{insOrderVo.orderNo}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. <view style="padding:0 16px;position: relative;">
  21. <view class="information">
  22. <text class="title">车辆信息</text>
  23. <view class="dis j-s a-c">
  24. <text>车牌号:</text>
  25. <text>{{insOrderVo.licenseNo}}</text>
  26. </view>
  27. <view class="dis j-s a-c">
  28. <text>品牌型号:</text>
  29. <text>{{ insOrderVo.brandName}}</text>
  30. </view>
  31. <view class="dis j-s a-c">
  32. <text>发动机号:</text>
  33. <text>{{ insOrderVo.engineNo}}</text>
  34. </view>
  35. <view class="dis j-s a-c">
  36. <text>座位数:</text>
  37. <text>{{ insOrderVo.seatCount}}</text>
  38. </view>
  39. </view>
  40. <view class="information">
  41. <text class="title">人员信息</text>
  42. <view class="dis j-s a-c">
  43. <text>车主姓名:</text>
  44. <text>{{ insOrderVo.carOwnerName}}</text>
  45. </view>
  46. <view class="dis j-s a-c">
  47. <text>车主身份证号:</text>
  48. <text>{{ insOrderVo.ownerIdentifyNumber}}</text>
  49. </view>
  50. <view class="dis j-s a-c">
  51. <text>投保人姓名:</text>
  52. <text>{{ insOrderVo.applyName}}</text>
  53. </view>
  54. <view class="dis j-s a-c">
  55. <text>投保人身份证号:</text>
  56. <text>{{ insOrderVo.applyIdentifyNumber}}</text>
  57. </view>
  58. <view class="dis j-s a-c">
  59. <text>被保人姓名:</text>
  60. <text>{{ insOrderVo.insuredName}}</text>
  61. </view>
  62. <view class="dis j-s a-c">
  63. <text>被保人身份证号:</text>
  64. <text>{{ insOrderVo.insuredNumber}}</text>
  65. </view>
  66. </view>
  67. <view class="information">
  68. <text class="title">保费信息</text>
  69. <view class="dis j-start a-c">
  70. <text>交强起保日期:</text>
  71. <text>{{ insOrderVo.jqstartDate}}</text>
  72. </view>
  73. <view class="dis j-start a-c">
  74. <text>交强终保日期:</text>
  75. <text>{{ insOrderVo.jqendDate}}</text>
  76. </view>
  77. <view class="dis j-start a-c">
  78. <text>商业起保日期:</text>
  79. <text>{{ insOrderVo.systartDate}}</text>
  80. </view>
  81. <view class="dis j-start a-c">
  82. <text>商业终保日期:</text>
  83. <text>{{ insOrderVo.syendDate}}</text>
  84. </view>
  85. </view>
  86. <view class="information1" v-for="(item,index) in subOrderVos" :key="index">
  87. <view class="title dis a-c j-s">
  88. <text>{{item.companyName}}</text>
  89. <text>总保费¥{{item.sumpremium}}</text>
  90. </view>
  91. <view class="dis f-c" v-if="item.jqpremium">
  92. <view class="dis a-c j-s" style="margin-bottom: 5px;">
  93. <text>交强险:</text>
  94. <text>{{item.jqpremium}}</text>
  95. </view>
  96. <view class="dis f-c" style="background-color: #F9F9F9;border-radius: 10px;padding: 6px;">
  97. <view class="dis j-s a-c" style="border-bottom: 1px solid #f2f2f2;">
  98. <text style="color: rgba(35,40,50,0.8)">险别/名称</text>
  99. <text style="color: rgba(35,40,50,0.8)">保额</text>
  100. </view>
  101. <view class="dis j-s a-c" v-for="(jqInsuranceitem,jqInsuranceindex) in item.jqInsuranceType"
  102. :key="jqInsuranceindex" style="margin-top: 6px;">
  103. <text>{{jqInsuranceitem.name}}</text>
  104. <text>{{jqInsuranceitem.amount}}</text>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="dis j-s a-c" v-if="item.taxaMount">
  109. <text>车船税:</text>
  110. <text>{{ item.taxaMount}}</text>
  111. </view>
  112. <view class="dis f-c" v-if="item.sypremium">
  113. <view class="dis a-c j-s ">
  114. <text>商业险:</text>
  115. <text>{{ item.sypremium}}</text>
  116. </view>
  117. <view class=" dis j-s f-c p-2"
  118. style="border: none;background-color: #F9F9F9;border-radius: 10px;">
  119. <view class="dis j-s a-c" style="border-bottom: 1px solid #f2f2f2;">
  120. <view class="dis j-start" style="width: 50%;">
  121. <text style="color: rgba(35,40,50,0.8)">险别/名称</text>
  122. </view>
  123. <view class="dis j-c" style="width: 25%;">
  124. <text style="color: rgba(35,40,50,0.8)">保额</text>
  125. </view>
  126. <view class="dis j-end" style="width: 25%;">
  127. <text style="color: rgba(35,40,50,0.8)">保费(元)</text>
  128. </view>
  129. </view>
  130. <view class="coverage-sum dis j-s" v-for="(kindinfoitem,kindinfoindex) in item.kindinfo"
  131. :key="kindinfoindex" style="margin-top: 6px;">
  132. <view style="width: 50%;" class="dis a-c j-start">
  133. <text>{{kindinfoitem.kindName}}</text>
  134. </view>
  135. <view style="width: 25%;" class="dis a-c j-c"
  136. v-if="['D4', 'SY_FJ_YBW2'].includes(kindinfoitem.kindCode)">
  137. <text>{{kindinfoitem.unitAmount}}/座*{{insOrderVo.seatCount-1}}</text>
  138. </view>
  139. <view style="width: 25%;" class="dis a-c j-c"
  140. v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(kindinfoitem.kindCode)">
  141. <text>{{kindinfoitem.deductibleRate}}</text>
  142. </view>
  143. <view style="width: 25%;" class="dis a-c j-c"
  144. v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(kindinfoitem.kindCode)">
  145. <text>{{kindinfoitem.serviceTimes}}/次</text>
  146. </view>
  147. <view style="width: 25%;" class="dis a-c j-c" v-else>
  148. <text>{{kindinfoitem.amount}}</text>
  149. </view>
  150. <view style="width: 25%;" class="dis a-c j-end">
  151. <text>¥{{kindinfoitem.coveragePremium}}</text>
  152. </view>
  153. </view>
  154. </view>
  155. </view>
  156. <view class="dis f-c" v-if="item.jypremium">
  157. <view class="dis a-c j-s">
  158. <text>附加险:意外险</text>
  159. <text>{{ item.jypremium}}</text>
  160. </view>
  161. <view class=" dis j-s f-c p-2" v-if="item.accidentInfo.length>0"
  162. style="border: none;background-color: #F9F9F9;border-radius: 10px;">
  163. <view class="dis j-s a-c" style="border-bottom: 1px solid #f2f2f2;">
  164. <view class="dis j-start" style="width: 50%;">
  165. <text style="color: rgba(35,40,50,0.8)">险别/名称</text>
  166. </view>
  167. <view class="dis j-c" style="width: 25%;">
  168. <text style="color: rgba(35,40,50,0.8)">保额</text>
  169. </view>
  170. <view class="dis j-end" style="width: 25%;">
  171. <text style="color: rgba(35,40,50,0.8)">保费(元)</text>
  172. </view>
  173. </view>
  174. <view class="coverage-sum dis j-s"
  175. v-for="(accidentInfoitem,accidentInfoindex) in item.accidentInfo"
  176. :key="accidentInfoindex" style="margin-top: 6px;">
  177. <view style="width: 50%;" class="dis a-c j-start">
  178. <text>{{accidentInfoitem.name}}</text>
  179. </view>
  180. <view style="width: 25%;" class="dis a-c j-c">
  181. <text>{{accidentInfoitem.amount}}</text>
  182. </view>
  183. <view style="width: 25%;" class="dis a-c j-c">
  184. <text>{{accidentInfoitem.premium}}</text>
  185. </view>
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. <view class="information2">
  191. <view class="dis j-s a-c" v-for="(item,index) in parityPriceVo" :key="index">
  192. <view class="dis j-c a-c p-1" v-for="(items,indexs) in item" :key="indexs">{{items}}</view>
  193. </view>
  194. </view>
  195. <view class="massage dis a-c j-start">
  196. <image src="../../static/image/car-insure/jianyitoubao.png" mode=""
  197. style="width: 105px;height: 25px;"></image>
  198. <text>{{companyName}}, 报价最低!</text>
  199. </view>
  200. </view>
  201. </view>
  202. <view class="fixed-bottom">
  203. <u-button type="primary" style="background-color:#23C1CB;" @tap="sendPayCode">发送微信</u-button>
  204. </view>
  205. </view>
  206. </template>
  207. <script>
  208. import {
  209. mapState,
  210. mapMutations
  211. } from 'vuex';
  212. import {
  213. pathToBase64,
  214. base64ToPath
  215. } from '@/common/pdf.js'
  216. export default {
  217. data() {
  218. return {
  219. texts: [],
  220. payImg: "",
  221. posterUrl: "",
  222. show: false,
  223. insOrderVo: {},
  224. subOrderVos: [],
  225. parityPriceVo: [],
  226. companyName: "",
  227. }
  228. },
  229. computed: {
  230. ...mapState(["userLoginId"])
  231. },
  232. async onLoad(options) {
  233. let item = JSON.parse(options.subOrderNoslist);
  234. let params = {
  235. subOrderNos: item,
  236. }
  237. let res = await this.$http.post('/insurance/order/getInquiryDetalsBySubOrderNos', params);
  238. if (res.code == '200') {
  239. res.data.subOrderVos.map(val => {
  240. val.kindinfo.map((ele, index) => {
  241. switch (ele.kindCode) {
  242. case "A":
  243. if (ele.amount == 1) {
  244. ele.amount = "投保"
  245. } else {
  246. ele.amount = ele.amount
  247. }
  248. break;
  249. case "D4":
  250. case "SY_FJ_YBW2":
  251. ele.unitAmount = this.toChinesNum(ele.unitAmount);
  252. break;
  253. case "MJ1":
  254. case "MJ2":
  255. case "MJ3":
  256. case "MJ4":
  257. ele.deductibleRate = ele.deductibleRate + "%";
  258. break;
  259. default:
  260. ele.amount = this.toChinesNum(ele.amount);
  261. }
  262. return ele;
  263. });
  264. })
  265. this.companyName = res.data.companyName;
  266. this.insOrderVo = res.data.insOrderVo;
  267. this.subOrderVos = res.data.subOrderVos;
  268. this.parityPriceVo = res.data.parityPriceVo;
  269. }
  270. },
  271. methods: {
  272. //页面返回按钮
  273. back() {
  274. uni.navigateBack({
  275. delta: 1, // 返回的页面数,如果是1表示返回上一页
  276. success: function() {}
  277. });
  278. },
  279. //分享图片到微信
  280. sendPayCode() {
  281. if (this.payImg) {
  282. uni.share({
  283. provider: "weixin",
  284. scene: "WXSceneSession",
  285. type: 2,
  286. imageUrl: this.payImg
  287. })
  288. }
  289. },
  290. toChinesNum(num) {
  291. let overWan = Math.floor(num / 10000);
  292. let result = overWan + "万";
  293. return result;
  294. },
  295. //页面截图转路径
  296. receiveRenderData(val) {
  297. this.posterUrl = val.replace(/[\r\n]/g, ''); // 去除base64位中的空格
  298. const imageStr = this.posterUrl;
  299. // 将base64转化为临时地址
  300. base64ToPath(imageStr).then(path => {
  301. this.payImg = path
  302. }).catch(error => {});
  303. },
  304. showLoading() {
  305. uni.showLoading({
  306. title: '正在生成图片'
  307. });
  308. },
  309. hideLoading() {
  310. uni.hideLoading();
  311. },
  312. },
  313. }
  314. </script>
  315. <script module="canvasImage" lang="renderjs">
  316. import html2canvas from 'html2canvas'
  317. export default {
  318. data() {
  319. return {
  320. }
  321. },
  322. mounted() {
  323. // #ifdef APP-PLUS
  324. setTimeout(() => {
  325. this.canvasImage.generateImage()
  326. }, 1000);
  327. // #endif
  328. },
  329. methods: {
  330. // #ifdef APP-PLUS
  331. generateImage() {
  332. setTimeout(() => {
  333. this.$ownerInstance.callMethod('showLoading')
  334. const dom = document.getElementById('panelcanvas') // 需要生成图片内容的 dom 节点
  335. html2canvas(dom, {
  336. width: dom.clientWidth, //dom 原始宽度
  337. height: dom.clientHeight,
  338. scrollY: 0, // html2canvas默认绘制视图内的页面,需要把scrollY,scrollX设置为0
  339. scrollX: 0,
  340. useCORS: true, //支持跨域
  341. // allowTaint: false,
  342. scale: 3, // 设置生成图片的像素比例,默认是1,如果生成的图片模糊的话可以开启该配置项
  343. }).then((canvas) => {
  344. // 生成成功
  345. this.$ownerInstance.callMethod('hideLoading')
  346. this.$ownerInstance.callMethod('receiveRenderData', canvas.toDataURL('image/png'))
  347. }).catch(err => {
  348. // 生成失败 弹出提示弹窗
  349. this.$ownerInstance.callMethod('_errAlert', `【生成图片失败,请重试】${err}`)
  350. })
  351. }, 300)
  352. }
  353. // #endif
  354. },
  355. }
  356. </script>
  357. <style lang="scss" scoped>
  358. @import '@/style/mixin.scss';
  359. .page {
  360. background-color: #F8FEFE;
  361. padding-bottom: 100px;
  362. box-sizing: border-box;
  363. }
  364. .massage {
  365. width: 100%;
  366. height: 41px;
  367. background: linear-gradient(90deg, #FFDCCD 0%, #FFF1EE 100%);
  368. border-radius: 0px 0px 6px 6px;
  369. padding: 10px;
  370. text {
  371. font-size: 15px;
  372. font-weight: bold;
  373. color: #FF5600;
  374. margin-left: 10px;
  375. }
  376. }
  377. .fixed-bottom {
  378. position: fixed;
  379. bottom: 0;
  380. width: 100%;
  381. height: 62px;
  382. background-color: #FFFFFF;
  383. padding: 16px;
  384. box-shadow: 0px -4px 10px 0px #DAE3F4;
  385. border-radius: 0px 0px 0px 0px;
  386. }
  387. .content {
  388. width: 100%;
  389. height: auto;
  390. padding: 16px 16px 0;
  391. position: relative;
  392. .price {
  393. width: 100%;
  394. height: 40px;
  395. background: #FFFFFF;
  396. border-radius: 6px 6px 0px 0px;
  397. }
  398. }
  399. .information {
  400. width: 100%;
  401. height: auto;
  402. background-color: #fff;
  403. box-shadow: 0px 4px 10px 0px rgba(35, 193, 203, 0.2);
  404. border-radius: 6px;
  405. margin-top: 10px;
  406. padding: 10px 10px 0;
  407. >view {
  408. padding: 10px 0;
  409. border-bottom: 1px solid #f2f2f2;
  410. text {
  411. font-size: 14px;
  412. color: #232832;
  413. }
  414. }
  415. .title {
  416. font-size: 15px;
  417. color: #232832;
  418. font-weight: bold;
  419. }
  420. :last-child {
  421. border: none;
  422. }
  423. }
  424. .information1 {
  425. width: 100%;
  426. height: auto;
  427. background-color: #fff;
  428. box-shadow: 0px 4px 10px 0px rgba(35, 193, 203, 0.2);
  429. border-radius: 6px;
  430. margin-top: 10px;
  431. >view {
  432. padding: 10px;
  433. border-bottom: 1px solid #f2f2f2;
  434. text {
  435. font-size: 14px;
  436. color: #232832;
  437. }
  438. }
  439. >view:first-child {
  440. border: none;
  441. background-color: #DCF5F6;
  442. border-radius: 6px 6px 0 0;
  443. text:nth-child(1) {
  444. font-weight: bold;
  445. color: #232832;
  446. font-size: 14px;
  447. }
  448. text:nth-child(2) {
  449. font-weight: bold;
  450. color: #088F98;
  451. font-size: 14px;
  452. }
  453. }
  454. :last-child {
  455. border: none;
  456. }
  457. }
  458. .information2 {
  459. width: 100%;
  460. height: auto;
  461. background-color: #fff;
  462. box-shadow: 0px 4px 10px 0px rgba(35, 193, 203, 0.2);
  463. border-radius: 6px;
  464. margin-top: 10px;
  465. >view {
  466. view {
  467. width: 25%;
  468. font-size: 14px;
  469. color: #232832;
  470. }
  471. }
  472. >view:first-child {
  473. border: none;
  474. background-color: #DCF5F6;
  475. border-radius: 6px 6px 0 0;
  476. font-weight: bold;
  477. }
  478. .title {
  479. font-size: 15px;
  480. color: #232832;
  481. font-weight: bold;
  482. }
  483. :last-child {
  484. border: none;
  485. }
  486. }
  487. .Basic-information {
  488. background-color: white;
  489. width: 100%;
  490. height: auto;
  491. .basic-logo {
  492. padding: 10px 16px;
  493. border-bottom: 1px solid #f2f2f2;
  494. image {
  495. width: 50px;
  496. height: 50px;
  497. margin-right: 20px;
  498. }
  499. text {
  500. font-size: 12px;
  501. }
  502. text:first-child {
  503. font-weight: bold;
  504. font-size: 18px;
  505. }
  506. }
  507. .basic-data {
  508. padding: 16px;
  509. .arrange {
  510. margin: 4px 0;
  511. font-size: 14px;
  512. text:first-child {
  513. font-weight: bold;
  514. margin-right: 5px;
  515. }
  516. text:last-child {
  517. color: #606266;
  518. }
  519. &::before {
  520. content: "·";
  521. color: #606266;
  522. margin-right: 10px;
  523. font-weight: bold;
  524. }
  525. }
  526. }
  527. .bjdCarSum {
  528. padding: 10px 16px;
  529. border-bottom: 1px solid #f2f2f2;
  530. font-weight: bold;
  531. font-size: 14px;
  532. }
  533. .coverage {
  534. padding: 10px 16px;
  535. .coverage-title {
  536. width: 100%;
  537. view:first-child {
  538. border-top-left-radius: 8px;
  539. }
  540. view:last-child {
  541. border-top-right-radius: 8px;
  542. }
  543. view:nth-child(2) {
  544. border-left: none;
  545. border-right: none;
  546. }
  547. view {
  548. width: 33.33%;
  549. text-align: center;
  550. background: #ff8f63;
  551. color: #fff;
  552. padding: 6px 16px;
  553. border: 1px solid #fff;
  554. font-size: 12px;
  555. box-sizing: border-box;
  556. }
  557. }
  558. .coverage-sum {
  559. width: 100%;
  560. view {
  561. font-size: 12px;
  562. padding: 6px 16px;
  563. }
  564. }
  565. }
  566. }
  567. .Circle {
  568. position: relative;
  569. &::before {
  570. display: block;
  571. content: "";
  572. position: absolute;
  573. width: 10px;
  574. height: 10px;
  575. background: #92b5fe;
  576. top: -5px;
  577. left: -15px;
  578. border-radius: 50%;
  579. }
  580. &::after {
  581. content: "";
  582. position: absolute;
  583. width: 10px;
  584. height: 10px;
  585. background: #92b5fe;
  586. top: -5px;
  587. right: -15px;
  588. border-radius: 50%;
  589. }
  590. }
  591. .footer-button {
  592. z-index: 9999;
  593. margin-top: 20px;
  594. position: fixed;
  595. bottom: 0;
  596. width: 100%;
  597. background: white;
  598. padding: 10px 20px;
  599. button {
  600. width: 70%;
  601. cursor: pointer;
  602. }
  603. }
  604. .tip {
  605. width: 100%;
  606. background-color: #fff;
  607. border-radius: 10upx;
  608. font-size: 32upx;
  609. font-weight: bold;
  610. margin: 0 auto;
  611. padding: 20px;
  612. box-sizing: border-box;
  613. position: fixed;
  614. bottom: 0;
  615. }
  616. /* 底部的样式Start */
  617. .infoBottom {
  618. height: 140upx;
  619. position: fixed;
  620. bottom: 0;
  621. left: 0;
  622. right: 0;
  623. background: #ea552d;
  624. border-top: 1upx solid #ea552d;
  625. z-index: 99;
  626. margin-top: 100px;
  627. }
  628. .infoBottom>button {
  629. // font-size: 30upx;
  630. background: #fff;
  631. color: #333;
  632. flex: 1;
  633. margin: 0upx 30px;
  634. font-weight: bold;
  635. }
  636. /* 底部的样式End */
  637. .watermark {
  638. position: fixed;
  639. top: 50%;
  640. left: 50%;
  641. transform: translate(-50%, -50%);
  642. font-size: 24px;
  643. color: rgba(0, 0, 0, 0.3);
  644. pointer-events: none;
  645. z-index: 9999;
  646. }
  647. </style>