driverSee.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  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="dataObj.avatarUrl" width="100rpx" height="100rpx" @click=""
  7. shape='circle'>
  8. </u--image>
  9. <view class="name">{{dataObj.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">4.98</view>
  23. </view>
  24. <view class="flex item">
  25. <view class="pf-name">发运次数</view>
  26. <view class="pf-number">4.98</view>
  27. </view>
  28. <view class="flex item">
  29. <view class="pf-name">评价</view>
  30. <view class="pf-number">4.98</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. 4.8
  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">累计发运150次</view>
  59. </view>
  60. </view>
  61. <view class="right">
  62. <view>98%</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="btnData == '' ? 'btn-active':'btn'" @click="btnChange('')">全部({{list.length}})</view>
  70. <!-- <view :class="btnData == 2 ? 'btn-active':'btn'" @click="btnChange(2)">最新(1)</view> -->
  71. <view :class="btnData == 1 ? 'btn-active':'btn'" @click="btnChange(1)">好评({{list3.length}})</view>
  72. <view :class="btnData == 2 ? 'btn-active':'btn'" @click="btnChange(2)">差评({{list4.length}})</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 :src="item.ownerPortrait?item.ownerPortrait:'../../static/images/mine/tx.png'"
  78. width='70rpx' height='70rpx' shape="circle">
  79. </u--image>
  80. <view class="right">
  81. <view class="evaluate_name">{{item.ownerName}}</view>
  82. <view class="evaluate_date m-top10">
  83. {{item.createDate?item.createDate.split(' ')[0]:''}}
  84. </view>
  85. <view class="flex m-top10">
  86. <view class="branch_css ">{{item.count}}</view>
  87. <view class="">
  88. <start count="5" v-model="item.count" size="35" activeColor="#ffaa00" :size="18"
  89. :allowHalf='true' :readonly='true'>
  90. </start>
  91. </view>
  92. </view>
  93. <view class="">
  94. {{item.driverContent}}
  95. </view>
  96. <view>
  97. <u--image v-for="(item,index) in item.imgList" :src="item" width='170rpx'
  98. height='170rpx' class="img-style">
  99. </u--image>
  100. </view>
  101. </view>
  102. </view>
  103. </view>
  104. </view>
  105. </mescroll-body>
  106. </view>
  107. <view class="row5">
  108. <view class="">
  109. <view v-if="tabIndex==1&&index==1" v-for="(items,index) in dataObj.driverCarInfoList" :key="index">
  110. <view class="">
  111. <view>{{items.carNumber}}</view>
  112. <view class="flex align-center">{{items.carType}} | 车长{{items.carLong/1000}}米 |
  113. 载重{{items.carApprovedWeight/1000}}吨</view>
  114. </view>
  115. </view>
  116. <view class="carInfo" v-if="tabIndex==2&index==1">
  117. <view>
  118. 累计发运150次,好评率90%
  119. </view>
  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. columns: [
  148. ['反馈', '举报']
  149. ],
  150. list: [],
  151. list1: [{
  152. name: '司机',
  153. }, {
  154. name: '评价',
  155. }],
  156. list3: [],
  157. list4: [],
  158. dataObj: {},
  159. commonId: "",
  160. };
  161. },
  162. onNavigationBarButtonTap(e) {
  163. console.log("success")
  164. this.show = true
  165. },
  166. onLoad(options) {
  167. debugger
  168. this.commonId = options.commonId
  169. console.log(this.dataObj)
  170. that = this
  171. this.getList()
  172. },
  173. computed: {
  174. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
  175. },
  176. methods: {
  177. getList() {
  178. that.$request.baseRequest('get', '/driverInfo/getDriver', {
  179. commonId: this.commonId
  180. }).then(res => {
  181. this.dataObj = res.data
  182. })
  183. },
  184. confirmBtn(e) {
  185. console.log(e.value)
  186. if (e.value == '反馈') {
  187. uni.$u.route('/pages/order/fk', {
  188. val: JSON.stringify(this.dataObj)
  189. });
  190. } else {
  191. uni.$u.route('/pages/order/jb', {
  192. val: JSON.stringify(this.dataObj)
  193. });
  194. }
  195. this.show = false
  196. },
  197. cancel() {
  198. this.show = false
  199. },
  200. clickTap(index) {
  201. this.index = index
  202. },
  203. clickTab(index) {
  204. this.tabIndex = index
  205. },
  206. btnChange(num) {
  207. this.btnData = num
  208. this.upCallback({
  209. size: 10,
  210. num: 1,
  211. })
  212. },
  213. upCallback(page) {
  214. that.$request.baseRequest('get', '/evaluateInfo/selectEvaluateInfo', {
  215. evaluatoredId: this.dataObj.id,
  216. flag: 2,
  217. pageSize: page.size,
  218. // 1好2差
  219. haoType: 1,
  220. searchType: 1,
  221. currentPage: page.num
  222. }).then(res => {
  223. if (page.num == 1) that.list3 = [];
  224. that.list3 = that.list3.concat(res.data.records); //追加新数据
  225. })
  226. that.$request.baseRequest('get', '/evaluateInfo/selectEvaluateInfo', {
  227. evaluatoredId: this.dataObj.id,
  228. flag: 2,
  229. pageSize: page.size,
  230. haoType: 2,
  231. searchType: 1,
  232. currentPage: page.num
  233. }).then(res => {
  234. if (page.num == 1) that.list4 = [];
  235. that.list4 = that.list4.concat(res.data.records); //追加新数据
  236. })
  237. that.$request.baseRequest('get', '/evaluateInfo/selectEvaluateInfo', {
  238. evaluatoredId: this.dataObj.id,
  239. flag: 2,
  240. searchType: 1,
  241. pageSize: page.size,
  242. currentPage: page.num
  243. }).then(res => {
  244. if (page.num == 1) that.list = [];
  245. that.list = that.list.concat(res.data.records); //追加新数据
  246. for (let i = 0; i < that.list.length; i++) {
  247. if (that.list[i].ownerUrl) {
  248. that.list[i].imgList = that.list[i].ownerUrl.split(',')
  249. }
  250. that.list[i].count = (Number(that.list[i].ownerCredit) + Number(that.list[i]
  251. .tranEfficiency) + Number(that.list[i].freightPayment) + Number(that.list[i]
  252. .serviceQuality) + Number(that.list[i].comprehensiveSatisfaction)) / 15 * 5
  253. }
  254. that.mescroll.endBySize(res.data.records.length, res.data.total);
  255. uni.hideLoading()
  256. })
  257. .catch(res => {
  258. uni.$u.toast(res.message);
  259. });
  260. that.$request.baseRequest('get', '/orderInfo/selectHaoPing', {
  261. commonId: this.userInfo.id,
  262. haoType: ''
  263. }).then(res => {
  264. })
  265. .catch(res => {
  266. uni.$u.toast(res.message);
  267. });
  268. },
  269. // getList() {
  270. // debugger
  271. // this.$request.baseRequest('get', '/orderInfo/selectHaoPing', {
  272. // commonId: this.userInfo.id,
  273. // haoType:''
  274. // }).then(res => {
  275. // if (res.code == 200) {
  276. // this.dataObj = res.data
  277. // } else {
  278. // this.$refs.uToast.show({
  279. // type: 'error',
  280. // message: res.message,
  281. // })
  282. // }
  283. // })
  284. // .catch(res => {
  285. // uni.$u.toast(res.message);
  286. // });
  287. // },
  288. },
  289. }
  290. </script>
  291. <style lang="scss">
  292. .content {
  293. height: 100vh;
  294. }
  295. .item3,
  296. .row3 {
  297. background: white;
  298. }
  299. .name {
  300. font-size: 46rpx;
  301. font-weight: 500;
  302. margin-left: 20rpx;
  303. }
  304. .row1 {
  305. width: 100%;
  306. padding: 30rpx;
  307. }
  308. .phone {
  309. .bgc {
  310. background: #E5F0FE;
  311. display: flex;
  312. align-items: center;
  313. justify-content: center;
  314. border-radius: 50rpx;
  315. padding: 10rpx 20rpx;
  316. align-items: center;
  317. }
  318. .hz-name {
  319. font-size: 26rpx;
  320. color: #2772FB;
  321. }
  322. }
  323. .row2 {
  324. padding: 0 20rpx;
  325. background: white;
  326. .item {
  327. margin-right: 20rpx;
  328. }
  329. .pf-name {
  330. color: #999999;
  331. margin-right: 10rpx;
  332. }
  333. .pf-number {
  334. color: #2772FB;
  335. }
  336. }
  337. .row3 {
  338. justify-content: space-around;
  339. padding: 40rpx 0;
  340. }
  341. .row3-active {
  342. font-weight: 700;
  343. position: relative;
  344. }
  345. .row3-active:before {
  346. font-weight: 700;
  347. content: '';
  348. position: absolute;
  349. bottom: -10rpx;
  350. width: 40rpx;
  351. height: 6rpx;
  352. background: #2772FB;
  353. left: 0;
  354. right: 0;
  355. margin: auto;
  356. }
  357. .row4 {
  358. .title {
  359. background: #EFF1F7;
  360. border-radius: 20rpx;
  361. margin-top: 20rpx;
  362. .item {
  363. display: inline-block;
  364. color: #AFB3BF;
  365. border-radius: 20rpx;
  366. padding: 4rpx 60rpx;
  367. }
  368. .item-active {
  369. background: white;
  370. color: #363636;
  371. }
  372. }
  373. }
  374. .row5 {
  375. padding: 20rpx;
  376. }
  377. .evaluate_css {
  378. margin-top: 30rpx;
  379. display: flex;
  380. width: 100%;
  381. padding-bottom: 40rpx;
  382. border-bottom: 1px solid #E6E6E6;
  383. .evaluate_name {}
  384. .branch_css {
  385. // margin: 0;
  386. margin-right: 20rpx;
  387. }
  388. .evaluate_date {}
  389. .row1 {
  390. .right {
  391. display: flex;
  392. flex-direction: column;
  393. margin-left: 40rpx;
  394. }
  395. }
  396. }
  397. .btn-active {
  398. background-color: #2772FB;
  399. color: white;
  400. border-radius: 50rpx;
  401. display: flex;
  402. align-items: center;
  403. justify-content: center;
  404. padding: 10rpx 20rpx;
  405. }
  406. .btn {
  407. background: #F8F9FB;
  408. color: #363636;
  409. border-radius: 50rpx;
  410. display: flex;
  411. align-items: center;
  412. justify-content: center;
  413. padding: 10rpx 20rpx;
  414. }
  415. .pl-style {
  416. padding: 40rpx;
  417. background: white;
  418. }
  419. .img-style {
  420. display: inline-block;
  421. margin-right: 20rpx;
  422. }
  423. .pf-number1 {
  424. color: #363636;
  425. font-size: 60rpx;
  426. margin-right: 30rpx;
  427. }
  428. .pf {
  429. margin-bottom: 20rpx;
  430. }
  431. </style>