priceComparison.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  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" v-if="insOrderVo.jqstartDate">
  70. <text>交强起保日期:</text>
  71. <text>{{ insOrderVo.jqstartDate}}</text>
  72. </view>
  73. <view class="dis j-start a-c" v-if="insOrderVo.jqendDate">
  74. <text>交强终保日期:</text>
  75. <text>{{ insOrderVo.jqendDate}}</text>
  76. </view>
  77. <view class="dis j-start a-c" v-if="insOrderVo.systartDate">
  78. <text>商业起保日期:</text>
  79. <text>{{ insOrderVo.systartDate}}</text>
  80. </view>
  81. <view class="dis j-start a-c" v-if="insOrderVo.syendDate">
  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"
  193. :class="{ 'active': items.flag == true, 'active1': items.yzhFlag == true }"
  194. v-for="(items,indexs) in item" :key="indexs">{{items.value}}
  195. </view>
  196. </view>
  197. </view>
  198. <view class="massage dis a-c j-start">
  199. <image src="../../static/image/car-insure/jianyitoubao.png" mode=""
  200. style="width: 105px;height: 25px;"></image>
  201. <text>{{companyName}}, 报价最低!</text>
  202. </view>
  203. </view>
  204. </view>
  205. <view class="fixed-bottom">
  206. <u-button type="primary" style="background-color:#23C1CB;" @tap="sendPayCode">发送微信</u-button>
  207. </view>
  208. </view>
  209. </template>
  210. <script>
  211. import {
  212. mapState,
  213. mapMutations
  214. } from 'vuex';
  215. import {
  216. pathToBase64,
  217. base64ToPath
  218. } from '@/common/pdf.js'
  219. export default {
  220. data() {
  221. return {
  222. texts: [],
  223. payImg: "",
  224. posterUrl: "",
  225. show: false,
  226. insOrderVo: {},
  227. subOrderVos: [],
  228. parityPriceVo: [],
  229. companyName: "",
  230. }
  231. },
  232. computed: {
  233. ...mapState(["userLoginId"])
  234. },
  235. async onLoad(options) {
  236. let item = JSON.parse(options.subOrderNoslist);
  237. let params = {
  238. subOrderNos: item,
  239. }
  240. let res = await this.$http.post('/insurance/order/getInquiryDetalsBySubOrderNos', params);
  241. console.log(res);
  242. if (res.code == '200') {
  243. res.data.subOrderVos.map(val => {
  244. val.kindinfo.map((ele, index) => {
  245. switch (ele.kindCode) {
  246. case "A":
  247. if (ele.amount == 1) {
  248. ele.amount = "投保"
  249. } else {
  250. ele.amount = ele.amount
  251. }
  252. break;
  253. case "D4":
  254. case "SY_FJ_YBW2":
  255. ele.unitAmount = this.toChinesNum(ele.unitAmount);
  256. break;
  257. case "MJ1":
  258. case "MJ2":
  259. case "MJ3":
  260. case "MJ4":
  261. ele.deductibleRate = ele.deductibleRate + "%";
  262. break;
  263. default:
  264. ele.amount = this.toChinesNum(ele.amount);
  265. }
  266. return ele;
  267. });
  268. })
  269. this.companyName = res.data.companyName;
  270. this.insOrderVo = res.data.insOrderVo;
  271. this.subOrderVos = res.data.subOrderVos;
  272. this.parityPriceVo = res.data.parityPriceVo;
  273. }
  274. },
  275. methods: {
  276. //页面返回按钮
  277. back() {
  278. uni.navigateBack({
  279. delta: 1, // 返回的页面数,如果是1表示返回上一页
  280. success: function() {}
  281. });
  282. },
  283. //分享图片到微信
  284. sendPayCode() {
  285. if (this.payImg) {
  286. uni.share({
  287. provider: "weixin",
  288. scene: "WXSceneSession",
  289. type: 2,
  290. imageUrl: this.payImg
  291. })
  292. }
  293. },
  294. toChinesNum(num) {
  295. let overWan = Math.floor(num / 10000);
  296. let result = overWan + "万";
  297. return result;
  298. },
  299. //页面截图转路径
  300. receiveRenderData(val) {
  301. this.posterUrl = val.replace(/[\r\n]/g, ''); // 去除base64位中的空格
  302. const imageStr = this.posterUrl;
  303. // 将base64转化为临时地址
  304. base64ToPath(imageStr).then(path => {
  305. this.payImg = path
  306. }).catch(error => {});
  307. },
  308. showLoading() {
  309. uni.showLoading({
  310. title: '正在生成图片'
  311. });
  312. },
  313. hideLoading() {
  314. uni.hideLoading();
  315. },
  316. },
  317. }
  318. </script>
  319. <script module="canvasImage" lang="renderjs">
  320. import html2canvas from 'html2canvas'
  321. export default {
  322. data() {
  323. return {
  324. }
  325. },
  326. mounted() {
  327. // #ifdef APP-PLUS
  328. setTimeout(() => {
  329. this.canvasImage.generateImage()
  330. }, 1000);
  331. // #endif
  332. },
  333. methods: {
  334. // #ifdef APP-PLUS
  335. generateImage() {
  336. setTimeout(() => {
  337. this.$ownerInstance.callMethod('showLoading')
  338. const dom = document.getElementById('panelcanvas') // 需要生成图片内容的 dom 节点
  339. html2canvas(dom, {
  340. width: dom.clientWidth, //dom 原始宽度
  341. height: dom.clientHeight,
  342. scrollY: 0, // html2canvas默认绘制视图内的页面,需要把scrollY,scrollX设置为0
  343. scrollX: 0,
  344. useCORS: true, //支持跨域
  345. // allowTaint: false,
  346. scale: 3, // 设置生成图片的像素比例,默认是1,如果生成的图片模糊的话可以开启该配置项
  347. }).then((canvas) => {
  348. // 生成成功
  349. this.$ownerInstance.callMethod('hideLoading')
  350. this.$ownerInstance.callMethod('receiveRenderData', canvas.toDataURL('image/png'))
  351. }).catch(err => {
  352. // 生成失败 弹出提示弹窗
  353. this.$ownerInstance.callMethod('_errAlert', `【生成图片失败,请重试】${err}`)
  354. })
  355. }, 300)
  356. }
  357. // #endif
  358. },
  359. }
  360. </script>
  361. <style lang="scss" scoped>
  362. @import '@/style/mixin.scss';
  363. .page {
  364. background-color: #F8FEFE;
  365. padding-bottom: 100px;
  366. box-sizing: border-box;
  367. }
  368. .active {
  369. background-color: #FFF5F3;
  370. }
  371. .active1 {
  372. color: #FF5600 !important;
  373. font-weight: bold;
  374. }
  375. .massage {
  376. width: 100%;
  377. height: 41px;
  378. background: linear-gradient(90deg, #FFDCCD 0%, #FFF1EE 100%);
  379. border-radius: 0px 0px 6px 6px;
  380. padding: 10px;
  381. text {
  382. font-size: 15px;
  383. font-weight: bold;
  384. color: #FF5600;
  385. margin-left: 10px;
  386. }
  387. }
  388. .fixed-bottom {
  389. position: fixed;
  390. bottom: 0;
  391. width: 100%;
  392. height: 62px;
  393. background-color: #FFFFFF;
  394. padding: 16px;
  395. box-shadow: 0px -4px 10px 0px #DAE3F4;
  396. border-radius: 0px 0px 0px 0px;
  397. }
  398. .content {
  399. width: 100%;
  400. height: auto;
  401. padding: 16px 16px 0;
  402. position: relative;
  403. .price {
  404. width: 100%;
  405. height: 40px;
  406. background: #FFFFFF;
  407. border-radius: 6px 6px 0px 0px;
  408. }
  409. }
  410. .information {
  411. width: 100%;
  412. height: auto;
  413. background-color: #fff;
  414. box-shadow: 0px 4px 10px 0px rgba(35, 193, 203, 0.2);
  415. border-radius: 6px;
  416. margin-top: 10px;
  417. padding: 10px 10px 0;
  418. >view {
  419. padding: 10px 0;
  420. border-bottom: 1px solid #f2f2f2;
  421. text {
  422. font-size: 14px;
  423. color: #232832;
  424. }
  425. }
  426. .title {
  427. font-size: 15px;
  428. color: #232832;
  429. font-weight: bold;
  430. }
  431. :last-child {
  432. border: none;
  433. }
  434. }
  435. .information1 {
  436. width: 100%;
  437. height: auto;
  438. background-color: #fff;
  439. box-shadow: 0px 4px 10px 0px rgba(35, 193, 203, 0.2);
  440. border-radius: 6px;
  441. margin-top: 10px;
  442. >view {
  443. padding: 10px;
  444. border-bottom: 1px solid #f2f2f2;
  445. text {
  446. font-size: 14px;
  447. color: #232832;
  448. }
  449. }
  450. >view:first-child {
  451. border: none;
  452. background-color: #DCF5F6;
  453. border-radius: 6px 6px 0 0;
  454. text:nth-child(1) {
  455. font-weight: bold;
  456. color: #232832;
  457. font-size: 14px;
  458. }
  459. text:nth-child(2) {
  460. font-weight: bold;
  461. color: #088F98;
  462. font-size: 14px;
  463. }
  464. }
  465. :last-child {
  466. border: none;
  467. }
  468. }
  469. .information2 {
  470. width: 100%;
  471. height: auto;
  472. background-color: #fff;
  473. box-shadow: 0px 4px 10px 0px rgba(35, 193, 203, 0.2);
  474. border-radius: 6px;
  475. margin-top: 10px;
  476. >view {
  477. view {
  478. width: 25%;
  479. font-size: 14px;
  480. color: #232832;
  481. }
  482. }
  483. >view:first-child {
  484. border: none;
  485. background-color: #DCF5F6;
  486. border-radius: 6px 6px 0 0;
  487. font-weight: bold;
  488. }
  489. .title {
  490. font-size: 15px;
  491. color: #232832;
  492. font-weight: bold;
  493. }
  494. :last-child {
  495. border: none;
  496. }
  497. }
  498. .Basic-information {
  499. background-color: white;
  500. width: 100%;
  501. height: auto;
  502. .basic-logo {
  503. padding: 10px 16px;
  504. border-bottom: 1px solid #f2f2f2;
  505. image {
  506. width: 50px;
  507. height: 50px;
  508. margin-right: 20px;
  509. }
  510. text {
  511. font-size: 12px;
  512. }
  513. text:first-child {
  514. font-weight: bold;
  515. font-size: 18px;
  516. }
  517. }
  518. .basic-data {
  519. padding: 16px;
  520. .arrange {
  521. margin: 4px 0;
  522. font-size: 14px;
  523. text:first-child {
  524. font-weight: bold;
  525. margin-right: 5px;
  526. }
  527. text:last-child {
  528. color: #606266;
  529. }
  530. &::before {
  531. content: "·";
  532. color: #606266;
  533. margin-right: 10px;
  534. font-weight: bold;
  535. }
  536. }
  537. }
  538. .bjdCarSum {
  539. padding: 10px 16px;
  540. border-bottom: 1px solid #f2f2f2;
  541. font-weight: bold;
  542. font-size: 14px;
  543. }
  544. .coverage {
  545. padding: 10px 16px;
  546. .coverage-title {
  547. width: 100%;
  548. view:first-child {
  549. border-top-left-radius: 8px;
  550. }
  551. view:last-child {
  552. border-top-right-radius: 8px;
  553. }
  554. view:nth-child(2) {
  555. border-left: none;
  556. border-right: none;
  557. }
  558. view {
  559. width: 33.33%;
  560. text-align: center;
  561. background: #ff8f63;
  562. color: #fff;
  563. padding: 6px 16px;
  564. border: 1px solid #fff;
  565. font-size: 12px;
  566. box-sizing: border-box;
  567. }
  568. }
  569. .coverage-sum {
  570. width: 100%;
  571. view {
  572. font-size: 12px;
  573. padding: 6px 16px;
  574. }
  575. }
  576. }
  577. }
  578. .Circle {
  579. position: relative;
  580. &::before {
  581. display: block;
  582. content: "";
  583. position: absolute;
  584. width: 10px;
  585. height: 10px;
  586. background: #92b5fe;
  587. top: -5px;
  588. left: -15px;
  589. border-radius: 50%;
  590. }
  591. &::after {
  592. content: "";
  593. position: absolute;
  594. width: 10px;
  595. height: 10px;
  596. background: #92b5fe;
  597. top: -5px;
  598. right: -15px;
  599. border-radius: 50%;
  600. }
  601. }
  602. .footer-button {
  603. z-index: 9999;
  604. margin-top: 20px;
  605. position: fixed;
  606. bottom: 0;
  607. width: 100%;
  608. background: white;
  609. padding: 10px 20px;
  610. button {
  611. width: 70%;
  612. cursor: pointer;
  613. }
  614. }
  615. .tip {
  616. width: 100%;
  617. background-color: #fff;
  618. border-radius: 10upx;
  619. font-size: 32upx;
  620. font-weight: bold;
  621. margin: 0 auto;
  622. padding: 20px;
  623. box-sizing: border-box;
  624. position: fixed;
  625. bottom: 0;
  626. }
  627. /* 底部的样式Start */
  628. .infoBottom {
  629. height: 140upx;
  630. position: fixed;
  631. bottom: 0;
  632. left: 0;
  633. right: 0;
  634. background: #ea552d;
  635. border-top: 1upx solid #ea552d;
  636. z-index: 99;
  637. margin-top: 100px;
  638. }
  639. .infoBottom>button {
  640. // font-size: 30upx;
  641. background: #fff;
  642. color: #333;
  643. flex: 1;
  644. margin: 0upx 30px;
  645. font-weight: bold;
  646. }
  647. /* 底部的样式End */
  648. .watermark {
  649. position: fixed;
  650. top: 50%;
  651. left: 50%;
  652. transform: translate(-50%, -50%);
  653. font-size: 24px;
  654. color: rgba(0, 0, 0, 0.3);
  655. pointer-events: none;
  656. z-index: 9999;
  657. }
  658. </style>