index.vue 26 KB

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