123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194 |
- <!-- 我的佣金 -->
- <template>
- <view class="wrap">
- <view class="card">
- <view class="card-label">我的佣金</view>
- <view class="card-middle">
- <view class="money">
- ¥
- <text>{{info.money}}</text>
- </view>
- <button type="default" class="btn" @tap="withdraw">立即提现</button>
- </view>
- <view class="card-bottom">
- <view class="card-bottom-row">
- <text class="card-bottom-row-label">累计提现</text>
- <view class="small-money">
- ¥
- <text>{{info.wallet}}</text>
- </view>
- </view>
- <view class="password-msg" @tap="changePassword">
- 修改密码
- </view>
- </view>
- </view>
- <scroll-view scroll-x="true" class="tab-list">
- <view :class="{ 'active' : isActive === index }" class="child" v-for="(item,index) in navList" :key="index"
- @click="checked(index)">
- {{item.title}}
- </view>
- </scroll-view>
- <view class="list">
- <view class="item" v-for="(item, index) in list" :key="index">
- <view class="item-sidebar">
- <view class="item-name">
- {{item.desc}}
- </view>
- <view class="item-msg">{{item.create_at}}</view>
- </view>
- <text v-if="isActive == 0" :class="[item.money > 0 ? 'numadd' : 'numless']">{{item.money > 0 ? '+' : ''}}{{item.money}}</text>
- <text v-if="isActive == 1" :class="[item.integral > 0 ? 'numadd' : 'numless']">{{item.integral > 0 ? '+' : ''}}{{item.integral}}</text>
- </view>
- <!-- <view class="item">
- <view class="item-sidebar">
- <view class="item-name">
- 商品购买
- </view>
- <view class="item-msg">2020-02-24 14:3:23</view>
- </view>
- <text :class="[num==true?'numadd':'numless']">{{num==true ? '+' : '-'}}1239.98</text>
- </view>
- <view class="item">
- <view class="item-sidebar">
- <view class="item-name">
- 商品购买
- </view>
- <view class="item-msg">2020-02-24 14:3:23</view>
- </view>
- <text :class="[num==true?'numadd':'numless']">{{num==true ? '+' : '-'}}1239.98</text>
- </view> -->
- <!-- 无内容时显示 -->
- <view class="normal-box" v-if="list.length == 0">
- <image src="../../../static/normal-3.png" mode="widthFix"></image>
- 暂无佣金明细
- </view>
- </view>
- </view>
- </template>
- <script>
- import {
- walletManageWalletInfo,
- walletManageGetWithdrawLog,
- walletManageGetUserMoneyInfo,
- walletManageGetUserIntegralLog,
- } from '../../../common/service.js';
- export default {
- data() {
- return {
- //选项卡
- isActive: 0,
- navList: [{
- index: 0,
- title: '佣金明细',
- }, {
- index: 1,
- title: "提现明细",
- }],
- num: true,
- info: {},
-
- list: [],
- page: 1,
- page_num: 20,
- }
- },
- onLoad() {
- this.walletInfo();
- this.getList();
- },
- methods: {
- // 获取钱包详情
- walletInfo() {
- walletManageWalletInfo({
- success: ({code, data, msg}) => {
- if (code == 1) {
- this.info = data.detail;
- } else {
- uni.showToast({
- icon: 'none',
- title: msg,
- });
- }
- },
- });
- },
- // 获取列表
- getList(type) {
- const {page, page_num, isActive} = this;
- const req = isActive == 0 ? walletManageGetUserMoneyInfo : walletManageGetUserIntegralLog;
- req({
- data: {
- page,
- page_num,
- },
- success: res => {
- if (res.code === 1) {
- const list = res.data.list;
- this.list = page > 1 ? [...this.list, ...list] : list;
- if (list.length === 0) {
- uni.showToast({
- icon: 'none',
- title: '没有更多数据了'
- });
- } else {
- this.page = this.page + 1;
- }
- } else {
- uni.showToast({
- icon: 'none',
- title: res.msg
- });
- }
- },
- complete: () => {
- this.getDataLoading = false;
- uni.stopPullDownRefresh();
- }
- })
- },
- /**
- * 下拉刷新
- */
- onPullDownRefresh() {
- this.getList();
- },
- /**
- * 触底加载
- */
- onReachBottom() {
- this.getList();
- },
- checked(index) {
- this.isActive = index;
- this.page = 1;
- this.list = [];
- this.getList();
- },
- //跳转登录
- withdraw() {
- uni.navigateTo({
- url: '../withdraw/withdraw'
- })
- },
- //跳转修改密码
- changePassword() {
- uni.navigateTo({
- url: '../change-password/change-password'
- })
- },
- }
- }
- </script>
- <style scoped lang="scss">
- @import "./my-commission.css";
- </style>
|