index.vue 25 KB

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