order.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277
  1. <template>
  2. <view class="content">
  3. <view class="order-title">
  4. <view class="body-title">
  5. <view class="goback-box" @click="toBack">
  6. <image class="goback" src="../../static/icon/fanhui.png" mode=""></image>
  7. </view>
  8. <view class="header">我的订单</view>
  9. </view>
  10. <view class="roder-content">
  11. <view class="left" :class="{ current: currentIndex === index }" :key="index"
  12. v-for="(item, index) in maiList" @click="navGo(index)">{{ item.title }}</view>
  13. </view>
  14. </view>
  15. <view class="navbar" v-show="currentIndex == 0">
  16. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  17. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index, 0)">
  18. {{ item.text }}
  19. <view class="dian" v-if="tabCurrentIndex != index && item.isnew == 2"></view>
  20. </view>
  21. </view>
  22. <view class="navbar" v-show="currentIndex == 1">
  23. <view v-for="(item, index) in navList1" :key="index" class="nav-item"
  24. :class="{ current: tabCurrentIndex1 === index }" @click="tabClick(index, 1)">
  25. {{ item.text }}
  26. <view class="dian" v-if="tabCurrentIndex1 != index && item.isnew == 2"></view>
  27. </view>
  28. </view>
  29. <swiper :current="currentAuto" class="swiper-box-one" duration="0" @change="changeTab">
  30. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"
  31. v-if="currentIndex == 0">
  32. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  33. <!-- 空白页 -->
  34. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  35. <!-- 订单列表 -->
  36. <view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item"
  37. @click="goToOrderDetail(item)">
  38. <view class="i-top b-b">
  39. <text class="time">{{ item.order_id }}</text>
  40. <text class="state" :style="{ color: item.stateTipColor }">{{ item.stateTip }}</text>
  41. </view>
  42. <view class="goods-box-single">
  43. <image class="goods-img" :src="item.image" mode="aspectFill"></image>
  44. <view class="right">
  45. <text class="title clamp">{{ item.name }}</text>
  46. <text class="attr-box">x1</text>
  47. <text class="price">{{ moneyNum(item.price) }}</text>
  48. </view>
  49. </view>
  50. <view class="price-box">
  51. <text class="num">1</text>
  52. 件商品 邮费
  53. <text class="price">0</text>
  54. 实付款
  55. <text class="price">{{ moneyNum(item.price) }}</text>
  56. </view>
  57. <view class="action-box b-t" v-if="item.stateTip == '待支付'"><button @click.stop="pay(item)"
  58. class="action-btn recom">立即支付</button></view>
  59. <view class="action-box b-t" v-if="item.stateTip == '待审核'"><button @click.stop="pay(item)"
  60. class="action-btn recom">修改凭证</button></view>
  61. <view class="action-box b-t" v-if="item.stateTip == '待挂售' && tabItem.state != 0">
  62. <button @click.stop="gsell(item)"
  63. class="action-btn recom">{{ item.frozen == 0 ? '立即挂售' : '冻结中' }}</button>
  64. </view>
  65. </view>
  66. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  67. </scroll-view>
  68. </swiper-item>
  69. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList1" :key="tabIndex"
  70. v-if="currentIndex == 1" @click="goToOrderDetail(item)">
  71. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  72. <!-- 空白页 -->
  73. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  74. <!-- 订单列表 -->
  75. <view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
  76. <view class="i-top b-b">
  77. <text class="time">{{ item.order_id ? item.order_id : item.order }}</text>
  78. <text class="state" :style="{ color: item.stateTipColor }">{{ item.stateTip }}</text>
  79. </view>
  80. <view class="goods-box-single">
  81. <image class="goods-img" :src="item.image" mode="scaleToFill"></image>
  82. <view class="right">
  83. <view class="flex-start">
  84. <text class="title clamp">{{ item.name }}</text>
  85. <text class="price">{{ item.price | moneyNum }}</text>
  86. </view>
  87. <view class="row flex" v-if="!item.status && item.status != 0">
  88. <text class="attr-box">售卖时间:{{ item.gs_time }}</text>
  89. </view>
  90. <view class="row flex" v-if="!item.status && item.status != 0">
  91. <text class="attr-box">来源:{{ item.nickname }}</text>
  92. </view>
  93. <view class="row flex" v-else><text class="attr-box">x1</text></view>
  94. </view>
  95. </view>
  96. <view class="buy-box">
  97. <view class="buy-info" v-if="item.tabItem != 0 && item.status">
  98. <view class="font">买家:</view>
  99. <image class="avter" :src="item.avatar" mode=""></image>
  100. <view class="buy-name">{{ item.nickname }}</view>
  101. <view class="phone">{{ item.phone }}</view>
  102. </view>
  103. <view v-if="!item.status && item.status != 0">
  104. <view class="buy-info">
  105. <view class="font">挂售价格:{{ item.hanging_price }}</view>
  106. </view>
  107. <view class="buy-info">
  108. <view class="font">挂售时间:{{ item.update_time }}</view>
  109. </view>
  110. </view>
  111. </view>
  112. <view class="upimg" v-if="item.status == 2 || item.status == 3">
  113. <view class="up-tit">打款凭证:</view>
  114. <view class="img-wrap" v-if="item.upload_image" @click="lookimg(item.upload_image)">
  115. <image :src="item.upload_image" mode=""></image>
  116. </view>
  117. <view class="" style="color: #0F253A;font-weight: bold;font-size: 26rpx;" v-else>买家未上传支付凭证
  118. </view>
  119. </view>
  120. <view class="action-box b-t" v-if="item.status == 1"><button @click.stop="call(item)"
  121. class="action-btn recom">联系买家</button></view>
  122. <view class="action-box b-t" v-if="item.status == 2">
  123. <button @click.stop="appeal(item)"
  124. class="action-btn recom">{{ item.appeal == 0 ? '申诉' : '取消申诉' }}</button>
  125. <button @click.stop="orderPay(item)" class="action-btn recom">通过</button>
  126. </view>
  127. <!-- <view class="action-box b-t" v-if="!item.status && item.status != 0"><button
  128. @click.stop="cancel(item)" class="action-btn recom">取消挂售</button></view> -->
  129. </view>
  130. <uni-load-more :status="tabItem.loadingType"></uni-load-more>
  131. </scroll-view>
  132. </swiper-item>
  133. </swiper>
  134. <!-- <u-tabbar activeColor="#f42b4e" v-model="current" :list="tabbar" :mid-button="true"></u-tabbar> -->
  135. </view>
  136. </template>
  137. <script>
  138. import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
  139. import empty from '@/components/empty';
  140. import {
  141. orderList,
  142. orderCancel,
  143. orderDel,
  144. orderTake,
  145. adopt,
  146. user_auction_order,
  147. seller,
  148. cancel,
  149. untreated,
  150. plead,
  151. revoke
  152. } from '@/api/order.js';
  153. import {
  154. tabbar
  155. } from '@/utils/tabbar.js';
  156. export default {
  157. components: {
  158. uniLoadMore,
  159. empty
  160. },
  161. data() {
  162. return {
  163. loading: false, //判断是否在点击
  164. height: '', //第一层swiper高度
  165. tabbar: tabbar,
  166. current: 1, //底部tabar选中的icon对象
  167. currentIndex: 0, //当前选中的第一级0为我要买单,1我要卖单
  168. tabCurrentIndex: 0, //当前选中的第二级别我要买单选中项
  169. tabCurrentIndex1: 0, //当前选中的第二级别我要卖单选中项
  170. maiList: [{
  171. title: '我的买单'
  172. },
  173. {
  174. title: '我的卖单'
  175. }
  176. ],
  177. navList: [{
  178. state: 0,
  179. text: '全部',
  180. loadingType: 'more',
  181. orderList: [],
  182. isnew: 1, //判断是否有新的订单
  183. page: 1, //当前页数
  184. limit: 10 //每次信息条数
  185. },
  186. {
  187. state: 1,
  188. text: '待支付',
  189. loadingType: 'more',
  190. orderList: [],
  191. isnew: 1, //判断是否有新的订单
  192. page: 1, //当前页数
  193. limit: 10 //每次信息条数
  194. },
  195. {
  196. state: 2,
  197. text: '待审核',
  198. loadingType: 'more',
  199. orderList: [],
  200. isnew: 1, //判断是否有新的订单
  201. page: 1, //当前页数
  202. limit: 10 //每次信息条数
  203. },
  204. {
  205. state: 4,
  206. text: '待挂售',
  207. loadingType: 'more',
  208. orderList: [],
  209. isnew: 1, //判断是否有新的订单
  210. page: 1, //当前页数
  211. limit: 10 //每次信息条数
  212. }
  213. ],
  214. navList1: [{
  215. state: 0,
  216. text: '全部',
  217. loadingType: 'more',
  218. orderList: [],
  219. isnew: 1, //判断是否有新的订单
  220. page: 1, //当前页数
  221. limit: 10 //每次信息条数
  222. },
  223. {
  224. state: 4,
  225. text: '售卖中',
  226. loadingType: 'more',
  227. orderList: [],
  228. isnew: 1, //判断是否有新的订单
  229. page: 1, //当前页数
  230. limit: 10 //每次信息条数
  231. },
  232. {
  233. state: 1,
  234. text: '待支付',
  235. loadingType: 'more',
  236. orderList: [],
  237. isnew: 1, //判断是否有新的订单
  238. page: 1, //当前页数
  239. limit: 10 //每次信息条数
  240. },
  241. {
  242. state: 2,
  243. text: '待审核',
  244. loadingType: 'more',
  245. orderList: [],
  246. isnew: 1, //判断是否有新的订单
  247. page: 1, //当前页数
  248. limit: 10 //每次信息条数
  249. }
  250. ]
  251. };
  252. },
  253. computed: {
  254. currentAuto() {
  255. if (this.currentIndex == 0) {
  256. return this.tabCurrentIndex;
  257. }
  258. if (this.currentIndex == 1) {
  259. return this.tabCurrentIndex1;
  260. }
  261. }
  262. },
  263. onLoad(options) {
  264. /**
  265. * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
  266. * 替换onLoad下代码即可
  267. */
  268. this.tabCurrentIndex = +options.state || 0;
  269. },
  270. onShow() {
  271. this.loadData();
  272. this.upData();
  273. },
  274. // #ifdef APP-PLUS || H5
  275. onBackPress(e) {
  276. uni.switchTab({
  277. url: '/pages/user/user'
  278. });
  279. return true;
  280. },
  281. // #endif
  282. filters: {
  283. moneyNum(value) {
  284. return +value;
  285. }
  286. },
  287. // 页面加载完获取swiper高度
  288. onReady(res) {
  289. var obj = this;
  290. uni.getSystemInfo({
  291. success: resu => {
  292. const query = uni.createSelectorQuery();
  293. query.select('.swiper-box-one').boundingClientRect();
  294. query.exec(function(res) {
  295. console.log(res, 'ddddddddddddd');
  296. obj.height = resu.windowHeight - res[0].top + 'px';
  297. console.log('打印页面的剩余高度', obj.height);
  298. });
  299. },
  300. fail: res => {}
  301. });
  302. },
  303. methods: {
  304. //顶部tab点击
  305. tabClick(index, type) {
  306. if (type == 0) {
  307. this.tabCurrentIndex = index;
  308. }
  309. if (type == 1) {
  310. this.tabCurrentIndex1 = index;
  311. }
  312. },
  313. toBack() {
  314. uni.switchTab({
  315. url: '/pages/order/index'
  316. });
  317. },
  318. navGo(index) {
  319. this.currentIndex = index;
  320. console.log(this.currentIndex, '点击');
  321. this.upData();
  322. this.loadData('reload');
  323. },
  324. // 转换金额为数字
  325. moneyNum(value) {
  326. return +value;
  327. },
  328. // 订单支付
  329. pay(item) {
  330. uni.navigateTo({
  331. url: '/pages/hall/hallpay?ordid=' + item.order_id + '&type=2'
  332. });
  333. },
  334. // 更新
  335. upData() {
  336. untreated().then(({
  337. data
  338. }) => {
  339. console.log(data);
  340. if (data.user.hanging != 0) {
  341. this.navList[3].isnew = 2;
  342. }
  343. if (data.user.hanging == 0) {
  344. this.navList[3].isnew = 1;
  345. }
  346. if (data.user.paid != 0) {
  347. this.navList[1].isnew = 2;
  348. }
  349. if (data.user.paid == 0) {
  350. this.navList[1].isnew = 1;
  351. }
  352. if (data.user.reviewed != 0) {
  353. this.navList[2].isnew = 2;
  354. }
  355. if (data.user.reviewed == 0) {
  356. this.navList[2].isnew = 1;
  357. }
  358. if (data.seller.reviewed != 0) {
  359. this.navList1[3].isnew = 2;
  360. }
  361. if (data.seller.reviewed == 0) {
  362. this.navList1[3].isnew = 1;
  363. }
  364. });
  365. },
  366. // 查看大图
  367. lookimg(src) {
  368. console.log(src);
  369. let arr = [src];
  370. uni.previewImage({
  371. current: src,
  372. urls: arr
  373. });
  374. },
  375. //申诉和取消申诉
  376. appeal(item) {
  377. const obj = this;
  378. if (this.loading) {
  379. return;
  380. }
  381. this.loading = true;
  382. if (item.appeal == 0) {
  383. uni.showModal({
  384. title: '提示',
  385. content: '提交申诉后会导致画被冻结,是否继续提交申诉',
  386. success: function(res) {
  387. if (res.confirm) {
  388. uni.showLoading({
  389. title: '申诉中'
  390. });
  391. plead({
  392. order_id: item.order_id
  393. }).then(e => {
  394. uni.hideLoading();
  395. obj.$api.msg('申诉成功');
  396. obj.loadData('reload');
  397. obj.loading = false;
  398. });
  399. } else if (res.cancel) {
  400. console.log('用户点击取消');
  401. }
  402. }
  403. });
  404. } else {
  405. uni.showModal({
  406. title: '提示',
  407. content: '提交撤销申诉后会导致画被解冻,是否继续提交取消申诉',
  408. success: function(res) {
  409. if (res.confirm) {
  410. uni.showLoading({
  411. title: '取消申诉中'
  412. });
  413. revoke({
  414. order_id: item.order_id
  415. }).then(e => {
  416. uni.hideLoading();
  417. obj.$api.msg('取消申诉成功');
  418. obj.loadData('reload');
  419. obj.loading = false;
  420. });
  421. } else if (res.cancel) {
  422. console.log('用户点击取消');
  423. }
  424. }
  425. });
  426. }
  427. },
  428. //跳转到订单详情
  429. goToOrderDetail(e) {
  430. console.log(11);
  431. uni.navigateTo({
  432. url: '/pages/order/hallorderDetail?id=' + e.order_id
  433. });
  434. },
  435. gsell(item) {
  436. if (item.frozen) {
  437. return this.$api.msg('已冻结,请联系客服或与卖家协商');
  438. } else {
  439. uni.navigateTo({
  440. url: '/pages/hall/gsell?id=' + item.product_id
  441. });
  442. }
  443. },
  444. //卖家确认订单
  445. orderPay(e) {
  446. const obj = this;
  447. if (this.loading) {
  448. return;
  449. }
  450. uni.showModal({
  451. title: '提示',
  452. content: '通过后画将进入买家账户,是否核实完成后继续通过',
  453. success: function(res) {
  454. if (res.confirm) {
  455. uni.showLoading({
  456. title: '确认订单中'
  457. });
  458. this.loading = true;
  459. adopt({
  460. order_id: e.order_id
  461. }).then(({
  462. data
  463. }) => {
  464. console.log('1111');
  465. uni.hideLoading();
  466. obj.loading = false;
  467. obj.loadData('reload');
  468. obj.upData();
  469. });
  470. } else if (res.cancel) {
  471. console.log('用户点击取消');
  472. }
  473. }
  474. });
  475. },
  476. //取消挂售
  477. cancel(e) {
  478. const obj = this;
  479. uni.showModal({
  480. title: '提示',
  481. content: '是否取消挂售',
  482. success: function(res) {
  483. if (res.confirm) {
  484. if (obj.loading) {
  485. return;
  486. }
  487. obj.loading = true;
  488. uni.showLoading({
  489. title: '取消挂售中'
  490. });
  491. cancel({
  492. id: e.id
  493. }).then(({
  494. data
  495. }) => {
  496. uni.hideLoading();
  497. obj.loading = false;
  498. obj.loadData('reload');
  499. obj.upData();
  500. });
  501. } else if (res.cancel) {}
  502. }
  503. });
  504. },
  505. //获取订单列表
  506. loadData(source) {
  507. //这里是将订单挂载到tab列表下
  508. let index, navItem;
  509. if (this.currentIndex == 0) {
  510. index = this.tabCurrentIndex;
  511. navItem = this.navList[index];
  512. }
  513. if (this.currentIndex == 1) {
  514. index = this.tabCurrentIndex1;
  515. navItem = this.navList1[index];
  516. }
  517. console.log(source, 'load');
  518. let state = navItem.state;
  519. // if ( navItem.loaded === true) {
  520. // //tab切换只有第一次需要加载数据
  521. // return;
  522. // }
  523. if (navItem.loadingType === 'loading') {
  524. //防止重复加载
  525. return;
  526. }
  527. if (source == 'reload') {
  528. navItem.orderList = [];
  529. navItem.page = 1;
  530. navItem.limit = 10;
  531. navItem.loadingType = 'more';
  532. }
  533. if (navItem.loadingType === 'noMore') {
  534. //防止重复加载
  535. return;
  536. }
  537. // 修改当前对象状态为加载中
  538. navItem.loadingType = 'loading';
  539. if (this.currentIndex == 0) {
  540. user_auction_order({
  541. type: state,
  542. page: navItem.page,
  543. limit: navItem.limit
  544. })
  545. .then(({
  546. data
  547. }) => {
  548. let arr = data.map(e => {
  549. console.log(e);
  550. if (state == 4) {
  551. e.stateTip = '待挂售';
  552. e.stateTipColor = '#fa436a';
  553. } else {
  554. if (e.status == 3 && e.is_gs == 0) {
  555. e.stateTip = '待挂售';
  556. e.stateTipColor = '#fa436a';
  557. } else {
  558. let b = this.orderStateExp(e.status);
  559. e.stateTip = b.stateTip;
  560. e.stateTipColor = b.stateTipColor;
  561. }
  562. }
  563. return e;
  564. });
  565. console.log(arr, '123456');
  566. navItem.orderList = navItem.orderList.concat(arr);
  567. // console.log(navItem.orderList);
  568. navItem.page++;
  569. if (navItem.limit == data.length) {
  570. //判断是否还有数据, 有改为 more, 没有改为noMore
  571. navItem.loadingType = 'more';
  572. return;
  573. } else {
  574. //判断是否还有数据, 有改为 more, 没有改为noMore
  575. navItem.loadingType = 'noMore';
  576. }
  577. uni.hideLoading();
  578. this.$set(navItem, 'loaded', true);
  579. })
  580. .catch(e => {
  581. console.log(e);
  582. });
  583. }
  584. if (this.currentIndex == 1) {
  585. seller({
  586. type: state,
  587. page: navItem.page,
  588. limit: navItem.limit
  589. })
  590. .then(({
  591. data
  592. }) => {
  593. console.log(data);
  594. let arr = data.map(e => {
  595. if (state == 4) {
  596. e.stateTip = '售卖中';
  597. e.stateTipColor = '#fa436a';
  598. } else {
  599. if (e.status == 3 && e.appeal == 1) {
  600. e.stateTip = '冻结中';
  601. e.stateTipColor = '#fa436a';
  602. } else {
  603. let b = this.orderStateExp(e.status);
  604. e.stateTip = b.stateTip;
  605. e.stateTipColor = b.stateTipColor;
  606. }
  607. }
  608. return e;
  609. });
  610. navItem.orderList = navItem.orderList.concat(arr);
  611. // console.log(navItem.orderList);
  612. navItem.page++;
  613. if (navItem.limit == data.length) {
  614. //判断是否还有数据, 有改为 more, 没有改为noMore
  615. navItem.loadingType = 'more';
  616. return;
  617. } else {
  618. //判断是否还有数据, 有改为 more, 没有改为noMore
  619. navItem.loadingType = 'noMore';
  620. }
  621. uni.hideLoading();
  622. this.$set(navItem, 'loaded', true);
  623. })
  624. .catch(e => {
  625. console.log(e);
  626. });
  627. }
  628. },
  629. //swiper 切换
  630. changeTab(e) {
  631. if (this.currentIndex == 0) {
  632. this.tabCurrentIndex = e.target.current;
  633. }
  634. if (this.currentIndex == 1) {
  635. this.tabCurrentIndex1 = e.target.current;
  636. }
  637. this.loadData('reload');
  638. },
  639. //删除订单
  640. deleteOrder(index) {
  641. uni.showLoading({
  642. title: '请稍后'
  643. });
  644. setTimeout(() => {
  645. this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
  646. uni.hideLoading();
  647. }, 600);
  648. },
  649. //取消订单
  650. call(item) {
  651. console.log(item.phone);
  652. uni.makePhoneCall({
  653. phoneNumber: item.phone //仅为示例
  654. });
  655. },
  656. //订单状态文字和颜色
  657. orderStateExp(state) {
  658. let stateTip = '',
  659. stateTipColor = '#fa436a';
  660. switch (+state) {
  661. case 0:
  662. stateTip = '已过期';
  663. break;
  664. case 1:
  665. stateTip = '待支付';
  666. break;
  667. case 2:
  668. stateTip = '待审核';
  669. break;
  670. case 3:
  671. stateTip = '已完成';
  672. break;
  673. case undefined:
  674. stateTip = '待挂售';
  675. break;
  676. case 9:
  677. stateTip = '订单已关闭';
  678. stateTipColor = '#909399';
  679. break;
  680. //更多自定义
  681. }
  682. return {
  683. stateTip,
  684. stateTipColor
  685. };
  686. }
  687. }
  688. };
  689. </script>
  690. <style lang="scss">
  691. page,
  692. .content {
  693. background: $page-color-base;
  694. height: 100%;
  695. }
  696. .order-title {
  697. width: 750rpx;
  698. height: 270rpx;
  699. background: url(../../static/img/order99.png) repeat-x 0;
  700. display: flex;
  701. flex-direction: column;
  702. // padding: 50rpx 0;
  703. text-align: center;
  704. .body-title {
  705. height: 80rpx;
  706. text-align: center;
  707. font-size: 35rpx;
  708. position: relative;
  709. .header {
  710. position: absolute;
  711. left: 0;
  712. top: 30rpx;
  713. width: 100%;
  714. font-size: 36rpx;
  715. font-family: PingFang SC;
  716. font-weight: bold;
  717. color: #fffeff;
  718. height: 80rpx;
  719. font-size: 36rpx;
  720. font-weight: 700;
  721. z-index: 9;
  722. display: flex;
  723. justify-content: center;
  724. align-items: center;
  725. }
  726. .goback-box {
  727. position: absolute;
  728. left: 18rpx;
  729. top: 30rpx;
  730. height: 80rpx;
  731. display: flex;
  732. align-items: center;
  733. }
  734. .goback {
  735. z-index: 100;
  736. width: 34rpx;
  737. height: 34rpx;
  738. }
  739. }
  740. text {
  741. margin: 30px 0;
  742. font-size: 17px;
  743. font-family: PingFang SC;
  744. font-weight: bold;
  745. color: #ffffff;
  746. }
  747. .roder-content {
  748. margin-top: 80rpx;
  749. display: flex;
  750. justify-content: space-around;
  751. .left {
  752. width: 168px;
  753. height: 40px;
  754. line-height: 40px;
  755. border: 1px solid #ffffff;
  756. border-radius: 5px;
  757. text-align: center;
  758. font-size: 15px;
  759. font-family: PingFang SC;
  760. font-weight: bold;
  761. color: #ffffff;
  762. background: #dc262b;
  763. }
  764. .current {
  765. color: #dc262b;
  766. background: #ffffff;
  767. }
  768. }
  769. }
  770. .swiper-box {
  771. background: red;
  772. }
  773. .list-scroll-content {
  774. height: 100%;
  775. }
  776. .uni-swiper-item {
  777. height: auto;
  778. }
  779. .navbar {
  780. display: flex;
  781. height: 40px;
  782. padding: 0 5px;
  783. background: #fff;
  784. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  785. position: relative;
  786. z-index: 10;
  787. .nav-item {
  788. flex: 1;
  789. display: flex;
  790. justify-content: center;
  791. align-items: center;
  792. height: 100%;
  793. font-size: 15px;
  794. color: $font-color-dark;
  795. position: relative;
  796. .dian {
  797. position: absolute;
  798. top: 20rpx;
  799. right: 10rpx;
  800. width: 12rpx;
  801. height: 12rpx;
  802. border-radius: 50%;
  803. background-color: $base-color;
  804. }
  805. &.current {
  806. color: $base-color;
  807. &:after {
  808. content: '';
  809. position: absolute;
  810. left: 50%;
  811. bottom: 0;
  812. transform: translateX(-50%);
  813. width: 44px;
  814. height: 0;
  815. border-bottom: 2px solid $base-color;
  816. }
  817. }
  818. }
  819. }
  820. .order-item {
  821. display: flex;
  822. flex-direction: column;
  823. background: #fff;
  824. margin-top: 16rpx;
  825. .i-top {
  826. display: flex;
  827. align-items: center;
  828. height: 80rpx;
  829. font-size: $font-base;
  830. color: $font-color-dark;
  831. position: relative;
  832. padding: 0 30rpx;
  833. .time {
  834. flex: 1;
  835. }
  836. .state {
  837. color: $base-color;
  838. }
  839. .del-btn {
  840. padding: 10rpx 0 10rpx 36rpx;
  841. font-size: $font-lg;
  842. color: $font-color-light;
  843. position: relative;
  844. &:after {
  845. content: '';
  846. width: 0;
  847. height: 30rpx;
  848. border-left: 1px solid $border-color-dark;
  849. position: absolute;
  850. left: 20rpx;
  851. top: 50%;
  852. transform: translateY(-50%);
  853. }
  854. }
  855. }
  856. /* 多条商品 */
  857. .goods-box {
  858. height: 160rpx;
  859. padding: 20rpx 0;
  860. white-space: nowrap;
  861. .goods-item {
  862. width: 120rpx;
  863. height: 120rpx;
  864. display: inline-block;
  865. margin-right: 24rpx;
  866. }
  867. .goods-img {
  868. display: block;
  869. width: 100%;
  870. height: 100%;
  871. }
  872. }
  873. /* 单条商品 */
  874. .goods-box-single {
  875. display: flex;
  876. padding: 20rpx 30rpx;
  877. background: #f7f7f7;
  878. .goods-img {
  879. display: block;
  880. width: 120rpx;
  881. height: 120rpx;
  882. }
  883. .right {
  884. flex: 1;
  885. display: flex;
  886. flex-direction: column;
  887. padding: 0 0 0 24rpx;
  888. overflow: hidden;
  889. .row {
  890. margin-top: 10rpx;
  891. }
  892. .row_title {
  893. padding: 5rpx 10rpx;
  894. background-color: #dddddd;
  895. border-radius: 10rpx;
  896. font-size: 22rpx;
  897. color: #ffffff;
  898. }
  899. .title {
  900. font-size: $font-base + 2rpx;
  901. color: $font-color-dark;
  902. line-height: 1;
  903. width: 80%;
  904. }
  905. .attr-box {
  906. display: flex;
  907. justify-content: flex-end;
  908. font-size: $font-sm + 2rpx;
  909. color: $font-color-light;
  910. }
  911. .price {
  912. display: inline;
  913. font-size: $font-base + 2rpx;
  914. color: $font-color-dark;
  915. &:before {
  916. content: '¥';
  917. font-size: $font-sm;
  918. }
  919. }
  920. }
  921. }
  922. .buy-box {
  923. padding: 10rpx 22rpx;
  924. background-color: #ffffff;
  925. .buy-info {
  926. display: flex;
  927. align-items: center;
  928. margin-top: 20rpx;
  929. .font {
  930. font-size: 32rpx;
  931. font-family: PingFang SC;
  932. font-weight: 500;
  933. color: #333333;
  934. }
  935. .avter {
  936. margin-left: 10rpx;
  937. width: 46rpx;
  938. height: 46rpx;
  939. border-radius: 50%;
  940. }
  941. .buy-name {
  942. margin-left: 10rpx;
  943. font-size: 32rpx;
  944. font-family: PingFang SC;
  945. font-weight: bold;
  946. color: #333333;
  947. }
  948. .phone {
  949. margin-left: 12rpx;
  950. font-size: 24rpx;
  951. font-family: PingFang SC;
  952. font-weight: 500;
  953. color: #999999;
  954. }
  955. }
  956. }
  957. .upimg {
  958. padding-left: 20rpx;
  959. padding-top: 10rpx;
  960. padding-bottom: 10rpx;
  961. display: flex;
  962. .up-tit {
  963. display: inline-block;
  964. font-size: 26rpx;
  965. font-family: PingFang SC;
  966. font-weight: 500;
  967. color: #6d7c88;
  968. }
  969. .img-wrap {
  970. width: 153rpx;
  971. height: 152rpx;
  972. border-radius: 20rpx;
  973. image {
  974. border-radius: 20rpx;
  975. width: 153rpx;
  976. height: 152rpx;
  977. background-color: #ccc;
  978. }
  979. }
  980. }
  981. .price-box {
  982. display: flex;
  983. justify-content: flex-end;
  984. align-items: baseline;
  985. padding: 20rpx 30rpx;
  986. font-size: $font-sm + 2rpx;
  987. color: $font-color-light;
  988. .num {
  989. margin: 0 8rpx;
  990. color: $font-color-dark;
  991. }
  992. .price {
  993. font-size: $font-lg;
  994. color: $font-color-dark;
  995. &:before {
  996. content: '¥';
  997. font-size: $font-sm;
  998. margin: 0 2rpx 0 8rpx;
  999. }
  1000. }
  1001. }
  1002. .action-box {
  1003. padding: 0 30rpx;
  1004. display: flex;
  1005. justify-content: flex-end;
  1006. align-items: center;
  1007. height: 100rpx;
  1008. position: relative;
  1009. }
  1010. .refuse {
  1011. margin: 0;
  1012. padding: 0;
  1013. width: 160rpx;
  1014. height: 60rpx;
  1015. border: 2rpx solid #ebebeb;
  1016. border-radius: 28rpx;
  1017. text-align: center;
  1018. line-height: 60rpx;
  1019. font-size: 26rpx;
  1020. font-family: PingFang SC;
  1021. font-weight: 500;
  1022. color: #999999;
  1023. &:after {
  1024. border-radius: 100px;
  1025. }
  1026. &.recom {
  1027. color: #999999;
  1028. &:after {
  1029. border-color: #999999;
  1030. }
  1031. }
  1032. }
  1033. .action-btn {
  1034. width: 160rpx;
  1035. height: 60rpx;
  1036. margin: 0;
  1037. margin-left: 24rpx;
  1038. padding: 0;
  1039. text-align: center;
  1040. line-height: 60rpx;
  1041. font-size: $font-sm + 2rpx;
  1042. color: $font-color-dark;
  1043. background: #fff;
  1044. border-radius: 100px;
  1045. border: 2rpx solid #fd3b39;
  1046. border-radius: 28px;
  1047. &:after {
  1048. border-radius: 100px;
  1049. }
  1050. &.recom {
  1051. color: $base-color;
  1052. &:after {
  1053. border-color: $base-color;
  1054. }
  1055. }
  1056. &.evaluate {
  1057. color: $color-yellow;
  1058. &:after {
  1059. border-color: $color-yellow;
  1060. }
  1061. }
  1062. }
  1063. }
  1064. /* load-more */
  1065. .uni-load-more {
  1066. display: flex;
  1067. flex-direction: row;
  1068. height: 80rpx;
  1069. align-items: center;
  1070. justify-content: center;
  1071. }
  1072. .uni-load-more__text {
  1073. font-size: 28rpx;
  1074. color: #999;
  1075. }
  1076. .uni-load-more__img {
  1077. height: 24px;
  1078. width: 24px;
  1079. margin-right: 10px;
  1080. }
  1081. .uni-load-more__img>view {
  1082. position: absolute;
  1083. }
  1084. .uni-load-more__img>view view {
  1085. width: 6px;
  1086. height: 2px;
  1087. border-top-left-radius: 1px;
  1088. border-bottom-left-radius: 1px;
  1089. background: #999;
  1090. position: absolute;
  1091. opacity: 0.2;
  1092. transform-origin: 50%;
  1093. animation: load 1.56s ease infinite;
  1094. }
  1095. .uni-load-more__img>view view:nth-child(1) {
  1096. transform: rotate(90deg);
  1097. top: 2px;
  1098. left: 9px;
  1099. }
  1100. .uni-load-more__img>view view:nth-child(2) {
  1101. transform: rotate(180deg);
  1102. top: 11px;
  1103. right: 0;
  1104. }
  1105. .uni-load-more__img>view view:nth-child(3) {
  1106. transform: rotate(270deg);
  1107. bottom: 2px;
  1108. left: 9px;
  1109. }
  1110. .uni-load-more__img>view view:nth-child(4) {
  1111. top: 11px;
  1112. left: 0;
  1113. }
  1114. .load1,
  1115. .load2,
  1116. .load3 {
  1117. height: 24px;
  1118. width: 24px;
  1119. }
  1120. .load2 {
  1121. transform: rotate(30deg);
  1122. }
  1123. .load3 {
  1124. transform: rotate(60deg);
  1125. }
  1126. .load1 view:nth-child(1) {
  1127. animation-delay: 0s;
  1128. }
  1129. .load2 view:nth-child(1) {
  1130. animation-delay: 0.13s;
  1131. }
  1132. .load3 view:nth-child(1) {
  1133. animation-delay: 0.26s;
  1134. }
  1135. .load1 view:nth-child(2) {
  1136. animation-delay: 0.39s;
  1137. }
  1138. .load2 view:nth-child(2) {
  1139. animation-delay: 0.52s;
  1140. }
  1141. .load3 view:nth-child(2) {
  1142. animation-delay: 0.65s;
  1143. }
  1144. .load1 view:nth-child(3) {
  1145. animation-delay: 0.78s;
  1146. }
  1147. .load2 view:nth-child(3) {
  1148. animation-delay: 0.91s;
  1149. }
  1150. .load3 view:nth-child(3) {
  1151. animation-delay: 1.04s;
  1152. }
  1153. .load1 view:nth-child(4) {
  1154. animation-delay: 1.17s;
  1155. }
  1156. .load2 view:nth-child(4) {
  1157. animation-delay: 1.3s;
  1158. }
  1159. .load3 view:nth-child(4) {
  1160. animation-delay: 1.43s;
  1161. }
  1162. @-webkit-keyframes load {
  1163. 0% {
  1164. opacity: 1;
  1165. }
  1166. 100% {
  1167. opacity: 0.2;
  1168. }
  1169. }
  1170. .swiper-box-one {
  1171. height: calc(100% - 175px);
  1172. }
  1173. </style>