myPing.vue 8.0 KB

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