index.js
2.1 KB
"use strict";const e=require("../../common/vendor.js"),a=require("../../common/assets.js"),o=require("../../api/user.js"),t=require("../../api/work.js"),r=require("../../store/modules/user.js");if(!Array){(e.resolveComponent("up-navbar")+e.resolveComponent("up-parse")+e.resolveComponent("up-popup"))()}Math||((()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js")+u+s+n+(()=>"../../uni_modules/uview-plus/components/u-parse/u-parse.js")+(()=>"../../uni_modules/uview-plus/components/u-popup/u-popup.js"))();const n=()=>"../../components/carCard.js",s=()=>"../../components/centerLine.js",u=()=>"../../components/navTop.js",i={__name:"index",setup(n){const s=e.ref([]),u=e.ref(""),i=e.ref(""),p=e.ref("0"),c=r.useUserStore(),l=e.reactive({pageNum:1,pageSize:20}),d=async()=>{const{data:e}=await o.getUserCarInfo(l);s.value=e.records;const{data:a}=await t.queryMyList({pageNum:1,pageSize:20,type:1}),{data:r}=await t.queryMyList(l);p.value=(a.total+r.total).toString()},v=()=>{e.index.navigateTo({url:"/pages/carDetail/carDetail"})},m=()=>{c.isShowAdver=!1};return(async()=>{const{rows:e}=await o.getAdverList(l);i.value=e[0].noticeContent,u.value=e[0].noticeTitle,c.isShowAdver=!0})(),e.onPullDownRefresh((async()=>{s.value=[],await d(),e.index.stopPullDownRefresh()})),e.onShow((async()=>{await d(),"0"!==p.value?e.index.setTabBarBadge({index:1,text:p.value}):e.index.removeTabBarBadge({index:1})})),(o,t)=>({a:e.p({placeholder:!0,leftIconSize:0,bgColor:"transparent"}),b:e.f(s.value,((a,o,t)=>({a:"1f4817ab-2-"+t+",1f4817ab-1-"+t,b:e.p({carNum:a.licensePlateNumber}),c:"1f4817ab-3-"+t+",1f4817ab-1-"+t,d:e.p({leftContent:a.frameNumber,fontColor:"#999",rightContent:a.engineNumber}),e:e.o((o=>{return t=a.id,void e.index.navigateTo({url:`/pages/carDetail/carDetail?carInfoId=${t}`});var t}),a.id),f:a.id,g:"1f4817ab-1-"+t,h:e.p({tipContent:a.status,carInfo:a})}))),c:e.o(v),d:a._imports_0$2,e:e.t(u.value),f:e.p({content:i.value}),g:e.o(m),h:e.o((a=>e.unref(c).isShowAdver=!1)),i:e.p({show:e.unref(c).isShowAdver,mode:"center",safeAreaInsetBottom:!1,round:"20"})})}},p=e._export_sfc(i,[["__scopeId","data-v-1f4817ab"]]);wx.createPage(p);