profit-detail.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view>
  3. <view v-if="detail != null">
  4. <view class="padding-horizontal-main padding-top-main">
  5. <view v-if="detail_list.length > 0" class="panel-item padding-main border-radius-main bg-white spacing-mb">
  6. <view class="panel-content oh">
  7. <view v-for="(item, index) in detail_list" :key="index" class="item br-b oh padding-vertical-main">
  8. <view class="title fl padding-right-main cr-gray">{{item.name}}</view>
  9. <view class="content fl br-l padding-left-main">{{item.value}}</view>
  10. </view>
  11. </view>
  12. </view>
  13. </view>
  14. <!-- 结尾 -->
  15. <component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
  16. </view>
  17. <view v-else>
  18. <!-- 提示信息 -->
  19. <component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. const app = getApp();
  25. import componentNoData from "../../../../components/no-data/no-data";
  26. import componentBottomLine from "../../../../components/bottom-line/bottom-line";
  27. export default {
  28. data() {
  29. return {
  30. params: null,
  31. data_list_loding_status: 1,
  32. data_list_loding_msg: '',
  33. data_bottom_line_status: false,
  34. detail: null,
  35. detail_list: []
  36. };
  37. },
  38. components: {
  39. componentNoData,
  40. componentBottomLine
  41. },
  42. props: {},
  43. onLoad(params) {
  44. //params['id'] = 1;
  45. this.setData({
  46. params: params
  47. });
  48. this.init();
  49. },
  50. onShow() {
  51. // 分享菜单处理
  52. app.globalData.page_share_handle();
  53. },
  54. // 下拉刷新
  55. onPullDownRefresh() {
  56. this.init();
  57. },
  58. methods: {
  59. init() {
  60. uni.showLoading({
  61. title: '加载中...'
  62. });
  63. this.setData({
  64. data_list_loding_status: 1
  65. });
  66. uni.request({
  67. url: app.globalData.get_request_url("detail", "profit", "membershiplevelvip"),
  68. method: 'POST',
  69. data: {
  70. id: this.params.id
  71. },
  72. dataType: 'json',
  73. success: res => {
  74. uni.hideLoading();
  75. uni.stopPullDownRefresh();
  76. if (res.data.code == 0) {
  77. var data = res.data.data;
  78. this.setData({
  79. detail: data.data,
  80. detail_list: [
  81. { name: "订单金额", value: data.data.total_price || '' },
  82. { name: "返佣金额", value: data.data.profit_price || '' },
  83. { name: "当前级别", value: data.data.level_name || '' },
  84. { name: "结算状态", value: data.data.status_name || '' },
  85. { name: "返佣规则", value: data.data.commission_rules || '' },
  86. { name: "创建时间", value: data.data.add_time_time || '' },
  87. { name: "更新时间", value: data.data.upd_time || '' },
  88. ],
  89. data_list_loding_status: 3,
  90. data_bottom_line_status: true,
  91. data_list_loding_msg: ''
  92. });
  93. } else {
  94. this.setData({
  95. data_list_loding_status: 2,
  96. data_bottom_line_status: false,
  97. data_list_loding_msg: res.data.msg
  98. });
  99. if (app.globalData.is_login_check(res.data, this, 'init')) {
  100. app.globalData.showToast(res.data.msg);
  101. }
  102. }
  103. },
  104. fail: () => {
  105. uni.hideLoading();
  106. uni.stopPullDownRefresh();
  107. this.setData({
  108. data_list_loding_status: 2,
  109. data_bottom_line_status: false,
  110. data_list_loding_msg: '服务器请求出错'
  111. });
  112. app.globalData.showToast('服务器请求出错');
  113. }
  114. });
  115. }
  116. }
  117. };
  118. </script>
  119. <style>
  120. </style>