index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. <template>
  2. <view class="content">
  3. <view class="topBox"></view>
  4. <view class="yuanhu"></view>
  5. <view class="shoptopbox2" v-if="!carInfo">
  6. <view class="carinfoBox2">
  7. <view class="carinfoBoxNocar" @click="addCar">
  8. <img src="../../static/timg/addcar.png" alt="" class="carinfonocarIcon">
  9. <view class="carinfoBoxNocarRight">
  10. <view class="carinfoBoxNocarRightTitle">添加我的爱车</view>
  11. <view class="carinfoBoxNocarRightMS">按照车型推荐合适的商品</view>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. <view class="shoptopbox" v-if="carInfo">
  17. <view class="carinfoBox" >
  18. <view class="carinfoBoxTop">
  19. <img :src="carInfo.brandLogo" alt="" class="carLogo" v-if="carInfo.brandLogo">
  20. <img src="../../static/timg/nocar.png" alt="" class="carLogo" v-else>
  21. <view class="carinfoBoxTopCont">
  22. <view class="carinfoBoxTopContTop">
  23. <view class="carInfoplateNumber">{{carInfo.plateNumber}}</view>
  24. <view class="carTnfomilage">{{carInfo.milage}}km</view>
  25. </view>
  26. <view class="carInfocarModel" v-if="carInfo.carModel">{{carInfo.carModel}}</view>
  27. <view class="carInfocarModel" v-else>暂无</view>
  28. </view>
  29. <view class="carinfoBoxTopRight" @click="changeCar">
  30. <img src="../../static/timg/icon_change@2x.png" alt="" class="carinfoBoxTopRightIcon">
  31. <view class="huancheBtn">换车</view>
  32. </view>
  33. </view>
  34. <view class="carInfoBottom">
  35. <view class="carInfoBottomLine">
  36. <view class="carInfoBottomLineTitle">下次保养里程</view>
  37. <view class="carInfoBottomLineTxt" v-if="carInfo.nextCareMilage">{{carInfo.nextCareMilage}}</view>
  38. <view class="carInfoBottomLineTxt" v-else>暂无</view>
  39. </view>
  40. <view class="carInfoBottomLine">
  41. <view class="carInfoBottomLineTitle">下次保养日期</view>
  42. <view class="carInfoBottomLineTxt" v-if="carInfo.nextCareDate">{{carInfo.nextCareDate.slice(0,10)}}</view>
  43. <view class="carInfoBottomLineTxt" v-else>暂无</view>
  44. </view>
  45. <view class="carInfoBottomLine">
  46. <view class="carInfoBottomLineTitle">保养手册</view>
  47. <view class="carInfoBottomLineTxt" @click="information">点击查看</view>
  48. </view>
  49. </view>
  50. </view>
  51. </view>
  52. <!-- 服务顾问 -->
  53. <view class="adviser">
  54. <view class="adviserLeft">
  55. <img src="../../static/timg/pic_def_ava@2x.png" alt="" class="advisertx">
  56. <view class="adviserNema">张三</view>
  57. <view class="adviserms">服务顾问</view>
  58. </view>
  59. <img src="../../static/timg/icon_arrow_right.png" alt="" class="adviserJt">
  60. </view>
  61. <!-- 中间轮播模块 -->
  62. <view class="modular">
  63. <swiper class="swiper" circular :autoplay="false" :interval="interval"
  64. :duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
  65. <swiper-item>
  66. <view class="swiper-item">
  67. <view class="itemLine">
  68. <view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
  69. <view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
  70. </view>
  71. <view class="itemLine">
  72. <view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
  73. <view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
  74. </view>
  75. <view class="itemLine">
  76. <view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
  77. <view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
  78. </view>
  79. <view class="itemLine">
  80. <view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
  81. <view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
  82. </view>
  83. <view class="itemLine">
  84. <view><img src="../../static/img/icon_allorder.png" alt="" class="itemImg"></view>
  85. <view class="Menusline" @click="goRoter('onlineBooking')">在线预约</view>
  86. </view>
  87. </view>
  88. </swiper-item>
  89. <swiper-item>
  90. <view class="swiper-item">
  91. </view>
  92. </swiper-item>
  93. </swiper>
  94. </view>
  95. <view class="advertisement">
  96. <swiper class="swiper2" circular :autoplay="false" :interval="interval"
  97. :duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
  98. <swiper-item>
  99. <view class="swiper-item2">
  100. <image class="swiper-item2Img" src="http://phone.66km.cn:8088/thFiles/C678448A-C874-4B42-9EAE-4F8F21D71D27.jpg" mode=""></image>
  101. </view>
  102. </swiper-item>
  103. <swiper-item>
  104. <view class="swiper-item2">
  105. <image class="swiper-item2Img" src="http://phone.66km.cn:8088/thFiles/C678448A-C874-4B42-9EAE-4F8F21D71D27.jpg" mode=""></image>
  106. </view>
  107. </swiper-item>
  108. </swiper>
  109. </view>
  110. <!-- 热门活动 -->
  111. <view class="Hot">
  112. <view class="hotTop">
  113. <view class="hotLeft">
  114. <view class="hotSx"></view>
  115. <view class="hottitle">热门活动</view>
  116. </view>
  117. <view class="hotRight">
  118. <view class="hotMore">更多</view>
  119. <img src="../../static/timg/icon_arrow_right.png" alt="" class="hotMoreJt">
  120. </view>
  121. </view>
  122. <view class="hotLine">
  123. <view class="hotLineTop">
  124. <image class="hotLineTopImg" src="http://phone.66km.cn:8088/thFiles/C678448A-C874-4B42-9EAE-4F8F21D71D27.jpg" mode=""></image>
  125. <view class="hotlineTimebox">
  126. <view class="hotlinestate1">进行中</view>
  127. <view class="hotTime">2022.01.21-2022.02.14</view>
  128. </view>
  129. </view>
  130. <view class="hotName">博世 7月促【CX-200715003】</view>
  131. </view>
  132. <view class="hotLine">
  133. <view class="hotLineTop">
  134. <image class="hotLineTopImg" src="http://phone.66km.cn:8088/thFiles/C678448A-C874-4B42-9EAE-4F8F21D71D27.jpg" mode=""></image>
  135. <view class="hotlineTimebox">
  136. <view class="hotlinestate2">未开始</view>
  137. <view class="hotTime">2022.01.21-2022.02.14</view>
  138. </view>
  139. </view>
  140. <view class="hotName">博世 7月促【CX-200715003】</view>
  141. </view>
  142. </view>
  143. <!-- 热门商品 -->
  144. <view class="Hot">
  145. <view class="hotTop">
  146. <view class="hotLeft">
  147. <view class="hotSx"></view>
  148. <view class="hottitle">热门商品</view>
  149. </view>
  150. <view class="hotRight">
  151. <view class="hotMore">更多</view>
  152. <img src="../../static/timg/icon_arrow_right.png" alt="" class="hotMoreJt">
  153. </view>
  154. </view>
  155. <view class="hotGoodsLine" v-for="(item,index) in 5">
  156. <view>
  157. <image src="../../static/timg/nocar.png" mode="" class="hotGoodsLineImg"></image>
  158. </view>
  159. <view class="hotGoodsLineRIght">
  160. <view class="goodsName">德国马牌 Continental 全新升级6代 TechContct德国马牌 Continental 全新升级6代 TechContct</view>
  161. <view class="Sold">已售 999</view>
  162. <view class="goodsPrice">
  163. <view class="goodsPrice1">店庆价</view>
  164. <view class="goodsPrice2">¥</view>
  165. <view class="goodsPrice3">999</view>
  166. <view class="goodsPrice3">¥893</view>
  167. </view>
  168. </view>
  169. </view>
  170. </view>
  171. <view style="height: 60rpx;"></view>
  172. <!-- <view @getphonenumber="decryptPhoneNumber" >shopId:{{shopId}}</view>
  173. <button type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">获取手机号</button> -->
  174. </view>
  175. </template>
  176. <script>
  177. export default {
  178. data() {
  179. return {
  180. shopId: '',
  181. url:'',
  182. wxOpenData:'',
  183. code:'',
  184. carInfo:{
  185. plateNumber:11,
  186. milage:'3222',
  187. carModel:'奥迪',
  188. }
  189. }
  190. },
  191. onLoad() {
  192. var that=this;
  193. this.$common.getExtStoreId()
  194. var ext=this.$common.getExtStoreId();
  195. console.log(ext)
  196. this.shopId=ext.shopId;
  197. this.url=ext.url;
  198. uni.setStorage({
  199. key: 'extdata',
  200. data: {
  201. shopId:'E37BB296-5A08-4534-859D-B351BA611AF9',
  202. },
  203. success: function () {
  204. that.uniLogin()
  205. }
  206. });
  207. this.uniLogin()
  208. },
  209. methods: {
  210. information(){
  211. },
  212. changeCar(){
  213. },
  214. goRoter(url){
  215. uni.navigateTo({
  216. url:url
  217. })
  218. },
  219. decryptPhoneNumber: function(e) {
  220. console.log(e);
  221. this.code=e.detail.code
  222. this.wxPhoneLogin()
  223. },
  224. wxgologin(){
  225. var that=this;
  226. uni.getUserProfile({
  227. lang:'zh_CN',
  228. desc:'登录',
  229. success:(res)=>{
  230. console.log(res);
  231. that.wxdata=res;
  232. uni.setStorage({
  233. key: 'wxdata',
  234. data: res,
  235. success: function () {
  236. that.uniLogin()
  237. }
  238. });
  239. },
  240. fail:(res)=>{
  241. console.log(res)
  242. }
  243. });
  244. },
  245. uniLogin(){
  246. var that=this;
  247. uni.login({
  248. provider: 'weixin',
  249. success: function (loginRes) {
  250. console.log(loginRes);
  251. that.getWxOpenID(loginRes)
  252. }
  253. });
  254. },
  255. getWxOpenID(e){
  256. var that=this;
  257. // this.code=e.code;
  258. this.$http('miniApp2/sys/getWxOpenID', {
  259. code:e.code,
  260. shopId:'E37BB296-5A08-4534-859D-B351BA611AF9'
  261. },'GET').then(res => {
  262. this.wxOpenData=res.data;
  263. //that.wxPhoneLogin()
  264. uni.setStorage({
  265. key: 'wxOpenData',
  266. data: that.wxOpenData,
  267. success: function () {
  268. // that.uniLogin()
  269. }
  270. });
  271. if(this.wxOpenData.loginInfo){
  272. uni.setStorage({
  273. key: 'userInfo',
  274. data: that.wxOpenData.loginInfo.openUser,
  275. success: function () {
  276. // that.uniLogin()
  277. }
  278. });
  279. }
  280. })
  281. },
  282. wxPhoneLogin(){
  283. var that=this;
  284. this.$http('miniApp2/sys/wxPhoneLogin', {
  285. appId:'wx33053a645546ec31',
  286. shopId:'E37BB296-5A08-4534-859D-B351BA611AF9',
  287. code:this.code,
  288. openId:this.wxOpenData.openid
  289. },'POST').then(res => {
  290. var data = res.data;
  291. if(data.loginInfo){
  292. uni.setStorage({
  293. key: 'userInfo',
  294. data: data.loginInfo.openUser,
  295. success: function () {
  296. // that.uniLogin()
  297. }
  298. });
  299. }
  300. })
  301. }
  302. }
  303. }
  304. </script>
  305. <style scoped>
  306. .content{
  307. min-height: 100vh;
  308. background: #F4F5F7;
  309. }
  310. .topBox{
  311. width: 750rpx;
  312. height: 200rpx;
  313. background: #D53533;
  314. }
  315. .yuanhu{
  316. width: 750rpx;
  317. height: 50rpx;
  318. background: #D53533;
  319. border-radius: 0 0 100% 100%;
  320. }
  321. .carinfoBox{
  322. width: 702rpx;
  323. height: 250rpx;
  324. background: #FFFFFF;
  325. border-radius: 10rpx;
  326. margin-left: 24rpx;
  327. overflow: hidden;
  328. }
  329. .carinfoBox2{
  330. width: 702rpx;
  331. height: 180rpx;
  332. background: #FFFFFF;
  333. border-radius: 10rpx;
  334. margin-left: 24rpx;
  335. overflow: hidden;
  336. }
  337. .carinfoBox .carLogo{
  338. width: 72rpx;height: 72rpx;
  339. }
  340. .carinfoBoxTop{
  341. display: flex;
  342. justify-content: space-between;
  343. padding-top: 29rpx;
  344. padding-left: 24rpx;
  345. padding-right: 20rpx;
  346. padding-bottom: 24rpx;
  347. border: 1px solid #EEEEEE;
  348. }
  349. .carinfoBoxTopCont{
  350. width: 454rpx;
  351. }
  352. .carinfoBoxTopContTop{
  353. display: flex;
  354. }
  355. .carInfoplateNumber{
  356. font-weight: 500;
  357. color: #3C3C3C;
  358. font-size: 30rpx;
  359. line-height: 42rpx;
  360. padding-right: 16rpx;
  361. }
  362. .carTnfomilage{
  363. color: #F19D01;
  364. font-size: 22rpx;
  365. padding: 0rpx 10rpx;
  366. border-radius: 4rpx;
  367. border: 1px solid #F19D01;
  368. height: 32rpx;
  369. line-height: 34rpx;
  370. margin-top: 2rpx;
  371. margin-left: 2rpx;
  372. }
  373. .carInfocarModel{
  374. width: 454rpx;
  375. color: #666666;
  376. font-size: 26rpx;
  377. white-space: nowrap;
  378. overflow: hidden;
  379. text-overflow: ellipsis;
  380. }
  381. .carinfoBoxTopRight{
  382. display: flex;padding-top: 25rpx;
  383. }
  384. .carinfoBoxTopRightIcon{
  385. width: 29rpx;
  386. height: 31rpx;
  387. }
  388. .huancheBtn{
  389. color: #666666; font-size: 26rpx;line-height: 31rpx;
  390. padding-left: 10rpx;
  391. }
  392. .carInfoBottom{
  393. display: flex;
  394. justify-content: space-around;
  395. }
  396. .carInfoBottomLineTitle{
  397. color: #999999;font-size: 24rpx;
  398. text-align: center;
  399. padding-top: 24rpx;
  400. }
  401. .carInfoBottomLineTxt{
  402. color: #3C3C3C;
  403. font-size: 26rpx;
  404. padding-top: 5rpx;
  405. text-align: center;
  406. }
  407. .carinfonocarIcon{
  408. width: 72rpx;
  409. height: 72rpx;
  410. }
  411. .carinfoBoxNocar{
  412. display: flex;
  413. padding-top: 50rpx;
  414. padding-left: 20rpx;
  415. }
  416. .carinfoBoxNocarRightTitle{
  417. font-weight: 500;
  418. color: #3C3C3C;
  419. font-size: 30rpx;
  420. }
  421. .carinfoBoxNocarRightMS{
  422. color: #666666;
  423. font-size: 26rpx;
  424. }
  425. .carinfoBoxNocarRight{
  426. padding-left: 24rpx;
  427. }
  428. .shoptopbox{
  429. margin-top: -200rpx;
  430. }
  431. .adviser{
  432. width: 662rpx;
  433. margin-left: 24rpx;
  434. background: #FFFFFF;
  435. border-radius: 10px;
  436. display: flex;
  437. justify-content: space-between;
  438. padding: 18rpx 20rpx;
  439. margin-top: 20rpx;
  440. }
  441. .adviserLeft{
  442. display: flex;
  443. }
  444. .advisertx{
  445. width: 62rpx;height: 62rpx;
  446. }
  447. .adviserNema{
  448. color: #333333;font-size: 30rpx;
  449. line-height: 62rpx;padding-left: 24rpx;
  450. }
  451. .adviserms{
  452. width: 118rpx;
  453. height: 36rpx;
  454. border-radius: 4rpx;
  455. border: 1px solid #D53533;
  456. line-height: 36rpx;
  457. text-align: center;
  458. margin-top: 12rpx;
  459. margin-left: 20rpx;
  460. color: #D53533;
  461. font-size: 24rpx;
  462. }
  463. .adviserJt{
  464. width: 12rpx;
  465. height: 20rpx;
  466. margin-top: 16rpx;
  467. }
  468. .modular{
  469. width: 702rpx;
  470. height: 313rpx;
  471. background: #FFFFFF;
  472. border-radius: 10px;
  473. margin-top: 20rpx;
  474. margin-left: 24rpx;
  475. }
  476. .swiper-item{
  477. display: flex;
  478. flex-wrap: wrap;
  479. }
  480. .itemImg{
  481. width: 46rpx;
  482. height: 46rpx;
  483. }
  484. .Menusline{
  485. font-size: 24rpx;
  486. color: #333333;
  487. }
  488. .itemLine{
  489. width: 25%;
  490. text-align: center;
  491. padding-top: 40rpx;
  492. }
  493. .advertisement{
  494. width: 702rpx;
  495. height: 280rpx;
  496. margin-top: 20rpx;
  497. margin-left: 24rpx;
  498. border-radius: 20rpx;
  499. }
  500. .swiper-item2{
  501. width: 702rpx;
  502. height: 280px;
  503. }
  504. .swiper-item2Img{
  505. width: 702rpx;
  506. height: 280rpx;
  507. }
  508. .hotMoreJt{
  509. width: 12rpx;
  510. height: 20rpx;
  511. margin-top: 6rpx;
  512. }
  513. .Hot{
  514. width: 702rpx;
  515. margin-top: 20rpx;
  516. margin-left: 24rpx;
  517. }
  518. .hotTop{
  519. display: flex;
  520. justify-content: space-between;
  521. }
  522. .hotSx{
  523. width: 8rpx;
  524. height: 30rpx;
  525. background: #F03B3B;
  526. border-radius: 5rpx;
  527. }
  528. .hotLeft{
  529. display: flex;
  530. }
  531. .hottitle{
  532. font-weight: 500;
  533. color: #333333;
  534. font-size: 30rpx;
  535. line-height: 30rpx;
  536. margin-left: 16rpx;
  537. }
  538. .hotRight{
  539. display: flex;
  540. }
  541. .hotMore{
  542. line-height: 30rpx;color: #666666;font-size: 24rpx;
  543. margin-right: 16rpx;
  544. }
  545. .hotLineTopImg{
  546. width: 702rpx;
  547. height: 280rpx;
  548. }
  549. .hotLineTop{
  550. position: relative;
  551. height: 280rpx;
  552. }
  553. .hotLine{
  554. margin-top: 20rpx;
  555. border-radius: 10rpx;
  556. background: #FFFFFF;
  557. overflow: hidden;
  558. }
  559. .hotlinestate1{
  560. width: 102rpx;
  561. height: 44rpx;
  562. background:#FBBF00 ;
  563. line-height: 44rpx;
  564. font-weight: 500;
  565. color: #333333;
  566. font-size: 24rpx;
  567. text-align: center;
  568. }
  569. .hotlinestate2{
  570. width: 102rpx;
  571. height: 44rpx;
  572. background:#F03B3B ;
  573. line-height: 44rpx;
  574. font-weight: 500;
  575. color: #FFFFFF;
  576. font-size: 24rpx;
  577. text-align: center;
  578. }
  579. .hotlineTimebox{
  580. position: absolute;
  581. left: 0;
  582. bottom: 0;
  583. background: rgba(0, 0, 0, 0.5);
  584. display: flex;
  585. }
  586. .hotTime{
  587. font-weight: 400;
  588. color: #FFFFFF;
  589. font-size: 24rpx;
  590. line-height: 44rpx;
  591. padding: 0 20rpx;
  592. }
  593. .hotName{
  594. padding: 24rpx 20rpx;
  595. color: #333333;
  596. line-height: 40rpx;
  597. font-size: 28rpx;
  598. }
  599. .hotGoodsLine{
  600. margin-top: 20rpx;
  601. padding: 20rpx;
  602. background: #FFFFFF;
  603. border-radius: 16rpx;
  604. display: flex;
  605. }
  606. .hotGoodsLineImg{
  607. width: 208rpx;
  608. height: 194rpx;
  609. border-radius: 16rpx;
  610. border: 1px solid #EEEEEE;
  611. }
  612. .goodsName{
  613. font-size: 28rpx;
  614. font-family: PingFangSC-Regular, PingFang SC;
  615. font-weight: 400;
  616. color: #333333;
  617. line-height: 40rpx;
  618. text-overflow: -o-ellipsis-lastline;
  619. overflow: hidden;
  620. text-overflow: ellipsis;
  621. display: -webkit-box;
  622. -webkit-line-clamp: 2;
  623. line-clamp: 2;
  624. -webkit-box-orient: vertical;
  625. }
  626. .hotGoodsLineRIght{
  627. padding-left: 24rpx;
  628. }
  629. .goodsPrice{
  630. display: flex;
  631. padding-top: 10rpx;
  632. }
  633. .goodsPrice1{
  634. font-size: 24rpx;
  635. font-weight: 400;
  636. color: #F03B3B;
  637. }
  638. .goodsPrice2{
  639. font-size: 22rpx;
  640. font-weight: 400;
  641. color: #F03B3B;
  642. }
  643. .goodsPrice3{
  644. font-size: 32rpx;
  645. font-weight: 400;
  646. color: #F03B3B;
  647. }
  648. .goodsPrice3{
  649. font-size: 24rpx;
  650. font-weight: 400;
  651. color: #999999;
  652. }
  653. .Sold{
  654. font-weight: 400;
  655. color: #999999;
  656. font-size: 24rpx;
  657. padding-top: 8rpx;
  658. }
  659. </style>