index1.nvue 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016
  1. <template>
  2. <view class="page">
  3. <map id="map" :longitude='longitude' :latitude='latitude' :scale='18' @markertap="marker" :show-location="true"
  4. :markers="markers" :polygons="polygons"></map>
  5. <!-- <footer params="current" v:if="footerShow" bind:scanCode="scanCode"></footer> -->
  6. <cover-view class="area">
  7. <cover-view @click="parkShow1">
  8. <image src="http://resource.weilaibike.com/yunwei/parkShow.png" style="width:48rpx;height:56rpx;"></image>
  9. <text style="color:parkAreaShow==true?'red':'black';padding-left:10rpx;">还车点</text>
  10. </cover-view>
  11. <cover-view @click="forbidShow">
  12. <image src="http://resource.weilaibike.com/yunwei/forbid.png" style="width:48rpx;height:56rpx;"></image>
  13. <text style="color:noParkAreaShow==true?'red':'black';padding-left:10rpx;">禁停区</text>
  14. </cover-view>
  15. </cover-view>
  16. <view class="iconHint">
  17. <view class="operate" @click="operate">
  18. <view style="height:60rpx;width:60rpx;background:#fff;border-radius:50%;" class="flexC">
  19. <image src="http://resource.weilaibike.com/yunwei/operation.png" style="width:46rpx;height:46rpx;"></image>
  20. </view>
  21. </view>
  22. <view class="flexB">
  23. <image src="http://resource.weilaibike.com/bike_yunwei/location.png" @click="posi"></image>
  24. <view @click="hintIcon" class="how">如何识别地图上的图标</view>
  25. <image src="http://resource.weilaibike.com/bike_yunwei/ref.png" @click="load"></image>
  26. </view>
  27. </view>
  28. <view class="cover" v-if="hintShow"></view>
  29. <view class="hintPop" v-if="hintShow">
  30. <view class="hintCon">
  31. <view class="intr">提示说明:</view>
  32. <view class="icon">
  33. <view v-for="(item,index) in iconList1" :key="index">
  34. <image src="item.icon"></image>
  35. <text>{{item.con}}</text>
  36. </view>
  37. </view>
  38. <view class="close" @click="closeHint">
  39. <image src="http://resource.weilaibike.com/common/closePop.png"></image>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="cover" v-if="sideShow" @click="closeSide"></view>
  44. <view class="side" v-if="sideShow">
  45. <view class="record flexA">
  46. <view @click="modify">
  47. <image src="http://resource.weilaibike.com/yunwei/amend.png" style="width:40rpx;height:40rpx;"></image>
  48. <text>修改</text>
  49. </view>
  50. <view @click="reqair">
  51. <image src="http://resource.weilaibike.com/yunwei/maintain.png"></image>
  52. <text>报修</text>
  53. </view>
  54. <view @click="bike_detail">
  55. <image src="http://resource.weilaibike.com/yunwei/bikeDe.png" style="width:45rpx;height:45rpx;"></image>
  56. <text>详情</text>
  57. </view>
  58. </view>
  59. <view class="bikeNo flexA">
  60. <input placeholder="请输入车牌号" value="bikeDetail.bike_info.bike_no" bindinput="bindKeyInput" bindblur="bindKeyInput"
  61. placeholder-class="place" type="number"></input>
  62. <text @click="getBike_info">查找</text>
  63. <text @click="scanCode">扫描</text>
  64. </view>
  65. <view class="info" style="background:url('http://resource.weilaibike.com/bike_yunwei/sideBg.png') no-repeat;background-size:100% 100%;">
  66. <view class="infoCon">
  67. <view class="infoLeft">
  68. <view style="font-size: 30rpx;font-weight:bold;padding:10rpx 0;">车辆检测信息</view>
  69. <view style="margin-bottom:screenHeight=='xSeries' ? '12rpx' : '7rpx'">车牌号:{{bikeDetail.bike_info.bike_no}}</view>
  70. <view style="margin-bottom:screenHeight=='xSeries' ? '12rpx' : '7rpx'">当前电量:{{bikeDetail.bike_info.battery_power}}%</view>
  71. <view style="margin-bottom:screenHeight=='xSeries' ? '12rpx' : '7rpx'">车辆状态:{{bikeDetail.bike_info.tab_name}}</view>
  72. </view>
  73. <view class="infoRight">
  74. <image src="http://resource.weilaibike.com/bike_yunwei/sideRef.png" @click="refresh_power"></image>
  75. </view>
  76. </view>
  77. <view style="margin-bottom:screenHeight=='xSeries' ? '12rpx' : '7rpx'" class="last">{{bikeDetail.bike_info.tab_name=="中控离线"?'离线时间':'最后定位'}}:{{bikeDetail.bike_info.last_time}}</view>
  78. </view>
  79. <view class="position flexB" @click="bikePosition">
  80. <text>车辆位置</text>
  81. <!-- <van-icon name="arrow" color="#8A8A8A" /> -->
  82. </view>
  83. <view class="order " @click="recentOrder">
  84. <view class="flexB recent">
  85. <text>最近订单</text>
  86. <!-- <van-icon name="arrow" color="#8A8A8A" size="16px" /> -->
  87. </view>
  88. <view class="flex" style="color:#28282877;" v-if="bikeDetail.bike_order!=''">
  89. <view>{{bikeDetail.bike_order[0].mobile}} </view>
  90. <view style="width:287rpx;overflow: hidden;text-overflow:ellipsis;white-space: nowrap;margin-left:15rpx;">
  91. {{bikeDetail.bike_order[0].username}}</view>
  92. </view>
  93. <view v-if="bikeDetail.bike_order==''" style="color:#28282877;">暂无订单信息</view>
  94. <view>
  95. <!-- <text style="color:#28282877;margin-right:10rpx;">{{bikeDetail.bike_order[0].order_status}}</text> -->
  96. <!-- <text v-if="bikeDetail.bike_order[0].mobile" style="color:#28282877;">{{bikeDetail.bike_order[0].start_use_bike_time_app}}-{{bikeDetail.bike_order[0].end_use_bike_time_app}}</text> -->
  97. </view>
  98. </view>
  99. <view class="directive">
  100. <view class="dire">
  101. <text style="font-size:32rpx;">车辆检测指令</text>
  102. 只开启蓝牙操控
  103. <!-- <switch checked="{{switch1Checked}}" bindchange="switch1Change" /> -->
  104. </view>
  105. <view>
  106. <view class="flexA list" style="height:100%;">
  107. <view style="text-align:center;margin-top:10rpx;" @click="whistle">
  108. <image src="/static/img/whistle.png" style="width:58rpx;height:58rpx;"></image>
  109. <text style="margin:15rpx 0;">鸣笛</text>
  110. </view>
  111. <view style="text-align:center;margin-top:10rpx;" @click="unlock">
  112. <image src="/static/img/open-lock.png" style="width:58rpx;height:58rpx;"></image>
  113. <text style="margin:15rpx 0;">开电车锁</text>
  114. </view>
  115. <view style="text-align:center;margin-top:10rpx;" @click="close_lock">
  116. <image src="/static/img/close-lock.png" style="width:58rpx;height:58rpx;"></image>
  117. <text style="margin:15rpx 0;">关电车锁</text>
  118. </view>
  119. <view style="text-align:center;" @click="battery_load">
  120. <image src="/static/img/battery-load.png" style="width:58rpx;height:58rpx;"></image>
  121. <text style="margin:15rpx 0;">开电池锁</text>
  122. </view>
  123. <view style="text-align:center;" @click="online">
  124. <image src="/static/img/online.png" style="width:62rpx;height:60rpx;"></image>
  125. <text style="margin:15rpx 0;">上线</text>
  126. </view>
  127. <view style="text-align:center;" @click="more">
  128. <image src="/static/img/more.png" style="width:62rpx;height:60rpx;"></image>
  129. <text style="margin:15rpx 0;">更多</text>
  130. </view>
  131. </view>
  132. </view>
  133. </view>
  134. <view class="workBtn">
  135. <view @click="showPop" :class="typeName==1?'changeWork':''" class="shelters">
  136. <text>工单记录</text>
  137. <text class="count flexC" v-if="workCount">{{workCount}}</text>
  138. </view>
  139. <view @click="showPop" :class="typeName==2?'changeWork':''" class="has">
  140. <text>报修记录</text>
  141. <text class="count flexC" v-if="repairsCount">{{repairsCount}}</text>
  142. </view>
  143. </view>
  144. <!-- <view class="amend flexC" bindtap="lookWork">查看工单</view> -->
  145. </view>
  146. <view class="background" v-if="moreShow" @click="coverHidn" catchtouchmove="true"></view>
  147. <view class="more" v-if="moreShow">
  148. <view @click="Offline">
  149. <image src="/img/offline.png" style="width:62rpx;height:60rpx;"></image>
  150. <text>下线</text>
  151. </view>
  152. <view @click="renewalPower">
  153. <image src="/img/renewalPower.png" style="width:62rpx;height:60rpx;"></image>
  154. <text>更新电量</text>
  155. </view>
  156. <view @click="renewalLocation">
  157. <image src="/img/renewalLocation.png" style="width:62rpx;height:60rpx;"></image>
  158. <text>更新位置</text>
  159. </view>
  160. <view @click="renewal">
  161. <image src="/img/renewal.png" style="width:62rpx;height:60rpx;"></image>
  162. <text>重启中控</text>
  163. </view>
  164. <view @click="recover">
  165. <image src="http://resource.weilaibike.com/bike_yunwei/park.png" style="width:50rpx;height:50rpx;"></image>
  166. <text>设为停车区</text>
  167. </view>
  168. </view>
  169. <view class="background" v-if="workShow" @click="coverHidn" catchtouchmove="true"></view>
  170. <view class="work" v-if="workShow">
  171. <view class="workTitle flexC">
  172. <text>{{bikeId}}</text>
  173. <text style="margin-left:15rpx;">工单记录</text>
  174. </view>
  175. <view class="workTab flexC">
  176. <view @click="workChoose" :class="workState==1?'cur':''">待领工单</view>
  177. <view @click="workChoose" :class="workState==2?'cur':''">已领工单</view>
  178. </view>
  179. <scroll-view class="wait" scroll-top='topNum' scroll-y="true" bindscrolltolower="moreWork" :style="list.length>=2 ? 'background:#efefef':'background:#fff'">
  180. <view v-for="(item,index) in list" :key="index" class="waitCon mead">
  181. <view bindtouchstart="touchS" bindtouchmove="touchM" bindtouchend="touchE" style="item.txtStyle" class="content">
  182. <view style="font-size:28rpx;" class="title">
  183. <view class="left">{{item.type_name}}</view>
  184. <view class="right">{{item.planned}}</view>
  185. </view>
  186. <view class="body">
  187. <view class="left">
  188. <image style="width:90rpx;height:90rpx;" src="http://resource.weilaibike.com/yunwei/rescue.png" v-if="item.type_name=='道路救援工单'"></image>
  189. <image style="width:80rpx;height:80rpx;" src="http://resource.weilaibike.com/yunwei/posi.png" v-if="item.type_name=='车辆定位出现问题'"></image>
  190. <image style="width:100rpx;height:100rpx;" src="http://resource.weilaibike.com/bike_yunwei/outLi.png" v-if="item.type_name=='离线工单'"></image>
  191. <image style="width:100rpx;height:100rpx;" src="http://resource.weilaibike.com/yunwei/fault.png" v-if="item.type_name=='故障工单'"></image>
  192. <image style="width:90rpx;height:90rpx;" src="http://resource.weilaibike.com/yunwei/charge.png" v-if="item.type_name=='充电工单'"></image>
  193. <image style="width:100rpx;height:100rpx;" src="http://resource.weilaibike.com/yunwei/steal.png" v-if="item.type_name=='偷盗工单'"></image>
  194. <image style="width:90rpx;height:90rpx;" src="http://resource.weilaibike.com/yunwei/look1.png" v-if="item.type_name=='查看工单'"></image>
  195. <image style="width:90rpx;height:90rpx;" src="http://resource.weilaibike.com/yunwei/otherWork.png" v-if="item.type_name=='其他工单'"></image>
  196. <image style="width:100rpx;height:100rpx;" src="http://resource.weilaibike.com/yunwei/alarm1.png" v-if="item.type_name=='警报工单'"></image>
  197. <image style="width:80rpx;height:80rpx;" src="http://resource.weilaibike.com/yunwei/leader.png" v-if="item.type_name=='组长工单'"></image>
  198. <image style="width:100rpx;height:100rpx;" src="http://resource.weilaibike.com/yunwei/prepare.png" v-if="item.type_name=='备用电池电量低报警'"></image>
  199. <image style="width:90rpx;height:90rpx;" src="http://resource.weilaibike.com/xiaobanma_yunwei/lowPower_xbm.png"
  200. v-if="item.type_name=='断电工单'"></image>
  201. </view>
  202. <view class="right">
  203. <view class="reason" style="width:100%;color:#555;font-size:28rpx; white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">原因:{{item.reason?item.reason:item.type_name}}</view>
  204. <view class="reason" style="color:#999999;flex-grow:1;">来源:{{item.source}}</view>
  205. </view>
  206. </view>
  207. <view class="time">更新时间:{{item.updated_at}}</view>
  208. </view>
  209. <view :class="workState==1?'get':'finish'" class="del" @click="workState==1?'getWork':'finishWork'">{{workState == 1 ? '领取':'完成'}}
  210. </view>
  211. </view>
  212. <view class="no" v-if="list.length == 0">
  213. <image src="http://resource.weilaibike.com/none.png"></image>
  214. <view>暂无相关数据~</view>
  215. </view>
  216. </scroll-view>
  217. </view>
  218. <view class="background" v-if="repairsShow" @click="coverHidn" catchtouchmove="true"></view>
  219. <view class="work" v-if="repairsShow">
  220. <view class="workTitle flexC">
  221. <text>{{bikeId}}</text>
  222. <text style="margin-left:15rpx;">报修记录</text>
  223. </view>
  224. <view class="workTab flexC">
  225. <view @click="repairsChoose" :class="repairsState==1?'cur':''">未读</view>
  226. <view @click="repairsChoose" :class="repairsState==2?'cur':''">已读</view>
  227. </view>
  228. <scroll-view class="wait" scroll-y="true" bindscrolltolower="morkRepairs" :style="repairsList.length>=2 ? 'background:#efefef':'background:#fff'"
  229. scroll-top='topNum'>
  230. <view v-for="(item,index) in repairsList" :key="index" class="waitCon mead">
  231. <view style="item.txtStyle" class="content">
  232. <view style="font-size:28rpx;" class="title">
  233. <view class="left">{{item.trouble_part}}</view>
  234. <view class="right" v-if="repairsState==1" @click="markRead">标为已读</view>
  235. </view>
  236. <view class="body">
  237. <view class="left">
  238. <image style="height:50rpx;width:112rpx" src="http://resource.weilaibike.com/yunwei/rep4.png" v-if="item.trouble_part=='刹车'"></image>
  239. <image style="height:96rpx;width:96rpx" src="http://resource.weilaibike.com/yunwei/rep6.png" v-if="item.trouble_part=='车胎'"></image>
  240. <image style="height:58rpx;width:116rpx" src="http://resource.weilaibike.com/yunwei/rep5.png" v-if="item.trouble_part=='链条'"></image>
  241. <image style="height:66rpx;width:116rpx" src="http://resource.weilaibike.com/yunwei/rep1.png" v-if="item.trouble_part=='车座'"></image>
  242. <image style="height:80rpx;width:60rpx" src="http://resource.weilaibike.com/yunwei/rep2.png" v-if="item.trouble_part=='二维码'"></image>
  243. <image style="height:72rpx;width:64rpx" src="http://resource.weilaibike.com/yunwei/rep3.png" v-if="item.trouble_part=='其他'"></image>
  244. </view>
  245. <view class="right">
  246. <view class="describe">问题描述:{{item.trouble_description}}</view>
  247. </view>
  248. </view>
  249. <view class="time">
  250. <text>创建时间:{{item.created_at}}</text>
  251. <text @click="phone" style="margin-left:40rpx;">手机号:{{item.users.mobile}}</text>
  252. </view>
  253. <!-- <view class="block"></view> -->
  254. </view>
  255. </view>
  256. <view class="no" v-if="repairsList.length == 0">
  257. <image src="http://resource.weilaibike.com/none.png"></image>
  258. <view>暂无相关数据~</view>
  259. </view>
  260. </scroll-view>
  261. </view>
  262. <!-- <footer params="current" v-if="footerShow" bind:scanCode="scanCode"></footer> -->
  263. </view>
  264. </template>
  265. <script>
  266. var app = getApp()
  267. export default {
  268. data() {
  269. return {
  270. current: 3,
  271. bike_no: '', //车牌号
  272. hintShow: false, //是否显示提示弹窗
  273. sideShow: false, //是否显示侧边栏
  274. footerShow: true,
  275. iconList1: [{
  276. icon: "http://resource.weilaibike.com/xiaobanma_yunwei/outline_xbm.png",
  277. con: "下线"
  278. },
  279. {
  280. icon: "http://resource.weilaibike.com/xiaobanma_yunwei/lowPower_xbm.png",
  281. con: "低电量"
  282. },
  283. {
  284. icon: "http://resource.weilaibike.com/xiaobanma_yunwei/noUser_xbm.png",
  285. con: "未使用"
  286. },
  287. {
  288. icon: "http://resource.weilaibike.com/trobole.png",
  289. con: "故障"
  290. },
  291. {
  292. icon: "http://resource.weilaibike.com/xiaobanma_yunwei/repair_xbm.png",
  293. con: "待维修"
  294. },
  295. {
  296. icon: "http://resource.weilaibike.com/xiaobanma_yunwei/noInPark_xbm.png",
  297. con: "未在停车区"
  298. },
  299. {
  300. icon: "http://resource.weilaibike.com/xiaobanma_yunwei/riding_xbm.png",
  301. con: "骑行中"
  302. },
  303. {
  304. icon: "http://resource.weilaibike.com/bike_yunwei/outLi.png",
  305. con: "离线"
  306. },
  307. {
  308. icon: "http://resource.weilaibike.com/bike_yunwei/work.png",
  309. con: "运维人员骑行"
  310. },
  311. ],
  312. markers: [], //显示单车、停车的P
  313. polygons: [], //区域
  314. longitude: '113.779801',
  315. latitude: '34.753993',
  316. // allArea: [{
  317. // text: '全部区域',
  318. // value: 0,
  319. // areaID: ''
  320. // }],
  321. allArea: [],
  322. allEle: [{
  323. text: '全部电量',
  324. value: 0,
  325. areaID: ''
  326. },
  327. {
  328. text: '70%以下',
  329. value: 1,
  330. areaID: '70'
  331. },
  332. {
  333. text: '60%以下',
  334. value: 2,
  335. areaID: '60'
  336. },
  337. {
  338. text: '50%以下',
  339. value: 3,
  340. areaID: '50'
  341. },
  342. {
  343. text: '30%以下',
  344. value: 4,
  345. areaID: '30'
  346. },
  347. {
  348. text: '20%以下',
  349. value: 5,
  350. areaID: '20'
  351. },
  352. ],
  353. allStatus: [{
  354. text: '全部状态',
  355. value: 0,
  356. areaID: ''
  357. }],
  358. allDay: [{
  359. text: '使用状态',
  360. value: 0
  361. },
  362. {
  363. text: '1天未使用',
  364. value: 1
  365. },
  366. {
  367. text: '3天未使用',
  368. value: 2
  369. },
  370. {
  371. text: '7天未使用',
  372. value: 3
  373. }
  374. ],
  375. area: 0,
  376. ele: 0,
  377. status: 0,
  378. day: 0,
  379. show: false, //车子详情的布尔值
  380. longitude: '113.779801',
  381. latitude: '34.753993',
  382. id: '', //停车区域的ID
  383. stopP: false, //判断是否显示停车区域
  384. polygons1: [], //可骑行区域 先用这个变量代表
  385. controls: [], //地图上当前定位的箭头
  386. background: '', //弹窗的背景颜色
  387. over: '', //关闭图标
  388. location: '', //是否有位置权限
  389. bluetooth: false, //是否开启蓝牙 false开始 true未开启
  390. box_no: '', //中控编号
  391. bikeDetail: [],
  392. bikeId: '',
  393. areaID: '',
  394. low_power: '',
  395. state: '',
  396. use_state: '',
  397. parkAreaShow: false, //还车点是否显示
  398. noParkAreaShow: true, //禁停区是否显示
  399. ridding: true,
  400. moreShow: false,
  401. screenHeight: '', //屏幕可视高度
  402. areas: [],
  403. parking: [],
  404. parking_points: [],
  405. no_parking: [],
  406. no_parking_points: [],
  407. parkShow: '',
  408. switch1Checked: '',
  409. delBtnWidth: 200, //删除或完成 按钮宽度
  410. typeName: '', //1 待认领工单 2已领工单
  411. page: 1, //当前页面
  412. workShow: false, //工单弹窗
  413. workCount: '', //侧边栏报修数量(未读)
  414. list: [], //工单列表
  415. workState: 1, //工单列表状态【1 待领取 2已领】
  416. repairsList: [], //报修列表
  417. repairsCount: '', //侧边栏工单数量(未认领)
  418. repairsState: 1, //报修列表状态【1 未读 2已读】
  419. repairsShow: false, //是否显示报修弹窗 【false 不显示 true 显示】
  420. topNum: 0,
  421. }
  422. },
  423. methods: {
  424. touchS: function(e) {
  425. if (e.touches.length == 1) {
  426. this.startX = e.touches[0].clientX
  427. //设置触摸起始点水平方向位置
  428. }
  429. },
  430. touchM: function(e) {
  431. // console.log(this.data.list[index].txtStyle)
  432. // console.log(e);
  433. if (e.touches.length == 1) {
  434. //手指移动时水平方向位置
  435. var moveX = e.touches[0].clientX;
  436. //手指起始点位置与移动期间的差值
  437. var disX = this.startX - moveX;
  438. // console.log(disX,'disX')
  439. var delBtnWidth = this.delBtnWidth;
  440. var txtStyle = "";
  441. if (disX == 0 || disX < 0) { //如果移动距离小于等于0,文本层位置不变
  442. txtStyle = "left:0rpx";
  443. } else if (disX > 0) { //移动距离大于0,文本层left值等于手指移动距离
  444. txtStyle = "left:-" + disX + "rpx";
  445. if (disX >= delBtnWidth) {
  446. //控制手指移动距离最大值为删除按钮的宽度
  447. txtStyle = "left:-" + delBtnWidth + "rpx";
  448. }
  449. }
  450. //获取手指触摸的是哪一项
  451. var index = e.currentTarget.dataset.idx;
  452. var list = this.list;
  453. list[index].txtStyle = txtStyle;
  454. //更新列表的状态
  455. this.list = list
  456. }
  457. },
  458. touchE: function(e) {
  459. if (e.changedTouches.length == 1) {
  460. //手指移动结束后水平位置
  461. var endX = e.changedTouches[0].clientX;
  462. //触摸开始与结束,手指移动的距离
  463. var disX = this.startX - endX;
  464. var delBtnWidth = this.delBtnWidth;
  465. //如果距离小于删除按钮的1/2,不显示删除按钮
  466. var txtStyle = disX > delBtnWidth / 2 ? "left:-" + delBtnWidth + "rpx" : "left:0rpx";
  467. //获取手指触摸的是哪一项
  468. var index = e.currentTarget.dataset.idx;
  469. var list = this.list;
  470. list[index].txtStyle = txtStyle;
  471. //更新列表的状态
  472. this.list = list
  473. }
  474. },
  475. goTop: function(e) { // 一键回到顶部
  476. this.topNum = 0
  477. },
  478. coverHidn:function(e) {
  479. let show = e.currentTarget.dataset.show;
  480. if (show == 1) {
  481. this.moreShow = false;
  482. this.workState = 1;
  483. } else if (show == 2) {
  484. this.workShow = false;
  485. this.typeName = '';
  486. } else if (show == 3) {
  487. this.repairsShow = false;
  488. this.typeName = '';
  489. this.repairsState = 1;
  490. }
  491. },
  492. phone:function(e) {
  493. console.log(1111)
  494. uni.makePhoneCall({
  495. phoneNumber: e.currentTarget.dataset.phone
  496. })
  497. },
  498. showPop:function(e) {
  499. let show = e.currentTarget.dataset.idx;
  500. this.typeName = show;
  501. if (show == 1) {
  502. this.workShow = true;
  503. this.lookWork();
  504. } else if (show == 2) {
  505. this.repairsShow = true;
  506. this.lookRepairs();
  507. }
  508. },
  509. workChoose:function(e) {
  510. uni.showLoading({
  511. title: '加载中...',
  512. })
  513. let state = e.currentTarget.dataset.state;
  514. this.workState = state;
  515. this.list = []
  516. this.lookWork();
  517. this.goTop();
  518. },
  519. //工单列表
  520. lookWork:function() {
  521. uni.showLoading({
  522. title: '加载中...',
  523. })
  524. let that = this;
  525. let planned = '';
  526. let url = "";
  527. let state = that.workState
  528. // console.log(state, 'workState')
  529. if (state == 1) {
  530. planned = 1
  531. url = "work_order/list?planned=" + planned + "&bike_no=" + that.bikeId
  532. } else {
  533. let planned = 2;
  534. url = 'work_order/myWorkOrderList?planned=' + planned + "&bike_no=" + that.bikeId
  535. }
  536. app.request(url, '', 'GET').then(res => {
  537. uni.hideLoading();
  538. let work = res.data.data;
  539. // console.log(work, '工单列表')
  540. if (work.length == 0) {
  541. // uni.showToast({
  542. // title: '暂无工单~',
  543. // icon: 'none'
  544. // })
  545. this.list = ''
  546. } else {
  547. work.map(i => {
  548. i.txtStyle = 'left:0rpx'
  549. })
  550. this.workShow = true;
  551. this.list = work;
  552. // console.log(that.data.list, 'list')
  553. }
  554. })
  555. },
  556. //接单
  557. getWork:function(e) {
  558. uni.showLoading({
  559. title: '领取中...',
  560. })
  561. let id = e.currentTarget.dataset.id
  562. console.log(id, 'getWorkid');
  563. app.request('work_order/receive?work_order_id=' + id, '', 'GET').then(res => {
  564. uni.hideLoading();
  565. console.log(res)
  566. if (res.statusCode == 200) {
  567. uni.showToast({
  568. title: '接单成功',
  569. icon: "none"
  570. })
  571. let work = this.list;
  572. work.map((i, index) => {
  573. if (i.id == id) {
  574. work.splice(index, 1)
  575. console.log(i)
  576. }
  577. })
  578. let count = this.workCount
  579. count = count - 1
  580. this.list = work;
  581. this.workCount = count;
  582. if (work.length == 0) {
  583. uni.showToast({
  584. title: '该车辆已无待领工单~',
  585. icon: 'none'
  586. })
  587. this.workShow = false;
  588. this.workCount = ''
  589. }
  590. }
  591. })
  592. },
  593. //完成
  594. finishWork:function(e) {
  595. uni.showLoading({
  596. title: '操作中...',
  597. })
  598. // console.log('finishWork')
  599. let id = e.currentTarget.dataset.id
  600. console.log(id, 'finishWorkId')
  601. app.request('work_order/over?work_order_id=' + id, '', 'GET').then(res => {
  602. uni.hideLoading();
  603. if (res.statusCode == 200) {
  604. console.log(res)
  605. uni.showToast({
  606. title: '操作成功',
  607. icon: "none"
  608. })
  609. let list = this.list
  610. list.map((i, index) => {
  611. if (i.id == id) {
  612. console.log(i)
  613. list.splice(index, 1)
  614. }
  615. })
  616. this.list = list;
  617. if (list.length == 0) {
  618. uni.showToast({
  619. title: '已完成所有认领工单~',
  620. icon: 'none'
  621. })
  622. this.workShow = false;
  623. }
  624. }
  625. })
  626. },
  627. //上拉加载
  628. moreWork:function() {
  629. uni.showLoading({
  630. title: '加载中...',
  631. })
  632. let that = this;
  633. var page = that.page + 1;
  634. let planned = '';
  635. let url = "";
  636. if (that.workState == 1) {
  637. planned = 1
  638. url = "work_order/list?planned=" + planned + "&bike_no=" + that.bikeId + '&page=' + page
  639. } else {
  640. planned = 2
  641. url = 'work_order/myWorkOrderList?planned=' + planned + "&bike_no=" + that.bikeId + '&page=' + page
  642. }
  643. app.request(url, '', 'GET').then(res => {
  644. uni.hideLoading();
  645. if (res.data.data.length > 0) {
  646. let work = res.data.data
  647. work.map(i => {
  648. i.txtStyle = 'left:0rpx'
  649. })
  650. this.workShow = true;
  651. this.list = that.list.concat(work);
  652. this.page = page;
  653. } else {
  654. uni.showToast({
  655. title: '没有更多数据了~',
  656. icon: 'none'
  657. })
  658. }
  659. })
  660. },
  661. //报修列表
  662. lookRepairs:function() {
  663. uni.showLoading({
  664. title: '加载中...',
  665. })
  666. let status = ''
  667. let state = this.repairsState
  668. if (state == 1) {
  669. status = 0
  670. } else if (state == 2) {
  671. status = 1
  672. }
  673. app.request('user/userRepaired?bike_no=' + this.bikeId + '&status=' + status, '', 'GET').then(res => {
  674. if (res.statusCode == 200) {
  675. uni.hideLoading();
  676. // console.log(res, '报修列表')
  677. let list = res.data.data;
  678. if (list.length == 0) {
  679. // uni.showToast({
  680. // title: '暂无报修记录~',
  681. // icon: 'none'
  682. // })
  683. this.repairsList = []
  684. } else {
  685. let repairs = res.data.data;
  686. repairs.map(i => {
  687. i.txtStyle = 'left:0rpx'
  688. })
  689. this.repairsList = res.data.data;
  690. }
  691. }
  692. })
  693. },
  694. repairsChoose:function(e) {
  695. let state = e.currentTarget.dataset.state;
  696. this.repairsState = state;
  697. this.repairsList = [];
  698. this.lookRepairs();
  699. this.goTop();
  700. },
  701. markRead:function(e) {
  702. let id = e.currentTarget.dataset.id
  703. app.request('user/userRepaired/status?id=' + id, '', 'GET').then(res => {
  704. if (res.statusCode == 200) {
  705. console.log(res)
  706. this.lookRepairs();
  707. let list = this.repairsList;
  708. if (list.length == 0) {
  709. uni.showToast({
  710. title: '暂无报修~',
  711. icon: 'none'
  712. })
  713. this.repairsCount = ''
  714. } else {
  715. let count = this.repairsCount;
  716. count = count - 1;
  717. this.repairsCount = count;
  718. }
  719. }
  720. })
  721. },
  722. morkRepairs:function() {
  723. uni.showLoading({
  724. title: '加载中...',
  725. })
  726. let that = this;
  727. let status = '';
  728. var page = that.page + 1;
  729. let state = this.repairsState
  730. if (state == 1) {
  731. status = 0
  732. } else if (state == 2) {
  733. status = 1
  734. }
  735. app.request('user/userRepaired?bike_no=' + this.bikeId + '&status=' + status + '&page=' + page, '', 'GET').then(res => {
  736. uni.hideLoading();
  737. if (res.statusCode == 200) {
  738. let list = res.data.data;
  739. if (list.length > 0) {
  740. this.repairsList = that.repairsList.concat(list);
  741. this.page = page;
  742. } else {
  743. uni.showToast({
  744. title: '没有更多数据了~',
  745. icon: 'none'
  746. })
  747. }
  748. }
  749. })
  750. },
  751. more: function() {
  752. this.moreShow = true;
  753. },
  754. async initData(isLoad = false) {
  755. var that = this;
  756. this.markers = [];
  757. uni.showLoading({
  758. title: '加载中...',
  759. })
  760. await app.request('getAreas?put_area_id=' + that.areaID, '', 'GET').then(res => {
  761. uni.hideLoading();
  762. // console.log(res.data.ridding_area);
  763. let data = res.data
  764. that.ridding_area = data.ridding_area;
  765. that.no_parking = data.no_parking_area;
  766. that.no_parking_points = data.no_parking_points;
  767. that.parking = data.parking_area;
  768. that.parking_points = data.parking_points;
  769. if (isLoad) {
  770. this.showArea(1)
  771. if (this.noParkAreaShow) this.showNoParking(0)
  772. if (this.parkAreaShow) this.showParking(0)
  773. }
  774. })
  775. },
  776. showArea:function(type = 0) {
  777. if (type) {
  778. this.polygons = this.ridding_area;
  779. } else {
  780. this.polygons = this.polygons.concat(this.ridding_area)
  781. }
  782. },
  783. clear:function(type=0) {
  784. if (type === 0) {
  785. let polygons = this.polygons.filter((polygons) => {
  786. if (polygons.id.slice(0, 1) === 'A') {
  787. return false
  788. }
  789. return true
  790. })
  791. this.polygons = polygons;
  792. }
  793. if (type === 1) {
  794. let polygons = this.polygons.filter((polygons) => {
  795. if (polygons.id.slice(0, 1) !== 'P') {
  796. return true
  797. }
  798. return false
  799. })
  800. let markers = this.markers.filter((polygons) => {
  801. if (polygons.id.slice(0, 1) !== 'p') {
  802. return true
  803. }
  804. return false
  805. })
  806. this.polygons = polygons;
  807. this.markers = markers;
  808. }
  809. if (type === 2) {
  810. let polygons = this.polygons.filter((polygons) => {
  811. if (polygons.id.slice(0, 1) !== 'N') {
  812. return true
  813. }
  814. return false
  815. })
  816. let markers = this.markers.filter((polygons) => {
  817. if (polygons.id.slice(0, 1) !== 'n') {
  818. return true
  819. }
  820. return false
  821. })
  822. this.polygons = polygons;
  823. this.markers = markers;
  824. }
  825. },
  826. //显示还车点 0:追加停车点 1:只显示停车点 2:删除停车点
  827. showParking:function(type = 0) {
  828. if (type === 0) {
  829. this.polygons = this.polygons.concat(this.parking);
  830. this.markers = this.markers.concat(this.parking_points);
  831. }
  832. if (type === 1) {
  833. this.polygons = this.parking;
  834. this.markers = this.markers;
  835. }
  836. if (type === 2) {
  837. this.clear(1)
  838. }
  839. },
  840. showNoParking:function(type = 0) {
  841. if (type === 0) {
  842. this.polygons = this.polygons.concat(this.no_parking);
  843. this.markers = this.markers.concat(this.no_parking_points);
  844. }
  845. if (type === 1) {
  846. this.polygons = this.no_parking;
  847. this.markers = this.no_parking_points;
  848. }
  849. if (type === 2) {
  850. this.clear(2)
  851. }
  852. },
  853. scanCode: function() {
  854. var that = this;
  855. console.log('scanCode')
  856. uni.scanCode({
  857. success: function(res) {
  858. let index = res.result.lastIndexOf("\=");
  859. var code = res.result.substring(index + 1, res.result.length);
  860. that.bikeId = code;
  861. that.getBike_info(code)
  862. },
  863. fail: function() {
  864. uni.showModal({
  865. title: '提示',
  866. content: '手动输入车辆标号',
  867. success: function(res) {
  868. if (res.confirm) {
  869. uni.navigateTo({
  870. url: '/pages/manualInp/manualInp',
  871. })
  872. }
  873. }
  874. })
  875. }
  876. })
  877. },
  878. getBikes: function(clear = 0) {
  879. uni.showLoading({
  880. title: '加载中...',
  881. })
  882. var that = this;
  883. var areaId = that.areaID;
  884. var low_power = that.low_power;
  885. var state = that.state;
  886. var use_state = that.use_state;
  887. let time = parseInt(use_state / 1000)
  888. if (time === 0) {
  889. time = ''
  890. }
  891. var data = {
  892. put_area_id: areaId,
  893. battery_power: low_power,
  894. all_states: state,
  895. last_use_bike_end_time: time
  896. };
  897. app.request('getBikes', data, 'POST').then(res => {
  898. uni.hideLoading();
  899. // console.log(res, 'bikes')
  900. let markers = this.markers
  901. if (clear) {
  902. markers = that.markers.filter((marker) => {
  903. if (marker.id.slice(0, 1) === 'B') {
  904. return false
  905. }
  906. return true
  907. })
  908. }
  909. that.markers = markers.concat(res.data);
  910. })
  911. },
  912. load: function() {
  913. uni.showLoading({
  914. title: '刷新中...',
  915. })
  916. this.markers = [];
  917. if (this.noParkAreaShow) {
  918. this.showNoParking(0);
  919. } else {
  920. this.showNoParking(2);
  921. }
  922. if (this.parkAreaShow) {
  923. this.showParking(0)
  924. } else {
  925. this.showParking(2)
  926. }
  927. this.getBikes(1);
  928. uni.hideLoading();
  929. },
  930. posi: function() {
  931. uni.showLoading({
  932. title: '定位中...',
  933. })
  934. //点击定位
  935. var that = this;
  936. uni.getLocation({
  937. type: 'gcj02',
  938. success: (res) => {
  939. uni.hideLoading();
  940. console.log(res, '定位信息')
  941. that.longitude = res.longitude;
  942. that.latitude = res.latitude;
  943. },
  944. fail: function(err) {
  945. uni.hideLoading();
  946. console.log(err)
  947. }
  948. })
  949. },
  950. change: function(e) {
  951. let that = this;
  952. console.log(e.detail)
  953. uni.setStorageSync('curVal', that.allArea[e.detail].value)
  954. uni.setStorageSync('curId', that.allArea[e.detail].areaID)
  955. this.areaID = that.allArea[e.detail].areaID;
  956. this.initData(1)
  957. that.getBikes(1)
  958. },
  959. change2: function(e) { //选择电量
  960. console.log(e)
  961. this.low_power = this.allEle[e.detail].areaID
  962. this.getBikes(1);
  963. },
  964. change3: function(e) { //选择状态
  965. console.log(e)
  966. this.state = this.allStatus[e.detail].areaID;
  967. this.getBikes(1)
  968. },
  969. change4: function(e) { //选择使用状态
  970. var time = new Date().getTime();
  971. var index = e.detail
  972. if (index == 0) {
  973. time = "";
  974. } else if (index == 1) {
  975. time = time - 86400000 * 1;
  976. } else if (index == 2) {
  977. time = time - 86400000 * 3;
  978. } else if (index == 3) {
  979. time = time - 86400000 * 7;
  980. }
  981. this.setData({
  982. use_state: time
  983. })
  984. this.getBikes(1)
  985. },
  986. marker: function(e) {
  987. console.log(e)
  988. // return;
  989. if (this.repairsShow || this.sideShow || this.workShow) return;
  990. // let type = markerId.slice(0, 1)
  991. //车辆索引
  992. // if (type === 'B') {
  993. // }
  994. var id = e.detail.markerId;
  995. id = id.substring(1, id.length);
  996. console.log(id)
  997. this.getBike_info(id)
  998. },
  999. // 获取车辆信息
  1000. getBike_info: function(bikeId = false) {
  1001. uni.showLoading({
  1002. title: '加载中...',
  1003. })
  1004. if (typeof bikeId === 'object') {
  1005. bikeId = this.bikeId
  1006. }
  1007. console.log(bikeId, 'bikeId')
  1008. this.bikeId = bikeId;
  1009. console.log(this.bikeId, 'bike_no')
  1010. app.request('bike/getBikeInfo?bike_no=' + this.bikeId, '', 'GET').then(res => {
  1011. uni.hideLoading();
  1012. console.log(res, '获取车辆信息')
  1013. if (res.data.bike_info == '') {
  1014. this.sideShow = false;
  1015. uni.showToast({
  1016. title: '暂无该车辆信息~',
  1017. })
  1018. } else {
  1019. this.bikeDetail = res.data;
  1020. this.sideShow = true;
  1021. this.footerShow = false;
  1022. }
  1023. })
  1024. app.request("work_order/list?planned=" + 1 + "&bike_no=" + bikeId, '', 'GET').then(res => {
  1025. if (res.statusCode == 200) {
  1026. // console.log(res.data.meta.total, '工单数量')
  1027. this.workCount = res.data.meta.total;
  1028. }
  1029. })
  1030. app.request('user/userRepaired?bike_no=' + bikeId + '&&status=' + 0, '', 'GET').then(res => {
  1031. // console.log(res.data)
  1032. // console.log(res.data.meta.total, '报修数量')
  1033. this.repairsCount = res.data.meta.total
  1034. })
  1035. },
  1036. //获取输入框的值
  1037. bindKeyInput:function(e) {
  1038. // console.log(e.detail.value, 11111)
  1039. this.bikeId = e.detail.value;
  1040. },
  1041. refresh_power: function() {
  1042. this.getBike_info(this.bikeId), uni.showToast({
  1043. title: '刷新完成',
  1044. icon: 'none'
  1045. })
  1046. },
  1047. bikePosition: function() {
  1048. uni.navigateTo({
  1049. url: '/pages/carPosition/carPosition?id=' + this.bikeDetail.bike_info.id + '&bike_no=' + this.bikeDetail.bike_info.bike_no,
  1050. })
  1051. },
  1052. recentOrder: function() {
  1053. console.log(123)
  1054. uni.navigateTo({
  1055. url: '../index/recentOrder?id=' + this.bikeDetail.bike_info.id
  1056. })
  1057. },
  1058. showPopup:function() {
  1059. this.show = true;
  1060. },
  1061. onClose:function() {
  1062. this.show = false;
  1063. },
  1064. modify: function() {
  1065. //跳转修改车辆信息
  1066. var bike = this.bikeDetail.bike_info
  1067. uni.navigateTo({
  1068. url: '/pages/amendCar/amendCar?id=' + bike.id + '&bike_no=' + bike.bike_no + '&box_no=' + bike.box_no,
  1069. })
  1070. },
  1071. parkShow1: function() {
  1072. this.parkAreaShow = !this.parkAreaShow
  1073. if (this.parkAreaShow) {
  1074. this.showParking(0)
  1075. } else {
  1076. this.showParking(2)
  1077. }
  1078. },
  1079. forbidShow:function() {
  1080. this.noParkAreaShow = !this.noParkAreaShow
  1081. if (this.noParkAreaShow) {
  1082. this.showNoParking(0);
  1083. } else {
  1084. this.showNoParking(2);
  1085. }
  1086. },
  1087. //显示图标提示弹窗
  1088. hintIcon:function() {
  1089. this.hintShow = true;
  1090. uni.hideTabBar({});
  1091. },
  1092. // 关闭图标提示弹窗
  1093. closeHint:function() {
  1094. this.hintShow = false;
  1095. uni.showTabBar({})
  1096. },
  1097. //关闭侧边栏
  1098. closeSide:function() {
  1099. this.sideShow = false;
  1100. this.footerShow = true;
  1101. this.workShow = false;
  1102. this.workState = 1;
  1103. this.repairsState = 1;
  1104. this.typeName = '';
  1105. uni.showTabBar({})
  1106. },
  1107. //调转我的工单
  1108. skipWork:function() {
  1109. uni.navigateTo({
  1110. url: '/pages/myWork/myWork',
  1111. })
  1112. },
  1113. // 鸣笛
  1114. whistle:function() {
  1115. var that = this;
  1116. app.request('bike/bikeBell?bike_id=' + that.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1117. if (res.statusCode == 200) {
  1118. // bluM.connectDeivece(that.bikeDetail.bike_info.box_no).then(res => {
  1119. // return bluM.bellBike()
  1120. // })
  1121. uni.showToast({
  1122. title: '响铃成功',
  1123. icon: 'none'
  1124. })
  1125. }
  1126. })
  1127. },
  1128. //开锁
  1129. unlock:function() {
  1130. var that = this;
  1131. app.request('bike/openBikeLock?bike_id=' + that.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1132. if (res.statusCode == 200) {
  1133. uni.showToast({
  1134. title: '开锁成功',
  1135. icon: 'none'
  1136. })
  1137. }
  1138. })
  1139. },
  1140. //关锁
  1141. close_lock:function() {
  1142. var that = this;
  1143. app.request('bike/closeBikeLock?bike_id=' + that.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1144. if (res.statusCode == 200) {
  1145. uni.showToast({
  1146. title: '关锁成功',
  1147. icon: 'none'
  1148. })
  1149. }
  1150. })
  1151. },
  1152. bike_detail: function() {
  1153. //车辆详情页面
  1154. var bike = this.bikeDetail.bike_info;
  1155. console.log(bike)
  1156. uni.navigateTo({
  1157. url: '/pages/carDetails/carDetails?bike_no=' + bike.bike_no + '&id=' + bike.id,
  1158. })
  1159. },
  1160. reqair: function() {
  1161. var bike = this.bikeDetail.bike_info;
  1162. uni.navigateTo({
  1163. url: '/pages/reqair/reqair?bike_no=' + bike.bike_no,
  1164. })
  1165. },
  1166. //开电池锁
  1167. battery_load:function() {
  1168. var that = this;
  1169. app.request('bike/openBatteryLock?bike_id=' + that.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1170. if (res.statusCode == 200) {
  1171. uni.showToast({
  1172. title: '开电池锁成功',
  1173. icon: 'none'
  1174. })
  1175. }
  1176. })
  1177. },
  1178. renewalPower: function() {
  1179. //更新电量
  1180. app.request('bike/newBikeBatteryMSG?bike_id=' + this.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1181. // console.log(res)
  1182. if (res.statusCode == 200) {
  1183. uni.showToast({
  1184. title: '更新电量成功',
  1185. icon: 'none'
  1186. })
  1187. }
  1188. })
  1189. },
  1190. renewalLocation: function() {
  1191. //更新位置
  1192. app.request('bike/newBikeLocation?bike_id=' + this.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1193. if (res.statusCode == 200) {
  1194. uni.showToast({
  1195. title: '更新位置成功',
  1196. icon: 'none'
  1197. })
  1198. }
  1199. })
  1200. },
  1201. renewal: function() {
  1202. //重启中控
  1203. var that = this;
  1204. app.request('bike/rebootBox?bike_id=' + that.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1205. if (res.statusCode == 200) {
  1206. uni.showToast({
  1207. title: '重启中控成功',
  1208. icon: 'none'
  1209. })
  1210. }
  1211. })
  1212. },
  1213. // 设为停车区
  1214. recover:function() {
  1215. app.request('bike/repairInParking?bike_id=' + this.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1216. // console.log(res)
  1217. if (res.statusCode == 200) {
  1218. uni.showToast({
  1219. title: '操作成功',
  1220. icon: 'none'
  1221. })
  1222. } else {
  1223. uni.showToast({
  1224. title: '操作失败',
  1225. icon: 'none'
  1226. })
  1227. }
  1228. })
  1229. },
  1230. //上线
  1231. online:function() {
  1232. app.request('bike/login?bike_id=' + this.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1233. // console.log(res)
  1234. if (res.statusCode == 200) {
  1235. uni.showToast({
  1236. title: '上线成功',
  1237. icon: 'none'
  1238. })
  1239. }
  1240. })
  1241. },
  1242. //下线
  1243. Offline:function() {
  1244. app.request('bike/logout?bike_id=' + this.bikeDetail.bike_info.id, '', 'GET').then(res => {
  1245. console.log(res)
  1246. if (res.statusCode == 200) {
  1247. uni.showToast({
  1248. title: '下线成功',
  1249. icon: 'none'
  1250. })
  1251. }
  1252. })
  1253. },
  1254. operate:function() {
  1255. uni.navigateTo({
  1256. url: '/pages/bikeInfo/bikeInfo'
  1257. })
  1258. },
  1259. },
  1260. onLoad(options) {
  1261. // console.log(app.request())
  1262. console.log(uni.getStorageSync('allArea'), 'allArea')
  1263. var that = this;
  1264. that.screenHeight = app.globalData.screenHeight;
  1265. let timer = setTimeout(function() {
  1266. if (uni.getStorageSync('allArea')) {
  1267. that.allArea = uni.getStorageSync('allArea');
  1268. that.allStatus = uni.getStorageSync('allState');
  1269. }
  1270. console.log(that.allArea)
  1271. let curVal = uni.getStorageSync('curVal')
  1272. console.log(curVal, 'log_curVal')
  1273. if (curVal) {
  1274. that.area = curVal;
  1275. }
  1276. let areaID = uni.getStorageSync('curId')
  1277. console.log(areaID, 'log_areaID')
  1278. if (areaID) {
  1279. that.areaID = areaID;
  1280. } else {
  1281. let id = that.allArea[0].areaID
  1282. that.areaID = id
  1283. }
  1284. // that.menu = that.selectComponent("#menu");
  1285. // that.menu.changeTitle(that.data.allArea[that.data.area].text);
  1286. }, 500)
  1287. that.posi(); //获取当前位置
  1288. this.initData(1)
  1289. if (options.bike_no) {
  1290. that.getBike_info(options.bike_no)
  1291. }
  1292. if (options.scan == 1) {
  1293. this.scanCode();
  1294. }
  1295. that.getBikes();
  1296. // that.lookWork();
  1297. // that.initEleWidth();
  1298. },
  1299. }
  1300. </script>
  1301. <style>
  1302. @import url('/static/base.css');
  1303. </style>
  1304. <style>
  1305. page {
  1306. width: 100%;
  1307. height: 100%;
  1308. }
  1309. uni-page-body {
  1310. width: 100%;
  1311. height: 100%;
  1312. }
  1313. .page {
  1314. width: 100%;
  1315. height: 100%;
  1316. display: flex;
  1317. flex-direction: column;
  1318. align-items: center;
  1319. overflow-y: hidden;
  1320. position: relative;
  1321. }
  1322. map {
  1323. width: 100%;
  1324. height: 100%;
  1325. }
  1326. .uni-cover-view{
  1327. display: flex;
  1328. align-items: center;
  1329. }
  1330. .top {
  1331. position: fixed;
  1332. z-index: 999;
  1333. left: 0rpx;
  1334. top: 0rpx;
  1335. width: 100%;
  1336. }
  1337. .area {
  1338. position: fixed;
  1339. display: flex;
  1340. width: 460rpx;
  1341. height: 80rpx;
  1342. background: rgba(255, 255, 255, 1);
  1343. box-shadow: 0px 3rpx 6rpx 0px rgba(190, 190, 190, 1);
  1344. border-radius: 10rpx;
  1345. top: 270rpx;
  1346. justify-content: space-around;
  1347. left: 0rpx;
  1348. }
  1349. .area view {
  1350. display: flex;
  1351. align-items: center;
  1352. font-size: 28rpx;
  1353. font-family: PingFang SC;
  1354. font-weight: 500;
  1355. color: rgba(40, 40, 40, 1);
  1356. width: 33%;
  1357. justify-content: center;
  1358. }
  1359. .top .back {
  1360. width: 100%;
  1361. height: 6rpx;
  1362. background: rgba(239, 239, 239, 1);
  1363. }
  1364. .top .flex {
  1365. display: flex;
  1366. width: 100%;
  1367. justify-content: space-around;
  1368. background: white;
  1369. height: 75rpx;
  1370. }
  1371. .button {
  1372. width: 216rpx;
  1373. height: 129rpx;
  1374. background: rgba(24, 213, 185, 1);
  1375. box-shadow: 0rpx 8rpx 13rpx 0rpx rgba(100, 239, 218, 1);
  1376. border-radius: 10rpx;
  1377. display: flex;
  1378. align-items: center;
  1379. justify-content: center;
  1380. position: fixed;
  1381. z-index: 777;
  1382. top: 78%;
  1383. left: 50%;
  1384. margin-left: -108rpx;
  1385. font-size: 40rpx;
  1386. font-family: PingFang SC;
  1387. font-weight: 500;
  1388. color: rgba(255, 255, 255, 1);
  1389. }
  1390. van-cell {
  1391. width: 100rpx !important;
  1392. height: 100rpx !important;
  1393. }
  1394. .view {
  1395. position: fixed;
  1396. display: flex;
  1397. justify-content: center;
  1398. align-items: center;
  1399. }
  1400. .view image {
  1401. width: 84rpx;
  1402. height: 84rpx;
  1403. }
  1404. .how {
  1405. bottom: 15%;
  1406. right: 30%;
  1407. font-size: 24rpx;
  1408. height: 68rpx;
  1409. width: 336rpx;
  1410. text-align: center;
  1411. color: #fff;
  1412. background: url(http://resource.weilaibike.com/bike_yunwei/iconHint.png) no-repeat;
  1413. background-size: cover;
  1414. padding-top: 10rpx;
  1415. box-sizing: border-box;
  1416. }
  1417. .iconHint {
  1418. position: absolute;
  1419. bottom: 15%;
  1420. left: 0;
  1421. width: 100%;
  1422. margin: 0 auto;
  1423. }
  1424. .iconHint .operate {
  1425. display: flex;
  1426. justify-content: flex-end;
  1427. margin-bottom: 30rpx;
  1428. }
  1429. .iconHint>view {
  1430. width: 85%;
  1431. margin: 0 auto;
  1432. }
  1433. .iconHint image {
  1434. height: 72rpx;
  1435. width: 72rpx;
  1436. }
  1437. /* 图标提示弹窗 */
  1438. .hintPop {
  1439. position: absolute;
  1440. top: 50%;
  1441. left: 50%;
  1442. transform: translate(-50%, -50%);
  1443. z-index: 9999;
  1444. }
  1445. .hintCon {
  1446. width: 526rpx;
  1447. height: 733rpx;
  1448. background-image: url('http://resource.weilaibike.com/popBg.png');
  1449. background-size: 100% 100%;
  1450. }
  1451. .hintCon .intr {
  1452. padding-top: 241rpx;
  1453. font-size: 35rpx;
  1454. color: #f00;
  1455. padding-left: 20rpx;
  1456. }
  1457. .hintCon .icon {
  1458. flex-grow: 1;
  1459. display: flex;
  1460. justify-content: space-between;
  1461. align-items: center;
  1462. flex-wrap: wrap;
  1463. height: 55%;
  1464. margin: 20rpx 0 0 35rpx;
  1465. }
  1466. .hintCon .icon view {
  1467. width: 50%;
  1468. }
  1469. .hintCon .icon image {
  1470. width: 55rpx;
  1471. height: 55rpx;
  1472. margin-right: 15rpx;
  1473. vertical-align: middle;
  1474. }
  1475. .hintCon text {
  1476. font-size: 26rpx;
  1477. }
  1478. .hintCon .icon>view>view {
  1479. margin-top: 28rpx;
  1480. }
  1481. .hintCon .close {
  1482. text-align: center;
  1483. }
  1484. .hintCon .close image {
  1485. height: 52rpx;
  1486. width: 52rpx;
  1487. margin-top: 153rpx;
  1488. }
  1489. /* 侧边栏 */
  1490. .side {
  1491. position: absolute;
  1492. top: 0;
  1493. left: 20%;
  1494. z-index: 7777;
  1495. background: #efefef;
  1496. height: 100%;
  1497. width: 80%;
  1498. overflow: hidden;
  1499. padding-top: 80rpx;
  1500. }
  1501. .record,
  1502. .bikeNo,
  1503. .position,
  1504. .order,
  1505. .directive {
  1506. background: #fff;
  1507. width: 92%;
  1508. border-radius: 10rpx;
  1509. padding: 0 15rpx;
  1510. box-sizing: border-box;
  1511. }
  1512. .side .record {
  1513. height: 6%;
  1514. margin: 0 auto;
  1515. /* display: flex;
  1516. justify-content: flex-end;
  1517. align-items: center; */
  1518. }
  1519. .side .record image {
  1520. height: 48rpx;
  1521. width: 48rpx;
  1522. vertical-align: middle;
  1523. margin-right: 10rpx;
  1524. }
  1525. .side .record text {
  1526. font-size: 26rpx;
  1527. color: #8a8a8a;
  1528. }
  1529. .bikeNo {
  1530. height: 7%;
  1531. margin: 16rpx auto 13rpx;
  1532. }
  1533. .bikeNo input {
  1534. width: 60%;
  1535. font-size: 28rpx;
  1536. padding: 0 0 5rpx 5rpx;
  1537. border-bottom: 1rpx solid #d2d2d2;
  1538. }
  1539. .bikeNo .place {
  1540. font-size: 24rpx;
  1541. color: #4d4d4d88;
  1542. }
  1543. .bikeNo text {
  1544. font-size: 24rpx;
  1545. background: #18d5b9;
  1546. padding: 10rpx 20rpx;
  1547. color: #fff;
  1548. border-radius: 10rpx;
  1549. }
  1550. .info {
  1551. height: 19%;
  1552. width: 92%;
  1553. margin: 0 auto;
  1554. display: flex;
  1555. flex-direction: column;
  1556. justify-content: center;
  1557. }
  1558. .infoCon {
  1559. display: flex;
  1560. justify-content: space-between;
  1561. box-sizing: border-box;
  1562. }
  1563. .iconfont {
  1564. font-size: 66rpx;
  1565. color: #fff;
  1566. }
  1567. .info .infoLeft {
  1568. height: 100%;
  1569. box-sizing: border-box;
  1570. margin-left: 100rpx;
  1571. }
  1572. .info .infoLeft view,
  1573. .last {
  1574. font-size: 24rpx;
  1575. color: #fff;
  1576. font-weight: 500;
  1577. }
  1578. .last {
  1579. margin-left: 100rpx;
  1580. padding-bottom: 20rpx;
  1581. }
  1582. .infoRight image {
  1583. height: 90rpx;
  1584. width: 90rpx;
  1585. }
  1586. .position {
  1587. height: 6%;
  1588. margin: 0 auto 10rpx;
  1589. }
  1590. .position text {
  1591. font-size: 28rpx;
  1592. color: #282828;
  1593. }
  1594. .order {
  1595. margin: 0 auto;
  1596. padding: 10rpx 15rpx;
  1597. }
  1598. .order .recent {
  1599. font-size: 28rpx;
  1600. padding: 10rpx 0;
  1601. }
  1602. .order view {
  1603. font-size: 26rpx;
  1604. margin-bottom: 5rpx;
  1605. }
  1606. .directive {
  1607. margin: 10rpx auto 0;
  1608. }
  1609. .directive view {
  1610. font-size: 28rpx;
  1611. color: #282828;
  1612. }
  1613. .directive text {
  1614. color: #575757;
  1615. }
  1616. .directive .dire {
  1617. font-size: 24rpx;
  1618. padding: 15rpx 0 15rpx 20rpx;
  1619. border-bottom: 1rpx solid #dedede;
  1620. box-sizing: border-box;
  1621. display: flex;
  1622. align-items: center;
  1623. justify-content: space-between;
  1624. }
  1625. .directive .iconfont {
  1626. font-size: 55rpx;
  1627. }
  1628. .directive .list {
  1629. width: 100%;
  1630. display: flex;
  1631. flex-wrap: wrap;
  1632. padding: 15rpx;
  1633. }
  1634. .directive .list view {
  1635. width: 33.33%;
  1636. display: flex;
  1637. flex-direction: column;
  1638. align-items: center;
  1639. }
  1640. .iconlaba,
  1641. .iconkaisuo,
  1642. .iconguansuo {
  1643. color: #f38106;
  1644. }
  1645. .background {
  1646. background: #282828;
  1647. width: 100%;
  1648. height: 100%;
  1649. position: fixed;
  1650. top: 0rpx;
  1651. left: 0rpx;
  1652. z-index: 8888;
  1653. opacity: 0.5;
  1654. }
  1655. .more {
  1656. display: flex;
  1657. flex-wrap: wrap;
  1658. position: fixed;
  1659. top: 41%;
  1660. left: 28%;
  1661. background: white;
  1662. z-index: 9999;
  1663. width: 392rpx;
  1664. height: 392rpx;
  1665. background: rgba(229, 229, 229, 1);
  1666. border-radius: 10rpx;
  1667. }
  1668. .more view {
  1669. display: flex;
  1670. flex-direction: column;
  1671. align-items: center;
  1672. font-size: 26rpx;
  1673. width: 50%;
  1674. justify-content: center;
  1675. }
  1676. .workTitle {
  1677. width: 100%;
  1678. padding: 33rpx 0 20rpx;
  1679. }
  1680. .workTitle text {
  1681. font-size: 32rpx;
  1682. font-weight: 600;
  1683. }
  1684. .workTab {
  1685. width: 100%;
  1686. margin: 20rpx 0;
  1687. background: #fff;
  1688. padding: 15rpx
  1689. }
  1690. .workTab view {
  1691. font-size: 28rpx;
  1692. padding: 15rpx 80rpx;
  1693. color: #64efda;
  1694. border: 1px solid #64efda;
  1695. }
  1696. .workTab view:first-child {
  1697. border-top-left-radius: 15rpx;
  1698. border-bottom-left-radius: 15rpx;
  1699. }
  1700. .workTab view:last-child {
  1701. border-top-right-radius: 15rpx;
  1702. border-bottom-right-radius: 15rpx;
  1703. }
  1704. .workTab .cur {
  1705. background: #64efda;
  1706. color: #fff;
  1707. }
  1708. .no {
  1709. width: 100%;
  1710. margin: 0 auto;
  1711. text-align: center;
  1712. margin-top: 180rpx;
  1713. }
  1714. .no image {
  1715. width: 200rpx;
  1716. height: 200rpx;
  1717. margin-bottom: 20rpx;
  1718. }
  1719. .work {
  1720. background: #fff;
  1721. position: fixed;
  1722. bottom: 0%;
  1723. left: 0%;
  1724. z-index: 9999;
  1725. width: 100%;
  1726. border-top-left-radius: 25rpx;
  1727. border-top-right-radius: 25rpx;
  1728. }
  1729. .wait {
  1730. width: 100%;
  1731. border-radius: 10rpx;
  1732. height: 840rpx;
  1733. }
  1734. .waitCon {
  1735. position: relative;
  1736. border: 2rpx solid #eee;
  1737. height: 140rpx;
  1738. overflow: hidden;
  1739. box-shadow: 0 0 5rpx #eee;
  1740. margin-bottom: 10rpx;
  1741. background: #fff;
  1742. }
  1743. .content {
  1744. background-color: #fff;
  1745. width: 100%;
  1746. height: 140rpx;
  1747. z-index: 5;
  1748. transition: left 0.2s ease-in-out;
  1749. position: absolute;
  1750. top: 0;
  1751. left: 0rpx;
  1752. font-size: 24rpx;
  1753. box-sizing: border-box;
  1754. display: flex;
  1755. flex-direction: column;
  1756. justify-content: center;
  1757. }
  1758. .content .reason {
  1759. /* border-top:1rpx solid #D7D8D9;
  1760. border-bottom:1rpx solid #D7D8D9; */
  1761. height: 40%;
  1762. }
  1763. .content view {
  1764. padding-left: 30rpx;
  1765. display: flex;
  1766. justify-content: start;
  1767. align-items: center;
  1768. font-size: 26rpx;
  1769. }
  1770. .del {
  1771. width: 200rpx;
  1772. height: 100%;
  1773. text-align: center;
  1774. z-index: 4;
  1775. position: absolute;
  1776. top: 0;
  1777. right: 0;
  1778. color: #fff;
  1779. display: flex;
  1780. align-items: center;
  1781. justify-content: center;
  1782. font-size: 26rpx;
  1783. }
  1784. .get {
  1785. background-color: #18d5b9;
  1786. }
  1787. .finish {
  1788. background-color: #18d5b9;
  1789. }
  1790. .workBtn {
  1791. width: 92%;
  1792. margin: 0 auto;
  1793. display: flex;
  1794. align-items: center;
  1795. height: 6%;
  1796. margin-top: 10rpx;
  1797. }
  1798. .workBtn .count {
  1799. /* padding: 6rpx; */
  1800. padding: 3rpx 14rpx;
  1801. background-color: #f00;
  1802. font-size: 22rpx;
  1803. color: #fff;
  1804. position: absolute;
  1805. top: 12rpx;
  1806. left: 199rpx;
  1807. border-radius: 20rpx;
  1808. }
  1809. .shelters,
  1810. .has {
  1811. width: 50%;
  1812. display: flex;
  1813. justify-content: center;
  1814. align-items: center;
  1815. background-color: #fff;
  1816. padding: 20rpx 0;
  1817. font-size: 28rpx;
  1818. position: relative;
  1819. }
  1820. .shelters {
  1821. border-top-left-radius: 10rpx;
  1822. border-bottom-left-radius: 10rpx;
  1823. border-right: 1rpx solid #eee;
  1824. }
  1825. .has {
  1826. border-top-right-radius: 10rpx;
  1827. border-bottom-right-radius: 10rpx;
  1828. }
  1829. .changeWork {
  1830. background-color: #18d5b9;
  1831. color: #fff;
  1832. }
  1833. .mead {
  1834. height: 300rpx;
  1835. }
  1836. .mead .content {
  1837. justify-content: initial;
  1838. height: 300rpx;
  1839. }
  1840. .mead .title {
  1841. line-height: 80rpx;
  1842. height: 80rpx;
  1843. padding: 0 20rpx;
  1844. }
  1845. .mead .title view {
  1846. flex-grow: 1;
  1847. padding: 0;
  1848. display: inline-block;
  1849. }
  1850. .mead .title .left {
  1851. text-align: left;
  1852. }
  1853. .mead .title .right {
  1854. text-align: right;
  1855. height: 100%
  1856. }
  1857. .mead .body {
  1858. padding: 20rpx 20rpx;
  1859. border-bottom: 1rpx solid #d7d8d8;
  1860. border-top: 1rpx solid #d7d8d8;
  1861. flex-wrap: wrap;
  1862. display: flex;
  1863. height: 100rpx;
  1864. }
  1865. .mead .body .left {
  1866. width: 20%;
  1867. display: inline-block;
  1868. text-align: center;
  1869. vertical-align: top;
  1870. }
  1871. .mead .body .right {
  1872. width: 80%;
  1873. display: inline-block;
  1874. padding-left: 30rpx;
  1875. vertical-align: top;
  1876. }
  1877. .mead .body .right .describe {
  1878. width: 100%;
  1879. height: 100%;
  1880. color: #555;
  1881. font-size: 28rpx;
  1882. overflow: hidden;
  1883. text-overflow: ellipsis;
  1884. display: -webkit-box;
  1885. -webkit-line-clamp: 2;
  1886. -webkit-box-orient: vertical;
  1887. }
  1888. .mead .body view {
  1889. display: block;
  1890. padding: 0;
  1891. box-sizing: border-box;
  1892. }
  1893. .mead .reason {
  1894. flex-grow: 0;
  1895. height: 50rpx;
  1896. line-height: 50rpx;
  1897. }
  1898. .mead .time {
  1899. line-height: 80rpx;
  1900. height: 80rpx;
  1901. color: #999;
  1902. padding: 0 20rpx;
  1903. }
  1904. </style>