fuli.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  1. <template>
  2. <view class="center">
  3. <view class="bg"></view>
  4. <view class="zong flex">
  5. <view class="info">
  6. <view class="info-num">{{ USDL || '0' }}</view>
  7. <view class="info-font">USDL</view>
  8. </view>
  9. <view class="info">
  10. <view class="info-num">{{ lucky || '0' }}</view>
  11. <view class="info-font">幸运值</view>
  12. </view>
  13. <view class="info">
  14. <view class="info-num">{{ honor || '0' }}</view>
  15. <view class="info-font">荣誉值</view>
  16. </view>
  17. </view>
  18. <view class="rule">
  19. <view class="rule-title">福利兑换规则</view>
  20. <view class="rule-main">
  21. 每{{ list.sp_exchange_origin_cost * 1 }}{{ list.sp_exchange_origin }}+{{ list.sp_exchange_bingo_time }}幸运值可兑换{{ list.sp_exchange_target_get * 1
  22. }}{{ list.sp_exchange_target }}+{{ list.sp_exchange_bingo_time }}荣誉值
  23. </view>
  24. </view>
  25. <view class="main-title">
  26. <view class="shu"></view>
  27. <view class="m-title">兑换记录</view>
  28. </view>
  29. <scroll-view scroll-y class="list-box" @scrolltolower="getList()">
  30. <!-- <view class="empty-box"><empty v-if="exchange.length === 0 || loadingType == 'nomore'"></empty></view> -->
  31. <view v-for="(item, index) in exchange" :key="index" class="list-item flex">
  32. <view class="list-left">
  33. <view class="list-title">福利兑换</view>
  34. <view class="time">{{ item.time }}</view>
  35. </view>
  36. <view class="list-right">已兑换</view>
  37. </view>
  38. <u-loadmore :status="loadingType" />
  39. </scroll-view>
  40. <view class="btn" @click="nav()">立即兑换</view>
  41. </view>
  42. </template>
  43. <script>
  44. import { getSp } from '@/api/market.js';
  45. import { lalaDetial } from '@/api/product.js';
  46. import { wallet } from '@/api/finance.js';
  47. import { getTime } from '@/utils/rocessor.js';
  48. export default {
  49. data() {
  50. return {
  51. id: '',
  52. lucky: '',
  53. honor: '',
  54. list: '',
  55. USDL: '',
  56. exchange: [],
  57. page: 1,
  58. limit: 10,
  59. loadingType: 'loadmore'
  60. };
  61. },
  62. onLoad(option) {
  63. this.id = option.id;
  64. this.loadData();
  65. this.getList();
  66. },
  67. methods: {
  68. async loadData() {
  69. lalaDetial({}, this.id)
  70. .then(({ data }) => {
  71. console.log(data);
  72. this.honor = data.exchange_point;
  73. this.lucky = data.luck_point - data.exchange_point;
  74. this.list = data.data;
  75. })
  76. .catch(e => {
  77. console.log(e);
  78. });
  79. wallet({}).then(({ data }) => {
  80. this.USDL = data.back['USDL'].money.money * 1;
  81. });
  82. },
  83. getList() {
  84. if (this.loadingType == 'nomore' || this.loadingType == 'loading') {
  85. return;
  86. }
  87. this.loadingType = 'loading';
  88. getSp(
  89. {
  90. page: this.page,
  91. limit: this.limit
  92. },
  93. this.id
  94. ).then(({ data }) => {
  95. if (data.count != 0) {
  96. data.data.forEach(e => {
  97. e.time = getTime(e.add_time);
  98. });
  99. }
  100. this.exchange = data.list;
  101. if (data.length != this.limit) {
  102. this.loadingType = 'nomore';
  103. } else {
  104. this.page++;
  105. this.loadingType = 'loadmore';
  106. }
  107. });
  108. },
  109. nav() {
  110. uni.navigateTo({
  111. url: '/pages/market/duihuan?id=' + this.id
  112. });
  113. }
  114. }
  115. };
  116. </script>
  117. <style lang="scss">
  118. .center,
  119. page {
  120. height: 100%;
  121. background: #f7fbfe;
  122. }
  123. .bg {
  124. width: 750rpx;
  125. height: 248rpx;
  126. background: linear-gradient(30deg, #2e58ff, #33eeff);
  127. border-bottom-left-radius: 150rpx;
  128. border-bottom-right-radius: 150rpx;
  129. }
  130. .zong {
  131. width: 690rpx;
  132. height: 181rpx;
  133. background: #ffffff;
  134. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  135. border-radius: 20rpx;
  136. margin: -150rpx auto 0;
  137. justify-content: space-between;
  138. padding: 0rpx 36rpx;
  139. .info {
  140. display: flex;
  141. flex-direction: column;
  142. align-items: center;
  143. .info-num {
  144. font-size: 50rpx;
  145. font-family: PingFang SC;
  146. font-weight: bold;
  147. color: #0f253a;
  148. }
  149. .info-font {
  150. font-size: 28rpx;
  151. font-family: PingFang SC;
  152. font-weight: bold;
  153. color: #6d7c88;
  154. }
  155. }
  156. }
  157. .rule {
  158. width: 690rpx;
  159. background: #ffffff;
  160. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  161. border-radius: 20rpx;
  162. margin: 16rpx auto 0;
  163. padding: 26rpx 36rpx;
  164. .rule-title {
  165. font-size: 28rpx;
  166. font-family: PingFang SC;
  167. font-weight: bold;
  168. color: #2e58ff;
  169. }
  170. .rule-main {
  171. font-size: 26rpx;
  172. font-family: PingFang SC;
  173. font-weight: 500;
  174. color: #0f253a;
  175. margin-top: 10rpx;
  176. }
  177. }
  178. .main-title {
  179. margin-top: 36rpx;
  180. display: flex;
  181. justify-content: flex-start;
  182. align-items: center;
  183. .shu {
  184. margin-left: 30rpx;
  185. width: 5rpx;
  186. height: 29rpx;
  187. background: #0f253a;
  188. border-radius: 3rpx;
  189. }
  190. .m-title {
  191. font-size: 30rpx;
  192. font-family: PingFang SC;
  193. font-weight: bold;
  194. color: #0f253a;
  195. margin-left: 16rpx;
  196. }
  197. }
  198. .list-box {
  199. margin-top: 34rpx;
  200. height: calc(100% - 260px);
  201. background-color: #ffffff;
  202. .list-item {
  203. padding: 25rpx 50rpx;
  204. border-bottom: 1px solid #f0f4f8;
  205. .list-title {
  206. font-size: 30rpx;
  207. font-family: PingFang SC;
  208. font-weight: bold;
  209. color: #666666;
  210. }
  211. .time {
  212. margin-top: 10rpx;
  213. font-size: 26rpx;
  214. font-family: PingFang SC;
  215. font-weight: 500;
  216. color: #aeaeae;
  217. }
  218. .list-right {
  219. font-size: 27rpx;
  220. font-family: PingFang SC;
  221. font-weight: 500;
  222. color: #999999;
  223. }
  224. }
  225. }
  226. .btn {
  227. position: fixed;
  228. bottom: 28rpx;
  229. left: 0;
  230. right: 0;
  231. margin: 0 auto;
  232. width: 674rpx;
  233. height: 88rpx;
  234. background: linear-gradient(0deg, #2E58FF, #32C6FF);
  235. border-radius: 44rpx;
  236. font-size: 36rpx;
  237. font-family: PingFang SC;
  238. font-weight: 500;
  239. color: #ffffff;
  240. text-align: center;
  241. line-height: 88rpx;
  242. }
  243. </style>