center.vue 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224
  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="showAgent">
  51. <image class="myicon" :src="$getImageUrl('static/images/applet/broker/agent.png')"
  52. style="width: 50rpx;height: 50rpx;"></image>
  53. <text>门店信息</text>
  54. </view>
  55. <view class="cu-item text-center" @click="goNavPage('/pages/broker/broker')">
  56. <image class="myicon" :src="$getImageUrl('static/images/applet/broker/code.png')"
  57. style="width: 50rpx;height: 50rpx;"></image>
  58. <text>我的邀请码</text>
  59. </view>
  60. <view class="cu-item text-center" @click="goNavPage('/pages/broker/myorder')">
  61. <image class="myicon" :src="$getImageUrl('static/images/applet/broker/order.png')"
  62. style="width: 50rpx;height: 50rpx;"></image>
  63. <text>劳务订单</text>
  64. <view style="color: #888;font-size: 26rpx;">(针对劳务机构)</view>
  65. </view>
  66. <view class="cu-item text-center" @click="goNavPage('/pages/my/myentry')">
  67. <image class="myicon" :src="$getImageUrl('static/images/applet/broker/record.png')"
  68. style="width: 50rpx;height: 50rpx;"></image>
  69. <text>悬赏报备记录</text>
  70. </view>
  71. </view>
  72. <view class="cu-modal" :class="modalName=='agentModal'?'show':''">
  73. <view class="cu-dialog">
  74. <view class="cu-bar bg-white justify-end">
  75. <view class="content">我的门店</view>
  76. <view class="action" @tap="hideModal">
  77. <text class="cuIcon-close text-red"></text>
  78. </view>
  79. </view>
  80. <view class="padding-xl text-left text-lg">
  81. <view>门店名:{{statistics.agent.title}}</view>
  82. <view class="margin-top-sm">联系人:{{statistics.agent.realname}}</view>
  83. <view class="margin-top-sm">电话:{{statistics.agent.mobile}}</view>
  84. </view>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script>
  90. var _this;
  91. export default {
  92. data() {
  93. return {
  94. userinfo: {},
  95. brokerinfo: {},
  96. statistics: {
  97. income_total: 0,
  98. income: 0,
  99. user: 0,
  100. worker: 0,
  101. agent: {},
  102. },
  103. modalName: '',
  104. };
  105. },
  106. onLoad: function() {
  107. _this = this;
  108. _this.userinfo = uni.getStorageSync('userinfo') || false;
  109. _this.brokerinfo = uni.getStorageSync('brokerinfo') || false;
  110. if (_this.userinfo === false || _this.brokerinfo === false) {
  111. uni.reLaunch({
  112. url: "/pages/my/my"
  113. });
  114. return false;
  115. }
  116. _this.init();
  117. },
  118. methods: {
  119. goPage(src) {
  120. uni.navigateTo({
  121. url: '/pages/broker/brokerNotice'
  122. });
  123. },
  124. init: function() {
  125. _this.$req.ajax({
  126. path: "broker/center",
  127. data: {
  128. brokerid: _this.brokerinfo.id
  129. }
  130. }).then((data) => {
  131. _this.statistics = data
  132. }).catch((err) => {
  133. uni.showModal({
  134. title: '信息提示',
  135. content: err,
  136. showCancel: false
  137. });
  138. });
  139. },
  140. goNavPage: function(pageurl) {
  141. _this.userinfo = _this.checkLogin("/pages/my/my");
  142. if (_this.userinfo === false) {
  143. return false;
  144. }
  145. uni.navigateTo({
  146. url: pageurl,
  147. fail: function() {
  148. uni.switchTab({
  149. url: pageurl
  150. });
  151. }
  152. });
  153. },
  154. hideModal: function(e) {
  155. _this.modalName = null;
  156. },
  157. showAgent: function() {
  158. _this.modalName = "agentModal";
  159. },
  160. },
  161. computed: {
  162. income_title() {
  163. return _this.brokerinfo.type == 1 ? '我的收益' : '我的积分';
  164. },
  165. income_total_title() {
  166. return _this.brokerinfo.type == 1 ? '总收益' : '总积分';
  167. },
  168. income_now_title() {
  169. return _this.brokerinfo.type == 1 ? '当前收益' : '剩余积分';
  170. },
  171. income_unit() {
  172. return _this.brokerinfo.type == 1 ? '元' : '分';
  173. },
  174. },
  175. }
  176. </script>
  177. <style lang="scss" scoped>
  178. .header {
  179. height: 146rpx;
  180. position: relative;
  181. display: flex;
  182. align-items: center;
  183. justify-content: flex-end;
  184. .header-image {
  185. width: 750rpx;
  186. position: absolute;
  187. top: 0;
  188. left: 0;
  189. z-index: -1;
  190. }
  191. .header-notice {
  192. padding-right: 40rpx;
  193. font-size: 25rpx;
  194. color: #E0E0E0;
  195. display: flex;
  196. flex-direction: column;
  197. justify-content: center;
  198. }
  199. }
  200. .lw-table {
  201. display: flex;
  202. align-items: center;
  203. justify-content: space-around;
  204. background: white;
  205. padding: 20rpx 0;
  206. }
  207. .lw-table .lw-table-item {
  208. text-align: center;
  209. }
  210. .lw-table .lw-table-value {
  211. font-size: 40rpx;
  212. }
  213. </style>