myPing.vue 8.1 KB

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