exchange_record.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <view :style="colorStyle">
  3. <block v-if="bargain.length > 0">
  4. <view class="bargain-record" ref="container">
  5. <view class="item" v-for="(item, index) in bargain" :key="index">
  6. <view class="exchange_record-time">
  7. <view class="">{{ $t(`兑换时间`) }}:{{ item.add_time }}</view>
  8. <view class="status">
  9. {{ $t(item.status_name) }}
  10. </view>
  11. </view>
  12. <view class="picTxt acea-row row-between-wrapper">
  13. <view class="pictrue">
  14. <image :src="item.image" />
  15. </view>
  16. <view class="text acea-row row-column-around">
  17. <view class="line1" style="width: 100%">{{ item.store_name }}</view>
  18. <view class="line1 gray-sty">{{ item.suk }}</view>
  19. <view class="line1 gray-sty">{{ $t(`积分`) }}:{{ item.total_price }}</view>
  20. </view>
  21. </view>
  22. <view class="bottom acea-row row-between-wrapper">
  23. <view class="end"></view>
  24. <view class="acea-row row-middle row-right">
  25. <view class="bnt cancel" v-if="item.status === 2 && item.delivery_type === 'express'"
  26. @click="getLogistics(item.order_id)">
  27. {{ $t(`查看物流`) }}
  28. </view>
  29. <view class="bnt bg-color-red" @click="goDetail(item.order_id)">
  30. {{ $t(`查看详情`) }}
  31. </view>
  32. <!-- <view class="bnt bg-color-red" v-else @click="goList">重开一个</view> -->
  33. </view>
  34. </view>
  35. </view>
  36. <Loading :loaded="status" :loading="loadingList"></Loading>
  37. </view>
  38. </block>
  39. <block v-if="bargain.length == 0">
  40. <emptyPage :title="$t(`暂无兑换记录~`)"></emptyPage>
  41. </block>
  42. <!-- #ifndef MP -->
  43. <home></home>
  44. <!-- #endif -->
  45. </view>
  46. </template>
  47. <script>
  48. import CountDown from '@/components/countDown';
  49. import emptyPage from '@/components/emptyPage.vue';
  50. import {
  51. getIntegralOrderList
  52. } from '@/api/activity';
  53. import Loading from '@/components/Loading';
  54. import home from '@/components/home';
  55. import colors from '@/mixins/color.js';
  56. export default {
  57. name: 'BargainRecord',
  58. components: {
  59. CountDown,
  60. Loading,
  61. emptyPage,
  62. home
  63. },
  64. props: {},
  65. mixins: [colors],
  66. data() {
  67. return {
  68. bargain: [],
  69. status: false, //砍价列表是否获取完成 false 未完成 true 完成
  70. loadingList: false, //当前接口是否请求完成 false 完成 true 未完成
  71. page: 1, //页码
  72. limit: 20, //数量
  73. userInfo: {}
  74. };
  75. },
  76. onShow() {
  77. this.bargain = [];
  78. this.page = 1;
  79. this.status = false
  80. this.getIntegralOrderList();
  81. },
  82. methods: {
  83. goDetail: function(id) {
  84. uni.navigateTo({
  85. url: `/pages/points_mall/integral_order_details?order_id=${id}`
  86. });
  87. },
  88. getIntegralOrderList: function() {
  89. var that = this;
  90. if (that.loadingList) return;
  91. if (that.status) return;
  92. that.loadingList = true
  93. getIntegralOrderList({
  94. page: that.page,
  95. limit: that.limit
  96. })
  97. .then((res) => {
  98. that.status = res.data.length < that.limit;
  99. that.bargain.push.apply(that.bargain, res.data);
  100. that.page++;
  101. that.loadingList = false;
  102. })
  103. .catch((res) => {
  104. that.$util.Tips({
  105. title: res
  106. });
  107. });
  108. },
  109. getLogistics(order_id) {
  110. uni.navigateTo({
  111. url: `/pages/points_mall/logistics_details?order_id=${order_id}`
  112. });
  113. }
  114. },
  115. onReachBottom() {
  116. if (!this.loadingList)
  117. this.getIntegralOrderList();
  118. }
  119. };
  120. </script>
  121. <style lang="scss">
  122. /*砍价记录*/
  123. .bargain-record .item .picTxt .text .time .styleAll {
  124. color: #fc4141;
  125. font-size: 24rpx;
  126. }
  127. .bargain-record .item .picTxt .text .time .red {
  128. color: #999;
  129. font-size: 24rpx;
  130. }
  131. .bargain-record .item {
  132. background-color: #fff;
  133. margin: 15rpx 15rpx;
  134. border-radius: 6rpx;
  135. .exchange_record-time {
  136. color: #333333;
  137. border-bottom: 1px solid #eeeeee;
  138. padding: 22rpx 30rpx;
  139. display: flex;
  140. justify-content: space-between;
  141. .status {
  142. color: var(--view-theme);
  143. }
  144. }
  145. }
  146. .bargain-record .item .picTxt {
  147. border-bottom: 1px solid #f0f0f0;
  148. padding: 30rpx 30rpx;
  149. }
  150. .bargain-record .item .picTxt .pictrue {
  151. width: 120rpx;
  152. height: 120rpx;
  153. margin-right: 30rpx;
  154. }
  155. .bargain-record .item .picTxt .pictrue image {
  156. width: 100%;
  157. height: 100%;
  158. border-radius: 6upx;
  159. }
  160. .bargain-record .item .picTxt .text {
  161. // flex:1;
  162. width: 77%;
  163. font-size: 30upx;
  164. color: #282828;
  165. }
  166. .bargain-record .item .picTxt .text .time {
  167. font-size: 24upx;
  168. color: #868686;
  169. justify-content: left !important;
  170. }
  171. .bargain-record .item .picTxt .text .successTxt {
  172. font-size: 24rpx;
  173. }
  174. .bargain-record .item .picTxt .text .endTxt {
  175. font-size: 24rpx;
  176. color: #999;
  177. }
  178. .bargain-record .item .picTxt .text .money {
  179. font-size: 24upx;
  180. }
  181. .bargain-record .item .picTxt .text .money .num {
  182. font-size: 32upx;
  183. font-weight: bold;
  184. }
  185. .bargain-record .item .picTxt .text .money .symbol {
  186. font-weight: bold;
  187. }
  188. .bargain-record .item .bottom {
  189. height: 100upx;
  190. padding: 0 30upx;
  191. font-size: 27upx;
  192. }
  193. .bargain-record .item .bottom .purple {
  194. color: #f78513;
  195. }
  196. .bargain-record .item .bottom .end {
  197. color: #999;
  198. }
  199. .bargain-record .item .bottom .success {
  200. color: #e93323;
  201. }
  202. .bargain-record .item .bottom .bnt {
  203. font-size: 27upx;
  204. color: #fff;
  205. width: 176upx;
  206. height: 60upx;
  207. border-radius: 32upx;
  208. text-align: center;
  209. line-height: 60upx;
  210. }
  211. .bargain-record .item .bottom .bnt.cancel {
  212. color: #aaa;
  213. border: 1px solid #ddd;
  214. }
  215. .bargain-record .item .bottom .bnt~.bnt {
  216. margin-left: 18upx;
  217. }
  218. .gray-sty {
  219. width: 100%;
  220. font-size: 24rpx;
  221. color: #999999;
  222. }
  223. </style>