index.vue 28 KB

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