index.vue 25 KB

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