exchange.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <template>
  2. <view class="exchange">
  3. <view class="bg">
  4. <!-- <image src="@/static/img/bargainBg.jpg" mode=""></image> -->
  5. </view>
  6. <view class="header">
  7. <view class="data">
  8. <view class="title">
  9. 我的金豆
  10. </view>
  11. <view class="quantity">
  12. 8
  13. </view>
  14. <view class="button">
  15. 查看明细
  16. </view>
  17. </view>
  18. </view>
  19. <view class="line">
  20. 热门兑换
  21. </view>
  22. <view class="dataList">
  23. <data-list :data='data'></data-list>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import { loadIndexs } from '@/api/index.js';
  29. import dataList from '@/components/datalist.vue'
  30. export default {
  31. data() {
  32. return {
  33. data: {
  34. page: 1,
  35. limit: 10,
  36. sum: 0,
  37. loadingType: 'loadmore',
  38. data: []
  39. }
  40. }
  41. },
  42. components: {
  43. dataList
  44. },
  45. mounted() {
  46. this.init()
  47. },
  48. methods: {
  49. // 點擊搜索框
  50. clickSearch() {
  51. uni.navigateTo({
  52. url: '/pages/product/search'
  53. });
  54. },
  55. init() {
  56. this.getData()
  57. },
  58. getData() {
  59. loadIndexs().then(res => {
  60. this.data = res.data.info.bastList
  61. this.loadingType = 'nomore'
  62. })
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss" scoped>
  68. $grey: #95A0B1;
  69. $text: #333333;
  70. $red: #FF4C4C;
  71. .exchange {
  72. .bg {
  73. width: 100%;
  74. height: 400rpx;
  75. background-color: $red;
  76. image {
  77. width: 100%;
  78. }
  79. }
  80. .header {
  81. .data {
  82. padding-top: 120rpx;
  83. width: 100%;
  84. text-align: center;
  85. position: absolute;
  86. top: 0;
  87. color: #fff;
  88. height: 400rpx;
  89. .quantity,.title,.button {
  90. margin: 10rpx auto;
  91. }
  92. .title {
  93. font-size: 24rpx;
  94. }
  95. .quantity {
  96. font-size: 54rpx;
  97. font-weight: bold;
  98. }
  99. .button {
  100. padding: 10rpx;
  101. border: solid 1rpx #fff;
  102. border-radius: 40rpx;
  103. font-size: 24rpx;
  104. width: 160rpx;
  105. }
  106. }
  107. }
  108. .line {
  109. background-color: #fff;
  110. font-size: 28rpx;
  111. padding: 30rpx;
  112. color: $red;
  113. font-weight: bold;
  114. text-align: center;
  115. }
  116. .dataList {
  117. background-color: #fff;
  118. }
  119. }
  120. </style>