center.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. <template>
  2. <view>
  3. <image :src="$getImageUrl('static/images/applet/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> {{income_title}}
  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="{'text-price':brokerinfo.type == 1}" class="lw-table-value text-bold text-red">{{statistics.income_total}}</view>
  15. <view class="lw-table-title text-gray padding-top-xs">{{income_total_title}}</view>
  16. </view>
  17. <view class="lw-table-item padding">
  18. <view :class="{'text-price':brokerinfo.type == 1}" class="lw-table-value text-bold text-red">{{statistics.income}}</view>
  19. <view class="lw-table-title text-gray padding-top-xs">{{income_now_title}}</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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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="$getImageUrl('static/images/applet/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. computed: {
  114. income_title() {
  115. return _this.brokerinfo.type == 1 ? '我的收益' : '我的积分';
  116. },
  117. income_total_title() {
  118. return _this.brokerinfo.type == 1 ? '总收益' : '总积分';
  119. },
  120. income_now_title() {
  121. return _this.brokerinfo.type == 1 ? '当前收益' : '剩余积分';
  122. },
  123. income_unit() {
  124. return _this.brokerinfo.type == 1 ? '元' : '分';
  125. },
  126. },
  127. }
  128. </script>
  129. <style scoped>
  130. .header-image {
  131. width: 750rpx;
  132. }
  133. .lw-table {
  134. display: flex;
  135. align-items: center;
  136. justify-content: space-around;
  137. background: white;
  138. padding: 20rpx 0;
  139. }
  140. .lw-table .lw-table-item {
  141. text-align: center;
  142. }
  143. .lw-table .lw-table-value {
  144. font-size: 40rpx;
  145. }
  146. </style>