record.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <template>
  2. <div class="exchange">
  3. <div class="top">
  4. <div class="card">
  5. <!-- <div class="card_item">
  6. <div class="my_nums">消耗积分:<span class="num">30000</span></div>
  7. <div class="my_nums">已兑换数量:<span class="num">200</span></div>
  8. </div> -->
  9. <div class="card_item">
  10. <div class="my_nums">还剩积分:<span class="num">{{useInfo.jifen}}</span></div>
  11. </div>
  12. <image src="@/static/images/gift/gift.png" mode="" class="icon_6"></image>
  13. </div>
  14. </div>
  15. <div class='record'>
  16. <div class="tabs">
  17. <u-tabs ref="tabs" :list="tabList" active-color="#F5222D" :current="current" :show-bar="false"
  18. @change="changeTab"></u-tabs>
  19. </div>
  20. <div class="list" v-if="list.length>0">
  21. <div class="item" @click="RecordDetail(item.id)" v-for="item in list" :key="item.id">
  22. <div class="time">{{item.order_time}}</div>
  23. <div class="goods">
  24. <div class="icon">
  25. <image v-if="item.goods && item.goods.good" :src="item.goods.good.cover" mode="" class="icon"></image>
  26. </div>
  27. <div class="right">
  28. <div class="name">{{item.goods? item.goods.good.name:'--'}}</div>
  29. <div class="btn">
  30. <div class="num">数量:{{item.nums}}</div>
  31. <div class="jifen">-{{item.jifen}}<span style="font-size: 12px;">积分</span></div>
  32. </div>
  33. </div>
  34. </div>
  35. <div class="tag zuofei" v-if="item.status==0">已作废</div>
  36. <div class="tag wait" v-if="item.status==1">待审核</div>
  37. <div class="tag wait_fh" v-if="item.status==2">待发货</div>
  38. <div class="tag all_fh" v-if="item.status==3">待收货</div>
  39. <div class="tag complate" v-if="item.status==4">已完成</div>
  40. <image v-if="item.status==0" src="../../static/images/gift/zf.png" mode="" class="zf_icon"></image>
  41. </div>
  42. </div>
  43. <div class="empty_image" v-else>
  44. <u-empty text="暂无兑换记录!"></u-empty>
  45. </div>
  46. </div>
  47. </div>
  48. </div>
  49. </template>
  50. <script>
  51. export default {
  52. data() {
  53. return {
  54. tabList: [{
  55. name: '全部',
  56. id: ''
  57. }, {
  58. name: '待审核',
  59. id: 1
  60. }, {
  61. name: '待发货',
  62. id: 2
  63. }, {
  64. name: '待收货',
  65. id: 3
  66. }, {
  67. name: '已完成',
  68. id: 4
  69. }, {
  70. name: '已作废',
  71. id: 0
  72. }],
  73. list: [],
  74. current: 0,
  75. status: '',
  76. useInfo: {}
  77. }
  78. },
  79. onShow() {
  80. this.useInfo = this.vuex_user
  81. this.page = 1
  82. this.last = false
  83. this.list = []
  84. this.getList()
  85. },
  86. onReachBottom() {
  87. if (!this.last) {
  88. this.page++
  89. }
  90. this.getList()
  91. },
  92. methods: {
  93. RecordDetail(id) {
  94. uni.navigateTo({
  95. url: '/pages/gift/record_detail?id=' + id
  96. })
  97. },
  98. //重置列表请求
  99. resetList() {
  100. this.page = 1
  101. this.last = false
  102. this.list = []
  103. this.getList()
  104. },
  105. //切换分类
  106. changeTab(index) {
  107. this.current = index;
  108. if (index == 0) this.status = ''
  109. else this.status = this.tabList[index].id
  110. this.resetList()
  111. },
  112. getList() {
  113. this.$u.get('/dwbs/shop/orders', {
  114. page: this.page,
  115. user_id: this.vuex_user.id,
  116. status: this.status
  117. }).then(res => {
  118. console.log(res, 'list')
  119. let data = res.data.data
  120. if (this.page > 1 && data.length == 0) {
  121. uni.showToast({
  122. title: '暂无更多',
  123. icon: 'none'
  124. })
  125. this.last = true
  126. } else {
  127. this.list = this.list.concat(data)
  128. }
  129. })
  130. },
  131. }
  132. }
  133. </script>
  134. <style lang="scss" scoped>
  135. page {
  136. background-color: #f5f5f5;
  137. padding-bottom: 16px;
  138. }
  139. .exchange {
  140. .top {
  141. background-color: #fff;
  142. padding: 12px;
  143. .card {
  144. padding: 20px;
  145. position: relative;
  146. background: linear-gradient(270deg, #FF571B 0%, #F5222D 100%);
  147. border-radius: 10px;
  148. .card_item {
  149. display: flex;
  150. align-items: center;
  151. .my_nums {
  152. font-weight: 400;
  153. font-size: 18px;
  154. color: #fff;
  155. flex: 1;
  156. text-align: left;
  157. .num {
  158. font-size: 20px;
  159. }
  160. }
  161. }
  162. .icon_6 {
  163. position: absolute;
  164. width: 37px;
  165. height: 37px;
  166. bottom: 0;
  167. right: 18px;
  168. }
  169. }
  170. }
  171. .record {
  172. padding: 10px;
  173. background-color: #fff;
  174. margin-top: 14px;
  175. border-radius: 10px;
  176. .list {
  177. .item {
  178. border-radius: 10px;
  179. background: #F9F9F9;
  180. padding: 4px 14px 14px;
  181. margin-bottom: 18px;
  182. position: relative;
  183. .time {
  184. color: #878787;
  185. font-size: 14px;
  186. }
  187. .goods {
  188. display: flex;
  189. margin-top: 8px;
  190. .icon {
  191. background-color: #fff;
  192. width: 80px;
  193. height: 64px;
  194. margin-right: 12px;
  195. border: solid 1px #fff;
  196. border-radius: 10px;
  197. overflow: hidden;
  198. }
  199. .right {
  200. flex: 1;
  201. align-items: center;
  202. position: relative;
  203. z-index: 2;
  204. .name {
  205. font-size: 18px;
  206. color: #333333;
  207. }
  208. .btn {
  209. margin-top: 22px;
  210. display: flex;
  211. .num {
  212. flex: 1;
  213. font-size: 16px;
  214. color: #6F6F6F;
  215. }
  216. .jifen {
  217. font-size: 20px;
  218. color: #FF0000;
  219. }
  220. }
  221. }
  222. }
  223. .zf_icon {
  224. position: absolute;
  225. width: 83px;
  226. height: 83px;
  227. right: 26px;
  228. bottom: 16px;
  229. z-index: 0;
  230. }
  231. .tag {
  232. position: absolute;
  233. width: 53px;
  234. height: 20px;
  235. line-height: 20px;
  236. text-align: center;
  237. top: 0;
  238. right: 0;
  239. border-radius: 0px 10px 0px 10px;
  240. opacity: 1;
  241. color: #FFFFFF;
  242. font-size: 12px;
  243. }
  244. .wait {
  245. background: #FAC858;
  246. }
  247. .zuofei {
  248. background: #A458FA;
  249. }
  250. .wait_fh {
  251. background: #FA9B58;
  252. }
  253. .all_fh {
  254. background: #586EFA;
  255. }
  256. .complate {
  257. background: #FF0000;
  258. }
  259. }
  260. }
  261. }
  262. }
  263. </style>