index.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222
  1. <template>
  2. <view class="content">
  3. <view class="bannerimg">
  4. <image src="../../static/img/banner.png" class="imgBanner"></image>
  5. </view>
  6. <view class="wrap leakagebox">
  7. <view class="mallList flex-start" v-if="listAll.length>0">
  8. <view class="listli rows" v-for="(item,index) in listAll" :key="index">
  9. <view class="title flex-start flsb ">
  10. <view class="titfl flex">
  11. <image src="../../static/img/img06.png" class="listimg"></image>
  12. {{item.name}}
  13. </view>
  14. </view>
  15. <view class="rowsfl">
  16. <view class="times flex-start">
  17. <image src="../../static/img/img15.png" class="iconimg"></image>
  18. 價值:
  19. <span>{{item.money}}USDT</span>
  20. </view>
  21. <view class="times flex-start">
  22. <image src="../../static/img/img28.png" class="iconimg"></image>
  23. 收益:
  24. <span>{{item.up_ratio}}</span>
  25. </view>
  26. </view>
  27. <view class="rowsfr" @click="orderopen(item.id)">立即撿漏</view>
  28. </view>
  29. </view>
  30. </view>
  31. <u-loadmore :status="status" line :loadmoreText="$t('base.加载更多')" :loadingText="$t('base.正在加载')"
  32. :nomoreText="$t('base.没有更多了')" />
  33. <taber></taber>
  34. </view>
  35. </template>
  36. <script>
  37. import {
  38. leak_list,
  39. order,
  40. } from '@/api/index.js';
  41. import taber from "@/components/footer/footer.vue";
  42. export default {
  43. components: {
  44. taber
  45. },
  46. data() {
  47. return {
  48. navIndex: 0,
  49. type: '1',
  50. listAll: [],
  51. status: 'loadmore', //'上拉加載更多','加載中','沒有更多'
  52. }
  53. },
  54. // onLoad() {
  55. // this.getList()
  56. // },
  57. onShow() {
  58. this.getList();
  59. },
  60. //监听该页面用户下拉刷新事件
  61. onPullDownRefresh() {
  62. this.getList();
  63. this.status='loadmore';
  64. setTimeout(function() {
  65. uni.stopPullDownRefresh();
  66. }, 1000);
  67. },
  68. methods: {
  69. getList() {
  70. uni.showLoading({
  71. mask: true
  72. });
  73. this.status = "loading"
  74. leak_list().then(res => {
  75. uni.hideLoading()
  76. this.listAll = res.data.map((re)=>{
  77. re.money = +re.money;
  78. return re
  79. });
  80. this.status='nomore'
  81. }).catch(err => {
  82. uni.hideLoading()
  83. uni.showToast({
  84. title: err,
  85. icon: 'none',
  86. })
  87. })
  88. },
  89. orderopen(id) {
  90. order({id}).then(res => {
  91. this.listAll=[];
  92. this.status='loadmore'
  93. this.getList();
  94. uni.showToast({
  95. title: res.msg
  96. });
  97. }).catch(err => {
  98. uni.showToast({
  99. title: err,
  100. icon: 'none',
  101. })
  102. })
  103. },
  104. },
  105. }
  106. </script>
  107. <style scoped lang="scss">
  108. .content{
  109. padding-bottom: 30rpx;
  110. }
  111. .bannerimg {
  112. width: 100%;
  113. height: 353rpx;
  114. .imgBanner {
  115. width: 100%;
  116. height: 353rpx;
  117. }
  118. }
  119. .leakagebox {
  120. position: relative;
  121. padding: 0 30rpx;
  122. }
  123. .mallList {
  124. flex-wrap: wrap;
  125. .listli {
  126. width: 330rpx;
  127. padding: 30rpx 24rpx;
  128. // border-radius: 8rpx;
  129. // background-color: #fff;
  130. // box-shadow: 0px 1px 5px 0px #C9D9F199;
  131. margin-bottom: 30rpx;
  132. margin-right: 28rpx;
  133. }
  134. .listli:nth-child(2n) {
  135. margin-right: 0;
  136. }
  137. .rows {
  138. background-color: #fff;
  139. border-radius: 20rpx;
  140. //padding: 32rpx 0;
  141. .title {
  142. margin-bottom: 20rpx;
  143. .titfl {
  144. color: #333333;
  145. font-size: 32rpx;
  146. font-weight: 700;
  147. .typeTips {
  148. width: 20rpx;
  149. height: 20rpx;
  150. border-radius: 50rpx;
  151. margin-left: 20rpx;
  152. }
  153. .red {
  154. background-color: red;
  155. }
  156. .green {
  157. background-color: #14C670;
  158. }
  159. }
  160. .price {
  161. color: #F5A94F;
  162. }
  163. }
  164. .listimg {
  165. width: 48rpx;
  166. height: 48rpx;
  167. margin-right: 10rpx;
  168. }
  169. .iconimg {
  170. width: 36rpx;
  171. height: 36rpx;
  172. margin-right: 10rpx;
  173. }
  174. .rowsfl {
  175. font-size: 28rpx;
  176. .times {
  177. margin-bottom: 24rpx;
  178. color: #828282;
  179. span {
  180. color: #333333;
  181. }
  182. }
  183. }
  184. .rowsfr {
  185. background: linear-gradient(90.89deg, #38F957 49.57%, #1DEEE1 99.24%);
  186. width: 80%;
  187. height: 64rpx;
  188. text-align: center;
  189. line-height: 64rpx;
  190. color: #040616;
  191. font-size: 28rpx;
  192. border-radius: 8rpx;
  193. margin: 0 auto;
  194. }
  195. }
  196. }
  197. </style>