index.vue 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770
  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. that.avatar = uni.getStorageSync('avatar') ? uni.getStorageSync('avatar') : '../../static/logo.png'
  901. that.userId = uni.getStorageSync('userId')
  902. if (that.userId) {
  903. console.log(that.userId, '用户id')
  904. uni.getLocation({
  905. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  906. success: function(res) {
  907. console.log('当前位置的经度:' + res.longitude);
  908. console.log('当前位置的纬度:' + res.latitude);
  909. let data = {
  910. lat: res.latitude,
  911. lng: res.longitude
  912. }
  913. that.$Request.getT('/app/Login/selectCity', data).then(res => {
  914. if (res.code == 0) {
  915. that.province = res.data.province
  916. that.city = res.data.city
  917. that.district = res.data.district
  918. }
  919. });
  920. },
  921. fail(e) {
  922. uni.hideLoading();
  923. uni.showModal({
  924. title: '温馨提示',
  925. content: '您的定位权限未开启,请开启后再来操作吧!',
  926. showCancel: true,
  927. cancelText: '取消',
  928. confirmText: '确认',
  929. success: res => {
  930. if (res.confirm) {
  931. // #ifdef MP-WEIXIN
  932. uni.openSetting({ // 打开设置页
  933. success(rea) {
  934. console.log(rea.authSetting)
  935. }
  936. });
  937. // #endif
  938. // #ifdef APP-PLUS
  939. gotoAppPermissionSetting()
  940. // #endif
  941. }
  942. }
  943. });
  944. }
  945. });
  946. that.getUserInfo()
  947. }
  948. // #ifdef MP-WEIXIN
  949. //订阅
  950. if (that.userId) {
  951. if (that.showModal111) {
  952. that.openMsg()
  953. }
  954. }
  955. // #endif
  956. },
  957. methods: {
  958. // 打开隐私协议页面
  959. openPrivacyContract() {
  960. let that = this;
  961. wx.openPrivacyContract({
  962. fail: () => {
  963. that.$queue.showToast('遇到错误无法打开!');
  964. }
  965. })
  966. },
  967. // 拒绝隐私协议
  968. exitMiniProgram() {
  969. // 直接退出小程序
  970. wx.exitMiniProgram()
  971. },
  972. // 同意隐私协议
  973. handleAgreePrivacyAuthorization() {
  974. // this.$refs.popusAuthorization.close();
  975. this.Authorization = false;
  976. let that = this;
  977. uni.getLocation({
  978. type: 'gcj02', //返回可以用于uni.openLocation的经纬度
  979. success: function(res) {
  980. console.log('当前位置的经度:' + res.longitude);
  981. console.log('当前位置的纬度:' + res.latitude);
  982. let data = {
  983. lat: res.latitude,
  984. lng: res.longitude
  985. }
  986. that.$Request.getT('/app/Login/selectCity', data).then(res => {
  987. if (res.code == 0) {
  988. that.province = res.data.province
  989. that.city = res.data.city
  990. that.district = res.data.district
  991. }
  992. });
  993. },
  994. fail(e) {
  995. uni.hideLoading();
  996. uni.showModal({
  997. title: '温馨提示',
  998. content: '您的定位权限未开启,请开启后再来操作吧!',
  999. showCancel: true,
  1000. cancelText: '取消',
  1001. confirmText: '确认',
  1002. success: res => {
  1003. if (res.confirm) {
  1004. // #ifdef MP-WEIXIN
  1005. uni.openSetting({ // 打开设置页
  1006. success(rea) {
  1007. console.log(rea.authSetting)
  1008. }
  1009. });
  1010. // #endif
  1011. // #ifdef APP-PLUS
  1012. gotoAppPermissionSetting()
  1013. // #endif
  1014. }
  1015. }
  1016. });
  1017. }
  1018. });
  1019. },
  1020. //获取最大接单数
  1021. getOrderNum() {
  1022. // orderNum
  1023. this.$Request.get('/app/common/type/342').then(res => {
  1024. if (res.code == 0 && res.data.value) {
  1025. this.orderNum = res.data.value
  1026. }
  1027. });
  1028. },
  1029. // 上传骑手位置
  1030. getLocation() {
  1031. if (this.userId) {
  1032. let data = {
  1033. lng: this.longitude,
  1034. lat: this.latitude,
  1035. userId: this.userId,
  1036. province: this.province,
  1037. city: this.city,
  1038. district: this.district,
  1039. }
  1040. this.$Request.getT('/timedtask/riderLocation', data).then(res => {
  1041. if (res.code = 0) {
  1042. console.log('上传骑手位置')
  1043. }
  1044. });
  1045. }
  1046. },
  1047. switchxdd(e) {
  1048. this.xddcheck = e;
  1049. // #ifdef MP-WEIXIN
  1050. if (uni.getStorageSync('sendMsg')) {
  1051. uni.requestSubscribeMessage({
  1052. tmplIds: this.arr,
  1053. success(re) {
  1054. // console.log(re,'**********')
  1055. var datas = JSON.stringify(re);
  1056. if (datas.indexOf("accept") != -1) {
  1057. console.log(re)
  1058. }
  1059. },
  1060. fail: (res) => {
  1061. console.log(res)
  1062. }
  1063. })
  1064. }
  1065. // #endif
  1066. let isSendMsg = 1;
  1067. if (!this.xddcheck) {
  1068. isSendMsg = 2;
  1069. }
  1070. let data = {
  1071. isSendMsg: isSendMsg
  1072. }
  1073. this.$Request.postJson('/app/user/updateUser', data).then(res => {
  1074. if (res.code == 0) {
  1075. }
  1076. });
  1077. },
  1078. //获取用户信息
  1079. getUserInfo() {
  1080. let that = this
  1081. that.$Request.getT('/app/userinfo/findUserInfoById').then(res => {
  1082. if (res.code == 0 && res.data) {
  1083. that.seen = res.data.onLineFlag == 1 ? false : true
  1084. // that.xddcheck = res.data.isSendMsg == 2 ? false : true;
  1085. that.checkCertification = res.data.checkCertification
  1086. uni.setStorageSync("checkCertification", res.data.checkCertification);
  1087. if (that.seen) {
  1088. that.tit = '休息中'
  1089. } else {
  1090. that.tit = '接单中'
  1091. // that.locationUpdate()
  1092. }
  1093. uni.getLocation({
  1094. type: 'wgs84',
  1095. success: function(res) {
  1096. console.log('当前位置的经度:' + res.longitude);
  1097. console.log('当前位置的纬度:' + res.latitude);
  1098. that.longitude = res.longitude
  1099. that.latitude = res.latitude
  1100. that.locationUpdate(that.longitude, that.latitude)
  1101. if (that.current == 0) {
  1102. that.taskData()
  1103. } else if (that.current == 1) {
  1104. that.indentState = 3
  1105. that.taskDataJ()
  1106. } else if (that.current == 2) {
  1107. that.indentState = 4
  1108. that.taskDataJ()
  1109. }
  1110. }
  1111. });
  1112. }
  1113. });
  1114. },
  1115. // 顶部tab切换
  1116. change(index) {
  1117. // #ifdef MP-WEIXIN
  1118. if (uni.getStorageSync('sendMsg')) {
  1119. uni.requestSubscribeMessage({
  1120. tmplIds: this.arr,
  1121. success(re) {
  1122. // console.log(re,'**********')
  1123. var datas = JSON.stringify(re);
  1124. if (datas.indexOf("accept") != -1) {
  1125. console.log(re)
  1126. }
  1127. },
  1128. fail: (res) => {
  1129. console.log(res)
  1130. }
  1131. })
  1132. }
  1133. // #endif
  1134. this.current = index;
  1135. this.page = 1
  1136. if (index == 0) { //接单池
  1137. uni.showLoading({
  1138. title: '加载中...'
  1139. })
  1140. this.taskData()
  1141. } else if (index == 1) { //待取货
  1142. uni.showLoading({
  1143. title: '加载中...'
  1144. })
  1145. this.indentState = 3
  1146. this.taskDataJ()
  1147. } else if (index == 2) { //配送中
  1148. uni.showLoading({
  1149. title: '加载中...'
  1150. })
  1151. this.indentState = 4
  1152. this.taskDataJ()
  1153. } else if (index == 3) { //全部订单
  1154. // uni.showLoading({
  1155. // title: '加载中...'
  1156. // })
  1157. this.current = 0;
  1158. uni.navigateTo({
  1159. url: '/pages/riderMy/order'
  1160. })
  1161. }
  1162. },
  1163. // 上下线
  1164. bindup() {
  1165. let that = this
  1166. if (!that.userId) {
  1167. uni.navigateTo({
  1168. url: '/pages/login/login'
  1169. })
  1170. return
  1171. }
  1172. // #ifdef MP-WEIXIN
  1173. if (uni.getStorageSync('sendMsg')) {
  1174. uni.requestSubscribeMessage({
  1175. tmplIds: this.arr,
  1176. success(re) {
  1177. // console.log(re,'**********')
  1178. var datas = JSON.stringify(re);
  1179. if (datas.indexOf("accept") != -1) {
  1180. console.log(re)
  1181. }
  1182. },
  1183. fail: (res) => {
  1184. console.log(res)
  1185. }
  1186. })
  1187. }
  1188. // #endif
  1189. let content = ''
  1190. if (that.seen) {
  1191. content = '确认开始接单吗'
  1192. } else {
  1193. content = '确认停止接单吗'
  1194. }
  1195. uni.showModal({
  1196. title: '提示',
  1197. content: content,
  1198. success: function(res) {
  1199. if (res.confirm) {
  1200. that.$Request.postT('/app/userinfo/updateOnLine', {
  1201. onLineFlag: that.seen ? 1 : 2,
  1202. }).then(res => {
  1203. that.getUserInfo()
  1204. });
  1205. }
  1206. },
  1207. })
  1208. },
  1209. // 更新骑手位置信息
  1210. locationUpdate(lng, lat) {
  1211. let that = this
  1212. // setInterval(function() {
  1213. that.$Request.postT('/app/userinfo/updateCoordinate', {
  1214. lng: lng,
  1215. lat: lat,
  1216. }).then(res => {
  1217. console.log('位置信息更新', res)
  1218. that.taskData()
  1219. });
  1220. // }, 600000)
  1221. },
  1222. // 跳转订单详情
  1223. binddetails(id, types) {
  1224. // #ifdef MP-WEIXIN
  1225. if (uni.getStorageSync('sendMsg')) {
  1226. uni.requestSubscribeMessage({
  1227. tmplIds: this.arr,
  1228. success(re) {
  1229. // console.log(re,'**********')
  1230. var datas = JSON.stringify(re);
  1231. if (datas.indexOf("accept") != -1) {
  1232. console.log(re)
  1233. }
  1234. },
  1235. fail: (res) => {
  1236. console.log(res)
  1237. }
  1238. })
  1239. }
  1240. // #endif
  1241. console.log('```', id, types)
  1242. if (types == 1 || types == 2 || types == 3 || types == 5) {
  1243. uni.navigateTo({
  1244. url: '/pages/index/buyOrder/buyOrder?id=' + id
  1245. })
  1246. } else {
  1247. uni.navigateTo({
  1248. url: '/pages/index/cityOrder/cityOrder?id=' + id
  1249. })
  1250. }
  1251. },
  1252. // 接单
  1253. bindorder(item) {
  1254. let that = this
  1255. if (!that.userId) {
  1256. uni.showModal({
  1257. title: '提示',
  1258. content: '请先登录后再接单',
  1259. success: function(res) {
  1260. if (res.confirm) {
  1261. console.log('用户点击确定');
  1262. uni.navigateTo({
  1263. url: '/pages/login/login'
  1264. })
  1265. } else if (res.cancel) {
  1266. console.log('用户点击取消');
  1267. }
  1268. }
  1269. });
  1270. return;
  1271. }
  1272. // #ifdef MP-WEIXIN
  1273. if (uni.getStorageSync('sendMsg')) {
  1274. uni.requestSubscribeMessage({
  1275. tmplIds: this.arr,
  1276. success(re) {
  1277. // console.log(re,'**********')
  1278. var datas = JSON.stringify(re);
  1279. if (datas.indexOf("accept") != -1) {
  1280. console.log(re)
  1281. }
  1282. },
  1283. fail: (res) => {
  1284. console.log(res)
  1285. }
  1286. })
  1287. }
  1288. // #endif
  1289. if (that.checkCertification == null) {
  1290. uni.showModal({
  1291. title: '提示',
  1292. content: '请先实名认证后再接单',
  1293. success: function(res) {
  1294. if (res.confirm) {
  1295. console.log('用户点击确定');
  1296. uni.navigateTo({
  1297. url: '/pages/riderMy/approve/approve'
  1298. })
  1299. } else if (res.cancel) {
  1300. console.log('用户点击取消');
  1301. }
  1302. }
  1303. });
  1304. return;
  1305. }
  1306. if (that.checkCertification == 0) {
  1307. uni.showToast({
  1308. title: '实名认证审核中,无法接单',
  1309. icon: 'none'
  1310. });
  1311. return;
  1312. }
  1313. if (that.checkCertification == 2) {
  1314. uni.showToast({
  1315. title: '实名认证未通过,无法接单',
  1316. icon: 'none'
  1317. });
  1318. return;
  1319. }
  1320. uni.showModal({
  1321. title: '提示',
  1322. content: '确认接单吗',
  1323. success: function(res) {
  1324. if (res.confirm) {
  1325. console.log('用户点击确定');
  1326. that.$Request.postT('/app/tbindent/indentReceiving', {
  1327. indentNumber: item.indentNumber
  1328. }).then(res => {
  1329. if (res.code == 0) {
  1330. that.page = 1
  1331. that.taskData()
  1332. uni.showToast({
  1333. title: '接单成功',
  1334. icon: 'none',
  1335. duration: 1000
  1336. });
  1337. } else {
  1338. console.log('失败:', res.data)
  1339. uni.showToast({
  1340. title: res.msg,
  1341. icon: 'none',
  1342. duration: 1500
  1343. });
  1344. that.page = 1
  1345. that.taskData()
  1346. }
  1347. });
  1348. } else if (res.cancel) {
  1349. console.log('用户点击取消');
  1350. }
  1351. }
  1352. });
  1353. },
  1354. // 未登录接单
  1355. bindorder1() {
  1356. uni.showToast({
  1357. title: '上线后方可接单',
  1358. icon: 'none'
  1359. })
  1360. },
  1361. bindridermy() {
  1362. // #ifdef MP-WEIXIN
  1363. if (uni.getStorageSync('sendMsg')) {
  1364. uni.requestSubscribeMessage({
  1365. tmplIds: this.arr,
  1366. success(re) {
  1367. // console.log(re,'**********')
  1368. var datas = JSON.stringify(re);
  1369. if (datas.indexOf("accept") != -1) {
  1370. console.log(re)
  1371. }
  1372. },
  1373. fail: (res) => {
  1374. console.log(res)
  1375. }
  1376. })
  1377. }
  1378. // #endif
  1379. uni.navigateTo({
  1380. url: '/pages/riderMy/riderMy'
  1381. })
  1382. },
  1383. onshow() {
  1384. console.log('第一个')
  1385. this.show = true
  1386. },
  1387. // 获取新任务数据
  1388. taskData() {
  1389. this.$Request.postJson('/app/tbindent/findNewIndent', {
  1390. page: this.page,
  1391. limit: 10,
  1392. riderlat: this.longitude,
  1393. riderlng: this.latitude,
  1394. receivingPettern: this.receivingPettern,
  1395. indentType: this.indentType,
  1396. }).then(res => {
  1397. uni.hideLoading()
  1398. if (res.data) {
  1399. if (res.data.list.length > 0) {
  1400. for (var i = 0; i < res.data.list.length; i++) {
  1401. if (res.data.list[i].distancess > 1000) {
  1402. res.data.list[i].distancess = Number((res.data.list[i].distancess / 1000))
  1403. .toFixed(
  1404. 2) + "km"
  1405. } else {
  1406. if (res.data.list[i].distancess == '0') {
  1407. res.data.list[i].distancess = "0m";
  1408. } else {
  1409. res.data.list[i].distancess = Number(res.data.list[i].distancess).toFixed(
  1410. 1) +
  1411. "m";
  1412. }
  1413. }
  1414. // if (res.data.list[i].distance > 1000) {
  1415. // res.data.list[i].distance = Number((res.data.list[i].distance / 1000)).toFixed(2) + "km"
  1416. // } else {
  1417. // if (res.data.list[i].distance == 0) {
  1418. // res.data.list[i].distance = "0m";
  1419. // } else {
  1420. // res.data.list[i].distance = Number(res.data.list[i].distance).toFixed(1) + "m";
  1421. // }
  1422. // }
  1423. if (res.data.list[i].distancessd > 1000) {
  1424. res.data.list[i].distancessd = Number((res.data.list[i].distancessd / 1000))
  1425. .toFixed(2) + "km"
  1426. } else {
  1427. if (res.data.list[i].distancessd == '0') {
  1428. res.data.list[i].distancessd = "0m";
  1429. } else {
  1430. res.data.list[i].distancessd = Number(res.data.list[i].distancessd)
  1431. .toFixed(
  1432. 1) + "m";
  1433. }
  1434. }
  1435. }
  1436. }
  1437. this.totalCount = res.data.totalCount
  1438. if (this.page == 1) {
  1439. this.list_box = res.data.list
  1440. } else {
  1441. this.list_box = this.list_box.concat(list)
  1442. }
  1443. }
  1444. this.$forceUpdate()
  1445. uni.stopPullDownRefresh();
  1446. });
  1447. },
  1448. // 获取待取货和配送中订单
  1449. taskDataJ() {
  1450. // uni.showLoading({
  1451. // title: '加载中'
  1452. // });
  1453. this.$Request.getT('/app/tbindent/findRiderIndent', {
  1454. page: this.page,
  1455. limit: 10,
  1456. indentState: this.indentState
  1457. // ol: this.longitude,
  1458. // od: this.latitude
  1459. }).then(res => {
  1460. uni.hideLoading()
  1461. if (this.page == 1) {
  1462. this.lists = res.data
  1463. } else {
  1464. this.lists = this.lists.concat(res.data.list)
  1465. }
  1466. for (var i in this.lists) {
  1467. if (this.lists[i].distanceInitial > 1000) {
  1468. this.lists[i].distanceInitials = (Number(this.lists[i].distanceInitial) / 1000)
  1469. .toFixed(2)
  1470. }
  1471. if (this.lists[i].distance > 1000) {
  1472. this.lists[i].distances = (Number(this.lists[i].distance) / 1000).toFixed(2)
  1473. }
  1474. }
  1475. console.log('lists', this.lists)
  1476. uni.stopPullDownRefresh();
  1477. });
  1478. },
  1479. switch1(e) {
  1480. // #ifdef MP-WEIXIN
  1481. if (uni.getStorageSync('sendMsg')) {
  1482. uni.requestSubscribeMessage({
  1483. tmplIds: this.arr,
  1484. success(re) {
  1485. // console.log(re,'**********')
  1486. var datas = JSON.stringify(re);
  1487. if (datas.indexOf("accept") != -1) {
  1488. console.log(re)
  1489. }
  1490. },
  1491. fail: (res) => {
  1492. console.log(res)
  1493. }
  1494. })
  1495. }
  1496. // #endif
  1497. this.checked = e
  1498. this.check = !this.check
  1499. if (e == true) {
  1500. this.receivingPettern = 1
  1501. }
  1502. if (e == false) {
  1503. // this.checked = false
  1504. // this.check = true
  1505. this.receivingPettern = 2
  1506. }
  1507. console.log(e)
  1508. },
  1509. switch2(e) {
  1510. // #ifdef MP-WEIXIN
  1511. if (uni.getStorageSync('sendMsg')) {
  1512. uni.requestSubscribeMessage({
  1513. tmplIds: this.arr,
  1514. success(re) {
  1515. // console.log(re,'**********')
  1516. var datas = JSON.stringify(re);
  1517. if (datas.indexOf("accept") != -1) {
  1518. console.log(re)
  1519. }
  1520. },
  1521. fail: (res) => {
  1522. console.log(res)
  1523. }
  1524. })
  1525. }
  1526. // #endif
  1527. console.log(e)
  1528. this.check = e
  1529. this.checked = !this.check
  1530. if (e == true) {
  1531. // this.checked = true
  1532. // this.check = false
  1533. this.receivingPettern = 2
  1534. }
  1535. if (e == false) {
  1536. // this.checked = false
  1537. // this.check = true
  1538. this.receivingPettern = 1
  1539. }
  1540. },
  1541. // 打开类型选择模态框
  1542. showModals() {
  1543. // #ifdef MP-WEIXIN
  1544. if (uni.getStorageSync('sendMsg')) {
  1545. uni.requestSubscribeMessage({
  1546. tmplIds: this.arr,
  1547. success(re) {
  1548. // console.log(re,'**********')
  1549. var datas = JSON.stringify(re);
  1550. if (datas.indexOf("accept") != -1) {
  1551. console.log(re)
  1552. }
  1553. },
  1554. fail: (res) => {
  1555. console.log(res)
  1556. }
  1557. })
  1558. }
  1559. // #endif
  1560. this.showModal = true
  1561. },
  1562. radioChange(e) {
  1563. // console.log(e);
  1564. },
  1565. radioGroupChange(e) {
  1566. console.log('······2', e);
  1567. this.indentTypeName = e
  1568. },
  1569. // 点击确定按钮
  1570. confirm() {
  1571. // #ifdef MP-WEIXIN
  1572. if (uni.getStorageSync('sendMsg')) {
  1573. uni.requestSubscribeMessage({
  1574. tmplIds: this.arr,
  1575. success(re) {
  1576. // console.log(re,'**********')
  1577. var datas = JSON.stringify(re);
  1578. if (datas.indexOf("accept") != -1) {
  1579. console.log(re)
  1580. }
  1581. },
  1582. fail: (res) => {
  1583. console.log(res)
  1584. }
  1585. })
  1586. }
  1587. // #endif
  1588. if (this.indentTypeName == '全部') {
  1589. this.indentType = null
  1590. }
  1591. if (this.indentTypeName == '帮我取') {
  1592. this.indentType = 2
  1593. }
  1594. if (this.indentTypeName == '帮我送') {
  1595. this.indentType = 1
  1596. }
  1597. if (this.indentTypeName == '同城帮买') {
  1598. this.indentType = 3
  1599. }
  1600. if (this.indentTypeName == '同城服务') {
  1601. this.indentType = 4
  1602. }
  1603. if (this.indentTypeName == '同城外卖') {
  1604. this.indentType = 5
  1605. }
  1606. },
  1607. // 获取地址
  1608. dizhis() {
  1609. var that = this
  1610. uni.chooseLocation({
  1611. success: function(res) {
  1612. console.log(res)
  1613. uni.setStorageSync('dizhi', res);
  1614. that.quyu = res.name
  1615. that.quyuLongitude = res.longitude
  1616. that.quyuLatitude = res.latitude
  1617. }
  1618. });
  1619. },
  1620. // 关闭底部弹出层
  1621. closePopup() {
  1622. // #ifdef MP-WEIXIN
  1623. if (uni.getStorageSync('sendMsg')) {
  1624. uni.requestSubscribeMessage({
  1625. tmplIds: this.arr,
  1626. success(re) {
  1627. // console.log(re,'**********')
  1628. var datas = JSON.stringify(re);
  1629. if (datas.indexOf("accept") != -1) {
  1630. console.log(re)
  1631. }
  1632. },
  1633. fail: (res) => {
  1634. console.log(res)
  1635. }
  1636. })
  1637. }
  1638. // #endif
  1639. this.page = 1
  1640. if (this.quyuLongitude != '') {
  1641. this.longitude = this.quyuLongitude
  1642. this.latitude = this.quyuLatitude
  1643. }
  1644. this.taskData()
  1645. },
  1646. // 订单详情
  1647. bindorderDetail(indentNumber, orderId) {
  1648. // #ifdef MP-WEIXIN
  1649. if (uni.getStorageSync('sendMsg')) {
  1650. uni.requestSubscribeMessage({
  1651. tmplIds: this.arr,
  1652. success(re) {
  1653. // console.log(re,'**********')
  1654. var datas = JSON.stringify(re);
  1655. if (datas.indexOf("accept") != -1) {
  1656. console.log(re)
  1657. }
  1658. },
  1659. fail: (res) => {
  1660. console.log(res)
  1661. }
  1662. })
  1663. }
  1664. // #endif
  1665. console.log(indentNumber, orderId)
  1666. uni.navigateTo({
  1667. url: '/pages/index/orderdetail/orderdetail?orderId=' + orderId + '&id=' + indentNumber
  1668. })
  1669. },
  1670. // 取消订单
  1671. quxiao(indentNumber) {
  1672. // #ifdef MP-WEIXIN
  1673. if (uni.getStorageSync('sendMsg')) {
  1674. uni.requestSubscribeMessage({
  1675. tmplIds: this.arr,
  1676. success(re) {
  1677. // console.log(re,'**********')
  1678. var datas = JSON.stringify(re);
  1679. if (datas.indexOf("accept") != -1) {
  1680. console.log(re)
  1681. }
  1682. },
  1683. fail: (res) => {
  1684. console.log(res)
  1685. }
  1686. })
  1687. }
  1688. // #endif
  1689. let that = this
  1690. uni.showModal({
  1691. title: '提示',
  1692. content: '取消订单将会被扣保证金',
  1693. success: function(res) {
  1694. if (res.confirm) {
  1695. console.log('用户点击确定');
  1696. that.$Request.postT('/app/tbindent/riderCancleIndent', {
  1697. indentNumber: indentNumber
  1698. }).then(res => {
  1699. console.log(res)
  1700. if (res.code == 0) {
  1701. uni.showToast({
  1702. title: '订单已取消',
  1703. icon: "none"
  1704. });
  1705. that.taskDataJ()
  1706. } else {
  1707. uni.showToast({
  1708. title: res.msg,
  1709. icon: "none"
  1710. });
  1711. that.taskDataJ()
  1712. }
  1713. });
  1714. } else if (res.cancel) {
  1715. console.log('用户点击取消');
  1716. }
  1717. }
  1718. });
  1719. },
  1720. quhuo(indentId) {
  1721. let that = this
  1722. // #ifdef MP-WEIXIN
  1723. if (uni.getStorageSync('sendMsg')) {
  1724. uni.requestSubscribeMessage({
  1725. tmplIds: this.arr,
  1726. success(re) {
  1727. // console.log(re,'**********')
  1728. var datas = JSON.stringify(re);
  1729. if (datas.indexOf("accept") != -1) {
  1730. console.log(re)
  1731. }
  1732. },
  1733. fail: (res) => {
  1734. console.log(res)
  1735. }
  1736. })
  1737. }
  1738. // #endif
  1739. uni.showModal({
  1740. title: '提示',
  1741. content: '确认到取货吗',
  1742. success: function(res) {
  1743. if (res.confirm) {
  1744. that.$Request.postJson('/app/tbindent/riderBuyGoods', {
  1745. indentId: indentId,
  1746. indentState: '4'
  1747. }).then(res => {
  1748. console.log(res)
  1749. if (res.code == 0) {
  1750. uni.showToast({
  1751. title: '确认取货成功',
  1752. icon: "none"
  1753. });
  1754. // that.indentState = 4
  1755. setTimeout(function() {
  1756. that.taskDataJ()
  1757. // that.current = 2
  1758. }, 1000)
  1759. } else {
  1760. uni.showToast({
  1761. title: res.msg,
  1762. icon: "none"
  1763. });
  1764. setTimeout(function() {
  1765. that.taskDataJ()
  1766. // that.current = 2
  1767. }, 1000)
  1768. }
  1769. });
  1770. } else {
  1771. }
  1772. },
  1773. })
  1774. },
  1775. shouhuo(e) {
  1776. console.log('第二个')
  1777. this.indentNumber = e.indentNumber
  1778. // if(e.indentType==5){
  1779. // this.querenSh()
  1780. // }
  1781. if (e.itemCodeFlag == 0 && e.indentType != 5) {
  1782. this.shows = true
  1783. } else {
  1784. this.querenSh()
  1785. }
  1786. },
  1787. querenSh() {
  1788. // #ifdef MP-WEIXIN
  1789. if (uni.getStorageSync('sendMsg')) {
  1790. uni.requestSubscribeMessage({
  1791. tmplIds: this.arr,
  1792. success(re) {
  1793. // console.log(re,'**********')
  1794. var datas = JSON.stringify(re);
  1795. if (datas.indexOf("accept") != -1) {
  1796. console.log(re)
  1797. }
  1798. },
  1799. fail: (res) => {
  1800. console.log(res)
  1801. }
  1802. })
  1803. }
  1804. // #endif
  1805. let that = this
  1806. // var date = new Date();
  1807. // var year = date.getFullYear();
  1808. // let Rcode = year + that.shouhuoma
  1809. that.$Request.postT('/app/tbindent/riderDelivery', {
  1810. indentNumber: that.indentNumber,
  1811. // itemCode: Rcode
  1812. itemCode: that.shouhuoma
  1813. }).then(res => {
  1814. console.log(res)
  1815. that.shouhuoma = '';
  1816. if (res.code == 0) {
  1817. that.shows = false
  1818. uni.showToast({
  1819. title: '订单完成',
  1820. icon: "none"
  1821. });
  1822. this.lists = []
  1823. that.taskDataJ()
  1824. } else {
  1825. uni.showToast({
  1826. title: res.msg,
  1827. icon: "none"
  1828. });
  1829. that.taskDataJ()
  1830. }
  1831. });
  1832. },
  1833. // 开启订阅消息
  1834. openMsg() {
  1835. console.log('订阅消息')
  1836. var that = this
  1837. uni.getSetting({
  1838. withSubscriptions: true, //是否获取用户订阅消息的订阅状态,默认false不返回
  1839. success(ret) {
  1840. console.log(ret.subscriptionsSetting, '------------------')
  1841. // if (ret.subscriptionsSetting.itemSettings && Object.keys(ret.subscriptionsSetting.itemSettings).length == 2) {
  1842. if (ret.subscriptionsSetting.itemSettings) {
  1843. uni.setStorageSync('sendMsg', true)
  1844. uni.openSetting({ // 打开设置页
  1845. success(rea) {
  1846. console.log(rea.authSetting)
  1847. }
  1848. });
  1849. } else { // 用户没有点击“总是保持以上,不再询问”则每次都会调起订阅消息
  1850. uni.setStorageSync('sendMsg', false)
  1851. uni.showModal({
  1852. title: '提示',
  1853. content: '为了更好的体验,请绑定消息推送',
  1854. confirmText: '确定',
  1855. cancelText: '取消',
  1856. success: function(res) {
  1857. if (res.confirm) {
  1858. wx.requestSubscribeMessage({
  1859. tmplIds: that.arr,
  1860. success(re) {
  1861. var datas = JSON.stringify(re);
  1862. if (datas.indexOf("accept") != -1) {
  1863. console.log(re)
  1864. // uni.setStorageSync('sendMsg', true)
  1865. }
  1866. },
  1867. fail: (res) => {
  1868. console.log(res)
  1869. }
  1870. })
  1871. // uni.setStorageSync('sendMsg', true)
  1872. that.showModal111 = false
  1873. } else if (res.cancel) {
  1874. console.log('取消')
  1875. // uni.setStorageSync('sendMsg', false)
  1876. that.showModal111 = true
  1877. }
  1878. }
  1879. })
  1880. }
  1881. }
  1882. })
  1883. },
  1884. },
  1885. // 上拉加载
  1886. onReachBottom: function() {
  1887. if (this.page < this.totalCount) {
  1888. this.page = this.page + 1;
  1889. } else {
  1890. uni.showToast({
  1891. title: '已经最后一页啦',
  1892. icon: 'none'
  1893. })
  1894. }
  1895. this.taskData();
  1896. },
  1897. onPullDownRefresh: function() {
  1898. this.page = 1;
  1899. if (this.current == 0) {
  1900. this.taskData();
  1901. } else {
  1902. this.taskDataJ();
  1903. }
  1904. },
  1905. }
  1906. </script>
  1907. <style>
  1908. body {
  1909. background: #F5F5F5;
  1910. }
  1911. .privacy {
  1912. position: fixed;
  1913. top: 0;
  1914. right: 0;
  1915. bottom: 0;
  1916. left: 0;
  1917. background: rgba(0, 0, 0, .5);
  1918. z-index: 9999999;
  1919. display: flex;
  1920. align-items: center;
  1921. justify-content: center;
  1922. }
  1923. .contentview {
  1924. width: 632rpx;
  1925. padding: 48rpx;
  1926. box-sizing: border-box;
  1927. background: #fff;
  1928. border-radius: 16rpx;
  1929. }
  1930. .contentview .title {
  1931. text-align: center;
  1932. color: #333;
  1933. font-weight: bold;
  1934. font-size: 32rpx;
  1935. }
  1936. .contentview .des {
  1937. font-size: 26rpx;
  1938. color: #666;
  1939. margin-top: 40rpx;
  1940. text-align: justify;
  1941. line-height: 1.6;
  1942. }
  1943. .contentview .des .link {
  1944. color: #07c160;
  1945. text-decoration: underline;
  1946. }
  1947. button::after {
  1948. border: none;
  1949. }
  1950. .btns {
  1951. margin-top: 48rpx;
  1952. display: flex;
  1953. }
  1954. .btns .item {
  1955. justify-content: space-between;
  1956. width: 244rpx;
  1957. height: 80rpx;
  1958. display: flex;
  1959. align-items: center;
  1960. justify-content: center;
  1961. border-radius: 16rpx;
  1962. box-sizing: border-box;
  1963. border: none;
  1964. }
  1965. .btns .reject {
  1966. background: #f4f4f5;
  1967. color: #909399;
  1968. }
  1969. .btns .agree {
  1970. background: #07c160;
  1971. color: #fff;
  1972. }
  1973. .content {
  1974. margin-top: 100rpx;
  1975. }
  1976. .slot-wrap {
  1977. display: flex;
  1978. justify-content: center;
  1979. align-items: center;
  1980. /* 如果您想让slot内容占满整个导航栏的宽度 */
  1981. /* flex: 1; */
  1982. /* 如果您想让slot内容与导航栏左右有空隙 */
  1983. /* padding: 0 30rpx; */
  1984. }
  1985. .u-title {
  1986. color: #000000 !important;
  1987. font-size: 31rpx !important;
  1988. font-weight: bold !important;
  1989. }
  1990. .solt {
  1991. position: relative;
  1992. }
  1993. .slot_left {
  1994. width: 60rpx;
  1995. height: 60rpx;
  1996. position: absolute;
  1997. top: 15rpx;
  1998. left: 20rpx;
  1999. }
  2000. .slot_left image {
  2001. width: 60rpx;
  2002. height: 60rpx;
  2003. }
  2004. .slot_content {
  2005. width: 35rpx;
  2006. height: 35rpx;
  2007. position: absolute;
  2008. top: 26rpx;
  2009. left: 280rpx;
  2010. }
  2011. .slot_content image {
  2012. width: 35rpx;
  2013. height: 35rpx;
  2014. }
  2015. /* tabs */
  2016. .u-tab-item {
  2017. color: #333333 !important;
  2018. /* font-size: 26rpx !important; */
  2019. letter-spacing: 2rpx;
  2020. }
  2021. .u-tab-bar {
  2022. width: 65rpx !important;
  2023. height: 8rpx !important;
  2024. background-color: #FF7F00 !important;
  2025. border-radius: 0rpx !important;
  2026. position: absolute !important;
  2027. bottom: 0rpx !important;
  2028. left: -14rpx !important;
  2029. }
  2030. .tabs_box {
  2031. display: none;
  2032. padding-bottom: 120rpx;
  2033. }
  2034. .dis {
  2035. display: block;
  2036. width: 100%;
  2037. margin-bottom: 190rpx;
  2038. }
  2039. .list_box1 {
  2040. width: 90%;
  2041. margin: 0 auto;
  2042. height: auto;
  2043. background: #FFFFFF;
  2044. border-radius: 23rpx;
  2045. box-shadow: 0rpx 5rpx 5rpx 0rpx rgba(198, 186, 181, 0.20);
  2046. margin-top: 20rpx;
  2047. padding-bottom: 20rpx;
  2048. }
  2049. .list_box {
  2050. width: 90%;
  2051. margin: 0 auto;
  2052. height: auto;
  2053. background: #FFFFFF;
  2054. border-radius: 23rpx;
  2055. box-shadow: 0rpx 5rpx 5rpx 0rpx rgba(198, 186, 181, 0.20);
  2056. margin-top: 20rpx;
  2057. padding-bottom: 20rpx;
  2058. }
  2059. .part1 {
  2060. width: 90%;
  2061. margin: 0 auto;
  2062. justify-content: left;
  2063. align-items: center;
  2064. display: flex;
  2065. height: 100rpx;
  2066. position: relative;
  2067. }
  2068. .box_one {
  2069. background: #c4e2ff;
  2070. color: #359CFF;
  2071. /* width: 60px;
  2072. height: 45rpx; */
  2073. padding: 0px 10px;
  2074. font-size: 26rpx;
  2075. text-align: center;
  2076. line-height: 45rpx;
  2077. border-radius: 5rpx;
  2078. }
  2079. .box_four {
  2080. color: #666666;
  2081. border: 1rpx solid #666666;
  2082. font-size: 22rpx;
  2083. width: 95px;
  2084. height: 40rpx;
  2085. text-align: center;
  2086. line-height: 40rpx;
  2087. border-radius: 5rpx;
  2088. margin-left: 20rpx;
  2089. }
  2090. .box_two {
  2091. color: #666666;
  2092. border: 1rpx solid #666666;
  2093. font-size: 22rpx;
  2094. /* width: 60px; */
  2095. height: 40rpx;
  2096. text-align: center;
  2097. line-height: 40rpx;
  2098. border-radius: 5rpx;
  2099. margin-left: 20rpx;
  2100. padding: 0 10rpx
  2101. }
  2102. .box_two1 {
  2103. width: auto;
  2104. padding: 0 10rpx;
  2105. }
  2106. .box_three {
  2107. color: #666666;
  2108. border: 1rpx solid #666666;
  2109. font-size: 22rpx;
  2110. width: 75px;
  2111. height: 40rpx;
  2112. text-align: center;
  2113. line-height: 40rpx;
  2114. border-radius: 5rpx;
  2115. margin-left: 20rpx;
  2116. }
  2117. .part2 {
  2118. width: 90%;
  2119. margin: 0 auto;
  2120. }
  2121. /* 下线 */
  2122. .address_name {
  2123. font-size: 28rpx;
  2124. font-weight: bold;
  2125. letter-spacing: 2rpx;
  2126. /* line-height: 60rpx; */
  2127. display: -webkit-box;
  2128. -webkit-box-orient: vertical;
  2129. -webkit-line-clamp: 1;
  2130. overflow: hidden;
  2131. }
  2132. .name {
  2133. color: #999999;
  2134. font-size: 21rpx;
  2135. }
  2136. .name text {
  2137. /* margin-left: 10rpx; */
  2138. }
  2139. /* 上线 */
  2140. .box_add {
  2141. display: flex;
  2142. }
  2143. .distance {
  2144. flex: 1;
  2145. /* text-align: center; */
  2146. font-size: 28rpx;
  2147. display: flex;
  2148. justify-content: left;
  2149. align-items: center;
  2150. }
  2151. .a {
  2152. font-size: 16rpx;
  2153. }
  2154. .add_name {
  2155. /* display: flex; */
  2156. flex: 4;
  2157. }
  2158. .sh_name {
  2159. font-size: 28rpx;
  2160. font-weight: bold;
  2161. letter-spacing: 2rpx;
  2162. }
  2163. .sh_name1 {
  2164. font-size: 28rpx;
  2165. font-weight: bold;
  2166. letter-spacing: 2rpx;
  2167. color: #999999;
  2168. }
  2169. .xs_add {
  2170. color: #999999;
  2171. font-size: 21rpx;
  2172. margin-top: 10rpx;
  2173. }
  2174. .jiantou {
  2175. margin-left: 43rpx;
  2176. display: flex;
  2177. /* justify-content: space-between; */
  2178. align-items: center;
  2179. height: 40px;
  2180. line-height: 40px;
  2181. }
  2182. .jiantou image {
  2183. width: 20rpx;
  2184. height: 40rpx;
  2185. }
  2186. .jiantou>view {
  2187. margin-left: 10rpx;
  2188. }
  2189. .part3 {
  2190. width: 90%;
  2191. margin: 0 auto;
  2192. display: flex;
  2193. }
  2194. .three_left {
  2195. flex: 1;
  2196. height: 100rpx;
  2197. display: flex;
  2198. justify-content: left;
  2199. align-items: center;
  2200. }
  2201. .three_left image {
  2202. width: 20px;
  2203. height: 20px;
  2204. }
  2205. .three_left text {
  2206. color: #FF7F00;
  2207. font-size: 25rpx;
  2208. margin-left: 10rpx;
  2209. }
  2210. .three_right {
  2211. /* flex: 1; */
  2212. height: 100rpx;
  2213. display: flex;
  2214. justify-content: flex-end;
  2215. align-items: center;
  2216. color: #FF7F00;
  2217. font-size: 32rpx;
  2218. font-weight: bold;
  2219. }
  2220. .part4 {
  2221. width: 90%;
  2222. margin: 0 auto;
  2223. }
  2224. .box_btn {
  2225. width: 100%;
  2226. background: #CCCCCC;
  2227. height: 70rpx;
  2228. color: white;
  2229. text-align: center;
  2230. line-height: 70rpx;
  2231. font-size: 26rpx;
  2232. letter-spacing: 2rpx;
  2233. border-radius: 8rpx;
  2234. }
  2235. .box_btn1 {
  2236. width: 100%;
  2237. background: #FF7F00;
  2238. height: 80rpx;
  2239. color: white;
  2240. text-align: center;
  2241. line-height: 80rpx;
  2242. font-size: 31rpx;
  2243. letter-spacing: 2rpx;
  2244. border-radius: 8rpx;
  2245. }
  2246. .part_six {
  2247. width: 90%;
  2248. margin: 0 auto;
  2249. display: flex;
  2250. }
  2251. .phone {
  2252. flex: 1;
  2253. }
  2254. .phone image {
  2255. width: 29rpx;
  2256. height: 33rpx;
  2257. margin-left: 30rpx;
  2258. }
  2259. .conmm {
  2260. font-size: 19rpx;
  2261. text-align: center;
  2262. letter-spacing: 5rpx;
  2263. }
  2264. .box_btn2 {
  2265. flex: 5;
  2266. width: 100%;
  2267. background: #FF7F00;
  2268. height: 70rpx;
  2269. color: white;
  2270. text-align: center;
  2271. line-height: 70rpx;
  2272. font-size: 26rpx;
  2273. letter-spacing: 2rpx;
  2274. border-radius: 6rpx;
  2275. }
  2276. /* tabbar */
  2277. .tabbar {
  2278. position: fixed;
  2279. bottom: 0rpx;
  2280. left: 0rpx;
  2281. right: 0rpx;
  2282. width: 100%;
  2283. height: 100rpx;
  2284. background: #ffffff;
  2285. display: flex;
  2286. }
  2287. .tabbar_type {
  2288. flex: 1;
  2289. text-align: center;
  2290. font-size: 22rpx;
  2291. margin-top: 10rpx;
  2292. }
  2293. .type_image {
  2294. width: 100%;
  2295. display: flex;
  2296. justify-content: center;
  2297. align-items: center;
  2298. }
  2299. .type_image image {
  2300. width: 47rpx;
  2301. height: 47rpx;
  2302. }
  2303. .tabbar_btn {
  2304. flex: 4;
  2305. display: flex;
  2306. justify-content: center;
  2307. align-items: center;
  2308. }
  2309. .btn {
  2310. width: 90%;
  2311. height: 80rpx;
  2312. background: #FF7F00;
  2313. color: white;
  2314. text-align: center;
  2315. line-height: 80rpx;
  2316. font-size: 26rpx;
  2317. letter-spacing: 2rpx;
  2318. border-radius: 8rpx;
  2319. }
  2320. .btn3 {
  2321. width: 90%;
  2322. height: 80rpx;
  2323. background: #CCCCCC;
  2324. color: white;
  2325. text-align: center;
  2326. line-height: 80rpx;
  2327. font-size: 26rpx;
  2328. letter-spacing: 2rpx;
  2329. border-radius: 8rpx;
  2330. }
  2331. /* 接单设置弹框 */
  2332. .u-drawer-bottom {
  2333. background-color: #F5F5F5 !important;
  2334. }
  2335. .popup_box {
  2336. width: 90%;
  2337. margin: 0 auto;
  2338. margin-top: 35rpx;
  2339. }
  2340. .title {
  2341. font-size: 29rpx;
  2342. font-weight: bold;
  2343. letter-spacing: 2rpx;
  2344. }
  2345. .part_one {
  2346. width: 100%;
  2347. background: #ffffff;
  2348. margin-top: 18rpx;
  2349. border-radius: 20rpx;
  2350. display: flex;
  2351. height: 120rpx;
  2352. }
  2353. .left {
  2354. flex: 3;
  2355. line-height: 40rpx;
  2356. margin-left: 20rpx;
  2357. margin-top: 20rpx;
  2358. }
  2359. .gotype {
  2360. font-size: 26rpx;
  2361. font-weight: bold;
  2362. letter-spacing: 2rpx;
  2363. }
  2364. .tit {
  2365. color: #999999;
  2366. font-size: 22rpx;
  2367. letter-spacing: 2rpx;
  2368. }
  2369. .right {
  2370. flex: 1;
  2371. display: flex;
  2372. justify-content: flex-end;
  2373. align-items: center;
  2374. margin-right: 30rpx;
  2375. }
  2376. .part_two {
  2377. width: 100%;
  2378. margin: 0 auto;
  2379. background: #ffffff;
  2380. border-radius: 20rpx;
  2381. margin-top: 20rpx;
  2382. height: 130rpx;
  2383. display: flex;
  2384. }
  2385. .two_left {
  2386. flex: 1;
  2387. display: flex;
  2388. justify-content: left;
  2389. align-items: center;
  2390. margin-left: 30rpx;
  2391. font-size: 29rpx;
  2392. font-weight: bold;
  2393. letter-spacing: 2rpx;
  2394. }
  2395. .two_right {
  2396. flex: 1;
  2397. display: flex;
  2398. justify-content: flex-end;
  2399. align-items: center;
  2400. margin-right: 30rpx;
  2401. color: #999999;
  2402. font-size: 25rpx;
  2403. letter-spacing: 2rpx;
  2404. }
  2405. .slot-content {
  2406. padding: 30rpx;
  2407. }
  2408. /* */
  2409. .tabs_box {
  2410. display: none;
  2411. }
  2412. .dis {
  2413. display: block;
  2414. width: 100%;
  2415. }
  2416. .u-tab-item {
  2417. /* font-size: 26upx !important; */
  2418. /* color: #666666 !important; */
  2419. }
  2420. .success_box {
  2421. width: 100%;
  2422. }
  2423. .order_box {
  2424. width: 90%;
  2425. margin: 0 auto;
  2426. /* height: 420rpx; */
  2427. background: #FFFFFF;
  2428. margin-top: 20rpx;
  2429. border-radius: 16px;
  2430. }
  2431. .order_success {
  2432. width: 90%;
  2433. margin: 0 auto;
  2434. display: flex;
  2435. height: 80upx;
  2436. }
  2437. .order_name {
  2438. flex: 1;
  2439. display: flex;
  2440. justify-content: left;
  2441. align-items: center;
  2442. font-weight: bold;
  2443. font-size: 29rpx;
  2444. letter-spacing: 1upx;
  2445. }
  2446. .order_data {
  2447. flex: 1;
  2448. color: #999999;
  2449. display: flex;
  2450. justify-content: flex-end;
  2451. align-items: center;
  2452. font-size: 26rpx;
  2453. }
  2454. .city_type {
  2455. width: 90%;
  2456. margin: 0 auto;
  2457. height: 60upx;
  2458. line-height: 60upx;
  2459. display: flex;
  2460. justify-content: left;
  2461. align-items: center;
  2462. }
  2463. .type_name {
  2464. font-size: 27rpx;
  2465. }
  2466. .city_text {
  2467. width: 70rpx;
  2468. line-height: 36rpx;
  2469. color: #49A5FF;
  2470. background: #c4e2ff;
  2471. text-align: center;
  2472. font-size: 19rpx;
  2473. margin-left: 20rpx;
  2474. }
  2475. .city_address {
  2476. width: 92%;
  2477. margin: 0 auto;
  2478. margin-top: -10rpx;
  2479. }
  2480. /* 发货地址 */
  2481. .fh_box {
  2482. display: flex;
  2483. /* height: 80upx; */
  2484. margin-top: 20upx;
  2485. }
  2486. .fh_image {
  2487. flex: 1;
  2488. display: flex;
  2489. /* justify-content: left;
  2490. align-items: center; */
  2491. }
  2492. .box {
  2493. flex: 9;
  2494. }
  2495. .fh_name {
  2496. font-size: 26rpx;
  2497. font-weight: 600;
  2498. letter-spacing: 2upx;
  2499. }
  2500. .fh_type {
  2501. color: #999999;
  2502. font-size: 22upx;
  2503. }
  2504. .fh_type text {
  2505. margin-left: 20upx;
  2506. }
  2507. /* 送货地址 */
  2508. .sh_box {
  2509. display: flex;
  2510. margin-bottom: 14upx;
  2511. margin-top: 14rpx;
  2512. }
  2513. .sh_image {
  2514. flex: 1;
  2515. display: flex;
  2516. /* justify-content: left;
  2517. align-items: center; */
  2518. }
  2519. .sh_name {
  2520. font-size: 28rpx;
  2521. font-weight: 600;
  2522. letter-spacing: 2upx;
  2523. }
  2524. .sh_type {
  2525. color: #999999;
  2526. font-size: 22upx;
  2527. }
  2528. .sh_type text {
  2529. margin-left: 20upx;
  2530. }
  2531. .fh_image image {
  2532. width: 40rpx;
  2533. height: 40rpx;
  2534. }
  2535. .sh_image image {
  2536. width: 40rpx;
  2537. height: 40rpx;
  2538. }
  2539. .order_btn {
  2540. display: flex;
  2541. justify-content: flex-end;
  2542. align-items: center;
  2543. height: 100upx;
  2544. line-height: 100upx;
  2545. /* margin-top: 8upx; */
  2546. }
  2547. .btn1 {
  2548. width: 170upx;
  2549. font-size: 28rpx;
  2550. line-height: 60upx;
  2551. text-align: center;
  2552. border: 1upx solid #9C9C9C;
  2553. border-radius: 20upx;
  2554. color: #9C9C9C;
  2555. margin-right: 30upx;
  2556. }
  2557. .btn2 {
  2558. width: 170upx;
  2559. line-height: 60upx;
  2560. color: white;
  2561. background: #FF6A04;
  2562. font-size: 28rpx;
  2563. text-align: center;
  2564. margin-right: 30upx;
  2565. border-radius: 20upx;
  2566. }
  2567. /* 收货码弹框 */
  2568. .receipt_code {
  2569. width: 90%;
  2570. margin: 0 auto;
  2571. }
  2572. .code_title {
  2573. width: 100%;
  2574. line-height: 100rpx;
  2575. font-size: 31rpx;
  2576. font-weight: bold;
  2577. text-align: center;
  2578. letter-spacing: 2rpx;
  2579. margin-top: 21rpx;
  2580. margin-bottom: 25rpx;
  2581. }
  2582. .u-input--border {
  2583. border: 1px solid #F2F2F2 !important;
  2584. background: #F2F2F2 !important;
  2585. color: #999999 !important;
  2586. font-weight: 500 !important;
  2587. letter-spacing: 2rpx !important;
  2588. }
  2589. .u-input__input {
  2590. font-size: 30rpx;
  2591. font-weight: bold;
  2592. flex: 1;
  2593. color: #999999 !important;
  2594. min-height: 85rpx !important;
  2595. margin-top: 7rpx;
  2596. }
  2597. .sure {
  2598. width: 100%;
  2599. height: 80rpx;
  2600. background: #FF7F00;
  2601. color: white;
  2602. border-radius: 46rpx;
  2603. text-align: center;
  2604. line-height: 80rpx;
  2605. margin-top: 30rpx;
  2606. letter-spacing: 2rpx;
  2607. }
  2608. </style>