Commit 47c6c847 by sunerhu

1.修改H5 提交订单 参数错误问题。

2.退课提交添加校验
parent 30c7b65f
......@@ -86,6 +86,7 @@
dropInfo:{},
dropIndex:0,
dropReasons:[''],
withdrawal: true,
readonlyFlag:false
};
},
......@@ -113,11 +114,24 @@
api.userRefundCourseDtl({userId:this.userId,orderId:this.orderId}).then(res=>{
if(res['success']){
this.dropInfo = res['data']
}else {
this.withdrawal = false
}
})
},
// 提交申请
submit(){
if(!this.withdrawal){
uni.showToast({
title: '已退课不能重新申请',
icon: 'none',
duration: 2000
});
return false
}
uni.showLoading({
title: '加载中...'
});
if(!this.readonlyFlag){
//提交按钮置灰
this.readonlyFlag = true;
......@@ -132,6 +146,7 @@
refundReason:this.dropReasons[this.dropIndex]['dropOptionName']
}
api.unifiedRefund(param).then(res=>{
console.log(res, 1515)
if(res['success']){
uni.navigateTo({
url:`/pages/afterSaleDetail/afterSaleDetail?orderNo=${this.dropInfo.orderNo}&afterSalesFlag=3`
......@@ -142,9 +157,11 @@
}else{
uni.showToast({
title: res['message'],
icon: 'none',
duration: 2000
});
}
uni.hideLoading()
this.readonlyFlag = false;
})
}
......@@ -156,15 +173,21 @@
if(res['success']){
this.dropReasons = res['data']['dropMasterInfoList'][0]['dropOptionsInfoList']
}
uni.hideLoading()
})
}
},
onLoad(option) {
uni.showLoading({
title: '加载中...'
});
this.orderId = option.id;
this.fileId = option.fileId;
this.courseDetail();
this.userRefundCourseDtl();
this.dropOptionsQuery()
},
onShow() {
this.userRefundCourseDtl();
}
}
</script>
......
......@@ -55,7 +55,7 @@
<view class="totalContent">
<view class="priceInfoBox">
<view>合计: <strong style="font-size: 36rpx;">¥{{totalPrice}}</strong></view>
<view>共优惠:<strong style="color:#F15A1F" v-if="isDeduction">¥{{Number(deductionCore * intergralInfo.preFortune).toFixed(2)}}</strong>
<view>共优惠:<strong style="color:#F15A1F" v-if="isDeduction == true">¥{{Number(deductionCore * intergralInfo.preFortune).toFixed(2)}}</strong>
<text style="color:#F15A1F" v-else>0</text>
</view>
</view>
......@@ -170,13 +170,13 @@
deviceType:'',
tipsFlag:false,
isRedirect:null,
amount:0
amount:0,
}
},
computed:{
totalPrice(){
if(this.isDeduction){
return (this.courseInfoItem.coursePrice - this.deductionCore * this.intergralInfo.preFortune).toFixed(2)
if(this.isDeduction == true){
return (this.courseInfoItem.coursePrice - (this.deductionCore * this.intergralInfo.preFortune)).toFixed(2)
}else{
return this.courseInfoItem.coursePrice;
}
......@@ -205,7 +205,7 @@
amount:this.totalPrice,
paymentMethod:this.paymentMethod,
userId:this.userId,
integralExchange:this.isDeduction ? parseFloat(this.deductionCore) : 0,
integralExchange:this.isDeduction == true ? parseFloat(this.deductionCore) : 0,
paymentType:''
}
if(this.paymentMethod==1){
......@@ -301,7 +301,8 @@
this.tipsFlag = true;
this.amount = this.totalPrice;
this.paymentBtnDisabled = false;
let url = window.location.href + `&isRedirect=1&amount=${this.amount}&jumptime=${new Date()}&isDeduction=${this.isDeduction}&deductionCore=${this.deductionCore}&userId=${this.userId}`;
let deductionCore = this.isDeduction==true ? parseFloat(this.deductionCore) : 0,
let url = window.location.href + `&isRedirect=1&amount=${this.amount}&jumptime=${new Date()}&isDeduction=${this.isDeduction}&deductionCore=${deductionCore}`;
window.history.replaceState(null, '',url);
return;
}
......@@ -403,9 +404,9 @@
this.isRedirect = option.isRedirect;
if(this.isRedirect == 1){
if(option.amount){
this.deductionCore = option.deductionCore;
this.amount = option.amount;
this.isDeduction = option.isDeduction;
this.deductionCore = option.deductionCore;
}
this.totalPrice = this.amount;
setTimeout(()=>{
......
......@@ -4,17 +4,19 @@
<view class="ulBox">
<view v-for="item in orderInfoList.filter(item=>item.pageArea===1)" :key="item.id" class="liBox">
<text>{{item.name}}:</text>
<text :style="{color:item.color ? item.color : '#666'}">{{item.type==='currency' && item.value ? '¥' : ''}}{{item.value ? item.value : '/'}}</text>
<text
:style="{color:item.color ? item.color : '#666'}">{{item.type==='currency' && item.value ? '¥' : ''}}{{item.value ? item.value : '/'}}</text>
</view>
</view>
<view class="ulBox">
<view v-for="item in orderInfoList.filter(item=>item.pageArea===2)" :key="item.id" class="liBox">
<text>{{item.name}}:</text>
<text :style="{color:item.color ? item.color : '#666'}">{{item.type==='currency' && item.value ? '¥' : ''}}{{item.value ? item.value : '/'}}</text>
<text
:style="{color:item.color ? item.color : '#666'}">{{item.type==='currency' && item.value ? '¥' : ''}}{{item.value ? item.value : '/'}}</text>
</view>
</view>
<!-- 退课 -->
<view class="dropClassBox" v-if="Withdrawal=='1' && orderDetail.operationStatus == '1'">
<view class="dropClassBox" v-if="Withdrawal=='1' && orderDetail.operationStatus == '1'&& type == 'drop'">
<view class="dropBtn" @click="dropClasses()">退课</view>
</view>
</view>
......@@ -28,59 +30,152 @@
data() {
return {
userId: uni.getStorageSync('cffp_userId'),
orderId:'',
fileId:'',
orderInfoList:[
{id:1,name:'订单编号',value:'/',type:'string',alias:'orderNo',pageArea:1},
{id:2,name:'购买时间',value:'/',type:'string',alias:'orderConfirmDate',pageArea:1},
{id:3,name:'课程类型',value:'/',type:'string',alias:'courseClassify',pageArea:1},
{id:4,name:'课程名称',value:'/',type:'string',alias:'fileTitle',pageArea:1},
{id:5,name:'购买人',value:'/',type:'string',alias:'userName',pageArea:1},
{id:6,name:'课程讲师',value:'/',type:'string',alias:'lecturerName',pageArea:1},
{id:7,name:'课程现价',value:'/',type:'currency',alias:'orderPrice',pageArea:1},
{id:8,name:'积分抵扣',value:'/',color:'#FA6900',type:'currency',alias:'integralExchange',pageArea:1},
{id:9,name:'实际支付',value:'/',type:'currency',alias:'paymentAmount',pageArea:1},
{id:10,name:'获得积分',value:'/',type:'string',color:'#F15A1F',alias:'salesCommission',pageArea:2},
{id:11,name:'积分来源',value:'/',type:'string',alias:'commissionSource',pageArea:2},
{id:12,name:'课程状态',value:'/',type:'string',alias:'courseStatusName',pageArea:2},
{id:13,name:'观看截至',value:'/',type:'string',alias:'effectiveEndDate',pageArea:2}
orderId: '',
fileId: '',
orderInfoList: [{
id: 1,
name: '订单编号',
value: '/',
type: 'string',
alias: 'orderNo',
pageArea: 1
},
{
id: 2,
name: '购买时间',
value: '/',
type: 'string',
alias: 'orderConfirmDate',
pageArea: 1
},
{
id: 3,
name: '课程类型',
value: '/',
type: 'string',
alias: 'courseClassify',
pageArea: 1
},
{
id: 4,
name: '课程名称',
value: '/',
type: 'string',
alias: 'fileTitle',
pageArea: 1
},
{
id: 5,
name: '购买人',
value: '/',
type: 'string',
alias: 'userName',
pageArea: 1
},
{
id: 6,
name: '课程讲师',
value: '/',
type: 'string',
alias: 'lecturerName',
pageArea: 1
},
{
id: 7,
name: '课程现价',
value: '/',
type: 'currency',
alias: 'orderPrice',
pageArea: 1
},
{
id: 8,
name: '积分抵扣',
value: '/',
color: '#FA6900',
type: 'currency',
alias: 'integralExchange',
pageArea: 1
},
{
id: 9,
name: '实际支付',
value: '/',
type: 'currency',
alias: 'paymentAmount',
pageArea: 1
},
{
id: 10,
name: '获得积分',
value: '/',
type: 'string',
color: '#F15A1F',
alias: 'salesCommission',
pageArea: 2
},
{
id: 11,
name: '积分来源',
value: '/',
type: 'string',
alias: 'commissionSource',
pageArea: 2
},
{
id: 12,
name: '课程状态',
value: '/',
type: 'string',
alias: 'courseStatusName',
pageArea: 2
},
{
id: 13,
name: '观看截至',
value: '/',
type: 'string',
alias: 'effectiveEndDate',
pageArea: 2
}
],
type:'',
orderDetail:{},
Withdrawal:'',
commissionType:null
type: '',
orderDetail: {},
Withdrawal: '',
commissionType: null
};
},
methods:{
userCourseInfo(){
methods: {
userCourseInfo() {
const param = {
userId:this.userId,
orderId:this.orderId,
queryType: this.type == 'drop'? '1':'2',
commissionType:this.commissionType,
userId: this.userId,
orderId: this.orderId,
queryType: this.type == 'drop' ? '1' : '2',
commissionType: this.commissionType,
}
api.userCourseInfo(param).then(res=>{
if(res['success']){
api.userCourseInfo(param).then(res => {
if (res['success']) {
const data = this.orderDetail = res['data']['orderDetail'];
this.fileId = data.fileId;
Object.keys(data).map((key,item)=>{
this.orderInfoList.forEach(val=>{
if(val.alias == key){
Object.keys(data).map((key, item) => {
this.orderInfoList.forEach(val => {
if (val.alias == key) {
val.value = data[key];
}
})
})
}
uni.hideLoading()
})
},
dropClasses(){
dropClasses() {
uni.navigateTo({
url:`/pages/applyDropClass/applyDropClass?id=${this.orderId}&fileId=${this.fileId}`
url: `/pages/applyDropClass/applyDropClass?id=${this.orderId}&fileId=${this.fileId}`
})
}
},
onLoad(option) {
if(option.userId){
if (option.userId) {
this.userId = option.userId
};
this.orderId = option.id;
......@@ -89,6 +184,9 @@
this.commissionType = option.commissionType;
},
mounted() {
uni.showLoading({
title: '加载中...'
});
this.userCourseInfo();
uni.$on("radiobroadcast", res => {
this.type = res.type;
......@@ -101,35 +199,41 @@
</script>
<style lang="scss">
.container{
.container {
height: 100%;
.orderInfoContent{
.ulBox{
.orderInfoContent {
.ulBox {
background-color: #fff;
margin: 20rpx 22rpx;
padding: 20rpx;
.liBox{
.liBox {
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
text{
&:first-child{
text {
&:first-child {
font-size: 28rpx;
color: #333;
}
&:last-child{
&:last-child {
font-size: 28rpx;
}
}
}
}
.dropClassBox{
.dropClassBox {
display: flex;
justify-content: flex-end;
padding-right: 20rpx;
margin-top: 20rpx;
.dropBtn{
.dropBtn {
border-radius: 80rpx;
color: #fff;
background-color: #20269B;
......
......@@ -68,6 +68,11 @@
</view>
</uni-popup>
</view>
<!-- <view class="loading">
加载loading
<orange-fullloading :loadshow="loadshow" text="加载中" textcolor="#f30" textsize="10"></orange-fullloading>
</view> -->
</view>
</template>
......@@ -78,6 +83,7 @@
export default {
data() {
return {
// loadshow:true,
userId: uni.getStorageSync('cffp_userId'),
inviteEqrode:'',
currentPage:'personalCenter',
......@@ -133,13 +139,20 @@
},
onShow() {
uni.$on("handClick", res => {
console.log('接受到监听')
this.customerBasicInfo = res.data
})
},
onUnload() {
// 移除监听事件
uni.$off('handClick');
})
// setTimeout(() => {
// this.loadshow = false
// }, 10000)
},
// onUnload() {
// },
methods: {
close(){
this.bootpage = false
......@@ -260,6 +273,12 @@
height: 100%;
border-radius: 50%;
}
.loading{
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.basicInfoBox{
display: flex;
padding: 67rpx 20rpx 60rpx 28rpx;
......
......@@ -4,9 +4,9 @@ import {interceptor} from "./interceptor";
export default (url:string, method:any, params?:any) => {
interceptor();
return new Promise((resolve, reject) => {
uni.showLoading({
title: '加载中...'
});
// uni.showLoading({
// title: '加载中...'
// });
uni.request({
url: url,
method: method,
......@@ -20,7 +20,7 @@ export default (url:string, method:any, params?:any) => {
reject(err);
},
complete() {
uni.hideLoading();
// uni.hideLoading();
}
});
});
......
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