driverSee.vue 14 KB

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