index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631
  1. <template>
  2. <view :style="colorStyle">
  3. <view class="my-order">
  4. <view class="header-group" style="padding-left: 20rpx;" >
  5. <view class="tabs">
  6. <u-tabs :is-scroll="true" :list="navigationList" @change="statusClick()" lineColor="#B22338"
  7. :inactiveStyle="{ color: '#999999' }" :activeStyle="{ color: '#B22338', fontWeight: 'bold' }"
  8. keyName="title"></u-tabs>
  9. </view>
  10. </view>
  11. <view class="list" v-for="(item, index) in orderList" :key="index">
  12. <view class="myclient_list">
  13. <view class="myclient_list_name">
  14. <view class="nl">
  15. {{item.mainTitle}}
  16. </view>
  17. <view class="status">
  18. {{item.grouponBizStateDesc}}
  19. </view>
  20. </view>
  21. <view class="myclient_list_content">
  22. <view class="phone">
  23. <image referrerpolicy="no-referrer" src="http://www.gzzzyd.com/groupon/home_slices/日期@2x.png" />
  24. <text>
  25. 团购日期:{{item.grouponStartTimeStr}} 至 {{item.grouponEndTimeStr}}
  26. </text>
  27. </view>
  28. <view class="time">
  29. <image referrerpolicy="no-referrer" src="http://www.gzzzyd.com/groupon/home_slices/时间@2x.png" />
  30. <text>
  31. 提货时间:{{item.takeStartTimeStr}} 至 {{item.takeEndTimeStr}}
  32. </text>
  33. </view>
  34. </view>
  35. </view>
  36. <view class="op-area">
  37. <uni-badge class="uni-badge-left-margin" :text="item.dotOrderNum || '0'" absolute="rightTop" :offset="[35, 10]" size="small">
  38. <button class="action-btn" @click="goOrderDetails(item.id, 1)">
  39. 网点订单
  40. </button>
  41. </uni-badge>
  42. <uni-badge class="uni-badge-left-margin" :text="item.allOrderNum || '0'" absolute="rightTop" :offset="[35, 10]" size="small">
  43. <button class="action-btn" @click="goOrderDetails(item.id, 2)">
  44. 全部订单
  45. </button>
  46. </uni-badge>
  47. </view>
  48. </view>
  49. <view class="loadingicon acea-row row-center-wrapper" v-if="orderList.length > 0">
  50. <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
  51. {{ loadTitle }}
  52. </view>
  53. <view v-if="orderList.length == 0">
  54. <emptyPage v-if="!loading" :title="$t(`暂无订单`)"></emptyPage>
  55. <view class="loadingicon acea-row row-center-wrapper">
  56. <text class="loading iconfont icon-jiazai" :hidden="loading == false"></text>
  57. </view>
  58. </view>
  59. </view>
  60. <!-- #ifndef MP -->
  61. <home></home>
  62. <!-- #endif -->
  63. <payment :payMode="payMode" :pay_close="pay_close" @onChangeFun="onChangeFun" :order_id="pay_order_id"
  64. :totalPrice="totalPrice"></payment>
  65. </view>
  66. </template>
  67. <script>
  68. import {
  69. getUserOrderPage,
  70. postUserOrderCancel,
  71. postUserOrderRefund
  72. } from '@/api/home.js';
  73. import {
  74. getCommanderOrder,
  75. } from '@/api/order.js';
  76. import {
  77. getUserInfo
  78. } from '@/api/user.js';
  79. import {
  80. openOrderSubscribe
  81. } from '@/utils/SubscribeMessage.js';
  82. import home from '@/components/home';
  83. import payment from '@/components/payment';
  84. import {
  85. toLogin
  86. } from '@/libs/login.js';
  87. import {
  88. mapGetters
  89. } from 'vuex';
  90. // #ifdef MP
  91. import authorize from '@/components/Authorize';
  92. // #endif
  93. import emptyPage from '@/components/emptyPage.vue';
  94. import colors from '@/mixins/color.js';
  95. export default {
  96. components: {
  97. payment,
  98. home,
  99. emptyPage,
  100. // #ifdef MP
  101. authorize
  102. // #endif
  103. },
  104. mixins: [colors],
  105. data () {
  106. return {
  107. navigationList: [{
  108. title: '全部',
  109. id: 0,
  110. grouponState: 0,
  111. }
  112. ,
  113. {
  114. title: '待收货',
  115. id: 1,
  116. grouponState: 1,
  117. },
  118. {
  119. title: '待提货',
  120. id: 2,
  121. grouponState: 2,
  122. },
  123. {
  124. title: '已完成',
  125. id: 3,
  126. grouponState: 3,
  127. },
  128. {
  129. title: '售后',
  130. id: 4,
  131. grouponState: 4,
  132. },
  133. ],
  134. loading: false, //是否加载中
  135. loadend: false, //是否加载完毕
  136. loadTitle: this.$t(`加载更多`), //提示语
  137. orderList: [], //订单数组
  138. grouponState: 0, //订单状态
  139. page: 1,
  140. limit: 5,
  141. };
  142. },
  143. computed: mapGetters(['isLogin']),
  144. onShow () {
  145. if (this.isLogin) {
  146. this.page = 1;
  147. this.orderList = []
  148. this.loadend = false;
  149. // this.onLoadFun();
  150. this.getCommanderOrderList()
  151. } else {
  152. toLogin();
  153. }
  154. },
  155. methods: {
  156. /**
  157. * 事件回调
  158. *
  159. */
  160. onChangeFun: function (e) {
  161. let opt = e;
  162. let action = opt.action || null;
  163. let value = opt.value != undefined ? opt.value : null;
  164. action && this[action] && this[action](value);
  165. },
  166. /**
  167. * 生命周期函数--监听页面加载
  168. */
  169. onLoad: function (options) {
  170. if (options.status) this.orderStatus = options.status;
  171. },
  172. /**
  173. * 去订单详情
  174. */
  175. goOrderDetails: function (grouponId, queryType) {
  176. uni.navigateTo({
  177. url: '/pages/groupbuying/leader_order_details/index?grouponId=' + grouponId + '&queryType=' + queryType
  178. });
  179. // let that = this;
  180. // if (!order_id)
  181. // return that.$util.Tips({
  182. // title: that.$t(`缺少订单号无法查看订单详情`)
  183. // });
  184. // uni.showLoading({
  185. // title: that.$t(`正在加载中`)
  186. // });
  187. // openOrderSubscribe()
  188. // .then(() => {
  189. // uni.hideLoading();
  190. // uni.navigateTo({
  191. // url: '/pages/goods/order_details/index?order_id=' + order_id
  192. // // +'&order='+JSON.stringify(order)
  193. // // +'&goods='+encodeURIComponent(JSON.stringify(order.orderGoods))
  194. // })
  195. // })
  196. // .catch(err => {
  197. // uni.hideLoading();
  198. // });
  199. },
  200. /**
  201. * 切换类型
  202. */
  203. statusClick: function (status) {
  204. console.log("status ", status)
  205. if (status.grouponState == this.grouponState) return;
  206. this.grouponState = status.grouponState;
  207. this.loadend = false;
  208. this.page = 1;
  209. this.$set(this, 'orderList', []);
  210. this.getCommanderOrderList();
  211. },
  212. getCommanderOrderList() {
  213. let that = this;
  214. if (that.loadend) return;
  215. if (that.loading) return;
  216. that.loading = true;
  217. that.loadTitle = that.$t(`加载更多`);
  218. getCommanderOrder({
  219. grouponState: that.grouponState,
  220. current: that.page,
  221. size: that.limit,
  222. }).then(res => {
  223. let list = res.data.records || [];
  224. let loadend = list.length < that.limit;
  225. that.orderList = that.$util.SplitArray(list, that.orderList);
  226. that.$set(that, 'orderList', that.orderList);
  227. that.loadend = loadend;
  228. that.loading = false;
  229. that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
  230. that.page = that.page + 1;
  231. }).catch(err => {
  232. that.loading = false;
  233. that.loadTitle = that.$t(`加载更多`);
  234. });
  235. },
  236. /**
  237. * 获取订单列表
  238. */
  239. getOrderList: function () {
  240. // let that = this;
  241. // if (that.loadend) return;
  242. // if (that.loading) return;
  243. // that.loading = true;
  244. // that.loadTitle = that.$t(`加载更多`);
  245. // getUserOrderPage({
  246. // userId: this.$store.state.app.uid,
  247. // current: that.page,
  248. // size: that.limit,
  249. // payFlag: this.orderStatus
  250. // })
  251. // .then(res => {
  252. // let list = res.data || [];
  253. // let loadend = list.length < that.limit;
  254. // that.orderList = that.$util.SplitArray(list, that.orderList);
  255. // that.$set(that, 'orderList', that.orderList);
  256. // that.loadend = loadend;
  257. // that.loading = false;
  258. // that.loadTitle = loadend ? that.$t(`没有更多内容啦~`) : that.$t(`加载更多`);
  259. // that.page = that.page + 1;
  260. // })
  261. // .catch(err => {
  262. // that.loading = false;
  263. // that.loadTitle = that.$t(`加载更多`);
  264. // });
  265. },
  266. },
  267. onReachBottom: function () {
  268. this.getCommanderOrder();
  269. }
  270. };
  271. </script>
  272. <style scoped lang="scss">
  273. .my-order .header {
  274. height: 220rpx;
  275. padding: 0 30rpx;
  276. }
  277. .my-order .header .picTxt {
  278. height: 160rpx;
  279. }
  280. .my-order .header .picTxt .text {
  281. color: rgba(255, 255, 255, 0.8);
  282. font-size: 26rpx;
  283. font-family: 'Guildford Pro';
  284. }
  285. .my-order .header .picTxt .text .name {
  286. font-size: 34rpx;
  287. font-weight: bold;
  288. color: #fff;
  289. margin-bottom: 20rpx;
  290. }
  291. .my-order .header .picTxt .pictrue {
  292. width: 122rpx;
  293. height: 109rpx;
  294. }
  295. .my-order .header .picTxt .pictrue image {
  296. width: 100%;
  297. height: 100%;
  298. }
  299. .my-order .nav {
  300. background-color: #F9F9F9;
  301. width: 100%;
  302. // height: 140rpx;
  303. }
  304. .my-order .nav .item {
  305. text-align: center;
  306. font-size: 26rpx;
  307. color: #282828;
  308. padding: 27rpx 0;
  309. border-bottom: 5rpx solid transparent;
  310. }
  311. .my-order .nav .item.on {
  312. /* #ifdef H5 || MP */
  313. font-weight: bold;
  314. /* #endif */
  315. /* #ifdef APP-PLUS */
  316. color: #000;
  317. /* #endif */
  318. border-color: var(--view-theme);
  319. }
  320. .my-order .nav .item .num {
  321. margin-top: 18rpx;
  322. }
  323. .list {
  324. width: 100%;
  325. background: white;
  326. margin: 14rpx auto 0 auto;
  327. }
  328. .noCart {
  329. margin-top: 171rpx;
  330. padding-top: 0.1rpx;
  331. }
  332. .noCart .pictrue {
  333. width: 414rpx;
  334. height: 336rpx;
  335. margin: 78rpx auto 56rpx auto;
  336. }
  337. .noCart .pictrue image {
  338. width: 100%;
  339. height: 100%;
  340. }
  341. .my-order .list .item .item-info .text .money .return {
  342. // color: var(--view-priceColor);
  343. margin-top: 10rpx;
  344. font-size: 24rpx;
  345. }
  346. .myclient_list {
  347. margin-top: 30rpx;
  348. padding: 30rpx;
  349. background: #FFFFFF;
  350. .myclient_list_name {
  351. margin-bottom: 15rpx;
  352. min-height: 44rpx;
  353. font-size: 28rpx;
  354. font-weight: 500;
  355. color: #111111;
  356. line-height: 44rpx;
  357. display: flex;
  358. flex-direction: row;
  359. justify-content: space-between;
  360. .nv {
  361. flex-grow: 1;
  362. }
  363. .status {
  364. text-align: right;
  365. margin-left: 30rpx;
  366. color: #FEA800;
  367. }
  368. }
  369. .myclient_list_content {
  370. image {
  371. width: 24rpx;
  372. height: 24rpx;
  373. margin-right: 20rpx;
  374. }
  375. .phone {
  376. margin-bottom: 15rpx;
  377. height: 44rpx;
  378. font-size: 24rpx;
  379. font-weight: 400;
  380. color: #999999;
  381. line-height: 44rpx;
  382. }
  383. .time {
  384. height: 44rpx;
  385. font-size: 24rpx;
  386. font-weight: 400;
  387. color: #999999;
  388. line-height: 44rpx;
  389. }
  390. }
  391. }
  392. .all-products-body {
  393. background: white;
  394. .all-products-item {
  395. display: flex;
  396. margin-bottom: 20rpx;
  397. image {
  398. width: 128rpx;
  399. height: 128rpx;
  400. margin-right: 20rpx;
  401. border: 2rpx solid #FFFFFF;
  402. }
  403. .all-products-item-content {
  404. flex-grow: 1;
  405. display: flex;
  406. flex-direction: column;
  407. .all-products-item-content-t {
  408. flex: 1;
  409. font-size: 24rpx;
  410. font-weight: 400;
  411. color: #333333;
  412. line-height: 40rpx;
  413. }
  414. .all-products-item-content-b {
  415. flex: 1;
  416. font-size: 28rpx;
  417. font-weight: 500;
  418. line-height: 80rpx;
  419. display: flex;
  420. justify-content: space-between;
  421. .red {
  422. display: block;
  423. font-size: 28rpx;
  424. font-weight: 500;
  425. color: #B22338 !important;
  426. margin-right: 10rpx;
  427. }
  428. .line-thr {
  429. display: block;
  430. font-size: 28rpx;
  431. font-weight: 400;
  432. color: #999999;
  433. text-decoration: line-through;
  434. }
  435. .count {
  436. font-size: 24rpx;
  437. font-weight: 400;
  438. color: #999999;
  439. margin-right: 30rpx;
  440. }
  441. }
  442. }
  443. }
  444. }
  445. .a-t {
  446. padding: 0 30rpx;
  447. display: flex;
  448. justify-content: space-between;
  449. height: 44rpx;
  450. margin-bottom: 20rpx;
  451. }
  452. .a-m {
  453. padding: 0 30rpx;
  454. .am1 {
  455. display: flex;
  456. justify-content: space-between;
  457. margin-bottom: 20rpx;
  458. .am1-1 {
  459. height: 40rpx;
  460. font-size: 28rpx;
  461. font-weight: 400;
  462. color: #111111;
  463. line-height: 40rpx;
  464. }
  465. .am1-2 {
  466. height: 36rpx;
  467. font-size: 20rpx;
  468. font-weight: 400;
  469. color: #666666;
  470. line-height: 36rpx;
  471. image {
  472. margin-left: 30rpx;
  473. vertical-align: middle;
  474. height: 34rpx;
  475. width: 34rpx;
  476. }
  477. }
  478. }
  479. .am2 {
  480. margin-bottom: 20rpx;
  481. height: 34rpx;
  482. font-size: 24rpx;
  483. font-weight: 400;
  484. color: #999999;
  485. line-height: 34rpx;
  486. }
  487. }
  488. .a-b {
  489. padding: 0 30rpx;
  490. width: 100%;
  491. background: #FFF7F8;
  492. border: 1px solid dashed #333333;
  493. height: 60rpx;
  494. line-height: 60rpx;
  495. display: flex;
  496. justify-content: space-between;
  497. .a-b1 {
  498. font-size: 20rpx;
  499. font-weight: 400;
  500. color: #666666;
  501. .red {
  502. font-size: 20rpx;
  503. font-weight: 500;
  504. color: #B22338;
  505. }
  506. }
  507. .a-b2 {
  508. image {
  509. vertical-align: middle;
  510. margin-right: 30rpx;
  511. margin-left: 30rpx;
  512. height: 34rpx;
  513. width: 34rpx;
  514. }
  515. }
  516. }
  517. .self-pickup-point {
  518. background: #FFF7F8;
  519. padding-top: 20rpx;
  520. margin: 0 30rpx;
  521. }
  522. .op-area {
  523. height: 120rpx;
  524. display: flex;
  525. justify-content: flex-end;
  526. line-height: 120rpx;
  527. padding: 20rpx 0;
  528. text-align: right;
  529. .action-btn {
  530. min-width: 200rpx;
  531. background: #FFF7F8;
  532. border-radius: 32rpx;
  533. border: 2rpx solid #B22338;
  534. margin-right: 30rpx;
  535. height: 64rpx;
  536. font-size: 24rpx;
  537. font-weight: 400;
  538. color: #B22338;
  539. line-height: 64rpx;
  540. }
  541. .info-btn {
  542. width: 200rpx;
  543. background: #F5F5F5;
  544. border-radius: 32rpx;
  545. margin-right: 30rpx;
  546. height: 64rpx;
  547. font-size: 24rpx;
  548. font-weight: 400;
  549. color: #666666;
  550. line-height: 64rpx;
  551. }
  552. .text_13 {
  553. overflow-wrap: break-word;
  554. color: rgba(178, 35, 56, 1);
  555. font-size: 12px;
  556. font-weight: NaN;
  557. text-align: center;
  558. white-space: nowrap;
  559. line-height: 18px;
  560. margin-right: 14px;
  561. }
  562. }
  563. </style>