sadjv3_jishi/pages/index/previousPoints.vue

782 lines
20 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<view class="content">
<view class="header">
<view class="header-top">
<view class="header-bottom">
<image style="width:100rpx; height:100rpx; margin-right: 10rpx;" src="../../static/purse3.png"></image>
<view>
<view class="header-text">当前积分</view>
<view class="header-bottom-money">{{sumJf}}<text style="font-size: 23rpx;font-weight: 400;"></text></view>
</view>
</view>
<view class="header-top-left">
<view class="header-text" style="text-align: right;">
当前周期
</view>
<view class="header-text1">
<span>{{startTime}}</span>
<span style="color: #029d88; margin-right: 5rpx;">~</span>
<span>{{endTime}}</span>
</view>
</view>
<!-- <view class="header-top-left">
<view>
<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>
</view> -->
</view>
<view class="flex justify-end">
<view class="header-top-btn" @click="wangqi">往期积分</view>
</view>
</view>
<!-- 往期时间选择 -->
<u-action-sheet :list="wqlistData" v-model="wqsyshow" @click="wqlistCallback"></u-action-sheet>
<view class="tapNav-list">
<view class="tapNav-view" v-for="(item,index) in tapNav" :key="index" @click="tabClick(index)">
<view class="tapNav-name">{{item.name}}</view>
<view class="tapNav-bor" v-if="tapNum==index"></view>
</view>
</view>
<view class="mina">
<!--业绩积分-->
<view class="mina-view" v-if="tapNum==0">
<view class="view-title">
<view class="view-title-left">
<span class="view-title-left-shuxian"></span>
<span class="view-title-left-text">业绩积分:<text class="view-num">{{yjjf}}</text></span>
</view>
<!-- <view class="view-title-right" @click="jieshi">更多</view> -->
</view>
<view class="mian-list" @click="goOder(item)" v-for="(item,index) in yjjfList" :key="index">
<view class="mian-list-top">
<view class="mian-list-top-biao">{{item.status=='3'?'待评价':'已完成'}}</view>
<view class="mian-list-top-time">
<span>预约时间: </span>
<span>{{item.serveTime}}</span>
</view>
</view>
<view class="mian-foot">
<view class="mian-foot-img">
<image :src="item.massageImg?item.massageImg: '../../../static/logo.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">{{item.km}}km</span>
</view>
</view>
<view class="mian-foot-dan od-number">
订单编号 : {{item.ordersNo}}
</view>
<view class="mian-foot-adder shouyi-text add-text">
服务地址 : {{item.accomplishAddress}}
</view>
<view class="mian-bottom">
<view class="mian-bottom-xiang shouyi-text">项目金额 : ¥{{item.priceTotal}}</view>
<view class="mian-bottom-shou">
<span class="shouyi-text">本单积分: </span>
<span class="shouyi-text" style="color: #FF6000;font-weight: bold;">{{item.jifen}}</span>
</view>
</view>
</view>
</view>
</view>
<view v-if="ddczList.yjjfList == 0" style="line-height: 80px;width:100%;text-align: center;">
<span >暂无数据</span>
</view>
</view>
<!--时长积分-->
<view class="mina-view" v-if="tapNum==1">
<view class="view-title">
<view class="view-title-left">
<span class="view-title-left-shuxian"></span>
<span class="view-title-left-text">时长积分: <text class="view-num">{{zxscjf}}</text>(在线时长10分钟可获取1积分)</span>
</view>
<!-- <view class="view-title-right" @click.stop="toggle('时长积分')">更多</view> -->
</view>
<view class="mian-table">
<view class="table-view">
<span style="font-weight: bold;">序号</span>
<span class="table-view-child" v-for="(item , index) in zxscList">{{index+1}}</span>
</view>
<view class="table-view">
<span style="font-weight: bold;">获取时间</span>
<span class="table-view-child" v-for="(item , index) in zxscList">{{item.jftime}}</span>
</view>
<view class="table-view">
<span style="font-weight: bold;">获取积分</span>
<span class="table-view-child" v-for="(item , index) in zxscList">{{item.jifen}}</span>
</view>
</view>
</view>
<!--储值积分-->
<view class="mina-view" v-if="tapNum==2">
<view class="view-title">
<view class="view-title-left">
<span class="view-title-left-shuxian"></span>
<span class="view-title-left-text">储值积分: <text class="view-num">{{czjf}}</text>
<!-- (为您充值累计积分兑换比例为1:1) -->
</span>
</view>
<!-- <view class="view-title-right" @click.stop="toggle('时长积分')">更多</view> -->
</view>
<view class="mian-table">
<view class="table-view">
<span style="font-weight: bold;">序号</span>
<span class="table-view-child" v-for="(item , index) in czjfList">{{index+1}}</span>
</view>
<view class="table-view">
<span style="font-weight: bold;">获取时间</span>
<span class="table-view-child" v-for="(item , index) in czjfList">{{item.jftime}}</span>
</view>
<view class="table-view">
<span style="font-weight: bold;">获取积分</span>
<span class="table-view-child" v-for="(item , index) in czjfList">{{item.jifen}}</span>
</view>
</view>
</view>
<!--充值积分-->
<view class="mina-view" v-if="tapNum==3">
<view class="view-title">
<view class="view-title-left">
<span class="view-title-left-shuxian"></span>
<span class="view-title-left-text">充值积分: <text class="view-num">{{ddczjf}}</text>
<!-- (充值积分比例为1:1) -->
</span>
</view>
<!-- <view class="view-title-right" @click.stop="toggle('充值积分')">更多</view> -->
</view>
<!-- <view class="mian-list" @click="goOder(item)" v-for="(item,index) in ddczList" :key="index">
<view class="mian-list-top">
<view class="mian-list-top-biao">已完成</view>
<view class="mian-list-top-time">
<span>预约时间: </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">{{item.km}}km</span>
</view>
</view>
<view class="mian-foot-dan shouyi-text">
订单编号 : {{item.ordersNo}}
</view>
<view class="mian-foot-adder shouyi-text">
服务地址 : {{item.accomplishAddress}}
</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.artificerMoneyTotal}}</span>
</view>
</view>
</view>
</view>
</view> -->
<view class="mian-table">
<view class="table-view">
<span style="font-weight: bold;">序号</span>
<span class="table-view-child" v-for="(item , index) in ddczList">{{index+1}}</span>
</view>
<view class="table-view">
<span style="font-weight: bold;">获取时间</span>
<span class="table-view-child" v-for="(item , index) in ddczList">{{item.jftime}}</span>
</view>
<view class="table-view">
<span style="font-weight: bold;">获取积分</span>
<span class="table-view-child" v-for="(item , index) in ddczList">{{item.jifen}}</span>
</view>
</view>
<view v-if="ddczList.length == 0" style="line-height: 80px;width:100%;text-align: center;">
<span >暂无数据</span>
</view>
</view>
</view>
<view>
<!-- 普通弹窗 -->
<uni-popup ref="popup" background-color="#fff" @change="change">
<view class="popup-content">
<view class="popup-head">
<span>{{titleList}}</span>
<span @click="closePopup(type)">x</span>
</view>
<view class="popup-mian">
<view class="popup-mian-textarea">
<view class="popup-mian-view">
<span>原服务项目价格:</span>
<span>¥198元</span>
</view>
<view class="popup-mian-view">
<span>现服务项目价格:</span>
<span>¥298元</span>
</view>
<view class="popup-mian-view">
<span>改价需支付差价:</span>
<span>¥100元</span>
</view>
</view>
<view class="popup-mian-btn">
<span @click="closePopup(type)">
取消
</span>
<span>
确定
</span>
</view>
</view>
</view>
</uni-popup>
</view>
</view>
</template>
<script>
export default{
data(){
return{
type:'center',
titleList:'',
startTime:'',
endTime:'',
userId:'',
czjf:'0',
czjfList:[],
ddczjf:'0',
ddczList:[],
yjjf:'0',
yjjfList:[],
zxscjf:'0',
zxscList:[],
sumJf:'0',
tapNav:[
{name:'业绩积分',id:'0'},
{name:'时长积分',id:'1'},
{name:'储值积分',id:'2'},
{name:'充值积分',id:'3'}
],
tapNum:0,
wqlistData:[],
wqsyshow:true,
}
},
onLoad(e) {
this.userId = uni.getStorageSync("artificerId");
this.getWangqiTime();
// this.getData();
},
methods:{
//
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();
},
wangqi(){//往期收益 跳页
this.wqsyshow = true;
// uni.navigateTo({
// url:'/pages/index/previousEarnings'
// })
},
//获取往期集合
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);
}
});
},
goOder(item){
uni.navigateTo({
url:'/my/order/revenueDetails?ordersId='+item.ordersId
})
},
tabClick(index){
this.tapNum=index;
this.page=0;
this.listData = [];
// uni.showLoading({
// title: '加载中'
// });
this.getData();
},
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<=15){
this.startTime=year + '-' + monthJia + '-01';
this.endTime=year + '-' + monthJia + '-' + 15;
}else if(day>=16&&day<=dayEnd){
this.startTime=year + '-' + monthJia + '-' + 16
this.endTime=year + '-' + monthJia + '-' + dayEnd;
}
if(!this.orderType){
this.orderType = 1;
}
},
getData(){
var that=this;
let data = {
userId:that.userId,
startTime:that.startTime,
endTime:that.endTime,
}
that.$Request.getT('/app/artificer/getJifenList', data).then(res => {
console.log(res);
if (res.code == 0) {
that.czjf = res.czjf;
that.czjfList = res.czjfList;
that.ddczjf = res.ddczjf;
that.ddczList = res.ddczList;
that.yjjf = res.yjjf;
that.yjjfList = res.yjjfList;
that.zxscjf = res.zxscjf;
that.zxscList = res.zxscList;
that.sumJf = res.sumJf;
// that.listData = [...that.listData, ...res.data.list]; //追加新数据
// that.shouyiMoeny = res.earnings;//收益信息
} else {
that.$queue.showToast(res.msg);
}
});
},
jieshi(){
uni.navigateTo({
url:'/pages/index/currentPointsDetail'
})
},
change(e) {
console.log('当前模式:' + e.type + ',状态:' + e.show);
},
closePopup(type){//改价 关闭弹出框
this.type = type
this.$refs.popup.close(type);
},
toggle(type) {//改价 弹出框
this.titleList=type
// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
this.$refs.popup.open(this.type)
},
wangqi(){//往期收益 跳页
uni.navigateTo({
url:'/pages/index/previousPoints'
})
},
}
}
</script>
<style scoped>
.tapNav-name{
font-weight: bold;
font-size: 30rpx;
color: #333333;
}
.tapNav-bor{
width: 62px;
height: 14rpx;
background: linear-gradient(-48deg, rgba(1, 156, 136, 0.35), rgba(45, 196, 142, 0.35));
border-radius: 7rpx;
position: absolute;
bottom: 0;
margin-bottom: 10px;
}
.tapNav-list{
width:100%;
margin: 0 auto;
display: flex;
flex-direction:row;
align-items: center;
justify-content: space-between;
background-color: #fff;
padding: 10rpx 0;
}
.tapNav-view{
height: 40px;
width: 50%;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
position: relative;
}
.popup-mian-view span:nth-child(1){
color: #666666;
}
.popup-mian-view span:nth-child(2){
color: #333;
font-weight: bold;
}
.popup-mian-view span{
font-size: 29rpx;
}
.popup-mian-view{
width: 100%;
height: 35px;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
border-bottom: 1px solid #DCDCDC;
}
.popup-mian-textarea{
width: 100%;
display: flex;
flex-direction: column;
}
.popup-mian-btn span:nth-child(1){
background: linear-gradient(90deg, #FE912E, #FF9970);
}
.popup-mian-btn span:nth-child(2){
background: linear-gradient(90deg, #019C88, #28BA92, #35C495);
}
.popup-mian-btn span{
width: 247rpx;
height: 77rpx;
line-height: 77rpx;
text-align: center;
font-weight: 400;
font-size: 32rpx;
color: #FFFEFE;
border-radius: 39rpx;
}
.popup-mian-btn{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
margin-top: 10px;
}
.popup-mian{
width: 88%;
display: flex;
flex-direction: column;
margin: 5px auto 0px auto;
}
.popup-head span:nth-child(2){
width: 50rpx;
height: 50rpx;
line-height: 19px;
text-align: center;
font-size: 24px;
color: #15AB8D;
border-radius: 50%;
border: 3px solid #15AB8D;
}
.popup-head span:nth-child(1){
font-weight: bold;
font-size: 32rpx;
color: #333333;
}
.popup-head{
width: 100%;
height: 99.38rpx;
background-color: rgba(21, 171, 141, 0.09);
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
padding: 0 15px;
}
.popup-content{
width: 613rpx;
height: 479rpx;
background: #FFFFFF;
border-radius: 56rpx;
display: flex;
flex-direction: column;
}
.table-view span{
font-size: 27rpx;
}
.table-view-bold{
font-weight: bold;
}
.table-view-child{
color: #888;
}
.table-view span{
margin-bottom: 20px;
}
.table-view{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.mian-table{
width: 100%;
padding: 15px;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
background: #FFFFFF;
border-radius: 21rpx;
margin-bottom: 10px;
}
.view-num{
color: #fb672b !important;
font-weight: bold;
font-size: 30rpx;
}
.mian-bottom{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
margin-top: 8rpx;
}
.mian-foot-adder{
margin: 3px 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: 73%;
display: flex;
flex-direction: column;
}
.mian-foot-img image{
width: 100%;
height: 100%;
border-radius: 20rpx;
}
.mian-foot-img{
width: 160rpx;
height: 160rpx;
background: #E6E6E6;
border-radius: 30rpx;
}
.mian-foot{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.mian-list-top-time span{
font-size:25rpx;
}
.mian-list-top-time span:nth-child(1){
color: #7D7D7D;
}
.mian-list-top-time span:nth-child(2){
color: #11957C;
}
.mian-list-top-time{
display: flex;
flex-direction: row;
align-items: center;
}
.mian-list-top-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-list-top{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
align-items: center;
padding-bottom: 10px;
border-bottom: 1px solid #E5E5E5;
margin-bottom: 10px;
}
.mian-list{
width: 100%;
padding: 10px;
display: flex;
flex-direction: column;
background: #FFFFFF;
border-radius: 24rpx;
margin-bottom: 10px;
}
.view-title-right{
font-weight: 400;
font-size: 21rpx;
color: #666666;
}
.view-title-left-text{
font-weight: 400;
font-size: 28rpx;
color: #019c88;
margin-left: 5px;
}
.view-title-left-shuxian{
width: 10rpx;
height: 29rpx;
background: #029D88;
border-radius: 5rpx;
}
.view-title-left{
display: flex;
flex-direction: row;
align-items: center;
margin: 15px 0px;
}
.view-title{
width: 100%;
display: flex;
flex-direction: row;
align-items: center;
justify-content: space-between;
}
.mina-view{
width: 100%;
display: flex;
flex-direction: column;
}
.mina{
width: 94%;
margin: 0 auto;
height: 300px;
display: flex;
flex-direction: column;
}
.header-bottom{
display: flex;
align-items: end;
}
.header-bottom-money{
font-weight: bold;
font-size: 49rpx;
color: #00b198;
margin-bottom: 3px;
}
.header-top-btn{
width: 174rpx;
height: 49rpx;
line-height: 46rpx;
text-align: center;
font-size: 26rpx;
background: linear-gradient(90deg, #019C88, #0FA78B, #35C495);
border-radius: 24rpx;
color: #fff;
}
.header-text{
font-weight: 400;
font-size: 26rpx;
color: #00b198;
margin-right: 8rpx;
}
.header-text1{
font-weight: 400;
font-size: 24rpx;
color: #00b198;
margin-right: 8rpx;
border-radius: 30rpx;
}
.header-top-left image{
width: 24.31rpx;
height:22.92rpx;
margin-right: 2px;
margin-top: 3px;
}
..header-top-left{
margin-top:40rpx;
text-align: right;
}
.header-top{
width: 100%;
display: flex;
flex-direction: row;
justify-content: space-between;
margin-bottom: 10px;
}
.header{
width: 100%;
height: 280rpx;
padding: 15px;
background:#f7f7f7 url('../../static/index/technician15.png');
background-repeat: no-repeat;
background-size: 100%;
display: flex;
flex-direction: column;
justify-content: space-around;
/*border-radius: 24rpx;*/
}
.content{
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
height: 100vh;
background-color: #f7f7f7;
overflow: scroll;
}
.od-number{
font-size: 24rpx;
color: #7ea866;
}
.add-text{
font-size: 26rpx;
color: #999;
}
.mian-bottom-xiang{
color: #7D7D7D;
}
</style>