Commit 9842fcd0 by kyle

销售课程

parents 3d890d98 1b0f55db
......@@ -108,5 +108,25 @@ export default {
//我的积分查询接口
findByUserIdForFortuneStatistic(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)
},
// 销售课程统计
userCourseCount(params){
return request(`${cffpURL}/course/userCourseCount`, "POST", params)
},
// 销售课程列表查询
userCourseList(params){
return request(`${cffpURL}/course/userCourseList`, "POST", params)
},
// 分享课程列表查询
userShareCourseList(params){
return request(`${cffpURL}/course/userShareCourseList`, "POST", params)
}
}
......@@ -32,5 +32,13 @@ export default {
}
});
},
// 下拉选单通过code获取name
getNameByCode(code:String,arr:Array<any>){
if(arr && arr.filter(item=>item.dropOptionCode == code).pop()){
return arr.filter(item=>item.dropOptionCode == code).pop().dropOptionName
}else{
return;
}
}
}
\ No newline at end of file
......@@ -153,7 +153,7 @@
"path" : "pages/myPoints/myPoints",
"style" :
{
"navigationBarTitleText": "",
"navigationBarTitleText": "我的积分",
"enablePullDownRefresh": false
}
}
......@@ -194,6 +194,13 @@
"style" :
{
"navigationBarTitleText": "销售课程",
"enablePullDownRefresh": false
}
},{
"path" : "pages/myPoints/pointsDetail",
"style" :
{
"navigationBarTitleText": "积分明细",
"enablePullDownRefresh": false
}
}
......
......@@ -67,7 +67,7 @@
data() {
return {
featureLists:[
{ key: '00', name: '销售课程', icon: 'salesCourse', link: '/pages/saleCourseLists/saleCourseLists', isOpen: false },
{ key: '00', name: '销售课程', icon: 'salesCourse', link: '/pages/saleCourseLists/saleCourseLists', isOpen: true },
{ key: '01', name: '我的积分', icon: 'integral', link: '../myPoints/myPoints', isOpen: true },
{ key: '02', name: '申请加盟', icon: 'applyJoin', link: '../application-process/basic-info', isOpen: true },
{ key: '03', name: '学习认证', icon: 'learningCertify', link: '../learnCertify/learnCertify', isOpen: true },
......@@ -122,12 +122,12 @@
},
queryAreaCenterInfo(){
api.queryAreaCenterInfo({userId:1}).then((res)=>{
if(res['commonResult']['success']){
this.cffpUserInfo = res;
if(res['success']){
this.cffpUserInfo = res['data'];
// this.cffpUserInfo.logo = res['logo'];
}else{
uni.showToast({
title: res['commonResult']['message'],
title: res['message'],
duration: 2000,
icon: 'none'
})
......
......@@ -3,7 +3,7 @@
<view class="top">
<view class="exchange_wrapper">
<view>可兑换积分 <text style="color: #FF7704;">{{yesExchangeFortune}}积分</text></view>
<view style="color:#C85E04;text-decoration: underline;">可兑换提现5555.55</view>
<view style="color:#C85E04;text-decoration: underline;">可兑换提现{{yesExchangeFortune}}</view>
</view>
<view class="bg">
<image src="/static/mypoint_pic.png" mode="widthFix"></image>
......@@ -29,16 +29,16 @@
</view>
<view class="statistics_wrapper">
<view class="">
<text style="color: #0A2F99;">11111</text>
<text style="color: #0A2F99;">{{sumCommissionAmount}}</text>
<text>累计积分</text>
</view>
<view class="">
<text style="color: #F15A1F;">333</text>
<text>今日获得积分</text>
<text style="color: #F15A1F;">{{nowSumCommissionAmount}}</text>
<text>{{getName(timeFlag)}}获得积分</text>
</view>
<view class="">
<text style="color: #0A2F99;">-222</text>
<text>{{prePercent}}</text>
<text style="color: #0A2F99;">{{prePercent}}%</text>
<text>{{getInfo(timeFlag)}}得分</text>
</view>
</view>
<view class="point_content">
......@@ -51,7 +51,7 @@
<li>获得积分</li>
<li>操作</li>
</ul>
<ul class="point_content_list" v-for="pointItem in cffpFortuneDeductionList">
<ul class="point_content_list" v-for="pointItem in cffpFortuneDeductionList" @click="toPointDetail(pointItem)">
<li>{{pointItem.productTypeName}}</li>
<li>{{pointItem.commissionTypeName}}</li>
<li class="get_point">{{pointItem.commissionAmount}}</li>
......@@ -91,12 +91,19 @@
this.fortuneDate = e.detail.value;
},
findByUserIdForFortuneStatistic(){
// const param = {
// isDtl:2,
// userId:uni.getStorageSync('cffp_userId'),
// fortuneDate:this.fortuneDate,
// timeFlag:this.timeFlag
// }
const param = {
isDtl:2,
userId:uni.getStorageSync('cffp_userId'),
fortuneDate:this.fortuneDate,
timeFlag:this.timeFlag
}
"isDtl": 2,
"userId": 1,
"fortuneDate": "2022-11-01",
"timeFlag": "D"
}
api.findByUserIdForFortuneStatistic(param).then((res)=>{
console.log(res)
if(res['success']){
......@@ -104,9 +111,36 @@
this.nowSumCommissionAmount = res['data']['nowSumCommissionAmount'] //当前(日月年)积分
this.prePercent = res['data']['prePercent'] //比前日、上月,上年多或少的百分比数据
this.yesExchangeFortune = res['data']['yesExchangeFortune'] //可兑换金额
this.cffpFortuneDeductionList = res['data']['cffpFortuneDeductionList'];
this.cffpFortuneDeductionList = res['data']['cffpFortuneDeductionList']
}
})
},
getInfo(str){
if(str == 'D'){
return '上次';
}
if(str == 'M'){
return '上月';
}
if(str == 'Y'){
return '去年';
}
},
getName(str){
if(str == 'D'){
return '当日';
}
if(str == 'M'){
return '当月';
}
if(str == 'Y'){
return '当年';
}
},
toPointDetail(item){
uni.navigateTo({
url:`../myPoints/pointsDetail?timeFlag=${this.timeFlag}&fortuneDate=${this.fortuneDate}&commissionType=${item.commissionType}&productType=${item.productType}`,
})
}
}
}
......@@ -195,8 +229,15 @@
align-items: center;
height: 70rpx;
li{
width: 25%;
width: 20%;
text-align: center;
overflow:hidden;
}
li:nth-child(2){
width: 40%;
}
li:nth-child(2){
width: 30%;
}
.get_point{
color: #FF0000;
......
<template>
<view class="container">
<<<<<<< Updated upstream
<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>
=======
>>>>>>> Stashed changes
</view>
</template>
<script>
<<<<<<< Updated upstream
import api from '../../api/api';
import common from '../../common/common';
export default{
data(){
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
=======
export default{
data(){
return {
>>>>>>> Stashed changes
}
},
components:{},
onLoad(){
<<<<<<< Updated upstream
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:{
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(){
// const param = {
// isDtl: 1,
// userId: uni.getStorageSync('cffp_userId'),
// fortuneDate: this.fortuneDate,
// timeFlag: this.timeFlag,
// commissionType:this.commissionType,
// productType: this.productType
// }
const param = {
isDtl: 1,
userId: 1,
fortuneDate: "2022-12",
timeFlag: "M",
commissionType:"A01",
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>
<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;
}
}
}
}
=======
},
methods:{
getDetail(){
const param = {
"isDtl": 1,
"userId": 1,
"fortuneDate": "2022-12",
"timeFlag": "M",
"commissionType":"A01",
"productType": 1
}
}
}
}
</script>
<style>
>>>>>>> Stashed changes
</style>
\ No newline at end of file
......@@ -64,6 +64,10 @@
},
mounted() {
this.userCourseInfo()
},
onLoad(option) {
this.orderId = option.id
console.log(option)
}
}
......
......@@ -10,47 +10,57 @@
<!-- 销售统计 -->
<view class="saleStatisticalContent">
<view class="statisticItem">
<text>{{coursesCountInfos.shareFrequencyMonth}}</text>
<text>{{coursesCountInfos.integralCount}}</text>
<text>累计积分</text>
</view>
<view class="statisticItem" @click="viewIntegral()">
<text class="colorText">{{coursesCountInfos.integralMonth}}</text>
<text class="colorText">{{coursesCountInfos.integralDay}}</text>
<text>今日获得积分</text>
</view>
<view class="statisticItem">
<text>{{coursesCountInfos.shareSectionMonth}}</text>
<text>{{coursesCountInfos.integralMonth}}</text>
<text>本月得分</text>
</view>
<view class="statisticItem">
<text>{{coursesCountInfos.shareFrequencyCount}}</text>
<text>{{coursesCountInfos.orderCount}}</text>
<text>累计订单</text>
</view>
<view class="statisticItem" @click="viewIntegral()">
<text class="colorText">{{coursesCountInfos.integralCount}}</text>
<text class="colorText">{{coursesCountInfos.orderDay}}</text>
<text>今日成交单数</text>
</view>
<view class="statisticItem">
<text>{{coursesCountInfos.shareSectionCount}}</text>
<text>{{coursesCountInfos.orderMonth}}</text>
<text>本月单数</text>
</view>
</view>
<!-- 分享明细 -->
<view class="saleDetailContent">
<view class="courseTab">
<text>我的课程</text>
<text>分享课程</text>
<text :class="{'actived':tabType===1}" @click="switchTab(1)">我的课程</text>
<text :class="{'actived':tabType===2}" @click="switchTab(2)">分享课程</text>
</view>
<view class="totalCountBox">合计(单):<text>12</text></view>
<h4 class="noListTip" v-if="!userShareCourses">暂无销售记录!</h4>
<template v-if="userShareCourses">
<view class="saleOrderInfoItem" v-for="item in userShareCourses" :key="item.fileId">
<view class="totalCountBox">合计(单):<text>{{userCourseCountNum}}</text></view>
<h4 class="noListTip" v-if="!userCourses && tabType===1">暂无销售记录!</h4>
<h4 class="noListTip" v-if="!userShareCourseOrders && tabType===2">暂无分享记录!</h4>
<template v-if="userCourses && tabType===1">
<view class="saleOrderInfoItem" v-for="item in userCourses" :key="item.fileId">
<view class="courseInfoContent">
<course-item :thumbnailPath="item.displayImage" :title="item.fileTitle" :summaryBox="item.fileSynopsis" :dataList="{coursePrice:item.coursePrice,salesNumber:item.salesNumber}" :tagList="{v1:item.fileLecturerRanks,v2:item.fileLecturerName}"></course-item>
</view>
<view class="countsContent" @click="goDetail(item.fileId)">
<view>
<text>实际支付:¥199.00</text>
</view>
<text>实际支付:¥199.00</text>
</view>
</view>
</template>
<template v-if="userCourses && tabType===2">
<view class="orderItemDetailBox" v-for="item in userShareCourseOrders">
<view><text>订单编号</text><text>{{item.orderNo}}</text></view>
<view><text>课程名称</text><text>{{item.fileTitle}}</text></view>
<view><text>购买人</text><text>{{item.userName}}</text></view>
<view class="orderDetailLine">
<text></text>
<text @click="viewDetail(item.orderId)">订单详情></text>
</view>
</view>
</template>
......@@ -69,39 +79,58 @@
return {
queryDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
maxDate:`${new Date().getFullYear()}-${new Date().getMonth() + 1}`,
userId:null,
userId:'1',
coursesCountInfos:{},
userShareCourse:[]
userCourses:[],
userShareCourseOrders:[],
userCourseCountNum:0,
userShareCourseCount:0,
tabType:1
}
},
methods: {
bindDateChange: function(e) {
this.queryDate = e.detail.value
this.queryDate = e.detail.value;
this.userCourseList();
this.userCourseCount();
},
switchTab(type){
this.tabType = type
this.userCourseList()
},
userCourseCount(){
const params = {
userId:this.userId,
queryDate:this.queryDate
}
api.userCourseCount(params).then(res=>{
if(res['success']){
this.coursesCountInfos = res['data']
}
})
},
userShareQuery(){
userCourseList(){
const params = {
userId:this.userId,
queryDate:this.queryDate
}
this.coursesCountInfos ={
shareFrequencyMonth:'XXX',
integralMonth:'XXX',
shareSectionMonth:'XXX',
shareFrequencyCount:'XXX',
integralCount:'XXX',
shareSectionCount:'XXX'
if(this.tabType===1){
api.userCourseList(params).then(res=>{
console.log(res)
if(res['success']){
this.userCourses = res['data']['userCourses'];
this.userCourseCountNum = res['data']['userCourseCount'];
}
})
}else{
api.userShareCourseList(params).then(res=>{
if(res['success']){
this.userShareCourseOrders = res['data']['userShareCourseOrders'];
this.userCourseCountNum = res['data']['userShareCourseCount'];
}
})
}
this.userShareCourses = [
{fileId:1,fileTitle:'11111',fileLecturerName:'sssss',fileLecturerRanks:'nnnnnn',coursePrice:'12312',salesNumber:123,shareDate:'2022-11-11 17:33',shareCount:123,readCount:111,buyCount:111}
]
console.log(this.userShareCourses)
// api.userShareQuery(params).then(res=>{
// console.log(res)
// if(res['success']){
// this.coursesCountInfos = res['data']['coursesCountInfos'];
// this.userShareCourses = res['data']['userShareCourses'];
// }
// })
},
// 查看详情
goDetail(val){
......@@ -114,10 +143,17 @@
uni.navigateTo({
url:`/pages/myPoints/myPoints`
})
},
// 查看订单详情
viewDetail(id){
uni.navigateTo({
url:`/pages/orderDetail/orderDetail?id=${id}`
})
}
},
onLoad() {
this.userShareQuery()
this.userCourseCount()
this.userCourseList()
},
mounted() {
......@@ -174,26 +210,74 @@
}
.saleDetailContent{
margin: 10rpx 20rpx;
padding: 20rpx 14rpx;
h3{
color: #333;
font-size: 36rpx;
position: relative;
margin: 10rpx 0 10rpx 58rpx;
&::before{
content: '';
display: block;
position: absolute;
left: -5px;
top: 4px;
width: 2px;
height: 70%;
border-radius: 4rpx;
background-color: #FA882F;
.saleOrderInfoItem{
padding: 18rpx 10rpx;
border-radius: 20rpx;
background-color: #fff;
.countsContent{
text-align: right;
color: #333;
font-size: 32rpx;
margin-top: 20rpx;
}
}
.saleOrderInfoItem{
margin: 0 20rpx;
.orderItemDetailBox{
padding: 10rpx 20rpx 10rpx 40rpx;
background-color: #fff;
border-radius: 20rpx;
color: #4a4a4a;
margin-bottom: 20rpx;
font-size: 24rpx;
view{
position: relative;
margin-bottom: 20rpx;
display: flex;
text{
&:first-child{
color: #333;
width: 0;
flex: 0 0 20%;
}
}
&:first-child::before{
display:block;
content: '';
position: absolute;
left: -20rpx;
top: 10rpx;
width: 8rpx;
height: 60%;
border-radius:8rpx;
background-color: #FA882F;
}
&.orderDetailLine{
justify-content: flex-end;
font-size: 28rpx;
}
}
}
.courseTab{
margin-top: 20rpx;
text{
padding: 6rpx 16rpx;
color: #20269B;
border: 1px solid #20269B;
border-radius: 10rpx;
margin-right: 20rpx;
font-size: 24rpx;
&.actived{
background-color: #20269B;
color: #fff;
}
}
}
.totalCountBox{
margin: 16rpx 0;
font-size: 28rpx;
color: #666;
text{
color: #20269B;
}
}
}
}
......
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