绿满眶商城微信小程序-uniapp
zxl
4 天以前 c9928dd4f6d25e2339ea1400f59ec58674a927a7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<template>
  <view class="log-list">
    <!-- 提现记录 -->
    <view class="log-way" v-if="cashLogData.length != 0" v-for="(item, index) in cashLogData" :key="index">
      <view class="log-item">
        <view class="log-item-view">
          <view class="title">{{
            item.distributionCashStatus == "APPLY"
              ? "待处理"
              : item.distributionCashStatus == "VIA_AUDITING"
                ? "通过"
                : "拒绝"
          }}</view>
          <view class="price">+{{ item.price | unitPrice }}</view>
        </view>
        <view class="log-item-view">
          <view>{{ item.createTime }}</view>
          <view></view>
        </view>
      </view>
    </view>
    <!-- 分销业绩 -->
    <view class="log-way" v-if="achievementData.length != 0" v-for="(item, index) in achievementData" :key="index">
      <view class="log-item">
        <view class="log-item-view">
          <view class="title">{{ item.goodsName }}</view>
          <view class="price">提成金额:+{{ item.rebate | unitPrice }}</view>
        </view>
        <view class="log-item-view">
          <view>创建时间:{{ item.createTime }}</view>
          <view>店铺:{{ item.storeName }}</view>
        </view>
        <view class="log-item-footer">
          <view>会员名称:{{ item.memberName }}</view>
        </view>
        <view class="log-item-footers">
          <view>订单号:{{ item.orderSn }}</view>
        </view>
      </view>
    </view>
    <view class="empty" v-if="empty">
      <u-loadmore :status="status" :icon-type="iconType" bg-color="#f7f7f7" />
    </view>
  </view>
</template>
<script>
import '@/components/uview-components/uview-ui';
import { cashLog, distributionOrderList } from "@/api/goods";
export default {
  data () {
    return {
      cashLogData: [], //提现记录数据集合
      achievementData: [], //分销业绩数据合集,
      status: "loadmore",
      iconType: "flower",
      empty: false,
      params: {
        pageNumber: 1,
        pageSize: 10,
      },
 
      type: 0,
      routers: "",
      achParams: {
        pageNumber: 1,
        pageSize: 10,
      },
    };
  },
  onLoad (option) {
    let title;
    option.type == 0 ? (title = "分销业绩") : (title = "提现记录");
 
    uni.setNavigationBarTitle({
      title: title, //这是修改后的导航栏文字
    });
    this.routers = option;
    this.type = option.type;
    option.type == 0 ? this.achievement() : this.history();
  },
  mounted () { },
  onReachBottom () {
    this.status = "loading";
    this.type == 0 ? this.achParams.pageNumber++ : this.params.pageNumber++;
    this.type == 0 ? this.achievement() : this.history();
  },
  methods: {
    // 业绩
    achievement () {
      uni.showLoading({
        title: "加载中",
      });
      distributionOrderList(this.achParams).then((res) => {
        if (res.data.success && res.data.result.records.length >= 1) {
          this.achievementData.push(...res.data.result.records);
        } else {
          this.status = "nomore";
          this.empty = true;
        }
         if (this.$store.state.isShowToast){ uni.hideLoading() };
      });
    },
    // 初始化提现历史
    history () {
      uni.showLoading({
        title: "加载中",
      });
      cashLog(this.params).then((res) => {
        if (res.data.success && res.data.result.records.length >= 1) {
          this.cashLogData.push(...res.data.result.records);
        } else {
          this.status = "nomore";
          this.empty = true;
        }
         if (this.$store.state.isShowToast){ uni.hideLoading() };
      });
    },
  },
};
</script>
<style lang="scss" scoped>
.empty {
  margin: 40rpx 0;
}
 
.price {
  color: $main-color;
  font-weight: bold;
}
 
.log-list {
  padding: 0 8rpx;
  overflow: hidden;
  margin: 20rpx 0;
}
 
.log-way {
  margin: 10rpx 0;
  overflow: hidden;
  background: #fff;
  border-radius: 10rpx;
  padding: 20rpx 0;
}
 
.title {
  font-size: 30rpx;
  font-weight: bold;
}
 
.log-item-view {
  padding: 8rpx 32rpx;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
}
 
.log-item-footer {
  padding: 8rpx 32rpx;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
}
 
.log-item-footers {
  padding: 8rpx 32rpx;
  display: flex;
  font-size: 13px;
  justify-content: space-between;
}
</style>