index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516
  1. <template>
  2. <view :class="[AppTheme]" class="all_box">
  3. <view class="banner bg-linear-gradient">
  4. <view class="top">
  5. <view class="top-l">
  6. <view class="text">本月收益</view>
  7. <view class="num">{{ bysy }}</view>
  8. </view>
  9. <view class="top-2">
  10. <view class="top-2-a" @click="navTo('/pagesA/pages/mypurse/withdraw/withdraw')">提现</view>
  11. <view class="top-2-b" @click="navTo('/pagesA/pages/mypurse/recharge/recharge')">充值</view>
  12. <!-- <view v-if="deposit>0" class="top-2-c" @click="refund">退保证金</view> -->
  13. </view>
  14. </view>
  15. <view class="bottom">
  16. <view class="bottom-l">
  17. <view class="text">余额</view>
  18. <view class="num">{{ money }}</view>
  19. </view>
  20. <view class="bottom-r">
  21. <view class="text">已得收益</view>
  22. <view class="num">{{ ydsy }}</view>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="f-n">
  27. <view @click="navTo('/pagesA/pages/mypurse/txinfo/txinfo')">
  28. <u-icon labelSize="13" label="提现明细" labelPos="bottom" name="red-packet" :color="primary" size="40">
  29. </u-icon>
  30. </view>
  31. <view @click="goCode()">
  32. <u-icon labelSize="13" label="推广分享" labelPos="bottom" name="share-square" :color="primary" size="40">
  33. </u-icon>
  34. </view>
  35. <view @click="navTo('/pagesA/pages/mypurse/czinfo/czinfo')">
  36. <u-icon labelSize="13" label="充值明细" labelPos="bottom" name="rmb-circle" :color="primary" size="40">
  37. </u-icon>
  38. </view>
  39. </view>
  40. <view class="content">
  41. <u-cell-group>
  42. <u-cell @click="navTo('/pagesC/pages/user/funds/funds?id=0')" isLink icon="order" title="资金流水"></u-cell>
  43. <u-cell @click="navTo('/pagesA/pages/mypurse/other/other')" isLink icon="red-packet" title="消费记录">
  44. </u-cell>
  45. <u-cell @click="navTo('/pagesA/pages/mypurse/evidence/evidence')" isLink icon="grid" title="汇款凭证">
  46. </u-cell>
  47. </u-cell-group>
  48. </view>
  49. <!-- 分享 -->
  50. <sharebox ref="sbox" v-if="sharedata" :data="sharedata"></sharebox>
  51. <Footer></Footer>
  52. </view>
  53. </template>
  54. <script>
  55. import tabbar from '@/components/tabbar/tabbar.vue';
  56. import wallApi from '@/api/wall/index.js';
  57. import mineApi from '@/api/mine/index';
  58. export default {
  59. name: 'Purse',
  60. props: {},
  61. data() {
  62. return {
  63. primary: this.$theme.primary,
  64. more: 'more', //@value more loading前 @value loading loading中 @value noMore 没有更多了
  65. name: '上拉加载更多',
  66. bysy: 0, //本月收益
  67. money: 0, //余额
  68. dssy: 0, //待收
  69. dfyk: 0, //认领金额
  70. ydsy: 0, //已得收益
  71. // 认领+余额=资产F
  72. zican: 0,
  73. tabTitle: ['充值记录', '提现记录'],
  74. cur: 0, //默认选中第一个tab
  75. cZInfo: [], //充值记录
  76. txInfo: [], //充值记录
  77. p: 1,
  78. pagesize: 10,
  79. sharedata: null,
  80. settingFile: getApp().globalData.siteinfo
  81. }
  82. },
  83. onLoad(options) {
  84. let that = this
  85. that.$init_config(1, function(res) {
  86. that.sharedata = res.sharedata
  87. })
  88. if (options.isss) {
  89. that.cur = 1
  90. that.getTxList();
  91. } else {
  92. that.cur = 0
  93. }
  94. that.getWallInit();
  95. that.getCzList();
  96. },
  97. onShow() {
  98. let that = this
  99. that.p = 1
  100. that.getWallInit();
  101. },
  102. onReachBottom() {
  103. //如果不是最后一页 重新发送请求
  104. if (this.cur == 0) {
  105. this.p++;
  106. this.more = 'loading';
  107. setTimeout(() => {
  108. this.getCzList();
  109. }, 500);
  110. } else {
  111. this.p++;
  112. this.more = 'loading';
  113. setTimeout(() => {
  114. this.getTxList();
  115. }, 500);
  116. }
  117. },
  118. methods: {
  119. goCode: function() {
  120. this.$refs.sbox.opensharebox(this.sharedata);
  121. },
  122. navTo(url) {
  123. uni.navigateTo({
  124. url
  125. });
  126. },
  127. getWallInit() {
  128. wallApi.income({}).then(res => {
  129. if (res.status == 200) {
  130. this.ydsy = res.data.ydsy; //已得收益
  131. this.bysy = res.data.bysy; //本月收益
  132. this.money = res.data.money; //余额
  133. this.dfyk = res.data.dfyk; //认领金额
  134. this.dssy = res.data.dssy; //待收
  135. if (res.data.money) {
  136. this.zican = (Number(this.dfyk) + Number(this.money)).toFixed(2);
  137. } else {
  138. this.zican = 0;
  139. }
  140. }
  141. });
  142. },
  143. getCzList() {
  144. wallApi.czRecord({
  145. p: this.p,
  146. pagesize: this.pagesize
  147. }).then(res => {
  148. if (res.status == 200) {
  149. this.cZInfo = this.cZInfo.concat(res.data);
  150. if (res.data.length == 0 || res.data.length < 10) {
  151. this.more = 'noMore';
  152. }
  153. } else {
  154. this.more = 'noMore';
  155. }
  156. });
  157. },
  158. getTxList() {
  159. wallApi.txRecord({
  160. p: this.p,
  161. pagesize: this.pagesize
  162. }).then(res => {
  163. if (res.status == 200) {
  164. this.txInfo = this.txInfo.concat(res.data);
  165. if (res.data.length === 0 || res.data.length < 10) {
  166. this.more = 'noMore';
  167. }
  168. } else {
  169. this.more = 'noMore';
  170. }
  171. });
  172. }
  173. }
  174. }
  175. </script>
  176. <style scoped lang="scss">
  177. .botomtab {
  178. text-align: center;
  179. position: fixed;
  180. bottom: 0;
  181. height: 100rpx;
  182. width: 100vw;
  183. background: #FFFFFF;
  184. box-shadow: 10rpx 10rpx 20rpx #000000;
  185. display: flex;
  186. justify-content: space-around;
  187. .botomtab_sun {
  188. margin-top: 10rpx;
  189. image {
  190. width: 50rpx;
  191. height: 50rpx;
  192. }
  193. view {
  194. font-size: 20rpx;
  195. color: #aaaaaa
  196. }
  197. }
  198. }
  199. .u-tabs {
  200. background: #FFFFFF !important;
  201. }
  202. .jiazai {
  203. text-align: center;
  204. margin-top: 20rpx;
  205. color: #999999;
  206. }
  207. .all_box {
  208. .banner {
  209. width: 100%;
  210. height: 360rpx;
  211. background-size: 100% 100%;
  212. padding: 0px 20rpx 26rpx 40rpx;
  213. box-sizing: border-box;
  214. .text {
  215. font-size: 24rpx;
  216. font-weight: 500;
  217. color: #ffffff;
  218. margin-bottom: 20rpx;
  219. }
  220. .num {
  221. font-size: 48rpx;
  222. font-weight: bold;
  223. color: #ffffff;
  224. }
  225. .top {
  226. width: 100%;
  227. height: 102rpx;
  228. margin-bottom: 70rpx;
  229. display: flex;
  230. justify-content: space-between;
  231. padding-top: 30rpx;
  232. .top-2 {
  233. display: flex;
  234. justify-content: flex-start;
  235. align-items: center;
  236. }
  237. .top-2-a {
  238. width: 120rpx;
  239. height: 40rpx;
  240. line-height: 40rpx;
  241. color: #fff;
  242. text-align: center;
  243. margin-right: 10px;
  244. border: 3rpx solid #fff;
  245. padding: 8rpx;
  246. border-radius: 30rpx;
  247. font-weight: 600;
  248. font-size: 30rpx;
  249. }
  250. .top-2-b {
  251. width: 120rpx;
  252. height: 40rpx;
  253. line-height: 40rpx;
  254. text-align: center;
  255. color: #fff;
  256. margin-right: 10px;
  257. border: 3rpx solid #fff;
  258. padding: 8rpx;
  259. border-radius: 30rpx;
  260. font-weight: 600;
  261. font-size: 30rpx;
  262. }
  263. .top-2-c {
  264. width: 160rpx;
  265. height: 40rpx;
  266. line-height: 40rpx;
  267. text-align: center;
  268. color: #fff;
  269. margin-right: 10px;
  270. border: 3rpx solid #fff;
  271. padding: 8rpx;
  272. border-radius: 30rpx;
  273. font-weight: 600;
  274. font-size: 30rpx;
  275. }
  276. .top-r {
  277. overflow: hidden;
  278. >view {
  279. float: left;
  280. padding: 12rpx 28rpx;
  281. border: 2rpx solid #fff;
  282. margin: 0 8rpx;
  283. border-radius: 30rpx;
  284. color: #fff;
  285. font-size: 26rpx;
  286. }
  287. }
  288. }
  289. .bottom {
  290. width: 100%;
  291. height: 102rpx;
  292. display: flex;
  293. .bottom-l {
  294. margin-right: 244rpx;
  295. }
  296. }
  297. }
  298. .nav {
  299. width: 100%;
  300. height: 106rpx;
  301. padding: 0 30rpx 0 22rpx;
  302. box-sizing: border-box;
  303. background: #fff;
  304. display: flex;
  305. align-items: center;
  306. justify-content: space-between;
  307. border-bottom: 10rpx solid #f2f2f2;
  308. .nav-l {
  309. display: flex;
  310. view {
  311. font-size: 28rpx;
  312. font-weight: 500;
  313. color: #707070;
  314. margin-right: 20rpx;
  315. }
  316. text {
  317. font-size: 40rpx;
  318. color: red;
  319. margin-top: -10rpx;
  320. }
  321. }
  322. .nav-r {
  323. width: 320rpx;
  324. display: flex;
  325. justify-content: center;
  326. align-items: center;
  327. >view {
  328. width: 172rpx;
  329. height: 65rpx;
  330. display: flex;
  331. justify-content: center;
  332. align-items: center;
  333. border: 3rpx solid #ff4841;
  334. border-radius: 30rpx;
  335. font-size: 28rpx;
  336. font-weight: 600;
  337. color: #FFFFFF;
  338. margin: 0 12rpx;
  339. background-color: #ff4841;
  340. }
  341. }
  342. }
  343. .f-n {
  344. width: 100%;
  345. height: 80px;
  346. display: flex;
  347. align-items: center;
  348. margin-bottom: 15px;
  349. padding-top: 15px;
  350. font-size: 12px;
  351. font-weight: normal;
  352. color: #1c1c1c;
  353. background-color: #fff;
  354. }
  355. .f-n view {
  356. width: 100%;
  357. text-align: center;
  358. }
  359. .f-zi {
  360. width: 100%;
  361. margin-top: 12px;
  362. font-size: 14px;
  363. text-align: center;
  364. }
  365. .icon {
  366. width: 24px !important;
  367. margin: 0 auto;
  368. }
  369. .img-withdraw,
  370. .img-spread {
  371. height: 25px !important;
  372. }
  373. .img-team {
  374. width: 30px !important;
  375. height: 25px !important;
  376. }
  377. .icon image {
  378. width: 100%;
  379. height: 100%;
  380. }
  381. .footer {
  382. height: 160rpx;
  383. background: #FFFFFF;
  384. }
  385. .content {
  386. .cont-wrap {
  387. background: #FFFFFF;
  388. width: 100%;
  389. min-height: 40vh;
  390. padding: 0 20rpx;
  391. box-sizing: border-box;
  392. position: relative;
  393. .no-order {
  394. width: 140rpx;
  395. height: 140rpx;
  396. position: absolute;
  397. left: 0;
  398. right: 0;
  399. top: 12rpx;
  400. bottom: 0;
  401. margin: auto;
  402. image {
  403. width: 100%;
  404. height: 100%;
  405. }
  406. }
  407. .cont-inner {
  408. width: 100%;
  409. min-height: 160rpx;
  410. padding: 40rpx 0 34rpx 0;
  411. box-sizing: border-box;
  412. overflow: hidden;
  413. .cont-inner-left {
  414. width: 100rpx;
  415. height: 100rpx;
  416. border-radius: 50%;
  417. float: left;
  418. margin-right: 24rpx;
  419. image {
  420. width: 100%;
  421. height: 100%;
  422. border-radius: 50%;
  423. }
  424. }
  425. .cont-inner-t {
  426. margin-bottom: 24rpx;
  427. view {
  428. font-size: 30rpx;
  429. font-weight: 500;
  430. color: #333333;
  431. }
  432. text {
  433. font-size: 30rpx;
  434. font-weight: bold;
  435. color: #ff4841;
  436. float: right;
  437. font-style: normal;
  438. }
  439. }
  440. .cont-inner-b {
  441. text {
  442. font-size: 24rpx;
  443. font-weight: 500;
  444. color: #999999;
  445. }
  446. em {
  447. font-size: 24rpx;
  448. font-weight: 500;
  449. color: #ff4841;
  450. float: right;
  451. font-style: normal;
  452. }
  453. }
  454. }
  455. }
  456. }
  457. }
  458. </style>