330 lines
7.8 KiB
Vue
330 lines
7.8 KiB
Vue
|
<template>
|
|||
|
<view class="content">
|
|||
|
<view class="header">
|
|||
|
<view class="header-top">
|
|||
|
<view class="header-top-left">
|
|||
|
<image src="../../static/index/dangqian1.png" mode=""></image>
|
|||
|
<span class="header-text" style="margin-right: 5px;">当前周期</span>
|
|||
|
<span class="header-text">{{startTime}}~{{endTime}}</span>
|
|||
|
</view>
|
|||
|
<view class="header-top-btn" @click="wangqi">往期收益</view>
|
|||
|
</view>
|
|||
|
<view class="header-bottom">
|
|||
|
<view class="header-bottom-money">{{shouyiMoeny}}</view>
|
|||
|
<view class="header-text">当前收益</view>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
<t-refresh class="mian" ref="refresh" v-if="listData.length>0" @refresh="refresh" @loadMore="loadMore" :loadingType="loadingType" :tPadding="0">
|
|||
|
<template slot="content">
|
|||
|
<view class="mian-view" v-for="(item,index) in listData" :key="index" @click="goOder(item)">
|
|||
|
<view class="mian-head">
|
|||
|
<view class="mian-head-biao">{{item.status=='3'?'已完成':'待评价'}}</view>
|
|||
|
<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">
|
|||
|
<image src="../../my/static/bg6.png" mode=""></image>
|
|||
|
</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>
|
|||
|
<span class="shouyi-text">0.8km</span>
|
|||
|
</view>
|
|||
|
</view>
|
|||
|
<view class="mian-foot-dan shouyi-text">
|
|||
|
订单编号 : {{item.ordersNo}}
|
|||
|
</view>
|
|||
|
<view class="mian-foot-adder shouyi-text">
|
|||
|
服务地址 : {{item.address}}
|
|||
|
</view>
|
|||
|
<view class="mian-bottom">
|
|||
|
<view class="mian-bottom-xiang shouyi-text">项目金额 : ¥{{item.price}}</view>
|
|||
|
<view class="mian-bottom-shou">
|
|||
|
<span class="shouyi-text">本单收益: </span>
|
|||
|
<span class="shouyi-text" style="color: #FF6000;font-weight: bold;">¥{{item.artificerMoney}}</span>
|
|||
|
</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:[],
|
|||
|
titleData:'',
|
|||
|
page:1,
|
|||
|
limit:10,
|
|||
|
shouyiMoeny:'',
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
},
|
|||
|
onLoad(e) {
|
|||
|
this.orderType=e.type;
|
|||
|
this.shouyiMoeny=e.shouyiMoeny;
|
|||
|
|
|||
|
this.userId = uni.getStorageSync("artificerId");
|
|||
|
this.getTime()
|
|||
|
this.getData();
|
|||
|
},
|
|||
|
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();
|
|||
|
if(day>=1&&day<=10){
|
|||
|
this.startTime=year + '-' + monthJia + '-01';
|
|||
|
this.endTime=year + '-' + monthJia + '-' + 10;
|
|||
|
}else if(day>=11&&day<=20){
|
|||
|
this.startTime=year + '-' + monthJia + '-' + 11;
|
|||
|
this.endTime=year + '-' + monthJia + '-' + 20;
|
|||
|
}else if(day>=21&&day<=dayEnd){
|
|||
|
this.startTime=year + '-' + monthJia + '-' + 21
|
|||
|
this.endTime=year + '-' + monthJia + '-' + dayEnd;
|
|||
|
}
|
|||
|
},
|
|||
|
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]; //追加新数据
|
|||
|
} else {
|
|||
|
that.$queue.showToast(res.msg);
|
|||
|
}
|
|||
|
});
|
|||
|
},
|
|||
|
wangqi(){//往期收益 跳页
|
|||
|
uni.navigateTo({
|
|||
|
url:'/pages/index/previousEarnings'
|
|||
|
})
|
|||
|
},
|
|||
|
}
|
|||
|
}
|
|||
|
</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;
|
|||
|
}
|
|||
|
.mian-foot-adder{
|
|||
|
margin: 2px 0px;
|
|||
|
}
|
|||
|
.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{
|
|||
|
width: 75%;
|
|||
|
display: flex;
|
|||
|
flex-direction: column;
|
|||
|
}
|
|||
|
.mian-foot-img image{
|
|||
|
width: 100%;
|
|||
|
height: 100%;
|
|||
|
}
|
|||
|
.mian-foot-img{
|
|||
|
width: 158rpx;
|
|||
|
height: 188rpx;
|
|||
|
background: #E6E6E6;
|
|||
|
border-radius: 14rpx;
|
|||
|
}
|
|||
|
|
|||
|
.mian-foot{
|
|||
|
width: 100%;
|
|||
|
display: flex;
|
|||
|
flex-direction: row;
|
|||
|
align-items: center;
|
|||
|
justify-content: space-between;
|
|||
|
}
|
|||
|
.shouyi-text{
|
|||
|
color: #7D7D7D;
|
|||
|
font-size: 22rpx;
|
|||
|
}
|
|||
|
.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;
|
|||
|
font-size: 25rpx;
|
|||
|
}
|
|||
|
.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;
|
|||
|
padding: 10px;
|
|||
|
border-radius: 24rpx;
|
|||
|
display: flex;
|
|||
|
flex-direction: column;
|
|||
|
margin-top: 10px;
|
|||
|
}
|
|||
|
.mian{
|
|||
|
width: 100%;
|
|||
|
display: flex;
|
|||
|
flex-direction: column;
|
|||
|
align-items: center;
|
|||
|
}
|
|||
|
.header-bottom-money{
|
|||
|
font-weight: bold;
|
|||
|
font-size: 49rpx;
|
|||
|
color: #FFFFFF;
|
|||
|
margin-bottom: 3px;
|
|||
|
}
|
|||
|
.header-top-btn{
|
|||
|
width: 174rpx;
|
|||
|
height: 49rpx;
|
|||
|
line-height: 49rpx;
|
|||
|
text-align: center;
|
|||
|
font-size: 21rpx;
|
|||
|
color: #333333;
|
|||
|
background: #FFFFFF;
|
|||
|
border-radius: 24rpx;
|
|||
|
}
|
|||
|
.header-text{
|
|||
|
font-weight: 400;
|
|||
|
font-size: 22rpx;
|
|||
|
color: #FFFFFF;
|
|||
|
margin-top: 2px;
|
|||
|
}
|
|||
|
.header-top-left image{
|
|||
|
width: 24.31rpx;
|
|||
|
height:22.92rpx;
|
|||
|
margin-right: 2px;
|
|||
|
margin-top: 3px;
|
|||
|
}
|
|||
|
.header-top-left{
|
|||
|
display: flex;
|
|||
|
flex-direction: row;
|
|||
|
align-items: center;
|
|||
|
}
|
|||
|
.header-top{
|
|||
|
width: 100%;
|
|||
|
display: flex;
|
|||
|
flex-direction: row;
|
|||
|
justify-content: space-between;
|
|||
|
}
|
|||
|
.header{
|
|||
|
width: 100%;
|
|||
|
height: 300rpx;
|
|||
|
padding: 15px;
|
|||
|
background-image: url('../../static/index/fun_banner4.png');
|
|||
|
background-repeat: no-repeat;
|
|||
|
background-size: 100% 100%;
|
|||
|
display: flex;
|
|||
|
flex-direction: column;
|
|||
|
justify-content: space-around;
|
|||
|
}
|
|||
|
.content{
|
|||
|
width: 100%;
|
|||
|
height: 100vh;
|
|||
|
background-color: #f7f7f7;
|
|||
|
}
|
|||
|
</style>
|