Commit bc378208 by wangzhihui

订单详情

1 parent 95797715
...@@ -17,6 +17,8 @@ module.exports = { ...@@ -17,6 +17,8 @@ module.exports = {
...data ...data
}) })
}, },
/**获取订单状态数量 */ /**获取订单状态数量 */
getOrderNumberList(data) { getOrderNumberList(data) {
return api.post({ return api.post({
......
...@@ -68,10 +68,10 @@ module.exports = { ...@@ -68,10 +68,10 @@ module.exports = {
}) })
}, },
/**订单详情 */ /**订单详情 */
getOrderDetail(orderCode) { getOrderDetail(data) {
return api.post({ return api.post({
method: `scrm.api.shopmall.weapp.order.detail`, method: `scrm.api.shopmall.platform.order.detail`,
orderCode ...data
}) })
}, },
/**获取订单的售后详情 */ /**获取订单的售后详情 */
...@@ -195,4 +195,12 @@ module.exports = { ...@@ -195,4 +195,12 @@ module.exports = {
id id
}) })
}, },
/** 查看物流轨迹 */
queryLogistics(data) {
return api.post({
method: `scrm.api.shopmall.platform.order.queryLogistics`,
...data
})
},
} }
\ No newline at end of file \ No newline at end of file
...@@ -10,6 +10,10 @@ Component({ ...@@ -10,6 +10,10 @@ Component({
type: Object, type: Object,
value: {}, value: {},
}, },
shipmentTrack:{
type: Array,
value: [],
}
}, },
data: { data: {
timelineData: [ timelineData: [
......
<wxs module="goodItem" src="formatGoods.wxs"></wxs>
<view class="item"> <view class="item">
<TimeLine nodes="{{timelineData}}"/> <TimeLine nodes="{{timelineData}}"/>
</view> </view>
\ No newline at end of file \ 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 \ No newline at end of file
...@@ -5,13 +5,13 @@ ...@@ -5,13 +5,13 @@
<view class="logo"> <view class="logo">
<glsx-image src="{{expressInfo.logo||'https://picsum.photos/200/200'}}" /> <glsx-image src="{{expressInfo.logo||'https://picsum.photos/200/200'}}" />
</view> </view>
<text>{{expressInfo.name||"顺丰快递"}}</text> <text>{{expressInfo.expressName||"顺丰快递"}}</text>
<text>{{expressInfo.number||'SF12222222222222'}}</text> <text>{{expressInfo.shipmentCode||'SF12222222222222'}}</text>
</view> </view>
<view class="express-info-item"> <view class="express-info-item">
<Copy /> <Copy />
</view> </view>
</view> </view>
<Express /> <Express shipmentTrack="{{expressInfo.shipmentTrack}}" />
</view> </view>
</popup> </popup>
\ No newline at end of file \ No newline at end of file
...@@ -29,12 +29,14 @@ ...@@ -29,12 +29,14 @@
text-align: right; text-align: right;
word-wrap: break-word; word-wrap: break-word;
} }
.order-box { .order-box {
.order-content { .order-content {
border-top: 1rpx solid #f0f1f5; border-top: 1rpx solid #f0f1f5;
margin-top: 35rpx; margin-top: 35rpx;
padding-top: 35rpx; padding-top: 35rpx;
} }
.order-bottom { .order-bottom {
height: 64rpx; height: 64rpx;
padding-top: 24rpx; padding-top: 24rpx;
...@@ -42,3 +44,9 @@ ...@@ -42,3 +44,9 @@
margin-top: 35rpx; margin-top: 35rpx;
} }
} }
.fontColor {
color: #fc5b32!important;
font-size: 28rpx;
font-weight: 700;
}
\ No newline at end of file \ No newline at end of file
...@@ -8,9 +8,10 @@ ...@@ -8,9 +8,10 @@
<block wx:for="{{orderObj}}" wx:key="index"> <block wx:for="{{orderObj}}" wx:key="index">
<view class="item {{item.alignItems}}"> <view class="item {{item.alignItems}}">
<view class="label">{{item.label}}:</view> <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:if="{{item.enum}}">{{statusEnum[orderInfo[item.key]]|| ''}}</block>
<block wx:else>{{orderInfo[item.key] || ''}}</block> <block wx:else>{{orderInfo[item.key] || '-'}}</block>
</view> </view>
</view> </view>
</block> </block>
......
import { wxqrcode as QR } from "~/lib/index"; import {
import { orderMixin } from "~/mixins/index"; wxqrcode as QR
import { iosTimeFormat } from "~/utils/format"; } from "~/lib/index";
import { mockOrderDetailData } from "./mock.js"; import {
import { OrderStatus } from "~/constants/mine.js"; orderMixin
} from "~/mixins/index";
import {
iosTimeFormat
} from "~/utils/format";
import {
mockOrderDetailData
} from "./mock.js";
import {
OrderStatus
} from "~/constants/mine.js";
Page({ Page({
behaviors: [orderMixin], behaviors: [orderMixin],
/** /**
...@@ -12,26 +22,114 @@ Page({ ...@@ -12,26 +22,114 @@ Page({
// 使用mock数据用于开发和测试 // 使用mock数据用于开发和测试
...mockOrderDetailData, ...mockOrderDetailData,
OrderStatus, OrderStatus,
couponsList: [], expressInfo: {
isShowExpressPop:false, "orderCode": "295057717192728657",
orderObj: [ "expressCode": "yuantong",
"expressName": "圆通速递",
"shipmentCode": "1231231231dfsdgs",
"logisticsStatus": 1003,
"shipmentItems": [
{ {
label: "下单日期", "goodsSkuCode": "1125899906842634",
key: "time", "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: 'freightAmount',
sign: true
}, },
{ {
label: "订单编号", label: "订单编号",
key: "orderCode", key: "orderCode",
}, },
{ {
label: "收货地址", label: "下单时间",
key: "shipAddress", key: "orderCreatedDate",
alignItems: "flex-start",
}, },
{ {
label: "订单状态", label: "支付时间",
key: "orderStatus", key: "orderCreatedDate",
enum: true,
}, },
], ],
deliveryStatus: { deliveryStatus: {
...@@ -44,69 +142,63 @@ Page({ ...@@ -44,69 +142,63 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getRouterParams(options).then(({ orderCode } = {}) => { wx.p.router.getRouterParams(options).then(params => {
if (orderCode) { if (params.item) {
this.getOrderDetail(orderCode); this.setData({
orderInfo: params.item
})
this.queryLogistics()
// this.getOrderDetail(params.orderCode);
} }
this.setData({ this.setData({
Status: OrderStatus[this.data.orderInfo.orderStatus], 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) { getOrderDetail(orderCode) {
let { orderObj } = this.data; console.log(orderCode, 7777)
let {
orderObj
} = this.data;
wx.p.wxApi.showLoading("加载中..."); 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(); wx.hideLoading();
console.log(data); console.log(data);
data.time = new Date(iosTimeFormat(data.createdDate)).format( data.time = new Date(iosTimeFormat(data.createdDate)).format(
"yyyy.MM.dd hh:mm:ss" "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({ this.setData({
orderInfo: data, orderInfo: data,
orderObj, 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() { toDetail() {
let [temp] = this.data.orderInfo.relatedUserCoupon, let [temp] = this.data.orderInfo.relatedUserCoupon, {
{ discountType, useChannel, id } = temp, discountType,
useChannel,
id
} = temp,
detailInfo = { detailInfo = {
xx: "xx", xx: "xx",
}; };
...@@ -138,7 +230,7 @@ Page({ ...@@ -138,7 +230,7 @@ Page({
qr: QR.createQrCodeImg(`t=1&c=${data}`), qr: QR.createQrCodeImg(`t=1&c=${data}`),
}); });
}, },
showExpressPop(){ showExpressPop() {
console.log("🚀 ~ showExpressPop ~ showExpressPop:") console.log("🚀 ~ showExpressPop ~ showExpressPop:")
this.setData({ this.setData({
isShowExpressPop: true, isShowExpressPop: true,
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<BlockBox> <BlockBox>
<view class="express-box" bindtap="showExpressPop"> <view class="express-box" bindtap="showExpressPop">
<view class="express-detail" >物流详情 <mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon></view> <view class="express-detail" >物流详情 <mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon></view>
<Express /> <Express shipmentTrack="{{expressInfo.shipmentTrack}}"/>
</view> </view>
</BlockBox> </BlockBox>
<BlockBox> <BlockBox>
...@@ -18,9 +18,7 @@ ...@@ -18,9 +18,7 @@
<!-- <BlockBox> <!-- <BlockBox>
<content item="{{orderInfo}}" /> <content item="{{orderInfo}}" />
</BlockBox> --> </BlockBox> -->
<BlockBox>
<OrderAmount orderInfo="{{orderInfo}}"></OrderAmount> <Expresspop showExpress="{{isShowExpressPop}}" expressInfo="{{expressInfo}}"/>
</BlockBox>
<Expresspop showExpress="{{isShowExpressPop}}"/>
</view> </view>
</block> </block>
\ No newline at end of file \ No newline at end of file
...@@ -33,13 +33,13 @@ Component({ ...@@ -33,13 +33,13 @@ Component({
methods: { methods: {
// 跳转到订单详情 // 跳转到订单详情
onJump(e) { onJump(e) {
console.log(e)
let { let {
item: { orderStatus, orderCode, orderSource }, item,
} = e.currentTarget.dataset; } = e.currentTarget.dataset;
if (orderSource == 5 && (orderStatus == 2 || orderStatus == 7)) return;
let url = "/packageMine/pages/order/detail/detail"; let url = "/packageMine/pages/order/detail/detail";
wx.p.router.go(url, { wx.p.router.go(url, {
orderCode, item,
}); });
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!