金诚优选前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.5 KiB

  1. <template>
  2. <view id="sensus">
  3. <view class="sensuspage">
  4. <!--<view class="sensus-detail"></view>-->
  5. <view class="sensus-item">
  6. <view>
  7. <span class="item-top sale-earning">{{order.money_sum_today || 0}}</span>
  8. <span>今日销售</span>
  9. </view>
  10. <view>
  11. <span class="item-top">{{order.agent_order_count_today || 0}}</span>
  12. <span>今日订单</span>
  13. </view>
  14. <view>
  15. <span class="item-top">{{order.user_count_today || 0}}</span>
  16. <span>今日新增会员</span>
  17. </view>
  18. <view>
  19. <span class="item-top sale-earning">{{order.money_sum_seven || 0}}</span>
  20. <span>近七天销售</span>
  21. </view>
  22. <view>
  23. <span class="item-top ">{{order.agent_order_count_seven || 0}}</span>
  24. <span>近七天订单</span>
  25. </view>
  26. <view>
  27. <span class="item-top">{{order.user_count_seven || 0}}</span>
  28. <span>近七天新增会员</span>
  29. </view>
  30. <view>
  31. <span class="item-top sale-earning">{{order.money_sum_month || 0}}</span>
  32. <span>近一月销售</span>
  33. </view>
  34. <view>
  35. <span class="item-top">{{order.agent_order_count_month || 0}}</span>
  36. <span>近一月订单</span>
  37. </view>
  38. <view>
  39. <span class="item-top">{{order.user_count_month || 0}}</span>
  40. <span>近一月新增会员</span>
  41. </view>
  42. </view>
  43. <view class="check-money" @tap="checkmoney">
  44. <button>查看收益明细</button>
  45. </view>
  46. </view>
  47. </view>
  48. </template>
  49. <script>
  50. import {pageLogin, getUrl,config,is} from '@/common/js/utils.js';
  51. export default {
  52. data() {
  53. return {
  54. info: {},
  55. order:''
  56. };
  57. },
  58. onShow() {
  59. this.getsensus();
  60. },
  61. components: {},
  62. props: {},
  63. methods: {
  64. getsensus() {
  65. this.$http.get({
  66. api: 'api/distribution/statistics',
  67. header: {
  68. Authorization: this.$cookieStorage.get('user_token')
  69. }
  70. }).then(res => {
  71. if (res.statusCode == 200) {
  72. res = res.data;
  73. if (res.status) {
  74. // this.setData({
  75. // order: res.data
  76. // });
  77. this.order=res.data;
  78. } else {
  79. wx.showModal({
  80. content: '请求失败,请稍后重试',
  81. showCancel: false
  82. });
  83. }
  84. } else {
  85. wx.showModal({
  86. content: '请求失败,请稍后重试',
  87. showCancel: false
  88. });
  89. }
  90. });
  91. },
  92. checkmoney(e) {
  93. wx.navigateTo({
  94. url: '/pages/distribution/myReceive/myReceive'
  95. });
  96. },
  97. setData: function (obj) {
  98. let that = this;
  99. let keys = [];
  100. let val, data;
  101. Object.keys(obj).forEach(function (key) {
  102. keys = key.split('.');
  103. val = obj[key];
  104. data = that.$data;
  105. keys.forEach(function (key2, index) {
  106. if (index + 1 == keys.length) {
  107. that.$set(data, key2, val);
  108. } else {
  109. if (!data[key2]) {
  110. that.$set(data, key2, {});
  111. }
  112. }
  113. data = data[key2];
  114. });
  115. });
  116. }
  117. },
  118. computed: {},
  119. watch: {}
  120. };
  121. </script>
  122. <style rel="stylesheet/less" lang="less">
  123. @import "sensus";
  124. </style>