index.vue 71 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771
  1. <template>
  2. <view>
  3. <u-navbar :is-back="false" :title="tit">
  4. <view class="slot">
  5. <!-- 我的 -->
  6. <view class="slot_left" @click="bindridermy">
  7. <image :src="avatar" style="border-radius: 50%;"></image>
  8. </view>
  9. <!-- 下线 -->
  10. <view class="slot_content" v-show="seen">
  11. <image src="../../static/rider/icon_down.png"></image>
  12. </view>
  13. <!-- 上线 -->
  14. <view class="slot_content" v-show="!seen">
  15. <image src="../../static/rider/icon_up.png"></image>
  16. </view>
  17. </view>
  18. </u-navbar>
  19. <!-- tabs -->
  20. <u-tabs style="position: fixed;width: 100%;z-index: 999;" :list="tab" :is-scroll="false"
  21. inactive-color="#333333" :current="current" @change="change">
  22. </u-tabs>
  23. <view class="content">
  24. <!-- 新任务 -->
  25. <view class="tabs_box" :class="{dis:current == 0}">
  26. <!-- 下线中 -->
  27. <view class="list_box" v-for="(item,index) in list_box" :key="index" v-show="seen"
  28. @click="binddetails(item.indentNumber,item.indentType)">
  29. <view class="part1">
  30. <view class="box_one" v-if="item.indentType==1">帮我送</view>
  31. <view class="box_one" v-if="item.indentType==2">帮我取</view>
  32. <view class="box_one" v-if="item.indentType==3">同城帮买</view>
  33. <view class="box_one" v-if="item.indentType==4">同城服务</view>
  34. <view class="box_one" v-if="item.indentType==5">同城外卖</view>
  35. <view class="box_two" v-if="item.indentType==4 &&item.serviceType">{{item.serviceType}}
  36. </view>
  37. <view class="box_two box_two1" v-if="item.itemType!=null||item.itemWeight!=null">
  38. {{item.itemType}}&nbsp;{{item.itemWeight}}
  39. </view>
  40. <view class="box_three" v-if="item.indentType==4&&item.tool">{{item.tool}}</view>
  41. </view>
  42. <!-- 同城服务 -->
  43. <view class="part2" v-if="item.indentType==4">
  44. <view class="address_name">
  45. {{item.userAddressDetail}}({{item.userProvince}}{{item.userCity}}{{item.userDistrict}})
  46. </view>
  47. <!-- <view class="name">{{item.deliveryUserName}}<text>{{item.deliveryUserPhone}}</text></view> -->
  48. </view>
  49. <!-- 同城帮买 就近-->
  50. <view class="part2" v-if="item.indentType==3&&item.buyType==0">
  51. <view class="address_name">{{item.userAddressDetail}}</view>
  52. <view class="name"><text>{{item.userProvince}}{{item.userCity}}{{item.userDistrict}}</text>
  53. </view>
  54. </view>
  55. <!-- 同城帮买 指定 -->
  56. <view class="part2" v-if="item.indentType==3 &&item.buyType==1">
  57. <view class="box_add">
  58. <view class="add_name">
  59. <view class="sh_name">
  60. {{item.shopAddressDetail}}
  61. </view>
  62. <view class="xs_add">
  63. {{item.shopProvince}}{{item.shopCity}}{{item.shopDistrict}}
  64. </view>
  65. </view>
  66. </view>
  67. <view class="jiantou">
  68. <image src="../../static/rider/jiantou.png"></image>
  69. </view>
  70. <view class="box_add">
  71. <view class="add_name">
  72. <view class="sh_name">
  73. {{item.userAddressDetail}}
  74. </view>
  75. <view class="xs_add">
  76. {{item.userProvince}}{{item.userCity}}{{item.userDistrict}}
  77. </view>
  78. </view>
  79. </view>
  80. </view>
  81. <!-- 帮送 帮区-->
  82. <view class="part2" v-if="item.indentType==1 ||item.indentType==2">
  83. <view class="box_add">
  84. <view class="add_name">
  85. <view class="sh_name">
  86. {{item.shopAddressDetail}}
  87. </view>
  88. <view class="xs_add">
  89. {{item.shopProvince}}{{item.shopCity}}{{item.shopDistrict}}
  90. </view>
  91. </view>
  92. </view>
  93. <view class="jiantou">
  94. <image src="../../static/rider/jiantou.png"></image>
  95. </view>
  96. <view class="box_add">
  97. <view class="add_name">
  98. <view class="sh_name">{{item.userProvince}}{{item.userCity}}{{item.userDistrict}}</view>
  99. </view>
  100. </view>
  101. </view>
  102. <!-- 同城外卖 -->
  103. <view class="part2" v-if="item.indentType==5">
  104. <view class="address_name">
  105. {{item.userAddressDetail}}({{item.userProvince}}{{item.userCity}}{{item.userDistrict}})
  106. </view>
  107. <!-- <view class="name">{{item.deliveryUserName}}<text>{{item.deliveryUserPhone}}</text></view> -->
  108. </view>
  109. <!-- -->
  110. <view class="part3">
  111. <view class="three_left">
  112. <!-- <image src="../../static/rider/icon_data.png"></image> -->
  113. <!-- <text v-if="item.indentType==1 ||item.indentType==2">{{item.predictTime}}分钟内送达</text> -->
  114. <!-- <text v-if="item.indentType==3">{{item.buyTime}}分钟内送达</text> -->
  115. <!-- <text v-if="item.indentType==4">{{item.visitTime}}分钟内送达</text> -->
  116. </view>
  117. <view class="three_right">¥{{item.errandMoney}}</view>
  118. </view>
  119. <view class="part4">
  120. <view class="box_btn" @click.stop="bindorder1">接单</view>
  121. </view>
  122. </view>
  123. <!-- 上线 -->
  124. <view class="list_box" v-for="(item,index) in list_box" :key="index" v-if="!seen"
  125. @click="binddetails(item.indentNumber,item.indentType)">
  126. <view class="part1">
  127. <view class="box_one" v-if="item.indentType==1">帮我送</view>
  128. <view class="box_one" v-if="item.indentType==2">帮我取</view>
  129. <view class="box_one" v-if="item.indentType==3">同城帮买</view>
  130. <view class="box_one" v-if="item.indentType==4">同城服务</view>
  131. <view class="box_one" v-if="item.indentType==5">同城外卖</view>
  132. <view class="box_two" v-if="item.indentType==4 &&item.serviceType">{{item.serviceType}}
  133. </view>
  134. <view class="box_two box_two1" v-if="item.itemType!=null||item.itemWeight!=null">
  135. {{item.itemType}}&nbsp;{{item.itemWeight}}
  136. </view>
  137. <view class="box_three" v-if="item.indentType==4&&item.tool">{{item.tool}}</view>
  138. <view class="box_two box_two1" v-if="item.indentType==3">{{item.buyType==0?'就近购买':'指定地点购买'}}
  139. </view>
  140. <view style="position: absolute;right: 0;font-size: 22rpx;color: #999;">{{item.createTime}}
  141. </view>
  142. </view>
  143. <!-- 同城服务 -->
  144. <view class="part2" v-if="item.indentType==4">
  145. <view class="box_add">
  146. <view class="distance" v-if="item.distancessd!='0.0m'">
  147. <view>{{item.distancessd}}</view>
  148. </view>
  149. <view class="add_name">
  150. <view class="address_name">
  151. {{item.userAddressDetail}}({{item.userProvince}}{{item.userCity}}{{item.userDistrict}})
  152. </view>
  153. <!-- <view class="name">{{item.deliveryUserName}}<text>{{item.deliveryUserPhone}}</text>
  154. </view> -->
  155. </view>
  156. </view>
  157. </view>
  158. <!-- 同城帮买 就近-->
  159. <view class="part2" v-if="item.indentType==3&&item.buyType==0">
  160. <view class="box_add">
  161. <view class="distance" v-if="item.distancessd!='0.0m'">
  162. <view>{{item.distancessd}}</view>
  163. </view>
  164. <view class="add_name">
  165. <view class="address_name">{{item.userAddressDetail}}</view>
  166. <view class="name">
  167. <text>{{item.userProvince}}{{item.userCity}}{{item.userDistrict}}{{item.userAddressDetail}}</text>
  168. </view>
  169. </view>
  170. </view>
  171. </view>
  172. <!-- 同城帮买 指定 -->
  173. <view class="part2" v-if="item.indentType==3 &&item.buyType==1">
  174. <view class="box_add">
  175. <view class="distance" v-if="item.distancess!='0.0m'">
  176. <view>{{item.distancess}}</view>
  177. </view>
  178. <view class="add_name">
  179. <view class="sh_name">
  180. {{item.shopAddressDetail}}
  181. <!-- {{item.shopProvince?item.shopProvince:''}}{{item.shopCity?item.shopCity:''}}{{item.shopDistrict?item.shopDistrict:''}} -->
  182. </view>
  183. <view class="xs_add">
  184. {{item.shopProvince?item.shopProvince:''}}{{item.shopCity?item.shopCity:''}}{{item.shopDistrict?item.shopDistrict:''}}
  185. </view>
  186. </view>
  187. </view>
  188. <view class="jiantou">
  189. <image src="../../static/rider/jiantou.png"></image>
  190. <!-- <view>{{item.distance}}</view> -->
  191. </view>
  192. <view class="box_add">
  193. <view class="distance" v-if="item.distancessd!='0.0m'">
  194. <view>{{item.distancessd}}</view>
  195. </view>
  196. <view class="add_name">
  197. <view class="sh_name">
  198. {{item.userProvince}}{{item.userCity}}{{item.userDistrict}}{{item.userAddressDetail}}
  199. </view>
  200. </view>
  201. </view>
  202. </view>
  203. <!-- 帮送 帮取-->
  204. <view class="part2" v-if="item.indentType==1 ||item.indentType==2">
  205. <view class="box_add">
  206. <view class="distance" v-if="item.distancess!='0.0m'">
  207. <view>{{item.distancess}}</view>
  208. </view>
  209. <view class="add_name">
  210. <view class="sh_name">
  211. {{item.shopAddressDetail}}
  212. <!-- {{item.shopProvince?item.shopProvince:''}}{{item.shopCity?item.shopCity:''}}{{item.shopDistrict?item.shopDistrict:''}} -->
  213. </view>
  214. <view class="xs_add">
  215. {{item.shopProvince?item.shopProvince:''}}{{item.shopCity?item.shopCity:''}}{{item.shopDistrict?item.shopDistrict:''}}
  216. </view>
  217. </view>
  218. </view>
  219. <view class="jiantou">
  220. <image src="../../static/rider/jiantou.png"></image>
  221. <!-- <view>{{item.distance}}</view> -->
  222. </view>
  223. <view class="box_add">
  224. <view class="distance" v-if="item.distancessd!='0.0m'">
  225. <view>{{item.distancessd}}</view>
  226. </view>
  227. <view class="add_name">
  228. <view class="sh_name">
  229. {{item.userProvince}}{{item.userCity}}{{item.userDistrict}}{{item.userAddressDetail}}
  230. </view>
  231. </view>
  232. </view>
  233. </view>
  234. <!-- 同城外卖 -->
  235. <view class="part2" v-if="item.indentType==5">
  236. <view class="box_add">
  237. <view class="distance" v-if="item.distancess!='0.0m'">
  238. <view>{{item.distancess}}</view>
  239. </view>
  240. <view class="add_name">
  241. <view class="sh_name">
  242. {{item.shopAddressDetail}}
  243. </view>
  244. <view class="xs_add">
  245. {{item.shipAddress?item.shipAddress:''}}
  246. </view>
  247. </view>
  248. </view>
  249. <view class="jiantou">
  250. <image src="../../static/rider/jiantou.png"></image>
  251. <!-- <view>{{item.distance}}</view> -->
  252. </view>
  253. <view class="box_add">
  254. <view class="distance" v-if="item.distancessd!='0.0m'">
  255. <view>{{item.distancessd}}</view>
  256. </view>
  257. <view class="add_name">
  258. <view class="sh_name">
  259. {{item.userProvince}}{{item.userCity}}{{item.userDistrict}}{{item.userAddressDetail}}
  260. </view>
  261. </view>
  262. </view>
  263. </view>
  264. <view></view>
  265. <!-- -->
  266. <view class="part3">
  267. <view class="three_left" v-if="item.indentType==4">
  268. <image src="../../static/rider/icon_data.png"></image>
  269. <text>预约时间:{{item.sendOutTime?item.sendOutTime:'立即送达'}}</text>
  270. </view>
  271. <view class="three_left" v-if="item.indentType!=4">
  272. <image src="../../static/rider/icon_data.png"></image>
  273. <text>送达时间:{{item.sendOutTime?item.sendOutTime:'立即送达'}}</text>
  274. </view>
  275. <view class="three_right" v-if="item.riderMoney">¥{{item.riderMoney}}
  276. <!-- <text style="font-size: 20upx;">(<text
  277. v-if="item.prepayMoney">预付{{item.prepayMoney}}元</text>
  278. <text v-if="item.tip">小费{{item.tip}}元</text> 跑腿费{{item.errandMoney}}元)</text> -->
  279. </view>
  280. <view class="three_right" v-else>¥ 0</view>
  281. </view>
  282. <view class="part4">
  283. <view class="box_btn1" @click.stop="bindorder(item)">接单</view>
  284. </view>
  285. </view>
  286. <empty v-if="list_box.length == 0"></empty>
  287. </view>
  288. <!-- 待取货 -->
  289. <view class="tabs_box" :class="{dis:current == 1}">
  290. <view class="order_box" v-for="(item,index) in lists.list" :key="index"
  291. @click="bindorderDetail(item.indentNumber,item.indentId)">
  292. <view class="order_success" v-if="item.indentState=='2'">
  293. <view class="order_name">待支付领取</view>
  294. <view class="order_data">{{item.receivingTime}}</view>
  295. </view>
  296. <view class="order_success" v-if="item.indentState=='3'">
  297. <view class="order_name">待取货</view>
  298. <view class="order_data">{{item.receivingTime}}</view>
  299. </view>
  300. <view class="order_success" v-if="item.indentState=='4'">
  301. <view class="order_name">配送中</view>
  302. <view class="order_data">{{item.receivingTime}}</view>
  303. </view>
  304. <view class="order_success" v-if="item.indentState=='5'">
  305. <view class="order_name">已送达,客户待确认</view>
  306. <view class="order_data">{{item.receivingTime}}</view>
  307. </view>
  308. <view class="order_success" v-if="item.indentState=='6'">
  309. <view class="order_name">客户已确认</view>
  310. <view class="order_data">{{item.receivingTime}}</view>
  311. </view>
  312. <view class="order_success" v-if="item.indentState=='7'">
  313. <view class="order_name">已完成</view>
  314. <view class="order_data">{{item.receivingTime}}</view>
  315. </view>
  316. <view class="order_success" v-if="item.indentState=='9'">
  317. <view class="order_name">已取消</view>
  318. <view class="order_data">{{item.receivingTime}}</view>
  319. </view>
  320. <u-line color="#E6E6E6" />
  321. <view class="order_city">
  322. <view class="city_type">
  323. <view class="type_name" v-if="item.indentType == 1">帮我送</view>
  324. <view class="type_name" v-if="item.indentType == 2">帮我取</view>
  325. <view class="type_name" v-if="item.indentType == 3">同城帮买</view>
  326. <view class="type_name" v-if="item.indentType == 4">同城服务</view>
  327. <view class="type_name" v-if="item.indentType == 5">同城外卖</view>
  328. <view class="city_text" v-if="item.itemType">{{item.itemType}}</view>
  329. </view>
  330. <!-- 帮我送/帮我取 地址 -->
  331. <view class="city_address" v-if="item.indentType == 1 || item.indentType == 2">
  332. <view class="fh_box">
  333. <view class="fh_image">
  334. <image src="../../static/image/icon_f.png"></image>
  335. </view>
  336. <view class="box">
  337. <view class="fh_name">{{item.shopAddressDetail}}</view>
  338. <view class="fh_type">{{item.shopName}}
  339. <text>{{item.shopPhone}}</text>
  340. </view>
  341. </view>
  342. </view>
  343. <view class="sh_box">
  344. <view class="sh_image">
  345. <image src="../../static/image/icon_s.png"></image>
  346. </view>
  347. <view class="box">
  348. <view class="sh_name">{{item.userAddressDetail}}</view>
  349. <view class="sh_type">{{item.userName}}
  350. <text>{{item.userPhone}}</text>
  351. </view>
  352. </view>
  353. </view>
  354. </view>
  355. <!-- 同城帮买 指定位置 -->
  356. <view class="city_address" v-if="item.indentType == 3">
  357. <view class="fh_box" v-if="item.buy_type == 1">
  358. <view class="fh_image">
  359. <image src="../../static/image/icon_f.png"></image>
  360. </view>
  361. <view class="box">
  362. <view class="fh_name">{{item.shopAddressDetail}}</view>
  363. <view class="fh_type">{{item.shopName}}
  364. <text>{{item.shopPhone}}</text>
  365. </view>
  366. </view>
  367. </view>
  368. <view class="sh_box">
  369. <view class="sh_image">
  370. <image src="../../static/image/icon_s.png"></image>
  371. </view>
  372. <view class="box">
  373. <view class="sh_name">{{item.userAddressDetail}}</view>
  374. <view class="sh_type">{{item.userName}}
  375. <text>{{item.userPhone}}</text>
  376. </view>
  377. </view>
  378. </view>
  379. </view>
  380. <!-- 同城服务 -->
  381. <view class="city_address" v-if="item.indentType == 4">
  382. <view class="sh_box">
  383. <view class="sh_image">
  384. <image src="../../static/image/icon_s.png"></image>
  385. </view>
  386. <view class="box">
  387. <view class="sh_name">{{item.userAddressDetail}}</view>
  388. <view class="sh_type">{{item.userName}}
  389. <text>{{item.userPhone}}</text>
  390. </view>
  391. </view>
  392. </view>
  393. </view>
  394. <!-- 同城外卖 -->
  395. <view class="city_address" v-if="item.indentType == 5">
  396. <view class="fh_box">
  397. <view class="fh_image">
  398. <image src="../../static/image/icon_f.png"></image>
  399. </view>
  400. <view class="box">
  401. <view class="fh_name">{{item.shopAddressDetail}}</view>
  402. <view class="fh_type">{{item.shopName}}
  403. <text>{{item.shopPhone}}</text>
  404. </view>
  405. </view>
  406. </view>
  407. <view class="sh_box">
  408. <view class="sh_image">
  409. <image src="../../static/image/icon_s.png"></image>
  410. </view>
  411. <view class="box">
  412. <view class="sh_name">{{item.userAddressDetail}}</view>
  413. <view class="sh_type">{{item.userName}}
  414. <text>{{item.userPhone}}</text>
  415. </view>
  416. </view>
  417. </view>
  418. </view>
  419. </view>
  420. <u-line color="#E6E6E6" />
  421. <view class="order_btn">
  422. <view class="btn1" v-if="item.indentState=='3'" @click.stop="quxiao(item.indentNumber)">取消订单
  423. </view>
  424. <view class="btn2" v-if="item.indentState=='3'" @click.stop="quhuo(item.indentId)">确认取货
  425. </view>
  426. </view>
  427. </view>
  428. <empty v-if="lists.list.length == 0"></empty>
  429. </view>
  430. <!-- 配送中-->
  431. <view class="tabs_box" :class="{dis:current == 2}">
  432. <view class="order_box" v-for="(item,index) in lists.list" :key="index"
  433. @click="bindorderDetail(item.indentNumber,item.indentId)">
  434. <view class="order_success" v-if="item.indentState=='2'">
  435. <view class="order_name">待支付领取</view>
  436. <view class="order_data">{{item.receivingTime}}</view>
  437. </view>
  438. <view class="order_success" v-if="item.indentState=='3'">
  439. <view class="order_name">待取货</view>
  440. <view class="order_data">{{item.receivingTime}}</view>
  441. </view>
  442. <view class="order_success" v-if="item.indentState=='4'">
  443. <view class="order_name">配送中</view>
  444. <view class="order_data">{{item.receivingTime}}</view>
  445. </view>
  446. <view class="order_success" v-if="item.indentState=='5'">
  447. <view class="order_name">已送达,客户待确认</view>
  448. <view class="order_data">{{item.receivingTime}}</view>
  449. </view>
  450. <view class="order_success" v-if="item.indentState=='6'">
  451. <view class="order_name">客户已确认</view>
  452. <view class="order_data">{{item.receivingTime}}</view>
  453. </view>
  454. <view class="order_success" v-if="item.indentState=='7'">
  455. <view class="order_name">已完成</view>
  456. <view class="order_data">{{item.receivingTime}}</view>
  457. </view>
  458. <view class="order_success" v-if="item.indentState=='9'">
  459. <view class="order_name">已取消</view>
  460. <view class="order_data">{{item.receivingTime}}</view>
  461. </view>
  462. <u-line color="#E6E6E6" />
  463. <view class="order_city">
  464. <view class="city_type">
  465. <view class="type_name" v-if="item.indentType == 1">帮我送</view>
  466. <view class="type_name" v-if="item.indentType == 2">帮我取</view>
  467. <view class="type_name" v-if="item.indentType == 3">同城帮买</view>
  468. <view class="type_name" v-if="item.indentType == 4">同城服务</view>
  469. <view class="type_name" v-if="item.indentType == 5">同城外卖</view>
  470. <view class="city_text" v-if="item.itemType">{{item.itemType}}</view>
  471. </view>
  472. <!-- 帮我送/帮我取 -->
  473. <view class="city_address" v-if="item.indentType == 1 || item.indentType == 2">
  474. <view class="fh_box">
  475. <view class="fh_image">
  476. <image src="../../static/image/icon_f.png"></image>
  477. </view>
  478. <view class="box">
  479. <view class="fh_name">{{item.shopAddressDetail}}</view>
  480. <view class="fh_type">{{item.shopName}}
  481. <text>{{item.shopPhone}}</text>
  482. </view>
  483. </view>
  484. </view>
  485. <view class="sh_box">
  486. <view class="sh_image">
  487. <image src="../../static/image/icon_s.png"></image>
  488. </view>
  489. <view class="box">
  490. <view class="sh_name">{{item.userAddressDetail}}</view>
  491. <view class="sh_type">{{item.userName}}
  492. <text>{{item.userPhone}}</text>
  493. </view>
  494. </view>
  495. </view>
  496. </view>
  497. <!-- 同城帮买 -->
  498. <view class="city_address" v-if="item.indentType == 3">
  499. <view class="fh_box" v-if="item.buy_type == 1">
  500. <view class="fh_image">
  501. <image src="../../static/image/icon_f.png"></image>
  502. </view>
  503. <view class="box">
  504. <view class="fh_name">{{item.shopAddressDetail}}</view>
  505. <view class="fh_type">{{item.shopName}}
  506. <text>{{item.shopPhone}}</text>
  507. </view>
  508. </view>
  509. </view>
  510. <view class="sh_box">
  511. <view class="sh_image">
  512. <image src="../../static/image/icon_s.png"></image>
  513. </view>
  514. <view class="box">
  515. <view class="sh_name">{{item.userAddressDetail}}</view>
  516. <view class="sh_type">{{item.userName}}
  517. <text>{{item.userPhone}}</text>
  518. </view>
  519. </view>
  520. </view>
  521. </view>
  522. <!-- 同城服务 -->
  523. <view class="city_address" v-if="item.indentType == 4">
  524. <view class="sh_box">
  525. <view class="sh_image">
  526. <image src="../../static/image/icon_s.png"></image>
  527. </view>
  528. <view class="box">
  529. <view class="sh_name">{{item.userAddressDetail}}</view>
  530. <view class="sh_type">{{item.userName}}
  531. <text>{{item.userPhone}}</text>
  532. </view>
  533. </view>
  534. </view>
  535. </view>
  536. <!-- 同城外卖 -->
  537. <view class="city_address" v-if="item.indentType == 5">
  538. <view class="fh_box">
  539. <view class="fh_image">
  540. <image src="../../static/image/icon_f.png"></image>
  541. </view>
  542. <view class="box">
  543. <view class="fh_name">{{item.shopAddressDetail}}</view>
  544. <view class="fh_type">{{item.shopName}}
  545. <text>{{item.shopPhone}}</text>
  546. </view>
  547. </view>
  548. </view>
  549. <view class="sh_box">
  550. <view class="sh_image">
  551. <image src="../../static/image/icon_s.png"></image>
  552. </view>
  553. <view class="box">
  554. <view class="sh_name">{{item.userAddressDetail}}</view>
  555. <view class="sh_type">{{item.userName}}
  556. <text>{{item.userPhone}}</text>
  557. </view>
  558. </view>
  559. </view>
  560. </view>
  561. </view>
  562. <u-line color="#E6E6E6" />
  563. <view class="order_btn">
  564. <view class="btn1" v-if="item.indentState=='3'" @click.stop="quxiao(item.indentNumber)">取消订单
  565. </view>
  566. <view class="btn1" v-if="item.indentState=='6'">客户待确认</view>
  567. <view class="btn2" v-if="item.indentState=='3'" @click.stop="quhuo(item.indentId)">确认取货
  568. </view>
  569. <view class="btn2" v-if="item.indentState=='4'" @click.stop="shouhuo(item)">确认送达
  570. </view>
  571. <view class="btn2" v-if="item.indentState=='9'">已取消</view>
  572. </view>
  573. </view>
  574. <empty v-if="lists.list.length == 0"></empty>
  575. </view>
  576. </view>
  577. <!-- tabbar -->
  578. <view class="tabbar">
  579. <view class="tabbar_type" @click="onshow" v-if="current == 0">
  580. <view class="type_image">
  581. <image src="../../static/rider/type.png"></image>
  582. </view>
  583. 接单设置
  584. </view>
  585. <view class="tabbar_btn" @click="bindup">
  586. <view class="btn" v-show="seen">
  587. 开始接单
  588. </view>
  589. <view class="btn3" v-show="!seen">
  590. 停止接单
  591. </view>
  592. </view>
  593. </view>
  594. <!-- 接单设置弹框 -->
  595. <u-popup v-model="show" mode="bottom" height="600rpx" :closeable="true" close-icon="close-circle"
  596. close-icon-size="50" close-icon-color="#CCCCCC" @close="closePopup()">
  597. <view class="popup_box">
  598. <view class="title">当前接单模式</view>
  599. <!-- <view class="part_one">
  600. <view class="left">
  601. <view class="gotype">近单模式</view>
  602. <view class="tit">推单范围{{distance?distance:'0'}}</view>
  603. </view>
  604. <view class="right">
  605. <u-switch v-model="checked" size="40" inactive-color="#CCCCCC" active-color="#FF6A04"
  606. @change="switch1">
  607. </u-switch>
  608. </view>
  609. </view>
  610. <view class="part_one">
  611. <view class="left">
  612. <view class="gotype">同城模式</view>
  613. <view class="tit">推单范围{{distance?distance:'0'}}</view>
  614. </view>
  615. <view class="right">
  616. <u-switch v-model="check" size="40" inactive-color="#CCCCCC" active-color="#FF6A04"
  617. @change="switch2"></u-switch>
  618. </view>
  619. </view> -->
  620. <view class="part_two">
  621. <view class="two_left">接单类型</view>
  622. <view class="two_right" @click="showModals()">
  623. {{indentTypeName}}
  624. <u-icon name="arrow-right" color="#999999"></u-icon>
  625. </view>
  626. </view>
  627. <view class="part_two">
  628. <view class="two_left">常驻送货区域</view>
  629. <view class="two_right" @click="dizhis()">
  630. {{quyu}}
  631. <u-icon name="arrow-right" color="#999999"></u-icon>
  632. </view>
  633. </view>
  634. <view class="part_one" v-if="checkxdd != '否'">
  635. <view class="left">
  636. <view class="gotype">新订单通知</view>
  637. <view class="tit">开启后{{xddNumber}}KM内,系统自动推送新订单通知</view>
  638. </view>
  639. <view class="right">
  640. <u-switch v-model="xddcheck" size="40" inactive-color="#CCCCCC" active-color="#FF6A04"
  641. @change="switchxdd"></u-switch>
  642. </view>
  643. </view>
  644. <view class="part_two">
  645. <view class="two_left">同时接单量</view>
  646. <view class="two_right">
  647. 最大({{orderNum}}单)
  648. <!-- <u-icon name="arrow-right" color="#999999"></u-icon> -->
  649. </view>
  650. </view>
  651. </view>
  652. </u-popup>
  653. <u-popup v-model="Authorization" mode="center" close-icon="close-circle" close-icon-pos="top-right"
  654. close-icon-color="#8f9298" close-icon-size="50">
  655. <view class="contentview">
  656. <view class="title">隐私保护指引</view>
  657. <view class="des" @click="openPrivacyContract">
  658. 在使用当前小程序服务之前,请仔细阅读<text
  659. style="color: #FF7F00;">{{privacyContractName}}</text>。如你同意{{privacyContractName}},请点击“同意”开始使用。
  660. </view>
  661. <view class="btns">
  662. <button class="item reject" @click="exitMiniProgram">拒绝</button>
  663. <button id="agree-btn" class="item agree" open-type="agreePrivacyAuthorization"
  664. @agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
  665. </view>
  666. </view>
  667. </u-popup>
  668. <!-- 类型选择-->
  669. <u-modal v-model="showModal" title="选择订单类型" :show-cancel-button="true" @confirm="confirm()">
  670. <view class="slot-content">
  671. <u-radio-group v-model="indentTypeName" @change="radioGroupChange" width="50%">
  672. <u-radio v-for="(item, index) in indentTypeList" :key="index" :name="item.name"
  673. :disabled="item.disabled" @change="radioChange">
  674. {{item.name}}
  675. </u-radio>
  676. </u-radio-group>
  677. </view>
  678. </u-modal>
  679. <!-- 收货码弹框 -->
  680. <u-popup v-model="shows" mode="center" border-radius="18" :closeable="closeable" close-icon="close-circle"
  681. close-icon-size="45" width="580rpx" height="400rpx">
  682. <view class="receipt_code">
  683. <view class="code_title">填写收货码</view>
  684. <u-input v-model="shouhuoma" type="text" placeholder="请输入收货码" :border="true" />
  685. <view class="sure" @click="querenSh">确定</view>
  686. </view>
  687. </u-popup>
  688. </view>
  689. </template>
  690. <script>
  691. import empty from '@/components/empty'
  692. import {
  693. requestAndroidPermission,
  694. gotoAppPermissionSetting
  695. } from '@/components/permission.js'
  696. export default {
  697. components: {
  698. empty
  699. },
  700. onShareAppMessage(res) { //发送给朋友
  701. return {
  702. title: this.tuiguang,
  703. path: '/pages/index/index',
  704. imageUrl: this.tuiguangImg,
  705. }
  706. },
  707. onShareTimeline(res) { //分享到朋友圈
  708. return {
  709. title: this.tuiguang,
  710. path: '/pages/index/index',
  711. imageUrl: this.tuiguangImg,
  712. }
  713. },
  714. data() {
  715. return {
  716. Authorization: false,
  717. privacyContractName: '',
  718. checkxdd: '否',
  719. xddNumber: 0,
  720. xddcheck: true,
  721. avatar: '', //头像
  722. // 接单设置弹框
  723. show: false,
  724. tuiguang: '',
  725. tuiguangImg: '',
  726. closeable: true,
  727. checked: false,
  728. check: true,
  729. showModal: false,
  730. // head
  731. tit: '休息中',
  732. seen: true,
  733. tab: [{
  734. name: '接单池'
  735. }, {
  736. name: '待取货'
  737. }, {
  738. name: '配送中'
  739. }, {
  740. name: '我的订单'
  741. }],
  742. current: 0,
  743. page: 1,
  744. list_box: [],
  745. list_tip: [],
  746. take_list: [],
  747. longitude: '', //经度
  748. latitude: '', //纬度
  749. indentType: null, //订单类型
  750. indentTypeName: '全部',
  751. indentTypeList: [{
  752. name: '全部',
  753. disabled: false
  754. },
  755. {
  756. name: '帮我取',
  757. disabled: false
  758. },
  759. {
  760. name: '帮我送',
  761. disabled: false
  762. },
  763. {
  764. name: '同城帮买',
  765. disabled: false
  766. },
  767. {
  768. name: '同城服务',
  769. disabled: false
  770. }, {
  771. name: '同城外卖',
  772. disabled: false
  773. },
  774. ],
  775. quyu: '设置自己的常在位置',
  776. quyuLongitude: '',
  777. quyuLatitude: '',
  778. totalCount: 0, //最后一页
  779. indentState: 3,
  780. lists: {
  781. list: []
  782. },
  783. shows: false,
  784. shouhuoma: '',
  785. userId: '', //用户id
  786. checkCertification: '', //是否实名认证
  787. receivingPettern: 2, //1近单模式 2同城模式
  788. province: '',
  789. city: '',
  790. district: '',
  791. time: '',
  792. distance: "",
  793. jiedanSuccess: '',
  794. jiedan: "",
  795. arr: [],
  796. showModal111: true,
  797. orderNum: 0,
  798. }
  799. },
  800. onHide() {
  801. clearInterval(this.time)
  802. },
  803. onLoad() {
  804. uni.showLoading({
  805. title: '加载中...'
  806. })
  807. var dizhi = uni.getStorageSync('dizhi')
  808. if (dizhi.longitude) {
  809. this.longitude = dizhi.longitude
  810. this.latitude = dizhi.latitude
  811. }
  812. this.taskData()
  813. let that = this
  814. this.time = setInterval(function() {
  815. that.taskData()
  816. that.getLocation()
  817. }, 5000)
  818. // #ifdef MP-WEIXIN
  819. try {
  820. wx.getPrivacySetting({
  821. success: res => {
  822. console.log("是否需要授权:", res.needAuthorization, "隐私协议的名称为:", res.privacyContractName)
  823. if (res.needAuthorization) {
  824. that.privacyContractName = res.privacyContractName;
  825. // this.$refs.popusAuthorization.open();
  826. that.Authorization = true;
  827. }
  828. },
  829. fail: () => {},
  830. complete: () => {},
  831. })
  832. } catch (e) {
  833. //TODO handle the exception
  834. }
  835. // #endif
  836. },
  837. onShow() {
  838. let that = this
  839. that.getOrderNum()
  840. //是否开启骑手新订单推送 340
  841. that.$Request.getT('/app/common/type/340').then(res => {
  842. if (res.code === 0) {
  843. that.checkxdd = res.data.value
  844. }
  845. });
  846. //骑手新订单通知范围(km) 339
  847. that.$Request.getT('/app/common/type/339').then(res => {
  848. if (res.code === 0) {
  849. that.xddNumber = res.data.value
  850. }
  851. });
  852. that.$Request.getT('/app/common/type/331').then(res => {
  853. if (res.code === 0) {
  854. uni.setStorageSync('tuiguang', res.data.value)
  855. that.tuiguang = res.data.value
  856. }
  857. });
  858. that.$Request.getT('/app/common/type/332').then(res => {
  859. if (res.code === 0) {
  860. uni.setStorageSync('tuiguangImg', res.data.value)
  861. that.tuiguangImg = res.data.value
  862. }
  863. });
  864. // 自动派单距离
  865. that.$Request.getT('/app/common/type/303').then(res => {
  866. if (res.code === 0) {
  867. if (res.data.value > 1000) {
  868. that.distance = res.data.value / 1000 + '公里'
  869. } else if (res.data.value > 100) {
  870. that.distance = res.data.value + 'm'
  871. }
  872. }
  873. });
  874. //骑手端接单成功通知
  875. that.$Request.getT('/app/common/type/310').then(res => {
  876. if (res.code === 0) {
  877. // this.jiedan = res.data.value
  878. that.arr.push(res.data.value)
  879. }
  880. });
  881. //骑手端订单完成通知
  882. that.$Request.getT('/app/common/type/311').then(res => {
  883. if (res.code === 0) {
  884. // this.jiedanSuccess = res.data.value
  885. that.arr.push(res.data.value)
  886. }
  887. });
  888. //用户端骑手转单订单通知 338
  889. that.$Request.getT('/app/common/type/338').then(res => {
  890. if (res.code === 0) {
  891. that.arr.push(res.data.value)
  892. }
  893. });
  894. //用户端骑手转单订单通知 335
  895. // that.$Request.getT('/app/common/type/335').then(res => {
  896. // if (res.code === 0) {
  897. // that.arr.push(res.data.value)
  898. // }
  899. // });
  900. console.log(uni.getStorageSync('avatar'),'uni.getStorageSync')
  901. that.avatar = uni.getStorageSync('avatar') ? uni.getStorageSync('avatar') : '../../static/logo.png'
  902. that.userId = uni.getStorageSync('userId')
  903. if (that.userId) {
  904. console.log(that.userId, '用户id')
  905. uni.getLocation({
  906. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  907. success: function(res) {
  908. console.log('当前位置的经度:' + res.longitude);
  909. console.log('当前位置的纬度:' + res.latitude);
  910. let data = {
  911. lat: res.latitude,
  912. lng: res.longitude
  913. }
  914. that.$Request.getT('/app/Login/selectCity', data).then(res => {
  915. if (res.code == 0) {
  916. that.province = res.data.province
  917. that.city = res.data.city
  918. that.district = res.data.district
  919. }
  920. });
  921. },
  922. fail(e) {
  923. uni.hideLoading();
  924. uni.showModal({
  925. title: '温馨提示',
  926. content: '您的定位权限未开启,请开启后再来操作吧!',
  927. showCancel: true,
  928. cancelText: '取消',
  929. confirmText: '确认',
  930. success: res => {
  931. if (res.confirm) {
  932. // #ifdef MP-WEIXIN
  933. uni.openSetting({ // 打开设置页
  934. success(rea) {
  935. console.log(rea.authSetting)
  936. }
  937. });
  938. // #endif
  939. // #ifdef APP-PLUS
  940. gotoAppPermissionSetting()
  941. // #endif
  942. }
  943. }
  944. });
  945. }
  946. });
  947. that.getUserInfo()
  948. }
  949. // #ifdef MP-WEIXIN
  950. //订阅
  951. if (that.userId) {
  952. if (that.showModal111) {
  953. that.openMsg()
  954. }
  955. }
  956. // #endif
  957. },
  958. methods: {
  959. // 打开隐私协议页面
  960. openPrivacyContract() {
  961. let that = this;
  962. wx.openPrivacyContract({
  963. fail: () => {
  964. that.$queue.showToast('遇到错误无法打开!');
  965. }
  966. })
  967. },
  968. // 拒绝隐私协议
  969. exitMiniProgram() {
  970. // 直接退出小程序
  971. wx.exitMiniProgram()
  972. },
  973. // 同意隐私协议
  974. handleAgreePrivacyAuthorization() {
  975. // this.$refs.popusAuthorization.close();
  976. this.Authorization = false;
  977. let that = this;
  978. uni.getLocation({
  979. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  980. success: function(res) {
  981. console.log('当前位置的经度:' + res.longitude);
  982. console.log('当前位置的纬度:' + res.latitude);
  983. let data = {
  984. lat: res.latitude,
  985. lng: res.longitude
  986. }
  987. that.$Request.getT('/app/Login/selectCity', data).then(res => {
  988. if (res.code == 0) {
  989. that.province = res.data.province
  990. that.city = res.data.city
  991. that.district = res.data.district
  992. }
  993. });
  994. },
  995. fail(e) {
  996. uni.hideLoading();
  997. uni.showModal({
  998. title: '温馨提示',
  999. content: '您的定位权限未开启,请开启后再来操作吧!',
  1000. showCancel: true,
  1001. cancelText: '取消',
  1002. confirmText: '确认',
  1003. success: res => {
  1004. if (res.confirm) {
  1005. // #ifdef MP-WEIXIN
  1006. uni.openSetting({ // 打开设置页
  1007. success(rea) {
  1008. console.log(rea.authSetting)
  1009. }
  1010. });
  1011. // #endif
  1012. // #ifdef APP-PLUS
  1013. gotoAppPermissionSetting()
  1014. // #endif
  1015. }
  1016. }
  1017. });
  1018. }
  1019. });
  1020. },
  1021. //获取最大接单数
  1022. getOrderNum() {
  1023. // orderNum
  1024. this.$Request.get('/app/common/type/342').then(res => {
  1025. if (res.code == 0 && res.data.value) {
  1026. this.orderNum = res.data.value
  1027. }
  1028. });
  1029. },
  1030. // 上传骑手位置
  1031. getLocation() {
  1032. if (this.userId) {
  1033. let data = {
  1034. lng: this.longitude,
  1035. lat: this.latitude,
  1036. userId: this.userId,
  1037. province: this.province,
  1038. city: this.city,
  1039. district: this.district,
  1040. }
  1041. this.$Request.getT('/timedtask/riderLocation', data).then(res => {
  1042. if (res.code = 0) {
  1043. console.log('上传骑手位置')
  1044. }
  1045. });
  1046. }
  1047. },
  1048. switchxdd(e) {
  1049. this.xddcheck = e;
  1050. // #ifdef MP-WEIXIN
  1051. if (uni.getStorageSync('sendMsg')) {
  1052. uni.requestSubscribeMessage({
  1053. tmplIds: this.arr,
  1054. success(re) {
  1055. // console.log(re,'**********')
  1056. var datas = JSON.stringify(re);
  1057. if (datas.indexOf("accept") != -1) {
  1058. console.log(re)
  1059. }
  1060. },
  1061. fail: (res) => {
  1062. console.log(res)
  1063. }
  1064. })
  1065. }
  1066. // #endif
  1067. let isSendMsg = 1;
  1068. if (!this.xddcheck) {
  1069. isSendMsg = 2;
  1070. }
  1071. let data = {
  1072. isSendMsg: isSendMsg
  1073. }
  1074. this.$Request.postJson('/app/user/updateUser', data).then(res => {
  1075. if (res.code == 0) {
  1076. }
  1077. });
  1078. },
  1079. //获取用户信息
  1080. getUserInfo() {
  1081. let that = this
  1082. that.$Request.getT('/app/userinfo/findUserInfoById').then(res => {
  1083. if (res.code == 0 && res.data) {
  1084. that.seen = res.data.onLineFlag == 1 ? false : true
  1085. // that.xddcheck = res.data.isSendMsg == 2 ? false : true;
  1086. that.checkCertification = res.data.checkCertification
  1087. uni.setStorageSync("checkCertification", res.data.checkCertification);
  1088. if (that.seen) {
  1089. that.tit = '休息中'
  1090. } else {
  1091. that.tit = '接单中'
  1092. // that.locationUpdate()
  1093. }
  1094. uni.getLocation({
  1095. type: 'wgs84',
  1096. success: function(res) {
  1097. console.log('当前位置的经度:' + res.longitude);
  1098. console.log('当前位置的纬度:' + res.latitude);
  1099. that.longitude = res.longitude
  1100. that.latitude = res.latitude
  1101. that.locationUpdate(that.longitude, that.latitude)
  1102. if (that.current == 0) {
  1103. that.taskData()
  1104. } else if (that.current == 1) {
  1105. that.indentState = 3
  1106. that.taskDataJ()
  1107. } else if (that.current == 2) {
  1108. that.indentState = 4
  1109. that.taskDataJ()
  1110. }
  1111. }
  1112. });
  1113. }
  1114. });
  1115. },
  1116. // 顶部tab切换
  1117. change(index) {
  1118. // #ifdef MP-WEIXIN
  1119. if (uni.getStorageSync('sendMsg')) {
  1120. uni.requestSubscribeMessage({
  1121. tmplIds: this.arr,
  1122. success(re) {
  1123. // console.log(re,'**********')
  1124. var datas = JSON.stringify(re);
  1125. if (datas.indexOf("accept") != -1) {
  1126. console.log(re)
  1127. }
  1128. },
  1129. fail: (res) => {
  1130. console.log(res)
  1131. }
  1132. })
  1133. }
  1134. // #endif
  1135. this.current = index;
  1136. this.page = 1
  1137. if (index == 0) { //接单池
  1138. uni.showLoading({
  1139. title: '加载中...'
  1140. })
  1141. this.taskData()
  1142. } else if (index == 1) { //待取货
  1143. uni.showLoading({
  1144. title: '加载中...'
  1145. })
  1146. this.indentState = 3
  1147. this.taskDataJ()
  1148. } else if (index == 2) { //配送中
  1149. uni.showLoading({
  1150. title: '加载中...'
  1151. })
  1152. this.indentState = 4
  1153. this.taskDataJ()
  1154. } else if (index == 3) { //全部订单
  1155. // uni.showLoading({
  1156. // title: '加载中...'
  1157. // })
  1158. this.current = 0;
  1159. uni.navigateTo({
  1160. url: '/pages/riderMy/order'
  1161. })
  1162. }
  1163. },
  1164. // 上下线
  1165. bindup() {
  1166. let that = this
  1167. if (!that.userId) {
  1168. uni.navigateTo({
  1169. url: '/pages/login/login'
  1170. })
  1171. return
  1172. }
  1173. // #ifdef MP-WEIXIN
  1174. if (uni.getStorageSync('sendMsg')) {
  1175. uni.requestSubscribeMessage({
  1176. tmplIds: this.arr,
  1177. success(re) {
  1178. // console.log(re,'**********')
  1179. var datas = JSON.stringify(re);
  1180. if (datas.indexOf("accept") != -1) {
  1181. console.log(re)
  1182. }
  1183. },
  1184. fail: (res) => {
  1185. console.log(res)
  1186. }
  1187. })
  1188. }
  1189. // #endif
  1190. let content = ''
  1191. if (that.seen) {
  1192. content = '确认开始接单吗'
  1193. } else {
  1194. content = '确认停止接单吗'
  1195. }
  1196. uni.showModal({
  1197. title: '提示',
  1198. content: content,
  1199. success: function(res) {
  1200. if (res.confirm) {
  1201. that.$Request.postT('/app/userinfo/updateOnLine', {
  1202. onLineFlag: that.seen ? 1 : 2,
  1203. }).then(res => {
  1204. that.getUserInfo()
  1205. });
  1206. }
  1207. },
  1208. })
  1209. },
  1210. // 更新骑手位置信息
  1211. locationUpdate(lng, lat) {
  1212. let that = this
  1213. // setInterval(function() {
  1214. that.$Request.postT('/app/userinfo/updateCoordinate', {
  1215. lng: lng,
  1216. lat: lat,
  1217. }).then(res => {
  1218. console.log('位置信息更新', res)
  1219. that.taskData()
  1220. });
  1221. // }, 600000)
  1222. },
  1223. // 跳转订单详情
  1224. binddetails(id, types) {
  1225. // #ifdef MP-WEIXIN
  1226. if (uni.getStorageSync('sendMsg')) {
  1227. uni.requestSubscribeMessage({
  1228. tmplIds: this.arr,
  1229. success(re) {
  1230. // console.log(re,'**********')
  1231. var datas = JSON.stringify(re);
  1232. if (datas.indexOf("accept") != -1) {
  1233. console.log(re)
  1234. }
  1235. },
  1236. fail: (res) => {
  1237. console.log(res)
  1238. }
  1239. })
  1240. }
  1241. // #endif
  1242. console.log('```', id, types)
  1243. if (types == 1 || types == 2 || types == 3 || types == 5) {
  1244. uni.navigateTo({
  1245. url: '/pages/index/buyOrder/buyOrder?id=' + id
  1246. })
  1247. } else {
  1248. uni.navigateTo({
  1249. url: '/pages/index/cityOrder/cityOrder?id=' + id
  1250. })
  1251. }
  1252. },
  1253. // 接单
  1254. bindorder(item) {
  1255. let that = this
  1256. if (!that.userId) {
  1257. uni.showModal({
  1258. title: '提示',
  1259. content: '请先登录后再接单',
  1260. success: function(res) {
  1261. if (res.confirm) {
  1262. console.log('用户点击确定');
  1263. uni.navigateTo({
  1264. url: '/pages/login/login'
  1265. })
  1266. } else if (res.cancel) {
  1267. console.log('用户点击取消');
  1268. }
  1269. }
  1270. });
  1271. return;
  1272. }
  1273. // #ifdef MP-WEIXIN
  1274. if (uni.getStorageSync('sendMsg')) {
  1275. uni.requestSubscribeMessage({
  1276. tmplIds: this.arr,
  1277. success(re) {
  1278. // console.log(re,'**********')
  1279. var datas = JSON.stringify(re);
  1280. if (datas.indexOf("accept") != -1) {
  1281. console.log(re)
  1282. }
  1283. },
  1284. fail: (res) => {
  1285. console.log(res)
  1286. }
  1287. })
  1288. }
  1289. // #endif
  1290. if (that.checkCertification == null) {
  1291. uni.showModal({
  1292. title: '提示',
  1293. content: '请先实名认证后再接单',
  1294. success: function(res) {
  1295. if (res.confirm) {
  1296. console.log('用户点击确定');
  1297. uni.navigateTo({
  1298. url: '/pages/riderMy/approve/approve'
  1299. })
  1300. } else if (res.cancel) {
  1301. console.log('用户点击取消');
  1302. }
  1303. }
  1304. });
  1305. return;
  1306. }
  1307. if (that.checkCertification == 0) {
  1308. uni.showToast({
  1309. title: '实名认证审核中,无法接单',
  1310. icon: 'none'
  1311. });
  1312. return;
  1313. }
  1314. if (that.checkCertification == 2) {
  1315. uni.showToast({
  1316. title: '实名认证未通过,无法接单',
  1317. icon: 'none'
  1318. });
  1319. return;
  1320. }
  1321. uni.showModal({
  1322. title: '提示',
  1323. content: '确认接单吗',
  1324. success: function(res) {
  1325. if (res.confirm) {
  1326. console.log('用户点击确定');
  1327. that.$Request.postT('/app/tbindent/indentReceiving', {
  1328. indentNumber: item.indentNumber
  1329. }).then(res => {
  1330. if (res.code == 0) {
  1331. that.page = 1
  1332. that.taskData()
  1333. uni.showToast({
  1334. title: '接单成功',
  1335. icon: 'none',
  1336. duration: 1000
  1337. });
  1338. } else {
  1339. console.log('失败:', res.data)
  1340. uni.showToast({
  1341. title: res.msg,
  1342. icon: 'none',
  1343. duration: 1500
  1344. });
  1345. that.page = 1
  1346. that.taskData()
  1347. }
  1348. });
  1349. } else if (res.cancel) {
  1350. console.log('用户点击取消');
  1351. }
  1352. }
  1353. });
  1354. },
  1355. // 未登录接单
  1356. bindorder1() {
  1357. uni.showToast({
  1358. title: '上线后方可接单',
  1359. icon: 'none'
  1360. })
  1361. },
  1362. bindridermy() {
  1363. // #ifdef MP-WEIXIN
  1364. if (uni.getStorageSync('sendMsg')) {
  1365. uni.requestSubscribeMessage({
  1366. tmplIds: this.arr,
  1367. success(re) {
  1368. // console.log(re,'**********')
  1369. var datas = JSON.stringify(re);
  1370. if (datas.indexOf("accept") != -1) {
  1371. console.log(re)
  1372. }
  1373. },
  1374. fail: (res) => {
  1375. console.log(res)
  1376. }
  1377. })
  1378. }
  1379. // #endif
  1380. uni.navigateTo({
  1381. url: '/pages/riderMy/riderMy'
  1382. })
  1383. },
  1384. onshow() {
  1385. console.log('第一个')
  1386. this.show = true
  1387. },
  1388. // 获取新任务数据
  1389. taskData() {
  1390. this.$Request.postJson('/app/tbindent/findNewIndent', {
  1391. page: this.page,
  1392. limit: 10,
  1393. riderlat: this.longitude,
  1394. riderlng: this.latitude,
  1395. receivingPettern: this.receivingPettern,
  1396. indentType: this.indentType,
  1397. }).then(res => {
  1398. uni.hideLoading()
  1399. if (res.data) {
  1400. if (res.data.list.length > 0) {
  1401. for (var i = 0; i < res.data.list.length; i++) {
  1402. if (res.data.list[i].distancess > 1000) {
  1403. res.data.list[i].distancess = Number((res.data.list[i].distancess / 1000))
  1404. .toFixed(
  1405. 2) + "km"
  1406. } else {
  1407. if (res.data.list[i].distancess == '0') {
  1408. res.data.list[i].distancess = "0m";
  1409. } else {
  1410. res.data.list[i].distancess = Number(res.data.list[i].distancess).toFixed(
  1411. 1) +
  1412. "m";
  1413. }
  1414. }
  1415. // if (res.data.list[i].distance > 1000) {
  1416. // res.data.list[i].distance = Number((res.data.list[i].distance / 1000)).toFixed(2) + "km"
  1417. // } else {
  1418. // if (res.data.list[i].distance == 0) {
  1419. // res.data.list[i].distance = "0m";
  1420. // } else {
  1421. // res.data.list[i].distance = Number(res.data.list[i].distance).toFixed(1) + "m";
  1422. // }
  1423. // }
  1424. if (res.data.list[i].distancessd > 1000) {
  1425. res.data.list[i].distancessd = Number((res.data.list[i].distancessd / 1000))
  1426. .toFixed(2) + "km"
  1427. } else {
  1428. if (res.data.list[i].distancessd == '0') {
  1429. res.data.list[i].distancessd = "0m";
  1430. } else {
  1431. res.data.list[i].distancessd = Number(res.data.list[i].distancessd)
  1432. .toFixed(
  1433. 1) + "m";
  1434. }
  1435. }
  1436. }
  1437. }
  1438. this.totalCount = res.data.totalCount
  1439. if (this.page == 1) {
  1440. this.list_box = res.data.list
  1441. } else {
  1442. this.list_box = this.list_box.concat(list)
  1443. }
  1444. }
  1445. this.$forceUpdate()
  1446. uni.stopPullDownRefresh();
  1447. });
  1448. },
  1449. // 获取待取货和配送中订单
  1450. taskDataJ() {
  1451. // uni.showLoading({
  1452. // title: '加载中'
  1453. // });
  1454. this.$Request.getT('/app/tbindent/findRiderIndent', {
  1455. page: this.page,
  1456. limit: 10,
  1457. indentState: this.indentState
  1458. // ol: this.longitude,
  1459. // od: this.latitude
  1460. }).then(res => {
  1461. uni.hideLoading()
  1462. if (this.page == 1) {
  1463. this.lists = res.data
  1464. } else {
  1465. this.lists = this.lists.concat(res.data.list)
  1466. }
  1467. for (var i in this.lists) {
  1468. if (this.lists[i].distanceInitial > 1000) {
  1469. this.lists[i].distanceInitials = (Number(this.lists[i].distanceInitial) / 1000)
  1470. .toFixed(2)
  1471. }
  1472. if (this.lists[i].distance > 1000) {
  1473. this.lists[i].distances = (Number(this.lists[i].distance) / 1000).toFixed(2)
  1474. }
  1475. }
  1476. console.log('lists', this.lists)
  1477. uni.stopPullDownRefresh();
  1478. });
  1479. },
  1480. switch1(e) {
  1481. // #ifdef MP-WEIXIN
  1482. if (uni.getStorageSync('sendMsg')) {
  1483. uni.requestSubscribeMessage({
  1484. tmplIds: this.arr,
  1485. success(re) {
  1486. // console.log(re,'**********')
  1487. var datas = JSON.stringify(re);
  1488. if (datas.indexOf("accept") != -1) {
  1489. console.log(re)
  1490. }
  1491. },
  1492. fail: (res) => {
  1493. console.log(res)
  1494. }
  1495. })
  1496. }
  1497. // #endif
  1498. this.checked = e
  1499. this.check = !this.check
  1500. if (e == true) {
  1501. this.receivingPettern = 1
  1502. }
  1503. if (e == false) {
  1504. // this.checked = false
  1505. // this.check = true
  1506. this.receivingPettern = 2
  1507. }
  1508. console.log(e)
  1509. },
  1510. switch2(e) {
  1511. // #ifdef MP-WEIXIN
  1512. if (uni.getStorageSync('sendMsg')) {
  1513. uni.requestSubscribeMessage({
  1514. tmplIds: this.arr,
  1515. success(re) {
  1516. // console.log(re,'**********')
  1517. var datas = JSON.stringify(re);
  1518. if (datas.indexOf("accept") != -1) {
  1519. console.log(re)
  1520. }
  1521. },
  1522. fail: (res) => {
  1523. console.log(res)
  1524. }
  1525. })
  1526. }
  1527. // #endif
  1528. console.log(e)
  1529. this.check = e
  1530. this.checked = !this.check
  1531. if (e == true) {
  1532. // this.checked = true
  1533. // this.check = false
  1534. this.receivingPettern = 2
  1535. }
  1536. if (e == false) {
  1537. // this.checked = false
  1538. // this.check = true
  1539. this.receivingPettern = 1
  1540. }
  1541. },
  1542. // 打开类型选择模态框
  1543. showModals() {
  1544. // #ifdef MP-WEIXIN
  1545. if (uni.getStorageSync('sendMsg')) {
  1546. uni.requestSubscribeMessage({
  1547. tmplIds: this.arr,
  1548. success(re) {
  1549. // console.log(re,'**********')
  1550. var datas = JSON.stringify(re);
  1551. if (datas.indexOf("accept") != -1) {
  1552. console.log(re)
  1553. }
  1554. },
  1555. fail: (res) => {
  1556. console.log(res)
  1557. }
  1558. })
  1559. }
  1560. // #endif
  1561. this.showModal = true
  1562. },
  1563. radioChange(e) {
  1564. // console.log(e);
  1565. },
  1566. radioGroupChange(e) {
  1567. console.log('······2', e);
  1568. this.indentTypeName = e
  1569. },
  1570. // 点击确定按钮
  1571. confirm() {
  1572. // #ifdef MP-WEIXIN
  1573. if (uni.getStorageSync('sendMsg')) {
  1574. uni.requestSubscribeMessage({
  1575. tmplIds: this.arr,
  1576. success(re) {
  1577. // console.log(re,'**********')
  1578. var datas = JSON.stringify(re);
  1579. if (datas.indexOf("accept") != -1) {
  1580. console.log(re)
  1581. }
  1582. },
  1583. fail: (res) => {
  1584. console.log(res)
  1585. }
  1586. })
  1587. }
  1588. // #endif
  1589. if (this.indentTypeName == '全部') {
  1590. this.indentType = null
  1591. }
  1592. if (this.indentTypeName == '帮我取') {
  1593. this.indentType = 2
  1594. }
  1595. if (this.indentTypeName == '帮我送') {
  1596. this.indentType = 1
  1597. }
  1598. if (this.indentTypeName == '同城帮买') {
  1599. this.indentType = 3
  1600. }
  1601. if (this.indentTypeName == '同城服务') {
  1602. this.indentType = 4
  1603. }
  1604. if (this.indentTypeName == '同城外卖') {
  1605. this.indentType = 5
  1606. }
  1607. },
  1608. // 获取地址
  1609. dizhis() {
  1610. var that = this
  1611. uni.chooseLocation({
  1612. success: function(res) {
  1613. console.log(res)
  1614. uni.setStorageSync('dizhi', res);
  1615. that.quyu = res.name
  1616. that.quyuLongitude = res.longitude
  1617. that.quyuLatitude = res.latitude
  1618. }
  1619. });
  1620. },
  1621. // 关闭底部弹出层
  1622. closePopup() {
  1623. // #ifdef MP-WEIXIN
  1624. if (uni.getStorageSync('sendMsg')) {
  1625. uni.requestSubscribeMessage({
  1626. tmplIds: this.arr,
  1627. success(re) {
  1628. // console.log(re,'**********')
  1629. var datas = JSON.stringify(re);
  1630. if (datas.indexOf("accept") != -1) {
  1631. console.log(re)
  1632. }
  1633. },
  1634. fail: (res) => {
  1635. console.log(res)
  1636. }
  1637. })
  1638. }
  1639. // #endif
  1640. this.page = 1
  1641. if (this.quyuLongitude != '') {
  1642. this.longitude = this.quyuLongitude
  1643. this.latitude = this.quyuLatitude
  1644. }
  1645. this.taskData()
  1646. },
  1647. // 订单详情
  1648. bindorderDetail(indentNumber, orderId) {
  1649. // #ifdef MP-WEIXIN
  1650. if (uni.getStorageSync('sendMsg')) {
  1651. uni.requestSubscribeMessage({
  1652. tmplIds: this.arr,
  1653. success(re) {
  1654. // console.log(re,'**********')
  1655. var datas = JSON.stringify(re);
  1656. if (datas.indexOf("accept") != -1) {
  1657. console.log(re)
  1658. }
  1659. },
  1660. fail: (res) => {
  1661. console.log(res)
  1662. }
  1663. })
  1664. }
  1665. // #endif
  1666. console.log(indentNumber, orderId)
  1667. uni.navigateTo({
  1668. url: '/pages/index/orderdetail/orderdetail?orderId=' + orderId + '&id=' + indentNumber
  1669. })
  1670. },
  1671. // 取消订单
  1672. quxiao(indentNumber) {
  1673. // #ifdef MP-WEIXIN
  1674. if (uni.getStorageSync('sendMsg')) {
  1675. uni.requestSubscribeMessage({
  1676. tmplIds: this.arr,
  1677. success(re) {
  1678. // console.log(re,'**********')
  1679. var datas = JSON.stringify(re);
  1680. if (datas.indexOf("accept") != -1) {
  1681. console.log(re)
  1682. }
  1683. },
  1684. fail: (res) => {
  1685. console.log(res)
  1686. }
  1687. })
  1688. }
  1689. // #endif
  1690. let that = this
  1691. uni.showModal({
  1692. title: '提示',
  1693. content: '取消订单将会被扣保证金',
  1694. success: function(res) {
  1695. if (res.confirm) {
  1696. console.log('用户点击确定');
  1697. that.$Request.postT('/app/tbindent/riderCancleIndent', {
  1698. indentNumber: indentNumber
  1699. }).then(res => {
  1700. console.log(res)
  1701. if (res.code == 0) {
  1702. uni.showToast({
  1703. title: '订单已取消',
  1704. icon: "none"
  1705. });
  1706. that.taskDataJ()
  1707. } else {
  1708. uni.showToast({
  1709. title: res.msg,
  1710. icon: "none"
  1711. });
  1712. that.taskDataJ()
  1713. }
  1714. });
  1715. } else if (res.cancel) {
  1716. console.log('用户点击取消');
  1717. }
  1718. }
  1719. });
  1720. },
  1721. quhuo(indentId) {
  1722. let that = this
  1723. // #ifdef MP-WEIXIN
  1724. if (uni.getStorageSync('sendMsg')) {
  1725. uni.requestSubscribeMessage({
  1726. tmplIds: this.arr,
  1727. success(re) {
  1728. // console.log(re,'**********')
  1729. var datas = JSON.stringify(re);
  1730. if (datas.indexOf("accept") != -1) {
  1731. console.log(re)
  1732. }
  1733. },
  1734. fail: (res) => {
  1735. console.log(res)
  1736. }
  1737. })
  1738. }
  1739. // #endif
  1740. uni.showModal({
  1741. title: '提示',
  1742. content: '确认到取货吗',
  1743. success: function(res) {
  1744. if (res.confirm) {
  1745. that.$Request.postJson('/app/tbindent/riderBuyGoods', {
  1746. indentId: indentId,
  1747. indentState: '4'
  1748. }).then(res => {
  1749. console.log(res)
  1750. if (res.code == 0) {
  1751. uni.showToast({
  1752. title: '确认取货成功',
  1753. icon: "none"
  1754. });
  1755. // that.indentState = 4
  1756. setTimeout(function() {
  1757. that.taskDataJ()
  1758. // that.current = 2
  1759. }, 1000)
  1760. } else {
  1761. uni.showToast({
  1762. title: res.msg,
  1763. icon: "none"
  1764. });
  1765. setTimeout(function() {
  1766. that.taskDataJ()
  1767. // that.current = 2
  1768. }, 1000)
  1769. }
  1770. });
  1771. } else {
  1772. }
  1773. },
  1774. })
  1775. },
  1776. shouhuo(e) {
  1777. console.log('第二个')
  1778. this.indentNumber = e.indentNumber
  1779. // if(e.indentType==5){
  1780. // this.querenSh()
  1781. // }
  1782. if (e.itemCodeFlag == 0 && e.indentType != 5) {
  1783. this.shows = true
  1784. } else {
  1785. this.querenSh()
  1786. }
  1787. },
  1788. querenSh() {
  1789. // #ifdef MP-WEIXIN
  1790. if (uni.getStorageSync('sendMsg')) {
  1791. uni.requestSubscribeMessage({
  1792. tmplIds: this.arr,
  1793. success(re) {
  1794. // console.log(re,'**********')
  1795. var datas = JSON.stringify(re);
  1796. if (datas.indexOf("accept") != -1) {
  1797. console.log(re)
  1798. }
  1799. },
  1800. fail: (res) => {
  1801. console.log(res)
  1802. }
  1803. })
  1804. }
  1805. // #endif
  1806. let that = this
  1807. // var date = new Date();
  1808. // var year = date.getFullYear();
  1809. // let Rcode = year + that.shouhuoma
  1810. that.$Request.postT('/app/tbindent/riderDelivery', {
  1811. indentNumber: that.indentNumber,
  1812. // itemCode: Rcode
  1813. itemCode: that.shouhuoma
  1814. }).then(res => {
  1815. console.log(res)
  1816. that.shouhuoma = '';
  1817. if (res.code == 0) {
  1818. that.shows = false
  1819. uni.showToast({
  1820. title: '订完完成',
  1821. icon: "none"
  1822. });
  1823. this.lists = []
  1824. that.taskDataJ()
  1825. } else {
  1826. uni.showToast({
  1827. title: res.msg,
  1828. icon: "none"
  1829. });
  1830. that.taskDataJ()
  1831. }
  1832. });
  1833. },
  1834. // 开启订阅消息
  1835. openMsg() {
  1836. console.log('订阅消息')
  1837. var that = this
  1838. uni.getSetting({
  1839. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  1840. success(ret) {
  1841. console.log(ret.subscriptionsSetting, '------------------')
  1842. // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
  1843. if (ret.subscriptionsSetting.itemSettings) {
  1844. uni.setStorageSync('sendMsg', true)
  1845. uni.openSetting({ // 打开设置页
  1846. success(rea) {
  1847. console.log(rea.authSetting)
  1848. }
  1849. });
  1850. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  1851. uni.setStorageSync('sendMsg', false)
  1852. uni.showModal({
  1853. title: '提示',
  1854. content: '为了更好的体验,请绑定消息推送',
  1855. confirmText: '确定',
  1856. cancelText: '取消',
  1857. success: function(res) {
  1858. if (res.confirm) {
  1859. wx.requestSubscribeMessage({
  1860. tmplIds: that.arr,
  1861. success(re) {
  1862. var datas = JSON.stringify(re);
  1863. if (datas.indexOf("accept") != -1) {
  1864. console.log(re)
  1865. // uni.setStorageSync('sendMsg', true)
  1866. }
  1867. },
  1868. fail: (res) => {
  1869. console.log(res)
  1870. }
  1871. })
  1872. // uni.setStorageSync('sendMsg', true)
  1873. that.showModal111 = false
  1874. } else if (res.cancel) {
  1875. console.log('取消')
  1876. // uni.setStorageSync('sendMsg', false)
  1877. that.showModal111 = true
  1878. }
  1879. }
  1880. })
  1881. }
  1882. }
  1883. })
  1884. },
  1885. },
  1886. // 上拉加载
  1887. onReachBottom: function() {
  1888. if (this.page < this.totalCount) {
  1889. this.page = this.page + 1;
  1890. } else {
  1891. uni.showToast({
  1892. title: '已经最后一页啦',
  1893. icon: 'none'
  1894. })
  1895. }
  1896. this.taskData();
  1897. },
  1898. onPullDownRefresh: function() {
  1899. this.page = 1;
  1900. if (this.current == 0) {
  1901. this.taskData();
  1902. } else {
  1903. this.taskDataJ();
  1904. }
  1905. },
  1906. }
  1907. </script>
  1908. <style>
  1909. body {
  1910. background: #F5F5F5;
  1911. }
  1912. .privacy {
  1913. position: fixed;
  1914. top: 0;
  1915. right: 0;
  1916. bottom: 0;
  1917. left: 0;
  1918. background: rgba(0, 0, 0, .5);
  1919. z-index: 9999999;
  1920. display: flex;
  1921. align-items: center;
  1922. justify-content: center;
  1923. }
  1924. .contentview {
  1925. width: 632rpx;
  1926. padding: 48rpx;
  1927. box-sizing: border-box;
  1928. background: #fff;
  1929. border-radius: 16rpx;
  1930. }
  1931. .contentview .title {
  1932. text-align: center;
  1933. color: #333;
  1934. font-weight: bold;
  1935. font-size: 32rpx;
  1936. }
  1937. .contentview .des {
  1938. font-size: 26rpx;
  1939. color: #666;
  1940. margin-top: 40rpx;
  1941. text-align: justify;
  1942. line-height: 1.6;
  1943. }
  1944. .contentview .des .link {
  1945. color: #07c160;
  1946. text-decoration: underline;
  1947. }
  1948. button::after {
  1949. border: none;
  1950. }
  1951. .btns {
  1952. margin-top: 48rpx;
  1953. display: flex;
  1954. }
  1955. .btns .item {
  1956. justify-content: space-between;
  1957. width: 244rpx;
  1958. height: 80rpx;
  1959. display: flex;
  1960. align-items: center;
  1961. justify-content: center;
  1962. border-radius: 16rpx;
  1963. box-sizing: border-box;
  1964. border: none;
  1965. }
  1966. .btns .reject {
  1967. background: #f4f4f5;
  1968. color: #909399;
  1969. }
  1970. .btns .agree {
  1971. background: #07c160;
  1972. color: #fff;
  1973. }
  1974. .content {
  1975. margin-top: 100rpx;
  1976. }
  1977. .slot-wrap {
  1978. display: flex;
  1979. justify-content: center;
  1980. align-items: center;
  1981. /* 如果您想让slot内容占满整个导航栏的宽度 */
  1982. /* flex: 1; */
  1983. /* 如果您想让slot内容与导航栏左右有空隙 */
  1984. /* padding: 0 30rpx; */
  1985. }
  1986. .u-title {
  1987. color: #000000 !important;
  1988. font-size: 31rpx !important;
  1989. font-weight: bold !important;
  1990. }
  1991. .solt {
  1992. position: relative;
  1993. }
  1994. .slot_left {
  1995. width: 60rpx;
  1996. height: 60rpx;
  1997. position: absolute;
  1998. top: 15rpx;
  1999. left: 20rpx;
  2000. }
  2001. .slot_left image {
  2002. width: 60rpx;
  2003. height: 60rpx;
  2004. }
  2005. .slot_content {
  2006. width: 35rpx;
  2007. height: 35rpx;
  2008. position: absolute;
  2009. top: 26rpx;
  2010. left: 280rpx;
  2011. }
  2012. .slot_content image {
  2013. width: 35rpx;
  2014. height: 35rpx;
  2015. }
  2016. /* tabs */
  2017. .u-tab-item {
  2018. color: #333333 !important;
  2019. /* font-size: 26rpx !important; */
  2020. letter-spacing: 2rpx;
  2021. }
  2022. .u-tab-bar {
  2023. width: 65rpx !important;
  2024. height: 8rpx !important;
  2025. background-color: #FF7F00 !important;
  2026. border-radius: 0rpx !important;
  2027. position: absolute !important;
  2028. bottom: 0rpx !important;
  2029. left: -14rpx !important;
  2030. }
  2031. .tabs_box {
  2032. display: none;
  2033. padding-bottom: 120rpx;
  2034. }
  2035. .dis {
  2036. display: block;
  2037. width: 100%;
  2038. margin-bottom: 190rpx;
  2039. }
  2040. .list_box1 {
  2041. width: 90%;
  2042. margin: 0 auto;
  2043. height: auto;
  2044. background: #FFFFFF;
  2045. border-radius: 23rpx;
  2046. box-shadow: 0rpx 5rpx 5rpx 0rpx rgba(198, 186, 181, 0.20);
  2047. margin-top: 20rpx;
  2048. padding-bottom: 20rpx;
  2049. }
  2050. .list_box {
  2051. width: 90%;
  2052. margin: 0 auto;
  2053. height: auto;
  2054. background: #FFFFFF;
  2055. border-radius: 23rpx;
  2056. box-shadow: 0rpx 5rpx 5rpx 0rpx rgba(198, 186, 181, 0.20);
  2057. margin-top: 20rpx;
  2058. padding-bottom: 20rpx;
  2059. }
  2060. .part1 {
  2061. width: 90%;
  2062. margin: 0 auto;
  2063. justify-content: left;
  2064. align-items: center;
  2065. display: flex;
  2066. height: 100rpx;
  2067. position: relative;
  2068. }
  2069. .box_one {
  2070. background: #c4e2ff;
  2071. color: #359CFF;
  2072. /* width: 60px;
  2073. height: 45rpx; */
  2074. padding: 0px 10px;
  2075. font-size: 26rpx;
  2076. text-align: center;
  2077. line-height: 45rpx;
  2078. border-radius: 5rpx;
  2079. }
  2080. .box_four {
  2081. color: #666666;
  2082. border: 1rpx solid #666666;
  2083. font-size: 22rpx;
  2084. width: 95px;
  2085. height: 40rpx;
  2086. text-align: center;
  2087. line-height: 40rpx;
  2088. border-radius: 5rpx;
  2089. margin-left: 20rpx;
  2090. }
  2091. .box_two {
  2092. color: #666666;
  2093. border: 1rpx solid #666666;
  2094. font-size: 22rpx;
  2095. /* width: 60px; */
  2096. height: 40rpx;
  2097. text-align: center;
  2098. line-height: 40rpx;
  2099. border-radius: 5rpx;
  2100. margin-left: 20rpx;
  2101. padding: 0 10rpx
  2102. }
  2103. .box_two1 {
  2104. width: auto;
  2105. padding: 0 10rpx;
  2106. }
  2107. .box_three {
  2108. color: #666666;
  2109. border: 1rpx solid #666666;
  2110. font-size: 22rpx;
  2111. width: 75px;
  2112. height: 40rpx;
  2113. text-align: center;
  2114. line-height: 40rpx;
  2115. border-radius: 5rpx;
  2116. margin-left: 20rpx;
  2117. }
  2118. .part2 {
  2119. width: 90%;
  2120. margin: 0 auto;
  2121. }
  2122. /* 下线 */
  2123. .address_name {
  2124. font-size: 28rpx;
  2125. font-weight: bold;
  2126. letter-spacing: 2rpx;
  2127. /* line-height: 60rpx; */
  2128. display: -webkit-box;
  2129. -webkit-box-orient: vertical;
  2130. -webkit-line-clamp: 1;
  2131. overflow: hidden;
  2132. }
  2133. .name {
  2134. color: #999999;
  2135. font-size: 21rpx;
  2136. }
  2137. .name text {
  2138. /* margin-left: 10rpx; */
  2139. }
  2140. /* 上线 */
  2141. .box_add {
  2142. display: flex;
  2143. }
  2144. .distance {
  2145. flex: 1;
  2146. /* text-align: center; */
  2147. font-size: 28rpx;
  2148. display: flex;
  2149. justify-content: left;
  2150. align-items: center;
  2151. }
  2152. .a {
  2153. font-size: 16rpx;
  2154. }
  2155. .add_name {
  2156. /* display: flex; */
  2157. flex: 4;
  2158. }
  2159. .sh_name {
  2160. font-size: 28rpx;
  2161. font-weight: bold;
  2162. letter-spacing: 2rpx;
  2163. }
  2164. .sh_name1 {
  2165. font-size: 28rpx;
  2166. font-weight: bold;
  2167. letter-spacing: 2rpx;
  2168. color: #999999;
  2169. }
  2170. .xs_add {
  2171. color: #999999;
  2172. font-size: 21rpx;
  2173. margin-top: 10rpx;
  2174. }
  2175. .jiantou {
  2176. margin-left: 43rpx;
  2177. display: flex;
  2178. /* justify-content: space-between; */
  2179. align-items: center;
  2180. height: 40px;
  2181. line-height: 40px;
  2182. }
  2183. .jiantou image {
  2184. width: 20rpx;
  2185. height: 40rpx;
  2186. }
  2187. .jiantou>view {
  2188. margin-left: 10rpx;
  2189. }
  2190. .part3 {
  2191. width: 90%;
  2192. margin: 0 auto;
  2193. display: flex;
  2194. }
  2195. .three_left {
  2196. flex: 1;
  2197. height: 100rpx;
  2198. display: flex;
  2199. justify-content: left;
  2200. align-items: center;
  2201. }
  2202. .three_left image {
  2203. width: 20px;
  2204. height: 20px;
  2205. }
  2206. .three_left text {
  2207. color: #FF7F00;
  2208. font-size: 25rpx;
  2209. margin-left: 10rpx;
  2210. }
  2211. .three_right {
  2212. /* flex: 1; */
  2213. height: 100rpx;
  2214. display: flex;
  2215. justify-content: flex-end;
  2216. align-items: center;
  2217. color: #FF7F00;
  2218. font-size: 32rpx;
  2219. font-weight: bold;
  2220. }
  2221. .part4 {
  2222. width: 90%;
  2223. margin: 0 auto;
  2224. }
  2225. .box_btn {
  2226. width: 100%;
  2227. background: #CCCCCC;
  2228. height: 70rpx;
  2229. color: white;
  2230. text-align: center;
  2231. line-height: 70rpx;
  2232. font-size: 26rpx;
  2233. letter-spacing: 2rpx;
  2234. border-radius: 8rpx;
  2235. }
  2236. .box_btn1 {
  2237. width: 100%;
  2238. background: #FF7F00;
  2239. height: 80rpx;
  2240. color: white;
  2241. text-align: center;
  2242. line-height: 80rpx;
  2243. font-size: 31rpx;
  2244. letter-spacing: 2rpx;
  2245. border-radius: 8rpx;
  2246. }
  2247. .part_six {
  2248. width: 90%;
  2249. margin: 0 auto;
  2250. display: flex;
  2251. }
  2252. .phone {
  2253. flex: 1;
  2254. }
  2255. .phone image {
  2256. width: 29rpx;
  2257. height: 33rpx;
  2258. margin-left: 30rpx;
  2259. }
  2260. .conmm {
  2261. font-size: 19rpx;
  2262. text-align: center;
  2263. letter-spacing: 5rpx;
  2264. }
  2265. .box_btn2 {
  2266. flex: 5;
  2267. width: 100%;
  2268. background: #FF7F00;
  2269. height: 70rpx;
  2270. color: white;
  2271. text-align: center;
  2272. line-height: 70rpx;
  2273. font-size: 26rpx;
  2274. letter-spacing: 2rpx;
  2275. border-radius: 6rpx;
  2276. }
  2277. /* tabbar */
  2278. .tabbar {
  2279. position: fixed;
  2280. bottom: 0rpx;
  2281. left: 0rpx;
  2282. right: 0rpx;
  2283. width: 100%;
  2284. height: 100rpx;
  2285. background: #ffffff;
  2286. display: flex;
  2287. }
  2288. .tabbar_type {
  2289. flex: 1;
  2290. text-align: center;
  2291. font-size: 22rpx;
  2292. margin-top: 10rpx;
  2293. }
  2294. .type_image {
  2295. width: 100%;
  2296. display: flex;
  2297. justify-content: center;
  2298. align-items: center;
  2299. }
  2300. .type_image image {
  2301. width: 47rpx;
  2302. height: 47rpx;
  2303. }
  2304. .tabbar_btn {
  2305. flex: 4;
  2306. display: flex;
  2307. justify-content: center;
  2308. align-items: center;
  2309. }
  2310. .btn {
  2311. width: 90%;
  2312. height: 80rpx;
  2313. background: #FF7F00;
  2314. color: white;
  2315. text-align: center;
  2316. line-height: 80rpx;
  2317. font-size: 26rpx;
  2318. letter-spacing: 2rpx;
  2319. border-radius: 8rpx;
  2320. }
  2321. .btn3 {
  2322. width: 90%;
  2323. height: 80rpx;
  2324. background: #CCCCCC;
  2325. color: white;
  2326. text-align: center;
  2327. line-height: 80rpx;
  2328. font-size: 26rpx;
  2329. letter-spacing: 2rpx;
  2330. border-radius: 8rpx;
  2331. }
  2332. /* 接单设置弹框 */
  2333. .u-drawer-bottom {
  2334. background-color: #F5F5F5 !important;
  2335. }
  2336. .popup_box {
  2337. width: 90%;
  2338. margin: 0 auto;
  2339. margin-top: 35rpx;
  2340. }
  2341. .title {
  2342. font-size: 29rpx;
  2343. font-weight: bold;
  2344. letter-spacing: 2rpx;
  2345. }
  2346. .part_one {
  2347. width: 100%;
  2348. background: #ffffff;
  2349. margin-top: 18rpx;
  2350. border-radius: 20rpx;
  2351. display: flex;
  2352. height: 120rpx;
  2353. }
  2354. .left {
  2355. flex: 3;
  2356. line-height: 40rpx;
  2357. margin-left: 20rpx;
  2358. margin-top: 20rpx;
  2359. }
  2360. .gotype {
  2361. font-size: 26rpx;
  2362. font-weight: bold;
  2363. letter-spacing: 2rpx;
  2364. }
  2365. .tit {
  2366. color: #999999;
  2367. font-size: 22rpx;
  2368. letter-spacing: 2rpx;
  2369. }
  2370. .right {
  2371. flex: 1;
  2372. display: flex;
  2373. justify-content: flex-end;
  2374. align-items: center;
  2375. margin-right: 30rpx;
  2376. }
  2377. .part_two {
  2378. width: 100%;
  2379. margin: 0 auto;
  2380. background: #ffffff;
  2381. border-radius: 20rpx;
  2382. margin-top: 20rpx;
  2383. height: 130rpx;
  2384. display: flex;
  2385. }
  2386. .two_left {
  2387. flex: 1;
  2388. display: flex;
  2389. justify-content: left;
  2390. align-items: center;
  2391. margin-left: 30rpx;
  2392. font-size: 29rpx;
  2393. font-weight: bold;
  2394. letter-spacing: 2rpx;
  2395. }
  2396. .two_right {
  2397. flex: 1;
  2398. display: flex;
  2399. justify-content: flex-end;
  2400. align-items: center;
  2401. margin-right: 30rpx;
  2402. color: #999999;
  2403. font-size: 25rpx;
  2404. letter-spacing: 2rpx;
  2405. }
  2406. .slot-content {
  2407. padding: 30rpx;
  2408. }
  2409. /* */
  2410. .tabs_box {
  2411. display: none;
  2412. }
  2413. .dis {
  2414. display: block;
  2415. width: 100%;
  2416. }
  2417. .u-tab-item {
  2418. /* font-size: 26upx !important; */
  2419. /* color: #666666 !important; */
  2420. }
  2421. .success_box {
  2422. width: 100%;
  2423. }
  2424. .order_box {
  2425. width: 90%;
  2426. margin: 0 auto;
  2427. /* height: 420rpx; */
  2428. background: #FFFFFF;
  2429. margin-top: 20rpx;
  2430. border-radius: 16px;
  2431. }
  2432. .order_success {
  2433. width: 90%;
  2434. margin: 0 auto;
  2435. display: flex;
  2436. height: 80upx;
  2437. }
  2438. .order_name {
  2439. flex: 1;
  2440. display: flex;
  2441. justify-content: left;
  2442. align-items: center;
  2443. font-weight: bold;
  2444. font-size: 29rpx;
  2445. letter-spacing: 1upx;
  2446. }
  2447. .order_data {
  2448. flex: 1;
  2449. color: #999999;
  2450. display: flex;
  2451. justify-content: flex-end;
  2452. align-items: center;
  2453. font-size: 26rpx;
  2454. }
  2455. .city_type {
  2456. width: 90%;
  2457. margin: 0 auto;
  2458. height: 60upx;
  2459. line-height: 60upx;
  2460. display: flex;
  2461. justify-content: left;
  2462. align-items: center;
  2463. }
  2464. .type_name {
  2465. font-size: 27rpx;
  2466. }
  2467. .city_text {
  2468. width: 70rpx;
  2469. line-height: 36rpx;
  2470. color: #49A5FF;
  2471. background: #c4e2ff;
  2472. text-align: center;
  2473. font-size: 19rpx;
  2474. margin-left: 20rpx;
  2475. }
  2476. .city_address {
  2477. width: 92%;
  2478. margin: 0 auto;
  2479. margin-top: -10rpx;
  2480. }
  2481. /* 发货地址 */
  2482. .fh_box {
  2483. display: flex;
  2484. /* height: 80upx; */
  2485. margin-top: 20upx;
  2486. }
  2487. .fh_image {
  2488. flex: 1;
  2489. display: flex;
  2490. /* justify-content: left;
  2491. align-items: center; */
  2492. }
  2493. .box {
  2494. flex: 9;
  2495. }
  2496. .fh_name {
  2497. font-size: 26rpx;
  2498. font-weight: 600;
  2499. letter-spacing: 2upx;
  2500. }
  2501. .fh_type {
  2502. color: #999999;
  2503. font-size: 22upx;
  2504. }
  2505. .fh_type text {
  2506. margin-left: 20upx;
  2507. }
  2508. /* 送货地址 */
  2509. .sh_box {
  2510. display: flex;
  2511. margin-bottom: 14upx;
  2512. margin-top: 14rpx;
  2513. }
  2514. .sh_image {
  2515. flex: 1;
  2516. display: flex;
  2517. /* justify-content: left;
  2518. align-items: center; */
  2519. }
  2520. .sh_name {
  2521. font-size: 28rpx;
  2522. font-weight: 600;
  2523. letter-spacing: 2upx;
  2524. }
  2525. .sh_type {
  2526. color: #999999;
  2527. font-size: 22upx;
  2528. }
  2529. .sh_type text {
  2530. margin-left: 20upx;
  2531. }
  2532. .fh_image image {
  2533. width: 40rpx;
  2534. height: 40rpx;
  2535. }
  2536. .sh_image image {
  2537. width: 40rpx;
  2538. height: 40rpx;
  2539. }
  2540. .order_btn {
  2541. display: flex;
  2542. justify-content: flex-end;
  2543. align-items: center;
  2544. height: 100upx;
  2545. line-height: 100upx;
  2546. /* margin-top: 8upx; */
  2547. }
  2548. .btn1 {
  2549. width: 170upx;
  2550. font-size: 28rpx;
  2551. line-height: 60upx;
  2552. text-align: center;
  2553. border: 1upx solid #9C9C9C;
  2554. border-radius: 20upx;
  2555. color: #9C9C9C;
  2556. margin-right: 30upx;
  2557. }
  2558. .btn2 {
  2559. width: 170upx;
  2560. line-height: 60upx;
  2561. color: white;
  2562. background: #FF6A04;
  2563. font-size: 28rpx;
  2564. text-align: center;
  2565. margin-right: 30upx;
  2566. border-radius: 20upx;
  2567. }
  2568. /* 收货码弹框 */
  2569. .receipt_code {
  2570. width: 90%;
  2571. margin: 0 auto;
  2572. }
  2573. .code_title {
  2574. width: 100%;
  2575. line-height: 100rpx;
  2576. font-size: 31rpx;
  2577. font-weight: bold;
  2578. text-align: center;
  2579. letter-spacing: 2rpx;
  2580. margin-top: 21rpx;
  2581. margin-bottom: 25rpx;
  2582. }
  2583. .u-input--border {
  2584. border: 1px solid #F2F2F2 !important;
  2585. background: #F2F2F2 !important;
  2586. color: #999999 !important;
  2587. font-weight: 500 !important;
  2588. letter-spacing: 2rpx !important;
  2589. }
  2590. .u-input__input {
  2591. font-size: 30rpx;
  2592. font-weight: bold;
  2593. flex: 1;
  2594. color: #999999 !important;
  2595. min-height: 85rpx !important;
  2596. margin-top: 7rpx;
  2597. }
  2598. .sure {
  2599. width: 100%;
  2600. height: 80rpx;
  2601. background: #FF7F00;
  2602. color: white;
  2603. border-radius: 46rpx;
  2604. text-align: center;
  2605. line-height: 80rpx;
  2606. margin-top: 30rpx;
  2607. letter-spacing: 2rpx;
  2608. }
  2609. </style>