order.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275
  1. <template>
  2. <view class="content">
  3. <view class="order-title">
  4. <view class="body-title">
  5. <view class="header">我的订单</view>
  6. </view>
  7. <view class="roder-content">
  8. <view class="left" :class="{ current: currentIndex === index }" :key="index"
  9. v-for="(item, index) in maiList" @click="navGo(index)">{{ item.title }}</view>
  10. </view>
  11. </view>
  12. <view class="navbar" v-show="currentIndex == 0">
  13. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  14. :class="{ current: tabCurrentIndex === index }" @click="tabClick(index, 0)">
  15. {{ item.text }}
  16. <view class="dian" v-if="tabCurrentIndex != index && item.isnew == 2"></view>
  17. </view>
  18. </view>
  19. <view class="navbar" v-show="currentIndex == 1">
  20. <view v-for="(item, index) in navList1" :key="index" class="nav-item"
  21. :class="{ current: tabCurrentIndex1 === index }" @click="tabClick(index, 1)">
  22. {{ item.text }}
  23. <view class="dian" v-if="tabCurrentIndex1 != index && item.isnew == 2"></view>
  24. </view>
  25. </view>
  26. <swiper :current="currentAuto" class="swiper-box-one" duration="0" @change="changeTab">
  27. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList" :key="tabIndex"
  28. v-if="currentIndex == 0">
  29. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  30. <!-- 空白页 -->
  31. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  32. <!-- 订单列表 -->
  33. <view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item"
  34. @click="goToOrderDetail(item)">
  35. <view class="i-top b-b">
  36. <text class="time">{{ item.order_id }}</text>
  37. <text class="state" :style="{ color: item.stateTipColor }">{{ item.stateTip }}</text>
  38. </view>
  39. <view class="goods-box-single">
  40. <image class="goods-img" :src="item.image" mode="aspectFill"></image>
  41. <view class="right">
  42. <text class="title clamp">{{ item.name }}</text>
  43. <text class="attr-box">x1</text>
  44. <text class="price">{{ moneyNum(item.price) }}</text>
  45. </view>
  46. </view>
  47. <view class="price-box">
  48. <text class="num">1</text>
  49. 件商品 邮费
  50. <text class="price">0</text>
  51. 实付款
  52. <text class="price">{{ moneyNum(item.price) }}</text>
  53. </view>
  54. <view class="action-box b-t flex">
  55. <view class="time">
  56. 创建时间:{{item.create_time}}
  57. </view>
  58. <view >
  59. <button v-if="item.stateTip == '待支付'" @click.stop="pay(item)" class="action-btn recom">立即支付</button>
  60. <button v-else-if="item.stateTip == '待挂售' && tabItem.state != 0" @click.stop="gsell(item)" class="action-btn recom">{{ item.frozen == 0 ? '立即挂售' : '冻结中' }}</button>
  61. <button v-else-if="item.stateTip == '待审核'" @click.stop="pay(item)" class="action-btn recom">修改凭证</button>
  62. </view>
  63. </view>
  64. </view>
  65. <u-loadmore class="margin-t-30" :status="tabItem.loadingType" />
  66. </scroll-view>
  67. </swiper-item>
  68. <swiper-item class="tab-content" v-for="(tabItem, tabIndex) in navList1" :key="tabIndex"
  69. v-if="currentIndex == 1" @click="goToOrderDetail(item)">
  70. <scroll-view class="list-scroll-content" scroll-y @scrolltolower="loadData">
  71. <!-- 空白页 -->
  72. <empty v-if="tabItem.loaded === true && tabItem.orderList.length === 0"></empty>
  73. <!-- 订单列表 -->
  74. <view v-for="(item, index) in tabItem.orderList" :key="index" class="order-item">
  75. <view class="i-top b-b">
  76. <text class="time">{{ item.order_id ? item.order_id : item.order }}</text>
  77. <text class="state" :style="{ color: item.stateTipColor }">{{ item.stateTip }}</text>
  78. </view>
  79. <view class="goods-box-single">
  80. <image class="goods-img" :src="item.image" mode="scaleToFill"></image>
  81. <view class="right">
  82. <view class="flex-start">
  83. <text class="title clamp">{{ item.name }}</text>
  84. <text class="price">{{ item.price | moneyNum }}</text>
  85. </view>
  86. <view class="row flex" v-if="!item.status && item.status != 0">
  87. <text class="attr-box">售卖时间:{{ item.gs_time }}</text>
  88. </view>
  89. <view class="row flex" v-if="!item.status && item.status != 0">
  90. <text class="attr-box">来源:{{ item.nickname }}</text>
  91. </view>
  92. <view class="row flex" v-else><text class="attr-box">x1</text></view>
  93. </view>
  94. </view>
  95. <view class="buy-box">
  96. <view class="buy-info" v-if="item.tabItem != 0 && item.status">
  97. <view class="font">买家:</view>
  98. <image class="avter" :src="item.avatar" mode=""></image>
  99. <view class="buy-name">{{ item.nickname }}</view>
  100. <view class="phone">{{ item.phone }}</view>
  101. </view>
  102. <view class="padding-b-10" v-if="!item.status && item.status != 0">
  103. <view class="buy-info">
  104. <view class="font">挂售价格:{{ item.hanging_price }}</view>
  105. </view>
  106. <view class="buy-info">
  107. <view class="font">挂售时间:{{ item.update_time }}</view>
  108. </view>
  109. </view>
  110. </view>
  111. <view class="upimg" v-if="item.status == 2 || item.status == 3">
  112. <view class="up-tit">打款凭证:</view>
  113. <view class="img-wrap" v-if="item.upload_image" @click="lookimg(item.upload_image)">
  114. <image :src="item.upload_image" mode=""></image>
  115. </view>
  116. <view class="" style="color: #0F253A;font-weight: bold;font-size: 26rpx;" v-else>买家未上传支付凭证
  117. </view>
  118. </view>
  119. <view class="action-box b-t flex" v-if="item.status == 1">
  120. <view class="time">
  121. 创建时间:{{item.create_time}}
  122. </view>
  123. <button @click.stop="call(item)"
  124. class="action-btn recom">联系买家</button>
  125. </view>
  126. <view class="action-box b-t flex" v-if="item.status == 2">
  127. <view class="time">
  128. {{item.create_time}}
  129. </view>
  130. <view class="flex">
  131. <button @click.stop="appeal(item)"
  132. class="action-btn recom">{{ item.appeal == 0 ? '申诉' : '取消申诉' }}</button>
  133. <button @click.stop="orderPay(item)" class="action-btn recom margin-l-20">通过</button>
  134. </view>
  135. </view>
  136. <!-- <view class="action-box b-t" v-if="!item.status && item.status != 0"><button
  137. @click.stop="cancel(item)" class="action-btn recom">取消挂售</button></view> -->
  138. </view>
  139. <u-loadmore class="margin-t-30" :status="tabItem.loadingType" />
  140. </scroll-view>
  141. </swiper-item>
  142. </swiper>
  143. <u-tabbar activeColor="#333333" inactive-color='#999999' :list="tabbar"></u-tabbar>
  144. </view>
  145. </template>
  146. <script>
  147. import empty from '@/components/empty';
  148. import {
  149. orderList,
  150. orderCancel,
  151. orderDel,
  152. orderTake,
  153. adopt,
  154. user_auction_order,
  155. seller,
  156. cancel,
  157. untreated,
  158. plead,
  159. revoke
  160. } from '@/api/order.js';
  161. import {
  162. tabbar1
  163. } from '@/utils/tabbar.js';
  164. export default {
  165. components: {
  166. empty
  167. },
  168. data() {
  169. return {
  170. loading: false, //判断是否在点击
  171. height: '', //第一层swiper高度
  172. tabbar: tabbar1,
  173. currentIndex: 0, //当前选中的第一级0为我要买单,1我要卖单
  174. tabCurrentIndex: 0, //当前选中的第二级别我要买单选中项
  175. tabCurrentIndex1: 0, //当前选中的第二级别我要卖单选中项
  176. maiList: [{
  177. title: '我的买单'
  178. },
  179. {
  180. title: '我的卖单'
  181. }
  182. ],
  183. navList: [{
  184. state: 0,
  185. text: '全部',
  186. loadingType: 'loadmore',
  187. orderList: [],
  188. isnew: 1, //判断是否有新的订单
  189. page: 1, //当前页数
  190. limit: 10 //每次信息条数
  191. },
  192. {
  193. state: 1,
  194. text: '待支付',
  195. loadingType: 'loadmore',
  196. orderList: [],
  197. isnew: 1, //判断是否有新的订单
  198. page: 1, //当前页数
  199. limit: 10 //每次信息条数
  200. },
  201. {
  202. state: 2,
  203. text: '待审核',
  204. loadingType: 'loadmore',
  205. orderList: [],
  206. isnew: 1, //判断是否有新的订单
  207. page: 1, //当前页数
  208. limit: 10 //每次信息条数
  209. },
  210. {
  211. state: 4,
  212. text: '待挂售',
  213. loadingType: 'loadmore',
  214. orderList: [],
  215. isnew: 1, //判断是否有新的订单
  216. page: 1, //当前页数
  217. limit: 10 //每次信息条数
  218. }
  219. ],
  220. navList1: [{
  221. state: 0,
  222. text: '全部',
  223. loadingType: 'loadmore',
  224. orderList: [],
  225. isnew: 1, //判断是否有新的订单
  226. page: 1, //当前页数
  227. limit: 10 //每次信息条数
  228. },
  229. {
  230. state: 4,
  231. text: '售卖中',
  232. loadingType: 'loadmore',
  233. orderList: [],
  234. isnew: 1, //判断是否有新的订单
  235. page: 1, //当前页数
  236. limit: 10 //每次信息条数
  237. },
  238. {
  239. state: 1,
  240. text: '待支付',
  241. loadingType: 'loadmore',
  242. orderList: [],
  243. isnew: 1, //判断是否有新的订单
  244. page: 1, //当前页数
  245. limit: 10 //每次信息条数
  246. },
  247. {
  248. state: 2,
  249. text: '待审核',
  250. loadingType: 'loadmore',
  251. orderList: [],
  252. isnew: 1, //判断是否有新的订单
  253. page: 1, //当前页数
  254. limit: 10 //每次信息条数
  255. }
  256. ]
  257. };
  258. },
  259. computed: {
  260. currentAuto() {
  261. if (this.currentIndex == 0) {
  262. return this.tabCurrentIndex;
  263. }
  264. if (this.currentIndex == 1) {
  265. return this.tabCurrentIndex1;
  266. }
  267. }
  268. },
  269. onLoad(options) {
  270. /**
  271. * 修复app端点击除全部订单外的按钮进入时不加载数据的问题
  272. * 替换onLoad下代码即可
  273. */
  274. this.tabCurrentIndex = +options.state || 0;
  275. },
  276. onShow() {
  277. this.loadData();
  278. this.upData();
  279. },
  280. // #ifdef APP-PLUS || H5
  281. onBackPress(e) {
  282. uni.switchTab({
  283. url: '/pages/user/user'
  284. });
  285. return true;
  286. },
  287. // #endif
  288. filters: {
  289. moneyNum(value) {
  290. return +value;
  291. }
  292. },
  293. // 页面加载完获取swiper高度
  294. onReady(res) {
  295. var obj = this;
  296. uni.getSystemInfo({
  297. success: resu => {
  298. const query = uni.createSelectorQuery();
  299. query.select('.swiper-box-one').boundingClientRect();
  300. query.exec(function(res) {
  301. console.log(res, 'ddddddddddddd');
  302. obj.height = resu.windowHeight - res[0].top + 'px';
  303. console.log('打印页面的剩余高度', obj.height);
  304. });
  305. },
  306. fail: res => {}
  307. });
  308. },
  309. methods: {
  310. //顶部tab点击
  311. tabClick(index, type) {
  312. if (type == 0) {
  313. this.tabCurrentIndex = index;
  314. }
  315. if (type == 1) {
  316. this.tabCurrentIndex1 = 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 = 'loadmore';
  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. e.create_time = e.create_time.split(' ')[0];
  552. if (state == 4) {
  553. e.stateTip = '待挂售';
  554. e.stateTipColor = '#fa436a';
  555. } else {
  556. if (e.status == 3 && e.is_gs == 0) {
  557. e.stateTip = '待挂售';
  558. e.stateTipColor = '#fa436a';
  559. } else {
  560. let b = this.orderStateExp(e.status);
  561. e.stateTip = b.stateTip;
  562. e.stateTipColor = b.stateTipColor;
  563. }
  564. }
  565. return e;
  566. });
  567. console.log(arr, '123456');
  568. navItem.orderList = navItem.orderList.concat(arr);
  569. // console.log(navItem.orderList);
  570. navItem.page++;
  571. if (navItem.limit == data.length) {
  572. //判断是否还有数据, 有改为 more, 没有改为noMore
  573. navItem.loadingType = 'loadmore';
  574. return;
  575. } else {
  576. //判断是否还有数据, 有改为 more, 没有改为noMore
  577. navItem.loadingType = 'nomore';
  578. }
  579. uni.hideLoading();
  580. this.$set(navItem, 'loaded', true);
  581. })
  582. .catch(e => {
  583. console.log(e);
  584. });
  585. }
  586. if (this.currentIndex == 1) {
  587. seller({
  588. type: state,
  589. page: navItem.page,
  590. limit: navItem.limit
  591. })
  592. .then(({
  593. data
  594. }) => {
  595. console.log(data);
  596. let arr = data.map(e => {
  597. if (state == 4) {
  598. e.stateTip = '售卖中';
  599. e.stateTipColor = '#fa436a';
  600. } else {
  601. if (e.status == 3 && e.appeal == 1) {
  602. e.stateTip = '冻结中';
  603. e.stateTipColor = '#fa436a';
  604. } else {
  605. let b = this.orderStateExp(e.status);
  606. e.stateTip = b.stateTip;
  607. e.stateTipColor = b.stateTipColor;
  608. }
  609. }
  610. return e;
  611. });
  612. navItem.orderList = navItem.orderList.concat(arr);
  613. // console.log(navItem.orderList);
  614. navItem.page++;
  615. if (navItem.limit == data.length) {
  616. //判断是否还有数据, 有改为 more, 没有改为noMore
  617. navItem.loadingType = 'loadmore';
  618. return;
  619. } else {
  620. //判断是否还有数据, 有改为 more, 没有改为noMore
  621. navItem.loadingType = 'nomore';
  622. }
  623. uni.hideLoading();
  624. this.$set(navItem, 'loaded', true);
  625. })
  626. .catch(e => {
  627. console.log(e);
  628. });
  629. }
  630. },
  631. //swiper 切换
  632. changeTab(e) {
  633. if (this.currentIndex == 0) {
  634. this.tabCurrentIndex = e.target.current;
  635. }
  636. if (this.currentIndex == 1) {
  637. this.tabCurrentIndex1 = e.target.current;
  638. }
  639. this.loadData('reload');
  640. },
  641. //删除订单
  642. deleteOrder(index) {
  643. uni.showLoading({
  644. title: '请稍后'
  645. });
  646. setTimeout(() => {
  647. this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
  648. uni.hideLoading();
  649. }, 600);
  650. },
  651. //取消订单
  652. call(item) {
  653. console.log(item.phone);
  654. uni.makePhoneCall({
  655. phoneNumber: item.phone //仅为示例
  656. });
  657. },
  658. //订单状态文字和颜色
  659. orderStateExp(state) {
  660. let stateTip = '',
  661. stateTipColor = '#fa436a';
  662. switch (+state) {
  663. case 0:
  664. stateTip = '已过期';
  665. break;
  666. case 1:
  667. stateTip = '待支付';
  668. break;
  669. case 2:
  670. stateTip = '待审核';
  671. break;
  672. case 3:
  673. stateTip = '已完成';
  674. break;
  675. case undefined:
  676. stateTip = '待挂售';
  677. break;
  678. case 9:
  679. stateTip = '订单已关闭';
  680. stateTipColor = '#909399';
  681. break;
  682. //更多自定义
  683. }
  684. return {
  685. stateTip,
  686. stateTipColor
  687. };
  688. }
  689. }
  690. };
  691. </script>
  692. <style lang="scss">
  693. page,
  694. .content {
  695. background: $page-color-base;
  696. height: 100%;
  697. }
  698. .order-title {
  699. width: 750rpx;
  700. height: 270rpx;
  701. background: url(../../static/img/myfans.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-family: PingFang SC;
  746. font-weight: bold;
  747. color: #ffffff;
  748. }
  749. .roder-content {
  750. margin-top: 80rpx;
  751. display: flex;
  752. justify-content: space-around;
  753. .left {
  754. width: 168px;
  755. height: 40px;
  756. line-height: 40px;
  757. border: 1px solid #ffffff;
  758. border-radius: 5px;
  759. text-align: center;
  760. font-size: 15px;
  761. font-family: PingFang SC;
  762. font-weight: bold;
  763. color: #ffffff;
  764. background: #d5c6b2;
  765. }
  766. .current {
  767. color: #BB9159;
  768. background: #ffffff;
  769. }
  770. }
  771. }
  772. .swiper-box {
  773. background: red;
  774. }
  775. .list-scroll-content {
  776. height: 100%;
  777. }
  778. .uni-swiper-item {
  779. height: auto;
  780. }
  781. .navbar {
  782. display: flex;
  783. height: 40px;
  784. padding: 0 5px;
  785. background: #fff;
  786. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  787. position: relative;
  788. z-index: 10;
  789. .nav-item {
  790. flex: 1;
  791. display: flex;
  792. justify-content: center;
  793. align-items: center;
  794. height: 100%;
  795. font-size: 15px;
  796. color: $font-color-dark;
  797. position: relative;
  798. .dian {
  799. position: absolute;
  800. top: 20rpx;
  801. right: 10rpx;
  802. width: 12rpx;
  803. height: 12rpx;
  804. border-radius: 50%;
  805. // background-color: $base-color;
  806. }
  807. &.current {
  808. color: #d9b789;
  809. &:after {
  810. content: '';
  811. position: absolute;
  812. left: 50%;
  813. bottom: 0;
  814. transform: translateX(-50%);
  815. width: 44px;
  816. height: 0;
  817. border-bottom: 2px solid #d9b789;
  818. }
  819. }
  820. }
  821. }
  822. .order-item {
  823. display: flex;
  824. flex-direction: column;
  825. background: #fff;
  826. margin: 16rpx 30rpx 0 30rpx;
  827. border-radius: 20rpx;
  828. overflow: hidden;
  829. .i-top {
  830. display: flex;
  831. align-items: center;
  832. height: 80rpx;
  833. font-size: $font-base;
  834. color: $font-color-dark;
  835. position: relative;
  836. padding: 0 30rpx;
  837. .time {
  838. flex: 1;
  839. }
  840. .state {
  841. color: $base-color;
  842. }
  843. .del-btn {
  844. padding: 10rpx 0 10rpx 36rpx;
  845. font-size: $font-lg;
  846. color: $font-color-light;
  847. position: relative;
  848. &:after {
  849. content: '';
  850. width: 0;
  851. height: 30rpx;
  852. border-left: 1px solid $border-color-dark;
  853. position: absolute;
  854. left: 20rpx;
  855. top: 50%;
  856. transform: translateY(-50%);
  857. }
  858. }
  859. }
  860. /* 多条商品 */
  861. .goods-box {
  862. height: 160rpx;
  863. padding: 20rpx 0;
  864. white-space: nowrap;
  865. .goods-item {
  866. width: 120rpx;
  867. height: 120rpx;
  868. display: inline-block;
  869. margin-right: 24rpx;
  870. }
  871. .goods-img {
  872. display: block;
  873. width: 100%;
  874. height: 100%;
  875. }
  876. }
  877. /* 单条商品 */
  878. .goods-box-single {
  879. display: flex;
  880. padding: 20rpx 30rpx;
  881. .goods-img {
  882. display: block;
  883. width: 120rpx;
  884. height: 120rpx;
  885. }
  886. .right {
  887. flex: 1;
  888. display: flex;
  889. flex-direction: column;
  890. padding: 0 0 0 24rpx;
  891. overflow: hidden;
  892. .row {
  893. margin-top: 10rpx;
  894. }
  895. .row_title {
  896. padding: 5rpx 10rpx;
  897. background-color: #dddddd;
  898. border-radius: 10rpx;
  899. font-size: 22rpx;
  900. color: #ffffff;
  901. }
  902. .title {
  903. font-size: $font-base + 2rpx;
  904. color: $font-color-dark;
  905. line-height: 1;
  906. width: 80%;
  907. }
  908. .attr-box {
  909. display: flex;
  910. justify-content: flex-end;
  911. font-size: $font-sm + 2rpx;
  912. color: $font-color-light;
  913. }
  914. .price {
  915. display: inline;
  916. font-size: $font-base + 2rpx;
  917. color: $font-color-dark;
  918. &:before {
  919. content: '¥';
  920. font-size: $font-sm;
  921. }
  922. }
  923. }
  924. }
  925. .buy-box {
  926. padding: 10rpx 22rpx;
  927. background-color: #ffffff;
  928. .buy-info {
  929. display: flex;
  930. align-items: center;
  931. .font {
  932. font-size: $font-base;
  933. font-weight: 500;
  934. color: #333333;
  935. }
  936. .avter {
  937. margin-left: 10rpx;
  938. width: 46rpx;
  939. height: 46rpx;
  940. border-radius: 50%;
  941. }
  942. .buy-name {
  943. margin-left: 10rpx;
  944. font-size: 32rpx;
  945. font-family: PingFang SC;
  946. font-weight: bold;
  947. color: #333333;
  948. }
  949. .phone {
  950. margin-left: 12rpx;
  951. font-size: 24rpx;
  952. font-family: PingFang SC;
  953. font-weight: 500;
  954. color: #999999;
  955. }
  956. }
  957. }
  958. .upimg {
  959. padding-left: 20rpx;
  960. padding-top: 10rpx;
  961. padding-bottom: 10rpx;
  962. display: flex;
  963. .up-tit {
  964. display: inline-block;
  965. font-size: 26rpx;
  966. font-family: PingFang SC;
  967. font-weight: 500;
  968. color: #6d7c88;
  969. }
  970. .img-wrap {
  971. width: 153rpx;
  972. height: 152rpx;
  973. border-radius: 20rpx;
  974. image {
  975. border-radius: 20rpx;
  976. width: 153rpx;
  977. height: 152rpx;
  978. background-color: #ccc;
  979. }
  980. }
  981. }
  982. .price-box {
  983. display: flex;
  984. justify-content: flex-end;
  985. align-items: baseline;
  986. padding: 20rpx 30rpx;
  987. font-size: $font-sm + 2rpx;
  988. color: $font-color-light;
  989. .num {
  990. margin: 0 8rpx;
  991. color: $font-color-dark;
  992. }
  993. .price {
  994. font-size: $font-lg;
  995. color: $font-color-dark;
  996. &:before {
  997. content: '¥';
  998. font-size: $font-sm;
  999. margin: 0 2rpx 0 8rpx;
  1000. }
  1001. }
  1002. }
  1003. .action-box {
  1004. padding: 0 30rpx;
  1005. height: 100rpx;
  1006. position: relative;
  1007. .time{
  1008. font-size: $font-sm;
  1009. color: $font-color-light;
  1010. }
  1011. }
  1012. .refuse {
  1013. margin: 0;
  1014. padding: 0;
  1015. width: 160rpx;
  1016. height: 60rpx;
  1017. border: 2rpx solid #ebebeb;
  1018. border-radius: 28rpx;
  1019. text-align: center;
  1020. line-height: 60rpx;
  1021. font-size: 26rpx;
  1022. font-family: PingFang SC;
  1023. font-weight: 500;
  1024. color: #999999;
  1025. &:after {
  1026. border-radius: 100px;
  1027. }
  1028. &.recom {
  1029. color: #999999;
  1030. &:after {
  1031. border-color: #999999;
  1032. }
  1033. }
  1034. }
  1035. .action-btn {
  1036. min-width: 160rpx;
  1037. height: 60rpx;
  1038. text-align: center;
  1039. line-height: 60rpx;
  1040. font-size: $font-sm + 2rpx;
  1041. color: $font-color-dark;
  1042. background: #fff;
  1043. border-radius: 100px;
  1044. border: 2rpx solid #fd3b39;
  1045. border-radius: 28px;
  1046. &:after {
  1047. border-radius: 100px;
  1048. }
  1049. &.recom {
  1050. color: $base-color;
  1051. &:after {
  1052. border-color: $base-color;
  1053. }
  1054. }
  1055. &.evaluate {
  1056. color: $color-yellow;
  1057. &:after {
  1058. border-color: $color-yellow;
  1059. }
  1060. }
  1061. }
  1062. }
  1063. /* load-more */
  1064. .uni-load-more {
  1065. display: flex;
  1066. flex-direction: row;
  1067. height: 80rpx;
  1068. align-items: center;
  1069. justify-content: center;
  1070. }
  1071. .uni-load-more__text {
  1072. font-size: 28rpx;
  1073. color: #999;
  1074. }
  1075. .uni-load-more__img {
  1076. height: 24px;
  1077. width: 24px;
  1078. margin-right: 10px;
  1079. }
  1080. .uni-load-more__img>view {
  1081. position: absolute;
  1082. }
  1083. .uni-load-more__img>view view {
  1084. width: 6px;
  1085. height: 2px;
  1086. border-top-left-radius: 1px;
  1087. border-bottom-left-radius: 1px;
  1088. background: #999;
  1089. position: absolute;
  1090. opacity: 0.2;
  1091. transform-origin: 50%;
  1092. animation: load 1.56s ease infinite;
  1093. }
  1094. .uni-load-more__img>view view:nth-child(1) {
  1095. transform: rotate(90deg);
  1096. top: 2px;
  1097. left: 9px;
  1098. }
  1099. .uni-load-more__img>view view:nth-child(2) {
  1100. transform: rotate(180deg);
  1101. top: 11px;
  1102. right: 0;
  1103. }
  1104. .uni-load-more__img>view view:nth-child(3) {
  1105. transform: rotate(270deg);
  1106. bottom: 2px;
  1107. left: 9px;
  1108. }
  1109. .uni-load-more__img>view view:nth-child(4) {
  1110. top: 11px;
  1111. left: 0;
  1112. }
  1113. .load1,
  1114. .load2,
  1115. .load3 {
  1116. height: 24px;
  1117. width: 24px;
  1118. }
  1119. .load2 {
  1120. transform: rotate(30deg);
  1121. }
  1122. .load3 {
  1123. transform: rotate(60deg);
  1124. }
  1125. .load1 view:nth-child(1) {
  1126. animation-delay: 0s;
  1127. }
  1128. .load2 view:nth-child(1) {
  1129. animation-delay: 0.13s;
  1130. }
  1131. .load3 view:nth-child(1) {
  1132. animation-delay: 0.26s;
  1133. }
  1134. .load1 view:nth-child(2) {
  1135. animation-delay: 0.39s;
  1136. }
  1137. .load2 view:nth-child(2) {
  1138. animation-delay: 0.52s;
  1139. }
  1140. .load3 view:nth-child(2) {
  1141. animation-delay: 0.65s;
  1142. }
  1143. .load1 view:nth-child(3) {
  1144. animation-delay: 0.78s;
  1145. }
  1146. .load2 view:nth-child(3) {
  1147. animation-delay: 0.91s;
  1148. }
  1149. .load3 view:nth-child(3) {
  1150. animation-delay: 1.04s;
  1151. }
  1152. .load1 view:nth-child(4) {
  1153. animation-delay: 1.17s;
  1154. }
  1155. .load2 view:nth-child(4) {
  1156. animation-delay: 1.3s;
  1157. }
  1158. .load3 view:nth-child(4) {
  1159. animation-delay: 1.43s;
  1160. }
  1161. @-webkit-keyframes load {
  1162. 0% {
  1163. opacity: 1;
  1164. }
  1165. 100% {
  1166. opacity: 0.2;
  1167. }
  1168. }
  1169. .swiper-box-one {
  1170. height: calc(100% - 175px);
  1171. }
  1172. </style>