order.vue 28 KB

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