fuli.vue 5.3 KB

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