index.vue 26 KB

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