index.vue 26 KB

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