Selaa lähdekoodia

添加未到货退款按钮

pangqijun 1 vuosi sitten
vanhempi
commit
b1d2bdd579
2 muutettua tiedostoa jossa 24 lisäystä ja 0 poistoa
  1. 5 0
      api/groupon.js
  2. 19 0
      pages/order/index.vue

+ 5 - 0
api/groupon.js

@@ -40,6 +40,11 @@ export function refundSubmit(data) {
     return request.post("/v1/after-sales/refundSubmit",data);
 }
 
+//团购后申请退款
+export function applyGrouponAfterRefund(orderId) {
+    return request.post("/v1/after-sales/applyGrouponAfterRefund?orderId=" + orderId);
+}
+
 
 //同意售后
 export function agreeAfterSales(data) {

+ 19 - 0
pages/order/index.vue

@@ -117,6 +117,7 @@
 						<button v-if="item.canReturnGoods && orderStatus != 8" class="info-btn" @click="salesReturn(item, 2)">申请退货</button>
 <!--						<button v-if="item.canRefund" class="info-btn" @click="refundOrder(item.orderId)">申请退款</button>-->
 						<button v-if="item.canRefund && orderStatus != 8" class="info-btn" @click="salesReturn(item, 1)">申请退款</button>
+						<button v-if="item.canRefundTwo && orderStatus != 8" class="info-btn" @click="applyGrouponAfterRefund(item)">申请退款</button>
 						<button  v-if="item.orderState == 2 && orderStatus != 8" class="action-btn" @click="viewPickCode(item.pickupCode)">取货码 {{item.pickupCode}}</button>
 					</view>
 				</view>
@@ -177,6 +178,9 @@ import {
 	orderCancel,
 	postUserOrderRefund
 } from '@/api/home.js';
+import {
+	applyGrouponAfterRefund
+} from '@/api/groupon.js';
 import {
 	getOrderList,
 	orderData,
@@ -338,6 +342,21 @@ export default {
 			})
 		},
 
+		applyGrouponAfterRefund(item) {
+			let that = this;
+			applyGrouponAfterRefund(item.orderId).then(res => {
+				that.getOrderList()
+				return that.$util.Tips({
+					title: res.msg,
+					icon: 'success'
+				});
+			}).catch(err => {
+				return that.$util.Tips({
+					title: err
+				});
+			});
+		},
+
 		openmap(selfTake) {
 			uni.openLocation({
 				latitude: selfTake.latitude,