index.vue 26 KB

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