wallets.vue 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365
  1. <template>
  2. <view class="content">
  3. <!-- #ifndef MP -->
  4. <view class="revert flex-upDown-center">
  5. <view class="revert-1" @click="switchTab('/pages/user/user')"><image src="../../static/img/img03.png"></image></view>
  6. <view class="revert-2">推广收益</view>
  7. </view>
  8. <!-- #endif -->
  9. <view class="content-money">
  10. <view class="money-box">
  11. <view class="money flex1" @click="navto('/pages/award/award')">
  12. <text>总收益(元)</text>
  13. <text>佣金明细</text>
  14. </view>
  15. <view class="text">¥{{count}}</view>
  16. </view>
  17. </view>
  18. <view class="buttom-box flex">
  19. <view class="buttom">
  20. <view class="money">¥{{money}}</view>
  21. <text class="text">现有佣金</text>
  22. </view>
  23. <view class="interval"></view>
  24. <view class="buttom">
  25. <view class="money">¥{{extractTotalPrice}}</view>
  26. <text class="text">已发放奖励(元)</text>
  27. </view>
  28. </view>
  29. <view class="button">
  30. <view class="button1" @click="toWechat">转出到余额</view>
  31. <view class="button2" @click="toAccount">提现</view>
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. import { spreadCount } from '@/api/wallet.js';
  37. import { userinfos } from '@/api/user.js';
  38. export default {
  39. data() {
  40. return {
  41. money:0,//现有佣金
  42. count:0,//佣金总金额
  43. extractTotalPrice:0,//已提佣金
  44. };
  45. },
  46. onShow() {
  47. this.loadData();
  48. },
  49. methods: {
  50. //获取佣金总金额
  51. async loadData(source) {
  52. let type = 3;
  53. spreadCount({
  54. type:type
  55. }).then(({data}) => {
  56. console.log(data,'data')
  57. this.count = data.count;
  58. });
  59. let that = this;
  60. userinfos().then(({data}) => {
  61. console.log(data,'res')
  62. this.money = data.extractPrice;
  63. this.extractTotalPrice = data.extractTotalPrice;
  64. });
  65. },
  66. /**
  67. * 获取个人用户信息
  68. */
  69. // 页面跳转
  70. switchTab(e) {
  71. uni.switchTab({
  72. url: e
  73. });
  74. },
  75. navto(url){
  76. uni.navigateTo({
  77. url
  78. });
  79. },
  80. // 跳转到转出到余额
  81. toWechat(){
  82. if( this.count <= 0){
  83. uni.showToast({
  84. title: '佣金不足',
  85. duration: 2000,
  86. icon: 'none',
  87. });
  88. } else{
  89. uni.navigateTo({
  90. url:'/pages/wallet/wechat'
  91. });
  92. }
  93. },
  94. toAccount(){
  95. if( this.count <= 0){
  96. uni.showToast({
  97. title: '佣金不足',
  98. duration: 2000,
  99. icon: 'none',
  100. });
  101. } else{
  102. uni.navigateTo({
  103. url:'/pages/wallet/account'
  104. });
  105. }
  106. }
  107. }
  108. };
  109. </script>
  110. <style lang="scss">
  111. page {
  112. background: #ffffff;
  113. height: 100%;
  114. }
  115. .revert{
  116. z-index: 10;
  117. width: 100%;
  118. position: absolute;
  119. top:20rpx;
  120. padding: 0 30rpx;
  121. .revert-1{
  122. width: 20rpx;
  123. height: 35rpx;
  124. image{
  125. width: 20rpx;
  126. height: 35rpx;
  127. }
  128. }
  129. .revert-2{
  130. text-align: center;
  131. width: calc(100% - 20rpx);
  132. font-size:32rpx;
  133. font-weight:500;
  134. color:#ffffff;
  135. }
  136. }
  137. .content-money {
  138. background: $page-color-base;
  139. // border: 2px solid #ffffff;
  140. .moneyTx {
  141. position: absolute;
  142. top: 150rpx;
  143. right: 0rpx;
  144. width: 150rpx;
  145. padding: 10rpx 30rpx;
  146. border: 2px solid #ffffff;
  147. border-top-left-radius: 99rpx;
  148. border-bottom-left-radius: 99rpx;
  149. color: #ffffff;
  150. line-height: 1;
  151. font-size: $font-base;
  152. }
  153. .buttom-box {
  154. background-color: #ffffff;
  155. text-align: center;
  156. margin: 0 30rpx;
  157. padding: 20rpx 0;
  158. border-radius: $border-radius-sm;
  159. .buttom {
  160. font-size: $font-lg;
  161. flex-grow: 1;
  162. }
  163. .interval {
  164. width: 2px;
  165. height: 60rpx;
  166. background-color: #eeeeee;
  167. }
  168. .icon {
  169. height: 50rpx;
  170. width: 48rpx;
  171. margin: 0 auto;
  172. .icon-img {
  173. width: 100%;
  174. height: 100%;
  175. }
  176. }
  177. }
  178. }
  179. .buttom-box {
  180. background-color: #ffffff;
  181. text-align: center;
  182. margin: 0 30rpx;
  183. padding: 30rpx 0;
  184. border-radius: $border-radius-sm;
  185. box-shadow:0px 0px 20px 0px rgba(50,50,52,0.06);
  186. margin-top: -60rpx;
  187. position: relative;
  188. .buttom {
  189. font-size: $font-lg;
  190. flex-grow: 1;
  191. .money{
  192. font-weight: bold;
  193. font-size: 32rpx;
  194. color:#222222;
  195. }
  196. }
  197. .text {
  198. color: #666666;
  199. }
  200. .interval {
  201. width: 2rpx;
  202. height: 60rpx;
  203. background-color: #eeeeee;
  204. }
  205. .icon {
  206. height: 50rpx;
  207. width: 48rpx;
  208. margin: 0 auto;
  209. .icon-img {
  210. width: 100%;
  211. height: 100%;
  212. }
  213. }
  214. }
  215. .button{
  216. .button1{
  217. width:480rpx;
  218. height:80rpx;
  219. background:linear-gradient(90deg,rgba(254,78,70,1) 0%,rgba(252,65,65,1) 100%);
  220. border-radius:10rpx;
  221. font-size:30rpx;
  222. font-weight:500;
  223. color:#ffffff;
  224. line-height: 80rpx;
  225. text-align: center;
  226. margin:180rpx auto 0;
  227. }
  228. .button2{
  229. width:480rpx;
  230. height:80rpx;
  231. background:#F2F2F2;
  232. border-radius:10rpx;
  233. font-size:30rpx;
  234. font-weight:500;
  235. color:#FC4141;
  236. line-height: 80rpx;
  237. text-align: center;
  238. margin:30rpx auto 0;
  239. }
  240. }
  241. .money-box {
  242. background: $base-color;
  243. padding-top: var(--status-bar-height);
  244. height: 600rpx;
  245. color: #ffffff;
  246. text-align: center;
  247. position: relative;
  248. .text {
  249. padding-top: 140rpx;
  250. font-size: 82rpx;
  251. }
  252. .money {
  253. padding: 120rpx 25rpx 0 25rpx;
  254. font-size: 24rpx;
  255. }
  256. .money-accum {
  257. display: flex;
  258. align-items: center;
  259. justify-content: space-around;
  260. margin-top: 44rpx;
  261. .money-frame {
  262. .money-num {
  263. font-size: 45rpx;
  264. font-weight: 500;
  265. color: rgba(255,255,255,1);
  266. }
  267. .mon-text {
  268. font-size: 30rpx;
  269. font-weight: 500;
  270. color: rgba(255,255,255,1);
  271. }
  272. }
  273. }
  274. .money-loca {
  275. width: 140rpx;
  276. height: 50rpx;
  277. background: #FFFFFF;
  278. color: #FA2740;
  279. font-size: $font-base;
  280. line-height: 50rpx;
  281. border-radius: 10rpx 0 0 10rpx;
  282. }
  283. // 立即提现
  284. .draw {
  285. position: absolute;
  286. right: 0;
  287. top: 64rpx;
  288. }
  289. // 余额支付
  290. .rech {
  291. position: absolute;
  292. right: 0;
  293. top: 134rpx;
  294. }
  295. }
  296. .navbar {
  297. display: flex;
  298. height: 40px;
  299. padding: 0 5px;
  300. background: #fff;
  301. box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  302. position: relative;
  303. z-index: 10;
  304. .nav-item {
  305. flex: 1;
  306. display: flex;
  307. justify-content: center;
  308. align-items: center;
  309. height: 100%;
  310. font-size: 15px;
  311. color: $font-color-dark;
  312. position: relative;
  313. &.current {
  314. color: $font-color-spec;
  315. &:after {
  316. content: '';
  317. position: absolute;
  318. left: 50%;
  319. bottom: 0;
  320. transform: translateX(-50%);
  321. width: 44px;
  322. height: 0;
  323. border-bottom: 2px solid $font-color-spec;
  324. }
  325. }
  326. }
  327. }
  328. // 列表
  329. .swiper-box {
  330. padding-top: 10rpx;
  331. .order-item {
  332. padding: 20rpx 30rpx;
  333. line-height: 1.5;
  334. .title-box {
  335. .title {
  336. font-size: $font-lg;
  337. color: $font-color-base;
  338. }
  339. .time {
  340. font-size: $font-base;
  341. color: $font-color-light;
  342. }
  343. }
  344. .money {
  345. color: #fd5b23;
  346. font-size: $font-lg;
  347. }
  348. }
  349. }
  350. .list-scroll-content {
  351. height: 100%;
  352. }
  353. .content {
  354. height: 100%;
  355. .empty-content {
  356. background-color: #ffffff;
  357. }
  358. }
  359. </style>