index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895
  1. <template>
  2. <view @touchend="end" @touchmove="move" :class="{popupShow:tipsShow}" class="center">
  3. <view class="flex row1">
  4. <view class="flex center_top">
  5. <view class="center_top_btn" :class="indexbtn == 1? '':'center_top_btn1'" @click="changebtn(1)">司机
  6. </view>
  7. <view class="center_top_btn" :class="indexbtn == 2? '':'center_top_btn1'" @click="changebtn(2)">车队
  8. </view>
  9. </view>
  10. <view class="top_img">
  11. <u--image :showLoading="true" class="flex-end" src="../../static/images/riders/geren.png" width="35px"
  12. height="35px" @click="myPage"></u--image>
  13. </view>
  14. </view>
  15. <view class="driver" v-if="indexbtn == 1">
  16. <view class="flex screen">
  17. <view @click="selectAddress(1)" class="screen_item">
  18. <view class="screen_sign sign1">装</view>
  19. {{title1 ? title1 : "请选择地址"}}
  20. </view>
  21. <itmister-address-picker ref="addressElone" @confirmChange="confirmChangeOne"></itmister-address-picker>
  22. <u--image :showLoading="true" class="exchange" src="../../static/images/riders/exchange.png"
  23. width="43px" height="43px" @click="replace"></u--image>
  24. <view @click="selectAddress(2)" class="screen_item">
  25. <view class="screen_sign sign2">卸</view>
  26. {{title2 ? title2 : "请选择地址"}}
  27. </view>
  28. <itmister-address-picker-other ref="addressEltwo" :wholeCountry="true"
  29. @confirmChange="confirmChangeTwo"></itmister-address-picker-other>
  30. </view>
  31. <view class="route">
  32. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
  33. <view v-for="(item,index) in routeData">
  34. <view class="flex route_item">
  35. <view style="width: 20%;">
  36. <u-avatar :src="item.driverPortrait" size="60"></u-avatar>
  37. </view>
  38. <view style="width: 80%;">
  39. <view class="flex">
  40. <view class="driver_name">
  41. {{item.driverNickname}}
  42. </view>
  43. <view class="driver_invite">
  44. <view class="route_invite" style="margin-left: 30px;" @click="invitation(item)">
  45. <image src="../../static/images/riders/yaoqing.png" mode=""
  46. style="width: 26rpx;height: 26rpx;margin-rigth:10rpx;"></image>邀请
  47. </view>
  48. </view>
  49. <u-picker :show="fleetShow" :columns="columns" @cancel="fleetClose"
  50. @confirm="invitationCheng">
  51. </u-picker>
  52. </view>
  53. <view class="address" v-for="(items,index) in item.startAdress">
  54. <span class="spots spot1"></span>
  55. {{item.startAdress[index]}}
  56. <!-- {{item.sendCity ? item.sendCity: item.sendProvince }}{{item.sendArea}} -->
  57. <image class="jt-icon" src="@/static/images/goodSource/jt.png" mode='widthFix'>
  58. </image>
  59. <span class="spots spot2"></span>
  60. {{item.endAdress[index]}}
  61. <!-- {{item.unloadCity ? item.unloadCity: item.unloadProvince }}{{item.unloadArea}} -->
  62. </view>
  63. </view>
  64. </view>
  65. </view>
  66. <!-- <u-loadmore :status="status" :nomore-text="nomoreText" /> -->
  67. </mescroll-body>
  68. </view>
  69. <!-- <view v-if="routeData.length == 0" style="background: #FFFFFF;text-align: center;padding-top: 20rpx;">
  70. 暂无数据
  71. </view> -->
  72. </view>
  73. <view class="riders" v-if="indexbtn == 2">
  74. <view class="flex riders_top">
  75. <view @click="selectChange" class="riders_city">{{city ? city : province}}</view>
  76. <itmister-address-picker ref="addressElthree" :showCheck="false" @confirmChange="confirmChangethree">
  77. </itmister-address-picker>
  78. <u-search placeholder="输入车队信息关键字" bgColor="#ffffff" v-model="searchKeyWord" @search="getList"
  79. maxlength="15"></u-search>
  80. </view>
  81. <view class="fleet">
  82. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback">
  83. <view v-for="(item,index) in formData" class="flex">
  84. <view class="fleet_item">
  85. <view class="flex">
  86. <u-avatar :src="item.coverUrl" size="45"></u-avatar>
  87. <view class="fleet_name" @click="lookfleet(item)">
  88. {{item.fleetName}}
  89. <view class="fleet_member flex">
  90. <u-avatar-group :urls="item.fleetMemberUrl.split(',')" size="24" gap="0.4">
  91. </u-avatar-group>
  92. <text class="fleet_number">{{item.fleetMemberNum}}人</text>
  93. <!-- <image src="../../static/images/myimg/gengduo1@3x.png" class="arrow"></image> -->
  94. <image src="../../static/images/myimg/gengduo1.png" mode=""
  95. style="width: 18rpx;height: 20rpx;margin-top:14rpx;"></image>
  96. </view>
  97. </view>
  98. <view class="fleet_invite" v-if="!item.fleetMemberStatus" @click="joinFleet(item)">加入</view>
  99. <view class="fleet_invite" v-else>{{item.fleetMemberStatus}}</view>
  100. </view>
  101. <view class="fleet_introduce">
  102. <u-read-more ref="uReadMore" :toggle="true" :shadowStyle="shadowStyle" closeText="查看全部"
  103. :showHeight="20">
  104. <rich-text :nodes="item.fleetProfile"></rich-text>
  105. </u-read-more>
  106. <!-- <view class="fleet_text" v-if="item.textShow">{{item.fleetProfile}}</view>
  107. <view class="" v-else>{{item.fleetProfile}}</view>
  108. <span class="btn_change" @click="textChange(index)">{{switchtext}}</span> -->
  109. </view>
  110. <view class="" v-if="item.img">
  111. <u-upload class="uview-upload" :fileList="item.img" :deletable="false" name="1" multiple
  112. :maxCount="1">
  113. </u-upload>
  114. </view>
  115. </view>
  116. </view>
  117. <!-- <u-loadmore :status="status" :nomore-text="nomoreText" /> -->
  118. </mescroll-body>
  119. </view>
  120. <!-- <view v-if="formData.length == 0" style="background: #FFFFFF;text-align: center;">
  121. 暂无数据
  122. </view> -->
  123. </view>
  124. <u-toast ref="uToast"></u-toast>
  125. <u-modal :show="isShowAlert" :title="alertTitle" :closeOnClickOverlay='true' :showCancelButton='true'
  126. confirmColor='#2772FB' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal>
  127. <u-modal :show="tipsShow" :content='tipsText' :confirmText="btnTips" @confirm="authentication"></u-modal>
  128. </view>
  129. </template>
  130. <script>
  131. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  132. import itmisterAddressPicker from '@/components/itmister-address-picker/itmister-address-picker.nvue'
  133. import itmisterAddressPickerOther from '@/components/itmister-address-picker/itmister-address-picker-other.nvue'
  134. export default {
  135. mixins: [MescrollMixin], // 使用mixin
  136. components: {
  137. itmisterAddressPicker,
  138. itmisterAddressPickerOther
  139. },
  140. data() {
  141. return {
  142. indexbtn: 1,
  143. routeData: [], //列表
  144. // show1: false,
  145. // show2: false,
  146. title1: "",
  147. title2: "",
  148. sendInfo: {
  149. sendProvince: "",
  150. sendCity: "",
  151. sendArea: ""
  152. },
  153. unloadInfo: {
  154. unloadProvince: "",
  155. unloadCity: "",
  156. unloadArea: ""
  157. },
  158. fleetLocation: {},
  159. formData: [],
  160. searchKeyWord: "",
  161. province: "", //省
  162. city: "", //市
  163. alertTitle: "",
  164. isShowAlert: false,
  165. commonId: "",
  166. addMember: {},
  167. tipsShow: false,
  168. tipsText: "",
  169. btnTips: '去认证',
  170. fleetShow: false,
  171. columns: [],
  172. fleetInviteList: [],
  173. //文本折叠
  174. shadowStyle: {
  175. backgroundImage: "none",
  176. paddingTop: "0",
  177. },
  178. status: 'loadmore',
  179. nomoreText: '实在没有了',
  180. mescroll:{},
  181. popupShow:false
  182. }
  183. },
  184. created() {},
  185. onShow() {
  186. if (uni.getStorageSync("sendInfo")) { //从缓存中获取 上一次的装车地 卸车地
  187. this.sendInfo = uni.getStorageSync("sendInfo")
  188. this.title1 = this.sendInfo.sendProvince + this.sendInfo.sendCity + this.sendInfo.sendArea
  189. } else {
  190. this.sendInfo.sendProvince = "北京"
  191. this.title1 = "北京"
  192. }
  193. if (uni.getStorageSync("unloadInfo")) {
  194. this.unloadInfo = uni.getStorageSync("unloadInfo")
  195. this.title2 = this.unloadInfo.unloadProvince + this.unloadInfo.unloadCity + this.unloadInfo.unloadArea
  196. } else {
  197. this.title2 = '全国'
  198. this.unloadInfo.unloadProvince = '全国'
  199. }
  200. if (uni.getStorageSync("fleetLocation")) {
  201. this.province = uni.getStorageSync("fleetLocation").province
  202. this.city = uni.getStorageSync("fleetLocation").city
  203. } else {
  204. this.province = ''
  205. this.city = '北京'
  206. }
  207. this.commonId = uni.getStorageSync("firstAuthentication").commonId
  208. this.checking()
  209. // this.getList()
  210. },
  211. onLoad() {},
  212. methods: {
  213. mescrollInit(mescroll) {
  214. this.mescroll = mescroll;
  215. },
  216. downCallback() {
  217. // 第2种: 下拉刷新和上拉加载调同样的接口, 则不用第1种, 直接mescroll.resetUpScroll()即可
  218. // 重置列表为第一页 (自动执行 page.num=1, 再触发upCallback方法 )
  219. this.mescroll.resetUpScroll()
  220. },
  221. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  222. upCallback(page) {
  223. console.log(page)
  224. // 此处可以继续请求其他接口
  225. if (page.num == 1) {
  226. this.routeData = []
  227. this.formData = []
  228. // 请求其他接口...
  229. }
  230. // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
  231. // if(!this.isInitxx){
  232. // apiGetxx().then(res=>{
  233. // this.isInitxx = true
  234. // this.mescroll.resetUpScroll() // 重新触发upCallback
  235. // }).catch(()=>{
  236. // this.mescroll.endErr()
  237. // })
  238. // return // 此处return,先获取xx
  239. // }
  240. //联网加载数据
  241. this.status = 'loading';
  242. if (this.indexbtn == 1) {
  243. // if(this.sendInfo.sendProvince == "北京"||this.sendInfo.sendProvince == "重庆"||this.sendInfo.sendProvince == "天津"||this.sendInfo.sendProvince == "上海"){
  244. // this.sendInfo.sendCity = this.sendInfo.sendProvince
  245. // this.sendInfo.sendProvince = ""
  246. // }
  247. if (this.unloadInfo.unloadProvince == "全国") {
  248. this.unloadInfo.unloadProvince = ""
  249. }
  250. this.$request.baseRequest('get', '/commonRoute/driverList', {
  251. pageSize: page.size,
  252. currentPage: page.num,
  253. sendProvince: this.sendInfo.sendProvince,
  254. sendCity: this.sendInfo.sendCity,
  255. sendArea: this.sendInfo.sendArea,
  256. unloadProvince: this.unloadInfo.unloadProvince,
  257. unloadCity: this.unloadInfo.unloadCity,
  258. unloadArea: this.unloadInfo.unloadArea
  259. }).then(res => {
  260. if (res.code == 200) {
  261. if (page.num == 1) {
  262. this.routeData = []
  263. this.formData = []
  264. }
  265. this.routeData = this.routeData.concat(res.data.records); //追加新数据
  266. for (let i = 0; i < this.routeData.length; i++) {
  267. if (this.routeData[i].startAdress) {
  268. this.routeData[i].startAdress = this.routeData[i].startAdress.split(",")
  269. }
  270. if (this.routeData[i].endAdress) {
  271. this.routeData[i].endAdress = this.routeData[i].endAdress.split(",")
  272. }
  273. }
  274. this.$forceUpdate()
  275. this.mescroll.endBySize(res.data.records.length, res.data.total);
  276. }
  277. })
  278. .catch(res => {
  279. uni.$u.toast(res.message);
  280. });
  281. } else {
  282. let that = this
  283. this.$request.baseRequest('get', '/fleetInfo/selectFleetInfo', {
  284. commonId: this.commonId,
  285. province: this.province, //省
  286. city: this.city, //市
  287. searchKeyWord: this.searchKeyWord,
  288. pageSize: page.size,
  289. currentPage: page.num,
  290. }).then(res => {
  291. if (page.num == 1) {
  292. this.routeData = []
  293. this.formData = []
  294. }
  295. this.formData = this.formData.concat(res.data.records); //追加新数据
  296. for (let i = 0; i < that.formData.length; i++) {
  297. that.formData[i].textShow = false
  298. if (that.formData[i].fleetUrl) {
  299. that.formData[i].img = []
  300. let imgList = that.formData[i].fleetUrl.split(",")
  301. for (let j = 0; j < imgList.length; j++) {
  302. that.formData[i].img.push({
  303. url: imgList[j]
  304. })
  305. }
  306. }
  307. }
  308. this.$forceUpdate()
  309. this.mescroll.endBySize(res.data.records.length, res.data.total);
  310. })
  311. .catch(res => {
  312. uni.$u.toast(res.message);
  313. });
  314. }
  315. },
  316. lookfleet(item) {
  317. uni.$u.route("/pages/riders/fleetSee?fleetId=" + item.id)
  318. },
  319. checking() {
  320. this.statusVal = uni.getStorageSync("firstAuthentication").authenticationStatus
  321. if (uni.getStorageSync("firstAuthentication")) {
  322. if (this.statusVal != "已认证" && this.statusVal != "已过期") {
  323. uni.setTabBarItem({
  324. index: 1,
  325. text: '车友',
  326. pagePath: "/pages/riders/checkPage",
  327. iconPath: 'static/images/common/zhaoche.png',
  328. selectedIconPath: 'static/images/common/zhaoche_check.png'
  329. })
  330. uni.switchTab({
  331. url: '/pages/riders/checkPage'
  332. });
  333. } else {
  334. uni.setTabBarItem({
  335. index: 1,
  336. text: '车友',
  337. pagePath: "/pages/riders/index",
  338. iconPath: 'static/images/common/zhaoche.png',
  339. selectedIconPath: 'static/images/common/zhaoche_check.png'
  340. })
  341. uni.switchTab({
  342. url: '/pages/riders/index'
  343. });
  344. }
  345. } else if (!uni.getStorageSync("firstAuthentication") && !uni.getStorageSync("userInfo")) { //判断有没有登录
  346. this.tipsShow = true
  347. this.tipsText = "您尚未登录,请前去登录!"
  348. this.btnTips = "去登录"
  349. } else if (!uni.getStorageSync("firstAuthentication")) { //注册登录后并没有认证司机
  350. uni.setTabBarItem({
  351. index: 1,
  352. text: '车友',
  353. pagePath: "/pages/riders/checkPage",
  354. iconPath: 'static/images/common/zhaoche.png',
  355. selectedIconPath: 'static/images/common/zhaoche_check.png'
  356. })
  357. uni.switchTab({
  358. url: '/pages/riders/checkPage'
  359. });
  360. }
  361. },
  362. fleetClose() {
  363. this.fleetShow = false
  364. },
  365. invitation(item) {
  366. this.addMember = {}
  367. this.columns = []
  368. this.addMember.commonId = item.commonId
  369. this.addMember.driverNickname = item.driverNickname
  370. this.addMember.driverPortrait = item.driverPortrait
  371. this.$request.baseRequest('get', '/fleetInfo/fleetInfos', {
  372. commonId: this.commonId,
  373. }).then(res => {
  374. if (res.code == 200) {
  375. this.fleetInviteList = res.data
  376. let flrrtArray = []
  377. for (let i = 0; i < res.data.length; i++) {
  378. flrrtArray.push(res.data[i].fleetName)
  379. }
  380. this.columns.push(flrrtArray)
  381. if (this.columns.length == 0) {
  382. uni.$u.toast("无可邀请的车队");
  383. } else {
  384. this.fleetShow = true
  385. }
  386. } else {
  387. uni.$u.toast(res.message);
  388. }
  389. })
  390. .catch(res => {
  391. uni.$u.toast(res.message);
  392. });
  393. },
  394. invitationCheng(e) { //邀请
  395. this.addMember.fleetId = this.fleetInviteList[e.indexs[0]].id
  396. this.fleetShow = false
  397. this.addMember.joinFlag = 2
  398. this.$request.baseRequest('post', '/fleetMemberInfo/api/addFleetMemberInfo', this.addMember).then(res => {
  399. if (res.code == 200) {
  400. this.$refs.uToast.show({
  401. type: 'success',
  402. message: "邀请已发出",
  403. })
  404. } else {
  405. uni.$u.toast(res.message);
  406. }
  407. })
  408. .catch(res => {
  409. uni.$u.toast(res.message);
  410. });
  411. },
  412. authentication() {
  413. this.tipsShow = false
  414. if (this.statusVal == '未认证') {
  415. this.$u.route("/pages/mine/driverCertification")
  416. } else if (this.statusVal == '未通过') {
  417. this.$u.route("/pages/mine/editDriverCertification")
  418. } else if (this.statusVal == '审核中') {
  419. // this.$u.route("")
  420. uni.switchTab({
  421. url: '/pages/mine/index'
  422. });
  423. } else {
  424. uni.$u.route('/pages/public/login');
  425. }
  426. },
  427. selectAddress(num) {
  428. if (num == 1) {
  429. this.$refs.addressElone.show();
  430. } else if (num == 2) {
  431. this.$refs.addressEltwo.show();
  432. }
  433. },
  434. selectChange() {
  435. this.$refs.addressElthree.show();
  436. },
  437. // 确认选中
  438. confirmChangeOne(address) {
  439. if (address.province == '全国') {
  440. uni.$u.toast("发货地不可以是全国")
  441. // this.$refs.addressElone.show();
  442. return
  443. }
  444. this.sendInfo.sendProvince = address.province ? address.province : ''
  445. if(address.city=='天津'||address.city=='北京'||address.city=='上海'||address.city=='重庆'||address.city=='台湾'){
  446. this.sendInfo.sendCity=''
  447. }else{
  448. this.sendInfo.sendCity = address.city ? address.city : ''
  449. }
  450. this.sendInfo.sendArea = address.area ? address.area : ''
  451. if (address.city == '全省') {
  452. this.title1 = address.province
  453. this.sendInfo.sendCity = ""
  454. this.sendInfo.sendArea = ""
  455. } else if (address.area == '全市') {
  456. if(address.city=='天津'||address.city=='北京'||address.city=='上海'||address.city=='重庆'||address.city=='台湾'){
  457. this.title1 = address.province
  458. }else{
  459. this.title1 = address.province + address.city
  460. }
  461. this.sendInfo.sendArea = ""
  462. } else {
  463. this.title1 = address.province + address.city + address.area;
  464. }
  465. uni.setStorageSync("sendInfo", this.sendInfo)
  466. this.getList()
  467. },
  468. confirmChangeTwo(address) {
  469. this.unloadInfo.unloadProvince = address.province ? address.province : ''
  470. if(address.city=='天津'||address.city=='北京'||address.city=='上海'||address.city=='重庆'||address.city=='台湾'){
  471. this.unloadInfo.unloadCity=''
  472. }else{
  473. this.unloadInfo.unloadCity = address.city ? address.city : ''
  474. }
  475. // this.unloadCity.unloadCity = address.city ? address.city : ''
  476. this.unloadInfo.unloadArea = address.area ? address.area : ''
  477. if (address.city == '全省') {
  478. this.title2 = address.province
  479. this.unloadInfo.unloadCity = ""
  480. this.unloadInfo.unloadArea = ""
  481. } else if (address.area == '全市') {
  482. if(address.city=='天津'||address.city=='北京'||address.city=='上海'||address.city=='重庆'||address.city=='台湾'){
  483. this.title2 = address.province
  484. }else{
  485. this.title2 = address.province + address.city
  486. }
  487. this.unloadInfo.unloadArea = ""
  488. } else {
  489. if (address.province == '全国') {
  490. this.title2 = address.province
  491. } else {
  492. this.title2 = address.province + address.city + address.area;
  493. }
  494. }
  495. uni.setStorageSync("unloadInfo", this.unloadInfo)
  496. this.getList()
  497. },
  498. confirmChangethree(address) {
  499. this.province = address.province
  500. this.city = address.city
  501. if (address.city == "全省") {
  502. this.city = ""
  503. }
  504. this.fleetLocation.province = address.province
  505. this.fleetLocation.city = address.city == "全省" ? "" : address.city
  506. uni.setStorageSync("fleetLocation", this.fleetLocation)
  507. this.getList()
  508. },
  509. joinFleet(item) {
  510. this.addMember.commonId = this.commonId
  511. this.addMember.driverNickname = uni.getStorageSync("firstAuthentication").driverCall
  512. this.addMember.driverPortrait = uni.getStorageSync("userInfo").avatarUrl
  513. this.addMember.fleetId = item.id
  514. this.alertTitle = "确定申请加入该车队?"
  515. this.isShowAlert = true
  516. },
  517. // addressChange(num) {
  518. // if (num == 1) {
  519. // this.show1 = true
  520. // this.show2 = false
  521. // } else {
  522. // this.show1 = false
  523. // this.show2 = true
  524. // }
  525. // },
  526. cancelClick() {
  527. this.isShowAlert = false
  528. },
  529. confirmClick() {
  530. this.isShowAlert = false
  531. this.addMember.joinFlag = 1
  532. this.$request.baseRequest('post', '/fleetMemberInfo/api/addFleetMemberInfo', this.addMember).then(res => {
  533. if (res.code == '200') {
  534. this.$refs.uToast.show({
  535. type: 'success',
  536. message: "申请成功,等待队长审核",
  537. })
  538. this.getList()
  539. } else {
  540. this.$refs.uToast.show({
  541. type: 'success',
  542. message: "申请失败,请稍后重试",
  543. })
  544. }
  545. })
  546. .catch(res => {
  547. uni.$u.toast(res.message);
  548. });
  549. },
  550. getList() {
  551. this.status = 'loading';
  552. if (this.indexbtn == 1) {
  553. // if(this.sendInfo.sendProvince == "北京"||this.sendInfo.sendProvince == "重庆"||this.sendInfo.sendProvince == "天津"||this.sendInfo.sendProvince == "上海"){
  554. // this.sendInfo.sendCity = this.sendInfo.sendProvince
  555. // this.sendInfo.sendProvince = ""
  556. // }
  557. if (this.unloadInfo.unloadProvince == "全国") {
  558. this.unloadInfo.unloadProvince = ""
  559. }
  560. this.$request.baseRequest('get', '/commonRoute/driverList', {
  561. pageSize: 10,
  562. currentPage: 1,
  563. sendProvince: this.sendInfo.sendProvince,
  564. sendCity: this.sendInfo.sendCity,
  565. sendArea: this.sendInfo.sendArea,
  566. unloadProvince: this.unloadInfo.unloadProvince,
  567. unloadCity: this.unloadInfo.unloadCity,
  568. unloadArea: this.unloadInfo.unloadArea
  569. }).then(res => {
  570. if (res.code == 200) {
  571. this.routeData = res.data.records
  572. for (let i = 0; i < this.routeData.length; i++) {
  573. if (this.routeData[i].startAdress) {
  574. this.routeData[i].startAdress = this.routeData[i].startAdress.split(",")
  575. }
  576. if (this.routeData[i].endAdress) {
  577. this.routeData[i].endAdress = this.routeData[i].endAdress.split(",")
  578. }
  579. }
  580. if (res.data.total == 0) {
  581. this.status = 'nomore'
  582. } else {
  583. this.status = 'loadmore'
  584. }
  585. }
  586. })
  587. .catch(res => {
  588. uni.$u.toast(res.message);
  589. });
  590. } else {
  591. let that = this
  592. this.$request.baseRequest('get', '/fleetInfo/selectFleetInfo', {
  593. commonId: this.commonId,
  594. province: this.province, //省
  595. city: this.city, //市
  596. searchKeyWord: this.searchKeyWord,
  597. pageSize: 10,
  598. currentPage: 1
  599. }).then(res => {
  600. that.formData = res.data.records
  601. for (let i = 0; i < that.formData.length; i++) {
  602. that.formData[i].textShow = false
  603. if (that.formData[i].fleetUrl) {
  604. that.formData[i].img = []
  605. let imgList = that.formData[i].fleetUrl.split(",")
  606. for (let j = 0; j < imgList.length; j++) {
  607. that.formData[i].img.push({
  608. url: imgList[j]
  609. })
  610. }
  611. }
  612. }
  613. if (res.data.total == 0) {
  614. this.status = 'nomore'
  615. } else {
  616. this.status = 'loadmore'
  617. }
  618. })
  619. .catch(res => {
  620. uni.$u.toast(res.message);
  621. });
  622. }
  623. },
  624. changebtn(num) {
  625. this.indexbtn = num
  626. this.getList()
  627. },
  628. // 回调参数为包含columnIndex、value、values
  629. confirm(e) {
  630. console.log('confirm', e)
  631. this.show = false
  632. },
  633. replace() {
  634. if (this.title2 == "全国") {
  635. uni.$u.toast("发货地不可以是全国")
  636. return
  637. }
  638. let _obj = {}
  639. _obj = JSON.parse(JSON.stringify(this.sendInfo))
  640. this.sendInfo.sendProvince = this.unloadInfo.unloadProvince
  641. this.sendInfo.sendCity = this.unloadInfo.unloadCity
  642. this.sendInfo.sendArea = this.unloadInfo.unloadArea
  643. this.unloadInfo.unloadProvince = _obj.sendProvince
  644. this.unloadInfo.unloadCity = _obj.sendCity
  645. this.unloadInfo.unloadArea = _obj.sendArea
  646. let text = ""
  647. text = this.title1
  648. this.title1 = this.title2
  649. this.title2 = text
  650. this.getList()
  651. },
  652. myPage() {
  653. uni.$u.route("/pages/riders/myTeam")
  654. }
  655. }
  656. }
  657. </script>
  658. <style lang="scss" scoped>
  659. .center {
  660. background: #F2F4F7;
  661. .row1 {
  662. display: flex;
  663. justify-content: flex-end;
  664. .flex-end {
  665. margin: 60rpx 30rpx 0 0;
  666. }
  667. .center_top {
  668. width: 40%;
  669. margin: 60rpx auto 0;
  670. .center_top_btn {
  671. width: 50%;
  672. text-align: center;
  673. color: #000000;
  674. font-size: 42rpx;
  675. font-weight: 600;
  676. }
  677. .center_top_btn1 {
  678. color: #BBBBBB;
  679. }
  680. }
  681. }
  682. .top_img {
  683. width: 70rpx;
  684. height: 70rpx;
  685. }
  686. }
  687. .route {
  688. padding: 40rpx;
  689. margin-top: 40rpx;
  690. background: #FFFFFF;
  691. .route_item {
  692. margin-bottom: 40rpx;
  693. width: 100%;
  694. .route_invite {
  695. width: 146rpx;
  696. height: 54rpx;
  697. border-radius: 35px;
  698. text-align: center;
  699. color: #FFFFFF;
  700. line-height: 54rpx;
  701. background: #2772FB;
  702. }
  703. .driver_name {
  704. width: 50%;
  705. margin: 20rpx 0 0 30rpx;
  706. color: #333333;
  707. font-size: 30rpx;
  708. }
  709. .driver_invite {
  710. display: flex;
  711. width: 50%;
  712. justify-content: flex-end;
  713. }
  714. }
  715. .address {
  716. margin-left: 30rpx;
  717. // line-height: 34rpx;
  718. .spots {
  719. width: 20rpx;
  720. height: 20rpx;
  721. display: inline-block;
  722. border-radius: 10rpx;
  723. margin-right: 10rpx;
  724. margin-bottom: 4rpx
  725. }
  726. .spot1 {
  727. background: #2772FB;
  728. }
  729. .spot2 {
  730. background: #FE6300;
  731. }
  732. }
  733. }
  734. .driver {
  735. .screen {
  736. background-color: #FFFFFF;
  737. width: 92%;
  738. border-radius: 20rpx;
  739. height: 200rpx;
  740. margin: 40rpx auto 30rpx;
  741. // margin-top: 60rpx;
  742. .screen_item {
  743. padding: 60rpx 30rpx;
  744. width: 40%;
  745. text-align: center;
  746. .screen_sign {
  747. width: 40rpx;
  748. height: 40rpx;
  749. text-align: center;
  750. margin: 0 auto;
  751. border-radius: 6px;
  752. color: #FFFFFF;
  753. font-size: 22rpx;
  754. line-height: 40rpx;
  755. }
  756. .sign1 {
  757. background: #2772FB;
  758. }
  759. .sign2 {
  760. background: #FE6300;
  761. }
  762. }
  763. .exchange {
  764. line-height: 200rpx;
  765. margin-top: 60rpx;
  766. }
  767. }
  768. }
  769. .riders {
  770. .riders_top {
  771. margin-top: 40rpx;
  772. .riders_city {
  773. margin-top: 10rpx;
  774. margin: 10rpx 30rpx;
  775. }
  776. }
  777. .fleet {
  778. padding: 30rpx;
  779. margin-top: 40rpx;
  780. background: #FFFFFF;
  781. border-top-right-radius: 40rpx;
  782. border-top-left-radius: 40rpx;
  783. .fleet_item {
  784. // margin-top: 10rpx;
  785. width: 100%;
  786. margin-bottom: 20rpx;
  787. .fleet_name {
  788. margin-left: 20rpx;
  789. width: 70%;
  790. }
  791. .fleet_invite {
  792. text-align: center;
  793. background-color: #2772FB;
  794. width: 128rpx;
  795. height: 66rpx;
  796. line-height: 66rpx;
  797. border-radius: 35rpx;
  798. color: #fff;
  799. }
  800. .fleet_introduce {
  801. margin: 40rpx 0;
  802. position: relative;
  803. // .fleet_text{
  804. // overflow: hidden;
  805. // word-break: break-all; /* break-all(允许在单词内换行。) */
  806. // text-overflow: ellipsis; /* 超出部分省略号 */
  807. // display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
  808. // -webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
  809. // -webkit-line-clamp: 3; /** 显示的行数 **/
  810. // }
  811. .btn_change {
  812. position: absolute;
  813. right: 0rpx;
  814. bottom: 0rpx;
  815. color: #2772fb;
  816. }
  817. }
  818. .fleet_member {
  819. margin-top: 20rpx;
  820. }
  821. .fleet_number {
  822. margin: 6rpx 10rpx;
  823. color: #ABABAB;
  824. font-size: 24rpx;
  825. }
  826. }
  827. }
  828. }
  829. .jt-icon {
  830. position: relative;
  831. top: 16rpx;
  832. width: 60rpx;
  833. margin: 0 20rpx;
  834. // margin-top: 10rpx;
  835. }
  836. .popupShow {
  837. overflow: hidden;
  838. position: fixed;
  839. height: 100vh;
  840. width: 100%;
  841. }
  842. </style>