index.vue 28 KB

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