Commit 182bc34c by kyle

合并代码

parents eba3f263 0f062ac4
...@@ -288,5 +288,9 @@ export default { ...@@ -288,5 +288,9 @@ export default {
//保存base64电子签名 //保存base64电子签名
saveDigitalSignatures(params){ saveDigitalSignatures(params){
return request(`${cffpURL}/partner/saveDigitalSignatures`, "POST", params) return request(`${cffpURL}/partner/saveDigitalSignatures`, "POST", params)
},
// 微信退款
wxRefund(params){
return request(`${apiURL}/pay/wxRefund`, "POST", params)
} }
} }
...@@ -33,17 +33,18 @@ ...@@ -33,17 +33,18 @@
</view> </view>
<!-- 退款原因 --> <!-- 退款原因 -->
<view class="dropInfoBox"> <view class="dropInfoBox">
<view class=""> <view class="dropBox">
<h4>退款原因</h4> <h4>退款原因</h4>
<view class="uni-list-cell-db"> <view class="pickerBox">
<picker @change="bindPickerChange" :value="orderRemark" :range="dropReasons"> <picker @change="bindPickerChange" :value="dropIndex" :range="dropReasons" :range-key="'dropOptionName'">
<view class="uni-input">{{dropReasons[orderRemark]}}</view> <view class="uni-input" style="height: 80rpx;">{{dropReasons[dropIndex]['dropOptionName']}}</view>
</picker> </picker>
<i class="iconfont icon-youjiantou"></i>
</view> </view>
</view> </view>
</view> </view>
<!-- 提交申请 --> <!-- 提交申请 -->
<view class="submitApply"> <view class="submitApply" @click="submit()">
<text>提交申请</text> <text>提交申请</text>
</view> </view>
<!-- 弹窗 --> <!-- 弹窗 -->
...@@ -83,11 +84,14 @@ ...@@ -83,11 +84,14 @@
orderId:null, orderId:null,
userId:'1', userId:'1',
dropInfo:{}, dropInfo:{},
orderRemark:'', dropIndex:0,
dropReasons:[''] dropReasons:['']
}; };
}, },
methods:{ methods:{
bindPickerChange(e){
this.dropIndex = e.detail.value;
},
showModal(){ showModal(){
this.$refs.popup.open() this.$refs.popup.open()
}, },
...@@ -112,21 +116,63 @@ ...@@ -112,21 +116,63 @@
}) })
}, },
// 提交申请 // 提交申请
submit(paymentMethod){ submit(){
if(paymentMethod==='1'){ 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'){
// 微信 // 微信
api.wxRefund(param).then(res=>{
}else if(paymentMethod==='2'){ 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) { onLoad(option) {
this.orderId = option.id; this.orderId = option.id;
this.fileId = option.fileId; this.fileId = option.fileId;
this.courseDetail(); this.courseDetail();
this.userRefundCourseDtl() this.userRefundCourseDtl();
this.dropOptionsQuery()
} }
} }
</script> </script>
...@@ -188,5 +234,20 @@ ...@@ -188,5 +234,20 @@
font-size: 32rpx; 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> </style>
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
</view> </view>
<view class="progressBottomBox"> <view class="progressBottomBox">
<text>{{item.fileTitle}}</text> <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>
</view> </view>
<!-- 小课 --> <!-- 小课 -->
...@@ -170,10 +170,12 @@ ...@@ -170,10 +170,12 @@
} }
}) })
}, },
userCoursePackBar(state,packFileId,orderId){ userCoursePackBar(packFileId,orderId){
if(!packFileId || !state){ if(!packFileId || !orderId){
return false; 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=>{ api.userCoursePackBar({userId:this.userId,packFileId:packFileId,orderId:orderId}).then(res=>{
if(res['success']){ if(res['success']){
this.userCoursePackBarList = res['data']['barInfos']; this.userCoursePackBarList = res['data']['barInfos'];
......
...@@ -131,7 +131,8 @@ ...@@ -131,7 +131,8 @@
isDeduction:false, isDeduction:false,
userId:'1', userId:'1',
intergralInfo:{}, intergralInfo:{},
orderId:'1' orderId:'1',
paymentBtnDisabled:false
} }
}, },
computed:{ computed:{
...@@ -153,12 +154,16 @@ ...@@ -153,12 +154,16 @@
methods: { methods: {
// 支付 // 支付
pay(){ pay(){
if(this.paymentBtnDisabled){
return false;
}
this.paymentBtnDisabled = true;
const param = { const param = {
orderId:this.orderId, orderId:this.orderId,
amount:this.totalPrice, amount:this.totalPrice,
paymentMethod:this.paymentMethod, paymentMethod:this.paymentMethod,
userId:this.userId, userId:this.userId,
integralExchange:parseFloat(this.deductionCore) integralExchange:this.isDeduction ? parseFloat(this.deductionCore) : 0
} }
if(this.paymentMethod==1){ if(this.paymentMethod==1){
api.wxAppPay(param).then(res=>{ api.wxAppPay(param).then(res=>{
...@@ -168,16 +173,25 @@ ...@@ -168,16 +173,25 @@
api.aliAppPay(param).then(res=>{ api.aliAppPay(param).then(res=>{
if(res['success']){ if(res['success']){
const aliOrderString = res['data']['aliOrderString']; const aliOrderString = res['data']['aliOrderString'];
uni.requestPayment({ if(aliOrderString){
provider: 'alipay', uni.requestPayment({
orderInfo: aliOrderString, provider: 'alipay',
success: function (resp) { orderInfo: aliOrderString,
alert('success:' + JSON.stringify(resp)); success: function (resp) {
}, alert('success:' + JSON.stringify(resp));
fail: function (err) { },
alert('fail:' + JSON.stringify(err)); 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 @@ ...@@ -61,6 +61,11 @@
url:'/pages/index/index' url:'/pages/index/index'
}) })
} }
},
onLoad(options) {
this.orderId = options.orderId;
this.orderStatus = options.orderStatus;
this.fileId = options.fileId;
} }
} }
</script> </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