order.vue 27 KB

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