profit-detail.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  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", "distribution"),
  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.refund_price + '元' || '' },
  83. { name: "收益金额", value: data.data.profit_price + '元' || '' },
  84. { name: "当前级别", value: data.data.level_name || '' },
  85. { name: "结算状态", value: data.data.status_name || '' },
  86. { name: "订单状态", value: data.data.order_status_name || '' },
  87. { name: "订单支付状态", value: data.data.order_pay_status_name || '' },
  88. { name: "来源终端", value: data.data.order_client_type_name || '' },
  89. { name: "添加时间", value: data.data.add_time_time || '' },
  90. { name: "更新时间", value: data.data.upd_time_text || '' },
  91. ],
  92. data_list_loding_status: 3,
  93. data_bottom_line_status: true,
  94. data_list_loding_msg: ''
  95. });
  96. } else {
  97. this.setData({
  98. data_list_loding_status: 2,
  99. data_bottom_line_status: false,
  100. data_list_loding_msg: res.data.msg
  101. });
  102. if (app.globalData.is_login_check(res.data, this, 'init')) {
  103. app.globalData.showToast(res.data.msg);
  104. }
  105. }
  106. },
  107. fail: () => {
  108. uni.hideLoading();
  109. uni.stopPullDownRefresh();
  110. this.setData({
  111. data_list_loding_status: 2,
  112. data_bottom_line_status: false,
  113. data_list_loding_msg: '服务器请求出错'
  114. });
  115. app.globalData.showToast('服务器请求出错');
  116. }
  117. });
  118. }
  119. }
  120. };
  121. </script>
  122. <style>
  123. </style>