feat: 订单对接70%
This commit is contained in:
parent
799d1d5d03
commit
64a5918a2a
@ -45,6 +45,11 @@ Component({
|
|||||||
isStock: false,
|
isStock: false,
|
||||||
isAllSelectedSku: false,
|
isAllSelectedSku: false,
|
||||||
selectSkuSellsPrice: 0,
|
selectSkuSellsPrice: 0,
|
||||||
|
selectSkuLinePrice: 0,
|
||||||
|
selectedSkuId: 0,
|
||||||
|
maxLinePrice: 0,
|
||||||
|
minSalePrice: 0,
|
||||||
|
maxSalePrice: 0,
|
||||||
details: {},
|
details: {},
|
||||||
buyNum: 1,
|
buyNum: 1,
|
||||||
},
|
},
|
||||||
@ -181,6 +186,9 @@ Component({
|
|||||||
});
|
});
|
||||||
this.selectSpecsName(selectedSkuValues.length > 0 ? selectedAttrStr : '');
|
this.selectSpecsName(selectedSkuValues.length > 0 ? selectedAttrStr : '');
|
||||||
if (skuItem) {
|
if (skuItem) {
|
||||||
|
console.log(skuItem[0], '选中的item');
|
||||||
|
console.log(skuItem[0]?.priceInfo[0]?.price, '选中的item');
|
||||||
|
console.log(skuItem[0]?.priceInfo[1]?.price, '选中的item');
|
||||||
this.setData({
|
this.setData({
|
||||||
selectedSkuId: skuItem[0]?.skuId,
|
selectedSkuId: skuItem[0]?.skuId,
|
||||||
selectItem: skuItem,
|
selectItem: skuItem,
|
||||||
|
@ -12,14 +12,13 @@ const initFilters = {
|
|||||||
Page({
|
Page({
|
||||||
data: {
|
data: {
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
|
layout: 0,
|
||||||
priceSorts: '',
|
priceSorts: '',
|
||||||
soldSorts: '',
|
soldSorts: '',
|
||||||
overall: 1,
|
overall: 1,
|
||||||
show: false,
|
show: false,
|
||||||
minVal: '',
|
minVal: '',
|
||||||
maxVal: '',
|
maxVal: '',
|
||||||
minSalePriceFocus: false,
|
|
||||||
maxSalePriceFocus: false,
|
|
||||||
filter: initFilters,
|
filter: initFilters,
|
||||||
hasLoaded: false,
|
hasLoaded: false,
|
||||||
keywords: '',
|
keywords: '',
|
||||||
@ -29,7 +28,7 @@ Page({
|
|||||||
|
|
||||||
total: 0,
|
total: 0,
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 30,
|
pageSize: 10,
|
||||||
|
|
||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const {
|
const {
|
||||||
@ -56,7 +55,8 @@ Page({
|
|||||||
pageSize
|
pageSize
|
||||||
} = this;
|
} = this;
|
||||||
const {
|
const {
|
||||||
sorts,
|
priceSorts,
|
||||||
|
soldSorts,
|
||||||
overall
|
overall
|
||||||
} = filter;
|
} = filter;
|
||||||
const params = {
|
const params = {
|
||||||
@ -66,23 +66,28 @@ Page({
|
|||||||
goodsName: keywords,
|
goodsName: keywords,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (sorts) {
|
if (priceSorts) {
|
||||||
params.goodsSort = 1;
|
params.goodsSort = 1;
|
||||||
params.sortType = sorts === 'desc' ? 1 : 0;
|
params.goodsSortType = priceSorts === 'desc' ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (soldSorts) {
|
||||||
|
params.goodsSort = 2;
|
||||||
|
params.goodsSortType = soldSorts === 'desc' ? 1 : 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (overall) {
|
if (overall) {
|
||||||
params.goodsSort = 0;
|
params.goodsSort = 0;
|
||||||
} else {
|
} else {
|
||||||
params.goodsSort = 1;
|
params.goodsSort = 1;
|
||||||
}
|
}
|
||||||
|
console.log(minVal, 'minVal', maxVal, 'maxVal');
|
||||||
if (minVal) {
|
if (minVal) {
|
||||||
params.minPrice = minVal * 100
|
params.minPrice = minVal * 100
|
||||||
}
|
}
|
||||||
if (maxVal) {
|
if (maxVal) {
|
||||||
params.maxPrice = maxVal * 100
|
params.maxPrice = maxVal * 100
|
||||||
}
|
}
|
||||||
// params.minPrice = minVal ? minVal * 100 : 0;
|
|
||||||
// params.maxPrice = maxVal ? maxVal * 100 : undefined;
|
|
||||||
if (reset) return params;
|
if (reset) return params;
|
||||||
return {
|
return {
|
||||||
...params,
|
...params,
|
||||||
@ -97,6 +102,7 @@ Page({
|
|||||||
goodsList = []
|
goodsList = []
|
||||||
} = this.data;
|
} = this.data;
|
||||||
const params = this.generalQueryData(reset);
|
const params = this.generalQueryData(reset);
|
||||||
|
console.log(params);
|
||||||
if (loadMoreStatus !== 0) return;
|
if (loadMoreStatus !== 0) return;
|
||||||
this.setData({
|
this.setData({
|
||||||
loadMoreStatus: 1,
|
loadMoreStatus: 1,
|
||||||
@ -160,10 +166,11 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
handleSubmit() {
|
handleSubmit(e) {
|
||||||
this.setData({
|
this.setData({
|
||||||
goodsList: [],
|
goodsList: [],
|
||||||
loadMoreStatus: 0,
|
loadMoreStatus: 0,
|
||||||
|
keywords: e.detail.value
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
this.init(true);
|
this.init(true);
|
||||||
|
@ -1,30 +1,54 @@
|
|||||||
import { OrderStatus } from '../config';
|
import {
|
||||||
|
OrderStatus
|
||||||
|
} from '../config';
|
||||||
import {
|
import {
|
||||||
fetchOrders,
|
fetchOrders,
|
||||||
fetchOrdersCount,
|
fetchOrdersCount,
|
||||||
} from '../../../services/order/orderList';
|
} from '../../../services/order/orderList';
|
||||||
import { cosThumb } from '../../../utils/util';
|
import {
|
||||||
|
getOrderList
|
||||||
|
} from '~/services/order/getOrderList';
|
||||||
|
import {
|
||||||
|
cosThumb
|
||||||
|
} from '../../../utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
page: {
|
page: {
|
||||||
size: 5,
|
size: 10,
|
||||||
num: 1,
|
num: 1,
|
||||||
},
|
},
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
tabs: [
|
tabs: [{
|
||||||
{ key: -1, text: '全部' },
|
key: -1,
|
||||||
{ key: OrderStatus.PENDING_PAYMENT, text: '待付款', info: '' },
|
text: '全部'
|
||||||
{ key: OrderStatus.PENDING_DELIVERY, text: '待发货', info: '' },
|
},
|
||||||
{ key: OrderStatus.PENDING_RECEIPT, text: '待收货', info: '' },
|
{
|
||||||
{ key: OrderStatus.COMPLETE, text: '已完成', info: '' },
|
key: OrderStatus.PENDING_PAYMENT,
|
||||||
|
text: '待付款',
|
||||||
|
info: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: OrderStatus.PENDING_DELIVERY,
|
||||||
|
text: '待发货',
|
||||||
|
info: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: OrderStatus.PENDING_RECEIPT,
|
||||||
|
text: '待收货',
|
||||||
|
info: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: OrderStatus.COMPLETE,
|
||||||
|
text: '已完成',
|
||||||
|
info: ''
|
||||||
|
},
|
||||||
],
|
],
|
||||||
curTab: -1,
|
curTab: -1,
|
||||||
orderList: [],
|
orderList: [],
|
||||||
listLoading: 0,
|
listLoading: 0,
|
||||||
pullDownRefreshing: false,
|
pullDownRefreshing: false,
|
||||||
emptyImg:
|
emptyImg: 'https://cdn-we-retail.ym.tencent.com/miniapp/order/empty-order-list.png',
|
||||||
'https://cdn-we-retail.ym.tencent.com/miniapp/order/empty-order-list.png',
|
|
||||||
backRefresh: false,
|
backRefresh: false,
|
||||||
status: -1,
|
status: -1,
|
||||||
},
|
},
|
||||||
@ -39,12 +63,14 @@ Page({
|
|||||||
onShow() {
|
onShow() {
|
||||||
if (!this.data.backRefresh) return;
|
if (!this.data.backRefresh) return;
|
||||||
this.onRefresh();
|
this.onRefresh();
|
||||||
this.setData({ backRefresh: false });
|
this.setData({
|
||||||
|
backRefresh: false
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.data.listLoading === 0) {
|
if (this.data.listLoading === 0) {
|
||||||
this.getOrderList(this.data.curTab);
|
this.onGetOrderList(this.data.curTab);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -53,15 +79,23 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onPullDownRefresh_(e) {
|
onPullDownRefresh_(e) {
|
||||||
const { callback } = e.detail;
|
const {
|
||||||
this.setData({ pullDownRefreshing: true });
|
callback
|
||||||
|
} = e.detail;
|
||||||
|
this.setData({
|
||||||
|
pullDownRefreshing: true
|
||||||
|
});
|
||||||
this.refreshList(this.data.curTab)
|
this.refreshList(this.data.curTab)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
this.setData({ pullDownRefreshing: false });
|
this.setData({
|
||||||
|
pullDownRefreshing: false
|
||||||
|
});
|
||||||
callback && callback();
|
callback && callback();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.setData({ pullDownRefreshing: false });
|
this.setData({
|
||||||
|
pullDownRefreshing: false
|
||||||
|
});
|
||||||
Promise.reject(err);
|
Promise.reject(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@ -74,92 +108,401 @@ Page({
|
|||||||
this.refreshList(status);
|
this.refreshList(status);
|
||||||
},
|
},
|
||||||
|
|
||||||
getOrderList(statusCode = -1, reset = false) {
|
changeOrderStatus(deliveryStatus, payStatus, orderStatus, receiptStatus) {
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
onGetOrderList(statusCode, reset = false) {
|
||||||
|
let _status = -1;
|
||||||
|
switch (statusCode) {
|
||||||
|
case -1:
|
||||||
|
_status = 0
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
_status = 1
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
_status = 2
|
||||||
|
break;
|
||||||
|
case 40:
|
||||||
|
_status = 3
|
||||||
|
break;
|
||||||
|
case 50:
|
||||||
|
_status = 4
|
||||||
|
break;
|
||||||
|
}
|
||||||
const params = {
|
const params = {
|
||||||
parameter: {
|
pageIndex: this.page.num,
|
||||||
pageSize: this.page.size,
|
pageSize: this.page.size,
|
||||||
pageNum: this.page.num,
|
status: _status
|
||||||
},
|
|
||||||
};
|
};
|
||||||
if (statusCode !== -1) params.parameter.orderStatus = statusCode;
|
// if (statusCode !== -1) params.parameter.orderStatus = statusCode;
|
||||||
this.setData({ listLoading: 1 });
|
this.setData({
|
||||||
return fetchOrders(params)
|
listLoading: 1
|
||||||
.then((res) => {
|
});
|
||||||
|
return getOrderList(params)
|
||||||
|
.then((_res) => {
|
||||||
|
// console.log(res);
|
||||||
|
const res = {
|
||||||
|
"code": 200,
|
||||||
|
"msg": "SUCCESS",
|
||||||
|
"data": {
|
||||||
|
"pageSize": 10,
|
||||||
|
"pageIndex": 1,
|
||||||
|
"totalNum": 9,
|
||||||
|
"totalPage": 1,
|
||||||
|
"result": [{
|
||||||
|
"orderId": 17,
|
||||||
|
"orderGuid": "1714904293930307584",
|
||||||
|
"orderNo": "Q2310191520196710002",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1672964367177617408",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api//Uploads/Goods/20231010/BD3521D2710CF9CD.jpg",
|
||||||
|
"title": "韩哚馨(HANDUOXIN)韩哚馨 感学院风短袖茶歇法式连衣裙子碎花长裙2023新款",
|
||||||
|
"skuId": 232,
|
||||||
|
"specifications": [{
|
||||||
|
"specTitle": "规格",
|
||||||
|
"specValue": "常规款加绒"
|
||||||
|
}],
|
||||||
|
"price": 160.00,
|
||||||
|
"buyQuantity": 1
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 160.00,
|
||||||
|
"orderAmount": 155.00,
|
||||||
|
"payPrice": 0.01,
|
||||||
|
"expressPrice": 0.00,
|
||||||
|
"payStatus": 2,
|
||||||
|
"deliveryStatus": 1,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 2,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 0,
|
||||||
|
"statusName": null
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orderId": 16,
|
||||||
|
"orderGuid": "1714900618189082624",
|
||||||
|
"orderNo": "Q2310191505433070002",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1672964367177617408",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api//Uploads/Goods/20231010/BD3521D2710CF9CD.jpg",
|
||||||
|
"title": "韩哚馨(HANDUOXIN)韩哚馨 感学院风短袖茶歇法式连衣裙子碎花长裙2023新款",
|
||||||
|
"skuId": 232,
|
||||||
|
"specifications": [{
|
||||||
|
"specTitle": "规格",
|
||||||
|
"specValue": "常规款加绒"
|
||||||
|
}],
|
||||||
|
"price": 160.00,
|
||||||
|
"buyQuantity": 3
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 480.00,
|
||||||
|
"orderAmount": 475.00,
|
||||||
|
"payPrice": 0.01,
|
||||||
|
"expressPrice": 0.00,
|
||||||
|
"payStatus": 2,
|
||||||
|
"deliveryStatus": 1,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 1,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 2,
|
||||||
|
"statusName": "待发货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orderId": 15,
|
||||||
|
"orderGuid": "1714899117605523456",
|
||||||
|
"orderNo": "Q2310191459455300002",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1672961736711475200",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api/Uploads/Goods/20231009/2E9F7284DE854663.jpg",
|
||||||
|
"title": "2024新款裙子夏季女法式桔梗碎花公主裙吊带连衣裙仙气仙森系 连衣裙 均码",
|
||||||
|
"skuId": 220,
|
||||||
|
"specifications": [{
|
||||||
|
"specTitle": "颜色分类",
|
||||||
|
"specValue": "碎花【收藏优先发货】"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"specTitle": "尺码 ",
|
||||||
|
"specValue": "S【建议70-95斤】"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"price": 65.30,
|
||||||
|
"buyQuantity": 1
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 65.30,
|
||||||
|
"orderAmount": 60.30,
|
||||||
|
"payPrice": 0.01,
|
||||||
|
"expressPrice": 0.00,
|
||||||
|
"payStatus": 2,
|
||||||
|
"deliveryStatus": 1,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 1,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 2,
|
||||||
|
"statusName": "待发货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orderId": 13,
|
||||||
|
"orderGuid": "1714355378755604480",
|
||||||
|
"orderNo": "Q2310180259081130005",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1680467517816049664",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api/Uploads/Goods/20231014/FFCD5093C92A62B1.jpg",
|
||||||
|
"title": "三只松鼠肉松饼1000g 黄金肉松饼早餐代餐休闲零食办公室点心面包量贩箱装",
|
||||||
|
"skuId": 0,
|
||||||
|
"specifications": null,
|
||||||
|
"price": 9.90,
|
||||||
|
"buyQuantity": 2
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 19.80,
|
||||||
|
"orderAmount": 3001.80,
|
||||||
|
"payPrice": 19.80,
|
||||||
|
"expressPrice": 13.00,
|
||||||
|
"payStatus": 2,
|
||||||
|
"deliveryStatus": 1,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 1,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 2,
|
||||||
|
"statusName": "待发货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orderId": 14,
|
||||||
|
"orderGuid": "1714355379099537408",
|
||||||
|
"orderNo": "Q2310180259081130006",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1673671239077597184",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api/Uploads/Goods/20231014/666229CAA9F1B6AE.jpg",
|
||||||
|
"title": "三星 Galaxy S21 5G(SM-G9910)双模5G 骁龙888 超高清专业摄像 120Hz护目屏 游戏手机 8G+128G",
|
||||||
|
"skuId": 235,
|
||||||
|
"specifications": [{
|
||||||
|
"specTitle": "颜色",
|
||||||
|
"specValue": "梵梦紫"
|
||||||
|
}],
|
||||||
|
"price": 2969.00,
|
||||||
|
"buyQuantity": 1
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 2969.00,
|
||||||
|
"orderAmount": 3001.80,
|
||||||
|
"payPrice": 2969.00,
|
||||||
|
"expressPrice": 13.00,
|
||||||
|
"payStatus": 2,
|
||||||
|
"deliveryStatus": 1,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 1,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 2,
|
||||||
|
"statusName": "待发货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orderId": 9,
|
||||||
|
"orderGuid": "1713568156318044160",
|
||||||
|
"orderNo": "Q2310152250589130002",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1672961736711475200",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api/Uploads/Goods/20231009/2E9F7284DE854663.jpg",
|
||||||
|
"title": "2024新款裙子夏季女法式桔梗碎花公主裙吊带连衣裙仙气仙森系 连衣裙 均码",
|
||||||
|
"skuId": 220,
|
||||||
|
"specifications": [{
|
||||||
|
"specTitle": "颜色分类",
|
||||||
|
"specValue": "碎花【收藏优先发货】"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"specTitle": "尺码 ",
|
||||||
|
"specValue": "S【建议70-95斤】"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"price": 65.30,
|
||||||
|
"buyQuantity": 2
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 130.60,
|
||||||
|
"orderAmount": 130.60,
|
||||||
|
"payPrice": 2.00,
|
||||||
|
"expressPrice": 0.00,
|
||||||
|
"payStatus": 2,
|
||||||
|
"deliveryStatus": 2,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 1,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 3,
|
||||||
|
"statusName": "待收货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orderId": 7,
|
||||||
|
"orderGuid": "1713125767367495680",
|
||||||
|
"orderNo": "Q2310141733050100001",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1672964367177617408",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api//Uploads/Goods/20231010/BD3521D2710CF9CD.jpg",
|
||||||
|
"title": "韩哚馨(HANDUOXIN)韩哚馨 感学院风短袖茶歇法式连衣裙子碎花长裙2023新款",
|
||||||
|
"skuId": 231,
|
||||||
|
"specifications": [{
|
||||||
|
"specTitle": "规格",
|
||||||
|
"specValue": "爆款加绒"
|
||||||
|
}],
|
||||||
|
"price": 199.00,
|
||||||
|
"buyQuantity": 1
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 199.00,
|
||||||
|
"orderAmount": 199.00,
|
||||||
|
"payPrice": 1.00,
|
||||||
|
"expressPrice": 0.00,
|
||||||
|
"payStatus": 2,
|
||||||
|
"deliveryStatus": 1,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 1,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 2,
|
||||||
|
"statusName": "待发货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orderId": 6,
|
||||||
|
"orderGuid": "1713124559743488000",
|
||||||
|
"orderNo": "Q2310141728171060001",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1680467515018448896",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api/Uploads/Goods/20231014/EF0885623F14CA0C.jpg",
|
||||||
|
"title": "双汇 火腿肠 玉米热狗40g*8支 网兜装 出游 露营款",
|
||||||
|
"skuId": 0,
|
||||||
|
"specifications": null,
|
||||||
|
"price": 13.00,
|
||||||
|
"buyQuantity": 10
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 130.00,
|
||||||
|
"orderAmount": 143.00,
|
||||||
|
"payPrice": 1.00,
|
||||||
|
"expressPrice": 13.00,
|
||||||
|
"payStatus": 2,
|
||||||
|
"deliveryStatus": 1,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 1,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 2,
|
||||||
|
"statusName": "待发货"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"orderId": 5,
|
||||||
|
"orderGuid": "1713121315600338944",
|
||||||
|
"orderNo": "Q2310141715235960001",
|
||||||
|
"goodsList": [{
|
||||||
|
"goodsGuId": "1672964367177617408",
|
||||||
|
"thumb": "http://shop.back.aerwen.net/prod-api//Uploads/Goods/20231010/BD3521D2710CF9CD.jpg",
|
||||||
|
"title": "韩哚馨(HANDUOXIN)韩哚馨 感学院风短袖茶歇法式连衣裙子碎花长裙2023新款",
|
||||||
|
"skuId": 231,
|
||||||
|
"specifications": [{
|
||||||
|
"specTitle": "规格",
|
||||||
|
"specValue": "爆款加绒"
|
||||||
|
}],
|
||||||
|
"price": 199.00,
|
||||||
|
"buyQuantity": 1
|
||||||
|
}],
|
||||||
|
"goodsTotalAmoun": 199.00,
|
||||||
|
"orderAmount": 199.00,
|
||||||
|
"payPrice": 0.00,
|
||||||
|
"expressPrice": 0.00,
|
||||||
|
"payStatus": 1,
|
||||||
|
"deliveryStatus": 1,
|
||||||
|
"receiptStatus": 1,
|
||||||
|
"orderStatus": 1,
|
||||||
|
"isComment": 1,
|
||||||
|
"status": 1,
|
||||||
|
"statusName": "待付款"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"extra": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
this.page.num++;
|
this.page.num++;
|
||||||
let orderList = [];
|
let orderList = [];
|
||||||
if (res && res.data && res.data.orders) {
|
if (res && res.data && res.data.result) {
|
||||||
orderList = (res.data.orders || []).map((order) => {
|
orderList = (res.data.result || []).map((order) => {
|
||||||
return {
|
return {
|
||||||
id: order.orderId,
|
id: order.orderId,
|
||||||
orderNo: order.orderNo,
|
orderNo: order.orderNo,
|
||||||
parentOrderNo: order.parentOrderNo,
|
// parentOrderNo: order.parentOrderNo,
|
||||||
storeId: order.storeId,
|
storeId: order.storeId,
|
||||||
storeName: order.storeName,
|
storeName: order.storeName,
|
||||||
status: order.orderStatus,
|
status: order.orderStatus,
|
||||||
statusDesc: order.orderStatusName,
|
statusDesc: order.statusName,
|
||||||
amount: order.paymentAmount,
|
amount: order.payPrice,
|
||||||
totalAmount: order.totalAmount,
|
totalAmount: order.orderAmount,
|
||||||
logisticsNo: order.logisticsVO.logisticsNo,
|
// logisticsNo: order.logisticsVO.logisticsNo,
|
||||||
createTime: order.createTime,
|
// createTime: order.createTime,
|
||||||
goodsList: (order.orderItemVOs || []).map((goods) => ({
|
goodsList: (order.goodsList || []).map((goods) => ({
|
||||||
id: goods.id,
|
id: goods.id,
|
||||||
thumb: cosThumb(goods.goodsPictureUrl, 70),
|
thumb: goods.thumb,
|
||||||
title: goods.goodsName,
|
title: goods.title,
|
||||||
skuId: goods.skuId,
|
skuId: goods.skuId,
|
||||||
spuId: goods.spuId,
|
spuId: goods.spuId,
|
||||||
specs: (goods.specifications || []).map(
|
specs: (goods.specifications || []).map(
|
||||||
(spec) => spec.specValue,
|
(spec) => spec.specValue,
|
||||||
),
|
),
|
||||||
price: goods.tagPrice ? goods.tagPrice : goods.actualPrice,
|
price: goods.price,
|
||||||
num: goods.buyQuantity,
|
num: goods.buyQuantity,
|
||||||
titlePrefixTags: goods.tagText ? [{ text: goods.tagText }] : [],
|
titlePrefixTags: goods.tagText ? [{
|
||||||
|
text: goods.tagText
|
||||||
|
}] : [],
|
||||||
})),
|
})),
|
||||||
buttons: order.buttonVOs || [],
|
buttons: order.buttonVOs || [],
|
||||||
groupInfoVo: order.groupInfoVo,
|
groupInfoVo: order.groupInfoVo,
|
||||||
freightFee: order.freightFee,
|
freightFee: order.expressPrice,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
// console.log(orderList);
|
||||||
}
|
}
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
if (reset) {
|
if (reset) {
|
||||||
this.setData({ orderList: [] }, () => resolve());
|
this.setData({
|
||||||
|
orderList: []
|
||||||
|
}, () => resolve());
|
||||||
} else resolve();
|
} else resolve();
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.setData({
|
this.setData({
|
||||||
orderList: this.data.orderList.concat(orderList),
|
orderList: this.data.orderList.concat(orderList),
|
||||||
listLoading: orderList.length > 0 ? 0 : 2,
|
listLoading: orderList.length > 0 ? 0 : 2,
|
||||||
});
|
});
|
||||||
|
// console.log(orderList);
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
this.setData({ listLoading: 3 });
|
this.setData({
|
||||||
|
listLoading: 3
|
||||||
|
});
|
||||||
return Promise.reject(err);
|
return Promise.reject(err);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
onReTryLoad() {
|
onReTryLoad() {
|
||||||
this.getOrderList(this.data.curTab);
|
this.onGetOrderList(this.data.curTab);
|
||||||
},
|
},
|
||||||
|
|
||||||
onTabChange(e) {
|
onTabChange(e) {
|
||||||
const { value } = e.detail;
|
console.log(e);
|
||||||
|
const {
|
||||||
|
value
|
||||||
|
} = e.detail;
|
||||||
this.setData({
|
this.setData({
|
||||||
status: value,
|
status: value,
|
||||||
});
|
});
|
||||||
|
console.log(value);
|
||||||
|
// console.log(value,'asdasd');
|
||||||
this.refreshList(value);
|
this.refreshList(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
getOrdersCount() {
|
getOrdersCount() {
|
||||||
return fetchOrdersCount().then((res) => {
|
return fetchOrdersCount().then((res) => {
|
||||||
const tabsCount = res.data || [];
|
const tabsCount = res.data || [];
|
||||||
const { tabs } = this.data;
|
const {
|
||||||
|
tabs
|
||||||
|
} = this.data;
|
||||||
tabs.forEach((tab) => {
|
tabs.forEach((tab) => {
|
||||||
const tabCount = tabsCount.find((c) => c.tabType === tab.key);
|
const tabCount = tabsCount.find((c) => c.tabType === tab.key);
|
||||||
if (tabCount) {
|
if (tabCount) {
|
||||||
tab.info = tabCount.orderNum;
|
tab.info = tabCount.orderNum;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.setData({ tabs });
|
this.setData({
|
||||||
|
tabs
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -168,10 +511,13 @@ Page({
|
|||||||
size: this.page.size,
|
size: this.page.size,
|
||||||
num: 1,
|
num: 1,
|
||||||
};
|
};
|
||||||
this.setData({ curTab: status, orderList: [] });
|
this.setData({
|
||||||
|
curTab: status,
|
||||||
|
orderList: []
|
||||||
|
});
|
||||||
|
|
||||||
return Promise.all([
|
return Promise.all([
|
||||||
this.getOrderList(status, true),
|
this.onGetOrderList(status, true),
|
||||||
this.getOrdersCount(),
|
this.getOrdersCount(),
|
||||||
]);
|
]);
|
||||||
},
|
},
|
||||||
@ -181,9 +527,11 @@ Page({
|
|||||||
},
|
},
|
||||||
|
|
||||||
onOrderCardTap(e) {
|
onOrderCardTap(e) {
|
||||||
const { order } = e.currentTarget.dataset;
|
const {
|
||||||
|
order
|
||||||
|
} = e.currentTarget.dataset;
|
||||||
wx.navigateTo({
|
wx.navigateTo({
|
||||||
url: `/pages/order/order-detail/index?orderNo=${order.orderNo}`,
|
url: `/pages/order/order-detail/index?orderNo=${order.orderNo}`,
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
20
services/order/getOrderList.js
Normal file
20
services/order/getOrderList.js
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import {
|
||||||
|
request
|
||||||
|
} from '../_utils/request';
|
||||||
|
|
||||||
|
/** 获取轮播图列表 */
|
||||||
|
export function getOrderList(data) {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
request({
|
||||||
|
url: `OrderApi/getOrderList`,
|
||||||
|
method: 'GET',
|
||||||
|
data: data,
|
||||||
|
success: function (res) {
|
||||||
|
resolve(res);
|
||||||
|
},
|
||||||
|
fail: function (error) {
|
||||||
|
reject(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user