team.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. <template>
  2. <view class="content">
  3. <view class="content-money">
  4. <view class="status_bar"><!-- 这里是状态栏 --></view>
  5. <view class="body-title">
  6. <view class="goback-box" @click="toBack">
  7. <image class="goback" src="/static/img/fanhui.png" mode=""></image>
  8. </view>
  9. <view class="header">{{$t('money.a1')}}</view>
  10. </view>
  11. <view class="content-bg">
  12. </view>
  13. <view class="money-box">
  14. <view>{{$t('money.a2')}}</view>
  15. <view class="money">{{userWallet}}U</view>
  16. </view>
  17. <!-- 数据代办 -->
  18. <view class="box">
  19. <view class="moneybtn-box1">
  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">
  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.a7')}}</view>
  32. <view class="info-num">{{userInfo.brokerage || '0'}}</view>
  33. </view>
  34. <view class="shu"></view>
  35. <view class="info-item">
  36. <view class="info-font">{{$t('money.a8')}}</view>
  37. <view class="info-num">{{userInfo.extract || '0'}}</view>
  38. </view>
  39. </view>
  40. <view class="list flex" v-for="(item, index) in navList" :key="index">
  41. <view class="">
  42. <view class="tit" v-if="item.title === '充值'">{{$t('user.a7')}}</view>
  43. <view class="tit" v-else>{{$t('user.a6')}}</view>
  44. <view class="tim">{{item.time}}</view>
  45. </view>
  46. <view class="boxT">
  47. <view class="mon">{{item.money}}</view>
  48. </view>
  49. </view>
  50. </view>
  51. </template>
  52. <script>
  53. import {qianBao} from "@/api/wallet.js"
  54. import {
  55. gameWallet,
  56. } from "@/api/game.js";
  57. import {
  58. mapState,
  59. mapMutations
  60. } from 'vuex';
  61. import {
  62. getCommissionInfo,
  63. getUserInfo,
  64. // getUser
  65. } from '@/api/user.js';
  66. import {
  67. getMoneyStyle
  68. } from '@/utils/rocessor.js';
  69. import {
  70. mapGetters
  71. } from 'vuex';
  72. import empty from '@/components/empty';
  73. import {
  74. spreadCommission,
  75. userBalance,
  76. } from '@/api/wallet.js';
  77. export default {
  78. filters: {
  79. getMoneyStyle
  80. },
  81. components: {
  82. empty,
  83. },
  84. data() {
  85. return {
  86. userInfo: {},
  87. userWallet: '', //余额
  88. height: '',
  89. // 头部图高度
  90. maxheight: '',
  91. tabCurrentIndex: 0,
  92. orderStatusSum: 0,
  93. recharge: 0,
  94. navList: [
  95. {
  96. title: '充值',
  97. time: '10.12',
  98. money: '100',
  99. },
  100. {
  101. title: '提现',
  102. time: '10.12',
  103. money: '300',
  104. }
  105. ],
  106. money: ''
  107. };
  108. },
  109. onLoad(options) {},
  110. onShow() {
  111. this.getUserInfo();
  112. this.loadData();
  113. this.getUserWallet();
  114. this.qianBao()
  115. },
  116. methods: {
  117. // 钱包
  118. async qianBao() {
  119. const res = await qianBao()
  120. console.log('qian', res);
  121. },
  122. // 获取用户余额信息
  123. getUserWallet() {
  124. gameWallet().then((res) => {
  125. this.userWallet = +res.data.back.USDT.money.money
  126. })
  127. },
  128. getUserInfo() {
  129. getUserInfo({}).then(({
  130. data
  131. }) => {
  132. this.userInfo = data
  133. });
  134. },
  135. toBack() {
  136. uni.switchTab({
  137. url: '/pages/index/user'
  138. });
  139. },
  140. // 页面跳转
  141. navto(e) {
  142. uni.navigateTo({
  143. url: e
  144. });
  145. },
  146. //获取收入支出信息
  147. async loadData(source) {
  148. let obj = this;
  149. //这里是将订单挂载到tab列表下
  150. let index = this.tabCurrentIndex;
  151. let navItem = this.navList[index];
  152. let state = navItem.state;
  153. if (source === 'tabChange' && navItem.loaded === true) {
  154. //tab切换只有第一次需要加载数据
  155. return;
  156. }
  157. if (navItem.loadingType === 'loading') {
  158. //防止重复加载
  159. return;
  160. }
  161. // 修改当前对象状态为加载中
  162. navItem.loadingType = 'loading';
  163. spreadCommission({
  164. }, state)
  165. .then(({
  166. data
  167. }) => {
  168. if (data.length > 0) {
  169. data.forEach(e => {
  170. navItem.orderList = navItem.orderList.concat(e.list);
  171. })
  172. console.log(navItem.orderList);
  173. navItem.page++;
  174. }
  175. //判断是否还有数据, 有改为more, 没有改为noMore
  176. if (navItem.limit == data.length) {
  177. navItem.loadingType = 'more';
  178. return;
  179. } else {
  180. navItem.loadingType = 'noMore';
  181. }
  182. uni.hideLoading();
  183. this.$set(navItem, 'loaded', true);
  184. })
  185. .catch(e => {
  186. console.log(e);
  187. });
  188. },
  189. //顶部tab点击
  190. tabClick(index) {
  191. this.tabCurrentIndex = index;
  192. },
  193. }
  194. };
  195. </script>
  196. <style lang="scss">
  197. page {
  198. background: $page-color-base;
  199. height: 100%;
  200. }
  201. .status_bar {
  202. height: var(--status-bar-height);
  203. width: 100%;
  204. }
  205. .content-money {
  206. position: relative;
  207. height: 480rpx;
  208. .content-bg {
  209. position: absolute;
  210. top: 0;
  211. left: 0;
  212. right: 0;
  213. width: 750rpx;
  214. height: 480rpx;
  215. image {
  216. width: 100%;
  217. height: 100%;
  218. }
  219. }
  220. .body-title {
  221. height: 80rpx;
  222. text-align: center;
  223. font-size: 35rpx;
  224. position: relative;
  225. .header {
  226. position: absolute;
  227. left: 0;
  228. top: 0;
  229. width: 100%;
  230. font-size: 36rpx;
  231. font-family: PingFang SC;
  232. font-weight: bold;
  233. color: #ffffff;
  234. height: 80rpx;
  235. font-size: 36rpx;
  236. font-weight: 700;
  237. z-index: 9;
  238. display: flex;
  239. justify-content: center;
  240. align-items: center;
  241. }
  242. .goback-box {
  243. position: absolute;
  244. left: 18rpx;
  245. top: 0;
  246. height: 80rpx;
  247. display: flex;
  248. align-items: center;
  249. }
  250. .goback {
  251. z-index: 100;
  252. width: 34rpx;
  253. height: 34rpx;
  254. color: #ffffff
  255. }
  256. }
  257. }
  258. .info-box {
  259. width: 670rpx;
  260. height: 186rpx;
  261. background: #1d1d22;
  262. box-shadow: 0px 0px 20rpx 0px rgba(50, 50, 52, 0.06);
  263. border-radius: 20rpx;
  264. margin: -100rpx auto 0;
  265. position: relative;
  266. z-index: 2;
  267. .info-item {
  268. width: 50%;
  269. display: flex;
  270. flex-direction: column;
  271. align-items: center;
  272. line-height: 1;
  273. .info-font {
  274. font-size: 30rpx;
  275. font-family: PingFang SC;
  276. font-weight: bold;
  277. color: #e2e2e2;
  278. }
  279. .info-num {
  280. margin-top: 30rpx;
  281. font-size: 30rpx;
  282. font-family: PingFang SC;
  283. font-weight: bold;
  284. color: #ffffff;
  285. }
  286. }
  287. .shu {
  288. width: 2rpx;
  289. height: 74rpx;
  290. background: #ffffff;
  291. }
  292. }
  293. .money-box {
  294. position: relative;
  295. z-index: 2;
  296. /* #ifdef H5 */
  297. padding-top: 90rpx;
  298. /* #endif */
  299. color: #ffffff;
  300. text-align: center;
  301. /* #ifdef APP-PLUS */
  302. height: 200rpx;
  303. display: flex;
  304. flex-direction: column;
  305. justify-content: center;
  306. /* #endif */
  307. /* #ifdef MP-WEIXIN */
  308. padding-top: 40rpx;
  309. /* #endif */
  310. .money {
  311. font-size: 72rpx;
  312. font-family: PingFang SC;
  313. font-weight: bold;
  314. color: #fdb242;
  315. }
  316. .text {
  317. font-size: 30rpx;
  318. }
  319. }
  320. .box {
  321. width: 670rpx;
  322. height: 50rpx;
  323. display: flex;
  324. justify-content: space-between;
  325. align-items: center;
  326. }
  327. .moneybtn-box {
  328. display: flex;
  329. justify-content: space-between;
  330. position: relative;
  331. z-index: 2;
  332. // color: #ffffff;
  333. padding: -20rpx 10rpx;
  334. font-size: 30rpx;
  335. font-family: PingFang SC;
  336. font-weight: bold;
  337. color: #ffffff;
  338. }
  339. .moneybtn-box1 {
  340. display: flex;
  341. justify-content: space-between;
  342. position: relative;
  343. z-index: 2;
  344. color: #ffffff;
  345. padding: 40rpx 60rpx;
  346. font-size: 30rpx;
  347. font-family: PingFang SC;
  348. font-weight: bold;
  349. color: #ffffff;
  350. }
  351. .content {
  352. height: 100%;
  353. .empty-content {
  354. background-color: #ffffff;
  355. }
  356. }
  357. // border-bottom: 1px solid #ffffff;
  358. .list {
  359. margin: 40rpx 31rpx;
  360. .tit {
  361. height: 26rpx;
  362. font-size: 28rpx;
  363. font-weight: 500;
  364. color: #FFFFFF;
  365. }
  366. .tim {
  367. padding-top: 30rpx;
  368. height: 17rpx;
  369. font-size: 22rpx;
  370. font-weight: 400;
  371. color: #999999;
  372. }
  373. .boxT {
  374. .mon {
  375. height: 23rpx;
  376. font-size: 30rpx;
  377. font-weight: bold;
  378. color: #FDB242;
  379. }
  380. }
  381. }
  382. </style>