Files
kangyuan-mobile/pages/home/noRelease.vue
T
2026-05-26 15:52:30 +08:00

387 lines
9.8 KiB
Vue

<template>
<s-layout :title="dataObj.title" navbar="inner">
<view class="pages h100">
<image
class="w100 bg"
:src="$url + 'home/points_1.png'"
mode="widthFix"
:style="{ top: paddingTop + 'px' }"
/>
<view class="pages_con">
<view class="page_bottom bg24">
<view class="bottom_title center c0"> 待释放明细 </view>
<view class="bottom_list flex-center al-flex-start ju-between" v-if="type == 5">
<view class="flex-row">
<view
class="navItem"
v-for="(v, i) in navList"
:key="i"
:class="{ activeNav: navIndex === i }"
@click="navChange(i)"
>
<view class="size28">{{ v.name }}</view>
</view>
</view>
<!-- <view class="flex-row">
<view class="typeItem flex-center size24" v-for="(v, i) in typeArr" :key="i"
:class="{ activeType: typeIndex === i }" @click="typeIndex = i">
{{ v.name }}
</view>
</view> -->
</view>
<view>
<card_mescroll ref="cardPages" @upCallback="getList" :height="height + 'px'">
<view
v-for="(v, i) in detailList"
:key="i"
class="flex-center ju-between p-b-34 p-t-32 border-bottom"
>
<view>
<view class="size28 line40 m-b-10 c0">
{{ sourceTypeObj[Number(v.sourceType) || 1] }}
</view>
<view class="size24 c_999 line34">{{ formatDate(v.createTime) }}</view>
</view>
<view>{{ dataObj.numValue }}</view>
<view class="size32 c_EE0A24">
{{ $fen2yuan(v.remainingEarning) }}
</view>
</view>
</card_mescroll>
</view>
</view>
</view>
</view>
<view class="h_200"> </view>
</s-layout>
</template>
<script setup lang="ts">
import sheep from '@/sheep';
import { ref, reactive, onMounted, onUnmounted, getCurrentInstance, watch, nextTick } from 'vue';
import * as api from '@/sheep/api/home/pay';
import * as pointsApi from '@/sheep/api/home/points';
import { onLoad, onShow } from '@dcloudio/uni-app';
import card_mescroll from '@/components/card_pages/card_mescroll.vue';
import { formatDate, sourceTypeObj } from '@/sheep/helper/utils';
let { proxy } = getCurrentInstance();
// 1-商场区域代理订单,2-AI店铺区域代理订单,3-AI店铺代理收益,4:AI店铺团队分红,5-营销活动随机奖励
let typeObj = {
1: '区域代理收益',
2: '区域代理收益',
3: '店长收益',
4: '店长收益',
5: '店长收益',
6: '系统导入',
};
let dataObj = reactive({
title: '待释放',
name: '我的积分',
num: 0,
btn: '去提现',
list: [],
unit: '',
url: '',
numName: 'changeAmount',
sourceName: 'bizType',
listApi: pointsApi.integraldetai,
titleName: 'remark',
});
let navList = ref([
{
name: '全部',
url: api.getWalletTransactionPage,
title: 'title',
numName: 'price',
sourceName: '',
},
{
name: '佣金',
url: api.commissionDetailPage,
title: 'remark',
numName: 'amount',
sourceName: '',
},
{
name: '代理收益',
url: api.agentEarningsDetailPage,
title: 'remark',
numName: 'totalEarnings',
sourceName: '',
},
{
name: '分红',
url: api.dividendDetailPage,
title: 'remark',
numName: 'amount',
sourceName: '',
},
]);
let typeArr = ref([
{
name: '收入',
transactionType: 1,
},
{
name: '支出',
transactionType: 2,
},
]);
let navIndex = ref(0);
let typeIndex = ref(0);
let height = ref(0);
let sysInfo = uni.getSystemInfoSync();
const windowHeight = sysInfo.windowHeight;
let urlAPI = ref(api.getWallet);
height.value =
windowHeight - sysInfo.statusBarHeight - uni.upx2px(88) - uni.upx2px(110) - uni.upx2px(40);
let statusBarHeight = uni.getSystemInfoSync().statusBarHeight;
let paddingTop = ref();
paddingTop.value = -(statusBarHeight + 44);
const getData = () => {
urlAPI.value().then((res) => {
console.log(res);
if (res.code === 0) {
dataObj.num = proxy.$fen2yuan(res.data.balance);
}
});
};
let cardPages = ref(null);
let detailList = ref([]);
const getList = (mescroll) => {
let obj = {
pageNo: mescroll.num,
pageSize: mescroll.size,
};
api.getReleaseList(obj).then((res) => {
console.log(res);
if (res.code === 0) {
let list = res.data.pageResult.list || [];
if (mescroll.num == 1) detailList.value = [];
detailList.value = detailList.value.concat(list);
cardPages.value.getState(true, list.length);
} else {
cardPages.value.getState(false);
}
});
};
let type = ref(1);
const dataChange = async () => {
let userInfo = await sheep.$store('user').getInfo();
if (type.value) {
type.value = Number(type.value);
switch (Number(type.value)) {
case 1:
dataObj.title = '绿色积分';
dataObj.name = '我的积分';
dataObj.btn = '去兑换';
dataObj.num = userInfo.point;
dataObj.url = '/pages/home/pay/seed';
dataObj.listApi = pointsApi.integraldetai;
dataObj.numName = 'changeAmount';
dataObj.sourceName = '';
break;
case 2:
dataObj.title = '佣金';
dataObj.name = '我的佣金';
dataObj.num = userInfo.commission;
dataObj.unit = '元';
dataObj.listApi = pointsApi.commission;
dataObj.numName = 'amount';
dataObj.sourceName = '';
break;
case 3:
dataObj.title = '代理收益';
dataObj.name = '我的代理收益';
dataObj.num = userInfo.agentEarning;
dataObj.unit = '元';
dataObj.listApi = pointsApi.agentearnings;
dataObj.numName = 'totalEarnings';
dataObj.sourceName = '';
break;
case 4:
dataObj.title = '消费金';
dataObj.name = '我的消费金';
dataObj.btn = '去消费';
dataObj.num = proxy.$fen2yuan(userInfo.consumptionGold);
dataObj.unit = '';
dataObj.url = '/pages/goods/list';
dataObj.listApi = pointsApi.consumptiongold;
dataObj.numName = 'amount';
dataObj.sourceName = '';
break;
case 5:
navChange(0);
dataObj.title = '钱包';
dataObj.name = '可提现金额';
dataObj.btn = '去提现';
dataObj.num = proxy.$fen2yuan(userInfo.wallet);
dataObj.unit = '元';
dataObj.url = '/pages/home/pay/withdraw';
getData();
break;
default:
break;
}
// getList();
}
if (cardPages.value) {
cardPages.value.mescrollTrigger();
}
};
onLoad(async (e) => {
type.value = e.type;
});
onShow(() => {
dataChange();
});
watch(
() => [navIndex.value, typeIndex.value],
() => {
cardPages.value.mescrollTrigger();
},
);
onShow(() => {
if (cardPages.value) {
cardPages.value.mescrollTrigger();
}
if (type.value == 5) {
getData();
}
});
const goUrl = () => {
// if (type.value == 5) {
// uni.showToast({
// title: '功能暂未开放',
// icon: 'none',
// })
// return;
// }
uni.navigateTo({
url: dataObj.url,
});
};
const go = () => {
uni.navigateTo({
url: '/pages/home/noRelease',
});
};
const navChange = (index) => {
dataObj.numName = navList.value[index].numName;
dataObj.sourceName = navList.value[index].sourceName;
dataObj.titleName = navList.value[index].title;
navIndex.value = index;
};
</script>
<style lang="scss" scoped>
.money-box {
//height: 344rpx;
background: linear-gradient(to right, #75aff6 0%, #366dee 99%);
border-radius: 12rpx;
margin-bottom: 32rpx;
padding: 40rpx 32rpx 16rpx;
.line {
width: 100%;
height: 1rpx;
background: #fff;
}
.btn {
color: #366eee;
border-radius: 50rpx;
background: #fff;
}
}
.pages {
position: relative;
.bg {
position: absolute;
top: 0;
left: 0;
z-index: 0;
}
}
.pages_con {
position: relative;
padding: 0 40rpx;
box-sizing: border-box;
z-index: 1;
.page_top {
height: 204rpx;
color: #1a1a1a;
.name {
}
.num {
font-size: 68rpx;
}
.btn {
background: linear-gradient(131deg, #f7772e 0%, #ee0a24 100%);
height: 52rpx;
line-height: 52rpx;
width: 112rpx;
text-align: center;
border-radius: 26rpx;
color: #ffffff;
margin-bottom: 10rpx;
margin-left: 20rpx;
}
}
.page_bottom {
background-color: #fff;
border-radius: 24rpx;
padding: 0 16rpx;
.bottom_title {
line-height: 110rpx;
}
}
}
.navItem {
margin-bottom: 20rpx;
margin-right: 32rpx;
color: #ffffff;
}
.activeNav {
position: relative;
color: var(--color32);
&::before {
content: '';
width: 40rpx;
height: 6rpx;
background: linear-gradient(131deg, var(--color30) 0%, var(--color32) 100%), #fa7e31;
border-radius: 4rpx;
position: absolute;
bottom: -14rpx;
left: 50%;
transform: translateX(-50%);
}
}
.typeItem {
width: 76rpx;
height: 40rpx;
background-color: #f2f2f2;
border-radius: 8rpx;
margin-left: 12rpx;
color: #333333;
}
.activeType {
color: var(--color30);
}
</style>