center.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <view>
  3. <view class="header">
  4. <image
  5. :src="brokerinfo.type == 1 ? $getImageUrl('static/images/applet/broker/topBg.png') : $getImageUrl('static/images/applet/broker/topBgRed.png')"
  6. class="header-image" mode="widthFix"></image>
  7. <view class="header-notice" @click="goPage('/pages/broker/brokerNotice')">
  8. <u-icon name="volume" color="#E0E0E0" size="28"></u-icon>
  9. <view>公告</view>
  10. </view>
  11. </view>
  12. <view class="cu-bar bg-white solid-bottom">
  13. <view class="action">
  14. <text class="cuIcon-title text-orange "></text> {{income_title}}
  15. </view>
  16. <view class="action">
  17. <button class="cu-btn bg-green shadow" @click="goNavPage('/pages/broker/income')">详情</button>
  18. </view>
  19. </view>
  20. <view class="lw-table">
  21. <view class="lw-table-item padding">
  22. <view :class="{'text-price':brokerinfo.type == 1}" class="lw-table-value text-bold text-red">
  23. {{statistics.income_total}}
  24. </view>
  25. <view class="lw-table-title text-gray padding-top-xs">{{income_total_title}}</view>
  26. </view>
  27. <view class="lw-table-item padding">
  28. <view :class="{'text-price':brokerinfo.type == 1}" class="lw-table-value text-bold text-red">
  29. {{statistics.income}}
  30. </view>
  31. <view class="lw-table-title text-gray padding-top-xs">{{income_now_title}}</view>
  32. </view>
  33. </view>
  34. <view class="cu-bar bg-white solid-bottom margin-top">
  35. <view class="action">
  36. <text class="cuIcon-title text-orange "></text> 我发展的用户
  37. </view>
  38. </view>
  39. <view class="lw-table">
  40. <view class="lw-table-item padding" @click="goNavPage('/pages/broker/myuser')">
  41. <view class="lw-table-value text-bold text-black">{{statistics.user}}</view>
  42. <view class="lw-table-title text-gray padding-top-xs">求职用户</view>
  43. </view>
  44. <view class="lw-table-item padding" @click="goNavPage('/pages/broker/myworker')">
  45. <view class="lw-table-value text-bold text-black">{{statistics.worker}}</view>
  46. <view class="lw-table-title text-gray padding-top-xs">雇主用户</view>
  47. </view>
  48. </view>
  49. <view class="cu-list grid col-3 no-border margin-top">
  50. <view class="cu-item text-center" @click="goNavPage('/pages/broker/broker')">
  51. <image class="myicon" :src="$getImageUrl('static/images/applet/broker/code.png')"
  52. style="width: 50rpx;height: 50rpx;"></image>
  53. <text>我的邀请码</text>
  54. </view>
  55. <view class="cu-item text-center" @click="goNavPage('/pages/broker/myorder')">
  56. <image class="myicon" :src="$getImageUrl('static/images/applet/broker/order.png')"
  57. style="width: 50rpx;height: 50rpx;"></image>
  58. <text>劳务订单</text>
  59. <view style="color: #888;font-size: 26rpx;">(针对劳务机构)</view>
  60. </view>
  61. <view class="cu-item text-center" @click="goNavPage('/pages/my/myentry')">
  62. <image class="myicon" :src="$getImageUrl('static/images/applet/broker/record.png')"
  63. style="width: 50rpx;height: 50rpx;"></image>
  64. <text>悬赏报备记录</text>
  65. </view>
  66. </view>
  67. </view>
  68. </template>
  69. <script>
  70. var _this;
  71. export default {
  72. data() {
  73. return {
  74. userinfo: {},
  75. brokerinfo: {},
  76. statistics: {
  77. income_total: 0,
  78. income: 0,
  79. user: 0,
  80. worker: 0,
  81. },
  82. };
  83. },
  84. onLoad: function() {
  85. _this = this;
  86. _this.userinfo = uni.getStorageSync('userinfo') || false;
  87. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  88. console.log("经纪人", _this.brokerinfo)
  89. if (_this.userinfo === false || _this.brokerinfo === false) {
  90. uni.reLaunch({
  91. url: "/pages/my/my"
  92. });
  93. return false;
  94. }
  95. _this.init();
  96. },
  97. methods: {
  98. goPage(src) {
  99. uni.navigateTo({
  100. url: '/pages/broker/brokerNotice'
  101. });
  102. },
  103. init: function() {
  104. _this.$req.ajax({
  105. path: "broker/center",
  106. data: {
  107. brokerid: _this.brokerinfo.id
  108. }
  109. }).then((data) => {
  110. _this.statistics = data
  111. }).catch((err) => {
  112. uni.showModal({
  113. title: '信息提示',
  114. content: err,
  115. showCancel: false
  116. });
  117. });
  118. },
  119. goNavPage: function(pageurl) {
  120. _this.userinfo = _this.checkLogin("/pages/my/my");
  121. if (_this.userinfo === false) {
  122. return false;
  123. }
  124. uni.navigateTo({
  125. url: pageurl,
  126. fail: function() {
  127. uni.switchTab({
  128. url: pageurl
  129. });
  130. }
  131. });
  132. },
  133. },
  134. computed: {
  135. income_title() {
  136. return _this.brokerinfo.type == 1 ? '我的收益' : '我的积分';
  137. },
  138. income_total_title() {
  139. return _this.brokerinfo.type == 1 ? '总收益' : '总积分';
  140. },
  141. income_now_title() {
  142. return _this.brokerinfo.type == 1 ? '当前收益' : '剩余积分';
  143. },
  144. income_unit() {
  145. return _this.brokerinfo.type == 1 ? '元' : '分';
  146. },
  147. },
  148. }
  149. </script>
  150. <style lang="scss" scoped>
  151. .header {
  152. height: 146rpx;
  153. position: relative;
  154. display: flex;
  155. align-items: center;
  156. justify-content: flex-end;
  157. .header-image {
  158. width: 750rpx;
  159. position: absolute;
  160. top: 0;
  161. left: 0;
  162. z-index: -1;
  163. }
  164. .header-notice {
  165. padding-right: 40rpx;
  166. font-size: 25rpx;
  167. color: #E0E0E0;
  168. display: flex;
  169. flex-direction: column;
  170. justify-content: center;
  171. }
  172. }
  173. .lw-table {
  174. display: flex;
  175. align-items: center;
  176. justify-content: space-around;
  177. background: white;
  178. padding: 20rpx 0;
  179. }
  180. .lw-table .lw-table-item {
  181. text-align: center;
  182. }
  183. .lw-table .lw-table-value {
  184. font-size: 40rpx;
  185. }
  186. </style>