entry.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. <template>
  2. <view class="body">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <public-module></public-module>
  5. <!-- 轮播图 -->
  6. <swiper-image :resdata="swiperList"></swiper-image>
  7. <!-- 车牌信息输入区域Start -->
  8. <view style="background-color: #FFFFFF;">
  9. <view class="licenseNoEnter">
  10. <view class="row entryTitle d-flex a-center j-sb">
  11. <view class="left">车险投保</view>
  12. <view class="right"><text>*</text>仅支持9座以下家庭自用车投保</view>
  13. </view>
  14. <view class="row entryLicenseNo d-flex a-center">
  15. <text class="left">车牌号码</text>
  16. <view class="middle d-flex a-center">
  17. <input placeholder="请点此输入" @tap="plateShow=true" v-model.trim="licenseNo" />
  18. <plate-input v-if="plateShow" :plate="licenseNo" @export="setPlate" @close="plateShow=false" />
  19. </view>
  20. <view class="right">
  21. <switch :checked="noLicence" @click="licencePlate" style="transform:scale(0.5)"></switch>
  22. </view>
  23. </view>
  24. <view class="agree d-flex a-center">
  25. <!-- <label @click="agreed">
  26. <checkbox :checked="agree" />本人已阅读并同意
  27. </label>
  28. <label @click="baoxin">
  29. <checkbox :checked="baoxinqudao" />保信渠道
  30. </label> -->
  31. </view>
  32. <view class="insureBtn d-flex a-center j-sb">
  33. <button class="main-bg-color" type="primary" @click="generalGetCarInfo">普通投保</button>
  34. </view>
  35. </view>
  36. </view>
  37. <!-- 车牌信息输入区域End -->
  38. <view class="pane">
  39. <view class="paneHeader d-flex a-center">
  40. <view class="titleBefore"></view>
  41. <text class="title">保险专区</text>
  42. </view>
  43. <view class="ads d-flex a-center">
  44. <view class="flex-1 d-flex a-center j-center">
  45. <image src="/static/image/car-insure/tools1.png" mode="widthFix" lazy-load></image>
  46. </view>
  47. <view class="flex-1 d-flex a-center j-center">
  48. <image src="/static/image/car-insure/tools2.png" mode="widthFix" lazy-load></image>
  49. </view>
  50. </view>
  51. </view>
  52. <view class="pane">
  53. <view class="paneHeader d-flex a-center">
  54. <view class="titleBefore"></view>
  55. <text class="title">小工具</text>
  56. </view>
  57. <view class="ads d-flex a-center">
  58. <view class="d-flex a-center j-center flex-1">
  59. 操作指南
  60. </view>
  61. <view class="d-flex a-center j-center flex-1">
  62. 常见问题
  63. </view>
  64. </view>
  65. </view>
  66. <view class="pane">
  67. <view class="paneHeader d-flex a-center">
  68. <text style="font-size: 26upx; font-weight: bold;">实时报案</text>
  69. </view>
  70. <marquee broadcastType='mould' :viewHeight="170" direction="left" :broadcastStyle='broadcastStyle'
  71. :touchEvent="true" style="width: 100%">
  72. <view v-for="(item,ind) in companyList" :key="ind" class="img_item2 u-f-ajc u-f-column"
  73. @tap="mobileCall(item.mobile)">
  74. <image :src="item.src" mode=""></image>
  75. <view class="imageTitle">{{item.name}}</view>
  76. </view>
  77. </marquee>
  78. </view>
  79. </view>
  80. </template>
  81. <script>
  82. import marquee from '@/components/modules/carInsure/marquee/marquee.vue'
  83. import plateInput from '@/components/modules/carInsure/uni-plate-input/uni-plate-input.vue';
  84. import swiperImage from "@/components/modules/index/swiper-image.vue"
  85. export default {
  86. components: {
  87. swiperImage,
  88. marquee,
  89. plateInput
  90. },
  91. data() {
  92. return {
  93. companyList: [{
  94. src: "/static/image/company/picc.png",
  95. name: "人保财险",
  96. mobile: "95518"
  97. },
  98. {
  99. src: "/static/image/company/huanong.png",
  100. name: "华农财险",
  101. mobile: "95540"
  102. },
  103. {
  104. src: "/static/image/company/hengbang.png",
  105. name: "恒邦财险",
  106. mobile: "4009895999"
  107. },
  108. {
  109. src: "/static/image/company/taiping.png",
  110. name: "太平财险",
  111. mobile: "95589"
  112. },
  113. {
  114. src: "/static/image/company/taipingyang.png",
  115. name: "太平洋财险",
  116. mobile: "95500"
  117. },
  118. {
  119. src: "/static/image/company/zhongmei.png",
  120. name: "中煤财险",
  121. mobile: "4006536388"
  122. },
  123. {
  124. src: "/static/image/company/guoren.png",
  125. name: "国任财险",
  126. mobile: "4008667788"
  127. },
  128. {
  129. src: "/static/image/company/zhonghua.png",
  130. name: "中华财险",
  131. mobile: "95585"
  132. },
  133. {
  134. src: "/static/image/company/guoshou.png",
  135. name: "国寿财险",
  136. mobile: "95519"
  137. }
  138. ],
  139. // 轮播图数据Start
  140. swiperList: [],
  141. // 轮播图数据Start
  142. licenseNo: "",
  143. plateShow: false,
  144. noLicence: false,
  145. agree: false,
  146. baoxinqudao: false,
  147. broadcastStyle: {
  148. speed: 40, //每秒100px
  149. },
  150. }
  151. },
  152. // 监听导航栏的按钮
  153. onNavigationBarButtonTap(e) {
  154. if (e.index == 0) {
  155. this.navigate({
  156. url: '/pages/index/index'
  157. }, "switchTab", true);
  158. }
  159. },
  160. async onLoad() {
  161. let banner = await this.$http.get('/apps/getCarousel');
  162. this.swiperList = banner.data;
  163. },
  164. methods: {
  165. setPlate(plate) {
  166. if (plate.length >= 7) this.licenseNo = plate
  167. this.plateShow = false
  168. },
  169. // 未上牌照
  170. licencePlate() {
  171. if (this.noLicence == false) {
  172. this.licenseNo = "******";
  173. this.noLicence = true;
  174. } else {
  175. this.licenseNo = "";
  176. this.noLicence = false;
  177. }
  178. },
  179. //阅读并同意协议
  180. agreed() {
  181. if (this.agree == false) {
  182. this.agree = true;
  183. } else {
  184. this.agree = false;
  185. }
  186. },
  187. //报信渠道
  188. baoxin() {
  189. if (this.baoxinqudao == false) {
  190. this.baoxinqudao = true;
  191. } else {
  192. this.baoxinqudao = false;
  193. }
  194. },
  195. // 校验车牌号
  196. islicense(val) {
  197. let mPattern = /^[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领A-Z]{1}[A-Z]{1}[A-Z0-9]{4,5}[A-Z0-9挂学警港澳]{1}$/;
  198. return mPattern.test(val);
  199. },
  200. //普通投保
  201. generalGetCarInfo() {
  202. if (!this.noLicence && !this.islicense(this.licenseNo)) {
  203. return uni.showToast({
  204. icon: "none",
  205. title: '请填写正确的车牌号码',
  206. duration: 1500
  207. });
  208. }
  209. // if (this.agree == false) {
  210. // return uni.showToast({
  211. // icon: "none",
  212. // title: '请阅读并同意协议',
  213. // duration: 1500
  214. // });
  215. // }
  216. this.navigate({
  217. url: "/pages/carInsure1/carInfo1?licenseNo=" + encodeURIComponent(this.licenseNo)
  218. }, "navigateTo", true)
  219. // this.navigate({
  220. // url: "/pages/carInsure1/quote1?licenseNo=" + encodeURIComponent(this.licenseNo)
  221. // }, "navigateTo", true)
  222. },
  223. // 电话咨询
  224. mobileCall(mobile) {
  225. uni.makePhoneCall({
  226. phoneNumber: mobile,
  227. success: () => {
  228. console.log("成功拨打电话")
  229. }
  230. })
  231. },
  232. }
  233. }
  234. </script>
  235. <style>
  236. .body {
  237. max-width: 750upx;
  238. min-height: 100vh;
  239. background: #f5f5f5;
  240. font-size: 26upx;
  241. font-family: "Arial,Helvetica,sans-serif,PingFangSC";
  242. }
  243. /* 车牌信息输入区域Start */
  244. .licenseNoEnter {
  245. padding: 30upx 15upx;
  246. position: relative;
  247. top: -24upx;
  248. background: rgba(255, 255, 255, 0.4);
  249. width: 600upx;
  250. margin: 0 auto;
  251. box-shadow: 0px 0px 8px 1.5px #ddd;
  252. border-radius: 10upx;
  253. }
  254. .row {
  255. padding: 0upx 10upx;
  256. height: 80upx;
  257. border-bottom: 1px solid #F9F7F7;
  258. }
  259. .entryTitle {
  260. margin-top: 20upx;
  261. }
  262. .entryTitle .left {
  263. font-weight: bold;
  264. }
  265. .entryTitle .right {
  266. color: #6091f5;
  267. font-size: 24upx;
  268. }
  269. .entryTitle .right text {
  270. color: red;
  271. }
  272. .entryCity .left,
  273. .entryLicenseNo .left {
  274. width: 120upx;
  275. margin-right: 40upx;
  276. flex-shrink: 0;
  277. }
  278. .entryCity .right {
  279. overflow: hidden;
  280. text-overflow: ellipsis;
  281. white-space: nowrap;
  282. }
  283. .entryLicenseNo .middle .uni-input {
  284. margin-right: 10upx;
  285. padding: 0;
  286. }
  287. .entryLicenseNo .middle input {
  288. width: 180upx;
  289. font-size: 28upx;
  290. }
  291. .agree {
  292. margin: 20upx 0 40upx;
  293. font-size: 24upx;
  294. }
  295. .agree checkbox {
  296. color: "#FFCC33";
  297. transform: scale(0.6);
  298. }
  299. .insureBtn button {
  300. flex: 1;
  301. color: #FFFFFF;
  302. margin: 0 30upx;
  303. font-size: 30upx;
  304. background: #337ab7;
  305. }
  306. /* 车牌信息输入区域End */
  307. /* 保险专区和小工具Start */
  308. .pane {
  309. margin-top: 20upx;
  310. padding: 10upx 25upx;
  311. background-color: #FFFFFF;
  312. }
  313. .paneHeader {
  314. height: 60upx;
  315. }
  316. .paneHeader .titleBefore {
  317. width: 10upx;
  318. background: #6091f5;
  319. height: 50%;
  320. margin: 0 20upx 0 10upx;
  321. }
  322. .paneHeader .title {
  323. font-size: 32upx;
  324. font-weight: bold;
  325. }
  326. .pane .ads {
  327. padding: 10upx 10upx;
  328. margin-bottom: 20upx;
  329. }
  330. .pane .ads>view {
  331. flex: 1;
  332. margin: 0upx 10upx;
  333. }
  334. .pane .ads>view image {
  335. width: 100%;
  336. }
  337. /* 保险专区和小工具End */
  338. .img_item2 {
  339. width: 100upx;
  340. height: 120upx;
  341. padding: 10px;
  342. }
  343. .img_item2 image {
  344. width: 70upx;
  345. height: 70upx;
  346. box-sizing: border-box;
  347. }
  348. .img_item2 .imageTitle {
  349. font-size: 22upx;
  350. width: 100upx;
  351. overflow: hidden;
  352. text-overflow: ellipsis;
  353. white-space: nowrap;
  354. }
  355. </style>