driverDetail.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487
  1. <template>
  2. <view class="content">
  3. <view class="item3 flex align-center flex-space-between">
  4. <view class="flex align-center flex-space-between row1">
  5. <view class="flex align-center">
  6. <u--image :showLoading="true" :src="driverList.avatarUrl" width="100rpx" height="100rpx" @click=""
  7. shape='circle'>
  8. </u--image>
  9. <view class="name">{{driverList.driverName}}</view>
  10. </view>
  11. <view class="right flex s-row align-center phone">
  12. <view class="bgc flex flex-space-between">
  13. <u-icon class="phone" name="phone-fill" color="#2772FB" size="20" @click="toPhone"></u-icon>
  14. <view class="hz-name">联系司机</view>
  15. </view>
  16. </view>
  17. </view>
  18. </view>
  19. <view class="row2 flex">
  20. <view class="flex item">
  21. <view class="pf-name">评分</view>
  22. <view class="pf-number">{{ping.zong}}</view>
  23. </view>
  24. <view class="flex item">
  25. <view class="pf-name">发运次数</view>
  26. <view class="pf-number">{{driverList.shipmentsNumber?driverList.shipmentsNumber:0}}</view>
  27. </view>
  28. <view v-if='total>=20' class="flex item">
  29. <view class="pf-name">好评率</view>
  30. <view class="pf-number">{{driverList.favorableRate?driverList.favorableRate:0}}%</view>
  31. </view>
  32. </view>
  33. <view class="row3 flex">
  34. <view :class="index==1?'row3-active':''" @click="clickTap(1)">司机信息</view>
  35. <view :class="index==2?'row3-active':''" @click="clickTap(2)">评价</view>
  36. <!-- <u-tabs :list="list1" @click="click"></u-tabs> -->
  37. </view>
  38. <view class="carInfo" v-if="index==1">
  39. <view class="flex flex-center row4">
  40. <view class="title">
  41. <text class="item" :class="tabIndex==1?'item-active':1" @click="clickTab(1)">车辆信息</text>
  42. <text class="item" :class="tabIndex==2?'item-active':2" @click="clickTab(2)">发运记录</text>
  43. </view>
  44. </view>
  45. </view>
  46. <view v-show="index == 2" class="pl-style">
  47. <view class="pf flex-space-between flex">
  48. <view class="left flex align-center" style="margin-right: 20rpx;">
  49. <view class="pf-number1">
  50. {{ping.zong}}
  51. </view>
  52. <view>
  53. <!-- <view>
  54. <start count="5" v-model="zhpf" size="35" activeColor="#ffaa00" :size="18" :allowHalf='true'
  55. :readonly='true'>
  56. </start>
  57. </view> -->
  58. <view class="gray fontsize-24">累计发运{{total}}次</view>
  59. </view>
  60. </view>
  61. <view class="right">
  62. <view>{{driverList.favorableRate?driverList.favorableRate:0}}%</view>
  63. <view class="gray fontsize-24">好评率</view>
  64. </view>
  65. </view>
  66. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
  67. class="mescroll">
  68. <view class="flex flex-space-between">
  69. <view :class="haoType == '' ? 'btn-active':'btn'" @click="btnChange('')">全部({{ping.haoPing+ping.chaPing}}})</view>
  70. <!-- <view :class="btnData == 2 ? 'btn-active':'btn'" @click="btnChange(2)">最新(1)</view> -->
  71. <view :class="haoType == 1 ? 'btn-active':'btn'" @click="btnChange(1)">好评({{ping.haoPing}})</view>
  72. <view :class="haoType == 2 ? 'btn-active':'btn'" @click="btnChange(2)">差评({{ping.chaPing}})</view>
  73. </view>
  74. <view class="evaluate_css" v-for="(item,index) in list">
  75. <view class="flex">
  76. <view class="row1 flex">
  77. <u--image
  78. :src="item.ownerPortrait?item.ownerPortrait:'../../static/images/mine/tx.png'"
  79. width='70rpx' height='70rpx' shape="circle">
  80. </u--image>
  81. <view class="right">
  82. <view class="evaluate_name">{{item.ownerName}}</view>
  83. <view class="evaluate_date m-top10">
  84. {{item.createDate?item.createDate.split(' ')[0]:''}}
  85. </view>
  86. <view class="flex m-top10">
  87. <view class="branch_css ">{{item.driverScoreObtained}}</view>
  88. <view class="">
  89. <start count="5" v-model="item.driverScoreObtained" size="35" activeColor="#ffaa00" :size="18"
  90. :allowHalf='true' :readonly='true'>
  91. </start>
  92. </view>
  93. </view>
  94. <view class="">
  95. {{item.driverContent}}
  96. </view>
  97. <view>
  98. <u--image v-for="(item,index) in item.imgList" :src="item" width='170rpx'
  99. height='170rpx' class="img-style">
  100. </u--image>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </view>
  106. </mescroll-body>
  107. </view>
  108. <view class="row5">
  109. <view class='carMessage' v-if="tabIndex==1&&index==1">
  110. <view class='carMessage-item' v-for='(item,index) in hyDriverCarInfoList' :style="{'border-radius':(index!=hyDriverCarInfoList.length-1?'#ccc':'transparent')}">
  111. <view v-if='item.carCategory=="挂车"'>{{item.guaCarNumber}}</view>
  112. <view v-else>{{item.carNumber}}</view>
  113. <view v-if='item.carCategory=="挂车"' class="flex align-center">{{item.carType}} | 车长{{item.guaCarLong}}米 | 载重{{item.guaCarApprovedWeight}}吨</view>
  114. <view v-else class="flex align-center">{{item.carType}} | 车长{{item.carLong}}米 | 载重{{item.carApprovedWeight}}吨</view>
  115. </view>
  116. </view>
  117. <view class="carInfo" v-if="tabIndex==2&&index==1">
  118. <view style='text-align:center;'>
  119. 累计发运{{driverList.shipmentsNumber?driverList.shipmentsNumber:0}}次<text v-if='total>=20'>,好评率{{driverList.favorableRate?driverList.favorableRate:0}}%</text>
  120. </view>
  121. </view>
  122. </view>
  123. <u-toast ref="uToast"></u-toast>
  124. <u-picker :show="show" :columns="columns" :closeOnClickOverlay='true' @cancel='cancel' @close='cancel'
  125. @confirm='confirmBtn'></u-picker>
  126. </view>
  127. </template>
  128. <script>
  129. var that
  130. import {
  131. mapState
  132. } from 'vuex';
  133. import start from '../../common/components/uni-rate.vue'
  134. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  135. export default {
  136. mixins: [MescrollMixin], // 使用mixin
  137. components: {
  138. start
  139. },
  140. data() {
  141. return {
  142. btnData: '',
  143. tabIndex: 1,
  144. index: 1,
  145. show: false,
  146. objectInfo: {},
  147. haoType:'',
  148. columns: [
  149. ['投诉', '举报']
  150. ],
  151. list: [],
  152. list1: [{
  153. name: '司机',
  154. }, {
  155. name: '评价',
  156. }],
  157. list3:[],
  158. list4:[],
  159. ping:[],
  160. hyDriverCarInfoList:[],
  161. driverList:{},
  162. total:0
  163. };
  164. },
  165. onNavigationBarButtonTap(e) {
  166. console.log("success")
  167. this.show = true
  168. },
  169. onLoad(options) {
  170. // this.dataObj =JSON.parse(options.driver)
  171. // console.log(this.dataObj)
  172. that = this
  173. // this.getList()
  174. },
  175. onShow(){
  176. var that=this
  177. },
  178. computed: {
  179. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
  180. },
  181. methods: {
  182. toPhone(){
  183. console.log(this.driverList.driverPhone)
  184. var that=this
  185. uni.makePhoneCall({
  186. phoneNumber: that.driverList.driverPhone,
  187. success: (res) => {
  188. console.log('调用成功!')
  189. },
  190. // 失败回调
  191. fail: (res) => {
  192. console.log('调用失败!')
  193. }
  194. });
  195. },
  196. confirmBtn(e) {
  197. console.log(e.value)
  198. if (e.value == '投诉') {
  199. uni.$u.route('/pages/order/fk', {
  200. val: JSON.stringify(this.driverList)
  201. });
  202. } else {
  203. uni.$u.route('/pages/order/jb', {
  204. val: JSON.stringify(this.driverList)
  205. });
  206. }
  207. this.show = false
  208. },
  209. cancel() {
  210. this.show = false
  211. },
  212. clickTap(index) {
  213. this.index = index
  214. },
  215. clickTab(index) {
  216. this.tabIndex = index
  217. },
  218. btnChange(num) {
  219. // debugger
  220. this.haoType = num
  221. this.upCallback({size:10,num:1})
  222. // this.getList()
  223. },
  224. upCallback(page) {
  225. var that =this
  226. that.$request.baseRequest('get', '/driverInfo/getDriver', {
  227. commonId:'2939c4c23ca14e4ab6f16d7a6b3f8d5e'
  228. }).then(res => {
  229. console.log(res.data)
  230. that.driverList=res.data
  231. if(res.data.hyDriverCarInfoList){
  232. for (var i = 0; i < res.data.hyDriverCarInfoList.length; i++) {
  233. res.data.hyDriverCarInfoList[i].carApprovedWeight=res.data.hyDriverCarInfoList[i].carApprovedWeight/1000
  234. res.data.hyDriverCarInfoList[i].guaCarApprovedWeight=res.data.hyDriverCarInfoList[i].guaCarApprovedWeight/1000
  235. res.data.hyDriverCarInfoList[i].carLong=res.data.hyDriverCarInfoList[i].carLong/1000
  236. res.data.hyDriverCarInfoList[i].guaCarLong=res.data.hyDriverCarInfoList[i].guaCarLong/1000
  237. res.data.hyDriverCarInfoList[i].carNumber = res.data.hyDriverCarInfoList[i].carNumber.replace(res.data.hyDriverCarInfoList[i].carNumber.substring(2, 6),
  238. "****")
  239. res.data.hyDriverCarInfoList[i].guaCarNumber = res.data.hyDriverCarInfoList[i].guaCarNumber.replace(res.data.hyDriverCarInfoList[i].guaCarNumber.substring(2, 6),
  240. "****")
  241. }
  242. that.hyDriverCarInfoList=res.data.hyDriverCarInfoList
  243. }
  244. that.$request.baseRequest('get', '/orderInfo/selectHaoPing', {
  245. commonId:that.driverList.commonId,
  246. evaluateFlag:1,
  247. }).then(res => {
  248. that.ping=res.data
  249. })
  250. .catch(res => {
  251. uni.$u.toast(res.message);
  252. });
  253. that.$request.baseRequest('get', '/evaluateInfo/selectEvaluateInfo', {
  254. evaluatoredId: that.driverList.commonId,
  255. flag: 2,
  256. haoType:that.haoType,
  257. searchType:1,
  258. pageSize: page.size,
  259. currentPage: page.num
  260. }).then(res => {
  261. if (page.num == 1) that.list = [];
  262. that.list = that.list.concat(res.data.records); //追加新数据
  263. that.total = res.data.total
  264. for (let i = 0; i < that.list.length; i++) {
  265. if (that.list[i].ownerUrl) {
  266. // that.list[i].imgList=[]
  267. that.list[i].imgList = that.list[i].ownerUrl.split(',')
  268. }
  269. // that.list[i].count = (Number(that.list[i].ownerCredit) + Number(that.list[i]
  270. // .tranEfficiency) + Number(that.list[i].freightPayment) + Number(that.list[i]
  271. // .serviceQuality) + Number(that.list[i].comprehensiveSatisfaction)) / 15 * 5
  272. }
  273. that.mescroll.endBySize(res.data.records.length, res.data.total);
  274. uni.hideLoading()
  275. })
  276. .catch(res => {
  277. uni.$u.toast(res.message);
  278. });
  279. })
  280. },
  281. // getList() {
  282. // debugger
  283. // this.$request.baseRequest('get', '/orderInfo/selectHaoPing', {
  284. // commonId: this.userInfo.id,
  285. // haoType:''
  286. // }).then(res => {
  287. // if (res.code == 200) {
  288. // this.dataObj = res.data
  289. // } else {
  290. // this.$refs.uToast.show({
  291. // type: 'error',
  292. // message: res.message,
  293. // })
  294. // }
  295. // })
  296. // .catch(res => {
  297. // uni.$u.toast(res.message);
  298. // });
  299. // },
  300. },
  301. }
  302. </script>
  303. <style lang="scss">
  304. .content {
  305. height: 100vh;
  306. }
  307. .carMessage{
  308. background:#fff;border-radius: 20rpx;
  309. .carMessage-item{
  310. padding:40rpx;
  311. }
  312. }
  313. .item3,
  314. .row3 {
  315. background: white;
  316. }
  317. .name {
  318. font-size: 46rpx;
  319. font-weight: 500;
  320. margin-left: 20rpx;
  321. }
  322. .row1 {
  323. width: 100%;
  324. padding: 30rpx;
  325. }
  326. .phone {
  327. .bgc {
  328. background: #E5F0FE;
  329. display: flex;
  330. align-items: center;
  331. justify-content: center;
  332. border-radius: 50rpx;
  333. padding: 10rpx 20rpx;
  334. align-items: center;
  335. }
  336. .hz-name {
  337. font-size: 26rpx;
  338. color: #2772FB;
  339. }
  340. }
  341. .row2 {
  342. padding: 0 20rpx;
  343. background: white;
  344. .item {
  345. margin-right: 20rpx;
  346. }
  347. .pf-name {
  348. color: #999999;
  349. margin-right: 10rpx;
  350. }
  351. .pf-number {
  352. color: #2772FB;
  353. }
  354. }
  355. .row3 {
  356. justify-content: space-around;
  357. padding: 40rpx 0;
  358. }
  359. .row3-active {
  360. font-weight: 700;
  361. position: relative;
  362. }
  363. .row3-active:before {
  364. font-weight: 700;
  365. content: '';
  366. position: absolute;
  367. bottom: -10rpx;
  368. width: 40rpx;
  369. height: 6rpx;
  370. background: #2772FB;
  371. left: 0;
  372. right: 0;
  373. margin: auto;
  374. }
  375. .row4 {
  376. .title {
  377. background: #EFF1F7;
  378. border-radius: 20rpx;
  379. margin-top: 20rpx;
  380. .item {
  381. display: inline-block;
  382. color: #AFB3BF;
  383. border-radius: 20rpx;
  384. padding: 4rpx 60rpx;
  385. }
  386. .item-active {
  387. background: white;
  388. color: #363636;
  389. }
  390. }
  391. }
  392. .row5 {
  393. padding: 20rpx;
  394. }
  395. .evaluate_css {
  396. margin-top: 30rpx;
  397. display: flex;
  398. width: 100%;
  399. padding-bottom: 40rpx;
  400. border-bottom: 1px solid #E6E6E6;
  401. .evaluate_name {}
  402. .branch_css {
  403. // margin: 0;
  404. margin-right: 20rpx;
  405. }
  406. .evaluate_date {}
  407. .row1 {
  408. .right {
  409. display: flex;
  410. flex-direction: column;
  411. margin-left: 40rpx;
  412. }
  413. }
  414. }
  415. .btn-active {
  416. background-color: #2772FB;
  417. color: white;
  418. border-radius: 50rpx;
  419. display: flex;
  420. align-items: center;
  421. justify-content: center;
  422. padding: 10rpx 20rpx;
  423. }
  424. .btn {
  425. background: #F8F9FB;
  426. color: #363636;
  427. border-radius: 50rpx;
  428. display: flex;
  429. align-items: center;
  430. justify-content: center;
  431. padding: 10rpx 20rpx;
  432. }
  433. .pl-style {
  434. padding: 40rpx;
  435. background: white;
  436. }
  437. .img-style{
  438. display: inline-block;
  439. margin-right: 20rpx;
  440. }
  441. .pf-number1 {
  442. color: #363636;
  443. font-size: 60rpx;
  444. margin-right: 30rpx;
  445. }
  446. .pf {
  447. margin-bottom: 20rpx;
  448. }
  449. </style>