team.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318
  1. <template>
  2. <view class="content">
  3. <view class="type flex-start">
  4. <view class="item" :class="{action:type=='USDT'}" @click="onchangeType('USDT')">
  5. USDT
  6. </view>
  7. <view class="item" :class="{action:type=='PKR'}" @click="onchangeType('PKR')">
  8. PKR
  9. </view>
  10. </view>
  11. <view class="content-money flex">
  12. <view class="money-box">
  13. <view class="margin-b-20">{{$t('money.a2')}}</view>
  14. <view class="money" v-if="type=='PKR'">{{userInfo.pkr}}</view>
  15. <view class="money" v-if="type=='USDT'">{{userInfo.usdt}}</view>
  16. </view>
  17. <!-- 数据代办 -->
  18. <view class="box">
  19. <view class="moneybtn-box">
  20. <view class="money-btn"></view>
  21. <view class="money-btn" @click="navto('/pages/user/money/recharge')">{{$t('money.a3')}}</view>
  22. </view>
  23. <view class="moneybtn-box margin-t-10">
  24. <view class="money-btn"></view>
  25. <view class="money-btn" @click="navto('/pages/user/money/withdrawal')">{{$t('money.a4')}}</view>
  26. </view>
  27. </view>
  28. </view>
  29. <view class="info-box flex">
  30. <view class="info-item">
  31. <view class="info-font">{{$t('money.a5')}}</view>
  32. <view class="info-num">{{userInfo.sum_income|| '0'}}</view>
  33. </view>
  34. <view class="shu"></view>
  35. <view class="info-item">
  36. <view class="info-font">{{$t('money.a6')}}</view>
  37. <view class="info-num">{{userInfo.sum_expend || '0'}}</view>
  38. </view>
  39. </view>
  40. <scroll-view :style="{height:height}" scroll-y="true" class="padding-b-20 padding-c-30 list-scroll-content"
  41. @scrolltolower="loadData">
  42. <!-- 订单列表 -->
  43. <view class="list flex padding-v-30" v-for="(item, index) in list" :key="index">
  44. <view>
  45. <view class="tit padding-b-20">{{item.mark}}</view>
  46. <view class="tim">{{item.add_time}}</view>
  47. </view>
  48. <view class="boxT">
  49. <text v-if="item.pm==1">+</text>
  50. <text v-if="item.pm==0">-</text>
  51. <text class="mon">{{item.number*1}}</text>
  52. </view>
  53. </view>
  54. </scroll-view>
  55. </view>
  56. </template>
  57. <script>
  58. import {
  59. getMoneyLog
  60. } from "@/api/wallet.js"
  61. import {
  62. gameWallet,
  63. } from "@/api/game.js";
  64. import {
  65. getMoneyStyle
  66. } from '@/utils/rocessor.js';
  67. import empty from '@/components/empty';
  68. export default {
  69. filters: {
  70. getMoneyStyle
  71. },
  72. components: {
  73. empty,
  74. },
  75. data() {
  76. return {
  77. userInfo: {
  78. sum_expend:'',
  79. sum_income:'',
  80. pkr:'',
  81. usdt:''
  82. },
  83. userWallet: '', //余额
  84. height: '',
  85. loaded: false,
  86. list: [],
  87. money: '',
  88. page: 1,
  89. limit: 10,
  90. loadingType: 'more',
  91. type:"USDT"
  92. };
  93. },
  94. onLoad(options) {},
  95. onReady(res) {
  96. var _this = this;
  97. uni.getSystemInfo({
  98. success: resu => {
  99. const query = uni.createSelectorQuery();
  100. query.select('.list-scroll-content').boundingClientRect();
  101. query.exec(function(res) {
  102. console.log(res[0].top);
  103. console.log(resu.windowHeight);
  104. _this.height = resu.windowHeight - res[0].top + 'px';
  105. });
  106. },
  107. fail: res => {}
  108. });
  109. },
  110. onShow() {
  111. // this.getUserInfo();
  112. this.loadData();
  113. this.getUserWallet();
  114. },
  115. methods: {
  116. onchangeType(type){
  117. this.type = type;
  118. this.page = 1;
  119. this.loadingType = 'more';
  120. this.loaded = false;
  121. this.list = [];
  122. this.loadData();
  123. },
  124. // 获取用户余额信息
  125. getUserWallet() {
  126. gameWallet().then((res) => {
  127. this.userInfo.pkr = +res.data.back.PKR.money.money
  128. this.userInfo.usdt = +res.data.back.USDT.money.money
  129. })
  130. },
  131. // getUserInfo() {
  132. // getUserInfo({}).then(({
  133. // data
  134. // }) => {
  135. // this.userInfo = data
  136. // });
  137. // },
  138. toBack() {
  139. uni.switchTab({
  140. url: '/pages/index/user'
  141. });
  142. },
  143. // 页面跳转
  144. navto(e) {
  145. uni.navigateTo({
  146. url: e
  147. });
  148. },
  149. //获取收入支出信息
  150. async loadData(source) {
  151. let navItem = this;
  152. if (navItem.loaded === true || navItem.loadingType === 'loading') {
  153. //tab切换只有第一次需要加载数据
  154. return;
  155. }
  156. // 修改当前对象状态为加载中
  157. navItem.loadingType = 'loading';
  158. getMoneyLog({
  159. page: navItem.page,
  160. limit: navItem.limit
  161. },navItem.type)
  162. .then(({
  163. data
  164. }) => {
  165. navItem.userInfo.sum_expend = data.sum_expend;
  166. navItem.userInfo.sum_expend = data.sum_expend;
  167. navItem.list = navItem.list.concat(data.list);
  168. navItem.page++;
  169. //判断是否还有数据, 有改为more, 没有改为noMore
  170. if (navItem.limit == data.list.length) {
  171. navItem.loadingType = 'more';
  172. return;
  173. } else {
  174. navItem.loadingType = 'noMore';
  175. }
  176. uni.hideLoading();
  177. this.$set(navItem, 'loaded', true);
  178. })
  179. .catch(e => {
  180. console.log(e);
  181. });
  182. },
  183. }
  184. };
  185. </script>
  186. <style lang="scss">
  187. .content {
  188. line-height: 1;
  189. }
  190. .content-money {
  191. position: relative;
  192. padding: 60rpx 30rpx;
  193. height: 250rpx;
  194. margin-top: -20rpx;
  195. .box {
  196. position: absolute;
  197. right: 0;
  198. top: 50rpx;
  199. font-size: 30rpx;
  200. font-weight: bold;
  201. color: #ffffff;
  202. .moneybtn-box {
  203. padding: 14rpx 40rpx;
  204. border: 2px solid #FFFFFF;
  205. border-bottom-left-radius: 100rpx;
  206. border-top-left-radius: 100rpx;
  207. border-right: none;
  208. }
  209. }
  210. .money-box {
  211. position: relative;
  212. z-index: 2;
  213. color: #ffffff;
  214. text-align: left;
  215. .money {
  216. font-weight: bold;
  217. font-size: 72rpx;
  218. color: #fdb242;
  219. }
  220. }
  221. }
  222. .info-box {
  223. background: #1d1d22;
  224. border-radius: 20rpx;
  225. margin: 0 30rpx;
  226. padding: 30rpx;
  227. .info-item {
  228. width: 50%;
  229. display: flex;
  230. flex-direction: column;
  231. align-items: center;
  232. line-height: 1;
  233. .info-font {
  234. font-size: 30rpx;
  235. font-family: PingFang SC;
  236. font-weight: bold;
  237. text-align: center;
  238. color: #e2e2e2;
  239. }
  240. .info-num {
  241. margin-top: 30rpx;
  242. font-size: 30rpx;
  243. font-family: PingFang SC;
  244. font-weight: bold;
  245. color: #ffffff;
  246. }
  247. }
  248. .shu {
  249. width: 2rpx;
  250. height: 74rpx;
  251. background: #ffffff;
  252. }
  253. }
  254. .content {
  255. height: 100%;
  256. .empty-content {
  257. background-color: #ffffff;
  258. }
  259. }
  260. // border-bottom: 1px solid #ffffff;
  261. .list {
  262. border-bottom: 1px solid $font-color-light;
  263. .tit {
  264. font-size: $font-base;
  265. font-weight: 500;
  266. color: #FFFFFF;
  267. }
  268. .tim {
  269. font-size: 22rpx;
  270. font-weight: 400;
  271. color: #999999;
  272. }
  273. .boxT {
  274. font-weight: bold;
  275. font-size: 30rpx;
  276. color: #FDB242;
  277. }
  278. }
  279. .type{
  280. padding: 30rpx 30rpx 0 30rpx;
  281. font-size: 38rpx;
  282. color: #FFF;
  283. .item{
  284. padding: 20rpx 20rpx;
  285. margin-right: 10rpx;
  286. &.action{
  287. color: #FDB242;
  288. border-bottom: 1px solid #FDB242;
  289. }
  290. }
  291. }
  292. </style>