From bbb482fb35d4359db090d46997bd8c98ba1e19ad Mon Sep 17 00:00:00 2001
From: 1154079537 <1154079537@qq.com>
Date: Tue, 7 May 2024 17:41:44 +0800
Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E8=B7=B3=E8=BD=AC=E5=88=B0?=
=?UTF-8?q?=E6=9C=89=E6=95=B0=E6=8D=AE=E7=9A=84=E5=88=97=E8=A1=A8=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=20iOS=E7=AB=AF=E7=A9=BA=E7=99=BD=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
api/order.js | 8 +
manifest.json | 4 +-
pages.json | 8 +-
pages/user/index.vue | 9 +-
pages/users/order_list/index.vue | 333 ++++++++++++++--
pages/users/order_list/search.vue | 629 ++++++++++++++++++++++--------
6 files changed, 805 insertions(+), 186 deletions(-)
diff --git a/api/order.js b/api/order.js
index 49cb8fd..06b76cd 100644
--- a/api/order.js
+++ b/api/order.js
@@ -9,6 +9,14 @@
// +----------------------------------------------------------------------
import request from "@/utils/request.js";
+/**
+ * 退款订单
+ * @param numType
+ */
+export function refundListNew(data) {
+ return request.get("refund/list", data);
+}
+
/**
* 校验支付密码是否正确
* @param numType
diff --git a/manifest.json b/manifest.json
index 5886d54..196d30b 100644
--- a/manifest.json
+++ b/manifest.json
@@ -2,8 +2,8 @@
"name": "惠农生活",
"appid": "__UNI__3A527D1",
"description": "",
- "versionName": "2.0.47",
- "versionCode": 2047,
+ "versionName": "2.0.49",
+ "versionCode": 2049,
"transformPx": false,
/* 5+App特有相关 */
"app-plus": {
diff --git a/pages.json b/pages.json
index 058abce..f95e173 100644
--- a/pages.json
+++ b/pages.json
@@ -34,7 +34,9 @@
"style": {
"enablePullDownRefresh": true,
"navigationBarTitleText": "工作台",
- "navigationStyle": "custom"
+ "navigationStyle": "custom",
+ "backgroundColorTop": "#40AE36",
+ "backgroundTextStyle": "light"
}
}, {
"path": "pages/order_addcart/order_addcart",
@@ -1516,7 +1518,9 @@
"backgroundColor": "#F8F8F8"
//#ifndef H5
,
- "titleNView": true
+ "titleNView": true,
+ "backgroundColorTop": "#40AE36",
+ "backgroundTextStyle": "light"
//#endif
//#ifdef H5
,
diff --git a/pages/user/index.vue b/pages/user/index.vue
index 5df909b..e448404 100644
--- a/pages/user/index.vue
+++ b/pages/user/index.vue
@@ -526,7 +526,6 @@
} else {
this.openAuto()
}
-
},
goRouter(item) {
var pages = getCurrentPages();
@@ -659,7 +658,13 @@
item.num = data.noPostage
break
case '待收货':
- item.num = data.noDeliver
+ let openType = '';
+ item.num = Number(data.noDeliver) + Number(data.mer_noDeliver)
+ if (data.noDeliver > data.mer_noDeliver)
+ openType = 1;
+ else
+ openType = 2;
+ item.url = '/pages/users/order_list/index?status=2&openType=' + openType
break
case '待评价':
item.num = data.noComment
diff --git a/pages/users/order_list/index.vue b/pages/users/order_list/index.vue
index d009704..2ce0bbe 100644
--- a/pages/users/order_list/index.vue
+++ b/pages/users/order_list/index.vue
@@ -37,6 +37,10 @@
待评价
{{orderData.noComment || 0}}
+
+ 退款/售后
+ {{orderData.refund || 0}}
+
@@ -73,8 +77,8 @@
{{orderData.noComment || 0}}
-->
-
+
搜索我的订单
@@ -206,6 +210,73 @@
+
+
+
+
+
+
+
+
+ {{item.merchant.mer_name}}
+
+
+
+
+
+
+
+ 预售{{goods.product.cart_info.product.store_name}}
+
+ {{goods.product.cart_info.productAttr.sku}}
+ 退款:{{goods.refund_price}}
+ x {{goods.refund_num}}
+
+
+
+
+ 查看详情
+ 退回商品
+
+
+ 查看详情
+
+
+
+
+ 删除订单
+ 查看详情
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -402,7 +473,8 @@
groupOrderList,
orderTake,
applyInvoiceApi,
- uploadEnvidenceApi
+ uploadEnvidenceApi,
+ refundListNew
} from '@/api/order.js';
import {
getUserInfo
@@ -498,6 +570,12 @@
add: false,
},
mer_info: {},
+ refundParam: {
+ page: 1,
+ limit: 15,
+ type: 0,
+ identity: ''
+ }
};
},
computed: {
@@ -508,6 +586,8 @@
onLoad(options) {
if (options.sale_type) this.sale_type = options.sale_type;
if (options.status) this.orderStatus = options.status;
+ if (options.openType && options.openType == 2) this.changeSaleType(2);
+
let user = this.$store.state.app.userInfo;
if (user.mer_info) this.initMerInfo(user);
if (this.isLogin) {
@@ -537,17 +617,23 @@
});
// #endif
},
-
+
// 下拉刷星
onPullDownRefresh() {
this.loadend = false;
this.loading = false;
- this.page = 1;
this.$set(this, 'orderList', []);
- this.getOrderList();
- this.getOrderData();
+
+ if (this.orderStatus == 4) {
+ this.refundParam.page = 1;
+ this.getRefundList();
+ } else {
+ this.page = 1;
+ this.getOrderList();
+ this.getOrderData();
+ }
},
-
+
methods: {
// 赋值银行信息
handleCopy() {
@@ -589,15 +675,23 @@
}
},
changeSaleType(type = 1) {
- if (type != this.sale_type) {
- this.sale_type = type;
- this.page = 1;
- this.loadend = false;
- this.loading = false;
- this.getOrderData();
- this.getOrderList();
- this.getUserInfo();
- this.getpreSellOrderList();
+ this.loadend = false;
+ this.loading = false;
+ this.$set(this, 'orderList', []);
+
+ if (this.orderStatus == 4) {
+ this.refundParam.identity = type;
+ this.refundParam.page = 1;
+ this.getRefundList();
+ } else {
+ if (type != this.sale_type) {
+ this.sale_type = type;
+ this.page = 1;
+ this.getOrderData();
+ this.getOrderList();
+ this.getUserInfo();
+ this.getpreSellOrderList();
+ }
}
},
// 去商铺
@@ -723,6 +817,7 @@
this.pay_close = false;
this.pay_order_id = '';
},
+
/**
* 去订单详情
*/
@@ -764,6 +859,7 @@
}
// #endif
},
+
/**
* 点击去评价
*/
@@ -795,18 +891,85 @@
}
// #endif
},
+
/**
* 切换类型
*/
statusClick: function(status) {
- if (status == this.orderStatus) return;
- this.orderStatus = status;
this.loadend = false;
this.loading = false;
- this.page = 1;
+
this.$set(this, 'orderList', []);
- this.getOrderList();
+
+ if (status == 4) { //1是用户 2是商户
+ if (status == this.orderStatus) return;
+ this.orderStatus = status;
+ this.refundParam.identity = this.sale_type;
+ this.refundParam.page = 1;
+ this.getRefundList();
+ } else {
+ if (status == this.orderStatus) return;
+ this.orderStatus = status;
+ this.page = 1;
+ this.getOrderList();
+ }
},
+
+ // 获取退款列表
+ getRefundList() {
+ let that = this;
+ if (that.loadend) return;
+ if (that.loading) return;
+ that.loading = true;
+ that.loadTitle = "加载更多";
+ refundListNew(this.refundParam).then(res => {
+ let list = res.data.list || [];
+ let loadend = list.length < that.limit;
+ that.orderList = that.page == 1 ? list : that.$util.SplitArray(list, that
+ .orderList);
+ that.$set(that, 'orderList', that.orderList);
+ that.getProductCount();
+ that.loadend = loadend;
+ that.loading = false;
+ that.loadTitle = loadend ? "我也是有底线的" : '加载更多';
+ that.page = that.page + 1;
+ that.isReady = true;
+ uni.stopPullDownRefresh();
+ }).catch(err => {
+ that.loading = false;
+ that.loadTitle = "加载更多";
+ })
+ },
+
+ // 去详情页
+ goDetail(item) {
+ uni.navigateTo({
+ url: '/pages/users/refund/detail?id=' + item.refund_order_id
+ })
+ },
+
+ // 删除记录
+ bindDetele(item, index) {
+ let self = this
+ uni.showModal({
+ title: '提示',
+ content: '确定删除该记录吗?',
+ success: function(res) {
+ if (res.confirm) {
+ refundDel(item.refund_order_id).then(res => {
+ self.goodsList.splice(index, 1)
+ })
+ uni.showToast({
+ title: '删除成功',
+ icon: 'none'
+ })
+ } else if (res.cancel) {
+ console.log('用户点击取消');
+ }
+ }
+ });
+ },
+
/**
* 获取订单列表
*/
@@ -970,12 +1133,138 @@
}
},
onReachBottom: function() {
- this.getOrderList();
+ if (this.orderStatus == 4)
+ this.getRefundList()
+ else
+ this.getOrderList();
}
}
+
\ No newline at end of file