myPing.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  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">{{happy || '0.00' }}</view>
  7. <view class="info-font">福气值</view>
  8. </view> -->
  9. <view class="info" v-for="ls in listType">
  10. <view class="info-num">{{ ls.num || '0.00' }}</view>
  11. <view class="info-font">昨日{{ ls.name }}分红值</view>
  12. </view>
  13. <!-- <view class="info">
  14. <view class="info-num">{{honor || '0.00' }}</view>
  15. <view class="info-font">荣誉值</view>
  16. </view> -->
  17. </view>
  18. <!-- <view class="money flex">
  19. <view class="money-box">
  20. <view class="money-num">{{usdt || '0.00' }}</view>
  21. <view class="money-font">昨日USDT分红池</view>
  22. </view>
  23. <view class="money-box" >
  24. <view class="money-num" style="text-align: right;">{{fil || '0.00' }}</view>
  25. <view class="money-font">昨日FIL分红池</view>
  26. </view>
  27. </view> -->
  28. <view class="join">
  29. <view class="xian"></view>
  30. <view class="join-font">参与记录</view>
  31. </view>
  32. <view v-for="(item, index) in list" :key="index" class="box" @click="nav(item)">
  33. <view class="title flex">
  34. <view class="flex clamp">
  35. <view class="log"><image src="../../static/img/pgTip.png" mode="scaleToFill"></image></view>
  36. <view class="name clamp">{{ item.name }}</view>
  37. <view class="lun">
  38. <text>{{ item.lun }}</text>
  39. <text v-if="item.status == 0">未开始</text>
  40. <text v-if="item.status == 1">已拼中</text>
  41. <text v-if="item.status == 2">未拼中</text>
  42. <text v-if="item.status == 3">已失败</text>
  43. </view>
  44. </view>
  45. <view class="more">详情</view>
  46. </view>
  47. <view class="main">
  48. <view class="main-info">
  49. <view class="main-left">参与份数</view>
  50. <view class="main-right">{{ item.fen }}人份</view>
  51. </view>
  52. <view class="main-info">
  53. <view class="main-left">参与金额</view>
  54. <view class="main-right">{{ item.money + item.type }}</view>
  55. </view>
  56. <view class="main-info">
  57. <view class="main-left">参与时间</view>
  58. <view class="main-right">{{ item.time }}</view>
  59. </view>
  60. </view>
  61. </view>
  62. <u-loadmore style="margin-top: 10rpx;" :icon="true" icon-type="flower" :status="loadtype" />
  63. </view>
  64. </template>
  65. <script>
  66. import { pinkLog, systemWallet } from '@/api/finance.js';
  67. export default {
  68. data() {
  69. return {
  70. // happy: '0.00',
  71. // luck: '0.00',
  72. // honor: '0.00',
  73. // usdt: '0.00',
  74. // fil: '0.00',
  75. list: [],
  76. listType: [], //分红数量
  77. loadtype: 'loadmore',
  78. page: 1,
  79. limit: 10,
  80. bonus: 0 //分红
  81. };
  82. },
  83. onReachBottom() {
  84. this.loadData();
  85. },
  86. onLoad() {
  87. this.loadData();
  88. this.systemWallet();
  89. },
  90. methods: {
  91. // 获取昨日分红
  92. systemWallet() {
  93. systemWallet()
  94. .then(e => {
  95. for (let a in e.data.back) {
  96. const num = +e.data.back[a].money.money;
  97. if (num > 0) {
  98. this.listType.push({
  99. name: e.data.back[a].money.money_type,
  100. num: num
  101. });
  102. }
  103. }
  104. console.log(this.listType);
  105. })
  106. .catch(e => {
  107. console.log(e);
  108. });
  109. },
  110. loadData() {
  111. let that = this;
  112. if (that.loadtype == 'nomore') {
  113. return;
  114. }
  115. that.loadtype = 'loading';
  116. pinkLog({
  117. page: that.page,
  118. limit: that.limit
  119. })
  120. .then(e => {
  121. const data = e.data.list.map(ls => {
  122. const lun = ls.group_num > 0 ? ls.group_num + '轮' : '';
  123. const time = new Date(ls.pay_time * 1000);
  124. return {
  125. name: ls.activity.name,
  126. lun,
  127. fen: 1,
  128. money: +ls.cost,
  129. type: ls.cost_money_type,
  130. time: time.getFullYear() + '-' + (time.getMonth() + 1) + '-' + time.getDate(),
  131. image: ls.activity.background_image,
  132. id: ls.id,
  133. status: ls.status
  134. };
  135. });
  136. that.list.push(...data);
  137. // 判断是否还有数据
  138. if (that.list.length >= that.limit) {
  139. that.page++;
  140. that.loadtype = 'loadmore';
  141. } else {
  142. that.loadtype = 'nomore';
  143. }
  144. })
  145. .catch(e => {
  146. console.log(e);
  147. });
  148. },
  149. nav(e) {
  150. uni.navigateTo({
  151. url: '/pages/assets/teamDetails?id=' + e.id
  152. });
  153. }
  154. }
  155. };
  156. </script>
  157. <style lang="scss">
  158. .center,
  159. page {
  160. height: 100%;
  161. background: #f7fbfe;
  162. }
  163. .bg {
  164. width: 750rpx;
  165. height: 248rpx;
  166. background: linear-gradient(90deg, #60bab0, #60bab0, #45969b);
  167. border-bottom-left-radius: 150rpx;
  168. border-bottom-right-radius: 150rpx;
  169. }
  170. .zong {
  171. width: 690rpx;
  172. height: 181rpx;
  173. background: #ffffff;
  174. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  175. border-radius: 20rpx;
  176. margin: -150rpx auto 0;
  177. justify-content: center;
  178. padding: 0rpx 36rpx;
  179. .info {
  180. display: flex;
  181. flex-direction: column;
  182. align-items: center;
  183. .info-num {
  184. font-size: 50rpx;
  185. font-family: PingFang SC;
  186. font-weight: bold;
  187. color: #0f253a;
  188. }
  189. .info-font {
  190. font-size: 28rpx;
  191. font-family: PingFang SC;
  192. font-weight: bold;
  193. color: #6d7c88;
  194. }
  195. }
  196. }
  197. .money {
  198. width: 690rpx;
  199. height: 143rpx;
  200. background: #ffffff;
  201. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  202. border-radius: 20rpx;
  203. margin: 10rpx auto 0;
  204. justify-content: space-between;
  205. padding: 0rpx 36rpx;
  206. .money-box {
  207. display: flex;
  208. flex-direction: column;
  209. .money-num {
  210. font-size: 40rpx;
  211. font-family: PingFang SC;
  212. font-weight: bold;
  213. color: #0f253a;
  214. }
  215. .money-font {
  216. font-size: 24rpx;
  217. font-family: PingFang SC;
  218. font-weight: bold;
  219. color: #6d7c88;
  220. }
  221. }
  222. }
  223. .join {
  224. margin-top: 44rpx;
  225. padding-left: 30rpx;
  226. display: flex;
  227. justify-content: flex-start;
  228. align-items: center;
  229. .xian {
  230. width: 6rpx;
  231. height: 30rpx;
  232. background: #0f253a;
  233. border-radius: 4rpx;
  234. }
  235. .join-font {
  236. padding-left: 16rpx;
  237. font-size: 30rpx;
  238. font-family: PingFang SC;
  239. font-weight: bold;
  240. color: #0f253a;
  241. }
  242. }
  243. .box:first-child {
  244. margin-top: 34rpx;
  245. }
  246. .box {
  247. margin: 20rpx auto 0;
  248. width: 690rpx;
  249. background: #ffffff;
  250. box-shadow: 0px 0px 17rpx 0px rgba(0, 0, 0, 0.05);
  251. border-radius: 20rpx;
  252. padding: 26rpx 36rpx 30rpx 30rpx;
  253. position: relative;
  254. .title {
  255. .log {
  256. width: 48rpx;
  257. height: 46rpx;
  258. image {
  259. width: 100%;
  260. height: 100%;
  261. }
  262. }
  263. .name {
  264. padding-left: 12rpx;
  265. font-size: 34rpx;
  266. font-family: PingFang SC;
  267. font-weight: bold;
  268. color: #0f253a;
  269. max-width: 100%;
  270. }
  271. .lun {
  272. padding-left: 10rpx;
  273. font-size: 26rpx;
  274. font-family: PingFang SC;
  275. font-weight: 500;
  276. color: #6d7c88;
  277. }
  278. .more {
  279. padding-left: 10rpx;
  280. font-size: 28rpx;
  281. font-family: PingFang SC;
  282. font-weight: bold;
  283. color: #44969d;
  284. flex-shrink: 0;
  285. }
  286. }
  287. .main {
  288. margin-top: 26rpx;
  289. .main-info {
  290. padding-top: 16rpx;
  291. display: flex;
  292. justify-content: space-between;
  293. .main-left {
  294. font-size: 26rpx;
  295. font-family: PingFang SC;
  296. font-weight: 500;
  297. color: #6d7c88;
  298. }
  299. .main-right {
  300. font-size: 26rpx;
  301. font-family: PingFang SC;
  302. font-weight: bold;
  303. color: #0f253a;
  304. }
  305. }
  306. }
  307. }
  308. </style>