index.vue 26 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013
  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=!showMenu">
  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. // this.closeMenu()
  388. // console.log(1111)
  389. },
  390. closepopup(){
  391. this.show=false
  392. },
  393. toggle(item){
  394. this.id = item.id
  395. if (item.orderStatusKey == 1) {
  396. this.isShowTerminationReason = false
  397. } else {
  398. this.isShowTerminationReason = true
  399. }
  400. if(item.orderStatus=='未装车'){
  401. this.show = true
  402. }else{
  403. this.isShowAlert=true
  404. }
  405. },
  406. open() {
  407. // console.log('open');
  408. },
  409. close() {
  410. this.show = false
  411. // console.log('close');
  412. },
  413. addevaluation(good) {
  414. uni.$u.route('/pages/order/addEvaluation', {
  415. val: JSON.stringify(good)
  416. });
  417. },
  418. evaluateClick() {
  419. //我的评价记录
  420. uni.$u.route('/pages/order/evaluateList');
  421. },
  422. closeMenu() {
  423. this.showMenu = false
  424. },
  425. // 完结
  426. closed(item) {
  427. this.$request.baseRequest('post', '/orderInfo/api/editEnd', {
  428. id: item.id,
  429. }).then(res => {
  430. if (res.code == 200) {
  431. this.$refs.uToast.show({
  432. type: 'success',
  433. message: "提交成功",
  434. complete() {
  435. that.upCallback({
  436. size: 10,
  437. num: 1
  438. })
  439. }
  440. })
  441. }
  442. })
  443. .catch(res => {
  444. uni.$u.toast(res.message);
  445. });
  446. },
  447. confirmLoading(item) {
  448. uni.$u.route('/pages/order/confirmLoading', item);
  449. },
  450. confirmUnLoading(item) {
  451. uni.$u.route('/pages/order/confirmUnloading', {
  452. obj: JSON.stringify(item)
  453. });
  454. },
  455. back() {
  456. uni.navigateBack(-1)
  457. },
  458. mescrollInit(mescroll) {
  459. this.mescroll = mescroll;
  460. },
  461. radioChange(n) {
  462. console.log('radioChange', n);
  463. },
  464. stop(item) {
  465. // 货主接单
  466. if (item.orderStatusKey == 1) {
  467. this.isShowTerminationReason = false
  468. } else {
  469. this.isShowTerminationReason = true
  470. }
  471. this.id = item.id
  472. this.isShowAlert = true
  473. },
  474. init() {
  475. },
  476. del() {
  477. this.isShowAlert = true
  478. this.alertTitle = '确定删除全部历史记录?'
  479. this.confirmText = '确定'
  480. },
  481. confirmClick() {
  482. // #ifdef APP-PLUS
  483. if (this.alertTitle == '账号审核中') {
  484. if (uni.getSystemInfoSync().platform == 'ios') {
  485. plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
  486. } else if (uni.getSystemInfoSync().platform == 'android') {
  487. plus.runtime.quit();
  488. }
  489. return
  490. }
  491. // #endif
  492. var that =this
  493. if (this.alertTitle == '确定删除全部历史记录?') {
  494. uni.removeStorageSync('useSearchList');
  495. this.useSearchList = [];
  496. this.isShowAlert = false
  497. } else {
  498. console.log('终止', this.radiovalue1 == '其他' && !this.value2)
  499. if (this.radiovalue1 == '其他' && !this.value2) {
  500. uni.showToast({
  501. title: '请填写终止原因描述',
  502. icon: 'none',
  503. duration: 2000
  504. });
  505. return
  506. }
  507. let _terminationReason = ''
  508. if (this.radiovalue1 == '已与货主协商') {
  509. _terminationReason = 1
  510. } else if (this.radiovalue1 == '货主原因终止') {
  511. _terminationReason = 2
  512. } else if (this.radiovalue1 == '司机个人原因终止') {
  513. _terminationReason = 3
  514. } else if (this.radiovalue1 == '其他') {
  515. _terminationReason = 4
  516. }
  517. this.$request.baseRequest('post', '/orderInfo/api/end', {
  518. id: this.id,
  519. terminator: 1,
  520. terminationReason: _terminationReason,
  521. terminationReasonDescription: this.value2
  522. }).then(res => {
  523. console.log(res)
  524. if (res.code == 200) {
  525. this.$refs.uToast.show({
  526. type: 'success',
  527. message: "终止订单成功",
  528. complete() {
  529. that.mescroll.resetUpScroll()
  530. }
  531. })
  532. } else {
  533. uni.$u.toast("终止订单失败!");
  534. }
  535. this.show=false
  536. this.isShowAlert = false
  537. })
  538. .catch(res => {
  539. uni.$u.toast(res.message);
  540. });
  541. }
  542. },
  543. cancelClick() {
  544. this.isShowAlert = false
  545. },
  546. getSearch(e) {
  547. console.log(e)
  548. if(!e){
  549. this.$refs.uToast.show({
  550. type: 'error',
  551. message: "搜索内容不能为空!",
  552. })
  553. return
  554. }
  555. this.useSearchList.unshift(e)
  556. this.useSearchList = [...new Set(this.useSearchList)]
  557. uni.setStorageSync("useSearchList", this.useSearchList)
  558. if (this.useSearchList.length > 9) {
  559. this.carList.splice(this.useSearchList.length, 1)
  560. }
  561. console.log("点击搜索", e)
  562. this.upCallback({
  563. size: 10,
  564. num: 1
  565. })
  566. },
  567. cancel() {
  568. this.isSearch = false
  569. },
  570. toDetail(item) {
  571. if(item.orderStatus!='待货主确认'){
  572. uni.$u.route('/pages/order/orderDetails', {
  573. id: item.id,
  574. });
  575. }
  576. },
  577. /*上拉加载的回调: 其中page.num:当前页 从1开始, page.size:每页数据条数,默认10 */
  578. upCallback(page) {
  579. // uni.$u.sleep(300).then(() => {
  580. uni.showLoading({
  581. mask: true,
  582. title: '加载中'
  583. })
  584. // })
  585. // 此处可以继续请求其他接口
  586. // if(page.num == 1){
  587. // // 请求其他接口...
  588. // }
  589. // 如果希望先请求其他接口,再触发upCallback,可参考以下写法
  590. // if(!this.isInitxx){
  591. // apiGetxx().then(res=>{
  592. // this.isInitxx = true
  593. // this.mescroll.resetUpScroll() // 重新触发upCallback
  594. // }).catch(()=>{
  595. // this.mescroll.endErr()
  596. // })
  597. // return // 此处return,先获取xx
  598. // }
  599. // 订单状态12345
  600. this.$request.baseRequest('get', '/orderInfo/selectOrderInfo', {
  601. commonId: this.userInfo.id,
  602. searchKeyWord: this.searchKeyWord,
  603. searchType: this.searchType,
  604. pageSize: page.size,
  605. currentPage: page.num
  606. }).then(res => {
  607. this.isSearch = false
  608. if (page.num == 1) this.goods = []; //如果是第一页需手动制空列表
  609. this.goods = this.goods.concat(res.data.records); //追加新数据
  610. this.mescroll.endBySize(res.data.records.length, res.data.total);
  611. this.searchKeyWord = ""//搜索完成之后清空筛选内容
  612. })
  613. .catch(res => {
  614. uni.$u.toast(res.message);
  615. });
  616. uni.$u.sleep(500).then(() => {
  617. uni.hideLoading()
  618. })
  619. },
  620. clickTab(val) {
  621. uni.showLoading({
  622. mask: true
  623. })
  624. console.log(val)
  625. this.searchType = val.index
  626. this.tabIndex = val.index
  627. this.upCallback({
  628. size: 10,
  629. num: 1
  630. })
  631. this.showMenu = false
  632. },
  633. search() {
  634. this.isSearch = true
  635. //获取缓存搜索数据
  636. this.useSearchList = uni.getStorageSync('useSearchList')
  637. if (!this.useSearchList) this.useSearchList = [];
  638. }
  639. }
  640. }
  641. </script>
  642. <style scoped lang="scss">
  643. .banner {
  644. width: 100%;
  645. position: relative;
  646. }
  647. .fixed,
  648. .fixed1 {
  649. background: white;
  650. position: fixed;
  651. top: var(--status-bar-height);
  652. z-index: 999;
  653. width: 100%;
  654. }
  655. /deep/.u-popup__content{
  656. border-radius: 10px;
  657. // padding:20px;
  658. }
  659. .fixed {
  660. .title {
  661. background: white;
  662. position: relative;
  663. font-size: 36rpx;
  664. font-weight: 500;
  665. color: rgba(0, 0, 0, 0.85);
  666. .search {
  667. position: absolute;
  668. right: 20rpx;
  669. }
  670. }
  671. }
  672. .fixed1 {
  673. top: 0;
  674. height: var(--status-bar-height);
  675. background: white;
  676. }
  677. .banner-img {
  678. width: 100%;
  679. }
  680. .head {
  681. position: absolute;
  682. width: calc(100% - 108rpx);
  683. bottom: 0;
  684. background: white;
  685. margin: 0 20rpx;
  686. border-radius: 20rpx;
  687. .item1,
  688. .item3 {
  689. width: 40%;
  690. .text {
  691. text-overflow: ellipsis;
  692. overflow: hidden;
  693. white-space: nowrap;
  694. }
  695. }
  696. .item1 .text {
  697. text-align: left;
  698. }
  699. .item3 .text {
  700. text-align: right;
  701. }
  702. }
  703. .change-btn {
  704. width: 86rpx;
  705. height: 86rpx;
  706. }
  707. .good-list {
  708. background-color: white;
  709. margin: 20rpx;
  710. padding: 20rpx 0rpx 0 0;
  711. border-radius: 20rpx;
  712. .row1 {
  713. font-size: 26rpx;
  714. .item1 {
  715. color: #333333;
  716. }
  717. .item2 {
  718. color: #FE6300;
  719. }
  720. }
  721. .row2 {
  722. margin: 30rpx 0;
  723. }
  724. .row3 {
  725. background: #F5F6FA;
  726. padding: 20rpx;
  727. border-radius: 10rpx;
  728. color: #333333;
  729. .hz {
  730. width: 74rpx;
  731. height: 74rpx;
  732. margin-right: 30rpx;
  733. }
  734. }
  735. .row4 {
  736. margin: 20rpx 0;
  737. .time {
  738. color: #999999;
  739. margin-right: 20rpx;
  740. }
  741. .car {
  742. color: #000000;
  743. }
  744. .pay {
  745. margin-left: 20rpx;
  746. .number {
  747. color: #FE6300;
  748. margin-left: 20rpx;
  749. }
  750. }
  751. }
  752. .row5 {
  753. margin: 20rpx 0;
  754. font-size: 28rpx;
  755. .stop {
  756. border-radius: 33px;
  757. border: 1px solid #FE6300;
  758. padding: 13rpx 31rpx;
  759. margin-right: 20rpx;
  760. color: #FE6300;
  761. }
  762. .normal {
  763. border: 1px solid #CDCDCD;
  764. border-radius: 33px;
  765. padding: 13rpx 31rpx;
  766. margin: 0 10rpx;
  767. }
  768. }
  769. }
  770. .jt-icon {
  771. position: relative;
  772. top: 6rpx;
  773. width: 60rpx;
  774. margin: 0 20rpx;
  775. }
  776. .row {
  777. margin: 10rpx 0;
  778. align-items: center;
  779. }
  780. // .item-bottom {
  781. // background: #F0F5FF;
  782. // padding: 0 30rpx;
  783. // .name {
  784. // font-size: 26rpx;
  785. // font-weight: 700;
  786. // color: #000000;
  787. // margin-left: 30rpx;
  788. // }
  789. // .hp {
  790. // margin: 30rpx;
  791. // }
  792. // .number-color {
  793. // margin: 0 10rpx;
  794. // }
  795. // .qd {
  796. // background: linear-gradient(97deg, #4FABFD 0%, #2772FB 100%);
  797. // border-radius: 13px;
  798. // font-size: 29rpx;
  799. // font-weight: 400;
  800. // color: #FFFFFF;
  801. // padding: 10rpx 35rpx;
  802. // }
  803. // }
  804. .dw {
  805. align-items: center;
  806. }
  807. .mescroll {
  808. margin-top: calc(var(--status-bar-height) + 140rpx);
  809. }
  810. .sline {
  811. height: 28rpx;
  812. width: 1px;
  813. background: black;
  814. margin: 0 10rpx;
  815. }
  816. .search-view {
  817. margin-top: var(--status-bar-height);
  818. background: white;
  819. padding: 0 20rpx;
  820. }
  821. .back-icon {
  822. margin-right: 20rpx;
  823. }
  824. .near-search-text {
  825. margin: 20rpx 0;
  826. }
  827. .item-style {
  828. margin-top: 20rpx;
  829. background: #F5F6FA;
  830. padding: 11rpx 24rpx;
  831. margin-right: 20rpx;
  832. border-radius: 10px;
  833. font-size: 26rpx;
  834. color: #333333;
  835. }
  836. /deep/.u-modal__content {
  837. flex-direction: column;
  838. }
  839. .tab-content {
  840. position: relative;
  841. padding-right: 200rpx;
  842. }
  843. .right-btn {
  844. position: absolute;
  845. background: #F3F3F3;
  846. // box-shadow: -14px 0px 8px -8px rgba(0, 53, 149, 0.21);
  847. display: flex;
  848. right: 20rpx;
  849. height: 60rpx;
  850. top: 0;
  851. bottom: 0;
  852. margin: auto;
  853. color: #333333;
  854. align-items: center;
  855. justify-content: center;
  856. padding: 0rpx 20rpx;
  857. box-sizing: border-box;
  858. border-radius: 6rpx;
  859. }
  860. .all-menu {
  861. position: absolute;
  862. z-index: 99;
  863. top: 136rrpx;
  864. }
  865. /deep/.u-transition {
  866. border-radius: 0 0 50rpx 50rpx;
  867. }
  868. .transition {
  869. background: white;
  870. padding-bottom: 40rpx;
  871. .transition-item-style {
  872. display: inline-block;
  873. width: calc(25% - 40rpx);
  874. text-align: center;
  875. box-sizing: border-box;
  876. background: #F7F8FA;
  877. border-radius: 6px;
  878. margin: 20rpx 20rpx 0 20rpx;
  879. padding: 16rpx 0;
  880. }
  881. .menu-active {
  882. background: #2772FB;
  883. color: white;
  884. }
  885. }
  886. .modal-black {
  887. background: black;
  888. height: 100vh;
  889. width: 100vw;
  890. position: fixed;
  891. z-index: 999;
  892. opacity: 0.3;
  893. }
  894. .all-menu {
  895. position: fixed;
  896. z-index: 99;
  897. top: 200rpx;
  898. }
  899. .menu-active {
  900. background: #2772FB;
  901. color: white;
  902. }
  903. .evaluatePage {
  904. background: white;
  905. margin: 20rpx;
  906. padding: 20rpx;
  907. border-radius: 20rpx;
  908. }
  909. /deep/.u-radio{
  910. margin:40rpx 0;
  911. }
  912. .close{
  913. position:absolute;
  914. right:20px;
  915. top:26px;
  916. }
  917. .termination{
  918. background:#F1F3F6;
  919. color:#C5CAD4;
  920. padding:10px;
  921. border-radius:30px;
  922. text-align: center;
  923. margin-top:30rpx;
  924. }
  925. .termination.active{
  926. background: #2772FB;
  927. color: white;
  928. }
  929. .u-popup-wrap{
  930. padding:20px;
  931. }
  932. </style>