order.vue 28 KB

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