driverDetail.vue 14 KB

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