index.vue 30 KB

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