Commit 78903bcb authored by zhengke's avatar zhengke

修改

parent 75abd0ef
......@@ -2,124 +2,211 @@
<view>
<view class="searchBox flex-between">
<view class="flex-center">
<u-search placeholder="请输入订单号" style="width:600rpx" bg-color="#fff" height="60" :show-action="false" v-model="keyword"></u-search>
<u-search v-if="orderType==1" placeholder="请输入订单号" style="width:600rpx" bg-color="#fff" height="60"
:show-action="false" v-model="msg1.OrderNo"></u-search>
<u-search v-if="orderType==2" placeholder="请输入订单号" style="width:600rpx" bg-color="#fff" height="60"
:show-action="false" @change="getList2()" v-model="msg2.ReOrderNo"></u-search>
</view>
<view class="flex-center">
取消
</view>
</view>
<!-- <view>
<saleAfterOrderItem
:data="item"
:orderType="orderType"
@update="updateList"
v-if="orderType === 2"
/>
</view> -->
<view v-if="orderList.length > 0"
style="height: calc(100vh - 100rpx);width: calc(100vw);overflow: hidden;box-sizing: border-box;">
<scroll-view :scroll-y="true" :enable-back-to-top="true" :enable-flex="true" @scrolltolower="lower"
:style="{ height: '100%' }">
<view v-for="(item,index) in orderList" :key="index">
<saleAfterOrderItem :data="item" :orderType="orderType" @update="updateList"
v-if="orderType === 2" />
</view>
</scroll-view>
</view>
</view>
</template>
<script>
import tabbar from "./components/tabbar.vue";
import orderItem from "./components/orderItem.vue";
import saleAfterOrderItem from "./components/saleAfterOrderItem.vue";
export default {
components: {
tabbar,
orderItem,
saleAfterOrderItem,
},
data() {
return {
orderType: 1, //1普通订单,2售后订单
loading: false,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
page_count: 1,
msg: {
pageIndex: 1,
pageSize: 15,
Name: "",
OrderSource: 0,
OrderType: 0,
DeliveryMethod: 0,
OrderId: 0,
StartTime: "",
EndTime: "",
OrderStatus: 0,
OrderNo: "",
MerchantsNo: "",
UserName: "",
UserId: "",
GoodsName: "",
Consignee: "",
Mobile: "",
ProductCode: "",
Recycled: 2,
AnchorName: "",
IsSelectPayMoney: 0,
IsOffline: -1,
}
};
},
methods: {
lower(e) {
if (this.msg.pageIndex < this.page_count) {
this.msg.pageIndex++;
this.status = "loading";
if (this.timer) {
clearTimeout(this.timer);
}
this.timer = setTimeout(async () => {
await this.getList();
clearTimeout(this.timer);
}, 500);
} else {
this.status = "nomore";
}
},
//普通订单数据
getList() {
this.loading = true;
this.requestAdmin("/api/order/GetGoodsOrderPageList", this.msg, (res) => {
this.loading = false;
this.page_count = res.data.pageCount;
console.log(res,'数据');
});
},
},
onLoad(options) {
uni.setNavigationBarTitle({
title: "订单管理",
});
if(options.OrderNo){
this.msg.OrderNo = options.OrderNo
}
console.log(options,'options');
this.getList();
},
};
import tabbar from "./components/tabbar.vue";
import orderItem from "./components/orderItem.vue";
import saleAfterOrderItem from "./components/saleAfterOrderItem.vue";
export default {
components: {
tabbar,
orderItem,
saleAfterOrderItem,
},
data() {
return {
orderType: 1, //1普通订单,2售后订单
loading: false,
status: "loadmore",
loadText: {
loadmore: "轻轻上拉,加载更多",
loading: "努力加载中",
nomore: "没有更多了",
},
page_count: 1,
msg1: {
pageIndex: 1,
pageSize: 15,
Name: "",
OrderSource: 0,
OrderType: 0,
DeliveryMethod: 0,
OrderId: 0,
StartTime: "",
EndTime: "",
OrderStatus: 0,
OrderNo: "",
MerchantsNo: "",
UserName: "",
UserId: "",
GoodsName: "",
Consignee: "",
Mobile: "",
ProductCode: "",
Recycled: 2,
AnchorName: "",
IsSelectPayMoney: 0,
IsOffline: -1,
},
msg2: {
pageIndex: 1,
pageSize: 15,
OrderSource: 0,
OrderType: 0,
DeliveryMethod: 0,
OrderId: 0,
StartTime: "",
EndTime: "",
OrderNo: "",
UserName: "",
UserId: 0,
GoodsName: "",
SelectStatus: 0,
ReOrderNo: "",
Consignee: "",
Mobile: "",
},
readMsg:{
Id:0,
Type:1
},
orderList: [],
};
},
methods: {
getList1() {
uni.showLoading({
title: '加载中'
});
this.requestAdmin("/api/order/GetGoodsOrderPageList", this.msg1, (res) => {
uni.hideLoading();
this.page_count = res.data.pageCount;
if (this.page_count == 1) {
this.status = "nomore";
}
if (this.msg1.pageIndex === 1) {
this.orderList = res.data.pageData;
} else {
this.orderList = [...this.orderList, ...res.data.pageData];
}
});
},
//售后订单数据
getList2() {
uni.showLoading({
title: '加载中'
});
this.requestAdmin("/api/order/GetGoodsOrderAfterPageList", this.msg2, (res) => {
uni.hideLoading();
this.page_count = res.data.pageCount;
if (this.msg2.pageIndex === 1) {
this.orderList = res.data.pageData;
} else {
this.orderList = [...this.orderList, ...res.data.pageData];
}
});
},
// 刷新页面
updateList() {
if (this.orderType === 1) {
this.msg1.pageIndex = 1;
this.getList1();
} else if (this.orderType === 2) {
this.msg2.pageIndex = 1;
this.getList2();
}
},
lower(e) {
if (this.orderType === 1) {
if (this.msg1.pageIndex < this.page_count) {
this.msg1.pageIndex++;
this.status = "loading";
this.getList1();
}
} else if (this.orderType === 2) {
if (this.msg2.pageIndex < this.page_count) {
this.msg2.pageIndex++;
this.status = "loading";
this.getList2();
this.status = "nomore";
}
}
},
//订单标记已读
getOrderRead(){
this.requestAdmin("/api/MemberUser/SetAdminMessageLook", this.readMsg, (res) => {
if(res.resultCode==1){
// uni.showToast({
// title: res.message,
// icon: 'none',
// })
}
});
},
},
onLoad(options) {
uni.setNavigationBarTitle({
title: "订单管理",
});
if (options.OrderNo) {
this.msg2.ReOrderNo = options.OrderNo
}
if (options?.orderType) {
if (options.orderType == 3) {
this.orderType = 2;
this.getList2();
} else {
this.orderType = 1;
this.getList1();
}
this.readMsg.Type=options.orderType
}
if(options?.Id){
this.readMsg.Id = options.Id;
this.getOrderRead();
}
},
};
</script>
<style>
.searchBox {
height: 90rpx;
background-color: #efeff4;
padding: 0 40rpx 0 20rpx;
height: 90rpx;
background-color: #efeff4;
padding: 0 40rpx 0 20rpx;
}
.flex-between {
display: flex;
justify-content: space-between;
align-items: center;
display: flex;
justify-content: space-between;
align-items: center;
}
.flex-center {
display: flex;
justify-content: center;
align-items: center;
display: flex;
justify-content: center;
align-items: center;
}
</style>
......@@ -107,7 +107,6 @@
if (res.resultCode == 1) {
this.dataList = this.dataList.concat(res.data.pageData);
this.page_count = res.data.pageCount;
console.log(this.dataList,'datalist');
}
}
);
......@@ -120,14 +119,10 @@
} else {
this.status = "nomore";
}
},
//订单标记已读
getOrderRead(){
},
goOrderDetail(item){
uni.navigateTo({
url: "/pages/MallMange/orderDetail?OrderNo="+item.OrderNo
url: "/pages/MallMange/orderDetail?OrderNo="+item.OrderNo+'&orderType='+this.msg.Type+'&Id='+item.Id
});
}
}
......
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