order.vue 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280
  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. toBack() {
  320. uni.switchTab({
  321. url: '/pages/order/index'
  322. });
  323. },
  324. navGo(index) {
  325. this.currentIndex = index;
  326. console.log(this.currentIndex, '点击');
  327. this.upData();
  328. this.loadData('reload');
  329. },
  330. // 转换金额为数字
  331. moneyNum(value) {
  332. return +value;
  333. },
  334. // 订单支付
  335. pay(item) {
  336. uni.navigateTo({
  337. url: '/pages/hall/hallpay?ordid=' + item.order_id + '&type=2'
  338. });
  339. },
  340. // 更新
  341. upData() {
  342. untreated().then(({
  343. data
  344. }) => {
  345. console.log(data);
  346. if (data.user.hanging != 0) {
  347. this.navList[3].isnew = 2;
  348. }
  349. if (data.user.hanging == 0) {
  350. this.navList[3].isnew = 1;
  351. }
  352. if (data.user.paid != 0) {
  353. this.navList[1].isnew = 2;
  354. }
  355. if (data.user.paid == 0) {
  356. this.navList[1].isnew = 1;
  357. }
  358. if (data.user.reviewed != 0) {
  359. this.navList[2].isnew = 2;
  360. }
  361. if (data.user.reviewed == 0) {
  362. this.navList[2].isnew = 1;
  363. }
  364. if (data.seller.reviewed != 0) {
  365. this.navList1[3].isnew = 2;
  366. }
  367. if (data.seller.reviewed == 0) {
  368. this.navList1[3].isnew = 1;
  369. }
  370. });
  371. },
  372. // 查看大图
  373. lookimg(src) {
  374. console.log(src);
  375. let arr = [src];
  376. uni.previewImage({
  377. current: src,
  378. urls: arr
  379. });
  380. },
  381. //申诉和取消申诉
  382. appeal(item) {
  383. const obj = this;
  384. if (this.loading) {
  385. return;
  386. }
  387. this.loading = true;
  388. if (item.appeal == 0) {
  389. uni.showModal({
  390. title: '提示',
  391. content: '提交申诉后会导致被冻结,是否继续提交申诉',
  392. success: function(res) {
  393. if (res.confirm) {
  394. uni.showLoading({
  395. title: '申诉中'
  396. });
  397. plead({
  398. order_id: item.order_id
  399. }).then(e => {
  400. uni.hideLoading();
  401. obj.$api.msg('申诉成功');
  402. obj.loadData('reload');
  403. obj.loading = false;
  404. });
  405. } else if (res.cancel) {
  406. console.log('用户点击取消');
  407. }
  408. }
  409. });
  410. } else {
  411. uni.showModal({
  412. title: '提示',
  413. content: '提交撤销申诉后会导致画被解冻,是否继续提交取消申诉',
  414. success: function(res) {
  415. if (res.confirm) {
  416. uni.showLoading({
  417. title: '取消申诉中'
  418. });
  419. revoke({
  420. order_id: item.order_id
  421. }).then(e => {
  422. uni.hideLoading();
  423. obj.$api.msg('取消申诉成功');
  424. obj.loadData('reload');
  425. obj.loading = false;
  426. });
  427. } else if (res.cancel) {
  428. console.log('用户点击取消');
  429. }
  430. }
  431. });
  432. }
  433. },
  434. //跳转到订单详情
  435. goToOrderDetail(e) {
  436. console.log(11);
  437. uni.navigateTo({
  438. url: '/pages/order/hallorderDetail?id=' + e.order_id
  439. });
  440. },
  441. gsell(item) {
  442. if (item.frozen) {
  443. return this.$api.msg('已冻结,请联系客服或与卖家协商');
  444. } else {
  445. uni.navigateTo({
  446. url: '/pages/hall/gsell?id=' + item.product_id
  447. });
  448. }
  449. },
  450. //卖家确认订单
  451. orderPay(e) {
  452. const obj = this;
  453. if (this.loading) {
  454. return;
  455. }
  456. uni.showModal({
  457. title: '提示',
  458. content: '通过后产品将由对方寄售',
  459. success: function(res) {
  460. if (res.confirm) {
  461. uni.showLoading({
  462. title: '确认订单中'
  463. });
  464. this.loading = true;
  465. adopt({
  466. order_id: e.order_id
  467. }).then(({
  468. data
  469. }) => {
  470. console.log('1111');
  471. uni.hideLoading();
  472. obj.loading = false;
  473. obj.loadData('reload');
  474. obj.upData();
  475. });
  476. } else if (res.cancel) {
  477. console.log('用户点击取消');
  478. }
  479. }
  480. });
  481. },
  482. //取消挂售
  483. cancel(e) {
  484. const obj = this;
  485. uni.showModal({
  486. title: '提示',
  487. content: '是否取消挂售',
  488. success: function(res) {
  489. if (res.confirm) {
  490. if (obj.loading) {
  491. return;
  492. }
  493. obj.loading = true;
  494. uni.showLoading({
  495. title: '取消挂售中'
  496. });
  497. cancel({
  498. id: e.id
  499. }).then(({
  500. data
  501. }) => {
  502. uni.hideLoading();
  503. obj.loading = false;
  504. obj.loadData('reload');
  505. obj.upData();
  506. });
  507. } else if (res.cancel) {}
  508. }
  509. });
  510. },
  511. //获取订单列表
  512. loadData(source) {
  513. //这里是将订单挂载到tab列表下
  514. let index, navItem;
  515. if (this.currentIndex == 0) {
  516. index = this.tabCurrentIndex;
  517. navItem = this.navList[index];
  518. }
  519. if (this.currentIndex == 1) {
  520. index = this.tabCurrentIndex1;
  521. navItem = this.navList1[index];
  522. }
  523. console.log(source, 'load');
  524. let state = navItem.state;
  525. // if ( navItem.loaded === true) {
  526. // //tab切换只有第一次需要加载数据
  527. // return;
  528. // }
  529. if (navItem.loadingType === 'loading') {
  530. //防止重复加载
  531. return;
  532. }
  533. if (source == 'reload') {
  534. navItem.orderList = [];
  535. navItem.page = 1;
  536. navItem.limit = 10;
  537. navItem.loadingType = 'loadmore';
  538. }
  539. if (navItem.loadingType === 'nomore') {
  540. //防止重复加载
  541. return;
  542. }
  543. // 修改当前对象状态为加载中
  544. navItem.loadingType = 'loading';
  545. if (this.currentIndex == 0) {
  546. user_auction_order({
  547. type: state,
  548. page: navItem.page,
  549. limit: navItem.limit
  550. })
  551. .then(({
  552. data
  553. }) => {
  554. let arr = data.map(e => {
  555. console.log(e);
  556. e.create_time = e.create_time.split(' ')[0];
  557. if (state == 4) {
  558. e.stateTip = '待挂售';
  559. e.stateTipColor = '#fa436a';
  560. } else {
  561. if (e.status == 3 && e.is_gs == 0) {
  562. e.stateTip = '待挂售';
  563. e.stateTipColor = '#fa436a';
  564. } else {
  565. let b = this.orderStateExp(e.status);
  566. e.stateTip = b.stateTip;
  567. e.stateTipColor = b.stateTipColor;
  568. }
  569. }
  570. return e;
  571. });
  572. console.log(arr, '123456');
  573. navItem.orderList = navItem.orderList.concat(arr);
  574. // console.log(navItem.orderList);
  575. navItem.page++;
  576. if (navItem.limit == data.length) {
  577. //判断是否还有数据, 有改为 more, 没有改为noMore
  578. navItem.loadingType = 'loadmore';
  579. return;
  580. } else {
  581. //判断是否还有数据, 有改为 more, 没有改为noMore
  582. navItem.loadingType = 'nomore';
  583. }
  584. uni.hideLoading();
  585. this.$set(navItem, 'loaded', true);
  586. })
  587. .catch(e => {
  588. console.log(e);
  589. });
  590. }
  591. if (this.currentIndex == 1) {
  592. seller({
  593. type: state,
  594. page: navItem.page,
  595. limit: navItem.limit
  596. })
  597. .then(({
  598. data
  599. }) => {
  600. console.log(data);
  601. let arr = data.map(e => {
  602. if (state == 4) {
  603. e.stateTip = '售卖中';
  604. e.stateTipColor = '#fa436a';
  605. } else {
  606. if (e.status == 3 && e.appeal == 1) {
  607. e.stateTip = '冻结中';
  608. e.stateTipColor = '#fa436a';
  609. } else {
  610. let b = this.orderStateExp(e.status);
  611. e.stateTip = b.stateTip;
  612. e.stateTipColor = b.stateTipColor;
  613. }
  614. }
  615. return e;
  616. });
  617. navItem.orderList = navItem.orderList.concat(arr);
  618. // console.log(navItem.orderList);
  619. navItem.page++;
  620. if (navItem.limit == data.length) {
  621. //判断是否还有数据, 有改为 more, 没有改为noMore
  622. navItem.loadingType = 'loadmore';
  623. return;
  624. } else {
  625. //判断是否还有数据, 有改为 more, 没有改为noMore
  626. navItem.loadingType = 'nomore';
  627. }
  628. uni.hideLoading();
  629. this.$set(navItem, 'loaded', true);
  630. })
  631. .catch(e => {
  632. console.log(e);
  633. });
  634. }
  635. },
  636. //swiper 切换
  637. changeTab(e) {
  638. if (this.currentIndex == 0) {
  639. this.tabCurrentIndex = e.target.current;
  640. }
  641. if (this.currentIndex == 1) {
  642. this.tabCurrentIndex1 = e.target.current;
  643. }
  644. this.loadData('reload');
  645. },
  646. //删除订单
  647. deleteOrder(index) {
  648. uni.showLoading({
  649. title: '请稍后'
  650. });
  651. setTimeout(() => {
  652. this.navList[this.tabCurrentIndex].orderList.splice(index, 1);
  653. uni.hideLoading();
  654. }, 600);
  655. },
  656. //取消订单
  657. call(item) {
  658. console.log(item.phone);
  659. uni.makePhoneCall({
  660. phoneNumber: item.phone //仅为示例
  661. });
  662. },
  663. //订单状态文字和颜色
  664. orderStateExp(state) {
  665. let stateTip = '',
  666. stateTipColor = '#fa436a';
  667. switch (+state) {
  668. case 0:
  669. stateTip = '已过期';
  670. break;
  671. case 1:
  672. stateTip = '待支付';
  673. break;
  674. case 2:
  675. stateTip = '待审核';
  676. break;
  677. case 3:
  678. stateTip = '已完成';
  679. break;
  680. case undefined:
  681. stateTip = '待挂售';
  682. break;
  683. case 9:
  684. stateTip = '订单已关闭';
  685. stateTipColor = '#909399';
  686. break;
  687. //更多自定义
  688. }
  689. return {
  690. stateTip,
  691. stateTipColor
  692. };
  693. }
  694. }
  695. };
  696. </script>
  697. <style lang="scss">
  698. page,
  699. .content {
  700. background: $page-color-base;
  701. height: 100%;
  702. }
  703. .order-title {
  704. width: 750rpx;
  705. height: 270rpx;
  706. background: url(../../static/img/myfans.png) repeat-x 0;
  707. display: flex;
  708. flex-direction: column;
  709. // padding: 50rpx 0;
  710. text-align: center;
  711. .body-title {
  712. height: 80rpx;
  713. text-align: center;
  714. font-size: 35rpx;
  715. position: relative;
  716. .header {
  717. position: absolute;
  718. left: 0;
  719. top: 30rpx;
  720. width: 100%;
  721. font-size: 36rpx;
  722. font-family: PingFang SC;
  723. font-weight: bold;
  724. color: #fffeff;
  725. height: 80rpx;
  726. font-size: 36rpx;
  727. font-weight: 700;
  728. z-index: 9;
  729. display: flex;
  730. justify-content: center;
  731. align-items: center;
  732. }
  733. .goback-box {
  734. position: absolute;
  735. left: 18rpx;
  736. top: 30rpx;
  737. height: 80rpx;
  738. display: flex;
  739. align-items: center;
  740. }
  741. .goback {
  742. z-index: 100;
  743. width: 34rpx;
  744. height: 34rpx;
  745. }
  746. }
  747. text {
  748. margin: 30px 0;
  749. font-size: 17px;
  750. font-family: PingFang SC;
  751. font-weight: bold;
  752. color: #ffffff;
  753. }
  754. .roder-content {
  755. margin-top: 80rpx;
  756. display: flex;
  757. justify-content: space-around;
  758. .left {
  759. width: 168px;
  760. height: 40px;
  761. line-height: 40px;
  762. border: 1px solid #ffffff;
  763. border-radius: 5px;
  764. text-align: center;
  765. font-size: 15px;
  766. font-family: PingFang SC;
  767. font-weight: bold;
  768. color: #ffffff;
  769. background: #d5c6b2;
  770. }
  771. .current {
  772. color: #BB9159;
  773. background: #ffffff;
  774. }
  775. }
  776. }
  777. .swiper-box {
  778. background: red;
  779. }
  780. .list-scroll-content {
  781. height: 100%;
  782. }
  783. .uni-swiper-item {
  784. height: auto;
  785. }
  786. .navbar {
  787. display: flex;
  788. height: 40px;
  789. padding: 0 5px;
  790. background: #fff;
  791. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  792. position: relative;
  793. z-index: 10;
  794. .nav-item {
  795. flex: 1;
  796. display: flex;
  797. justify-content: center;
  798. align-items: center;
  799. height: 100%;
  800. font-size: 15px;
  801. color: $font-color-dark;
  802. position: relative;
  803. .dian {
  804. position: absolute;
  805. top: 20rpx;
  806. right: 10rpx;
  807. width: 12rpx;
  808. height: 12rpx;
  809. border-radius: 50%;
  810. // background-color: $base-color;
  811. }
  812. &.current {
  813. color: #d9b789;
  814. &:after {
  815. content: '';
  816. position: absolute;
  817. left: 50%;
  818. bottom: 0;
  819. transform: translateX(-50%);
  820. width: 44px;
  821. height: 0;
  822. border-bottom: 2px solid #d9b789;
  823. }
  824. }
  825. }
  826. }
  827. .order-item {
  828. display: flex;
  829. flex-direction: column;
  830. background: #fff;
  831. margin: 16rpx 30rpx 0 30rpx;
  832. border-radius: 20rpx;
  833. overflow: hidden;
  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. .goods-img {
  887. display: block;
  888. width: 120rpx;
  889. height: 120rpx;
  890. }
  891. .right {
  892. flex: 1;
  893. display: flex;
  894. flex-direction: column;
  895. padding: 0 0 0 24rpx;
  896. overflow: hidden;
  897. .row {
  898. margin-top: 10rpx;
  899. }
  900. .row_title {
  901. padding: 5rpx 10rpx;
  902. background-color: #dddddd;
  903. border-radius: 10rpx;
  904. font-size: 22rpx;
  905. color: #ffffff;
  906. }
  907. .title {
  908. font-size: $font-base + 2rpx;
  909. color: $font-color-dark;
  910. line-height: 1;
  911. width: 80%;
  912. }
  913. .attr-box {
  914. display: flex;
  915. justify-content: flex-end;
  916. font-size: $font-sm + 2rpx;
  917. color: $font-color-light;
  918. }
  919. .price {
  920. display: inline;
  921. font-size: $font-base + 2rpx;
  922. color: $font-color-dark;
  923. &:before {
  924. content: '¥';
  925. font-size: $font-sm;
  926. }
  927. }
  928. }
  929. }
  930. .buy-box {
  931. padding: 10rpx 22rpx;
  932. background-color: #ffffff;
  933. .buy-info {
  934. display: flex;
  935. align-items: center;
  936. .font {
  937. font-size: $font-base;
  938. font-weight: 500;
  939. color: #333333;
  940. }
  941. .avter {
  942. margin-left: 10rpx;
  943. width: 46rpx;
  944. height: 46rpx;
  945. border-radius: 50%;
  946. }
  947. .buy-name {
  948. margin-left: 10rpx;
  949. font-size: 32rpx;
  950. font-family: PingFang SC;
  951. font-weight: bold;
  952. color: #333333;
  953. }
  954. .phone {
  955. margin-left: 12rpx;
  956. font-size: 24rpx;
  957. font-family: PingFang SC;
  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-family: PingFang SC;
  972. font-weight: 500;
  973. color: #6d7c88;
  974. }
  975. .img-wrap {
  976. width: 153rpx;
  977. height: 152rpx;
  978. border-radius: 20rpx;
  979. image {
  980. border-radius: 20rpx;
  981. width: 153rpx;
  982. height: 152rpx;
  983. background-color: #ccc;
  984. }
  985. }
  986. }
  987. .price-box {
  988. display: flex;
  989. justify-content: flex-end;
  990. align-items: baseline;
  991. padding: 20rpx 30rpx;
  992. font-size: $font-sm + 2rpx;
  993. color: $font-color-light;
  994. .num {
  995. margin: 0 8rpx;
  996. color: $font-color-dark;
  997. }
  998. .price {
  999. font-size: $font-lg;
  1000. color: $font-color-dark;
  1001. &:before {
  1002. content: '¥';
  1003. font-size: $font-sm;
  1004. margin: 0 2rpx 0 8rpx;
  1005. }
  1006. }
  1007. }
  1008. .action-box {
  1009. padding: 0 30rpx;
  1010. height: 100rpx;
  1011. position: relative;
  1012. .time{
  1013. font-size: $font-sm;
  1014. color: $font-color-light;
  1015. }
  1016. }
  1017. .refuse {
  1018. margin: 0;
  1019. padding: 0;
  1020. width: 160rpx;
  1021. height: 60rpx;
  1022. border: 2rpx solid #ebebeb;
  1023. border-radius: 28rpx;
  1024. text-align: center;
  1025. line-height: 60rpx;
  1026. font-size: 26rpx;
  1027. font-family: PingFang SC;
  1028. font-weight: 500;
  1029. color: #999999;
  1030. &:after {
  1031. border-radius: 100px;
  1032. }
  1033. &.recom {
  1034. color: #999999;
  1035. &:after {
  1036. border-color: #999999;
  1037. }
  1038. }
  1039. }
  1040. .action-btn {
  1041. min-width: 160rpx;
  1042. height: 60rpx;
  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>