Commit bc378208 by wangzhihui

订单详情

1 parent 95797715
......@@ -9,14 +9,16 @@ module.exports = {
...data
})
},
/**. 分页查询订单 */
getSalesOrderList(data) {
/**. 分页查询订单 */
getSalesOrderList(data) {
return api.post({
method: `scrm.api.shopmall.platform.after.sales.order.page`,
pageSize: 99999,
...data
})
},
/**获取订单状态数量 */
getOrderNumberList(data) {
return api.post({
......
......@@ -68,10 +68,10 @@ module.exports = {
})
},
/**订单详情 */
getOrderDetail(orderCode) {
getOrderDetail(data) {
return api.post({
method: `scrm.api.shopmall.weapp.order.detail`,
orderCode
method: `scrm.api.shopmall.platform.order.detail`,
...data
})
},
/**获取订单的售后详情 */
......@@ -195,4 +195,12 @@ module.exports = {
id
})
},
/** 查看物流轨迹 */
queryLogistics(data) {
return api.post({
method: `scrm.api.shopmall.platform.order.queryLogistics`,
...data
})
},
}
\ No newline at end of file
......@@ -10,6 +10,10 @@ Component({
type: Object,
value: {},
},
shipmentTrack:{
type: Array,
value: [],
}
},
data: {
timelineData: [
......
<wxs module="goodItem" src="formatGoods.wxs"></wxs>
<view class="item">
<TimeLine nodes="{{timelineData}}"/>
</view>
\ No newline at end of file
function filterItem(arr,num) {
return arr.slice(0,num)
}
module.exports = {
filterItem:filterItem
}
\ No newline at end of file
......@@ -5,13 +5,13 @@
<view class="logo">
<glsx-image src="{{expressInfo.logo||'https://picsum.photos/200/200'}}" />
</view>
<text>{{expressInfo.name||"顺丰快递"}}</text>
<text>{{expressInfo.number||'SF12222222222222'}}</text>
<text>{{expressInfo.expressName||"顺丰快递"}}</text>
<text>{{expressInfo.shipmentCode||'SF12222222222222'}}</text>
</view>
<view class="express-info-item">
<Copy />
</view>
</view>
<Express />
<Express shipmentTrack="{{expressInfo.shipmentTrack}}" />
</view>
</popup>
\ No newline at end of file
......@@ -29,12 +29,14 @@
text-align: right;
word-wrap: break-word;
}
.order-box {
.order-content {
border-top: 1rpx solid #f0f1f5;
margin-top: 35rpx;
padding-top: 35rpx;
}
.order-bottom {
height: 64rpx;
padding-top: 24rpx;
......@@ -42,3 +44,9 @@
margin-top: 35rpx;
}
}
.fontColor {
color: #fc5b32!important;
font-size: 28rpx;
font-weight: 700;
}
\ No newline at end of file
......@@ -8,9 +8,10 @@
<block wx:for="{{orderObj}}" wx:key="index">
<view class="item {{item.alignItems}}">
<view class="label">{{item.label}}:</view>
<view class="value">
<view class="value {{item.styleColor}}">
<block wx:if="{{item.sign}}">¥</block>
<block wx:if="{{item.enum}}">{{statusEnum[orderInfo[item.key]]|| ''}}</block>
<block wx:else>{{orderInfo[item.key] || ''}}</block>
<block wx:else>{{orderInfo[item.key] || '-'}}</block>
</view>
</view>
</block>
......
import { wxqrcode as QR } from "~/lib/index";
import { orderMixin } from "~/mixins/index";
import { iosTimeFormat } from "~/utils/format";
import { mockOrderDetailData } from "./mock.js";
import { OrderStatus } from "~/constants/mine.js";
import {
wxqrcode as QR
} from "~/lib/index";
import {
orderMixin
} from "~/mixins/index";
import {
iosTimeFormat
} from "~/utils/format";
import {
mockOrderDetailData
} from "./mock.js";
import {
OrderStatus
} from "~/constants/mine.js";
Page({
behaviors: [orderMixin],
/**
......@@ -12,26 +22,114 @@ Page({
// 使用mock数据用于开发和测试
...mockOrderDetailData,
OrderStatus,
couponsList: [],
isShowExpressPop:false,
orderObj: [
expressInfo: {
"orderCode": "295057717192728657",
"expressCode": "yuantong",
"expressName": "圆通速递",
"shipmentCode": "1231231231dfsdgs",
"logisticsStatus": 1003,
"shipmentItems": [
{
"goodsSkuCode": "1125899906842634",
"goodsSkuName": "松下家用微电脑电饭煲SR-MGT108可预约1-4人多功能煮饭电饭锅3L SR-MGT108 银色 ",
"qty": 1
}
],
"shipmentTrack": [
{
"content": "已签收,签收人凭取货码签收。",
"operateTime": "2019-10-21 17:59:18",
"operator": "Operator"
},
{
"content": "快件已暂存至武汉世界城加州阳光步行街店菜鸟驿站,如有疑问请联系18771141749",
"operateTime": "2019-10-21 13:12:02",
"operator": "Operator"
},
{
"content": "湖北武汉关南公司-朱杰(15172337939,027-59401618)-派件中",
"operateTime": "2019-10-21 11:14:08",
"operator": "Operator"
},
{
"content": "已到达-湖北武汉关南公司",
"operateTime": "2019-10-21 10:29:08",
"operator": "Operator"
},
{
"content": "已到达-湖北武汉关南公司",
"operateTime": "2019-10-21 06:54:16",
"operator": "Operator"
},
{
"content": "湖北武昌转运中心-已发往-湖北武汉关南公司",
"operateTime": "2019-10-20 23:16:43",
"operator": "Operator"
},
{
"content": "已到达-湖北武昌转运中心",
"operateTime": "2019-10-20 23:03:58",
"operator": "Operator"
},
{
"content": "广东深圳福田转运中心-已装袋发往-湖北武昌转运中心",
"operateTime": "2019-10-20 01:29:50",
"operator": "Operator"
},
{
"content": "广东深圳福田转运中心-已进行装车扫描",
"operateTime": "2019-10-20 01:29:50",
"operator": "Operator"
},
{
"content": "广东深圳福田转运中心-已发往-湖北武昌转运中心",
"operateTime": "2019-10-19 23:40:20",
"operator": "Operator"
},
{
"content": "广东深圳福田转运中心-已进行装袋扫描",
"operateTime": "2019-10-19 23:40:20",
"operator": "Operator"
},
{
"content": "已到达-广东深圳福田转运中心",
"operateTime": "2019-10-19 23:22:17",
"operator": "Operator"
},
{
"content": "广东宝安凤凰营业厅-已发往-广东深圳福田转运中心",
"operateTime": "2019-10-19 21:00:33",
"operator": "Operator"
},
{
"content": "广东宝安凤凰营业厅-冯凯(时光漫步)-已收件",
"operateTime": "2019-10-19 20:57:56",
"operator": "Operator"
}
]
}, //物流信息
isShowExpressPop: false,
orderObj: [{
label: "实付款",
key: 'redeemPoints',
styleColor: 'fontColor'
},
{
label: "下单日期",
key: "time",
label: "运费",
key: 'freightAmount',
sign: true
},
{
label: "订单编号",
key: "orderCode",
},
{
label: "收货地址",
key: "shipAddress",
alignItems: "flex-start",
label: "下单时间",
key: "orderCreatedDate",
},
{
label: "订单状态",
key: "orderStatus",
enum: true,
label: "支付时间",
key: "orderCreatedDate",
},
],
deliveryStatus: {
......@@ -44,69 +142,63 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.p.router.getRouterParams(options).then(({ orderCode } = {}) => {
if (orderCode) {
this.getOrderDetail(orderCode);
wx.p.router.getRouterParams(options).then(params => {
if (params.item) {
this.setData({
orderInfo: params.item
})
this.queryLogistics()
// this.getOrderDetail(params.orderCode);
}
this.setData({
Status: OrderStatus[this.data.orderInfo.orderStatus],
});
});
},
queryLogistics() {
let {
subOrderCode
} = this.data.orderInfo
let params = {
subOrderCode: 'GLS961872388671414272'
}
wx.p.api.shopmallApi.queryLogistics(params).then((data) => {
console.log(data, '物流信息')
this.setData({
// expressInfo: data
})
})
},
getOrderDetail(orderCode) {
let { orderObj } = this.data;
console.log(orderCode, 7777)
let {
orderObj
} = this.data;
wx.p.wxApi.showLoading("加载中...");
wx.p.api.shopmallApi.getOrderDetail(orderCode).then((data) => {
let params = {
subOrderCode: orderCode
}
wx.p.api.shopmallApi.getOrderDetail(params).then((data) => {
console.log(data, 999999999999999999999)
wx.hideLoading();
console.log(data);
data.time = new Date(iosTimeFormat(data.createdDate)).format(
"yyyy.MM.dd hh:mm:ss"
);
data.orderGoods.map((e) => {
e.retailPrice = Number(e.retailPrice).toFixed(2);
if (e.activityPrice)
e.activityPrice = Number(e.activityPrice).toFixed(2);
});
data.orderPrice = Number(data.orderPrice).toFixed(2);
data.expressFee = Number(data.expressFee).toFixed(2);
data.payPrice = Number(data.payPrice).toFixed(2);
if (data.orderSource == 4) {
orderObj[2] = {
label: "商户订单号",
key: "outTradeNo",
};
}
this.setData({
orderInfo: data,
orderObj,
});
if (data.deliveryType == 1 && data.orderVerification)
this.setQr(data.orderVerification.verificationCode);
if (data.relatedUserCoupon) {
let list = data.relatedUserCoupon.map((item) => {
item.receiveStartTime = new Date(
iosTimeFormat(item.receiveStartTime)
).format("yyyy.MM.dd");
if (item.effectiveType == 1) {
item.receiveEndTime = new Date(
iosTimeFormat(item.receiveEndTime)
).format("yyyy.MM.dd hh:mm:ss");
} else {
item.receiveEndTime = new Date(
iosTimeFormat(item.receiveEndTime)
).format("yyyy.MM.dd");
}
return item;
});
this.setData({
couponsList: list,
});
}
})
});
},
toDetail() {
let [temp] = this.data.orderInfo.relatedUserCoupon,
{ discountType, useChannel, id } = temp,
let [temp] = this.data.orderInfo.relatedUserCoupon, {
discountType,
useChannel,
id
} = temp,
detailInfo = {
xx: "xx",
};
......@@ -138,10 +230,10 @@ Page({
qr: QR.createQrCodeImg(`t=1&c=${data}`),
});
},
showExpressPop(){
showExpressPop() {
console.log("🚀 ~ showExpressPop ~ showExpressPop:")
this.setData({
isShowExpressPop: true,
});
}
});
});
\ No newline at end of file
......@@ -9,7 +9,7 @@
<BlockBox>
<view class="express-box" bindtap="showExpressPop">
<view class="express-detail" >物流详情 <mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon></view>
<Express />
<Express shipmentTrack="{{expressInfo.shipmentTrack}}"/>
</view>
</BlockBox>
<BlockBox>
......@@ -18,9 +18,7 @@
<!-- <BlockBox>
<content item="{{orderInfo}}" />
</BlockBox> -->
<BlockBox>
<OrderAmount orderInfo="{{orderInfo}}"></OrderAmount>
</BlockBox>
<Expresspop showExpress="{{isShowExpressPop}}"/>
<Expresspop showExpress="{{isShowExpressPop}}" expressInfo="{{expressInfo}}"/>
</view>
</block>
\ No newline at end of file
......@@ -33,13 +33,13 @@ Component({
methods: {
// 跳转到订单详情
onJump(e) {
console.log(e)
let {
item: { orderStatus, orderCode, orderSource },
item,
} = e.currentTarget.dataset;
if (orderSource == 5 && (orderStatus == 2 || orderStatus == 7)) return;
let url = "/packageMine/pages/order/detail/detail";
wx.p.router.go(url, {
orderCode,
item,
});
},
......@@ -113,4 +113,4 @@ Component({
});
},
},
});
});
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!