center.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <template>
  2. <view>
  3. <image src="../../static/images/broker/topBg.png" class="header-image" mode="widthFix"></image>
  4. <view class="cu-bar bg-white solid-bottom">
  5. <view class="action">
  6. <text class="cuIcon-title text-orange "></text> 我的收益
  7. </view>
  8. <view class="action">
  9. <button class="cu-btn bg-green shadow" @click="goNavPage('/pages/broker/income')">详情</button>
  10. </view>
  11. </view>
  12. <view class="lw-table">
  13. <view class="lw-table-item padding">
  14. <view class="lw-table-value text-price text-bold text-red">{{statistics.income_total}}</view>
  15. <view class="lw-table-title text-gray padding-top-xs">总收益</view>
  16. </view>
  17. <view class="lw-table-item padding">
  18. <view class="lw-table-value text-price text-bold text-red">{{statistics.income}}</view>
  19. <view class="lw-table-title text-gray padding-top-xs">当前收益</view>
  20. </view>
  21. </view>
  22. <view class="cu-bar bg-white solid-bottom margin-top">
  23. <view class="action">
  24. <text class="cuIcon-title text-orange "></text> 我发展的用户
  25. </view>
  26. </view>
  27. <view class="lw-table">
  28. <view class="lw-table-item padding" @click="goNavPage('/pages/broker/myuser')">
  29. <view class="lw-table-value text-bold text-black">{{statistics.user}}</view>
  30. <view class="lw-table-title text-gray padding-top-xs">求职用户</view>
  31. </view>
  32. <view class="lw-table-item padding" @click="goNavPage('/pages/broker/myworker')">
  33. <view class="lw-table-value text-bold text-black">{{statistics.worker}}</view>
  34. <view class="lw-table-title text-gray padding-top-xs">雇主用户</view>
  35. </view>
  36. </view>
  37. <view class="cu-list grid col-3 no-border margin-top">
  38. <view class="cu-item text-center" @click="goNavPage('/pages/broker/broker')">
  39. <image class="myicon" src="../../static/images/broker/code.png" style="width: 50rpx;height: 50rpx;"></image>
  40. <text>我的邀请码</text>
  41. </view>
  42. <view class="cu-item text-center" @click="goNavPage('/pages/broker/myorder')">
  43. <image class="myicon" src="../../static/images/broker/order.png" style="width: 50rpx;height: 50rpx;"></image>
  44. <text>劳务订单</text>
  45. <view style="color: #888;font-size: 26rpx;">(针对劳务机构)</view>
  46. </view>
  47. <view class="cu-item text-center" @click="goNavPage('/pages/my/myentry')">
  48. <image class="myicon" src="../../static/images/broker/record.png" style="width: 50rpx;height: 50rpx;"></image>
  49. <text>悬赏报备记录</text>
  50. </view>
  51. </view>
  52. </view>
  53. </template>
  54. <script>
  55. var _this;
  56. export default {
  57. data() {
  58. return {
  59. userinfo: {},
  60. brokerinfo: {},
  61. statistics: {
  62. income_total: 0,
  63. income: 0,
  64. user: 0,
  65. worker: 0,
  66. },
  67. };
  68. },
  69. onLoad: function() {
  70. _this = this;
  71. _this.userinfo = uni.getStorageSync('userinfo') || false;
  72. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  73. if (_this.userinfo === false || _this.brokerinfo === false) {
  74. uni.reLaunch({
  75. url: "/pages/my/my"
  76. });
  77. return false;
  78. }
  79. _this.init();
  80. },
  81. methods: {
  82. init: function() {
  83. _this.$req.ajax({
  84. path: "broker/center",
  85. data: {
  86. brokerid: _this.brokerinfo.id
  87. }
  88. }).then((data) => {
  89. _this.statistics = data
  90. }).catch((err) => {
  91. uni.showModal({
  92. title: '信息提示',
  93. content: err,
  94. showCancel: false
  95. });
  96. });
  97. },
  98. goNavPage: function(pageurl) {
  99. _this.userinfo = _this.checkLogin("/pages/my/my");
  100. if (_this.userinfo === false) {
  101. return false;
  102. }
  103. uni.navigateTo({
  104. url: pageurl,
  105. fail: function() {
  106. uni.switchTab({
  107. url: pageurl
  108. });
  109. }
  110. });
  111. },
  112. }
  113. }
  114. </script>
  115. <style scoped>
  116. .header-image {
  117. width: 750rpx;
  118. }
  119. .lw-table {
  120. display: flex;
  121. align-items: center;
  122. justify-content: space-around;
  123. background: white;
  124. padding: 20rpx 0;
  125. }
  126. .lw-table .lw-table-item {
  127. text-align: center;
  128. }
  129. .lw-table .lw-table-value {
  130. font-size: 40rpx;
  131. }
  132. </style>