You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
6.0 KiB

1 week ago
  1. import{r as t,l as e,s as a,q as s,a as o,b as i,c as n,w as c,i as l,o as r,d as p,e as u,u as d,t as m,f as A,g as f,F as y,n as g,h as w,j as h,k as C,m as x,p as k,v as B}from"./index-DkGewvWo.js";import{_ as I}from"./u-navbar.CwZJfInl.js";import{o as v,a as N,r as b}from"./uni-app.es.Bo01BzMV.js";import{_ as S}from"./u-icon.x7ElsZU9.js";import{_ as D}from"./oneBtn.l7bYA2mW.js";import{c as H}from"./car.CcI8AEaV.js";import{a as _,o as L}from"./index.esm.mx2S9eBV.js";import{_ as E}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./u-status-bar.DDNs5qwz.js";const R=E({__name:"index",setup(E){let R=H(),{mapKey:Y}=k;const T=()=>{console.log("11"),console.log(uni.webView),uni.webView.postMessage({data:{action:"goApp"}}),uni.webView.navigateBack()},J=t([{name:"小车",type:"C1/C2/C3",style:"width: 114rpx;height: 61rpx;",icon:new URL("/h5/assets/car4-B-ssq5qs.png",import.meta.url).href,id:"1"},{name:"货车",type:"A2/B2",style:"width: 106rpx;height: 68rpx;",icon:new URL("/h5/assets/car2-DruWO2TW.png",import.meta.url).href,id:"1"},{name:"客车",type:"A1/B1/A3",style:"width: 106rpx;height: 68rpx;",icon:new URL("/h5/assets/car1-BcevCpG2.png",import.meta.url).href,id:"1"},{name:"摩托车",type:"D/E/F",style:"width: 102rpx;height: 73rpx;",icon:new URL("/h5/assets/car3-DPlZfL4O.png",import.meta.url).href,id:"1"}]),O=t("");function Q(){g({url:"/pages/exercises/theoryStudy/theoryStudy"})}async function j(){const{data:t}=await s();let e=t.map((t=>(t.descriptionArr=t.description.split(":"),t)));J.value=e,O.value=t[0]}v((async t=>{let s=t.phone?t.phone:"18267103167",o=t.type?t.type:"1";if(!s)return uni.$u.toast("未查到您的手机号");await async function(t,s){console.log("会执行吗??");const o=await e({username:t,type:s});console.log(o),o.data.phone=t,o.data.type=s,a("loginInfo",o.data)}(s,o),j()})),N((()=>{j().then((()=>{o()})).catch((()=>{o()}))}));let P=[];function U(){w({type:"wgs84",success:function(t){console.log("当前位置的经度:"+t.longitude),console.log("当前位置的纬度:"+t.latitude);L("https://apis.map.qq.com/ws/geocoder/v1/",{key:Y,location:t.latitude+","+t.longitude,output:"jsonp"}).then((t=>{console.log("jsonp",t.result.address_component);let{province:e,city:a,district:s}=t.result.address_component;console.log(e,a,s);let o=P.find((t=>t.cityName==a));if(!o)return uni.$u.toast("获取定位失败,请手动选择城市");R.setCar("city",o.code),R.setCar("cityName",o.cityName),console.log(o,"当前城市")})).catch((()=>{uni.$u.toast("获取定位失败,请手动选择城市")}))},fail(){uni.$u.toast("获取定位失败,请手动选择城市")}})}return function(){let t=_.map((t=>t.cityInfoList.map((t=>({cityName:t.cityName,pinYin:t.cityPinyin,py:t.cityAcronym.toLocaleLowerCase(),code:t.cityCode,cityInitial:t.cityInitial})))));P=t.flat(),console.log(P)}(),(t,e)=>{const a=b(i("up-navbar"),I),s=l,o=b(i("up-icon"),S),g=h,w=b(i("u-icon"),S),k=B,v=b(i("oneBtn"),D);return r(),n(s,{class:"content"},{default:c((()=>[p(a,{title:"选择类型",onLeftClick:T,autoBack:!1}),p(s,{class:"padding"},{default:c((()=>[p(s,{class:"tit"},{default:c((()=>[u("请选择城市")])),_:1}),p(s,{class:"ard_row"},{default:c((()=>[p(s,{class:"leftBox",onClick:U},{default:c((()=>[p(o,{name:"map",size:"20"}),d(R).carInfo.cityName?(r(),n(s,{key:0,class:"text"},{default:c((()=>[u(m(d(R).carInfo.cityName)+" ",1),p(g,{style:{"font-size":"20rpx",color:"blue","margin-left":"10rpx"}},{default:c((()=>[u("(包函当地题库)")])),_:1})])),_:1})):(r(),n(s,{key:1,class:"text"},{default:c((()=>[u("选择城市")])),_:1}))])),_:1}),p(s,{class:"moreBox",onClick:e[0]||(e[0]=e=>t.$goPage("/pages/index/comp/city"))},{default:c((()=>[p(s,{class:"txt"},{default:c((()=>[u("选择城市")])),_:1}),p(w,{name:"arrow-right",color:"#1989FA",size:"14"})])),_:1})])),_:1}),p(s,{class:"tit"},{default:c((()=>[u("请选择需要学习的题库类型")])),_:1}),p(s,{class:"ul"},{default:c((()=>[(r(!0),A(y,null,f(J.value,((t,e)=>(r(),n(s,{class:C(["li",{active:t.id==O.value.id}]),key:e,onClick:e=>function(t){O.value=t,R.setCar("carType",t.carType),R