Commit 0f062ac4 by kyle

退课以及学习统计修改

parent f8e22c23
......@@ -284,5 +284,9 @@ export default {
//微信去提现
wxWithdrawal(params){
return request(`${apiURL}/pay/wxWithdrawal`, "POST", params)
},
// 微信退款
wxRefund(params){
return request(`${apiURL}/pay/wxRefund`, "POST", params)
}
}
......@@ -361,7 +361,7 @@
"navigationBarTitleText": "学习统计",
"enablePullDownRefresh": false
}
}
},
{
"path" : "pages/personalCenter/system/accontsetting",
"style" :
......
......@@ -33,17 +33,18 @@
</view>
<!-- 退款原因 -->
<view class="dropInfoBox">
<view class="">
<view class="dropBox">
<h4>退款原因</h4>
<view class="uni-list-cell-db">
<picker @change="bindPickerChange" :value="orderRemark" :range="dropReasons">
<view class="uni-input">{{dropReasons[orderRemark]}}</view>
<view class="pickerBox">
<picker @change="bindPickerChange" :value="dropIndex" :range="dropReasons" :range-key="'dropOptionName'">
<view class="uni-input" style="height: 80rpx;">{{dropReasons[dropIndex]['dropOptionName']}}</view>
</picker>
<i class="iconfont icon-youjiantou"></i>
</view>
</view>
</view>
<!-- 提交申请 -->
<view class="submitApply">
<view class="submitApply" @click="submit()">
<text>提交申请</text>
</view>
<!-- 弹窗 -->
......@@ -83,11 +84,14 @@
orderId:null,
userId:'1',
dropInfo:{},
orderRemark:'',
dropIndex:0,
dropReasons:['']
};
},
methods:{
bindPickerChange(e){
this.dropIndex = e.detail.value;
},
showModal(){
this.$refs.popup.open()
},
......@@ -112,21 +116,63 @@
})
},
// 提交申请
submit(paymentMethod){
if(paymentMethod==='1'){
submit(){
const param = {
orderNo:this.dropInfo.orderNo,
paymentMethod:this.dropInfo.paymentMethod,
userId:this.userId,
totalFee:this.dropInfo.orderPrice,
refundFee:this.dropInfo.refundFee,
integralExchange:this.dropInfo.integralExchange,
refundIntegralExchange:this.dropInfo.refundIntegralExchange,
refundReason:this.dropReasons[this.dropIndex]['dropOptionName']
}
if(this.dropInfo.paymentMethod==='1'){
// 微信
}else if(paymentMethod==='2'){
api.wxRefund(param).then(res=>{
if(res['success']){
uni.navigateTo({
url:`/pages/afterSaleDetail/afterSaleDetail?orderNo=${this.dropInfo.orderNO}&afterSalesFlag=3`
})
}else{
uni.showToast({
title: res['message'],
duration: 2000
});
}
})
}else if(this.dropInfo.paymentMethod==='2'){
// 支付宝
api.wxRefund(param).then(res=>{
if(res['success']){
uni.navigateTo({
url:`/pages/afterSaleDetail/afterSaleDetail?orderNo=${this.dropInfo.orderNO}&afterSalesFlag=3`
})
}else{
uni.showToast({
title: res['message'],
duration: 2000
});
}
})
}
},
// 退款原因
dropOptionsQuery(){
api.dropOptionsQuery({code:'REFUND_REASON'}).then(res=>{
console.log(res)
if(res['success']){
this.dropReasons = res['data']['dropMasterInfoList'][0]['dropOptionsInfoList']
}
})
}
},
onLoad(option) {
this.orderId = option.id;
this.fileId = option.fileId;
this.courseDetail();
this.userRefundCourseDtl()
this.userRefundCourseDtl();
this.dropOptionsQuery()
}
}
</script>
......@@ -188,5 +234,20 @@
font-size: 32rpx;
}
}
.dropBox{
display: flex;
justify-content: space-between;
align-items: baseline;
height: 80rpx;
.pickerBox{
display: flex;
align-items: baseline;
.iconfont{
transform: rotate(90deg);
margin-left: 20rpx;
color: #666;
}
}
}
}
</style>
......@@ -55,7 +55,7 @@
</view>
<view class="progressBottomBox">
<text>{{item.fileTitle}}</text>
<i class="iconfont icon-youjiantou" @click="item['state']=!item['state'];userCoursePackBar(item['state'],item.packFileId,item.orderId)" :style="{transform: item['state'] ? 'rotate(90deg)' : 'rotate(-90deg)' }"></i>
<i class="iconfont icon-youjiantou" v-if="item.packFileId" @click="userCoursePackBar(item.packFileId,item.orderId)" :style="{transform: item['state'] ? 'rotate(90deg)' : 'rotate(-90deg)' }"></i>
</view>
</view>
<!-- 小课 -->
......@@ -170,10 +170,12 @@
}
})
},
userCoursePackBar(state,packFileId,orderId){
if(!packFileId || !state){
userCoursePackBar(packFileId,orderId){
if(!packFileId || !orderId){
return false;
}
this.userStudyCountList.barInfos.forEach(item=>item.state=false);
this.userStudyCountList.barInfos.filter(item=>item.orderId==orderId)[0].state = true;
api.userCoursePackBar({userId:this.userId,packFileId:packFileId,orderId:orderId}).then(res=>{
if(res['success']){
this.userCoursePackBarList = res['data']['barInfos'];
......
......@@ -131,7 +131,8 @@
isDeduction:false,
userId:'1',
intergralInfo:{},
orderId:'1'
orderId:'1',
paymentBtnDisabled:false
}
},
computed:{
......@@ -153,12 +154,16 @@
methods: {
// 支付
pay(){
if(this.paymentBtnDisabled){
return false;
}
this.paymentBtnDisabled = true;
const param = {
orderId:this.orderId,
amount:this.totalPrice,
paymentMethod:this.paymentMethod,
userId:this.userId,
integralExchange:parseFloat(this.deductionCore)
integralExchange:this.isDeduction ? parseFloat(this.deductionCore) : 0
}
if(this.paymentMethod==1){
api.wxAppPay(param).then(res=>{
......@@ -168,16 +173,25 @@
api.aliAppPay(param).then(res=>{
if(res['success']){
const aliOrderString = res['data']['aliOrderString'];
uni.requestPayment({
provider: 'alipay',
orderInfo: aliOrderString,
success: function (resp) {
alert('success:' + JSON.stringify(resp));
},
fail: function (err) {
alert('fail:' + JSON.stringify(err));
}
});
if(aliOrderString){
uni.requestPayment({
provider: 'alipay',
orderInfo: aliOrderString,
success: function (resp) {
alert('success:' + JSON.stringify(resp));
},
fail: function (err) {
alert('fail:' + JSON.stringify(err));
}
});
}else{
uni.navigateTo({
url:`/pages/orderStatus/orderStatus?orderId=1&fileId=1&orderStatus=2`
})
}
}else{
this.paymentBtnDisabled = false;
}
})
......
......@@ -61,6 +61,11 @@
url:'/pages/index/index'
})
}
},
onLoad(options) {
this.orderId = options.orderId;
this.orderStatus = options.orderStatus;
this.fileId = options.fileId;
}
}
</script>
......
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