Commit f2931965 by 严立

退款问题修改

parent 6674fe67
......@@ -90,6 +90,7 @@ Page({
'instructions': funcResponse.particulars,
'expireTime': funcResponse.expireTime.replace(/-/g, '.').replace('~', '-'), //订单有效期
'wxRequest': funcResponse.wxRequest,
'isRefund': Boolean(Number(funcResponse.enableRefund))
}
// 电影
......@@ -186,6 +187,12 @@ Page({
'iconType': 'success',
'title': '退款申请已提交'
})
wx.emit({
event: {
type: 'onReload',
receivePage: 'pages/mine/appointment/appointment',
}
})
this.queryOrderDetail()
})
},
......@@ -285,9 +292,8 @@ Page({
},
// 去评价
onOrderEvaluate: function (event) {
let item = JSON.stringify(this.data.orderInfo)
wx.navigateTo({
url: `/pages/pay/order-comment/order-comment?orderItem=${item}&pageFrom=orderDetail`,
url: '/pages/pay/order-comment/order-comment?id=' + this.data.orderInfo.id + '&pageFrom=orderDetail'
})
},
// 删除订单&取消订单
......
......@@ -38,7 +38,20 @@
<text>订单已评价</text>
</view>
</view>
<view class="state-content state-content-invalid column cc" wx:if="{{orderInfo.state === 7}}">
<view class="state-content state-content column cc" wx:if="{{orderInfo.state === 7}}">
<view class="state-content-title row">
<text>退款审核中</text>
</view>
<view class="state-content-tip row">
<text>退款申请正在审核中,请您耐心等待</text>
</view>
</view>
<view class="state-content state-content-invalid column cc" wx:if="{{orderInfo.state === 8}}">
<view class="state-content-title row">
<text>退款成功</text>
</view>
</view>
<view class="state-content state-content-invalid column cc" wx:if="{{orderInfo.state === 9}}">
<view class="state-content-title row">
<text>订单已完成</text>
</view>
......@@ -279,13 +292,13 @@
</view>
<!-- 底部按钮 -->
<view class="footer-btn row ce">
<view class="footer-btn row ce ac">
<!-- 状态(-1已取消,0未付款,1未发货,2待使用,3已使用,4已过期,5已发货,6已关闭/已评价) -->
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='0' wx:if="{{orderInfo.state===0}}">取消订单</view>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='0' wx:if="{{orderInfo.state === 0}}">取消订单</view>
<view class="order-btn" bindtap="onOrderPay" wx:if="{{orderInfo.state===0}}">去支付</view>
<view class="delete-btn" bindtap="onOrderRefund" data-type='0' wx:if="{{orderInfo.state===2 && orderInfo.goodsType === -1}}">申请退款</view>
<view class="delete-btn" bindtap="onOrderRefund" data-type='0' wx:if="{{orderInfo.state === 2 && orderInfo.goodsType === -1 && orderInfo.isRefund}}">申请退款</view>
<view class="order-btn" bindtap="onOrderEvaluate" wx:if="{{orderInfo.state===3}}">去评价</view>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state===-1 || orderInfo.state===6 || orderInfo.state===7}}">删除订单</view>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state === -1 || orderInfo.state === 6 || orderInfo.state === 8 || orderInfo.state === 9}}">删除订单</view>
<view class="order-btn" wx:if="{{orderInfo.state === -1}}" bindtap="onOrderAgain">再次报名</view>
</view>
......
......@@ -793,14 +793,14 @@
bottom: 0;
width: 100%;
background: #FFFFFF;
padding: 32rpx 20rpx;
padding: 0 20rpx;
border-top: 1px solid #e2e7ef;
}
.delete-btn, .order-btn {
width: 200rpx;
line-height: 96rpx;
margin-right: 24rpx;
margin: 32rpx 24rpx 32rpx 0;
border-radius: 4rpx;
font-size: 30rpx;
font-weight: 600;
......
......@@ -115,6 +115,7 @@ Page({
'enrollId': funcData[i].enrollId,
'name': funcData[i].name,
'status': Number(funcData[i].status), // 订单状态(-1已取消, 0未付款, 2待使用, 3已使用, 4已过期 6已关闭)
'orderStatus': Number(funcData[i].orderStatus),
'activeState': Number(funcData[i].activeState), // 活动状态(0 未开始 1进行中 2 已结束)
'cover': funcData[i].cover,
'date': funcData[i].activeTime,
......@@ -173,6 +174,12 @@ Page({
})
this.onReload()
})
.catch((response) => {
App.ui.showToast({
'iconType': 'error',
'title': response.message
})
})
},
fail: () => {},
})
......
......@@ -49,9 +49,15 @@
<!-- 未开始 -->
<view class="appointment-wrapper" wx:if="{{item.status === 2 && item.activeState === 0}}" data-item="{{item}}" bindtap="onOrderDetail">
<view class="appointment-time">{{item.date}}</view>
<view class="appintment-activity-status">
<view wx:if="{{item.orderStatus === 2}}" class="appintment-activity-status">
<text>未开始</text>
</view>
<view wx:if="{{item.orderStatus === 7}}" class="appintment-activity-status-pay">
<text>退款审核中</text>
</view>
<view wx:if="{{item.orderStatus === 8}}" class="appintment-activity-status">
<text>退款成功</text>
</view>
<view class="appointment-activity-content row ac">
<view class="appointment-activity-img">
<image src="{{item.cover}}"></image>
......@@ -74,17 +80,24 @@
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<button wx:if="{{item.isRefund && item.status !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<view data-item="{{item}}" catchtap="onOrderUse" class="confirm-btn">去使用</view>
<button wx:if="{{item.isRefund && item.orderStatus !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<view wx:if="{{item.isRefund}}" data-item="{{item}}" catchtap="onOrderUse" class="confirm-btn">去使用</view>
<view wx:if="{{item.orderStatus === 8}}" data-item="{{item}}" data-type='1' class="cancel-btn" catchtap="doCancel">删除报名</view>
</view>
</view>
</view>
<!-- 进行中 -->
<view class="appointment-wrapper" wx:if="{{item.status === 2 && item.activeState === 1}}" data-item="{{item}}" bindtap="onOrderDetail">
<view class="appointment-time">{{item.date}}</view>
<view class="appintment-activity-status">
<view wx:if="{{item.orderStatus === 2}}" class="appintment-activity-status">
<text>进行中</text>
</view>
<view wx:if="{{item.orderStatus === 7}}" class="appintment-activity-status-pay">
<text>退款审核中</text>
</view>
<view wx:if="{{item.orderStatus === 8}}" class="appintment-activity-status">
<text>退款成功</text>
</view>
<view class="appointment-activity-content row ac">
<view class="appointment-activity-img">
<image src="{{item.cover}}"></image>
......@@ -107,8 +120,9 @@
<text>{{item.amount}}</text>
</view>
<view class="appointment-activity-btn row">
<button wx:if="{{item.isRefund && item.status !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<view data-item="{{item}}" catchtap="onOrderUse" class="confirm-btn">去使用</view>
<button wx:if="{{item.isRefund && item.orderStatus !== 7}}" class="delete row cc ac" data-item="{{item}}" catchtap="onOrderRefund">申请退款</button>
<view wx:if="{{item.isRefund}}" catchtap="onOrderUse" class="confirm-btn">去使用</view>
<view wx:if="{{item.orderStatus === 8}}" data-item="{{item}}" data-type='1' class="cancel-btn" catchtap="doCancel">删除报名</view>
</view>
</view>
</view>
......
......@@ -29,7 +29,9 @@ Page({
orderInfo: Object.assign(this.data.orderInfo, { 'id': options.id }),
pageFrom: pageFrom
})
if (pageFrom == 'activityList') {
// 判断来源的区别在于,评价之后,订单要返回的层数。
if (pageFrom === 'activityList' || pageFrom === 'orderDetail') {
this.queryOrderDetail()
}
......@@ -282,11 +284,22 @@ Page({
iconType: 'success',
title: '评价成功',
ending: () => {
wx.navigateBack({
event: {
'type': 'onReload',
}
})
if (pageFrom === 'activityList' || pageFrom === 'orderList') {
wx.navigateBack({
event: {
'type': 'onReload',
}
})
}
if (pageFrom == 'orderDetail') {
wx.navigateBack({
delta: 2,
event: {
'type': 'onReload',
}
})
}
}
})
})
......@@ -307,10 +320,9 @@ Page({
this.uploadImage()
.then((response) => {
this.saveCommentInfo()
console.log('onSubmitCommennt then')
})
.catch((response) => {
console.log('onSubmitCommennt catch')
})
},
......
......@@ -28,6 +28,12 @@ Page({
},
onReload: function () {
wx.emit({
event: {
type: 'onReload',
receivePage: 'pages/mine/order/order',
}
})
this.queryOrderDetail()
},
......@@ -74,6 +80,7 @@ Page({
'instructions': funcResponse.particulars,
'expireTime': funcResponse.expireTime.replace(/-/g, '.').replace('~', '-'), //订单有效期
'wxRequest': funcResponse.wxRequest,
'isRefund': Boolean(Number(funcResponse.enableRefund))
}
// 电影
......
......@@ -296,13 +296,13 @@
</view>
<!-- 底部按钮 -->
<view class="footer-btn row ce" wx:if="{{orderInfo.state !== 7}}">
<view class="footer-btn row ce ac" wx:if="{{orderInfo.state !== 7}}">
<!-- 状态(-1已取消,0未付款,1未发货,2待使用,3已使用,4已过期,5已发货,6已关闭/已评价) -->
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='0' wx:if="{{orderInfo.state === 0}}">取消订单</view>
<view class="order-btn" bindtap="onOrderPay" wx:if="{{orderInfo.state === 0}}">去支付</view>
<view class="delete-btn" bindtap="onOrderRefund" wx:if="{{orderInfo.state === 2}}">申请退款</view>
<view class="delete-btn" bindtap="onOrderRefund" wx:if="{{orderInfo.state === 2 && orderInfo.isRefund}}">申请退款</view>
<view class="order-btn" bindtap="onOrderEvaluate" wx:if="{{orderInfo.state === 3}}">去评价</view>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state === -1 || orderInfo.state === 6 || orderInfo.state === 8}}">删除订单</view>
<view class="delete-btn" bindtap="onDelOrCancelOrder" data-type='1' wx:if="{{orderInfo.state === 4 || orderInfo.state === -1 || orderInfo.state === 6 || orderInfo.state === 8 || orderInfo.state === 9}}">删除订单</view>
<view class="order-btn" bindtap="onOrderAgain" wx:if="{{orderInfo.state === -1 || orderInfo.state === 8}}">再次下单</view>
</view>
......
......@@ -822,14 +822,14 @@
bottom: 0;
width: 100%;
background: #FFFFFF;
padding: 32rpx 20rpx;
padding: 0 20rpx;
border-top: 1px solid #e2e7ef;
}
.delete-btn, .order-btn {
width: 200rpx;
line-height: 96rpx;
margin-right: 24rpx;
margin: 32rpx 24rpx 32rpx 0;
border-radius: 4rpx;
font-size: 30rpx;
font-weight: 600;
......
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 sign in to comment