index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  1. <template>
  2. <app-layout>
  3. <view class="order-box">
  4. <view v-if="is_show" class='content-box'>
  5. <template v-if="orders.length">
  6. <view v-for='(item, index) in orders' :key='item.id'
  7. :style="{'margin-top': index == 0 ? '24rpx' : '0'}" class='order-item-box dir-top-wrap'>
  8. <app-jump-button
  9. :url="item.id | getPageUrl(currentIndex)">
  10. <view class="dir-top-nowrap" style="width: 100%">
  11. <view class='dir-left-nowrap view-1'>
  12. <view class='box-grow-1'>订单号:{{item.order_no}}</view>
  13. <template v-if='item.status == 0'>
  14. <text v-if='item.sign == "pintuan"'>{{item.is_pay == 1 ? '拼团中' : '待付款'}}</text>
  15. </template>
  16. <template v-else>
  17. <view>{{item.status_text}}</view>
  18. </template>
  19. </view>
  20. <view v-for='(dItem) in item.detail' :key='dItem.id' class='view-2'>
  21. <app-order-goods-info :goods='dItem.goods_info'></app-order-goods-info>
  22. </view>
  23. </view>
  24. </app-jump-button>
  25. <view class='dir-left-nowrap view-3 status-text'>
  26. <view class='box-grow-1'>
  27. <view v-if='item.type == 1'>
  28. 退货退款
  29. </view>
  30. <view v-else>换货</view>
  31. </view>
  32. <view v-if="item.type == 1" class='box-grow-0 dir-top-nowrap'>
  33. <text :class="{'success-color': item.is_confirm == 1 ? true : false}">
  34. 申请退款:{{item.refund_price}}
  35. </text>
  36. <text style="margin-top:5rpx;" v-if="item.is_refund == 1" :class="{'success-color': item.is_confirm == 1 ? true : false}">
  37. 实际退款:{{item.reality_refund_price}}
  38. </text>
  39. </view>
  40. </view>
  41. </view>
  42. </template>
  43. <template v-else>
  44. <view class='not-order-box cross-center main-center'>
  45. 暂无相关订单
  46. </view>
  47. </template>
  48. </view>
  49. <app-load-text v-if="is_load_show"></app-load-text>
  50. <view class="return-index-btn" v-if="show_index">
  51. <app-jump-button open_type="redirect" url="/pages/index/index">
  52. <image src="/static/image/icon/index.png" style="width: 50rpx;height: 50rpx"></image>
  53. </app-jump-button>
  54. </view>
  55. </view>
  56. </app-layout>
  57. </template>
  58. <script>
  59. import appOrderGoodsInfo from '../../../components/page-component/app-order-goods-info/app-order-goods-info.vue';
  60. import {mapGetters} from 'vuex';
  61. export default {
  62. data() {
  63. return {
  64. page: 1,
  65. currentIndex: 5,
  66. orders: [],
  67. pagination: null,
  68. is_show: false,
  69. is_load_show: false,
  70. show_index: false,
  71. }
  72. },
  73. methods: {
  74. async getList() {
  75. try {
  76. const response = await this.$request({
  77. url: this.$api.order.list,
  78. data: {
  79. status: this.currentIndex,
  80. page: this.page,
  81. }
  82. });
  83. this.$hideLoading();
  84. let {code, data, msg} = response;
  85. this.is_load_show = false;
  86. this.is_show = true;
  87. if (code === 0) {
  88. let {list, pagination} = data;
  89. if (this.page !== 1) {
  90. this.orders = this.orders.concat(list);
  91. } else {
  92. this.orders = list;
  93. }
  94. this.page = list.length ? this.page + 1 : this.page;
  95. this.pagination = pagination;
  96. } else {
  97. uni.showModal({
  98. title: '',
  99. content: msg,
  100. showCancel: false,
  101. });
  102. }
  103. } catch (e) {
  104. this.is_load_show = false;
  105. this.$hideLoading();
  106. throw new Error(e);
  107. }
  108. },
  109. },
  110. filters: {
  111. getPageUrl(id, currentIndex) {
  112. if (currentIndex === 5) {
  113. return `/pages/order/refund-detail/refund-detail?id=${id}`
  114. }
  115. }
  116. },
  117. onReachBottom() {
  118. this.is_load_show = true;
  119. this.getList()
  120. },
  121. onShow() {
  122. this.page = 1;
  123. this.$showLoading();
  124. this.getList();
  125. this.$store.dispatch('gConfig/setTabBarBoolean', this.tabBarNavs.navs);
  126. let pages = getCurrentPages();
  127. if (pages.length < 2) {
  128. this.show_index = true;
  129. }
  130. },
  131. computed: {
  132. ...mapGetters('mallConfig', {
  133. tabBarNavs: 'getNavBar'
  134. }),
  135. },
  136. components: {
  137. 'app-order-goods-info': appOrderGoodsInfo,
  138. },
  139. }
  140. </script>
  141. <style scoped lang="scss">
  142. .order-box {
  143. width: 100%;
  144. height: 100%;
  145. }
  146. .not-order-box {
  147. height: 100vh;
  148. color: $uni-general-color-two;
  149. }
  150. .order-item-box {
  151. background: #fff;
  152. padding: 0 24#{rpx};
  153. margin: 0 24#{rpx};
  154. margin-bottom: 24#{rpx};
  155. border-radius: 16#{rpx};
  156. font-size: $uni-font-size-general-two;
  157. }
  158. .order-item-box .view-1 {
  159. width: 100%;
  160. font-size: $uni-font-size-weak-one;
  161. color: $uni-important-color-black;
  162. margin: 32#{rpx} 0;
  163. }
  164. .order-item-box .view-2 {
  165. }
  166. .order-item-box .view-3 {
  167. font-size: $uni-font-size-import-two;
  168. }
  169. .order-item-box .view-3 .btn {
  170. margin-left: 15#{rpx};
  171. }
  172. .price-color {
  173. color: $uni-important-color-black;
  174. }
  175. .status-text {
  176. margin: #{28rpx} 0;
  177. font-size: $uni-font-size-general-two;
  178. }
  179. .success-color {
  180. color: $uni-important-color-black;
  181. }
  182. .return-index-btn {
  183. position: fixed;
  184. right: 0;
  185. bottom: #{100rpx};
  186. display: inline-block;
  187. background: rgba(157, 157, 157, 0.5);
  188. padding: #{10rpx} #{20rpx};
  189. z-index: 1000;
  190. border-radius: #{10rpx} 0 0 #{10rpx}w;
  191. }
  192. .action-box-view {
  193. width: 100%;
  194. }
  195. </style>