index.vue 27 KB

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