checkOption.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  1. <template>
  2. <view class="page">
  3. <view class="" style="padding-bottom: 70px;">
  4. <view class="selectedCoverage dis j-s a-c">
  5. <view class="productName dis a-c j-c">
  6. <image src="../../static/image/car-insure/duigou.png" mode=""></image>
  7. <text>{{productName}}</text>
  8. </view>
  9. <view class="productName dis a-c j-c" style="border-radius: 6px;">
  10. <text style="margin: 0;">已选险种</text>
  11. </view>
  12. </view>
  13. <view class="planDetails">
  14. <image src="../../static/image/car-insure/yixuanchanpin.png" mode="" style="height: 22px;width: 88px;"
  15. class="mb-1"></image>
  16. <view class="Plancontent dis f-c " style="padding:0;"
  17. v-if="['0330','0330034002','0330034001'].includes(productId)">
  18. <view class="dis j-s a-c">
  19. <image src="../../static/image/car-insure/jqrisk.png" mode="" style="height: 22px;width: 88px;"
  20. class="mb-1"></image>
  21. <u-button type="primary" style="background: linear-gradient(90deg, #FF4D4D 0%, #FF784D 100%);"
  22. size="mini" @click="jqterms">交强条款</u-button>
  23. </view>
  24. <text style="margin-left: 10px;">{{jqstartDate}}-{{jqendDate}} </text>
  25. <u-table border-color="#E3E9F8">
  26. <u-tr class="jq">
  27. <u-th width="70%" style="text-align: left;padding: 5px 10px !important;">保险产品
  28. </u-th>
  29. <u-th>总计(元) </u-th>
  30. </u-tr>
  31. <u-tr class="jq">
  32. <u-td width="70%" style="text-align: left;padding: 5px 10px !important;">
  33. <view class="dis a-c">
  34. <view class="circle dis a-c j-c"></view>
  35. <text style="margin-left: 10px;"> 交通事故强制责任险</text>
  36. </view>
  37. </u-td>
  38. <u-td>{{item.result.jqPremium?'¥'+item.result.jqPremium:'-'}}</u-td>
  39. </u-tr>
  40. </u-table>
  41. </view>
  42. <view class="Plancontent dis j-s " style="padding:0;">
  43. <image src="../../static/image/car-insure/chechuanshui.png" mode=""
  44. style="height: 22px;width: 88px;" class="mb-1"></image>
  45. <text>{{taxRelifFlag}}</text>
  46. </view>
  47. <view class="Plancontent dis f-c " style="padding: 0;"
  48. v-if="['034001','034002','0330034002','0330034001'].includes(productId)">
  49. <view class="dis j-s a-c">
  50. <image src="../../static/image/car-insure/syrisk.png" mode="" style="height: 22px;width: 88px;"
  51. class="mb-1"></image>
  52. <u-button type="primary" style="background: linear-gradient(90deg, #FF4D4D 0%, #FF784D 100%);"
  53. size="mini" @click="syterms">商业条款</u-button>
  54. </view>
  55. <text style="margin-left: 10px;">{{systartDate}}-{{syendDate}} </text>
  56. <u-table border-color="#E3E9F8" v-if="item.insurancePlanInfo.kinds.length>0">
  57. <u-tr class="sy">
  58. <u-th width="50%" style="text-align: left;padding: 5px 10px !important">险种
  59. </u-th>
  60. <u-th>保额 </u-th>
  61. <u-th>保费(元) </u-th>
  62. </u-tr>
  63. <u-tr v-for="(item,index) in item.insurancePlanInfo.kinds" :key="index">
  64. <u-td width="50%" style="text-align: left;padding: 5px 10px !important">
  65. <view class="dis a-c">
  66. <view class="circle dis a-c j-c"></view>
  67. <text style="margin-left: 10px;">{{item.kindName}}</text>
  68. </view>
  69. </u-td>
  70. <u-td v-if="['A'].includes(item.kindCode)">{{item.amount!='1'?item.amount:'投保'}}</u-td>
  71. <u-td
  72. v-else-if="['D4', 'SY_FJ_YBW2'].includes(item.kindCode)">{{convertedValue(item.unitAmount)}}</u-td>
  73. <u-td
  74. v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(item.kindCode)">{{item.deductibleRate}}%</u-td>
  75. <u-td
  76. v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(item.kindCode)">{{item.serviceTimes}}次</u-td>
  77. <u-td v-else>{{convertedValue(item.amount)}}</u-td>
  78. <u-td>{{item.coveragePremium?item.coveragePremium:'-'}}</u-td>
  79. </u-tr>
  80. </u-table>
  81. </view>
  82. <view class="Plancontent dis f-c " style="padding: 0;"
  83. v-if=" item.insurancePlanInfo.drivingList && item.insurancePlanInfo.drivingList.length>0 ">
  84. <image src="../../static/image/car-insure/ywrisk.png" mode="" style="height: 22px;width: 88px;"
  85. class="mb-1"></image>
  86. <view class="policyInfo" v-for="(drivingsitem,risksindex) in item.insurancePlanInfo.drivingList"
  87. :key="risksindex">
  88. <text class="tagHeader dis a-c">
  89. <text>{{drivingsitem.alias}}
  90. <view class="tag"></view>
  91. </text>
  92. </text>
  93. <u-table border-color="#E3E9F8" class="mt-2"
  94. v-if="drivingsitem.insDrivingIntentionInsuranceSon && drivingsitem.insDrivingIntentionInsuranceSon.length>0">
  95. <u-tr class="sy">
  96. <u-th width="50%" style="text-align: left;padding: 5px 10px !important">保险责任</u-th>
  97. <u-th>保额</u-th>
  98. <u-th>保费(元)</u-th>
  99. </u-tr>
  100. <view class="dis">
  101. <view class="accident dis f-c">
  102. <view class="diss dis"
  103. v-for="(Sonitem,Sonindex) in drivingsitem.insDrivingIntentionInsuranceSon"
  104. :key="Sonindex">
  105. <view style="width: 67%;padding: 5px 10px " class="boss">
  106. <view class="dis a-c ">
  107. <view class="circle dis a-c j-c"></view>
  108. <view style="margin-left: 5px;width: 80%;" class="dis j-start">
  109. {{Sonitem.name}}
  110. </view>
  111. </view>
  112. </view>
  113. <view class="boss dis a-c j-c" style="width: 33%;">
  114. {{Sonitem.amount}}
  115. </view>
  116. </view>
  117. </view>
  118. <view class="right dis j-c a-c">
  119. {{drivingsitem.sumPremium}}
  120. </view>
  121. </view>
  122. </u-table>
  123. <u-table border-color="#E3E9F8" v-if="drivingsitem.alias">
  124. <u-tr class="sy">
  125. <u-th>座位数</u-th>
  126. <u-th>每份</u-th>
  127. <u-th>份数</u-th>
  128. <u-th>总计</u-th>
  129. </u-tr>
  130. <u-tr>
  131. <u-td>{{seatCount}}</u-td>
  132. <u-td>{{drivingsitem.sumPremium}}/每份</u-td>
  133. <u-td>{{drivingsitem.quantity}}份</u-td>
  134. <u-td>{{drivingsitem.sumPremium * drivingsitem.quantity}}</u-td>
  135. </u-tr>
  136. </u-table>
  137. </view>
  138. </view>
  139. <view class="Plancontent dis f-c policyInfo " style="padding: 0;"
  140. v-if="item.editingDto && item.result.jyPremium && item.insurancePlanInfo.drivingList.length==0 ">
  141. <image src="../../static/image/car-insure/ywrisk.png" mode="" style="height: 22px;width: 88px;"
  142. class="mb-1"></image>
  143. <view class=" ">
  144. <text class="tagHeader dis a-c" v-if="item.result.jyName">
  145. <text>{{item.result.jyName}}
  146. <view class="tag"></view>
  147. </text>
  148. </text>
  149. <u-table border-color="#E3E9F8" v-if="item.result.jyName">
  150. <u-tr class="sy">
  151. <u-th>座位数</u-th>
  152. <u-th>每份</u-th>
  153. <u-th>份数</u-th>
  154. <u-th>总计</u-th>
  155. </u-tr>
  156. <u-tr>
  157. <u-td>{{seatCount}}</u-td>
  158. <u-td>{{item.result.jyPremium / item.result.jyQuantity}}/每份</u-td>
  159. <u-td>{{item.result.jyQuantity}}份</u-td>
  160. <u-td>{{item.result.jyPremium}}</u-td>
  161. </u-tr>
  162. </u-table>
  163. </view>
  164. </view>
  165. </view>
  166. </view>
  167. </view>
  168. </template>
  169. <script>
  170. export default {
  171. data() {
  172. return {
  173. productId: "", //险种id
  174. productName: "", //险种名称
  175. jqstartDate: "",
  176. jqendDate: "",
  177. systartDate: "",
  178. syendDate: "",
  179. seatCount: "",
  180. taxRelifFlag: "",
  181. item: {},
  182. }
  183. },
  184. onShow() {
  185. },
  186. async onLoad() {
  187. const eventChannel = this.getOpenerEventChannel()
  188. // 监听acceptData事件,获取上一页面通过eventChannel传送到当前页面的数据
  189. await eventChannel.on('acceptData', (data) => {
  190. console.log(data);
  191. this.item = data.item;
  192. this.jqstartDate = data.jqstartDate;
  193. this.jqendDate = data.jqendDate;
  194. this.systartDate = data.systartDate;
  195. this.syendDate = data.syendDate;
  196. this.productName = data.productName;
  197. this.productId = data.productId;
  198. this.seatCount = data.seatNum;
  199. this.taxRelifFlag = data.taxRelifFlag;
  200. })
  201. },
  202. methods: {
  203. convertedValue(num) {
  204. if (num < 10000) {
  205. return num.toString();
  206. } else if (num < 100000000) {
  207. return (Math.floor(num / 10000 * 10) / 10) + '万';
  208. } else {
  209. return (Math.floor(num / 100000000 * 10) / 10) + '亿';
  210. }
  211. },
  212. jqterms() {
  213. let file = 'https://sxzgkj.baoxianzhanggui.com/web-api/upload/specification/commercialInsurance.pdf';
  214. //#ifdef APP-PLUS
  215. uni.showLoading({
  216. title: '正在打开'
  217. });
  218. let dtask = plus.downloader.createDownload(file, {
  219. filename: "_downloads/" + '交强条款.pdf'
  220. }, function(d, status) {
  221. if (status == 200) {
  222. uni.hideLoading()
  223. //下载成功,d.filename是文件在保存在本地的相对路径,使用下面的API可转为平台绝对路径
  224. let fileSaveUrl = plus.io.convertLocalFileSystemURL(d.filename);
  225. plus.runtime.openFile(d.filename); //选择软件打开文件
  226. } else {
  227. uni.hideLoading()
  228. //下载失败
  229. plus.downloader.clear(); //清除下载任务
  230. }
  231. })
  232. dtask.start();
  233. //#endif
  234. //#ifdef H5
  235. var win = window.open();
  236. win.document.write(
  237. '<body style="margin:0px;"><object data="' +
  238. file +
  239. '" type="application/pdf" width="100%" height="100%"><iframe src="' +
  240. file +
  241. '" scrolling="no" width="100%" height="100%" frameborder="0" ></iframe></object></body>'
  242. );
  243. //#endif
  244. },
  245. syterms() {
  246. let file = 'https://sxzgkj.baoxianzhanggui.com/web-api/upload/specification/compulsoryInsurance.pdf';
  247. //#ifdef APP-PLUS
  248. uni.showLoading({
  249. title: '正在打开'
  250. });
  251. let dtask = plus.downloader.createDownload(file, {
  252. filename: "_downloads/" + '商业条款.pdf'
  253. }, function(d, status) {
  254. if (status == 200) {
  255. uni.hideLoading()
  256. //下载成功,d.filename是文件在保存在本地的相对路径,使用下面的API可转为平台绝对路径
  257. let fileSaveUrl = plus.io.convertLocalFileSystemURL(d.filename);
  258. plus.runtime.openFile(d.filename); //选择软件打开文件
  259. } else {
  260. uni.hideLoading()
  261. //下载失败
  262. plus.downloader.clear(); //清除下载任务
  263. }
  264. })
  265. dtask.start();
  266. //#endif
  267. //#ifdef H5
  268. var win = window.open();
  269. win.document.write(
  270. '<body style="margin:0px;"><object data="' +
  271. file +
  272. '" type="application/pdf" width="100%" height="100%"><iframe src="' +
  273. file +
  274. '" scrolling="no" width="100%" height="100%" frameborder="0" ></iframe></object></body>'
  275. );
  276. //#endif
  277. },
  278. }
  279. }
  280. </script>
  281. <style lang="scss" scoped>
  282. .page {
  283. background: #F8FAFE;
  284. height: 100vh;
  285. padding: 16px 16px 16px 16px;
  286. }
  287. .selectedCoverage {
  288. width: 100%;
  289. background: linear-gradient(90deg, #CCE5FE 0%, #D4EDFF 100%);
  290. border-radius: 6px 6px 0px 0px;
  291. padding: 8px 6px;
  292. .productName {
  293. padding: 1px 6px;
  294. background: linear-gradient(90deg, #64A4F0 0%, #0052FF 100%);
  295. border-radius: 6px 6px 6px 0px;
  296. image {
  297. width: 16px;
  298. height: 16px;
  299. }
  300. text {
  301. color: #fff;
  302. font-size: 16px;
  303. margin-left: 10px;
  304. }
  305. }
  306. }
  307. .planDetails {
  308. background-color: #fff;
  309. box-shadow: 0px 4px 10px 0px #DAE3F4;
  310. border-radius: 6px;
  311. padding: 8px;
  312. .policyInfo {
  313. .tagHeader {
  314. font-family: Source Han Sans SC, Source Han Sans SC;
  315. text {
  316. position: relative;
  317. font-weight: bold;
  318. font-size: 13px;
  319. color: #333;
  320. }
  321. .tag {
  322. position: absolute;
  323. left: 0;
  324. bottom: -1px;
  325. width: 50%;
  326. height: 5px;
  327. background: linear-gradient(90deg, #0874FF 0%, rgba(8, 116, 255, 0) 100%);
  328. border-radius: 6px;
  329. }
  330. }
  331. .accident {
  332. width: 75%;
  333. .diss {
  334. border-bottom: 1px solid #E3E9F8;
  335. .boss {
  336. border-right: 1px solid #E3E9F8;
  337. text-align: center;
  338. padding: 5px 3px;
  339. }
  340. }
  341. }
  342. .right {
  343. width: 25%;
  344. border-right: 1px solid #E3E9F8;
  345. border-bottom: 1px solid #E3E9F8;
  346. padding: 5px 3px;
  347. }
  348. }
  349. }
  350. .Plancontent {
  351. .Accident {
  352. width: 100%;
  353. border: 1px solid #0874FF;
  354. border-radius: 6px;
  355. overflow: hidden;
  356. .head {
  357. width: 20%;
  358. height: 40px;
  359. background-color: #0874FF;
  360. color: #FFFFFF;
  361. &:nth-child(1) {
  362. width: 60%;
  363. }
  364. }
  365. .tr {
  366. width: 20%;
  367. height: 60px;
  368. color: #232832;
  369. border: 1rpx solid #0874FF;
  370. font-size: 24rpx;
  371. color: #232832;
  372. &:nth-child(1) {
  373. width: 60%;
  374. background: rgba(8, 116, 255, 0.05);
  375. }
  376. &:nth-child(3) {
  377. background: rgba(8, 116, 255, 0.05);
  378. }
  379. }
  380. }
  381. .insuranceType {
  382. margin: 5px 10px;
  383. background: #F2F6FF;
  384. border-radius: 10px;
  385. }
  386. .terms {
  387. color: #FFFFFF;
  388. background: linear-gradient(90deg, #FF4D4D 0%, #FF784D 100%);
  389. border-radius: 4px 4px 4px 4px;
  390. }
  391. }
  392. ::deep {
  393. .jq {
  394. .u-th {
  395. background: #EBF7FF;
  396. padding: 5px 10px !important;
  397. }
  398. .u-td {
  399. padding: 5px 10px !important;
  400. }
  401. }
  402. .sy {
  403. .u-th {
  404. background: #EBF7FF;
  405. }
  406. }
  407. }
  408. </style>