he2802 3 years ago
parent
commit
47072c4e8f
3 changed files with 31 additions and 8 deletions
  1. 7 0
      common/httpList/order.js
  2. 1 1
      common/request.js
  3. 23 7
      pages2/order/index.vue

+ 7 - 0
common/httpList/order.js

@@ -39,5 +39,12 @@ export default {
 			method: 'post',
 			data: data
 		})
+	},
+	refundSmallOrder(data) {
+		return myRequest({
+			url: '/order/refund',
+			method: 'post',
+			data: data
+		})
 	}
 }

+ 1 - 1
common/request.js

@@ -4,7 +4,7 @@ import store from '@/store/index.js'
 import api from './api.js'
 var num = 1
 
-export const BASE_URL = 'http://192.168.1.222:5055' //接口api  http://42.192.164.187:19005 http://192.168.1.222:5055
+export const BASE_URL = 'http://42.192.164.187:19005' //接口api  http://42.192.164.187:19005 http://192.168.1.222:5055
 
 
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/' //图片上传api  'https://file.xyyxt.net/

+ 23 - 7
pages2/order/index.vue

@@ -13,14 +13,19 @@
 					</view>
 					<u-line color="#D6D6DB" />
 					<view
-						style="display: flex;justify-content: space-between;padding: 25rpx 0;border-bottom: 1rpx solid #eee;"
+						style="padding: 25rpx 0;border-bottom: 1rpx solid #eee;"
 						v-for="(items, indexs) in item.orderGoodsList"
 						:key="indexs" @click="goCourse(items,item.orderStatus)"
 					>
-						<image :src="$method.splitImgHost(items.coverUrl)" style="height: 134rpx;width: 278rpx;border-radius: 16rpx;flex-shrink: 0;"></image>
-						<view style="margin-left: 20rpx;flex:1;display: flex;flex-direction: column;">
-							<view style="color: #333333;font-size: 30rpx;font-weight: bold;flex:1">{{ items.goodsName }}</view>
-							<view class="priceTag">¥ {{ items.goodsRealPrice }}</view>
+						<view style="display: flex;justify-content: space-between;">
+							<image :src="$method.splitImgHost(items.coverUrl)" style="height: 134rpx;width: 278rpx;border-radius: 16rpx;flex-shrink: 0;"></image>
+							<view style="margin-left: 20rpx;flex:1;display: flex;flex-direction: column;">
+								<view style="color: #333333;font-size: 30rpx;font-weight: bold;flex:1">{{ items.goodsName }}</view>
+								<view class="priceTag">¥ {{ items.goodsRealPrice }}</view>
+							</view>
+						</view>
+						<view style="display: flex;flex-direction: row-reverse;padding: 10rpx 0;">
+							<view class="btn2" v-if="item.orderFrom === 2&&(item.orderStatus === 1 || item.orderStatus === 2)&&(items.goodsType == '1' || items.goodsType == '2')" @click.stop="refund(item.orderSn,items.goodsId)">退款</view>
 						</view>
 					</view>
 					<view style="height: 80rpx;display: flex;justify-content: space-between;align-items: center;">
@@ -31,8 +36,7 @@
 						</view>
 						<view style="display: flex;align-items: center;">
 							<view class="btn2" v-if="item.orderStatus === 0&&item.orderFrom === 2" @click="resumeOrder(item)">继续支付</view>
-							<!-- <view class="btn2" v-if="item.orderStatus === -1 || item.orderStatus === -2" @click="againBuy(item)">重新购买</view> -->
-							<!--<view class="btn2" v-if="item.orderStatus === 1 || item.orderStatus === 2" >退款</view> -->
+							<!-- <view class="btn2" v-if="item.orderStatus === -1 || item.orderStatus === -2" @click="againBuy(item)">重新购买</view> --> 
 							<view class="btn1" v-if="item.orderStatus === -1 || item.orderStatus === -2" @click="delOrder(item)">删除订单</view>
 							<view class="btn1" @click="closeOrder(item)" v-if="item.orderStatus === 0">取消订单</view>
 						</view>
@@ -96,6 +100,18 @@ export default {
 		this.getFY();
 	},
 	methods: {
+		refund(orderSn,goodsId){
+			let self = this
+			this.$api.refundSmallOrder({orderSn:orderSn,goodsId:goodsId}).then(res => {
+				if(res.data.code==200){
+					uni.showModal({
+						title: "提示",
+						content: res.data.msg,
+						showCancel: false
+					})
+				}
+			});
+		},
 		/**
 		 * 跳转课程
 		 */