index.vue 27 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064
  1. <!-- 订单 -->
  2. <template>
  3. <view class="content">
  4. <view class="fixed1"></view>
  5. <view v-if="!isSearch">
  6. <view class="fixed">
  7. <view class='title flex flex-center'>
  8. <view>订单</view>
  9. <image class="search" style='width:18px;height:18px;' src="../../static/images/search_icon.png"
  10. @click="search" mode=""></image>
  11. <!-- <u-icon class="search" name="search" color="" size="28" @click="search"></u-icon> -->
  12. </view>
  13. <view class="tab-content">
  14. <u-tabs :list="tabList" @click="clickTab" lineColor='#2772FB' :current='tabIndex' :activeStyle="{
  15. color: '#2772FB',
  16. fontWeight: 'bold',
  17. transform: 'scale(1.05)'
  18. }"></u-tabs>
  19. <view class="right-btn flex align-center" @click="showMenu=!showMenu">
  20. <!-- <view class="">
  21. 全部类型
  22. </view> -->
  23. <image style='width:8px;height:8px;'
  24. :src="!showMenu?'../../static/images/order/xiala.png':'../../static/images/order/shangla.png'"
  25. mode=""></image>
  26. <!-- <u-icon :name="!showMenu?'arrow-down-fill':'arrow-up-fill'" color="#333333" size="12"></u-icon> -->
  27. </view>
  28. </view>
  29. </view>
  30. <view class="all-menu">
  31. <u-transition :show="showMenu" mode="fade">
  32. <view class="" style="background: white;padding:71rpx 0 23rpx 20rpx;font-weight: 700;">
  33. 类型
  34. </view>
  35. <view class="transition">
  36. <view v-for="(item,index) in tabList" class="transition-item-style"
  37. :class="tabIndex==index?'menu-active':''" @click="clickTab({index:index})">
  38. {{item.name}}
  39. </view>
  40. </view>
  41. </u-transition>
  42. <view @touchmove.stop.prevent="moveHandle" class="modal-black" v-show="showMenu"></view>
  43. </view>
  44. <mescroll-body ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback"
  45. class="mescroll">
  46. <view class="evaluatePage flex flex-space-between" v-show="tabIndex == 6" @click="evaluateClick">
  47. <view class="left flex flex-space-between" @click="evaluateClick">
  48. <!-- <u-icon size="20" name="edit-pen"></u-icon> -->
  49. <image style='width:14px;height:14px;margin-right:7px;'
  50. src="../../static/images/order/pingjiabianji.png" mode=""></image>
  51. <view style="margin-left: 20prx;">我的评价</view>
  52. </view>
  53. <view class="right">
  54. <image style='width:12px;height:12px;' src="../../static/images/order/right.png" mode="">
  55. </image>
  56. </view>
  57. </view>
  58. <view :id="'good'+good.id" class="good-list" v-for="good in goods" @click="toDetail(good)">
  59. <view style="padding: 0 35rpx 20rpx 35rpx;">
  60. <view class="flex flex-space-between row1">
  61. <view class="item1">
  62. {{good.orderNo}} {{good.goodsName}}
  63. </view>
  64. <view class="item2">
  65. {{good.orderStatus}}
  66. </view>
  67. </view>
  68. <view class="flex row2">
  69. <view class="left flex flex-space-between">
  70. <view class="ssx">
  71. {{$helper.getProvinceAbbreviation(good.sendPrivate?good.sendPrivate:good.sendCity)}}
  72. </view>
  73. <view class="level2-title">{{$helper.filterUrban(good.sendCity)}}
  74. {{$helper.filterArea(good.sendArea)}}
  75. </view>
  76. <view>
  77. <image class="jt-icon" src="@/static/images/goodSource/jt.png" mode='widthFix'>
  78. </image>
  79. </view>
  80. <view class="ssx">
  81. {{$helper.getProvinceAbbreviation(good.unloadPrivate?good.unloadPrivate:good.unloadCity)}}
  82. </view>
  83. <view class="level2-title">{{$helper.filterUrban(good.unloadCity)}}
  84. {{$helper.filterArea(good.unloadArea)}}
  85. </view>
  86. </view>
  87. </view>
  88. <view class="flex row3">
  89. <view class="left">
  90. <image class="hz" src="@/static/images/news/hz.png"></image>
  91. </view>
  92. <view class="right">
  93. <view class="flex row">
  94. <view>{{good.compName}}</view>
  95. <view class="sline"></view>
  96. <view style="min-width: 100rpx;">{{good.cargoOwner}}</view>
  97. </view>
  98. <view class="flex align-center">
  99. <view class="">运距 {{good.distance}}km</view>
  100. </view>
  101. </view>
  102. </view>
  103. <view class="row4 flex flex-end align-center">
  104. <view class="time">{{good.updateDate}}</view>
  105. <!-- 货主装车确认前运费 -->
  106. <view class="car"
  107. v-if="good.orderStatus=='待货主确认'||good.orderStatus=='未装车'||good.orderStatus=='待货主确认装车'||good.orderStatus=='货主驳回装车信息'||good.orderStatus=='已终止'">
  108. <!-- {{good.freightPrice?good.illingMethod==0?good.freight:good.freightCar:good.freight}}{{good.illingMethod==0?'元/吨':'元/车'}} -->
  109. <!-- {{good.billingMethod==0?good.freightInfo.freight?good.freightInfo.freight:good.freight:good.freightCar}}{{good.billingMethod==0?'元/吨':'元/车'}} -->
  110. {{good.freight}}{{good.billingMethod==0?'元/吨':'元/车'}}
  111. </view>
  112. <!-- 货主装车确认后卸车确认前运费 -->
  113. <view class="car"
  114. v-if="good.orderStatus=='待平台确认装车'||good.orderStatus=='平台驳回装车信息'||good.orderStatus=='运输中'||good.orderStatus=='待货主确认卸车'||good.orderStatus=='货主驳回卸车信息'">
  115. <!-- {{good.estimatedFreight}}{{good.illingMethod==0?'元/吨':'元/车'}} -->
  116. {{good.freight}}{{good.billingMethod==0?'元/吨':'元/车'}}
  117. </view>
  118. <!-- 货主装车卸车确认后 -->
  119. <view class="car"
  120. v-if="good.orderStatus=='待平台确认卸车'||good.orderStatus=='平台驳回卸车信息'||good.orderStatus=='待结算'||good.orderStatus=='已完结'||good.orderStatus=='结算中'||good.orderStatus=='待结算'">
  121. <!-- {{good.totalFreight}}{{good.illingMethod==0?'元/吨':'元/车'}} -->
  122. {{good.freight}}{{good.billingMethod==0?'元/吨':'元/车'}}
  123. </view>
  124. <!-- <view class='pay flex'
  125. v-if="good.orderStatus=='运输中'||good.orderStatus=='待货主确认卸车'||good.orderStatus=='待平台确认卸车'||good.orderStatus=='货主驳回卸车信息'||good.orderStatus=='平台驳回卸车信息'||good.orderStatus=='结算中'||good.orderStatus=='待结算'">
  126. <div>已付</div>
  127. <div class='number'>¥{{good.totalRepayable}}</div>
  128. <div class='number'>11</div>
  129. </view> -->
  130. </view>
  131. <view class="row5 flex flex-end">
  132. <view class="stop active" @click.stop="toggle(good)"
  133. v-if="good.orderStatus=='待货主确认'||good.orderStatus=='未装车'">终止</view>
  134. <!-- <view class="stop active" @click.stop="stop(good)"
  135. v-if="good.orderStatus=='待货主确认'||good.orderStatus=='未装车'">终止</view> -->
  136. <!-- <view class="start normal" @click.stop="confirmLoading(good)"
  137. v-if="good.orderStatus=='未装车'||good.orderStatus=='货主驳回装车信息'||good.orderStatus=='平台驳回装车信息'">
  138. 确认装车</view> -->
  139. <view class="start normal" @click.stop="toDetail(good)"
  140. v-if="good.orderStatus=='未装车'||good.orderStatus=='货主驳回装车信息'||good.orderStatus=='平台驳回装车信息'">
  141. 确认装车</view>
  142. <view class="start normal" v-if="good.orderStatus!='未装车'&&good.orderStatus!='待货主确认'"
  143. @click.stop="$helper.contactCustomerService()">联系客服
  144. </view>
  145. <view class="start normal" @click.stop="confirmUnLoading(good)"
  146. v-if="good.orderStatus=='运输中'||good.orderStatus=='货主驳回卸车信息'||good.orderStatus=='平台驳回卸车信息'">
  147. 确认卸车</view>
  148. <view class="start normal" @click.stop="closed(good)" v-if="good.orderStatus=='结算中'">完结
  149. </view>
  150. <view class="start normal" @click.stop="toDetail(good)" v-if="good.orderStatus=='待确认运费'">
  151. 确认运费
  152. </view>
  153. <!-- <view class="start normal" @click.stop="addevaluation(good)" v-if="good.orderStatus=='已完结'">评价</view> -->
  154. <view class="start normal" @click.stop="addevaluation(good)"
  155. v-if="good.orderStatus=='已完结' && good.driverEvaluated != 1">
  156. <!-- driverEvaluated 为1是已评价过-->
  157. 评价
  158. </view>
  159. </view>
  160. </view>
  161. </view>
  162. </mescroll-body>
  163. </view>
  164. <view v-else class="search-view">
  165. <view class="flex">
  166. <u-icon name="arrow-left" color="" size="20" class="back-icon" @click="back()"></u-icon>
  167. <u-search placeholder="可按编号、货主、收发地查找" placeholderColor="#AFB3BF" :actionStyle="textColor"
  168. bgColor="#F5F6FA" v-model="searchKeyWord" actionText='取消' @custom="cancel" @search="getSearch">
  169. </u-search>
  170. </view>
  171. <view class="near-search">
  172. <view class="flex flex-space-between">
  173. <view class="near-search-text">最近搜索</view>
  174. <u-icon name="trash-fill" color="#AFB3BF" size="20" class="back-icon" @click="del"></u-icon>
  175. </view>
  176. <view class="">
  177. <view v-for="(item,index) in useSearchList" :key="index" class="item-style inline-block"
  178. @click="getSearch(item)">
  179. {{item}}
  180. </view>
  181. </view>
  182. </view>
  183. </view>
  184. <u-modal :show="isShowAlert" :title="alertTitle" :content='alertContent' :closeOnClickOverlay='true'
  185. :showCancelButton='showCancelButton' confirmColor='#2772FB' @confirm="$u.throttle(confirmClick, 1000)"
  186. @close="cancelClick" @cancel="cancelClick">
  187. <view style="margin: 0 auto;">
  188. <u-radio-group v-model="radiovalue1" placement="" v-if='isShowTerminationReason'>
  189. <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
  190. :label="item.name" :name="item.name" @change="radioChange">
  191. </u-radio>
  192. </u-radio-group>
  193. </view>
  194. <u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'
  195. v-if='isShowTerminationReason'>
  196. </u--textarea>
  197. </u-modal>
  198. <!-- 普通弹窗 -->
  199. <u-popup :show="show" mode="bottom" @close="close" @open="open">
  200. <view class="u-popup-wrap">
  201. <view>
  202. <image style='width:12px;height:12px;' @click='closepopup' class='close'
  203. src="../../static/images/order/guanbi@3x.png" mode=""></image>
  204. <!-- <u-icon @click="closepopup" class='close' name="close" size="20"></u-icon> -->
  205. </view>
  206. <view style='fon-size:34rpx;margin-bottom:20px;text-align:center;font-weight: 600;'>确认终止订单</view>
  207. <view style="margin: 0 auto;">
  208. <u-radio-group iconPlacement="right" v-model="radiovalue1" placement=""
  209. v-if='isShowTerminationReason'>
  210. <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
  211. :label="item.name" :name="item.name" @change="radioChange">
  212. </u-radio>
  213. </u-radio-group>
  214. </view>
  215. <view style='border-top:10px solid #F2F4F7;position:absolute;left:0;height:0;width:100%;'></view>
  216. <view style='padding:40rpx 0 30rpx;'>终止原因描述</view>
  217. <u--textarea class="row" v-model="value2" placeholder="终止原因描述" count maxlength='50'
  218. v-if='isShowTerminationReason'>
  219. </u--textarea>
  220. <view class='termination' :class="{'active':value2.length>0}" @click='$u.throttle(confirmClick, 1000)'>
  221. 终止</view>
  222. </view>
  223. </u-popup>
  224. <u-toast ref="uToast"></u-toast>
  225. <!-- <view class="modal-black" v-show="showMenu" @click="closeMenu"></view> -->
  226. </view>
  227. </template>
  228. <script>
  229. var that
  230. import {
  231. mapState
  232. } from 'vuex';
  233. import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
  234. import {
  235. apiGoods
  236. } from "@/api/mock.js"
  237. import uniPopup from '@/components/uni-popup/uni-popup.vue'
  238. export default {
  239. components: {
  240. uniPopup
  241. },
  242. mixins: [MescrollMixin], // 使用mixin
  243. data() {
  244. return {
  245. confirmText: '确定',
  246. showCancelButton: true,
  247. showMenu: false,
  248. show: false,
  249. type: 'bottom',
  250. searchStyle: {
  251. background: "#317AFE",
  252. color: 'white',
  253. position: "absolute",
  254. right: "30rpx",
  255. padding: "6rpx 20rpx",
  256. "border-radius": '30rpx'
  257. },
  258. // isShowStopBtn: false,
  259. // isConfirmLoadingBtn:false,
  260. // isShowCustomerServiceBtn:false,
  261. // isConfirmUnLoadingBtn:false,
  262. // isClosedBtn:false,
  263. searchKeyWord: '',
  264. useSearchList: [],
  265. mescroll: null,
  266. isShowTerminationReason: false,
  267. id: '',
  268. value2: '',
  269. radiolist1: [{
  270. name: '已与货主协商',
  271. disabled: false
  272. },
  273. {
  274. name: '货主原因终止',
  275. disabled: false
  276. },
  277. {
  278. name: '司机个人原因终止',
  279. disabled: false
  280. }, {
  281. name: '其他',
  282. disabled: false
  283. }
  284. ],
  285. radiovalue1: '已与货主协商',
  286. confirmText: '终止',
  287. alertTitle: '确定终止订单?',
  288. alertContent: "",
  289. isShowAlert: false,
  290. textColor: {
  291. "color": "#AFB3BF"
  292. },
  293. isSearch: false,
  294. startPlace: '齐齐哈尔齐齐哈尔',
  295. endPlace: '全国',
  296. isdblclick: 0,
  297. goods: [], // 数据列表
  298. src: 'https://cdn.uviewui.com/uview/album/1.jpg',
  299. height: "", // 需要固定swiper的高度
  300. tabList: [{
  301. name: '全部'
  302. }, {
  303. name: '未发运'
  304. }, {
  305. name: '运输中'
  306. }, {
  307. name: '待收货'
  308. }, {
  309. name: '待结算'
  310. },
  311. {
  312. name: '已完结'
  313. },
  314. {
  315. name: '评价'
  316. },
  317. ],
  318. tabIndex: 0,
  319. scrollTop: 0
  320. }
  321. },
  322. computed: {
  323. ...mapState(['hasLogin', 'userInfo', 'firstAuthentication'])
  324. },
  325. onTabItemTap(e) {
  326. this.isdblclick++
  327. // tab 点击时执行,此处直接接收单击事件
  328. if (this.scrollTop > 1200) {
  329. if (this.isdblclick > 1) {
  330. uni.pageScrollTo({
  331. scrollTop: 0,
  332. duration: 300
  333. });
  334. }
  335. }
  336. },
  337. created() {
  338. //#ifdef APP-PLUS
  339. // this.getLngLat();
  340. //#endif
  341. },
  342. // async onLoad() {
  343. // that = this
  344. // // #ifdef APP-PLUS
  345. // let _status = await that.$request.baseRequest('get', '/driverInfo/firstAuthentication', {
  346. // driverPhone: this.userInfo.phone,
  347. // }).then(res => {
  348. // return res.data.authenticationStatus
  349. // })
  350. // // if (_status == '已禁用') {
  351. // // this.isShowAlert = true
  352. // // this.alertTitle = '账号审核中'
  353. // // this.confirmText = '退出APP'
  354. // // this.showCancelButton = false
  355. // // } else {
  356. // // console.log(1231233212332312312213)
  357. // // }
  358. // // #endif
  359. // },
  360. onHide() {
  361. this.isdblclick = 0
  362. },
  363. onShow() {
  364. if (this.scrollTop > 1200) {
  365. uni.setTabBarItem({
  366. index: 2,
  367. text: '返回顶部',
  368. iconPath: 'static/images/common/top@2x.png',
  369. selectedIconPath: 'static/images/common/top@2x.png'
  370. })
  371. }
  372. uni.setTabBarItem({
  373. index: 0,
  374. text: '货源',
  375. iconPath: 'static/images/common/huoyuan@2x(1).png',
  376. selectedIconPath: 'static/images/common/huoyuan@2x.png'
  377. })
  378. var that = this
  379. that.$request.baseRequest('get', '/newsInfo/unreadMessage', {
  380. reCommonId: this.userInfo.id,
  381. }).then(res3 => {
  382. if (res3.data || res3.data == 0) {
  383. let name = 'myTip';
  384. let value = res3.data
  385. if (value == 0) {
  386. uni.removeTabBarBadge({
  387. index: 3
  388. })
  389. }
  390. that.$store.commit('$uStore', {
  391. name,
  392. value
  393. });
  394. if (value != 0 && value) {
  395. uni.setTabBarBadge({
  396. index: 3,
  397. text: value + ""
  398. })
  399. }
  400. }
  401. })
  402. this.upCallback({
  403. size: 10,
  404. num: 1
  405. })
  406. },
  407. onPageScroll(res) {
  408. this.scrollTop = res.scrollTop
  409. // console.log("页面滚动了", res.scrollTop)
  410. if (this.scrollTop > 1200) {
  411. uni.setTabBarItem({
  412. index: 2,
  413. text: '返回顶部',
  414. iconPath: 'static/images/common/top@2x.png',
  415. selectedIconPath: 'static/images/common/top@2x.png'
  416. })
  417. } else {
  418. uni.setTabBarItem({
  419. index: 2,
  420. text: '订单',
  421. iconPath: 'static/images/common/dingdan@2x(1).png',
  422. selectedIconPath: 'static/images/common/dingdan@2x.png'
  423. })
  424. }
  425. },
  426. methods: {
  427. moveHandle() {
  428. // this.closeMenu()
  429. // console.log(1111)
  430. },
  431. closepopup() {
  432. this.show = false
  433. },
  434. toggle(item) {
  435. this.id = item.id
  436. if (item.orderStatusKey == 1) {
  437. this.isShowTerminationReason = false
  438. } else {
  439. this.isShowTerminationReason = true
  440. }
  441. if (item.orderStatus == '未装车') {
  442. this.show = true
  443. } else {
  444. this.isShowAlert = true
  445. }
  446. },
  447. open() {
  448. // console.log('open');
  449. },
  450. close() {
  451. this.show = false
  452. // console.log('close');
  453. },
  454. addevaluation(good) {
  455. uni.$u.route('/pages/order/addEvaluation', {
  456. val: JSON.stringify(good)
  457. });
  458. },
  459. evaluateClick() {
  460. //我的评价记录
  461. uni.$u.route('/pages/order/evaluateList');
  462. },
  463. closeMenu() {
  464. this.showMenu = false
  465. },
  466. // 完结
  467. closed(item) {
  468. this.$request.baseRequest('post', '/orderInfo/api/editEnd', {
  469. id: item.id,
  470. }).then(res => {
  471. if (res.code == 200) {
  472. this.$refs.uToast.show({
  473. type: 'success',
  474. message: "提交成功",
  475. complete() {
  476. that.upCallback({
  477. size: 10,
  478. num: 1
  479. })
  480. }
  481. })
  482. }
  483. })
  484. .catch(res => {
  485. uni.$u.toast(res.message);
  486. });
  487. },
  488. confirmLoading(item) {
  489. uni.$u.route('/pages/order/confirmLoading', item);
  490. },
  491. confirmUnLoading(item) {
  492. uni.$u.route('/pages/order/confirmUnloading', {
  493. obj: JSON.stringify(item)
  494. });
  495. },
  496. back() {
  497. uni.navigateBack(-1)
  498. },
  499. mescrollInit(mescroll) {
  500. this.mescroll = mescroll;
  501. },
  502. radioChange(n) {
  503. console.log('radioChange', n);
  504. },
  505. stop(item) {
  506. // 货主接单
  507. if (item.orderStatusKey == 1) {
  508. this.isShowTerminationReason = false
  509. } else {
  510. this.isShowTerminationReason = true
  511. }
  512. this.id = item.id
  513. this.isShowAlert = true
  514. },
  515. init() {
  516. },
  517. del() {
  518. this.isShowAlert = true
  519. this.alertTitle = '确定删除全部历史记录?'
  520. this.confirmText = '确定'
  521. },
  522. confirmClick() {
  523. // #ifdef APP-PLUS
  524. if (this.alertTitle == '账号审核中') {
  525. if (uni.getSystemInfoSync().platform == 'ios') {
  526. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  527. } else if (uni.getSystemInfoSync().platform == 'android') {
  528. plus.runtime.quit();
  529. }
  530. return
  531. }
  532. // #endif
  533. var that = this
  534. if (this.alertTitle == '确定删除全部历史记录?') {
  535. uni.removeStorageSync('useSearchList');
  536. this.useSearchList = [];
  537. this.isShowAlert = false
  538. } else {
  539. console.log('终止', this.radiovalue1 == '其他' && !this.value2)
  540. if (this.radiovalue1 == '其他' && !this.value2) {
  541. uni.showToast({
  542. title: '请填写终止原因描述',
  543. icon: 'none',
  544. duration: 2000
  545. });
  546. return
  547. }
  548. let _terminationReason = ''
  549. if (this.radiovalue1 == '已与货主协商') {
  550. _terminationReason = 1
  551. } else if (this.radiovalue1 == '货主原因终止') {
  552. _terminationReason = 2
  553. } else if (this.radiovalue1 == '司机个人原因终止') {
  554. _terminationReason = 3
  555. } else if (this.radiovalue1 == '其他') {
  556. _terminationReason = 4
  557. }
  558. this.$request.baseRequest('post', '/orderInfo/api/end', {
  559. id: this.id,
  560. terminator: 1,
  561. terminationReason: _terminationReason,
  562. terminationReasonDescription: this.value2
  563. }).then(res => {
  564. console.log(res)
  565. if (res.code == 200) {
  566. this.$refs.uToast.show({
  567. type: 'success',
  568. message: "终止订单成功",
  569. complete() {
  570. that.mescroll.resetUpScroll()
  571. }
  572. })
  573. } else {
  574. uni.$u.toast("终止订单失败!");
  575. }
  576. this.show = false
  577. this.isShowAlert = false
  578. })
  579. .catch(res => {
  580. uni.$u.toast(res.message);
  581. });
  582. }
  583. },
  584. cancelClick() {
  585. this.isShowAlert = false
  586. },
  587. getSearch(e) {
  588. console.log(e)
  589. if (!e) {
  590. this.$refs.uToast.show({
  591. type: 'error',
  592. message: "搜索内容不能为空!",
  593. })
  594. return
  595. }
  596. this.useSearchList.unshift(e)
  597. this.useSearchList = [...new Set(this.useSearchList)]
  598. uni.setStorageSync("useSearchList", this.useSearchList)
  599. if (this.useSearchList.length > 9) {
  600. this.carList.splice(this.useSearchList.length, 1)
  601. }
  602. console.log("点击搜索", e)
  603. this.upCallback({
  604. size: 10,
  605. num: 1
  606. })
  607. },
  608. cancel() {
  609. this.isSearch = false
  610. },
  611. toDetail(item) {
  612. if (item.orderStatus != '待货主确认') {
  613. uni.$u.route('/pages/order/orderDetails', {
  614. id: item.id,
  615. });
  616. }
  617. },
  618. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  619. upCallback(page) {
  620. // uni.$u.sleep(300).then(() => {
  621. uni.showLoading({
  622. mask: true,
  623. title: '加载中'
  624. })
  625. // })
  626. // 此处可以继续请求其他接口
  627. // if(page.num == 1){
  628. // // 请求其他接口...
  629. // }
  630. // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
  631. // if(!this.isInitxx){
  632. // apiGetxx().then(res=>{
  633. // this.isInitxx = true
  634. // this.mescroll.resetUpScroll() // 重新触发upCallback
  635. // }).catch(()=>{
  636. // this.mescroll.endErr()
  637. // })
  638. // return // 此处return,先获取xx
  639. // }
  640. // 订单状态12345
  641. this.$request.baseRequest('get', '/orderInfo/selectOrderInfo', {
  642. commonId: this.userInfo.id,
  643. searchKeyWord: this.searchKeyWord,
  644. searchType: this.searchType,
  645. pageSize: page.size,
  646. currentPage: page.num
  647. }).then(res => {
  648. this.isSearch = false
  649. if (page.num == 1) this.goods = []; //如果是第一页需手动制空列表
  650. this.goods = this.goods.concat(res.data.records); //追加新数据
  651. this.mescroll.endBySize(res.data.records.length, res.data.total);
  652. this.searchKeyWord = "" //搜索完成之后清空筛选内容
  653. })
  654. .catch(res => {
  655. uni.$u.toast(res.message);
  656. });
  657. uni.$u.sleep(500).then(() => {
  658. uni.hideLoading()
  659. })
  660. },
  661. clickTab(val) {
  662. uni.showLoading({
  663. mask: true
  664. })
  665. console.log(val)
  666. this.searchType = val.index
  667. this.tabIndex = val.index
  668. this.upCallback({
  669. size: 10,
  670. num: 1
  671. })
  672. this.showMenu = false
  673. },
  674. search() {
  675. this.isSearch = true
  676. //获取缓存搜索数据
  677. this.useSearchList = uni.getStorageSync('useSearchList')
  678. if (!this.useSearchList) this.useSearchList = [];
  679. }
  680. }
  681. }
  682. </script>
  683. <style scoped lang="scss">
  684. .banner {
  685. width: 100%;
  686. position: relative;
  687. }
  688. .fixed,
  689. .fixed1 {
  690. background: white;
  691. position: fixed;
  692. top: var(--status-bar-height);
  693. z-index: 999;
  694. width: 100%;
  695. }
  696. /deep/.u-popup__content {
  697. border-radius: 10px;
  698. // padding:20px;
  699. }
  700. .fixed {
  701. .title {
  702. background: white;
  703. position: relative;
  704. font-size: 36rpx;
  705. font-weight: 500;
  706. color: rgba(0, 0, 0, 0.85);
  707. .search {
  708. position: absolute;
  709. right: 20rpx;
  710. }
  711. }
  712. }
  713. .fixed1 {
  714. top: 0;
  715. height: var(--status-bar-height);
  716. background: white;
  717. }
  718. .banner-img {
  719. width: 100%;
  720. }
  721. .head {
  722. position: absolute;
  723. width: calc(100% - 108rpx);
  724. bottom: 0;
  725. background: white;
  726. margin: 0 20rpx;
  727. border-radius: 20rpx;
  728. .item1,
  729. .item3 {
  730. width: 40%;
  731. .text {
  732. text-overflow: ellipsis;
  733. overflow: hidden;
  734. white-space: nowrap;
  735. }
  736. }
  737. .item1 .text {
  738. text-align: left;
  739. }
  740. .item3 .text {
  741. text-align: right;
  742. }
  743. }
  744. .change-btn {
  745. width: 86rpx;
  746. height: 86rpx;
  747. }
  748. .good-list {
  749. background-color: white;
  750. margin: 20rpx;
  751. padding: 20rpx 0rpx 0 0;
  752. border-radius: 20rpx;
  753. .row1 {
  754. font-size: 26rpx;
  755. .item1 {
  756. color: #333333;
  757. }
  758. .item2 {
  759. color: #FE6300;
  760. }
  761. }
  762. .row2 {
  763. margin: 30rpx 0;
  764. }
  765. .row3 {
  766. background: #F5F6FA;
  767. padding: 20rpx;
  768. border-radius: 10rpx;
  769. color: #333333;
  770. .hz {
  771. width: 74rpx;
  772. height: 74rpx;
  773. margin-right: 30rpx;
  774. }
  775. }
  776. .row4 {
  777. margin: 20rpx 0;
  778. .time {
  779. color: #999999;
  780. margin-right: 20rpx;
  781. }
  782. .car {
  783. color: #000000;
  784. }
  785. .pay {
  786. margin-left: 20rpx;
  787. .number {
  788. color: #FE6300;
  789. margin-left: 20rpx;
  790. }
  791. }
  792. }
  793. .row5 {
  794. margin: 20rpx 0;
  795. font-size: 28rpx;
  796. .stop {
  797. border-radius: 33px;
  798. border: 1px solid #FE6300;
  799. padding: 13rpx 31rpx;
  800. margin-right: 20rpx;
  801. color: #FE6300;
  802. }
  803. .normal {
  804. border: 1px solid #CDCDCD;
  805. border-radius: 33px;
  806. padding: 13rpx 31rpx;
  807. margin: 0 10rpx;
  808. }
  809. }
  810. }
  811. .jt-icon {
  812. position: relative;
  813. top: 6rpx;
  814. width: 60rpx;
  815. margin: 0 20rpx;
  816. }
  817. .row {
  818. margin: 10rpx 0;
  819. align-items: center;
  820. }
  821. // .item-bottom {
  822. // background: #F0F5FF;
  823. // padding: 0 30rpx;
  824. // .name {
  825. // font-size: 26rpx;
  826. // font-weight: 700;
  827. // color: #000000;
  828. // margin-left: 30rpx;
  829. // }
  830. // .hp {
  831. // margin: 30rpx;
  832. // }
  833. // .number-color {
  834. // margin: 0 10rpx;
  835. // }
  836. // .qd {
  837. // background: linear-gradient(97deg, #4FABFD 0%, #2772FB 100%);
  838. // border-radius: 13px;
  839. // font-size: 29rpx;
  840. // font-weight: 400;
  841. // color: #FFFFFF;
  842. // padding: 10rpx 35rpx;
  843. // }
  844. // }
  845. .dw {
  846. align-items: center;
  847. }
  848. .mescroll {
  849. margin-top: calc(var(--status-bar-height) + 140rpx);
  850. }
  851. .sline {
  852. height: 28rpx;
  853. width: 1px;
  854. background: black;
  855. margin: 0 10rpx;
  856. }
  857. .search-view {
  858. margin-top: var(--status-bar-height);
  859. background: white;
  860. padding: 0 20rpx;
  861. }
  862. .back-icon {
  863. margin-right: 20rpx;
  864. }
  865. .near-search-text {
  866. margin: 20rpx 0;
  867. }
  868. .item-style {
  869. margin-top: 20rpx;
  870. background: #F5F6FA;
  871. padding: 11rpx 24rpx;
  872. margin-right: 20rpx;
  873. border-radius: 10px;
  874. font-size: 26rpx;
  875. color: #333333;
  876. }
  877. /deep/.u-modal__content {
  878. flex-direction: column;
  879. }
  880. .tab-content {
  881. position: relative;
  882. padding-right: 100rpx;
  883. }
  884. .right-btn {
  885. position: absolute;
  886. background: #F3F3F3;
  887. // box-shadow: -14px 0px 8px -8px rgba(0, 53, 149, 0.21);
  888. display: flex;
  889. right: 20rpx;
  890. height: 60rpx;
  891. top: 0;
  892. bottom: 0;
  893. margin: auto;
  894. color: #333333;
  895. align-items: center;
  896. justify-content: center;
  897. padding: 0rpx 20rpx;
  898. box-sizing: border-box;
  899. border-radius: 6rpx;
  900. }
  901. .all-menu {
  902. position: absolute;
  903. z-index: 99;
  904. top: 136rrpx;
  905. }
  906. /deep/.u-transition {
  907. border-radius: 0 0 50rpx 50rpx;
  908. }
  909. .transition {
  910. background: white;
  911. padding-bottom: 40rpx;
  912. .transition-item-style {
  913. display: inline-block;
  914. width: calc(25% - 40rpx);
  915. text-align: center;
  916. box-sizing: border-box;
  917. background: #F7F8FA;
  918. border-radius: 6px;
  919. margin: 20rpx 20rpx 0 20rpx;
  920. padding: 22rpx 0;
  921. font-size: 26rpx;
  922. }
  923. .menu-active {
  924. background: #2772FB;
  925. color: white;
  926. }
  927. }
  928. .modal-black {
  929. background: black;
  930. height: 100vh;
  931. width: 100vw;
  932. position: fixed;
  933. z-index: 999;
  934. opacity: 0.3;
  935. }
  936. .all-menu {
  937. position: fixed;
  938. z-index: 99;
  939. top: 136rpx;
  940. }
  941. .menu-active {
  942. background: #2772FB;
  943. color: white;
  944. }
  945. .evaluatePage {
  946. background: white;
  947. margin: 20rpx;
  948. padding: 20rpx;
  949. border-radius: 20rpx;
  950. }
  951. /deep/.u-radio {
  952. margin: 40rpx 0;
  953. }
  954. .close {
  955. position: absolute;
  956. right: 20px;
  957. top: 26px;
  958. }
  959. .termination {
  960. background: #F1F3F6;
  961. color: #C5CAD4;
  962. padding: 10px;
  963. border-radius: 30px;
  964. text-align: center;
  965. margin-top: 30rpx;
  966. }
  967. .termination.active {
  968. background: #2772FB;
  969. color: white;
  970. }
  971. .u-popup-wrap {
  972. padding: 20px;
  973. }
  974. </style>