order.vue 27 KB

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