12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414 |
- <template>
- <view style="padding-bottom: 50upx;">
- <view v-if="shangxian=='是'">
- <view class="top_view">
- <!-- <view class="flex justify-between padding-left-xl">
- <image src="../../static/upload/hometoplefttitle.png" style="width: 312rpx;height: 102rpx;"></image>
- <image src="../../static/upload/hometopimage.png" style="width: 329rpx;height: 151rpx;"></image>
- </view> -->
- <view>
- <image v-if="globalImages" :src="globalImages + 'imgs/banner.jpg'" style="width: 100%;height: 320rpx;" mode=""></image>
- </view>
-
- <view style="margin: 0 auto; text-align: center;" class="padding">
- <view style="font-size: 40rpx; font-weight: bold;">千万车主的新选择</view>
- <view class="flex padding" style="margin-top: 30rpx;">
- <view style="margin: 0 auto;">
- <image v-if="globalImages" :src="globalImages + 'imgs/dingdan.png'" style="width: 56rpx;height: 56rpx;" mode=""></image>
- <view style="font-size: 24rpx;">海量订单</view>
- </view>
- <view style="margin: 0 auto;">
- <image v-if="globalImages" :src="globalImages + 'imgs/hegui.png'" style="width: 56rpx;height: 56rpx;" mode=""></image>
- <view style="font-size: 24rpx;">合法合规</view>
- </view>
- <view style="margin: 0 auto;">
- <image v-if="globalImages" :src="globalImages + 'imgs/tixian (2).png'" style="width: 56rpx;height: 56rpx;" mode=""></image>
- <view style="font-size: 24rpx;">快速提现</view>
- </view>
- </view>
- </view>
- <view class="top_centerView">
- <view style="margin: 0 10rpx 20rpx;">
- 出发地
- </view>
- <view class="addboxs bg" style="padding: 0 30rpx;" @click="goCFAddress(1)">
- <view class="add_cont">
- <view class="green"></view>
- <view class="" v-if="addlist.address === ''">请选择出发地...</view>
- <view class="add_tit" v-else>
- <view class="flex align-center">
- 从<view class="text-cut" style="color: #346EF6;max-width: 420rpx;">
- {{addlist.address}}
- </view>出发
- </view>
- <!-- <view class="text-sm" style="color: #999999;font-weight: 500;margin-top: 5rpx;"
- v-if="riderNumber">
- 附近有{{riderNumber}}个司机
- </view> -->
- </view>
- </view>
- <view>
- <image src="../../static/image/go.png" style="width: 16rpx;height: 25rpx;">
- </image>
- </view>
- </view>
-
- <view style="margin: 0 10rpx 20rpx;">
- 目的地
- </view>
- <view class="addboxs bg" style="padding: 0 30rpx;" @click="goCFAddress(2)">
- <view class="add_cont">
- <view class="orgin"></view>
- <view class="add_tit" v-if="addlists.address === ''">输入目的地</view>
- <view class="add_tit" v-else>{{addlists.address}}</view>
- </view>
- <view>
- <image src="../../static/image/go.png" style="width: 16rpx;height: 25rpx;">
- </image>
- </view>
- </view>
-
- <view style="margin: 0 10rpx 20rpx;">
- 出发时间
- </view>
- <view class="flex align-center addboxs bg" style="padding: 0 30rpx;" @click="openTime()">
- <view class="flex align-center">
- <image src="/static/upload/time.png" style="width: 34rpx;height: 34rpx;"></image>
- <view class="add_tit margin-left-xs" v-if="!yuyueTime">选择预约时间</view>
- <view class="add_tit margin-left-xs" v-else>{{yuyueTime}}</view>
- </view>
- <view class="margin-left-xs">
- <image src="/static/image/right.png" style="width: 12rpx;height: 20rpx;">
- </image>
- </view>
- </view>
- <view class="fb_btn" @tap="goSave">发布行程</view>
- </view>
- </view>
- <view>
- <view v-if="orderList && orderList.length > 0">
- <view class="myOrder_view">
- <view>您有{{orderCounts}}个正在进行中的行程</view>
- <view @tap="goMore('')">查看全部</view>
- </view>
- <view class="myOrder_itemView">
- <view class="" v-for="(item,index) in orderList" @tap="goItemDetail(item)">
- <view class="flex justify-between align-center">
- <view class="item_title">正在寻找乘客</view>
- <image src="/static/image/right.png" style="width: 16rpx;height: 25rpx;"></image>
- </view>
- <view class="flex align-center add_name" style="margin: 30rpx 0rpx 4rpx;">
- <view class="green"></view>{{item.shipCity}} {{item.shipAddress}}
- </view>
- <image src="/static/upload/up.png" class="order_up"></image>
- <view class="flex align-center add_name">
- <view class="orgin"></view>{{item.deliveryCity}} {{item.deliveryAddress}}
- </view>
- <view class="item_title" style="margin-top: 26rpx;">{{item.startTime}}出发</view>
- <view v-if="index != orderList.length - 1" class="margin-tb-sm"
- style="width: 100%;height:1rpx;background: #F2F2F2;"></view>
- </view>
- </view>
- </view>
- <!-- #ifdef H5 -->
- <u-sticky :h5-nav-height="0" @fixed="xdCheck" @unfixed="noXDCheck">
- <!-- #endif -->
- <!-- #ifndef H5 -->
- <u-sticky @fixed="xdCheck" @unfixed="noXDCheck">
- <!-- #endif -->
- <view class="tab_view" id="tabSelView"
- :style="scrollTop == 1 ? '' : 'margin-top: 40rpx;height: 100rpx;'">
- <view :class="tabSel == 1 ? 'tab_items' : 'tab_item'" @tap="tabSelClick(1)">市内订单</view>
- <view :class="tabSel == 2 ? 'tab_items' : 'tab_item'" @tap="tabSelClick(2)">跨城订单</view>
- </view>
- <view style="background: #FFFFFF;">
- <u-dropdown :menu-icon='menuicon' ref="uDropdown" @open="open" @close="close"
- menu-icon-size="18">
- <u-dropdown-item v-model="value1" :title="mrtitle">
- <view class="slot-content">
- <view class=" flex flex-wrap padding">
- <view class="listpp" v-for="(item,index) in mrlist" :key="index"
- :class="mrIndex==index?'listppAct':''" @click="changeTj(item,index)">
- {{item.label}}
- </view>
- </view>
- </view>
- </u-dropdown-item>
- <u-dropdown-item v-model="value2" :title="carname">
- <view class="slot-content">
- <view class="padding">
- <!-- <view class="text-df text-bold">订单类型</view> -->
- <view class="text-df text-bold">订单类型</view>
- <view class="flex">
- <view :class="appointmentType == 0 ? 'bz_item_sel' : 'bz_item'"
- @tap="checkBZ(0)">
- 全部
- </view>
- <view :class="appointmentType == 1 ? 'bz_item_sel' : 'bz_item'"
- @tap="checkBZ(1)">
- 独享
- </view>
- <view :class="appointmentType == 2 ? 'bz_item_sel' : 'bz_item'"
- @tap="checkBZ(2)">
- 愿拼
- </view>
- </view>
- <view class="text-df text-bold margin-top">乘车人数</view>
- <view class="flex">
- <view :class="appointmentNum == 0 ? 'bz_item_sel' : 'bz_item'"
- @tap="checkBZNum(0)">
- 全部
- </view>
- <view :class="appointmentNum == 1 ? 'bz_item_sel' : 'bz_item'"
- @tap="checkBZNum(1)">
- 1位乘客
- </view>
- <view :class="appointmentNum == 2 ? 'bz_item_sel' : 'bz_item'"
- @tap="checkBZNum(2)">
- 2位乘客
- </view>
- <view :class="appointmentNum == 3 ? 'bz_item_sel' : 'bz_item'"
- @tap="checkBZNum(3)">
- 3位及以上乘客
- </view>
- </view>
- </view>
- </view>
- </u-dropdown-item>
- </u-dropdown>
- </view>
- </u-sticky>
- <view class="boxa" @click="goOrder(item)" v-for="(item,index) in list" :key="index">
- <view class="flex align-center justify-between" style="padding: 30rpx 30rpx 0rpx;">
- <view class="item_time">{{item.appointmentStartTime}}</view>
- <!-- <view class="item_shunlu">{{item.similarity ? item.similarity : '0'}}% <text
- style="font-size: 24rpx;">顺路</text> </view> -->
- </view>
- <view class="padding margin-top-xs">
- <view class="flex align-center justify-between" style="margin-bottom: 4rpx;">
- <view class="flex align-center">
- <view class="green"></view>
- <view class="item_addName">{{item.shipAddress}}</view>
- </view>
- <!-- <view class="item_juli">{{item.startDistance}}km</view> -->
- </view>
- <view class="flex align-center margin-top justify-between">
- <view class="flex align-center">
- <view class="orgin"></view>
- <view class="item_addName">{{item.deliveryAddress}}</view>
- </view>
- <!-- <view class="item_juli">{{item.endDistance}}km</view> -->
- </view>
- <view class="margin-top flex align-center justify-between">
- <view class="flex align-center">
- <image src="/static/upload/person.png" style="width: 30rpx;height: 31rpx;"></image>
- <view style="margin-left: 16rpx;width: fit-content;" class="item_addName">
- {{item.appointmentNum}}人乘坐·{{item.appointmentType == 1 ? '独享' : '拼车'}}
- </view>
- </view>
- <!-- <view class="item_juli">订单里程{{item.kmDistance}}km</view> -->
- </view>
- </view>
- <view class="margin-tb-sm" style="width: 100%;height:1rpx;background: #F2F2F2;"></view>
- <view class="flex align-center justify-between padding-lr ">
- <view style="color: #FF2020;font-size: 32rpx;font-weight: bold;">
- <text>¥</text><text style="font-size: 42rpx;">{{item.driveMoney}}</text>
- </view>
- <view class="item_btn" @tap.stop="goOrder(item)">立即同行</view>
- </view>
- </view>
- <view class="empty" v-if="list.length == 0">
- <view style="width: 100%;margin: 0 auto;text-align: center;">
- <image src="/static/image/empty.png" style="width: 300rpx;height: 300rpx;"></image>
- <view style="color: #CCCCCC;" v-if="driverRouteId != ''">暂无订单内容</view>
- <view style="color: #CCCCCC;" v-else>请发布行程后再来查看订单信息</view>
- </view>
- </view>
- </view>
- <u-popup v-model="remkShow" mode="bottom" border-radius="40" :closeable="true">
- <view style="padding: 50rpx 30rpx 50rpx 30rpx;">
- <view class="text-lg text-bold padding-bottom-sm">出行车辆与座位数</view>
- <view class="bz_item_sel">
- {{driverPlate}}
- </view>
- <view class="text-df text-bold margin-top">乘车人数</view>
- <view class="flex">
- <view :class="personNum == 1 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZFB(1)">
- 1座
- </view>
- <view :class="personNum == 2 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZFB(2)">
- 2座
- </view>
- <view :class="personNum == 3 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZFB(3)">
- 3座
- </view>
- <view :class="personNum == 4 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZFB(4)">
- 4座
- </view>
- </view>
- <view class="text-df text-bold margin-top">是否有同行亲友</view>
- <view class="flex">
- <view :class="friendsType == 1 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZQY(1)">
- 是
- </view>
- <view :class="friendsType == 2 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZQY(2)">
- 否
- </view>
- </view>
- <view class="text-df text-bold margin-top">高速费用</view>
- <view class="flex">
- <view :class="isHighSpeedPrice == 1 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZGS(1)">
- 司机承担
- </view>
- <view :class="isHighSpeedPrice == 2 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZGS(2)">
- 乘客承担
- </view>
- <view :class="isHighSpeedPrice == 3 ? 'bz_item_sel' : 'bz_item'" @tap="checkBZGS(3)">
- 费用AA
- </view>
- </view>
- <view class="remkbtn" @click="remarkSave()">确定</view>
- </view>
- </u-popup>
- <u-picker :start-year="dqYear" v-model="Timeshow" mode="time" :params="params"
- @confirm="timeConfirm"></u-picker>
- <view class="soss" @click="goJinji()">
- <image src="../../static/my/jjqz.png" mode=""></image>
- </view>
- <view class="sosTD" v-if="orderCounts && orderCounts > 0 && scrollShow" @tap="showTD">
- <image src="/static/upload/tingdan.png"></image>
- </view>
- <view class="sosT" v-if="orderCounts && orderCounts > 0 && !scrollShow">
- <image v-if="!tdShow" src="../../static/upload/starttd.png" @click="goTingDan()"
- style="width: 149rpx;height: 24rpx;">
- </image>
- <image v-if="tdShow" src="../../static/upload/endTD.png" @click="goTingDan()"
- style="width: 149rpx;height: 24rpx;">
- </image>
- <u-line direction="col" color="#FFFFFF" length="30" />
- <view class="flex align-center" @click="goEditTD()">
- <image src="/static/upload/tdset.png" style="width: 28rpx;height: 26rpx;"></image>
- <view class="sosT_text">设置</view>
- </view>
- </view>
- <view class="sos" @click="goTop()">
- <image src="/static/upload/goTop.png" mode=""></image>
- </view>
- <view class="sos" @click="goRefers()" style="bottom: 160rpx;">
- <image src="/static/upload/refers.png" mode=""></image>
- </view>
- </view>
-
- <view v-if="shangxian=='否'">
- <view class="flex align-center padding-lr padding-top" style="padding-top: 100rpx;">
- <view class="u-m-r-10">
- <image :src="avatar" style="width: 100rpx;height: 100rpx;border-radius: 100rpx;"
- @click="goNav('/pages/login/login')"></image>
- </view>
- <view class="u-flex-1 u-m-l-10 text-white r" v-if="!isLogin">
- <view class="" @click="goNav('/pages/login/login')">{{userName}}</view>
- </view>
- <view v-else class="text-xl u-p-l-20 text-bold" @click="goNav('/pages/login/login')">
- 登录
- </view>
- </view>
- <view class="flex align-center padding-left">
- <image src="/static/image/data.png" style="width: 26upx;height: 26upx;"></image>
- <view class="margin-left-xs flex align-center" style="color: #999999;">
- <view>开始时间</view>
- 至
- <view>结束时间</view>
- </view>
- </view>
- <view class="flex align-center box text-center">
- <view class="">
- ¥<text class="text-bold text-xl">0</text>
- <view>总收益</view>
- </view>
- <view class="" style="margin-left:180upx">
- <text class="text-bold text-xl">0</text>
- <view>用户评分</view>
- </view>
-
- </view>
-
- <view style="padding: 30upx 30upx;">
- <view class="text-bold text-lg margin-bottom-sm flex justify-between">
- <view>接单管理</view>
- <view>
- <text style="color: #666666;font-size: 26upx;margin-right: 10upx;">查看全部</text>
- </view>
- </view>
- <view class="orderbox ">
- <view class="">
- <text class="text-bold text-xl">0</text>
- <view class="margin-top-xs">待完成</view>
- </view>
- <view class="">
- <text class="text-bold text-xl">0</text>
- <view class="margin-top-xs">已完成</view>
- </view>
- <view class="">
- <text class="text-bold text-xl">0</text>
- <view class="margin-top-xs">已评价</view>
- </view>
- </view>
- </view>
-
- <view style="padding: 30upx 30upx;">
- <view class="text-bold text-lg margin-bottom-sm flex justify-between">
- <view>今日订单</view>
- <view>
- <text style="color: #666666;font-size: 26upx;margin-right: 10upx;">查看全部</text>
- </view>
- </view>
- <view class="orderbox ">
- <view class="">
- <text class="text-bold text-xl">0</text>
- <view class="margin-top-xs">待完成</view>
- </view>
- <view class="">
- <text class="text-bold text-xl">0</text>
- <view class="margin-top-xs">已完成</view>
- </view>
- <view class="">
- <text class="text-bold text-xl">0</text>
- <view class="margin-top-xs">已评价</view>
- </view>
- </view>
- </view>
- </view>
- </view>
- </template>
- <script>
- import empty from '@/components/empty'
- import { waitForGlobalImages } from '@/utils/globalImageLoader'
- export default {
- components: {
- empty
- },
- onShareAppMessage(res) { //发送给朋友
- return {
- title: this.tuiguang,
- path: '/pages/index/index',
- imageUrl: this.tuiguangImg,
- }
- },
- onShareTimeline(res) { //分享到朋友圈
- return {
- title: this.tuiguang,
- path: '/pages/index/index',
- imageUrl: this.tuiguangImg,
- }
- },
- data() {
- return {
- avatar:'/static/logo.png',
- isLogin: true,
- userName: '匿名',
-
- isHighSpeedPrice: 0,
- tdShow: false,
- dqYear: '',
- orderCounts: 0,
- orderList: [],
- friendsType: 0,
- remkShow: false,
- personNum: 0,
- appointmentNum: 0,
- appointmentType: '',
- shangxian: '',
- pricetit: '全部目的地',
- carname: '高级筛选',
- value1: 1,
- value2: 2,
- value3: 1,
- value4: 2,
- menuicon: 'arrow-down-fill',
- mrtitle: '智能筛选',
- mrlist: [{
- label: '智能排序',
- value: 0,
- }, {
- label: '最早出发',
- value: 1,
- }, {
- label: '价格最高',
- value: 2,
- }, {
- label: '起点最近',
- value: 3,
- }],
- mrIndex: 0,
- driverRouteId: '',
- params: {
- year: true,
- month: true,
- day: true,
- hour: true,
- minute: true,
- second: false
- },
- Timeshow: false,
- tabSel: 1,
- addlist: {
- address: ''
- }, //出发地址
- addressId: '',
- addlists: {
- address: ''
- }, //目的地
- addressIds: "",
- yuyueTime: '',
- tuiguang: '',
- tuiguangImg: '',
- time: '',
- indent: {},
- latitude: '',
- longitude: '',
- province: '',
- city: '',
- district: '',
- list: [],
- page: 1,
- driverPlate: '',
- checkCertification: 0, //是否实名 状态 1待审核 2已通过 3已拒绝
- cashDeposit: 0, //缴纳保证金
- onLineFlag: 1, //1上线 2下线
- arr: [],
- showModal1: true,
- riderLine: 0,
- tabList: [{
- name: '即时代驾',
- id: 1
- },
- {
- name: '包时代驾',
- id: 1
- },
- {
- name: '朋友代叫',
- id: 2
- },
- {
- name: '预约代驾',
- id: 3
- }
- ],
- bfShow: false,
- userId: '',
- current: 0,
- isDrop: false, //是否打开下拉筛选
- isVip: false, //是否是会员
- scrollTop: 0,
- scrollShow: false,
- globalImages: ''
- }
- },
- onHide() {
- // clearInterval(this.time)
- },
- onLoad(e) {
- waitForGlobalImages().then((path) => {
- console.log('✅ 全局图片路径:', path)
- this.globalImages = path
- })
- let that = this
- // #ifdef MP-WEIXIN
- if (e.scene) {
- const scene = decodeURIComponent(e.scene);
- if (scene.split('=')[0].indexOf('userId') != -1) {
- let riderUserId = scene.split('=')[1]
- that.$queue.setData('riderUserId', riderUserId);
- } else {
- that.$queue.setData('inviterCode', scene.split(',')[0]);
- }
- }
- // #endif
- // 获取邀请码保存到本地
- if (e.invitation) {
- that.$queue.setData('inviterCode', e.invitation);
- }
- this.$Request.getT('/app/common/type/284').then(res => {
- if (res.code === 0) {
- // #ifdef MP-WEIXIN
- uni.setStorageSync('shangxian', res.data.value)
- // #endif
- // #ifndef MP-WEIXIN
- uni.setStorageSync('shangxian', '否')
- // #endif
- this.shangxian = uni.getStorageSync('shangxian')
- }
- });
- let timeNow = new Date();
- timeNow.setMinutes(timeNow.getMinutes() + 30);
- this.dqYear = timeNow.getFullYear()
- this.yuyueTime =
- `${this.padZero(timeNow.getMonth() + 1)}月${this.padZero(timeNow.getDate())}日${this.padZero(timeNow.getHours())}:${this.padZero(timeNow.getMinutes())}`;
- // this.yuyueTime = e.month + '月' + e.day + '日' + ' ' + e.hour + ':' + e.minute
- let sysInfo = uni.getSystemInfoSync()
- let tabbarHeight = sysInfo.screenHeight - sysInfo.safeArea.bottom
- console.log(tabbarHeight, '2222222')
- that.userId = uni.getStorageSync('userId')
- // that.shouru()
- // that.getNewOrder()
- uni.getLocation({
- // #ifdef APP
- type: 'wgs84',
- // #endif
- // #ifndef APP
- type: 'gcj02', //wgs84 gcj02
- // #endif
- success: function(res) {
- console.log(res, '获取经纬度')
- that.latitude = res.latitude
- that.longitude = res.longitude
- that.addlist.lng = res.longitude
- that.addlist.lat = res.latitude
- uni.setStorageSync('latitude', res.latitude)
- uni.setStorageSync('longitude', res.longitude)
- let data = {
- lat: res.latitude,
- lng: res.longitude
- }
- that.$Request.getT('/app/Login/selectCity', data).then(res => {
- if (res.code === 0) {
- that.province = res.data.province
- that.city = res.data.city
- that.district = res.data.district
- uni.setStorageSync('cityName', res.data.city)
- that.addlist.address = res.data.address
- that.addlist.province = res.data.province
- that.addlist.city = res.data.city
- that.addlist.district = res.data.district
- that.taskData()
- that.getLocation()
- }
- });
- that.getUserInfo()
- },
- fail: function(ree) {
- console.log(ree, '获取地址失败')
- if (uni.getStorageSync('latitude') && uni.getStorageSync('longitude')) {
- that.latitude = uni.getStorageSync('latitude')
- that.longitude = uni.getStorageSync('longitude')
- that.getUserInfo()
- that.getLocation()
- }
- // else {
- // uni.startLocationUpdate({
- // type: 'gcj02', //gcj02 wgs84
- // isHighAccuracy: true, //开启高精度定位(!!!必需)
- // geocode: true,
- // success: res => {
- // uni.onLocationChange(function(res2) {
- // console.log('实时纬度:' + res2.latitude);
- // console.log('实时经度:' + res2.longitude);
- // that.latitude = res2.latitude
- // that.longitude = res2.longitude
- // uni.setStorageSync('latitude', that.latitude)
- // uni.setStorageSync('longitude', that.longitude)
- // let data = {
- // lat: res.latitude,
- // lng: res.longitude
- // }
- // that.$Request.getT('/app/Login/selectCity', data)
- // .then(
- // res => {
- // if (res.code === 0) {
- // that.province = res.data.province
- // that.city = res.data.city
- // that.district = res.data.district
- // that.getLocation()
- // }
- // });
- // that.getUserInfo()
- // });
- // },
- // fail: err => {
- // // clearInterval(this.ordertimer)
- // console.error('开启小程序接收位置消息失败:', err)
- // },
- // complete: msg => {
- // // clearInterval(this.ordertimer)
- // console.log('调用开启小程序接收位置消息 API 完成')
- // }
- // });
- // }
- }
- });
- if (that.userId) {
- that.time = setInterval(function() {
- // that.getNewOrder()
- uni.getLocation({
- // #ifdef APP
- type: 'wgs84',
- // #endif
- // #ifndef APP
- type: 'gcj02', //wgs84 gcj02
- // #endif
- success: function(res) {
- console.log(res, '获取经纬度')
- that.latitude = res.latitude
- that.longitude = res.longitude
- uni.setStorageSync('latitude', res.latitude)
- uni.setStorageSync('longitude', res.longitude)
- let data = {
- lat: res.latitude,
- lng: res.longitude
- }
- that.$Request.getT('/app/Login/selectCity', data).then(res => {
- if (res.code === 0) {
- that.province = res.data.province
- that.city = res.data.city
- uni.setStorageSync('cityName', res.data.city)
- that.district = res.data.district
- that.getLocation()
- }
- });
- // that.getUserInfo()
- },
- fail: function() {
- console.log('获取地址失败')
- if (uni.getStorageSync('latitude') && uni.getStorageSync('longitude')) {
- that.latitude = uni.getStorageSync('latitude')
- that.longitude = uni.getStorageSync('longitude')
- // that.getUserInfo()
- that.getLocation()
- } else {
- // that.getUserInfo()
- // that.getLocation()
- uni.startLocationUpdate({
- // #ifdef APP
- type: 'wgs84',
- // #endif
- // #ifndef APP
- type: 'gcj02', //wgs84 gcj02
- // #endif
- isHighAccuracy: true, //开启高精度定位(!!!必需)
- geocode: true,
- success: res => {
- uni.onLocationChange(function(res2) {
- console.log('实时纬度:' + res2.latitude);
- console.log('实时经度:' + res2.longitude);
- that.latitude = res2.latitude
- that.longitude = res2.longitude
- uni.setStorageSync('latitude', that
- .latitude)
- uni.setStorageSync('longitude', that
- .longitude)
- let data = {
- lat: res.latitude,
- lng: res.longitude
- }
- that.$Request.getT(
- '/app/Login/selectCity',
- data).then(res => {
- if (res.code === 0) {
- that.province = res
- .data
- .province
- that.city = res.data
- .city
- that.district = res
- .data
- .district
- that.getLocation()
- }
- });
- // that.getUserInfo()
- });
- },
- fail: err => {
- // clearInterval(this.ordertimer)
- console.error('开启小程序接收位置消息失败:', err)
- },
- complete: msg => {
- // clearInterval(this.ordertimer)
- console.log('调用开启小程序接收位置消息 API 完成')
- }
- });
- }
- }
- });
- }, 10000)
- }
- },
- onShow() {
- this.$Request.getT('/app/common/type/358').then(res => {
- if (res.code === 0) {
- uni.setStorageSync('tuiguang', res.data.value)
- this.tuiguang = res.data.value;
- }
- });
- this.$Request.getT('/app/common/type/357').then(res => {
- if (res.code === 0) {
- uni.setStorageSync('tuiguangImg', res.data.value)
- this.tuiguangImg = res.data.value;
- }
- });
- let that = this
- that.$Request.getT('/app/common/type/428').then(res => { //师傅端小程序订单状态通知 428
- if (res.code == 0) {
- if (res.data && res.data.value) {
- that.arr.push(res.data.value)
- }
- }
- })
- that.$Request.getT('/app/common/type/429').then(res => { //师傅端小程序新订单通知 429
- if (res.code == 0) {
- if (res.data && res.data.value) {
- that.arr.push(res.data.value)
- }
- }
- })
- that.userId = uni.getStorageSync('userId')
- if (that.userId) {
- that.getMyOrderList();
- that.getUserInfo()
- // that.shouru()
- if (that.showModal1) {
- // #ifdef MP-WEIXIN
- that.openMsg()
- // #endif
- }
- } else {
- this.userId = ''
- this.orderCounts = 0;
- this.orderList = []
- this.list = []
- this.isVip = false
- clearInterval(that.time)
- clearInterval(that.timeTD)
- this.tdShow = false
- this.indent = {}
- }
- },
- onPageScroll(e) {
- // e.scrollTop 是页面在垂直方向已滚动的距离(单位px)
- this.scrollShow = true;
- },
- methods: {
- showTD() {
- this.scrollShow = false;
- },
- getMassgeList() {
- let that = this;
- this.$Request.getT('/app/message/selectMessageByUserId?state=13&isSee=0&page=1&limit=1').then(res => {
- if (res.code == 0 && res.data) {
- if (res.data.records && res.data.records.length > 0) {
- if (res.data.records[0].content) {
- clearInterval(that.timeTD)
- const innerAudioContext = uni.createInnerAudioContext();
- innerAudioContext.autoplay = true;
- innerAudioContext.src = res.data.records[0].content;
- innerAudioContext.onPlay(() => {
- console.log('开始播放');
- });
- innerAudioContext.onEnded(() => {
- that.timeTD = setInterval(function() {
- that.getMassgeList();
- }, 3000);
- });
- that.page = 1;
- that.getMyOrderList();
- that.getUserInfo()
- }
- }
- }
- });
- },
- goTingDan() {
- let that = this;
- if (!this.tdShow) {
- that.tdShow = true
- let driverId = this.$queue.getData('driverId');
- let city = that.city ? that.city : ''
- let data = {
- isListeningOrders: 1,
- driverId: driverId,
- city: city,
- latitude: that.latitude,
- longitude: that.longitude
- }
- that.$queue.showLoading('设置中...')
- that.$Request.postJson('/app/driver/updateDriver', data).then(res => {
- uni.hideLoading();
- if (res.code == 0) {
- that.$queue.showToast('开始听单!')
- setTimeout(d => {
- that.timeTD = setInterval(function() {
- console.log(that.bfShow, "13456")
- that.getMassgeList();
- }, 5000);
- }, 1500)
- } else {
- that.$queue.showToast(res.msg)
- }
- });
- } else {
- let driverId = this.$queue.getData('driverId');
- let city = that.city ? that.city : ''
- let data = {
- isListeningOrders: 1,
- driverId: driverId,
- city: city,
- latitude: that.latitude,
- longitude: that.longitude
- }
- that.$queue.showLoading('设置中...')
- that.$Request.postJson('/app/driver/updateDriver', data).then(res => {
- uni.hideLoading();
- if (res.code == 0) {
- that.tdShow = false
- that.$queue.showToast('已结束听单!')
- clearInterval(that.timeTD)
- } else {
- that.$queue.showToast(res.msg)
- }
- });
- }
- },
- goEditTD() {
- if (!this.userId) {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- return;
- }
- uni.navigateTo({
- url: '/my/order/tdSet'
- });
- },
- goTop() {
- uni.pageScrollTo({
- scrollTop: 0,
- duration: 300
- });
- },
- goRefers() {
- if (this.userId) {
- this.$queue.showLoading('刷新中...')
- this.page = 1;
- this.getMyOrderList();
- this.getUserInfo()
- } else {
- this.orderCounts = 0;
- this.orderList = []
- this.list = []
- this.isVip = false
- clearInterval(that.time)
- this.indent = {}
- }
- },
- getMyOrderList() {
- this.$Request.getT('/app/driverRoute/selectDriverRouteListByUserId?page=1&limit=2').then(red => {
- if (red.code == 0 && red.data) {
- this.orderList = red.data.records;
- this.orderCounts = red.data.total;
- if (red.data.records && red.data.records.length > 0) {
- this.driverRouteId = red.data.records[0].driverRouteId;
- // this.addlist.province = red.data.records[0].shipProvince;
- // this.addlist.city = red.data.records[0].shipCity;
- // this.addlist.district = red.data.records[0].shipDistrict;
- // this.addlist.lng = red.data.records[0].shipAddressLongitude;
- // this.addlist.lat = red.data.records[0].shipAddressLatitude;
- // this.addlist.address = red.data.records[0].shipAddress;
- // this.addlists.province = red.data.records[0].deliveryProvince;
- // this.addlists.city = red.data.records[0].deliveryCity;
- // this.addlists.district = red.data.records[0].deliveryDistrict;
- // this.addlists.lng = red.data.records[0].deliveryAddressLongitude;
- // this.addlists.lat = red.data.records[0].deliveryAddressLatitude;
- // this.addlists.address = red.data.records[0].deliveryAddress;
- // this.yuyueTime = red.data.records[0].startTime;
- this.$queue.setData('driverRouteId', red.data.records[0].driverRouteId)
- this.taskData();
- }
- }
- uni.hideLoading();
- });
- },
- remarkSave() {
- this.remkShow = false;
- if (this.friendsType < 1 || this.personNum < 1) {
- this.$queue.showToast('请选择乘车人数和是否有亲友同行!')
- return;
- }
- if (this.isHighSpeedPrice < 1) {
- this.$queue.showToast('请选择是否承担高速费用!')
- return;
- }
- this.$queue.showLoading('提交中...')
- let driverId = this.$queue.getData('driverId');
- let userId = this.$queue.getData('userId');
- let data = {
- driverId: driverId,
- shipProvince: this.addlist.province,
- shipCity: this.addlist.city,
- shipDistrict: this.addlist.district,
- shipAddressLongitude: this.addlist.lng,
- shipAddressLatitude: this.addlist.lat,
- shipAddress: this.addlist.address,
- deliveryProvince: this.addlists.province,
- deliveryCity: this.addlists.city,
- isHighSpeedPrice: this.isHighSpeedPrice,
- seatNum: this.personNum,
- isFriends: this.friendsType,
- deliveryDistrict: this.addlists.district,
- deliveryAddressLongitude: this.addlists.lng,
- deliveryAddressLatitude: this.addlists.lat,
- deliveryAddress: this.addlists.address,
- startTime: this.yuyueTime,
- userId: userId
- }
- this.$Request.postJson('/app/driverRoute/insertDriverRoute', data).then(
- res => {
- uni.hideLoading();
- if (res.code == 0) {
- this.addlists.address = '';
- let timeNow = new Date();
- timeNow.setMinutes(timeNow.getMinutes() + 30);
- this.dqYear = timeNow.getFullYear()
- this.yuyueTime =
- `${this.padZero(timeNow.getMonth() + 1)}月${this.padZero(timeNow.getDate())}日${this.padZero(timeNow.getHours())}:${this.padZero(timeNow.getMinutes())}`;
- this.$queue.showToast('发布成功!');
- this.getUserInfo();
- this.getMyOrderList();
- } else {
- this.$queue.showToast(res.msg);
- }
- })
- },
- //获取正在进行的订单数量
- getMasterHaveOrder() {
- // this.$Request.getT('/app/orders/getMasterHaveOrder').then(res=>{
- // if(res.code == 0){
- // }
- // })
- return new Promise((resolve, reject) => {
- this.$Request.getT('/app/orders/getMasterHaveOrder').then(res => {
- if (res.code == 0) {
- resolve(res.data); // 假设你要获取的数据在res.data中,这里根据实际情况修改
- } else {
- reject(res);
- }
- }).catch(error => {
- reject(error);
- });
- });
- },
- goJinji() {
- uni.navigateTo({
- url: '/my/setting/jinji'
- })
- },
- open(index) {
- console.log('open', index)
- this.$refs.uDropdown.highlight();
- this.isDrop = true
- },
- close(index) {
- console.log('close', index)
- // 关闭的时候,给当前项加上高亮
- // 当然,您也可以通过监听dropdown-item的@change事件进行处理
- this.$refs.uDropdown.highlight(index);
- this.isDrop = false
- },
- timeConfirm(e) {
- this.yuyueTime = e.month + '月' + e.day + '日' + '' + e.hour + ':' + e.minute
- },
- openTime() {
- this.Timeshow = true
- },
- goCFAddress(index) {
- let that = this
- uni.chooseLocation({
- success: function(res) {
- console.log('位置名称:' + res.name);
- console.log('详细地址:' + res.address);
- console.log('纬度:' + res.latitude);
- console.log('经度:' + res.longitude);
- if (index == 1) {
- that.addlist.address = res.name
- that.addlist.lng = res.longitude
- that.addlist.lat = res.latitude
- let data = {
- lat: res.latitude,
- lng: res.longitude
- }
- that.$Request.getT('/app/Login/selectCity', data).then(res => {
- if (res.code === 0) {
- that.addlist.province = res.data.province
- that.addlist.city = res.data.city
- that.addlist.district = res.data.district
- }
- });
- } else if (index == 2) {
- that.addlists.address = res.name
- that.addlists.lng = res.longitude
- that.addlists.lat = res.latitude
- let data = {
- lat: res.latitude,
- lng: res.longitude
- }
- that.$Request.getT('/app/Login/selectCity', data).then(res => {
- if (res.code === 0) {
- that.addlists.province = res.data.province
- that.addlists.city = res.data.city
- that.addlists.district = res.data.district
- }
- });
- }
- }
- });
- },
- //时间格式转换
- padZero(num) {
- return num < 10 ? `0${num}` : num;
- },
- change(index) {
- if (uni.getStorageSync('token')) {
- this.current = index
- this.taskData()
- }
- },
- // 今日收入、订单量
- shouru() {
- // this.$Request.getT('/app/orders/findIncome').then(res => {
- // if (res.code == 0) {
- // this.indent = res.data
- // }
- // console.log('res', res)
- // });
- },
- getNewOrder() {
- this.$Request.getT('/app/message/getOrderMessage').then(res => {
- if (res.code == 0) {
- if (res.data > 0) {
- // this.aplayAudio()
- }
- }
- });
- },
- //接单池刷新
- aplayAudio() {
- // console.log('语音提示')
- // const innerAudioContext = uni.createInnerAudioContext();
- // innerAudioContext.autoplay = true;
- // // innerAudioContext.src ='../../static/mpc/order.mp3';
- // innerAudioContext.src =
- // 'https://pw.xianmxkj.com/file/uploadPath/2022/01/19/0753211f78d718d44ee6372e33eae9ee.mp3';
- // innerAudioContext.onPlay(() => {
- // console.log('开始播放');
- // });
- // innerAudioContext.onError((res) => {
- // console.log(res.errMsg);
- // console.log(res.errCode);
- // });
- },
- // 获取个人信息
- getUserInfo() {
- let userId = this.$queue.getData('userId');
- if (!userId) {
- return;
- }
- this.$Request.getT("/app/user/selectUserDetails?userId=" + userId).then(res => {
- if (res.code == 0) {
- this.$nextTick(function() {
- // this.checkCertification = res.data.checkCertification
- this.cashDeposit = res.data.cashDeposit
- this.onLineFlag = res.data.onLineFlag
- this.riderLine = res.data.riderLine
- if (res.data.isVip && res.data.isVip == 1) {
- this.isVip = true
- } else {
- this.isVip = false
- }
- })
- } else {
- this.$queue.logout();
- uni.showModal({
- showCancel: false,
- title: '登录失败',
- content: res.msg,
- });
- }
- });
- this.$Request.getT('/app/driver/selectDriverByUserId?userId=' + userId).then(res => {
- if (res.code == 0 && res.data) {
- this.checkCertification = res.data.status
- this.driverPlate = res.data.driverPlate
- if (this.checkCertification && this.checkCertification == 2) {
- // this.$Request.getT('/app/driverRoute/selectDriverRouteByUserId?userId=' + userId).then(
- // red => {
- // if (red.code == 0 && red.data) {
- // this.driverRouteId = red.data.driverRouteId;
- // this.addlist.province = red.data.shipProvince;
- // this.addlist.city = red.data.shipCity;
- // this.addlist.district = red.data.shipDistrict;
- // this.addlist.lng = red.data.shipAddressLongitude;
- // this.addlist.lat = red.data.shipAddressLatitude;
- // this.addlist.address = red.data.shipAddress;
- // this.addlists.province = red.data.deliveryProvince;
- // this.addlists.city = red.data.deliveryCity;
- // this.addlists.district = red.data.deliveryDistrict;
- // this.addlists.lng = red.data.deliveryAddressLongitude;
- // this.addlists.lat = red.data.deliveryAddressLatitude;
- // this.addlists.address = red.data.deliveryAddress;
- // this.yuyueTime = red.data.startTime;
- // this.$queue.setData('driverRouteId', red.data.driverRouteId)
- // this.taskData();
- // }
- // })
- }
- uni.setStorageSync('checkCertification', res.data.status)
- uni.setStorageSync('driverId', res.data.driverId)
- }
- })
- },
- async goCloseSave() {
- let data = await this.getMasterHaveOrder()
- console.log(data, '22222222222222')
- if (data > 0) {
- uni.showModal({
- title: '提示',
- content: '有订单正在进行中,无法取消当前行程',
- showCancel: false
- })
- return
- }
- if (this.isDrop) {
- this.$refs.uDropdown.close();
- }
- let that = this;
- uni.showModal({
- title: '提示',
- content: '确认取消发布行程吗?',
- cancelText: '取消',
- confirmText: '确认',
- complete: function(ret) {
- if (ret.confirm) {
- let data = {
- driverRouteId: that.driverRouteId
- }
- that.$Request.postT('/app/driverRoute/deleteDriverRoute', data).then(res => {
- if (res.code == 0) {
- that.addlist.address = ''
- that.addlists.address = ''
- that.driverRouteId = ''
- that.$queue.removeItem('driverRouteId')
- that.list = []
- that.page = 1;
- that.$queue.showToast('取消成功!');
- let timeNow = new Date();
- that.yuyueTime =
- `${that.padZero(timeNow.getMonth() + 1)}月${that.padZero(timeNow.getDate())}日${that.padZero(timeNow.getHours())}:${that.padZero(timeNow.getMinutes())}`;
- } else {
- that.$queue.showToast(res.msg);
- }
- });
- }
- }
- })
- },
- goItemDetail(item) {
- if (!this.userId) {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- return;
- }
- uni.navigateTo({
- url: '/my/order/myOrderDetail?driverRouteId=' + item.driverRouteId
- });
- },
- goMore(indentNumber) {
- if (!this.userId) {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- return;
- }
- if (this.orderCounts < 1) {
- this.$queue.showToast('请发布行程后再来查看吧!')
- return;
- }
- uni.navigateTo({
- url: '/my/order/myOrderList?indentNumber=' + indentNumber
- });
- },
- goSave() {
- // this.$refs.uDropdown.close();
- if (this.userId) {
- if (this.addlist.address === '') {
- this.$queue.showToast('请选择出发地址!')
- return;
- }
- if (this.addlists.address === '') {
- this.$queue.showToast('请选择目的地!')
- return;
- }
- if (this.yuyueTime === '') {
- this.$queue.showToast('请选择预约时间!')
- return;
- }
- if (this.checkCertification == 2) {
- this.$Request.getT('/app/common/type/261').then(res => {
- if (res.code === 0) {
- let baozhengjin = res.data.value;
- if (uni.getStorageSync('isBindung') == '是') {
- if ((Number(this.cashDeposit) < Number(baozhengjin))) {
- uni.showModal({
- title: '提示',
- content: '保证金不足,请先缴纳保证金后再发单',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.navigateTo({
- url: '/my/wallet/baozhengjin'
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- return
- }
- }
- this.remkShow = true;
- }
- });
- } else if (this.checkCertification == 1) {
- uni.showToast({
- title: '实名认证审核中,请稍等...',
- icon: 'none'
- })
- return
- } else {
- uni.showModal({
- title: '提示',
- content: '请先实名认证后再发单',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.navigateTo({
- url: '/my/renzheng/index'
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- return;
- }
- } else {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- }
- },
- goOrder(e) {
- if (this.userId) {
- if (this.checkCertification == 2) {
- this.$Request.getT('/app/common/type/261').then(res => {
- if (res.code === 0) {
- let baozhengjin = res.data.value;
- // console.log((Number(this.cashDeposit) - Number(baozhengjin))>0)
- // return
- if (uni.getStorageSync('isBindung') == '是') {
- if ((Number(this.cashDeposit) >= Number(baozhengjin))) {
- // uni.navigateTo({
- // url: '/pages/index/orderDet?indentNumber=' + e.ordersId
- // })
- this.goMore(e.ordersId);
- } else {
- uni.showModal({
- title: '提示',
- content: '保证金不足,请先缴纳保证金后再接单',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.navigateTo({
- url: '/my/wallet/baozhengjin'
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- }
- } else {
- this.goMore(e.ordersId);
- // uni.navigateTo({
- // url: '/pages/index/orderDet?indentNumber=' + e.ordersId
- // })
- }
- }
- });
- } else if (this.checkCertification == 1) {
- uni.showToast({
- title: '实名认证审核中,请稍等...',
- icon: 'none'
- })
- return
- } else if (this.checkCertification == '' || this.checkCertification == null) {
- uni.showModal({
- title: '提示',
- content: '请先实名认证后再接单',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.navigateTo({
- url: '/my/renzheng/index'
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- return;
- }
- } else {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- }
- },
- checkBZGS(index) {
- this.isHighSpeedPrice = index;
- },
- checkBZQY(index) {
- this.friendsType = index;
- },
- checkBZFB(index) {
- this.personNum = index;
- },
- checkBZNum(index) {
- this.appointmentNum = index
- this.page = 1;
- this.taskData()
- },
- checkBZ(index) {
- this.appointmentType = index
- this.page = 1;
- this.taskData()
- },
- changeTj(item, index) {
- this.$refs.uDropdown.close();
- this.mrIndex = index
- this.page = 1;
- this.taskData()
- },
- xdCheck(e) {
- this.scrollTop = 1;
- console.log('吸顶')
- },
- noXDCheck(e) {
- this.scrollTop = 0;
- console.log('no吸顶')
- },
- tabSelClick(index) {
- this.tabSel = index;
- this.page = 1;
- this.taskData()
- },
- // 获取新任务数据
- taskData() {
- // if (this.orderCounts < 1) {
- // uni.hideLoading();
- // uni.stopPullDownRefresh();
- // return;
- // }
- let shipProvince = this.province
- let shipCity = this.city
- let orderType = 1;
- if (this.tabSel == 2) { //跨市
- shipProvince = '';
- shipCity = '';
- orderType = 2;
- }
- let sort = this.mrIndex ? this.mrIndex : '';
- let userId = this.$queue.getData('userId');
- let data = {
- page: this.page,
- limit: 10,
- od: this.latitude,
- ol: this.longitude,
- appointmentType: this.appointmentType ? this.appointmentType : '',
- appointmentNum: this.appointmentNum ? this.appointmentNum : '',
- shipProvince: shipProvince,
- driverUserId: userId,
- shipCity: shipCity,
- orderType: orderType,
- status: 2,
- sort: sort
- }
- this.$Request.getT('/app/orders/selectOrdersList', data).then(res => {
- uni.hideLoading()
- if (res.code == 0) {
- if (this.page == 1) {
- this.list = res.data.list
- } else {
- this.list = [...this.list, ...res.data.list]
- }
- }
- uni.stopPullDownRefresh();
- });
- },
- // 接单成功语音播放
- // aplayAudios() {
- // // console.log('语音提示')
- // const innerAudioContext = uni.createInnerAudioContext();
- // innerAudioContext.autoplay = true;
- // innerAudioContext.src =
- // 'https://pw.xianmxkj.com/file/uploadPath/2022/03/15/c096db4257ecc2547814d4f51c6518bd.mp3';
- // innerAudioContext.onPlay(() => {
- // console.log('开始播放');
- // });
- // innerAudioContext.onError((res) => {
- // console.log(res.errMsg);
- // console.log(res.errCode);
- // });
- // },
- // 上传师傅位置
- getLocation() {
- if (!this.userId) {
- return;
- }
- if (this.orderCounts < 1) {
- return;
- }
- let data = {
- lng: this.longitude,
- lat: this.latitude,
- userId: this.userId,
- province: this.province,
- city: this.city,
- district: this.district,
- }
- this.$Request.getT('/timedtask/riderLocation', data).then(res => {
- if (res.code == 0) {
- console.log('上传师傅位置')
- }
- });
- },
- //接单
- jiedan(item) {
- // #ifdef MP-WEIXIN
- if (uni.getStorageSync('sendMsg')) {
- uni.requestSubscribeMessage({
- tmplIds: this.arr,
- success(re) {
- // console.log(re,'**********')
- var datas = JSON.stringify(re);
- if (datas.indexOf("accept") != -1) {
- console.log(re)
- }
- },
- fail: (res) => {
- console.log(res)
- }
- })
- }
- // #endif
- if (this.isDrop) {
- this.$refs.uDropdown.close();
- }
- if (this.userId) {
- if (uni.getStorageSync('isOpenVip') == '是') {
- if (this.isVip == false) {
- uni.showModal({
- title: '提示',
- content: '开通会员后可接单',
- confirmText: '开通会员',
- complete(ret) {
- if (ret.confirm) {
- uni.navigateTo({
- url: '/my/vip/vip'
- })
- }
- }
- })
- return
- }
- }
- if (this.checkCertification == 2) {
- this.$Request.getT('/app/common/type/261').then(res => {
- if (res.code === 0) {
- let baozhengjin = res.data.value;
- let that = this
- console.log((Number(this.cashDeposit) >= Number(baozhengjin)))
- // return
- if (uni.getStorageSync('isBindung') == '是') {
- if ((Number(this.cashDeposit) >= Number(baozhengjin))) {
- uni.showModal({
- title: '提示',
- content: '确定抢单吗?',
- success: function(res) {
- if (res.confirm) {
- // console.log('用户点击确定');
- that.$Request.postT(
- '/app/orders/takingOrders?ordersId=' +
- item.ordersId + '&userId=' + that.userId +
- '&driverRouteId=' + that.driverRouteId)
- .then(res => {
- if (res.code == 0) {
- that.taskData()
- uni.showToast({
- title: '接单成功',
- icon: 'none'
- })
- setTimeout(function() {
- uni.switchTab({
- url: '/pages/order/order'
- })
- }, 1000)
- } else {
- that.taskData()
- uni.showToast({
- title: res.msg,
- icon: 'none',
- duration: 1500
- })
- }
- });
- } else if (res.cancel) {
- // console.log('用户点击取消');
- }
- }
- });
- } else {
- uni.showModal({
- title: '提示',
- content: '还未缴纳保证金,请先去缴纳保证金',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.navigateTo({
- url: '/my/wallet/baozhengjin'
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- }
- } else {
- uni.showModal({
- title: '提示',
- content: '确定抢单吗?',
- success: function(res) {
- if (res.confirm) {
- // console.log('用户点击确定');
- that.$Request.postT(
- '/app/orders/takingOrders?ordersId=' +
- item.ordersId + '&userId=' + that.userId +
- '&driverRouteId=' + that.driverRouteId)
- .then(res => {
- if (res.code == 0) {
- that.taskData()
- uni.showToast({
- title: '接单成功',
- icon: 'none'
- })
- setTimeout(function() {
- uni.switchTab({
- url: '/pages/order/order'
- })
- }, 1000)
- } else {
- that.taskData()
- uni.showToast({
- title: res.msg,
- icon: 'none',
- duration: 1500
- })
- }
- });
- } else if (res.cancel) {
- // console.log('用户点击取消');
- }
- }
- });
- }
- }
- });
- } else if (this.checkCertification == 1) {
- uni.showToast({
- title: '实名认证审核中,请稍等...',
- icon: 'none'
- })
- return
- } else if (this.checkCertification == '' || this.checkCertification == null) {
- uni.showModal({
- title: '提示',
- content: '请先实名认证后再接单',
- success: function(res) {
- if (res.confirm) {
- console.log('用户点击确定');
- uni.navigateTo({
- url: '/my/renzheng/index'
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- return;
- }
- } else {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- }
- },
- goNav(e,) {
- console.log(e)
- if (this.userId) {
- uni.navigateTo({
- url: e
- })
- } else {
- uni.showModal({
- title: '提示',
- content: '您还未登录,请先登录',
- success: function(res) {
- if (res.confirm) {
- uni.navigateTo({
- url: '/pages/login/login'
- })
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- })
- }
- },
- // 开启订阅消息
- openMsg() {
- console.log('订阅消息')
- var that = this
- uni.getSetting({
- withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
- success(ret) {
- console.log(ret.subscriptionsSetting, '------------------')
- // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
- if (ret.subscriptionsSetting.itemSettings) {
- uni.setStorageSync('sendMsg', true)
- uni.openSetting({ // 打开设置页
- success(rea) {
- console.log(rea.authSetting)
- }
- });
- } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
- console.log(99999)
- uni.setStorageSync('sendMsg', false)
- uni.showModal({
- title: '提示',
- content: '为了更好的体验,请绑定消息推送',
- confirmText: '确定',
- cancelText: '取消',
- success: function(res) {
- if (res.confirm) {
- console.log(that.arr)
- wx.requestSubscribeMessage({
- tmplIds: that.arr,
- success(re) {
- console.log(JSON.stringify(re),
- '++++++++++++++')
- var datas = JSON.stringify(re);
- if (datas.indexOf("accept") != -1) {
- console.log(re)
- // uni.setStorageSync('sendMsg', true)
- }
- },
- fail: (res) => {
- console.log(res)
- }
- })
- // uni.setStorageSync('sendMsg', true)
- console.log('确认')
- that.showModal1 = false
- } else if (res.cancel) {
- console.log('取消')
- // uni.setStorageSync('sendMsg', false)
- that.showModal1 = true
- }
- }
- })
- }
- }
- })
- }
- },
- // 上拉加载
- onReachBottom: function() {
- if (this.userId) {
- this.page = this.page + 1;
- this.taskData();
- }
- },
- onPullDownRefresh: function() {
- // #ifdef MP-WEIXIN
- if (uni.getStorageSync('sendMsg')) {
- uni.requestSubscribeMessage({
- tmplIds: this.arr,
- success(re) {
- // console.log(re,'**********')
- var datas = JSON.stringify(re);
- if (datas.indexOf("accept") != -1) {
- console.log(re)
- }
- },
- fail: (res) => {
- console.log(res)
- }
- })
- }
- // #endif
- if (this.userId) {
- this.page = 1;
- this.taskData();
- } else {
- uni.hideLoading();
- uni.stopPullDownRefresh();
- }
- },
- }
- </script>
- <style lang="less">
- page {
- background: #F5F5F5;
- }
- ::v-deep .u-sticky {
- background-color: #F5F5F5;
- }
- .sosTD {
- width: 140rpx;
- height: 80rpx;
- position: fixed;
- bottom: 160rpx;
- left: 32rpx;
- z-index: 99;
- image {
- width: 80rpx;
- height: 80rpx;
- }
- }
- .sosT {
- width: 390rpx;
- position: fixed;
- bottom: 160rpx;
- left: 25%;
- background: #25262A;
- padding: 20rpx;
- z-index: 99;
- font-family: Source Han Sans CN;
- font-weight: 500;
- font-size: 26rpx;
- color: #FFFFFF;
- border-radius: 45px;
- display: flex;
- justify-content: space-between;
- padding: 30rpx 40rpx;
- align-items: center;
- .sosT_text {
- font-family: Source Han Sans CN;
- font-weight: 500;
- font-size: 26rpx;
- color: #FFFFFF;
- margin-left: 10rpx;
- }
- }
- .soss {
- width: 70rpx;
- height: 70rpx;
- position: fixed;
- bottom: 290rpx;
- left: 32rpx;
- z-index: 99;
- image {
- width: 70rpx;
- height: 70rpx;
- }
- }
- .sos {
- width: 100rpx;
- height: 100rpx;
- position: fixed;
- bottom: 290rpx;
- right: 32rpx;
- z-index: 99;
- image {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- }
- }
- .labelsx {
- padding: 0 30rpx;
- .scroll-view_H {
- white-space: nowrap;
- width: 100%;
- }
- .scroll-view-item_labe {
- display: inline-block;
- // width: 20%;
- padding: 0 35rpx;
- // width: 121rpx;
- height: 60rpx;
- background: #FFFFFF;
- border-radius: 8rpx;
- text-align: center;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #333333;
- // line-height: 60rpx;
- margin-right: 20rpx;
- display: inline-flex;
- align-items: center;
- justify-content: center;
- }
- .scroll-view-item_labeAct {
- background: #EAF9FF;
- color: #00c18a;
- }
- }
- // 价格 车龄筛选
- .slot-content {
- border-radius: 0rpx 0rpx 32rpx 32rpx;
- padding-bottom: 30rpx;
- background: #FFFFFF;
- .listpp {
- // text-align: center;
- padding: 0rpx 20rpx;
- // width: 150rpx;
- height: 60rpx;
- background: #F7F8FC;
- border-radius: 8rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- margin-right: 20rpx;
- margin-bottom: 20rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #171717;
- }
- .listppAct {
- padding: 0rpx 20rpx;
- height: 60rpx;
- display: flex;
- align-items: center;
- justify-content: center;
- background: #e8fbf6;
- border: 1px solid #00c18a;
- border-radius: 8rpx;
- font-size: 24rpx;
- font-family: PingFang SC;
- font-weight: 500;
- color: #00c18a;
- }
- .btn {
- background: #00c18a;
- color: #FFF;
- padding: 20rpx 0;
- text-align: center;
- }
- }
- .empty {
- width: 100%;
- background: #ffffff;
- height: 600rpx;
- // margin-top: 20rpx;
- padding-top: 60rpx;
- }
- .item_addName {
- font-family: PingFang SC;
- font-weight: 600;
- font-size: 28rpx;
- color: #1A1A1A;
- width: 520rpx;
- white-space: nowrap;
- text-overflow: ellipsis;
- overflow: hidden;
- }
- .item_juli {
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 26rpx;
- color: #999999;
- }
- .item_btn {
- width: 150rpx;
- height: 58rpx;
- background: #00c18a;
- border-radius: 29rpx;
- text-align: center;
- line-height: 58rpx;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 24rpx;
- color: #FFFFFF;
- }
- .tab_view {
- width: 750rpx;
- background: #F3F5F9;
- display: flex;
- // margin-top: 40rpx;
- .tab_item {
- width: 375rpx;
- height: 100rpx;
- background: #F3F5F9;
- border-radius: 24rpx 24rpx 0px 0px;
- text-align: center;
- line-height: 100rpx;
- font-family: Source Han Sans CN;
- font-weight: bold;
- font-size: 28rpx;
- color: #999999;
- }
- .tab_items {
- width: 375rpx;
- height: 100rpx;
- background: #FFFFFF;
- border-radius: 24rpx 24rpx 0px 0px;
- text-align: center;
- line-height: 100rpx;
- font-family: Source Han Sans CN;
- font-weight: bold;
- font-size: 28rpx;
- color: #333333;
- }
- }
- .addboxs {
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin: 0 10rpx 30rpx;
- height: 80rpx;
- border-radius: 16rpx;
- .add_cont {
- display: flex;
- align-items: center;
- }
- .add_tit {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- margin-left: 10rpx;
- }
- }
- .bg {
- // background: #FFFFFF;
- background: #f5f5f5;
- border-radius: 16rpx;
- border: 1px solid #f5f5f5;
- }
- .bgc {
- // background: #FFFFFF;
- }
- .myOrder_view {
- width: 686rpx;
- height: 120rpx;
- background: #e8fbf6;
- border-radius: 32rpx 32rpx 0px 0px;
- margin: 0 auto;
- margin-top: 30rpx;
- display: flex;
- justify-content: space-between;
- font-family: Source Han Sans CN;
- font-weight: 500;
- font-size: 26rpx;
- color: #00c18a;
- padding: 30rpx;
- }
- .myOrder_itemView {
- width: 686rpx;
- // height: 549rpx;
- background: #FFFFFF;
- border-radius: 32rpx;
- margin: 0 auto;
- margin-top: -30rpx;
- padding: 30rpx 40rpx;
- .item_title {
- font-family: Source Han Sans CN;
- font-weight: 600;
- font-size: 32rpx;
- color: #242424;
- }
- }
- .order_up {
- width: 6rpx;
- height: 24rpx;
- margin-left: 6rpx;
- }
- .green {
- width: 16rpx;
- height: 16rpx;
- background: #1FC657;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- .orgin {
- width: 16rpx;
- height: 16rpx;
- background: #FBAC04;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- .fb_btn {
- width: 592rpx;
- height: 80rpx;
- background: #00c18a;
- border-radius: 16rpx;
- margin: 0 auto;
- margin-top: 40rpx;
- font-family: PingFang SC;
- font-weight: 800;
- font-size: 28rpx;
- color: #FFFFFF;
- text-align: center;
- line-height: 80rpx;
- }
- .bz_item {
- width: fit-content;
- padding: 18rpx 30rpx;
- // height: 71rpx;
- background: #FFFFFF;
- border-radius: 24rpx;
- border: 1px solid #CCCCCC;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 24rpx;
- color: #030303;
- margin-top: 20rpx;
- margin-right: 20rpx;
- }
- .bz_item_sel {
- width: fit-content;
- padding: 18rpx 30rpx;
- // height: 71rpx;
- background: #FFFFFF;
- border-radius: 24rpx;
- border: 1px solid #00c18a;
- font-family: PingFang SC;
- font-weight: 500;
- font-size: 24rpx;
- color: #00c18a;
- margin-top: 20rpx;
- margin-right: 20rpx;
- }
- .remkbtn {
- width: 100%;
- height: 98rpx;
- background: #346EF6;
- border-radius: 16rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- display: flex;
- align-items: center;
- justify-content: center;
- line-height: 98rpx;
- margin-top: 40rpx;
- }
- .top_view {
- width: 750rpx;
- // height: 681rpx;
- // background: linear-gradient(80deg, #3670F6 0%, #8EB0FF 100%);
- // background: linear-gradient(to bottom, #3670F6 0%, #8EB0FF 70%, #F5F5F5 90%);
- // padding-top: 100rpx;
- .top_centerView {
- width: 686rpx;
- // height: 409rpx;
- background: #FFFFFF;
- border-radius: 20rpx;
- margin: 0 auto;
- // margin-top: 40rpx;
- padding: 20rpx 20rpx 40rpx;
- }
- }
- .maps {
- width: 100%;
- height: 100vh;
- position: fixed;
- top: 0;
- z-index: 1;
- }
- .bottomBtn {
- position: fixed;
- bottom: 88rpx;
- right: 20rpx;
- z-index: 10;
- .bottomBtn-img {
- width: 100rpx;
- height: 100rpx;
- border-radius: 50%;
- }
- }
- .orderInfoNum {
- width: 100%;
- height: auto;
- background-color: #F5F5F5;
- padding: 30rpx 0;
- .orderInfoNum-box {
- width: 686rpx;
- height: 100%;
- background-color: #FFFFFF;
- border-radius: 24rpx;
- padding: 20rpx;
- }
- .orderInfoNum-box-title {
- width: 100%;
- text-align: center;
- font-weight: bold;
- font-size: 30rpx;
- }
- .orderInfoNum-box-num {
- margin-top: 20rpx;
- text-align: center;
- }
- .orderInfoNum-box-num-item-top {
- font-size: 26rpx;
- font-weight: bold;
- }
- .orderInfoNum-box-num-item-txt {
- color: #999999;
- font-size: 24rpx;
- }
- }
- .boxa {
- background: #FFFFFF;
- border-radius: 24rpx;
- margin: 0 30rpx;
- // padding: 30rpx 0;
- margin-top: 30rpx;
- padding-bottom: 20rpx;
- // margin-bottom: 30rpx;
- .item_time {
- font-family: Source Han Sans CN;
- font-weight: bold;
- font-size: 28rpx;
- color: #242424;
- }
- .item_shunlu {
- width: 210rpx;
- height: 80rpx;
- background: #EFF4FF;
- border-radius: 0px 24rpx 0px 50rpx;
- text-align: center;
- line-height: 80rpx;
- font-family: Source Han Sans CN;
- font-weight: bold;
- font-size: 32rpx;
- color: #346EF6;
- }
- .addbox {
- display: flex;
- align-items: center;
- justify-content: space-between;
- padding: 0 30rpx;
- height: 110rpx;
- border-radius: 16rpx;
- }
- .add_cont {
- display: flex;
- align-items: center;
- }
- .add_tit {
- font-size: 30rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #333333;
- }
- .bg {
- background: #F5F5F5;
- }
- .bgs {
- background: #F5F8FF;
- }
- .green {
- width: 16rpx;
- height: 16rpx;
- background: #1FC657;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- .orgin {
- width: 16rpx;
- height: 16rpx;
- background: #FBAC04;
- border-radius: 50%;
- margin-right: 20rpx;
- }
- .btn {
- height: 78rpx;
- background: linear-gradient(87deg, #346EF6 0%, #7BA2FF 100%);
- border-radius: 4rpx;
- font-size: 28rpx;
- font-family: PingFang SC;
- font-weight: bold;
- color: #FFFFFF;
- margin: 30rpx 30rpx 0;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- }
-
-
- .box {
- width: 690upx;
- margin: 0 auto;
- height: 120rpx;
- background: #557EFD;
- border-radius: 16upx 16upx 0px 0px;
- color: #FFFFFF;
- padding: 0upx 30upx;
- margin-top: 20upx;
- }
-
- .orderbox {
- width: 690upx;
- margin: 0 auto;
- height: 153upx;
- background: #FAFAFA;
- border-radius: 16upx;
- display: flex;
- align-items: center;
- justify-content: space-between;
- text-align: center;
- padding: 0upx 30upx;
- }
- </style>
|