Commit 1b0f55db by sunchao

积分详情

parent 7fc0eee6
...@@ -108,5 +108,13 @@ export default { ...@@ -108,5 +108,13 @@ export default {
//我的积分查询接口 //我的积分查询接口
findByUserIdForFortuneStatistic(params){ findByUserIdForFortuneStatistic(params){
return request(`${apiURL}/fortune/findByUserIdForFortuneStatistic`, "POST", params) return request(`${apiURL}/fortune/findByUserIdForFortuneStatistic`, "POST", params)
},
//我的积分明细
findForExchangeStatisticDtl(params){
return request(`${apiURL}/fortune/findForExchangeStatisticDtl`, "POST", params)
},
//分类查询
dropOptionsQuery(params){
return request(`${apiURL}/metadata/dropOptionsQuery`, "POST", params)
} }
} }
...@@ -139,7 +139,7 @@ ...@@ -139,7 +139,7 @@
}, },
toPointDetail(item){ toPointDetail(item){
uni.navigateTo({ uni.navigateTo({
url:`../myPoints/pointDetail` url:`../myPoints/pointsDetail?timeFlag=${this.timeFlag}&fortuneDate=${this.fortuneDate}&commissionType=${item.commissionType}&productType=${item.productType}`,
}) })
} }
} }
...@@ -231,9 +231,10 @@ ...@@ -231,9 +231,10 @@
li{ li{
width: 20%; width: 20%;
text-align: center; text-align: center;
overflow:hidden;
} }
li:nth-child(2){ li:nth-child(2){
width: 30%; width: 40%;
} }
.get_point{ .get_point{
color: #FF0000; color: #FF0000;
......
<template> <template>
<view class="container"> <view class="container">
<view class="top">
<picker @change="changeProductType" :value="dropOptionName" :range="productTypeList"
range-key="dropOptionName">
<view class="uni-input">{{productTypeList[productTypeIdx]['dropOptionName']}}
<text class="iconfont icon-youjiantou"></text>
</view>
</picker>
<picker mode="date" :value="fortuneDate" :end="maxDate" fields="month" @change="bindDateChange">
<view class="uni-input">{{fortuneDate}}
<text class="iconfont icon-youjiantou"></text>
</view>
</picker>
<picker @change="changeCommissionType" :value="dropOptionName" :range="commissionTypeList"
range-key="dropOptionName">
<view class="uni-input">{{commissionTypeList[commissionTypeIdx]['dropOptionName']}}
<text class="iconfont icon-youjiantou"></text>
</view>
</picker>
</view>
<view class="total_wrapper">
<h4 class="total">
{{fortuneDate}}总得分
</h4>
<h4 class="total_score_add" :class="{'total_score_reduce':sumCommissionAmount<=0}">
<text>{{sumCommissionAmount>0?'+':'-'}}</text>
{{sumCommissionAmount}}
</h4>
</view>
<view class="list_wrapper">
<view class="fortune_list" v-for="(fortuneItem,idx) in cffpFortuneDateList" :key="idx">
<view class="date_score_info">
<view>{{fortuneItem.orderDate}}</view>
<view class="total_score_add" :class="{'total_score_reduce':fortuneItem.nowSumCommissionAmount<=0}">
<text>{{fortuneItem.nowSumCommissionAmount>0?'+':'-'}}</text>
{{fortuneItem.nowSumCommissionAmount}}
</view>
</view>
<view class="fortuneExchangeList" v-for="(item,index) in fortuneItem.cffpFortuneExchangeList">
<text>{{item.productTypeName}}</text>
<text class="iconfont icon-youjiantou"></text>
</view>
</view>
</view>
</view> </view>
</template> </template>
<script> <script>
import api from '../../api/api';
import common from '../../common/common';
export default{ export default{
data(){ data(){
return { return {
fortuneDate: null,
timeFlag: null,
commissionType:null,
commissionTypeIdx:0,
productType: null,
productTypeIdx:0,
cffpFortuneDateList:[],
maxDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
commissionTypeList:[{dropOptionName:null,dropOptionCode:null}],
productTypeList:[{dropOptionName:null,dropOptionCode:null}],
sumCommissionAmount:null
} }
}, },
components:{}, components:{},
onLoad(){ onLoad(){
this.fortuneDate = common.getQueryString('fortuneDate');
this.productType = common.getQueryString('productType');
this.timeFlag = common.getQueryString('timeFlag');
this.commissionType = common.getQueryString('commissionType');
if(this.timeFlag == 'D' || this.timeFlag == 'Y'){
this.fortuneDate = `${new Date().getFullYear()}-${new Date().getMonth() + 1}-${new Date().getDate()}`
}
this.getCommissionType();
this.getProductType();
this.getDetail();
}, },
methods:{ methods:{
bindDateChange: function(e) {
this.fortuneDate = e.detail.value;
this.getDetail();
},
changeCommissionType: function(e) {
this.commissionTypeIdx = e.detail.value;
this.commissionType = this.commissionTypeList[this.commissionTypeIdx]['dropOptionCode'];
this.getDetail();
},
changeProductType: function(e) {
this.productTypeIdx = e.detail.value;
this.productType = this.productTypeList[this.productTypeIdx]['dropOptionCode'];
this.getDetail();
},
getDetail(){ getDetail(){
// const param = {
// isDtl: 1,
// userId: uni.getStorageSync('cffp_userId'),
// fortuneDate: this.fortuneDate,
// timeFlag: this.timeFlag,
// commissionType:this.commissionType,
// productType: this.productType
// }
const param = { const param = {
"isDtl": 1, isDtl: 1,
"userId": 1, userId: 1,
"fortuneDate": "2022-12", fortuneDate: "2022-12",
"timeFlag": "M", timeFlag: "M",
"commissionType":"A01", commissionType:"A01",
"productType": 1 productType: 1
}
api.findForExchangeStatisticDtl(param).then((res)=>{
if(res['success']){
this.cffpFortuneDateList = res['data']['cffpFortuneDateList'];
console.log(this.cffpFortuneDateList)
this.sumCommissionAmount = res['data']['sumCommissionAmount'];
} }
});
},
//commissionType
getProductType(){
api.dropOptionsQuery({code:'cffp_course_classify'}).then((res)=>{
this.productTypeList = [{dropOptionName:'全部',dropOptionCode:null}].concat(res['data']['dropMasterInfoList'][0]['dropOptionsInfoList']);
for(let i=0;i<this.productTypeList.length;i++){
if(this.productType == this.productTypeList[i]['dropOptionCode']){
this.productTypeIdx = i;
break;
}
}
})
},
getCommissionType(){
api.dropOptionsQuery({code:'CFFP_Commission_Item'}).then((res)=>{
this.commissionTypeList = [{dropOptionName:'全部',dropOptionCode:null}].concat(res['data']['dropMasterInfoList'][0]['dropOptionsInfoList']);
for(let i=0;i<this.commissionTypeList.length;i++){
if(this.commissionType == this.commissionTypeList[i]['dropOptionCode']){
this.commissionTypeIdx = i;
break;
}
}
console.log(this.commissionTypeIdx)
})
} }
}
} }
}
</script> </script>
<style> <style lang="scss">
.container{
.top{
padding: 30rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 auto 20rpx auto;
background: #fff;
}
.total_wrapper{
display: flex;
justify-content: space-between;
align-items: center;
padding: 30rpx;
background: #fff;
margin-bottom: 20rpx;
.total_score_add{
color:#F15A1F;
}
.total_score_reduce{
color:#5C9D50;
}
}
.list_wrapper{
padding: 30rpx;
background: #fff;
.fortune_list{
.date_score_info,.fortuneExchangeList{
display: flex;
justify-content: space-between;
margin-bottom: 20rpx;
.total_score_add{
color:#F15A1F;
}
.total_score_reduce{
color:#5C9D50;
}
.iconfont{
color: #999999;
font-size: 24rpx;
}
}
.date_score_info{
font-size: 28rpx;
}
.fortuneExchangeList{
border-bottom: 2rpx #F2F2F2 solid;
padding-bottom: 20rpx;
}
}
}
}
</style> </style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment