order.vue 28 KB

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