sadjv3_jishi/pages/index/currentIncome.vue

394 lines
9.7 KiB
Vue
Raw Normal View History

2024-06-26 16:58:53 +08:00
<template>
<view class="content">
<view class="header">
<view class="header-top">
2024-07-26 16:53:41 +08:00
<view class="header-bottom" >
<image style="width:100rpx; height:100rpx; margin-right: 10rpx;" src="../../static/purse3.png"></image>
<view>
2024-07-26 17:30:46 +08:00
<view class="header-text" style=" margin-top: -5px;">当前收益</view>
<view class="header-bottom-money">{{shouyiMoeny}}</view>
2024-07-26 16:53:41 +08:00
</view>
2024-07-16 11:46:39 +08:00
</view>
2024-07-12 15:30:44 +08:00
<view class="header-top-left">
2024-07-16 11:46:39 +08:00
<view style="margin-bottom: 10rpx;">
2024-07-12 15:30:44 +08:00
<span class="header-text"></image>当前周期</span>
</view>
<view>
<span class="header-text1">{{startTime}}</span><span style="color: #fff; margin-right: 5rpx;">~</span><span class="header-text1">{{endTime}}</span>
</view>
2024-06-26 16:58:53 +08:00
</view>
</view>
2024-07-26 16:53:41 +08:00
<view class="flex justify-end">
<view class="header-top-btn" @click="wangqi" style="font-size: 14px; margin-top: -8px;">往期收益</view>
</view>
2024-07-16 11:46:39 +08:00
<!--<view class="header-bottom" style="margin-bottom: 40rpx;">
2024-07-02 18:10:24 +08:00
<view class="header-text" style=" margin-top: -5px;">当前收益</view>
2024-07-16 11:46:39 +08:00
<view class="header-bottom-money">{{shouyiMoeny}}</view>
2024-06-26 16:58:53 +08:00
</view>
2024-07-16 11:46:39 +08:00
性别选择 -->
<u-action-sheet :list="wqlistData" v-model="wqsyshow" @click="wqlistCallback"></u-action-sheet>
2024-06-26 16:58:53 +08:00
</view>
2024-06-28 10:45:52 +08:00
<t-refresh class="mian" ref="refresh" v-if="listData.length>0" @refresh="refresh" @loadMore="loadMore" :loadingType="loadingType" :tPadding="0" >
<template slot="content" >
2024-06-26 16:58:53 +08:00
<view class="mian-view" v-for="(item,index) in listData" :key="index" @click="goOder(item)">
<view class="mian-head">
2024-07-01 13:46:59 +08:00
<view class="mian-head-biao">{{item.status=='3'?'待评价':'已完成'}}</view>
2024-06-26 16:58:53 +08:00
<view class="mian-head-time">
<span class="shouyi-text">预约时间: </span>
<span>{{item.serveTime}}</span>
</view>
</view>
<view class="mian-foot">
<view class="mian-foot-img">
2024-07-01 13:46:59 +08:00
<image :src="item.massageImg?item.massageImg: '../../../static/logo.png'" mode=""></image>
2024-06-26 16:58:53 +08:00
</view>
<view class="mian-foot-list">
<view class="mian-foot-view">
<view class="mian-title">{{item.entryName}}</view>
<view class="mian-dingwei">
<image src="../../static/index/dangqian2.png" mode=""></image>
2024-07-01 13:46:59 +08:00
<span class="shouyi-text">{{item.km}}km</span>
2024-06-26 16:58:53 +08:00
</view>
</view>
2024-07-01 21:17:17 +08:00
<view class="mian-foot-dan shouyi-text od-number">
2024-06-26 16:58:53 +08:00
订单编号 : {{item.ordersNo}}
</view>
2024-07-01 21:17:17 +08:00
<view class="mian-foot-adder shouyi-text add-text">
2024-06-26 16:58:53 +08:00
服务地址 : {{item.address}}
</view>
<view class="mian-bottom">
2024-07-16 13:30:24 +08:00
<view class="shouyi-text">项目金额 : {{item.priceTotal}}</view>
2024-06-26 16:58:53 +08:00
<view class="mian-bottom-shou">
<span class="shouyi-text">本单收益: </span>
2024-07-12 15:19:33 +08:00
<span class="shouyi-text" style="color: #FF6000;font-weight: bold;">{{item.artificerMoneyTotal}}</span>
2024-06-26 16:58:53 +08:00
</view>
</view>
</view>
</view>
</view>
</template>
</t-refresh>
<empty v-if="listData.length==0"></empty>
</view>
</template>
<script>
import empty from '@/components/empty.vue'
import tRefresh from "@/components/t-refresh/t-refresh.vue"
export default {
components:{tRefresh,empty},
data(){
return{
loadingType:0,
orderType:'',
userId:'',
startTime:'',
endTime:'',
listData:[],
2024-06-26 21:47:41 +08:00
wqlistData:[],
2024-06-26 16:58:53 +08:00
titleData:'',
page:1,
limit:10,
shouyiMoeny:'',
2024-06-26 21:47:41 +08:00
wqsyshow:false,
2024-06-26 16:58:53 +08:00
}
},
onLoad(e) {
this.orderType=e.type;
2024-06-26 21:47:41 +08:00
// this.shouyiMoeny=e.shouyiMoeny;
2024-06-26 16:58:53 +08:00
this.userId = uni.getStorageSync("artificerId");
this.getTime()
this.getData();
2024-06-26 21:47:41 +08:00
// this.getWangqiTime();
2024-06-26 16:58:53 +08:00
},
onPullDownRefresh: function() {
this.page = 1;
this.getData();
},
methods:{
goOder(item){
uni.navigateTo({
url:'/my/order/revenueDetails?ordersId='+item.ordersId
})
},
// 加载更多
loadMore: async function() {
//loadingType: 0.数据未加载完 1.数据全部加载完了 2.数据加载中
if(this.loadingType==0){
this.loadingType=2
//模拟数据请求
setTimeout(()=>{
this.page++;
this.loadingType=0;
this.getData()
},1000)
}
},
getTime(){
let now = new Date();
let year = now.getFullYear();
let month = now.getMonth() + 1; // JavaScript中月份是从0开始计数需加1
let monthJia=month<10?'0'+month:month;
let day = now.getDate();
let currentDate = year + '-' + monthJia + '-' + day;
let dayEnd = new Date(now.getFullYear(), monthJia, 0).getDate();
2024-07-17 08:58:37 +08:00
if(day>=1&&day<=15){
2024-06-26 16:58:53 +08:00
this.startTime=year + '-' + monthJia + '-01';
2024-07-17 08:58:37 +08:00
this.endTime=year + '-' + monthJia + '-' + 15;
}else if(day>=16&&day<=dayEnd){
this.startTime=year + '-' + monthJia + '-' + 16
2024-06-26 16:58:53 +08:00
this.endTime=year + '-' + monthJia + '-' + dayEnd;
}
2024-06-26 21:47:41 +08:00
if(!this.orderType){
this.orderType = 1;
}
2024-06-26 16:58:53 +08:00
},
getData(){
var that=this;
let data = {
userId:that.userId,
orderType:that.orderType,
startTime:that.startTime,
endTime:that.endTime,
page: that.page,
limit: that.limit,
}
that.$Request.getT('/app/artificer/getOrderTypeList', data).then(res => {
if (res.code == 0) {
if (that.page == 1) that.listData = []; //如果是第一页需手动制空列表
that.listData = [...that.listData, ...res.data.list]; //追加新数据
2024-06-26 21:47:41 +08:00
that.shouyiMoeny = res.earnings;//收益信息
2024-06-26 16:58:53 +08:00
} else {
that.$queue.showToast(res.msg);
}
});
},
2024-06-26 21:47:41 +08:00
//获取往期集合
// getWangqiTime(){
// var that=this;
// let data = {
// userId:that.userId,
// }
// that.$Request.getT('/app/artificer/getZqhzList', data).then(res => {
// console.log('------>',res)
// if (res.code == 0) {
// that.wqlistData = res.data;
// } else {
// that.$queue.showToast(res.msg);
// }
// });
// },
//
// wqlistCallback(index){
// console.log("wqlistCallback-->",index)
// this.wqsyshow = false;
// var startAndEnd = this.wqlistData[index].label.split(" 至 ");
// console.log("startAndEnd---->",startAndEnd)
// this.startTime = startAndEnd[0];
// this.endTime = startAndEnd[1];
// console.log("startTime>",this.startTime)
// console.log("endTime>",this.endTime)
// this.getData();
// },
2024-06-26 16:58:53 +08:00
wangqi(){//往期收益 跳页
2024-06-26 21:47:41 +08:00
// this.wqsyshow = true;
2024-06-26 16:58:53 +08:00
uni.navigateTo({
2024-06-26 21:47:41 +08:00
url:'/pages/index/previousEarnings?orderType='+this.orderType
2024-06-26 16:58:53 +08:00
})
},
}
}
</script>
<style scoped>
/deep/.refresh-body .content{
/* background-color: #f7f7f7; */
}
/deep/.refresh-body{
height: 100% !important;
border-top: 2px solid #f7f7f7;
}
.mian-bottom{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
2024-07-01 21:17:17 +08:00
margin-top: 8rpx;
2024-07-16 13:30:24 +08:00
font-size: ;
2024-06-26 16:58:53 +08:00
}
.mian-foot-adder{
2024-07-01 21:17:17 +08:00
margin: 3px 0px;
2024-06-26 16:58:53 +08:00
}
.mian-dingwei image{
width: 18.75rpx;
height:21.53rpx;
margin-right: 5px;
}
.mian-dingwei,.mian-bottom-shou{
display: flex;
flex-direction: row;
align-items: center;
}
.mian-title{
font-weight: bold;
font-size: 31rpx;
color: #333333;
}
.mian-foot-view{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-bottom: 5px;
}
.mian-foot-list{
2024-07-01 21:17:17 +08:00
width: 73%;
2024-06-26 16:58:53 +08:00
display: flex;
flex-direction: column;
}
2024-07-01 21:17:17 +08:00
.mian-foot-img image{
2024-06-26 16:58:53 +08:00
width: 100%;
height: 100%;
2024-07-01 21:17:17 +08:00
border-radius: 20rpx;
2024-06-26 16:58:53 +08:00
}
.mian-foot-img{
2024-07-01 21:17:17 +08:00
width: 160rpx;
height: 160rpx;
2024-06-26 16:58:53 +08:00
background: #E6E6E6;
2024-07-01 21:17:17 +08:00
border-radius: 30rpx;
2024-06-26 16:58:53 +08:00
}
.mian-foot{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.shouyi-text{
color: #7D7D7D;
2024-07-01 21:17:17 +08:00
font-size: 26rpx;
2024-06-26 16:58:53 +08:00
}
.mian-head-time span:nth-child(2){
color: #11957C;
margin-top: 1px;
}
.mian-head-time{
display: flex;
flex-direction: row;
align-items: center;
font-weight: 400;
2024-07-01 21:17:17 +08:00
font-size: 26rpx;
2024-06-26 16:58:53 +08:00
}
.mian-head-biao{
width: 130rpx;
height: 47rpx;
line-height: 47rpx;
color: #fff;
font-size: 25rpx;
text-align: center;
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
border-top-left-radius: 21rpx;
border-bottom-right-radius: 21rpx;
}
.mian-head{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #E5E5E5;
padding-bottom: 5px;
margin-bottom: 10px;
}
.mian-view{
width: 95%;
background-color: #fff;
2024-07-01 21:17:17 +08:00
padding: 12px;
2024-06-26 16:58:53 +08:00
border-radius: 24rpx;
display: flex;
flex-direction: column;
2024-07-01 21:17:17 +08:00
margin: 26rpx auto;
2024-06-26 16:58:53 +08:00
}
.mian{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
2024-07-26 16:53:41 +08:00
2024-06-26 16:58:53 +08:00
.header-bottom-money{
font-weight: bold;
font-size: 49rpx;
2024-07-26 16:53:41 +08:00
color: #00b198;
2024-06-26 16:58:53 +08:00
margin-bottom: 3px;
}
2024-07-26 16:53:41 +08:00
.header-bottom{
display: flex;
align-items: end;
}
2024-06-26 16:58:53 +08:00
.header-top-btn{
width: 174rpx;
height: 49rpx;
2024-07-26 16:53:41 +08:00
line-height: 46rpx;
2024-06-26 16:58:53 +08:00
text-align: center;
2024-06-28 10:45:52 +08:00
font-size: 26rpx;
2024-07-26 16:53:41 +08:00
background: linear-gradient(90deg, #019C88, #0FA78B, #35C495);
2024-06-26 16:58:53 +08:00
border-radius: 24rpx;
2024-07-26 16:53:41 +08:00
color: #fff;
2024-06-26 16:58:53 +08:00
}
.header-text{
font-weight: 400;
2024-07-12 15:30:44 +08:00
font-size: 26rpx;
2024-07-26 16:53:41 +08:00
color: #00b198;
2024-06-28 10:45:52 +08:00
margin-right: 8rpx;
2024-06-26 16:58:53 +08:00
}
2024-07-12 15:30:44 +08:00
.header-text1{
font-weight: 400;
font-size: 24rpx;
2024-07-26 16:53:41 +08:00
color: #00b198;
2024-07-12 15:30:44 +08:00
margin-right: 8rpx;
border-radius: 30rpx;
}
2024-06-26 16:58:53 +08:00
.header-top-left{
2024-07-26 16:53:41 +08:00
margin-top:20rpx;
2024-07-16 11:46:39 +08:00
text-align: right;
2024-06-26 16:58:53 +08:00
}
.header-top{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.header{
2024-07-26 16:53:41 +08:00
width: 100%;
2024-07-16 11:46:39 +08:00
height: 280rpx;
2024-06-26 16:58:53 +08:00
padding: 15px;
2024-07-16 11:46:39 +08:00
background:#f7f7f7 url('../../static/index/technician15.png');
2024-06-26 16:58:53 +08:00
background-repeat: no-repeat;
2024-07-26 16:53:41 +08:00
background-size: 100%;
2024-06-26 16:58:53 +08:00
display: flex;
flex-direction: column;
justify-content: space-around;
2024-07-26 16:53:41 +08:00
/*border-radius: 24rpx;*/
2024-06-26 16:58:53 +08:00
}
.content{
width: 100%;
height: 100vh;
background-color: #f7f7f7;
}
2024-07-01 21:17:17 +08:00
.od-number{
font-size: 24rpx;
color: #7ea866;
}
.add-text{
font-size: 26rpx;
color: #999;
}
2024-06-26 16:58:53 +08:00
</style>