Commit 32ef5a21 by wangzhihui

申请售后

1 parent bc378208
Showing 32 changed files with 496 additions and 162 deletions
...@@ -130,9 +130,13 @@ module.exports = { ...@@ -130,9 +130,13 @@ module.exports = {
orderCode orderCode
}) })
}, },
/** 申请售后 */ /** 申请售后-自营商品 */
afterSale(data) { afterSale(data) {
return api.fetch('scrm.api.shopmall.weapp.orderRefund.apply', data) return api.fetch('scrm.api.shopmall.points.afterSales.add', data)
},
/** 申请售后-云中鹤申请售后 */
afterSalesPlatform(data) {
return api.fetch('scrm.api.shopmall.platform.afterSales.add', data)
}, },
//申请售后待审核的订单取消售后 //申请售后待审核的订单取消售后
cancelOrder(orderCode) { cancelOrder(orderCode) {
......
...@@ -5,6 +5,10 @@ Component({ ...@@ -5,6 +5,10 @@ Component({
nodes: { nodes: {
type: Array, type: Array,
value: [], value: [],
},
height:{
type:String,
value:'256rpx'
} }
}, },
}); });
\ No newline at end of file \ No newline at end of file
/* 时间轴容器 */ /* 时间轴容器 */
.timeline-container { .timeline-container {
padding: 20rpx 0; padding: 20rpx 0;
overflow-y: auto;
} }
/* 时间轴节点 */ /* 时间轴节点 */
...@@ -8,6 +9,7 @@ ...@@ -8,6 +9,7 @@
position: relative; position: relative;
padding-bottom: 40rpx; padding-bottom: 40rpx;
display: flex; display: flex;
&:last-child { &:last-child {
padding-bottom: 0; padding-bottom: 0;
} }
...@@ -32,7 +34,8 @@ ...@@ -32,7 +34,8 @@
z-index: 1; z-index: 1;
/* 激活状态的节点点 */ /* 激活状态的节点点 */
&.timeline-node__dot--special-small-active, //组合容错 &.timeline-node__dot--special-small-active,
//组合容错
&.timeline-node__dot--special-active-small, &.timeline-node__dot--special-active-small,
&.timeline-node__dot--small-active-special, &.timeline-node__dot--small-active-special,
&.timeline-node__dot--small-special-active, &.timeline-node__dot--small-special-active,
...@@ -48,8 +51,10 @@ ...@@ -48,8 +51,10 @@
&.timeline-node__dot--active { &.timeline-node__dot--active {
background-color: var(--btnColor); background-color: var(--btnColor);
} }
/* 小型节点点 */ /* 小型节点点 */
&.timeline-node__dot--special-small-active, //组合容错 &.timeline-node__dot--special-small-active,
//组合容错
&.timeline-node__dot--special-active-small, &.timeline-node__dot--special-active-small,
&.timeline-node__dot--small-active-special, &.timeline-node__dot--small-active-special,
&.timeline-node__dot--small-special-active, &.timeline-node__dot--small-special-active,
...@@ -91,15 +96,18 @@ ...@@ -91,15 +96,18 @@
.timeline-node__content--special-small, .timeline-node__content--special-small,
.timeline-node__content--special-active, .timeline-node__content--special-active,
.timeline-node__content--special-small-active, .timeline-node__content--special-small-active,
.timeline-node__content--special-active-small{ .timeline-node__content--special-active-small {
.timeline-node__title, .timeline-node__title,
.timeline-node__tip { .timeline-node__tip {
font-weight: 400; font-weight: 400;
font-size: 24rpx; font-size: 24rpx;
} }
.timeline-node__title { .timeline-node__title {
color: #282829; color: #282829;
} }
.timeline-node__tip { .timeline-node__tip {
color: #666666; color: #666666;
} }
...@@ -142,9 +150,11 @@ ...@@ -142,9 +150,11 @@
.timeline-node__title { .timeline-node__title {
color: #282829; color: #282829;
} }
.timeline-node__time { .timeline-node__time {
color: #909399; color: #909399;
} }
.timeline-node__tip { .timeline-node__tip {
color: #656566; color: #656566;
} }
......
<!-- 时间轴组件 --> <!-- 时间轴组件 -->
<view class="timeline-container"> <view class="timeline-container" style="height:{{height}}">
<view wx:for="{{nodes}}" wx:key="index" class="timeline-node"> <view wx:for="{{nodes}}" wx:key="index" class="timeline-node">
<!-- 时间轴节点 --> <!-- 时间轴节点 -->
<view class="timeline-node__dot-wrapper"> <view class="timeline-node__dot-wrapper">
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
<!-- 时间轴内容 --> <!-- 时间轴内容 -->
<view class="timeline-node__content timeline-node__content--{{item.type}} "> <view class="timeline-node__content timeline-node__content--{{item.type}} ">
<view class="timeline-node__header"> <view class="timeline-node__header">
<view wx:if="{{item.title}}" class="timeline-node__title">{{item.title}}</view> <view wx:if="{{item.statusDesc}}" class="timeline-node__title">{{item.statusDesc}}</view>
<view wx:if="{{item.time}}" class="timeline-node__time">{{item.time}}</view> <view wx:if="{{item.operateTime}}" class="timeline-node__time">{{item.operateTime}}</view>
</view> </view>
<view wx:for="{{item.tips}}" wx:key="index" class="timeline-node__tip"> <view class="timeline-node__tip">
{{item}} {{item.content}}
</view> </view>
</view> </view>
</view> </view>
......
...@@ -16,7 +16,7 @@ export const OrderStatusEnum = { ...@@ -16,7 +16,7 @@ export const OrderStatusEnum = {
AFTER_SALE_REJECTED: "10007", //售后审核不通过 AFTER_SALE_REJECTED: "10007", //售后审核不通过
AFTER_SALE_REFUNDED: "10008", //已退款 AFTER_SALE_REFUNDED: "10008", //已退款
AFTER_SALE_REFUNDED_FAILED: "10009", //退款失败 AFTER_SALE_REFUNDED_FAILED: "10009", //退款失败
AFTER_SALE_REVEAL:"10010"//所有其他状态 AFTER_SALE_REVEAL: "10010" //所有其他状态
}; };
export const OrderStatusTypes = { export const OrderStatusTypes = {
...@@ -85,7 +85,11 @@ export const ORDER_STATUS = { ...@@ -85,7 +85,11 @@ export const ORDER_STATUS = {
index: 2, // 查询订单列表TAB高亮的索引 index: 2, // 查询订单列表TAB高亮的索引
requestType: 6, // 查询订单列表TAB查询参数 requestType: 6, // 查询订单列表TAB查询参数
type: OrderStatusTypes.MY_ORDER, //我的 页面 我的订单 显示的项目 type: OrderStatusTypes.MY_ORDER, //我的 页面 我的订单 显示的项目
buttons: null, buttons: {
[GoodsSource.SELF]: [ //自营商品 在商品列表对应的按钮
OrderActionButtons.CONFIRM_RECEIVE
],
},
}, },
[OrderStatusEnum.WAIT_RECEIVE]: { [OrderStatusEnum.WAIT_RECEIVE]: {
text: "待收货", text: "待收货",
...@@ -97,11 +101,11 @@ export const ORDER_STATUS = { ...@@ -97,11 +101,11 @@ export const ORDER_STATUS = {
buttons: { buttons: {
[GoodsSource.SELF]: [ //自营商品 在商品列表对应的按钮 [GoodsSource.SELF]: [ //自营商品 在商品列表对应的按钮
OrderActionButtons.CONFIRM_RECEIVE, OrderActionButtons.CONFIRM_RECEIVE,
OrderActionButtons.SHOW_EXPRESS, // OrderActionButtons.SHOW_EXPRESS,
], ],
[GoodsSource.YZH]: [ //云中鹤商品 在商品列表对应的按钮 [GoodsSource.YZH]: [ //云中鹤商品 在商品列表对应的按钮
OrderActionButtons.CONFIRM_RECEIVE, OrderActionButtons.CONFIRM_RECEIVE,
OrderActionButtons.SHOW_EXPRESS, // OrderActionButtons.SHOW_EXPRESS,
], ],
}, },
}, },
...@@ -113,11 +117,11 @@ export const ORDER_STATUS = { ...@@ -113,11 +117,11 @@ export const ORDER_STATUS = {
type: OrderStatusTypes.QUERY_TAB, // 查询订单列表显示的TAB项 type: OrderStatusTypes.QUERY_TAB, // 查询订单列表显示的TAB项
buttons: { buttons: {
[GoodsSource.SELF]: [ //自营商品 在商品列表对应的按钮 [GoodsSource.SELF]: [ //自营商品 在商品列表对应的按钮
OrderActionButtons.SHOW_EXPRESS, // OrderActionButtons.SHOW_EXPRESS,
OrderActionButtons.AFTER_SALE, OrderActionButtons.AFTER_SALE,
], ],
[GoodsSource.YZH]: [ //云中鹤商品 在商品列表对应的按钮 [GoodsSource.YZH]: [ //云中鹤商品 在商品列表对应的按钮
OrderActionButtons.SHOW_EXPRESS, // OrderActionButtons.SHOW_EXPRESS,
OrderActionButtons.AFTER_SALE, OrderActionButtons.AFTER_SALE,
], ],
}, },
...@@ -196,51 +200,67 @@ export const ORDER_STATUS = { ...@@ -196,51 +200,67 @@ export const ORDER_STATUS = {
export const RefundReason = [{ export const RefundReason = [{
text: "商品无货", text: "商品无货",
value: 1, value: 1001,
}, },
{ {
text: "发货时间问题", text: "发货时间问题",
value: 2, value: 1002,
}, },
{ {
text: "不想要了/不喜欢", text: "不想要了/不喜欢",
value: 3, value: 1003,
}, },
{ {
text: "商品信息填写错误", text: "商品信息填写错误",
value: 4, value: 1004,
}, },
{ {
text: "地址信息填写错误", text: "地址信息填写错误",
value: 5, value: 1005,
}, },
{ {
text: "商品降价", text: "商品降价",
value: 6, value: 1006,
}, },
{ {
text: "其他", text: "其他",
value: 7, value: 1007,
}, },
{ {
text: "尺码不合适", text: "尺码不合适",
value: 8, value: 1008,
}, },
{ {
text: "无理由退货", text: "无理由退货",
value: 9, value: 1009,
}, },
{ {
text: "发票问题", text: "发票问题",
value: 10, value: 1010,
}, },
{ {
text: "商品与页面描述不符", text: "商品与页面描述不符",
value: 11, value: 1011,
}, },
{ {
text: "发错货", text: "发错货",
value: 12, value: 1012,
},
{
text: "质量问题",
value: 1013,
},
{
text: "买错尺码/颜色/型号",
value: 1014,
},
{
text: "商品缺少或破损",
value: 1015,
},
{
text: "买错了",
value: 1016,
}, },
]; ];
......
...@@ -2,8 +2,8 @@ module.exports = Behavior( ...@@ -2,8 +2,8 @@ module.exports = Behavior(
{ {
data: { data: {
afterType:{ afterType:{
1:'我要退款退货', 1001:'我要退款退货',
2:'我要退款(无需退货)' 1002:'我要退款(无需退货)'
} }
} }
}) })
\ No newline at end of file \ No newline at end of file
...@@ -8,21 +8,25 @@ Page({ ...@@ -8,21 +8,25 @@ Page({
afterSaleList: [ afterSaleList: [
{ {
active: true, active: true,
value: 2 value: 1001
}, },
{ {
value: 1 value: 1002
} }
] ]
}, },
choose(e) { choose(e) {
console.log(e)
let { index } = e.currentTarget.dataset let { index } = e.currentTarget.dataset
let { afterSaleList } = this.data let { afterSaleList } = this.data,
returnType;
afterSaleList.map(i => (i.active = false)) afterSaleList.map(i => (i.active = false))
afterSaleList[index].active = true afterSaleList[index].active = true
returnType= afterSaleList[index].value
this.setData({ this.setData({
afterSaleList afterSaleList
}) })
this.triggerEvent('returnType',{returnType})
}, },
click() { click() {
let { let {
......
import { afterSaleMixin } from "~/mixins/index"; import {
import { RefundReason } from "~/constants/mine.js"; afterSaleMixin
} from "~/mixins/index";
import {
RefundReason
} from "~/constants/mine.js";
Page({ Page({
behaviors: [afterSaleMixin], behaviors: [afterSaleMixin],
...@@ -18,7 +22,10 @@ Page({ ...@@ -18,7 +22,10 @@ Page({
wx.p.router.getRouterParams(options).then((params) => { wx.p.router.getRouterParams(options).then((params) => {
if (params.imgUrls) imgUrls = params.imgUrls; if (params.imgUrls) imgUrls = params.imgUrls;
this.setData({ this.setData({
orderObj: params, orderObj: {
...params,
returnType:1001//数据初始化
},
imgUrls, imgUrls,
maxRefundCount: params.refundCount, maxRefundCount: params.refundCount,
}); });
...@@ -26,18 +33,25 @@ Page({ ...@@ -26,18 +33,25 @@ Page({
}, },
input(e) { input(e) {
this.setData({ this.setData({
"orderObj.remark": e.detail.value, "orderObj.returnContent": e.detail.value,
}); });
}, },
changeRefundCount(e) { changeRefundCount(e) {
this.setData({ this.setData({
"orderObj.refundCount": e.detail.value "orderObj.applyQty": e.detail.value
}); });
}, },
radioChange(e){ radioChange(e) {
const value = e.detail.item.value console.log(e)
const value = e.detail.value
this.setData({ this.setData({
"orderObj.reason": value, "orderObj.returnReasonType": value,
});
},
changeReturnType(e) {
const returnType = e.detail.returnType
this.setData({
"orderObj.returnType": returnType,
}); });
}, },
showRefundCount() { showRefundCount() {
...@@ -46,8 +60,12 @@ Page({ ...@@ -46,8 +60,12 @@ Page({
}); });
}, },
del(e) { del(e) {
let { index } = e.detail; let {
let { imgUrls } = this.data; index
} = e.detail;
let {
imgUrls
} = this.data;
imgUrls.splice(index, 1); imgUrls.splice(index, 1);
this.setData({ this.setData({
imgUrls, imgUrls,
...@@ -55,7 +73,9 @@ Page({ ...@@ -55,7 +73,9 @@ Page({
}, },
upLoad() { upLoad() {
let _this = this; let _this = this;
let { imgUrls } = this.data; let {
imgUrls
} = this.data;
wx.chooseImage({ wx.chooseImage({
count: 1, count: 1,
}).then((res) => { }).then((res) => {
...@@ -77,21 +97,47 @@ Page({ ...@@ -77,21 +97,47 @@ Page({
imgUrls.push(img); imgUrls.push(img);
_this.setData({ _this.setData({
imgUrls, imgUrls,
'orderObj.imgUrls': imgUrls
}); });
}); });
}, },
}); });
}); });
}, },
check() {
let obj = {
returnReasonType: '请选择退款原因'
},
{
orderObj
} = this.data;
Object.keys(obj).forEach(key => {
if (!orderObj[key]) {
wx.p.wxApi.showToast(obj[key])
return
}
})
},
submit() { submit() {
let { orderObj, imgUrls } = this.data; let {
orderObj.imgUrls = imgUrls; orderObj,
console.log(orderObj); imgUrls
wx.p.api.shopmallApi.afterSale(orderObj).then(({ code, data, message }) => { } = this.data,
Methods = orderObj.goodsSource == 2 ? 'afterSale' : 'afterSalesPlatform';
orderObj.imgUrls = imgUrls,
// orderObj.subOrderCode='GLS960387803345330176'
this.check()
wx.p.api.shopmallApi[Methods](orderObj).then(({
code,
data,
message
}) => {
if (code == "0") { if (code == "0") {
wx.p.wxApi.showToast("申请成功!"); wx.p.wxApi.showToast("申请成功!");
setTimeout(() => { setTimeout(() => {
wx.p.router.back((prevPage) => { wx.p.router.back((prevPage) => {
console.log(prevPage)
prevPage.clearData && prevPage.clearData(); prevPage.clearData && prevPage.clearData();
}, 2); }, 2);
}, 1.5 * 1000); }, 1.5 * 1000);
......
<view class="layout isFullSucreen"> <view class="layout isFullSucreen">
<!-- <view class="title">售后类型</view> --> <!-- <view class="title">售后类型</view> -->
<!-- <view class="type text-center"> --> <!-- <view class="type text-center"> -->
<afterSale_step_one /> <afterSale_step_one bindreturnType="changeReturnType"/>
<!-- </view> --> <!-- </view> -->
<view class="title">申请退货退款</view> <view class="title">申请退货退款</view>
<!-- 退款信息组件 --> <!-- 退款信息组件 -->
<refund-info-box <refund-info-box
refund-count="{{orderObj.refundCount}}" orderObj="{{orderObj}}"
refund-count="{{orderObj.applyQty}}"
max-refund-count="{{maxRefundCount}}" max-refund-count="{{maxRefundCount}}"
refund-price="{{orderObj.refundPrice}}" refund-price="{{orderObj.refundPoints}}"
show-refund-count="{{showRefundCount}}" show-refund-count="{{showRefundCount}}"
bindconfirmpopup="confirmPopup" bindconfirmpopup="confirmPopup"
bindchangerefundcount="changeRefundCount" bindchangerefundcount="changeRefundCount"
...@@ -20,7 +21,7 @@ ...@@ -20,7 +21,7 @@
<!-- 描述信息组件 --> <!-- 描述信息组件 -->
<view class="description box"> <view class="description box">
<gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{remark}}" bindinput="input" showWordLimit customMaxLength></gl-textarea> <gl-textarea maxlength="230" placeholder="补充描述,有助于商家更好的处理售后问题" value="{{orderObj.returnContent}}" bindinput="input" showWordLimit customMaxLength></gl-textarea>
</view> </view>
<view class="title">上传图片</view> <view class="title">上传图片</view>
......
...@@ -46,15 +46,18 @@ Component({ ...@@ -46,15 +46,18 @@ Component({
}, },
onChangeRefundCount(e) { onChangeRefundCount(e) {
this.setData({
refundCount:e.detail
})
this.triggerEvent("changerefundcount", { value: e.detail }); this.triggerEvent("changerefundcount", { value: e.detail });
}, },
onRadioChange(e) { onRadioChange(e) {
const item = e.currentTarget.dataset.item; const {value} = e.currentTarget.dataset.item;
this.setData({ this.setData({
refundReason: RefundReason.find((item) => item.value == value).text, refundReason: this.data.RefundReasonList.find((item) => item.value == value).text,
}); });
this.triggerEvent("radiochange", { item }); this.triggerEvent("radiochange", { value });
}, },
}, },
}); });
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<view class="price">{{refundCount}}件</view> <view class="price">{{refundCount}}件</view>
修改数量 修改数量
</view> </view>
<Stepper wx:else count="{{refundCount}}" min="1" max="{{maxRefundCount}}" bindchange="onChangeRefundCount" data-index="{{index}}"></Stepper> <Stepper wx:else count="{{refundCount}}" min="1" max="10" bindchange="onChangeRefundCount" data-index="{{index}}"></Stepper>
</view> </view>
</view> </view>
<view class="box-item"> <view class="box-item">
......
const { mockDeliveryInfoData } = require("./mock.js"); const {
mockDeliveryInfoData
} = require("./mock.js");
const LOGISTICS_STATUS = {
1000: '待揽件',
1001: '已揽件',
1002: '运输中',
1003: '已签收',
1004: '拒收'
};
Component({ Component({
properties: { properties: {
orderInfo: { expressInfo: {
type: Object, type: Object,
value: {}, value: {},
observer: function (val) {
this.setData({
logisticsData: this.processExpressInfo(val)
})
}
}, },
deliveryStatus: { showExpress: {
type: Object, type: Boolean,
value: {}, value: false
}, },
shipmentTrack:{ height: {
type: Array, type: String,
value: [], value: '256rpx'
} }
}, },
data: { data: {
timelineData: [ logisticsData: {},
{ // timelineData: [
time: "2021-02-02 10:30:30", // {
tips: ["这是主要内容部分"], // time: "2021-02-02 10:30:30",
title: "已发货", // tips: ["这是主要内容部分"],
type: 'active',// 高亮显示 // title: "已发货",
// type: 'active',// 高亮显示
// },
// {
// time: "2021-02-02 10:30:30",
// tips: ["这是主要内容部分"],
// title:'运输中',
// type: 'small',// 小点显示
// },
// {
// time: "2021-02-02 10:30:30",
// tips: ["这是主要内容部分11111111111",
// "这是主要内容部分11111111111",
// "这是主要内容部分11111111111"
// ],
// title:'运输中',
// type: 'normal',
// },
// {
// title:'收货地址',
// tips: ["这是主要内容部分"],
// type: 'special' // 地址节点,使用专门的样式
// }
// ],
}, },
{ methods: {
time: "2021-02-02 10:30:30", processShipmentTrack(shipmentTrack, logisticsStatus) {
tips: ["这是主要内容部分"], if (!this.data.showExpress) {
title:'运输中', shipmentTrack = shipmentTrack ? shipmentTrack.slice(0, 2) : []
type: 'small',// 小点显示
},
{
time: "2021-02-02 10:30:30",
tips: ["这是主要内容部分11111111111",
"这是主要内容部分11111111111",
"这是主要内容部分11111111111"
],
title:'运输中',
type: 'normal',
},
{
title:'收货地址',
tips: ["这是主要内容部分"],
type: 'special' // 地址节点,使用专门的样式
} }
], return shipmentTrack.map((track, index) => {
let status = 1000;
let statusDesc = '待揽件';
const content = track.content;
const operateTime = track.operateTime;
const isLast = index === 0;
// 根据内容判断状态
if (content.includes('已签收') || content.includes('签收人')) {
status = 1003;
statusDesc = '已签收';
} else if (content.includes('拒收') || content.includes('退回')) {
status = 1004;
statusDesc = '拒收';
} else if (content.includes('派件') || content.includes('驿站') || content.includes('暂存')) {
status = 1002;
statusDesc = '运输中';
} else if (content.includes('转运中心') || content.includes('发往') || content.includes('到达')) {
status = 1002;
statusDesc = '运输中';
} else if (content.includes('已收件') || content.includes('揽收')) {
status = 1001;
statusDesc = '已揽件';
} else if (content.includes('已发往')) {
status = 1001;
statusDesc = '已揽件';
}
// 根据整体物流状态进行最终调整
if (logisticsStatus < status) {
// 如果整体状态低于当前轨迹状态,说明该轨迹尚未完成
statusDesc = LOGISTICS_STATUS[logisticsStatus] + '(进行中)';
}
return {
...track,
type: isLast ? 'active' : 'small',
status,
statusDesc
};
}).filter(track => {
// 根据整体物流状态过滤轨迹
switch (logisticsStatus) {
case 1000: // 待揽件 - 只显示收件相关记录
return track.status === 1000;
case 1001: // 已揽件 - 显示揽件和发往记录
return track.status <= 1001;
case 1002: // 运输中 - 显示所有运输中的记录
return track.status <= 1002;
case 1003: // 已签收 - 显示所有记录
return track.status <= 1003;
case 1004: // 拒收 - 显示所有记录
return track.status <= 1004;
default:
return true;
}
});
}, },
processExpressInfo(expressInfo) {
const {
logisticsStatus,
shipmentTrack,
...rest
} = expressInfo;
const processedTrack = this.processShipmentTrack(shipmentTrack, logisticsStatus);
return {
...rest,
logisticsStatus,
logisticsStatusDesc: LOGISTICS_STATUS[logisticsStatus],
shipmentTrack: processedTrack
};
}
}
}); });
\ No newline at end of file \ No newline at end of file
<wxs module="goodItem" src="formatGoods.wxs"></wxs>
<view class="item"> <view class="item">
<TimeLine nodes="{{timelineData}}"/> <TimeLine nodes="{{logisticsData.shipmentTrack}}" height="{{height}}"/>
</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
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
"component": true, "component": true,
"usingComponents": { "usingComponents": {
"Express": "../Express/Express", "Express": "../Express/Express",
"Copy": "../Copy/Copy"
"Expressage":"../Expressage/Expressage"
} }
} }
\ No newline at end of file \ No newline at end of file
.popup-content { .popup-content {
padding: 0 32rpx; padding: 0 32rpx;
.express-info { .express-info {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
height: 88rpx; height: 88rpx;
border-bottom: 1px solid #eff0f2; border-bottom: 1px solid #eff0f2;
.express-info-item { .express-info-item {
display: flex; display: flex;
gap: 6rpx; gap: 6rpx;
...@@ -12,6 +14,7 @@ ...@@ -12,6 +14,7 @@
font-weight: 400; font-weight: 400;
font-size: 28rpx; font-size: 28rpx;
color: #333435; color: #333435;
.logo { .logo {
width: 32rpx; width: 32rpx;
height: 32rpx; height: 32rpx;
...@@ -21,4 +24,10 @@ ...@@ -21,4 +24,10 @@
} }
} }
} }
.line {
width: 670rpx;
height: 2rpx;
background: #EFF0F2;
}
} }
\ No newline at end of file \ No newline at end of file
<popup show="{{showExpress}}" show-close-button="{{true}}" showFooter="{{false}}" headerColor="#F7F7F7" title="物流详情" bindconfirm="onConfirmPopup"> <popup show="{{showExpress}}" show-close-button="{{true}}" showFooter="{{false}}" headerColor="#F7F7F7" title="物流详情" bindconfirm="onConfirmPopup">
<view class="popup-content"> <view class="popup-content">
<view class="express-info"> <Expressage expressInfo="{{expressInfo}}"></Expressage>
<view class="express-info-item"> <view class="line"></view>
<view class="logo"> <Express expressInfo="{{expressInfo}}" showExpress="{{showExpress}} "height="980rpx" />
<glsx-image src="{{expressInfo.logo||'https://picsum.photos/200/200'}}" />
</view>
<text>{{expressInfo.expressName||"顺丰快递"}}</text>
<text>{{expressInfo.shipmentCode||'SF12222222222222'}}</text>
</view>
<view class="express-info-item">
<Copy />
</view>
</view>
<Express shipmentTrack="{{expressInfo.shipmentTrack}}" />
</view> </view>
</popup> </popup>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/components/Expressage/Expressage.js
Component({
/**
* 组件的属性列表
*/
properties: {
expressInfo:{
type: Object,
value: {}
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {
"Copy": "../Copy/Copy"
}
}
\ No newline at end of file \ No newline at end of file
.express-info {
display: flex;
justify-content: space-between;
height: 88rpx;
.express-info-item {
display: flex;
gap: 6rpx;
align-items: center;
font-weight: 400;
font-size: 28rpx;
color: #333435;
.logo {
width: 32rpx;
height: 32rpx;
border-radius: 50%;
overflow: hidden;
transform: translateY(1rpx);
}
}
}
\ No newline at end of file \ No newline at end of file
<view class="express-info">
<view class="express-info-item">
<view class="logo">
<glsx-image src="{{expressInfo.logo||'https://picsum.photos/200/200'}}" />
</view>
<text>{{expressInfo.expressName||"顺丰快递"}}</text>
<text>{{expressInfo.shipmentCode||'SF12222222222222'}}</text>
</view>
<view class="express-info-item">
<Copy />
</view>
</view>
\ No newline at end of file \ No newline at end of file
<view class="title">发货信息</view> <view class="title">发货信息</view>
<view class="item"> <view class="item">
<view class="label">收货地址:</view> <view class="label">收货地址:</view>
<view class="value">{{orderInfo.deliveryCompany || ''}}{{orderInfo.deliveryNumber || ''}}</view> <view class="value">{{orderInfo.receiveAddress || ''}}
<view class="value">{{orderInfo.receviveInfo || ''}}</view>
</view>
</view> </view>
\ No newline at end of file \ No newline at end of file
// packageMine/pages/order/detail/components/WaitDeliver/WaitDeliver.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
\ No newline at end of file \ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file \ No newline at end of file
.dispatched-box {
display: flex;
align-items: center;
.wait-icon {
width: 32px;
height: 32px;
margin-right: 10rpx;
}
.dispatched-txt {
font-weight: 500;
font-size: 36rpx;
color: #282829;
.info {
font-weight: 400;
font-size: 24rpx;
color: #656566;
margin-top: 8rpx;
}
}
}
\ No newline at end of file \ No newline at end of file
<!--packageMine/pages/order/detail/components/WaitDeliver/WaitDeliver.wxml-->
<view class="dispatched-box">
<glsx-image webp class="wait-icon" src="/status/loading.png"></glsx-image>
<view class="dispatched-txt">
待发货
<view class="info">等待商家发货</view>
</view>
</view>
\ No newline at end of file \ No newline at end of file
...@@ -28,15 +28,12 @@ Page({ ...@@ -28,15 +28,12 @@ Page({
"expressName": "圆通速递", "expressName": "圆通速递",
"shipmentCode": "1231231231dfsdgs", "shipmentCode": "1231231231dfsdgs",
"logisticsStatus": 1003, "logisticsStatus": 1003,
"shipmentItems": [ "shipmentItems": [{
{
"goodsSkuCode": "1125899906842634", "goodsSkuCode": "1125899906842634",
"goodsSkuName": "松下家用微电脑电饭煲SR-MGT108可预约1-4人多功能煮饭电饭锅3L SR-MGT108 银色 ", "goodsSkuName": "松下家用微电脑电饭煲SR-MGT108可预约1-4人多功能煮饭电饭锅3L SR-MGT108 银色 ",
"qty": 1 "qty": 1
} }],
], "shipmentTrack": [{
"shipmentTrack": [
{
"content": "已签收,签收人凭取货码签收。", "content": "已签收,签收人凭取货码签收。",
"operateTime": "2019-10-21 17:59:18", "operateTime": "2019-10-21 17:59:18",
"operator": "Operator" "operator": "Operator"
...@@ -144,11 +141,14 @@ Page({ ...@@ -144,11 +141,14 @@ Page({
onLoad: function (options) { onLoad: function (options) {
wx.p.router.getRouterParams(options).then(params => { wx.p.router.getRouterParams(options).then(params => {
if (params.item) { if (params.item) {
// 订单信息
this.setData({ this.setData({
orderInfo: params.item orderInfo: params.item
}) })
//物流信息
this.queryLogistics() this.queryLogistics()
// this.getOrderDetail(params.orderCode); //用来获取发货信息
this.getOrderDetail(params.item.subOrderCode);
} }
this.setData({ this.setData({
Status: OrderStatus[this.data.orderInfo.orderStatus], Status: OrderStatus[this.data.orderInfo.orderStatus],
...@@ -160,7 +160,7 @@ Page({ ...@@ -160,7 +160,7 @@ Page({
subOrderCode subOrderCode
} = this.data.orderInfo } = this.data.orderInfo
let params = { let params = {
subOrderCode: 'GLS961872388671414272' subOrderCode,
} }
wx.p.api.shopmallApi.queryLogistics(params).then((data) => { wx.p.api.shopmallApi.queryLogistics(params).then((data) => {
console.log(data, '物流信息') console.log(data, '物流信息')
...@@ -170,27 +170,33 @@ Page({ ...@@ -170,27 +170,33 @@ Page({
}) })
}, },
getOrderDetail(orderCode) { getOrderDetail(orderCode) {
console.log(orderCode, 7777)
let { let {
orderObj orderInfo
} = this.data; } = this.data;
wx.p.wxApi.showLoading("加载中..."); wx.p.wxApi.showLoading("加载中...");
let params = { let params = {
subOrderCode: orderCode subOrderCode: orderCode
} }
wx.p.api.shopmallApi.getOrderDetail(params).then((data) => { wx.p.api.shopmallApi.getOrderDetail(params).then((data) => {
console.log(data, 999999999999999999999)
wx.hideLoading(); wx.hideLoading();
console.log(data); let {
data.time = new Date(iosTimeFormat(data.createdDate)).format( provinceName,
"yyyy.MM.dd hh:mm:ss" cityName,
); countyName,
address,
receiveName,
receiveMobile
} = data.receiveAddress
this.setData({ this.setData({
orderInfo: data, orderInfo: {
orderObj, ...orderInfo,
receiveAddress: provinceName + cityName + countyName + address,
receviveInfo: receiveName + receiveMobile
}
}) })
}); });
}, },
toDetail() { toDetail() {
......
...@@ -10,6 +10,8 @@ ...@@ -10,6 +10,8 @@
"OrderAmount": "./components/OrderAmount/OrderAmount", "OrderAmount": "./components/OrderAmount/OrderAmount",
"content": "/packageMine/pages/order/index/components/Content/Content", "content": "/packageMine/pages/order/index/components/Content/Content",
"Express": "../components/Express/Express", "Express": "../components/Express/Express",
"Expresspop": "../components/ExpressPop/ExpressPop" "Expresspop": "../components/ExpressPop/ExpressPop",
"WaitDeliver" :"./components/WaitDeliver/WaitDeliver",
"Expressage":"../components/Expressage/Expressage"
} }
} }
\ No newline at end of file \ No newline at end of file
<block wx:if="{{orderInfo}}"> <block wx:if="{{orderInfo}}">
<view class="layout"> <view class="layout">
<BlockBox> <!-- <BlockBox>
<Status title="{{Status.title}}" image="{{Status.image}}" tips="{{Status.tips}}"></Status> <Status title="{{Status.title}}" image="{{Status.image}}" tips="{{Status.tips}}"></Status>
</BlockBox> -->
<!-- 云中鹤的有物流信息 -->
<BlockBox wx:if="{{orderInfo.goodsSource==1||!orderInfo.goodsSource}}">
<view class="express-box" bindtap="showExpressPop" wx:if="{{expressInfo}}">
<view class="express-detail">物流详情 <mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon>
</view>
<Express expressInfo="{{expressInfo}}" />
</view>
<WaitDeliver wx:else></WaitDeliver>
</BlockBox> </BlockBox>
<BlockBox> <!-- 自营商品展示快递信息 -->
<DeliveryInfo orderInfo="{{orderInfo}}" deliveryStatus="{{deliveryStatus}}"></DeliveryInfo> <BlockBox wx:if="{{orderInfo.goodsSource==2}}">
<Expressage expressInfo="{{expressInfo}}" wx:if="{{expressInfo}}"></Expressage>
<WaitDeliver wx:else></WaitDeliver>
</BlockBox> </BlockBox>
<BlockBox> <BlockBox>
<view class="express-box" bindtap="showExpressPop"> <DeliveryInfo orderInfo="{{orderInfo}}" deliveryStatus="{{deliveryStatus}}"></DeliveryInfo>
<view class="express-detail" >物流详情 <mp-icon icon="arrow" color="var(--btnColor)" size="{{11}}"></mp-icon></view>
<Express shipmentTrack="{{expressInfo.shipmentTrack}}"/>
</view>
</BlockBox> </BlockBox>
<BlockBox> <BlockBox>
<OrderInfo orderInfo="{{orderInfo}}" orderObj="{{orderObj}}" statusEnum="{{statusEnum}}"></OrderInfo> <OrderInfo orderInfo="{{orderInfo}}" orderObj="{{orderObj}}" statusEnum="{{statusEnum}}"></OrderInfo>
...@@ -19,6 +27,6 @@ ...@@ -19,6 +27,6 @@
<content item="{{orderInfo}}" /> <content item="{{orderInfo}}" />
</BlockBox> --> </BlockBox> -->
<Expresspop showExpress="{{isShowExpressPop}}" expressInfo="{{expressInfo}}"/> <Expresspop showExpress="{{isShowExpressPop}}" expressInfo="{{expressInfo}}" />
</view> </view>
</block> </block>
\ No newline at end of file \ No newline at end of file
...@@ -58,7 +58,7 @@ Component({ ...@@ -58,7 +58,7 @@ Component({
if ([1007].includes(orderStatus) && (!cancelStatus || cancelStatus == 1010)) { if ([1007].includes(orderStatus) && (!cancelStatus || cancelStatus == 1010)) {
// 按钮:售后(去掉) // 按钮:售后(去掉)
return OrderStatusEnum.WAIT_DELIVER //待发货 order_status属于(1002,1006,1007)且cancel_status不存在或者审核中(1010) return OrderStatusEnum.WAIT_DELIVER //待发货 order_status属于(1002,1006,1007)且cancel_status不存在或者审核中(1010)
} else if ([1002, 1006, 1007,1008].includes(orderStatus)&& (!cancelStatus || cancelStatus == 1010)) { } else if ([1002, 1006, 1007, 1008].includes(orderStatus) && (!cancelStatus || cancelStatus == 1010)) {
// 确认收货,查看物流 // 确认收货,查看物流
return OrderStatusEnum.WAIT_RECEIVE //待收货 order_status属于(1008)且cancel_status不存在或者审核中(1010) return OrderStatusEnum.WAIT_RECEIVE //待收货 order_status属于(1008)且cancel_status不存在或者审核中(1010)
} else if (orderStatus == 1009 && (!cancelStatus || cancelStatus == 1010)) { } else if (orderStatus == 1009 && (!cancelStatus || cancelStatus == 1010)) {
...@@ -77,7 +77,7 @@ Component({ ...@@ -77,7 +77,7 @@ Component({
return OrderStatusEnum.AFTER_SALE_REFUNDED // 已退款 退款退货的订单return_order_status:1003:已退款且return_status退换货状态(1002:已收货,1003:已退款),仅退款订单 return_order_status:1003:已退款且refund_status 退款状态1002:已退款, return OrderStatusEnum.AFTER_SALE_REFUNDED // 已退款 退款退货的订单return_order_status:1003:已退款且return_status退换货状态(1002:已收货,1003:已退款),仅退款订单 return_order_status:1003:已退款且refund_status 退款状态1002:已退款,
} else if ((returnOrderStatus == 1003 && returnStatus == 1006) || (returnOrderStatus == 1003 && refundStatus == 1004)) { } else if ((returnOrderStatus == 1003 && returnStatus == 1006) || (returnOrderStatus == 1003 && refundStatus == 1004)) {
return OrderStatusEnum.AFTER_SALE_REFUNDED_FAILED // 退款失败 退款退货的return_order_status:1003:已退款 return_status退换货状态(1006:退款异常 ,,仅退款的return_order_status:1003:已退款 且refund_status 退款状态,1004:退款异常 return OrderStatusEnum.AFTER_SALE_REFUNDED_FAILED // 退款失败 退款退货的return_order_status:1003:已退款 return_status退换货状态(1006:退款异常 ,,仅退款的return_order_status:1003:已退款 且refund_status 退款状态,1004:退款异常
}else { } else {
return OrderStatusEnum.AFTER_SALE_REVEAL //其他兜底的状态 return OrderStatusEnum.AFTER_SALE_REVEAL //其他兜底的状态
} }
}, },
...@@ -86,14 +86,14 @@ Component({ ...@@ -86,14 +86,14 @@ Component({
// 更新按钮 // 更新按钮
updateButtons() { updateButtons() {
console.log(this.orderStatus(),this.data.item,99999888) console.log(this.orderStatus(), this.data.item, 99999888)
let { let {
goodsSource goodsSource
} = this.data.item, } = this.data.item,
orderButtons = ORDER_STATUS[this.orderStatus()].buttons; orderButtons = ORDER_STATUS[this.orderStatus()].buttons;
// goodsSource ==null 默认云中鹤 // goodsSource ==null 默认云中鹤
this.setData({ this.setData({
buttons:orderButtons ? orderButtons[goodsSource ? goodsSource : 1] : [], buttons: orderButtons ? orderButtons[goodsSource ? goodsSource : 1] : [],
orderItem: this.data.item, orderItem: this.data.item,
}); });
}, },
...@@ -104,8 +104,9 @@ Component({ ...@@ -104,8 +104,9 @@ Component({
index index
} = e.currentTarget.dataset; } = e.currentTarget.dataset;
const button = this.data.buttons[index]; const button = this.data.buttons[index];
console.log(button)
if (button && button.handler) { if (button && button.handler) {
button.handler(e); this[button.handler](e);
} }
}, },
...@@ -197,18 +198,22 @@ Component({ ...@@ -197,18 +198,22 @@ Component({
// 售后 // 售后
onAfterSale(e) { onAfterSale(e) {
console.log(e)
let { let {
item: { item: {
orderCode, subOrderCode,
payPrice, redeemPoints,
goodsNumber goodsSource,
sellQty,
applyQty
}, },
} = e.currentTarget.dataset; } = e.currentTarget.dataset;
wx.p.router.go( wx.p.router.go(
"/packageMine/pages/order/afterSale_step_two/afterSale_step_two", { "/packageMine/pages/order/afterSale_step_two/afterSale_step_two", {
orderCode, subOrderCode,
refundPrice: payPrice, refundPoints:redeemPoints,
refundCount: goodsNumber, goodsSource,
applyQty: sellQty||applyQty,
} }
); );
}, },
......
...@@ -89,13 +89,13 @@ Page({ ...@@ -89,13 +89,13 @@ Page({
tabIndex: index, tabIndex: index,
requestType requestType
}); });
this.getOrderList() // this.getOrderList()
// this.clearData(); // 注释掉实际的API调用,使用硬编码数据 this.clearData(); // 注释掉实际的API调用,使用硬编码数据
}); });
}, },
onShow() { onShow() {
// if (this.refresh) this.clearData(); if (this.refresh) this.clearData();
if (this.refresh) this.getOrderList(); // if (this.refresh) this.getOrderList();
}, },
onHide() { onHide() {
this.refresh = true; this.refresh = true;
...@@ -109,14 +109,14 @@ Page({ ...@@ -109,14 +109,14 @@ Page({
nothing: false, nothing: false,
pageNum: 1, pageNum: 1,
}); });
// this.getOrderList(); // 注释掉实际的API调用,使用硬编码数据 this.getOrderList(); // 注释掉实际的API调用,使用硬编码数据
this.setData({ this.setData({
listFlag: true, listFlag: true,
}); });
}, },
search() { search() {
this.getOrderList() // this.getOrderList()
// this.clearData(); this.clearData();
}, },
clear() { clear() {
this.setData({ this.setData({
...@@ -250,8 +250,8 @@ Page({ ...@@ -250,8 +250,8 @@ Page({
wx.p.api.equityApi.comfirmRevice(para).then((res) => { wx.p.api.equityApi.comfirmRevice(para).then((res) => {
wx.p.wxApi.showToast("确认收货成功"); wx.p.wxApi.showToast("确认收货成功");
setTimeout(() => { setTimeout(() => {
// this.clearData(); this.clearData();
this.getOrderList() // this.getOrderList()
}, 1.5e3); }, 1.5e3);
}); });
} }
......
...@@ -16,6 +16,13 @@ ...@@ -16,6 +16,13 @@
"miniprogram": { "miniprogram": {
"list": [ "list": [
{ {
"name": "packageMine/pages/order/index/index",
"pathName": "packageMine/pages/order/index/index",
"query": "",
"scene": null,
"launchMode": "default"
},
{
"name": "pages/Login/Login", "name": "pages/Login/Login",
"pathName": "pages/Login/Login", "pathName": "pages/Login/Login",
"query": "", "query": "",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!