index.vue 30 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211
  1. <template>
  2. <view class="content">
  3. <view class="indexTop">
  4. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  5. <view class="indexnav">{{wxOpenData.unionName}}</view>
  6. </view>
  7. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  8. <view style="height: 43px;"></view>
  9. <view class="topBox"></view>
  10. <view class="yuanhu"></view>
  11. <view class="shoptopbox2" v-if="!carInfo">
  12. <view class="carinfoBox2">
  13. <view class="carinfoBoxNocar" @click="addCar">
  14. <img src="../../static/timg/addcar.png" alt="" class="carinfonocarIcon">
  15. <view class="carinfoBoxNocarRight">
  16. <view class="carinfoBoxNocarRightTitle">添加我的爱车</view>
  17. <view class="carinfoBoxNocarRightMS">按照车型推荐合适的商品</view>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="shoptopbox" v-if="carInfo">
  23. <view class="carinfoBox" >
  24. <view class="carinfoBoxTop">
  25. <img :src="carInfo.brandLogo" alt="" class="carLogo" v-if="carInfo.brandLogo">
  26. <img src="../../static/timg/nocar.png" alt="" class="carLogo" v-else>
  27. <view class="carinfoBoxTopCont">
  28. <view class="carinfoBoxTopContTop">
  29. <view class="carInfoplateNumber">{{carInfo.plateNumber}}</view>
  30. <view class="carTnfomilage" v-if="carInfo.milage">{{carInfo.milage}}km</view>
  31. </view>
  32. <view class="carInfocarModel" v-if="carInfo.carModel">{{carInfo.carModel}}</view>
  33. <view class="carInfocarModel" v-else>暂无</view>
  34. </view>
  35. <view class="carinfoBoxTopRight" @click="changeCar">
  36. <img src="../../static/timg/icon_change@2x.png" alt="" class="carinfoBoxTopRightIcon">
  37. <view class="huancheBtn">换车</view>
  38. </view>
  39. </view>
  40. <!-- <view class="carInfoBottom">
  41. <view class="carInfoBottomLine">
  42. <view class="carInfoBottomLineTitle">下次保养里程</view>
  43. <view class="carInfoBottomLineTxt" v-if="carInfo.nextCareMilage">{{carInfo.nextCareMilage}}</view>
  44. <view class="carInfoBottomLineTxt" v-else>暂无</view>
  45. </view>
  46. <view class="carInfoBottomLine">
  47. <view class="carInfoBottomLineTitle">下次保养日期</view>
  48. <view class="carInfoBottomLineTxt" v-if="carInfo.nextCareDate">{{carInfo.nextCareDate.slice(0,10)}}</view>
  49. <view class="carInfoBottomLineTxt" v-else>暂无</view>
  50. </view>
  51. <view class="carInfoBottomLine">
  52. <view class="carInfoBottomLineTitle">保养手册</view>
  53. <view class="carInfoBottomLineTxt" @click="information">点击查看</view>
  54. </view>
  55. </view> -->
  56. <view class="bxBox">
  57. <view class="bxline bxline1">
  58. <img src="../../static/timg/car1.png" alt="" class="bxlineIcon">
  59. <view class="bxlineTitle">保险</view>
  60. <view class="bxlineMs1" v-if="carInfo.insuranceExpireDate">{{InsuranceExpireDate}}天到期</view>
  61. <view class="bxlineMs2" v-else>--</view>
  62. </view>
  63. <view class="bxline bxline2">
  64. <img src="../../static/timg/car2.png" alt="" class="bxlineIcon" >
  65. <view class="bxlineTitle">下次保养</view>
  66. <view class="bxlineMs1" v-if="carInfo.nextCareDate||carInfo.nextCareMilage">
  67. <span v-if="NextCareDate||NextCareDate===0">{{NextCareDate}}天后</span>
  68. <span v-if="NextCareDate===0&&carInfo.nextCareMilage">或</span>
  69. <span v-if="carInfo.nextCareMilage&&NextCareDate">或</span>
  70. <span v-if="carInfo.nextCareMilage">{{carInfo.nextCareMilage}}km</span>
  71. </view>
  72. <view class="bxlineMs2" v-else>--</view>
  73. </view>
  74. <view class="bxline bxline1">
  75. <img src="../../static/timg/car3.png" alt="" class="bxlineIcon" >
  76. <view class="bxlineTitle">年审</view>
  77. <view class="bxlineMs1" v-if="carInfo.nextAuditDate">{{NextAuditDate}}天到期</view>
  78. <view class="bxlineMs2" v-else>--</view>
  79. </view>
  80. <view class="bxline bxline2">
  81. <img src="../../static/timg/car4.png" alt="" class="bxlineIcon" >
  82. <view class="bxlineTitle">保养手册</view>
  83. <view class="bxlineMs2" @click="information">点击查看</view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. <!-- 服务顾问 -->
  89. <view class="adviser" v-if="managerInfo" @click="goMUsers()">
  90. <view class="adviserLeft">
  91. <img v-if="managerInfo.avatar" :src="managerInfo.avatar" alt="" class="advisertx">
  92. <img v-else src="../../static/timg/pic_def_ava@2x.png" alt="" class="advisertx">
  93. <view class="adviserNema">{{managerInfo.name}}</view>
  94. <view class="adviserms">服务顾问</view>
  95. </view>
  96. <img src="../../static/timg/icon_arrow_right.png" alt="" class="adviserJt">
  97. </view>
  98. <!-- 中间功能应用模块 -->
  99. <view class="modular" v-if="homeCardList.application.length>0">
  100. <view class="swiper-item">
  101. <view class="itemLine" @click="goRoter(item)" v-for="(item,index) in homeCardList.application">
  102. <view><img :src="item.icon" alt="" class="itemImg"></view>
  103. <view class="Menusline">{{item.name}}</view>
  104. </view>
  105. </view>
  106. </view>
  107. <view class="advertisement" v-if="homeCardList.ad1.length>0">
  108. <swiper class="swiper2" circular :autoplay="true" :interval="interval"
  109. :duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
  110. <swiper-item v-for="(item,index) in homeCardList.ad1">
  111. <view class="swiper-item2" @click="goRoter(item)">
  112. <image class="swiper-item2Img" :src="item.icon" mode=""></image>
  113. </view>
  114. </swiper-item>
  115. </swiper>
  116. </view>
  117. <view class="advertisement" v-if="homeCardList.ad2.length>0">
  118. <swiper class="swiper2" circular :autoplay="true" :interval="interval"
  119. :duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
  120. <swiper-item v-for="(item,index) in homeCardList.ad2">
  121. <view class="swiper-item2" @click="goRoter(item)">
  122. <image class="swiper-item2Img" :src="item.icon" mode=""></image>
  123. </view>
  124. </swiper-item>
  125. </swiper>
  126. </view>
  127. <view class="advertisement" v-if="homeCardList.ad3.length>0">
  128. <swiper class="swiper2" circular :autoplay="true" :interval="interval"
  129. :duration="duration" :indicator-dots="true" indicator-color="#CCCCCC" indicator-active-color="#D53533">
  130. <swiper-item v-for="(item,index) in homeCardList.ad3">
  131. <view class="swiper-item2" @click="goRoter(item)">
  132. <image class="swiper-item2Img" :src="item.icon" mode=""></image>
  133. </view>
  134. </swiper-item>
  135. </swiper>
  136. </view>
  137. <!-- 热门活动 -->
  138. <view class="Hot">
  139. <view class="hotTop">
  140. <view class="hotLeft">
  141. <view class="hotSx"></view>
  142. <view class="hottitle">热门活动</view>
  143. </view>
  144. <view class="hotRight" @click="moreJk">
  145. <view class="hotMore">更多</view>
  146. <img src="../../static/timg/icon_arrow_right.png" alt="" class="hotMoreJt">
  147. </view>
  148. </view>
  149. <view class="hotLine" @click="goJk(item)" v-for="(item,index) in homeCardList.openMActivity.openCollectingList" v-if="index<homeCardList.openMActivity.showCount">
  150. <view class="hotLineTop">
  151. <image class="hotLineTopImg" :src="item.img" mode=""></image>
  152. <view class="hotlineTimebox">
  153. <!-- <view class="hotlinestate1" v-if="item.state==2">进行中</view>
  154. <view class="hotlinestate2" v-if="item.state==1">未开始</view> -->
  155. <image class="jkStateImg" v-if="item.state==2" src="../../static/img/bg_huangse.png" mode="" ></image>
  156. <image class="jkStateImg" v-if="item.state==1" src="../../static/img/bg_hongse.png" mode="" ></image>
  157. <view class="hotTime">{{item.startTime.slice(0,10)}}-{{item.endTime.slice(0,10)}}</view>
  158. </view>
  159. </view>
  160. <view class="hotName">{{item.activityName}}</view>
  161. </view>
  162. </view>
  163. <!-- 热门车型 -->
  164. <view class="" v-if="homeCardList">
  165. <view class="Hot" v-if="homeCardList.openMGoods.showType==1">
  166. <view class="hotTop">
  167. <view class="hotLeft">
  168. <view class="hotSx"></view>
  169. <view class="hottitle">热门车型</view>
  170. </view>
  171. <view class="hotRight" @click="goShop">
  172. <view class="hotMore">更多</view>
  173. <img src="../../static/timg/icon_arrow_right.png" alt="" class="hotMoreJt">
  174. </view>
  175. </view>
  176. <view class="hotGoodsLine" v-for="(item,index) in homeCardList.openMGoods.goodsList" @click="goGoods(item)" v-if="index<homeCardList.openMGoods.showCount">
  177. <view>
  178. <image :src="item.url" mode="" class="hotGoodsLineImg"></image>
  179. </view>
  180. <view class="hotGoodsLineRIght">
  181. <view class="goodsName">{{item.name}}</view>
  182. <view class="Sold">
  183. <view v-if="item.showLabel&&item.showLabel.indexOf('3')!=-1">
  184. 已售 {{item.saleQty}}
  185. </view>
  186. </view>
  187. <view class="goodsPrice">
  188. <view class="goodsPrice1">{{item.saleLabel}}</view>
  189. <view class="goodsPrice2">¥</view>
  190. <view class="goodsPrice3">{{item.salePrice}}
  191. <span v-if="item.categoryIds=='7B97D114-C419-42B2-9C1E-0B4CA284CDA0'">万</span>
  192. </view>
  193. <view class="goodsPrice4" v-if="item.showLabel&&item.scribingPrice&&item.showLabel.indexOf('1')!=-1">¥{{item.scribingPrice}}</view>
  194. </view>
  195. </view>
  196. </view>
  197. </view>
  198. </view>
  199. <view style="height: 60rpx;"></view>
  200. <!-- 手机号授权 -->
  201. <view class="authorizBox" v-if="authorizShow" @click="authorizShow=false">
  202. <view class="authorizCont" @click.stop="">
  203. <view class="authorizName">{{wxOpenData.miniAppName}}</view>
  204. <view class="authorizMs">您好,欢迎访问本店,授权手机号登录能获取我们最新的促销活动哦~</view>
  205. <button class="authorizContbutton" type="default" open-type="getPhoneNumber" @getphonenumber="decryptPhoneNumber">授权</button>
  206. </view>
  207. <view style="text-align: center;padding-top: 56rpx;">
  208. <image src="../../static/timg/icon_guanbi@2x.png" mode="" class="authorizCloseImg"></image>
  209. </view>
  210. </view>
  211. <!-- <view @getphonenumber="decryptPhoneNumber" >shopId:{{shopId}}</view>
  212. -->
  213. </view>
  214. </template>
  215. <script>
  216. export default {
  217. data() {
  218. return {
  219. shopId: '',
  220. url:'',
  221. wxOpenData:'',
  222. code:'',
  223. carInfo:'',
  224. homeCardList:'',
  225. authorizShow:false,
  226. miniAppName:'',
  227. iStatusBarHeight:'',
  228. managerInfo:'',
  229. unionId:'',
  230. ext:'',
  231. duration:500,
  232. interval:3000,
  233. InsuranceExpireDate:'',
  234. NextCareDate:'',
  235. NextAuditDate:'',
  236. }
  237. },
  238. onLoad() {
  239. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  240. var that=this;
  241. //this.$common.getExtStoreId()
  242. var ext=this.$common.getExtStoreId();
  243. this.ext=ext
  244. console.log(ext)
  245. //console.log( String(Date.now()))
  246. this.shopId=ext.shopId;
  247. this.url=ext.url;
  248. this.unionId=ext.unionId
  249. // uni.setStorage({
  250. // key: 'extdata',
  251. // data: {
  252. // shopId:'E37BB296-5A08-4534-859D-B351BA611AF9',
  253. // },
  254. // success: function () {
  255. // that.uniLogin()
  256. // }
  257. // });
  258. //this.userInfo = uni.getStorageSync("userInfo");
  259. this.userInfo=this.$store.state.userInfo
  260. if(this.userInfo){
  261. //this.wxOpenData = uni.getStorageSync("wxOpenData");
  262. this.getCarList();
  263. this.queryHomeCardList()
  264. this.queryManagerInfo()
  265. }else{
  266. this.uniLogin()
  267. }
  268. },
  269. onShow() {
  270. var indexaddcar = uni.getStorageSync("indexaddcar")
  271. if(indexaddcar==1){
  272. uni.removeStorageSync('indexaddcar');
  273. this.getCarList();
  274. }else{
  275. this.carInfo=this.$store.state.carInfo;
  276. this.jsTime()
  277. }
  278. },
  279. methods: {
  280. addCar(){
  281. if(!this.userInfo){
  282. this.authorizShow=true;
  283. }else{
  284. uni.navigateTo({
  285. url:'../user/addCar/addCar?type=1'
  286. })
  287. }
  288. },
  289. goShop(){
  290. uni.switchTab({
  291. url:'../shop/shop'
  292. })
  293. },
  294. moreJk(){
  295. uni.switchTab({
  296. url:'../activity/activity'
  297. })
  298. },
  299. information(){
  300. console.log('车辆信息--',this.carInfo);
  301. uni.navigateTo({
  302. url:'handbook?mileage='+this.carInfo.milage+'&liyangId='+this.carInfo.nLevelID
  303. })
  304. },
  305. changeCar(){
  306. uni.navigateTo({
  307. url:'../user/addCar/cailist'
  308. })
  309. },
  310. goMUsers(){
  311. if(!this.userInfo){
  312. this.authorizShow=true;
  313. }else{
  314. uni.navigateTo({
  315. url:'../index/personalCard?adInfo='+JSON.stringify(this.managerInfo)
  316. })
  317. }
  318. },
  319. goGoods(item){
  320. if(!this.userInfo){
  321. this.authorizShow=true;
  322. }else{
  323. uni.navigateTo({
  324. url:'../shop/goodsDetail?id='+item.id
  325. })
  326. }
  327. },
  328. goJk(item){
  329. if(!this.userInfo){
  330. this.authorizShow=true;
  331. }else{
  332. uni.navigateTo({
  333. url:'../activity/jkDetail?id='+item.id
  334. })
  335. }
  336. },
  337. goRoter(item){
  338. console.log(item)
  339. if(!this.userInfo){
  340. this.authorizShow=true;
  341. }else{
  342. if(item.bizType==0){
  343. if(item.name=='新车'){ //
  344. uni.navigateTo({
  345. url:'newCar'
  346. })
  347. }else if(item.name=='二手车'){
  348. uni.navigateTo({
  349. url:'usedCar'
  350. })
  351. }else if(item.name=='爱车估价'){
  352. uni.navigateTo({
  353. url:'evaluation'
  354. })
  355. }
  356. else{
  357. uni.showToast({
  358. title: '敬请期待',
  359. icon:'none',
  360. duration: 3000
  361. });
  362. }
  363. }else if(item.bizType==1){ //紧急救援
  364. uni.navigateTo({
  365. url:'rescue'
  366. })
  367. }else if(item.bizType==2){ //钣金喷漆
  368. uni.navigateTo({
  369. url:'paint'
  370. })
  371. }else if(item.bizType==3){ //保养
  372. uni.navigateTo({
  373. url:'maintain'
  374. })
  375. }else if(item.bizType==4){ //在线预约
  376. uni.navigateTo({
  377. url:'onlineBooking?naShopId='+item.naShopId
  378. })
  379. }else if(item.bizType==5){ //导航
  380. this.getShopinfo(5,item.reShopId)
  381. }else if(item.bizType==6){ //联系本店
  382. this.getShopinfo(6,item.orShopId)
  383. }else if(item.bizType==7){ //7门店列表
  384. uni.navigateTo({
  385. url:'shopList'
  386. })
  387. }else if(item.bizType==8){ //我的会员卡
  388. uni.navigateTo({
  389. url:'vipCard'
  390. })
  391. }else if(item.bizType==9){ //我的优惠券
  392. uni.navigateTo({
  393. url:'discountCard'
  394. })
  395. }else if(item.bizType==10){ //我的订单
  396. uni.navigateTo({
  397. url:'../user/myOrder/myOrder'
  398. })
  399. }else if(item.bizType==11){ //我的预约
  400. uni.navigateTo({
  401. url:'../user/myBespeak'
  402. })
  403. }else if(item.bizType==12){ //历史消费
  404. uni.navigateTo({
  405. url:'../user/historySpend'
  406. })
  407. }else if(item.bizType==12){ //历史消费
  408. uni.navigateTo({
  409. url:'../user/historySpend'
  410. })
  411. }else if(item.bizType==13){ //车检报告
  412. uni.navigateTo({
  413. url:'../user/checkReport'
  414. })
  415. }else if(item.bizType==14){ //指定商品分类
  416. uni.setStorage({
  417. key: 'shopcategoryID',
  418. data: item.bizId,
  419. success: function () {
  420. getApp().globalData.shopcategoryID=item.bizId;
  421. uni.switchTab({
  422. url:'../shop/shop?shopcategoryID='+ item.bizId
  423. })
  424. }
  425. });
  426. }else if(item.bizType==15){ //商品详情
  427. uni.navigateTo({
  428. url:'../shop/goodsDetail?id=CD2D70DC-706C-4441-9864-33BD19457CAE'
  429. })
  430. }
  431. // uni.navigateTo({
  432. // url:url
  433. // })
  434. }
  435. },
  436. decryptPhoneNumber: function(e) {
  437. console.log(e);
  438. this.code=e.detail.code
  439. this.wxPhoneLogin()
  440. this.authorizShow=false;
  441. },
  442. wxgologin(){
  443. var that=this;
  444. uni.getUserProfile({
  445. lang:'zh_CN',
  446. desc:'登录',
  447. success:(res)=>{
  448. console.log(res);
  449. that.wxdata=res;
  450. uni.setStorage({
  451. key: 'wxdata',
  452. data: res,
  453. success: function () {
  454. that.uniLogin()
  455. }
  456. });
  457. },
  458. fail:(res)=>{
  459. console.log(res)
  460. }
  461. });
  462. },
  463. uniLogin(){
  464. var that=this;
  465. uni.login({
  466. provider: 'weixin',
  467. success: function (loginRes) {
  468. console.log(loginRes);
  469. that.getWxOpenID(loginRes)
  470. }
  471. });
  472. },
  473. getWxOpenID(e){
  474. var that=this;
  475. uni.showLoading({
  476. title: '加载中'
  477. })
  478. this.$http('miniApp2/sys/getWxOpenID', {
  479. code:e.code,
  480. unionId:this.unionId
  481. },'GET').then(res => {
  482. this.wxOpenData=res.data;
  483. uni.setNavigationBarTitle({
  484. title:this.wxOpenData.miniAppName
  485. })
  486. that.queryHomeCardList()
  487. //that.wxPhoneLogin()
  488. this.$store.commit('mutationswxOpenData', that.wxOpenData)
  489. uni.setStorage({
  490. key: 'wxOpenData',
  491. data: that.wxOpenData,
  492. success: function () {
  493. // that.uniLogin()
  494. }
  495. });
  496. if(this.wxOpenData.loginInfo){
  497. this.$store.commit('mutationsuserInfo', that.wxOpenData.loginInfo.openUser)
  498. this.userInfo=that.wxOpenData.loginInfo.openUser
  499. that.queryManagerInfo()
  500. uni.setStorage({
  501. key: 'userInfo',
  502. data: that.wxOpenData.loginInfo.openUser,
  503. success: function () {
  504. that.getCarList()
  505. }
  506. });
  507. }else{
  508. this.authorizShow=true;
  509. }
  510. })
  511. },
  512. wxPhoneLogin(){
  513. var that=this;
  514. this.$http('miniApp2/sys/wxPhoneLogin', {
  515. appId:this.ext.appId,
  516. unionId:this.unionId,
  517. code:this.code,
  518. openId:this.wxOpenData.openid
  519. },'POST').then(res => {
  520. var data = res.data;
  521. if(data.loginInfo){
  522. this.userInfo=data.loginInfo.openUser;
  523. this.$store.commit('mutationsuserInfo', this.userInfo);
  524. this.$store.commit('mutationswxOpenData', data.loginInfo)
  525. uni.setStorage({
  526. key: 'userInfo',
  527. data: data.loginInfo.openUser,
  528. success: function () {
  529. that.getCarList()
  530. that.queryHomeCardList()
  531. that.queryManagerInfo()
  532. }
  533. });
  534. }
  535. })
  536. },
  537. getCarList(){
  538. this.$http('opencarOwnerHome/queryCarInfoList', {
  539. },'GET').then(res => {
  540. if(res.code==401){
  541. this.uniLogin()
  542. }else{
  543. this.carInfo=res.data[0]
  544. this.$store.commit('mutationscarInfo', this.carInfo)
  545. /* this.carInfo.insuranceExpireDate='2022-11-11';
  546. this.carInfo.nextAuditDate='2022-08-13'; */
  547. //this.carInfo.nextCareDate='2022-08-11';
  548. //this.carInfo.nextCareMilage=11
  549. this.jsTime()
  550. }
  551. })
  552. },
  553. jsTime(){
  554. if(this.carInfo.insuranceExpireDate){
  555. if (Number(new Date().getTime()) > (Number(new Date(this.carInfo.insuranceExpireDate.replace(/-/g, '/')).getTime()) || 0)) {
  556. console.log("现在时间大于开始时间")
  557. this.InsuranceExpireDate = 0
  558. } else {
  559. this.clock()
  560. }
  561. }else{
  562. this.InsuranceExpireDate=''
  563. }
  564. if(this.carInfo.nextCareDate){
  565. if (Number(new Date().getTime()) > (Number(new Date(this.carInfo.nextCareDate.replace(/-/g, '/')).getTime()) || 0)) {
  566. this.NextCareDate = 0
  567. } else {
  568. this.clock2()
  569. }
  570. }else{
  571. this.NextCareDate = ''
  572. }
  573. if(this.carInfo.nextAuditDate){
  574. if (Number(new Date().getTime()) > (Number(new Date(this.carInfo.nextAuditDate.replace(/-/g, '/')).getTime()) || 0)) {
  575. this.NextAuditDate = 0
  576. } else {
  577. this.clock3()
  578. }
  579. }else{
  580. this.NextAuditDate=''
  581. }
  582. },
  583. clock () {
  584. let _this = this
  585. let today = new Date() // 当前时间
  586. let h = today.getHours()
  587. let m = today.getMinutes()
  588. let s = today.getSeconds()
  589. let stopTime = new Date(_this.carInfo.insuranceExpireDate.replace(/-/g, '/')) // 结束时间
  590. let stopH = stopTime.getHours()
  591. let stopM = stopTime.getMinutes()
  592. let stopS = stopTime.getSeconds()
  593. let shenyu = stopTime.getTime() - today.getTime() // 倒计时毫秒数
  594. let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
  595. this.InsuranceExpireDate=shengyuD+1;
  596. // setTimeout(_this.clock, 500)
  597. },
  598. clock2 () {
  599. let _this = this
  600. let today = new Date() // 当前时间
  601. let stopTime = new Date(_this.carInfo.nextCareDate.replace(/-/g, '/')) // 结束时间
  602. let stopH = stopTime.getHours()
  603. let stopM = stopTime.getMinutes()
  604. let stopS = stopTime.getSeconds()
  605. let shenyu = stopTime.getTime() - today.getTime() // 倒计时毫秒数
  606. let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
  607. this.NextCareDate=shengyuD+1;
  608. // setTimeout(_this.clock, 500)
  609. },
  610. clock3 () {
  611. let _this = this
  612. let today = new Date() // 当前时间
  613. let stopTime = new Date(_this.carInfo.nextAuditDate.replace(/-/g, '/')) // 结束时间
  614. let shenyu = stopTime.getTime() - today.getTime() // 倒计时毫秒数
  615. let shengyuD = parseInt(shenyu / (60 * 60 * 24 * 1000)) // 转换为天
  616. this.NextAuditDate=shengyuD+1;
  617. // setTimeout(_this.clock, 500)
  618. },
  619. queryManagerInfo(){
  620. console.log("11")
  621. this.$http('openHome/queryManagerInfo', {
  622. },'GET').then(res => {
  623. this.managerInfo=res.data
  624. })
  625. },
  626. queryHomeCardList(){
  627. //console.log(this.wxOpenData)
  628. this.$http('openHome/queryHomeCardList', {
  629. unionId:this.unionId
  630. },'GET').then(res => {
  631. uni.hideLoading();
  632. this.homeCardList=res.data
  633. })
  634. },
  635. getShopinfo(num,shopId){
  636. var that=this;
  637. uni.showLoading({
  638. title: '加载中'
  639. })
  640. if(!shopId){
  641. shopId=''
  642. }
  643. this.$http('openmy/getShopinfo', {
  644. shopId:shopId
  645. },'GET').then(res => {
  646. uni.hideLoading();
  647. var res=res.data
  648. if(num==5){
  649. uni.openLocation({
  650. latitude:Number(res.lat),
  651. longitude:Number(res.lng),
  652. name: res.shopName,
  653. address: res.address,
  654. success: function() {
  655. console.log('success');
  656. },
  657. fail(err) {
  658. console.log(err)
  659. }
  660. });
  661. }else{
  662. uni.makePhoneCall({
  663. phoneNumber: res.contactorPhone
  664. });
  665. }
  666. })
  667. }
  668. }
  669. }
  670. </script>
  671. <style scoped>
  672. .bxBox{
  673. display: flex;
  674. flex-wrap: wrap;
  675. }
  676. .bxline{
  677. display: flex;
  678. padding-top: 22rpx;
  679. }
  680. .bxline1{
  681. width: 40%;
  682. }
  683. .bxline2{
  684. width: 60%;
  685. }
  686. .bxlineTitle{
  687. color: #333333;
  688. font-size: 26rpx;
  689. line-height: 37rpx;
  690. padding-left: 10rpx;
  691. }
  692. .bxlineMs1{
  693. line-height: 37rpx;
  694. color: #D53533;
  695. font-size: 26rpx;
  696. padding-left: 12rpx;
  697. }
  698. .bxlineMs2{
  699. line-height: 37rpx;
  700. color: #999999;
  701. font-size: 24rpx;
  702. padding-left: 12rpx;
  703. }
  704. .bxlineIcon{
  705. width: 34rpx;
  706. height: 34rpx;
  707. margin-left: 24rpx;
  708. }
  709. .indexTop{
  710. background: #D53533;
  711. width: 750rpx;
  712. position: fixed;
  713. top: 0;
  714. left: 0;
  715. z-index: 11;
  716. }
  717. .indexnav{
  718. height: 44px;
  719. line-height: 44px;
  720. text-align: center;
  721. font-size: 36rpx;
  722. color: #FFFFFF;
  723. }
  724. .authorizBox{
  725. width: 100vw;
  726. height: 100vh;
  727. background: rgba(0, 0, 0, 0.5);
  728. position: fixed;
  729. top: 0;
  730. left: 0;
  731. }
  732. .authorizCont{
  733. margin-top: 30vh;
  734. width: 564rpx;
  735. height: 408rpx;
  736. background: #FFFFFF;
  737. border-radius: 24rpx;
  738. margin-left: 93rpx;
  739. position: relative;
  740. }
  741. .authorizCloseImg{
  742. width: 62rpx;
  743. height: 62rpx;
  744. }
  745. .sqLogoBox{
  746. width: 180rpx;
  747. height: 180rpx;
  748. background: #FFFFFF;
  749. border-radius: 90rpx;
  750. text-align: center;
  751. position: absolute;
  752. top: -50rpx;
  753. left: 192rpx;
  754. }
  755. .authorizName{
  756. color: #333333;
  757. line-height: 42rpx;
  758. font-size: 30rpx;
  759. text-align: center;
  760. padding-top: 58rpx;
  761. }
  762. .authorizMs{
  763. color: #999999;
  764. line-height: 36rpx;
  765. font-size: 26rpx;
  766. width: 452rpx;
  767. padding-top: 24rpx;
  768. text-align: center;
  769. margin-left: 56rpx;
  770. }
  771. .authorizContbutton{
  772. width: 422rpx;
  773. height: 88rpx;
  774. background: #D53533;
  775. border-radius: 44rpx;
  776. line-height: 88rpx;
  777. text-align: center;
  778. font-size:30rpx;
  779. color: #FFFFFF;
  780. margin-top: 62rpx;
  781. margin-left:71rpx;
  782. }
  783. .content{
  784. min-height: 100vh;
  785. background: #F4F5F7;
  786. }
  787. .topBox{
  788. width: 750rpx;
  789. height: 150rpx;
  790. background: #D53533;
  791. }
  792. .yuanhu{
  793. width: 750rpx;
  794. height: 50rpx;
  795. background: #D53533;
  796. border-radius: 0 0 100% 100%;
  797. }
  798. .carinfoBox{
  799. width: 702rpx;
  800. /* height: 250rpx; */
  801. background: #FFFFFF;
  802. border-radius: 10rpx;
  803. margin-left: 24rpx;
  804. overflow: hidden;
  805. height: 270rpx;
  806. }
  807. .carinfoBox2{
  808. width: 702rpx;
  809. height: 180rpx;
  810. background: #FFFFFF;
  811. border-radius: 10rpx;
  812. margin-left: 24rpx;
  813. overflow: hidden;
  814. }
  815. .carinfoBox2{
  816. }
  817. .carinfoBox .carLogo{
  818. width: 60rpx;height: 60rpx;
  819. margin-top: 6rpx;
  820. }
  821. .carinfoBoxTop{
  822. display: flex;
  823. justify-content: space-between;
  824. padding-top: 29rpx;
  825. padding-left: 24rpx;
  826. padding-right: 20rpx;
  827. padding-bottom: 24rpx;
  828. border: 1px solid #EEEEEE;
  829. }
  830. .carinfoBoxTopCont{
  831. width: 454rpx;
  832. }
  833. .carinfoBoxTopContTop{
  834. display: flex;
  835. }
  836. .carInfoplateNumber{
  837. font-weight: 500;
  838. color: #3C3C3C;
  839. font-size: 30rpx;
  840. line-height: 42rpx;
  841. padding-right: 16rpx;
  842. }
  843. .carTnfomilage{
  844. color: #F19D01;
  845. font-size: 22rpx;
  846. padding: 0rpx 10rpx;
  847. border-radius: 4rpx;
  848. border: 1px solid #F19D01;
  849. height: 32rpx;
  850. line-height: 34rpx;
  851. margin-top: 2rpx;
  852. margin-left: 2rpx;
  853. }
  854. .carInfocarModel{
  855. width: 454rpx;
  856. color: #666666;
  857. font-size: 26rpx;
  858. white-space: nowrap;
  859. overflow: hidden;
  860. text-overflow: ellipsis;
  861. }
  862. .carinfoBoxTopRight{
  863. display: flex;padding-top: 25rpx;
  864. }
  865. .carinfoBoxTopRightIcon{
  866. width: 29rpx;
  867. height: 31rpx;
  868. }
  869. .huancheBtn{
  870. color: #666666; font-size: 26rpx;line-height: 31rpx;
  871. padding-left: 10rpx;
  872. }
  873. .carInfoBottom{
  874. display: flex;
  875. justify-content: space-around;
  876. }
  877. .carInfoBottomLineTitle{
  878. color: #999999;font-size: 24rpx;
  879. text-align: center;
  880. padding-top: 24rpx;
  881. }
  882. .carInfoBottomLineTxt{
  883. color: #3C3C3C;
  884. font-size: 26rpx;
  885. padding-top: 5rpx;
  886. text-align: center;
  887. }
  888. .carinfonocarIcon{
  889. width: 72rpx;
  890. height: 72rpx;
  891. }
  892. .carinfoBoxNocar{
  893. display: flex;
  894. padding-top: 50rpx;
  895. padding-left: 20rpx;
  896. }
  897. .carinfoBoxNocarRightTitle{
  898. font-weight: 500;
  899. color: #3C3C3C;
  900. font-size: 30rpx;
  901. }
  902. .carinfoBoxNocarRightMS{
  903. color: #666666;
  904. font-size: 26rpx;
  905. }
  906. .carinfoBoxNocarRight{
  907. padding-left: 24rpx;
  908. }
  909. .shoptopbox{
  910. margin-top: -170rpx;
  911. }
  912. .shoptopbox2{
  913. margin-top: -170rpx;
  914. }
  915. .adviser{
  916. width: 662rpx;
  917. margin-left: 24rpx;
  918. background: #FFFFFF;
  919. border-radius: 10px;
  920. display: flex;
  921. justify-content: space-between;
  922. padding: 18rpx 20rpx;
  923. margin-top: 20rpx;
  924. }
  925. .adviserLeft{
  926. display: flex;
  927. }
  928. .advisertx{
  929. width: 62rpx;height: 62rpx;
  930. }
  931. .adviserNema{
  932. color: #333333;font-size: 30rpx;
  933. line-height: 62rpx;padding-left: 24rpx;
  934. }
  935. .adviserms{
  936. width: 118rpx;
  937. height: 36rpx;
  938. border-radius: 4rpx;
  939. border: 1px solid #D53533;
  940. line-height: 36rpx;
  941. text-align: center;
  942. margin-top: 12rpx;
  943. margin-left: 20rpx;
  944. color: #D53533;
  945. font-size: 24rpx;
  946. }
  947. .adviserJt{
  948. width: 12rpx;
  949. height: 20rpx;
  950. margin-top: 16rpx;
  951. }
  952. .modular{
  953. width: 702rpx;
  954. /* height: 313rpx; */
  955. background: #FFFFFF;
  956. border-radius: 10px;
  957. margin-top: 20rpx;
  958. margin-left: 24rpx;
  959. padding-bottom: 40rpx;
  960. }
  961. .swiper-item{
  962. display: flex;
  963. flex-wrap: wrap;
  964. }
  965. .itemImg{
  966. width: 46rpx;
  967. height: 46rpx;
  968. }
  969. .Menusline{
  970. font-size: 24rpx;
  971. color: #333333;
  972. }
  973. .itemLine{
  974. width: 20%;
  975. text-align: center;
  976. padding-top: 40rpx;
  977. }
  978. .advertisement{
  979. width: 702rpx;
  980. height: 280rpx;
  981. margin-top: 20rpx;
  982. margin-left: 24rpx;
  983. border-radius: 20rpx;
  984. }
  985. .swiper-item2{
  986. width: 702rpx;
  987. height: 280px;
  988. }
  989. .swiper-item2Img{
  990. width: 702rpx;
  991. height: 280rpx;
  992. }
  993. .hotMoreJt{
  994. width: 12rpx;
  995. height: 20rpx;
  996. margin-top: 6rpx;
  997. }
  998. .Hot{
  999. width: 702rpx;
  1000. margin-top: 20rpx;
  1001. margin-left: 24rpx;
  1002. }
  1003. .hotTop{
  1004. display: flex;
  1005. justify-content: space-between;
  1006. padding: 6rpx 0;
  1007. }
  1008. .hotSx{
  1009. width: 8rpx;
  1010. height: 30rpx;
  1011. background: #FF0000;
  1012. border-radius: 5rpx;
  1013. }
  1014. .hotLeft{
  1015. display: flex;
  1016. }
  1017. .hottitle{
  1018. font-weight: 500;
  1019. color: #333333;
  1020. font-size: 30rpx;
  1021. line-height: 30rpx;
  1022. margin-left: 16rpx;
  1023. }
  1024. .hotRight{
  1025. display: flex;
  1026. }
  1027. .hotMore{
  1028. line-height: 30rpx;color: #666666;font-size: 24rpx;
  1029. margin-right: 16rpx;
  1030. }
  1031. .hotLineTopImg{
  1032. width: 702rpx;
  1033. height: 280rpx;
  1034. display: block;
  1035. }
  1036. .hotLineTop{
  1037. position: relative;
  1038. height: 280rpx;
  1039. }
  1040. .hotLine{
  1041. margin-top: 20rpx;
  1042. border-radius: 10rpx;
  1043. background: #FFFFFF;
  1044. overflow: hidden;
  1045. }
  1046. .hotlinestate1{
  1047. width: 102rpx;
  1048. height: 44rpx;
  1049. background:#FBBF00 ;
  1050. line-height: 44rpx;
  1051. font-weight: 500;
  1052. color: #333333;
  1053. font-size: 24rpx;
  1054. text-align: center;
  1055. }
  1056. .hotlinestate2{
  1057. width: 102rpx;
  1058. height: 44rpx;
  1059. background:#FF0000 ;
  1060. line-height: 44rpx;
  1061. font-weight: 500;
  1062. color: #FFFFFF;
  1063. font-size: 24rpx;
  1064. text-align: center;
  1065. }
  1066. .hotlineTimebox{
  1067. position: absolute;
  1068. left: 0;
  1069. bottom: 0;
  1070. display: flex;
  1071. align-items: flex-end;
  1072. }
  1073. .hotTime{
  1074. background: rgba(0, 0, 0, 0.5);
  1075. font-weight: 400;
  1076. color: #FFFFFF;
  1077. font-size: 24rpx;
  1078. /* line-height: 44rpx; */
  1079. padding: 5rpx 20rpx;
  1080. margin-top: 9rpx;
  1081. margin-left: -8rpx;
  1082. border-radius: 0px 10rpx 0px 0px;
  1083. }
  1084. .hotName{
  1085. padding: 24rpx 20rpx;
  1086. color: #333333;
  1087. line-height: 40rpx;
  1088. font-size: 28rpx;
  1089. }
  1090. .hotGoodsLine{
  1091. margin-top: 30rpx;
  1092. padding: 20rpx;
  1093. background: #FFFFFF;
  1094. border-radius: 16rpx;
  1095. display: flex;
  1096. }
  1097. .hotGoodsLineImg{
  1098. width: 208rpx;
  1099. height: 194rpx;
  1100. border-radius: 16rpx;
  1101. border: 1px solid #EEEEEE;
  1102. display: block;
  1103. }
  1104. .goodsName{
  1105. font-size: 28rpx;
  1106. font-family: PingFangSC-Regular, PingFang SC;
  1107. font-weight: 400;
  1108. color: #333333;
  1109. line-height: 40rpx;
  1110. text-overflow: -o-ellipsis-lastline;
  1111. overflow: hidden;
  1112. text-overflow: ellipsis;
  1113. display: -webkit-box;
  1114. -webkit-line-clamp: 2;
  1115. line-clamp: 2;
  1116. -webkit-box-orient: vertical;
  1117. }
  1118. .hotGoodsLineRIght{
  1119. padding-left: 24rpx;
  1120. }
  1121. .goodsPrice{
  1122. display: flex;
  1123. padding-top: 10rpx;
  1124. }
  1125. .goodsPrice1{
  1126. font-size: 24rpx;
  1127. font-weight: 400;
  1128. color: #FF0000;
  1129. padding-top: 8rpx;
  1130. }
  1131. .goodsPrice2{
  1132. font-size: 22rpx;
  1133. font-weight: 400;
  1134. color: #FF0000;
  1135. padding-top: 10rpx;
  1136. }
  1137. .goodsPrice3{
  1138. font-size: 32rpx;
  1139. font-weight: 500;
  1140. color: #FF0000;
  1141. }
  1142. .goodsPrice4{
  1143. font-size: 24rpx;
  1144. font-weight: 400;
  1145. color: #999999;
  1146. padding-top: 8rpx;
  1147. padding-left: 10rpx;
  1148. text-decoration:line-through;
  1149. }
  1150. .Sold{
  1151. font-weight: 400;
  1152. color: #999999;
  1153. font-size: 24rpx;
  1154. padding-top: 8rpx;
  1155. }
  1156. .jkStateImg{
  1157. width: 102rpx;
  1158. height: 53rpx;
  1159. position: relative;
  1160. }
  1161. </style>