Commit cde24afe by 前端

Merge branch 'SAAS+V5.7.9' into 'develop'

上线合并

See merge request !524
2 parents 0b8161bf 3aa29590
// tabWorkOrder/components/applyRefundBtn/applyRefundBtn.js // tabWorkOrder/components/applyRefundBtn/applyRefundBtn.js
import api from '~/api/api' import api from "~/api/api";
import qs from "~/utils/lib/qs";
Component({ Component({
/** /**
* 组件的属性列表 * 组件的属性列表
...@@ -7,7 +8,7 @@ Component({ ...@@ -7,7 +8,7 @@ Component({
properties: { properties: {
orderInfo: Object, orderInfo: Object,
showRefundBtn: Boolean, showRefundBtn: Boolean,
updateFlag: Boolean updateFlag: Boolean,
}, },
/** /**
...@@ -17,7 +18,7 @@ Component({ ...@@ -17,7 +18,7 @@ Component({
moreSelectData: [], moreSelectData: [],
showSelect: false, showSelect: false,
moreSelectIndex: null, moreSelectIndex: null,
areaOperationsFlag: false areaOperationsFlag: false,
}, },
/** /**
...@@ -26,144 +27,125 @@ Component({ ...@@ -26,144 +27,125 @@ Component({
methods: { methods: {
// 点击更多按钮 // 点击更多按钮
selectTap() { selectTap() {
let { orderInfo } = this.data let { orderInfo } = this.data;
let allOptions = [] let allOptions = [];
if (orderInfo.selectPayType == 2) { if (orderInfo.selectPayType == 2) {
// 门店收款订单查询退款可展示按钮 // 门店收款订单查询退款可展示按钮
allOptions = ['标记退款', '退款详情'] allOptions = ["标记退款", "退款详情"];
// 查询订单可展示按钮 // 查询订单可展示按钮
api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then(res => { api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then((res) => {
let { code, data } = res let { code, data } = res;
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
moreSelectData: this.filterMoreSelectData( moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton, allOptions, 1),
data.refundApplyButton, showSelect: !this.data.showSelect,
data.refundApplyDetailButton, });
allOptions,
1
),
showSelect: !this.data.showSelect
})
} }
}) });
} else { } else {
allOptions = ['申请退款', '退款详情'] allOptions = ["申请退款", "退款详情"];
// 查询订单可展示按钮 // 查询订单可展示按钮
api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then(res => { api.getMoreBtnAPI({ orderCode: orderInfo.orderCode }).then((res) => {
let { code, data } = res let { code, data } = res;
if (code == 0) { if (code == 0) {
this.setData({ this.setData({
moreSelectData: this.filterMoreSelectData( moreSelectData: this.filterMoreSelectData(data.refundApplyButton, data.refundApplyDetailButton, allOptions, 2),
data.refundApplyButton, showSelect: !this.data.showSelect,
data.refundApplyDetailButton, });
allOptions,
2
),
showSelect: !this.data.showSelect
})
} }
}) });
} }
}, },
filterMoreSelectData( filterMoreSelectData(refundApplyButton, refundApplyDetailButton, allOptions, num) {
refundApplyButton, const buttonType = num === 2 ? "申请退款" : "标记退款";
refundApplyDetailButton,
allOptions,
num
) {
const buttonType = num === 2 ? '申请退款' : '标记退款'
const conditions = { const conditions = {
[buttonType]: refundApplyButton === 'Y', [buttonType]: refundApplyButton === "Y",
退款详情: refundApplyDetailButton === 'Y' 退款详情: refundApplyDetailButton === "Y",
} };
return allOptions.filter(option => conditions[option]) return allOptions.filter((option) => conditions[option]);
}, },
closeSelect() { closeSelect() {
this.setData({ this.setData({
showSelect: false, showSelect: false,
moreSelectIndex: null moreSelectIndex: null,
}) });
}, },
tapConstruction() { tapConstruction() {
this.closeSelect() this.closeSelect();
let thisPage = wx.$router.getPageInstance() let thisPage = wx.$router.getPageInstance();
thisPage.setData({ thisPage.setData({
sublistVisible: true sublistVisible: true,
}) });
}, },
optionTap(e) { optionTap(e) {
let { index, item } = e.currentTarget.dataset let { index, item } = e.currentTarget.dataset;
let { orderInfo } = this.data let { orderInfo } = this.data;
let userInfo = wx.$util.getUserInfo() let userInfo = wx.$util.getUserInfo();
if (item == '申请退款' || item == '标记退款') { if (item == "申请退款" || item == "标记退款") {
// 申请退款点击埋点 // 申请退款点击埋点
if (item == '申请退款') if (item == "申请退款") wx.$track.setTrackData(0, "apply_refund_page", {}, "", 1);
wx.$track.setTrackData(0, 'apply_refund_page', {}, '', 1)
// 退款申请时区域运营查询 // 退款申请时区域运营查询
api api.areaSupervisionExistsAPI({
.areaSupervisionExistsAPI({
merchantId: userInfo.shopMerchantId, merchantId: userInfo.shopMerchantId,
sceneType: userInfo.sceneType sceneType: userInfo.sceneType,
}) }).then((res) => {
.then(res => { let { code, data, message } = res;
let { code, data, message } = res
if (code == 0) { if (code == 0) {
if (!data) { if (!data) {
return this.setData({ return this.setData({
areaOperationsFlag: true, areaOperationsFlag: true,
showSelect: !this.data.showSelect showSelect: !this.data.showSelect,
}) });
} else { } else {
wx.navigateTo({ wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?orderCode=${ url:
orderInfo.orderCode "/tabWorkOrder/pages/refundApply/refundApply?" +
}&shopMerchantName=${orderInfo.merchantName}&shopMerchantId=${ qs.stringify({
orderInfo.merchantId orderCode: orderInfo.orderCode,
}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}` shopMerchantName: orderInfo.merchantName,
}) shopMerchantId: orderInfo.merchantId,
this.closeSelect() refundPayType: orderInfo.selectPayType == 2 ? 2 : 1,
refundName: orderInfo.customerName,
}),
});
this.closeSelect();
} }
} else { } else {
return wx.$util.showToast(message) return wx.$util.showToast(message);
} }
}) });
} else { } else {
// 退款详情点击埋点 // 退款详情点击埋点
if (orderInfo?.selectPayType != 2) if (orderInfo?.selectPayType != 2) wx.$track.setTrackData(0, "refund_detail_page", {}, "", 1);
wx.$track.setTrackData(0, 'refund_detail_page', {}, '', 1)
// 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页 // 点击退款详情,判断是否存在多条退款申请记录,存在跳转列表页,不存在直接跳转详情页
api api.getRefundDetailListAPI({ orderCode: orderInfo.orderCode }).then((res) => {
.getRefundDetailListAPI({ orderCode: orderInfo.orderCode }) let { code, data } = res;
.then(res => {
let { code, data } = res
if (code == 0) { if (code == 0) {
if (data?.length > 1) { if (data?.length > 1) {
wx.navigateTo({ wx.navigateTo({
url: `/tabWorkOrder/pages/refundDetailList/refundDetailList?orderCode=${orderInfo.orderCode}` url: `/tabWorkOrder/pages/refundDetailList/refundDetailList?orderCode=${orderInfo.orderCode}`,
}) });
} else if (data.length == 1) { } else if (data.length == 1) {
wx.navigateTo({ wx.navigateTo({
url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${ url: `/tabWorkOrder/pages/refundApply/refundApply?applyCode=${data[0].applyCode}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`,
data[0].applyCode });
}&refundPayType=${orderInfo.selectPayType == 2 ? 2 : 1}`
})
} }
this.closeSelect() this.closeSelect();
} }
}) });
} }
this.setData({ this.setData({
moreSelectIndex: index moreSelectIndex: index,
// showSelect: !this.data.showSelect // showSelect: !this.data.showSelect
}) });
}, },
closeModal() { closeModal() {
this.setData({ this.setData({
areaOperationsFlag: false areaOperationsFlag: false,
}) });
} },
} },
}) });
...@@ -1349,7 +1349,7 @@ Page({ ...@@ -1349,7 +1349,7 @@ Page({
if (orderObj.orderType !== undefined && orderObj.orderType !== null) { if (orderObj.orderType !== undefined && orderObj.orderType !== null) {
orderObj.djOrderType = orderObj.orderType orderObj.djOrderType = orderObj.orderType
} else { } else {
orderObj.djOrderType = 0 orderObj.djOrderType = 1
} }
} }
......
...@@ -86,7 +86,7 @@ BaseStrategy.prototype.commonHandle = function (res) { ...@@ -86,7 +86,7 @@ BaseStrategy.prototype.commonHandle = function (res) {
// 1. 兼容初始化字段默认值 // 1. 兼容初始化字段默认值
if (res.djOrderType === undefined || res.djOrderType === null) { if (res.djOrderType === undefined || res.djOrderType === null) {
res.djOrderType = res.djOrderType =
res.orderType !== undefined && res.orderType !== null ? res.orderType : 0 res.orderType !== undefined && res.orderType !== null ? res.orderType : 1
} }
if (res.discountType === undefined || res.discountType === null) if (res.discountType === undefined || res.discountType === null)
res.discountType = 3 res.discountType = 3
......
...@@ -2,30 +2,30 @@ import api from "~/utils/request/request.js"; ...@@ -2,30 +2,30 @@ import api from "~/utils/request/request.js";
module.exports = { module.exports = {
// 退款申请流程状态栏 // 退款申请流程状态栏
getRefundStatusAPI(data) { getRefundStatusAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.audit.select', data) return api.post("dj.api.smartcarlife.refundApplyRecord.audit.select", data);
}, },
// 标记订单子订单详情查询 // 标记订单子订单详情查询
getSubOrderInfoAPI(data) { getSubOrderInfoAPI(data) {
return api.post('dj.api.smartcarlife.goodsOrder.goodsSubOrder.list', data) return api.post("dj.api.smartcarlife.goodsOrder.goodsSubOrder.list", data);
}, },
// 退款详情明细查询 // 退款详情明细查询
getRefundDetailInfoAPI(data) { getRefundDetailInfoAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.detail.select', data) return api.post("dj.api.smartcarlife.refundApplyRecord.detail.select", data);
}, },
// 发起退款申请 // 发起退款申请
applyRefundAPI(data) { applyRefundAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.add', data) return api.post("dj.api.smartcarlife.refundApplyRecord.add", data);
}, },
// 退款审核 // 退款审核
auditRefundAllpyAPI(data) { auditRefundAllpyAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.audit.update', data) return api.post("dj.api.smartcarlife.refundApplyRecord.audit.update", data);
}, },
// 根据主订单号获取退款成功记录 // 根据主订单号获取退款成功记录
getRefundLogByOrderCodeAPI(data) { getRefundLogByOrderCodeAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.refundedGoodsOrder.list', data) return api.post("dj.api.smartcarlife.refundApplyRecord.refundedGoodsOrder.list", data);
}, },
// 门店收款订单标记退款 // 门店收款订单标记退款
markAsRefundedAPI(data) { markAsRefundedAPI(data) {
return api.post('dj.api.smartcarlife.refundApplyRecord.offlinePay.add', data)
}
}
\ No newline at end of file \ No newline at end of file
return api.post("dj.api.smartcarlife.refundApplyRecord.offlinePay.add", data);
},
};
// tabWorkOrder/pages/refundApply/components/dialogInput.js
const EDIT_ICON = "/tabWorkOrder/images/editIcon.png";
Component({
properties: {
name: {
type: String,
value: "",
},
label: {
type: String,
value: "",
},
value: {
type: String,
value: "",
observer(nextValue) {
this.syncLocalValue(nextValue);
},
},
compareValue: {
type: String,
value: "",
observer(nextValue) {
this.syncCompareValue(nextValue);
},
},
placeholder: {
type: String,
value: "点击输入",
},
defaultTips: {
type: String,
value: "姓名自动带入工单完整姓名,如需修改可点击编辑",
},
warningTips: {
type: String,
value: "收款人与工单车主姓名不一致,若不一致请提供收款人付款凭证(如微信截图)",
},
tips: {
type: String,
value: "",
},
required: {
type: Boolean,
value: false,
},
disabled: {
type: Boolean,
value: false,
},
showBorder: {
type: Boolean,
value: true,
},
showEditIcon: {
type: Boolean,
value: true,
},
maxlength: {
type: Number,
value: 50,
},
type: {
type: String,
value: "text",
},
},
data: {
popupVisible: false,
localValue: "",
tempValue: "",
editBaseValue: "",
hasConfirmedEdit: false,
showChangedTips: false,
dialogValueChanged: false,
editIcon: EDIT_ICON,
},
lifetimes: {
attached() {
this.syncLocalValue(this.data.value);
this.syncCompareValue(this.data.compareValue);
},
},
methods: {
syncLocalValue(value) {
const normalizedValue = this.normalizeValue(value);
this.setData({
localValue: normalizedValue,
showChangedTips: this.data.hasConfirmedEdit ? normalizedValue !== this.data.editBaseValue : false,
});
},
normalizeValue(value) {
return value === undefined || value === null ? "" : String(value);
},
syncCompareValue(compareValue) {
const normalizedCompareValue = this.normalizeValue(compareValue);
this.setData({
editBaseValue: normalizedCompareValue,
showChangedTips: this.data.hasConfirmedEdit ? this.data.localValue !== normalizedCompareValue : false,
dialogValueChanged: this.data.popupVisible && this.data.tempValue !== normalizedCompareValue,
});
},
buildDetail(value) {
return {
name: this.data.name,
label: this.data.label,
value,
};
},
handleActivateEdit() {
if (this.data.disabled) return;
this.setData({
popupVisible: true,
tempValue: this.data.localValue,
dialogValueChanged: this.data.localValue !== this.data.editBaseValue,
});
this.triggerEvent("edit", this.buildDetail(this.data.localValue));
},
handleEditIconTap() {
this.handleActivateEdit();
},
handleDialogInput(e) {
const value = this.normalizeValue(e.detail.value);
this.setData({
tempValue: value,
dialogValueChanged: value !== this.data.editBaseValue,
});
},
noScroll() {},
handleClosePopup() {
this.setData({
popupVisible: false,
tempValue: this.data.localValue,
dialogValueChanged: false,
});
},
handleConfirmChange() {
const value = this.normalizeValue(this.data.tempValue).trim();
if (this.data.required && !value) {
const message = `${this.data.label || "当前字段"}不能为空`;
if (wx?.$util?.showToast) {
wx.$util.showToast(message);
} else {
wx.showToast({
title: message,
icon: "none",
});
}
return;
}
this.setData({
popupVisible: false,
hasConfirmedEdit: true,
localValue: value,
tempValue: value,
showChangedTips: value !== this.data.editBaseValue,
// Keep the dialog warning state until the popup fully closes
// to avoid a visual flicker on the confirm click.
dialogValueChanged: value !== this.data.editBaseValue,
});
this.triggerEvent("confirm", this.buildDetail(value));
},
},
});
{
"component": true,
"usingComponents": {
"van-dialog": "@vant/weapp/dialog/index",
"van-icon": "@vant/weapp/icon/index"
}
}
/* tabWorkOrder/pages/refundApply/components/dialogInput.wxss */
.dialog-input {
padding: var(--fontSize24) var(--fontSize40);
background: #ffffff;
box-sizing: border-box;
&--border {
border-bottom: 1px solid #eff0f2;
}
&__content {
display: flex;
flex-direction: column;
}
&__title {
display: flex;
align-items: center;
margin-bottom: var(--fontSize12);
}
&__label {
color: #292d33;
font-size: var(--fontSize28);
line-height: var(--fontSize40);
}
&__required {
margin-left: var(--fontSize8);
color: #f00;
font-size: var(--fontSize20);
line-height: 1;
}
&__field {
display: flex;
align-items: center;
height: var(--fontSize72);
padding: 0 var(--fontSize24);
border: 1px solid #eff0f2;
border-radius: var(--fontSize16);
background: #ffffff;
box-sizing: border-box;
}
&__field--disabled {
background: #f7f8fa;
}
&__text {
flex: 1;
min-width: 0;
color: #292d33;
font-size: var(--fontSize28);
line-height: var(--fontSize40);
}
&__text {
display: block;
line-height: var(--fontSize72);
word-break: break-all;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
&__text--placeholder {
color: #999ea8;
}
&__placeholder {
color: #999ea8;
font-size: var(--fontSize28);
}
&__icon {
width: var(--fontSize32);
height: var(--fontSize32);
margin-left: var(--fontSize12);
flex-shrink: 0;
}
&__tips {
margin-top: var(--fontSize12);
color: #999ea8;
font-size: var(--fontSize24);
font-weight: 400;
line-height: var(--fontSize32);
}
&__dialog-title {
padding: 0 0 var(--fontSize40);
color: #292d33;
font-size: var(--fontSize32);
font-weight: 500;
line-height: var(--fontSize48);
text-align: center;
}
&__dialog-body {
padding: var(--fontSize48);
border-top: 1px solid #ebedf0;
border-bottom: 1px solid #ebedf0;
}
&__dialog-form {
display: flex;
flex-direction: column;
gap: var(--fontSize12);
}
&__dialog-label-row {
display: flex;
align-items: center;
gap: var(--fontSize8);
}
&__dialog-label {
color: #292d33;
font-size: var(--fontSize28);
line-height: var(--fontSize40);
}
&__dialog-required {
color: #ef4444;
font-size: var(--fontSize20);
line-height: 1;
}
&__dialog-input-wrap {
display: flex;
align-items: center;
height: var(--fontSize72);
padding: 0 var(--fontSize24);
background: #ffffff;
border: 1px solid #eff0f2;
border-radius: var(--fontSize16);
box-sizing: border-box;
}
&__dialog-input {
width: 100%;
height: 100%;
color: #292d33;
font-size: var(--fontSize28);
line-height: var(--fontSize72);
}
&__dialog-alert {
display: flex;
align-items: flex-start;
padding: var(--fontSize10) var(--fontSize24);
background: #fff7ed;
border-radius: var(--fontSize12);
box-sizing: border-box;
}
&__outer-alert {
margin-top: var(--fontSize12);
}
&__dialog-alert-icon {
position: relative;
width: var(--fontSize28);
height: var(--fontSize28);
margin-right: var(--fontSize8);
flex-shrink: 0;
border-radius: 50%;
background: #f59e0b;
}
&__dialog-alert-line {
position: absolute;
top: 6px;
left: 50%;
width: 2px;
height: 8px;
background: #ffffff;
border-radius: 1px;
transform: translateX(-50%);
}
&__dialog-alert-dot {
position: absolute;
bottom: 5px;
left: 50%;
width: 3px;
height: 3px;
background: #ffffff;
border-radius: 50%;
transform: translateX(-50%);
}
&__dialog-alert-text {
flex: 1;
flex-shrink: 0;
color: #f59e0b;
font-size: var(--fontSize24);
line-height: var(--fontSize32);
word-break: break-all;
margin-left: var(--fontSize8);
}
&__dialog-footer-btn {
flex: 1;
flex-shrink: 0;
height: var(--fontSize96);
color: #3b82f6;
font-size: var(--fontSize32);
font-weight: 500;
line-height: var(--fontSize96);
text-align: center;
}
&__dialog-footer-btn--close {
color: #292d33;
font-weight: 400;
}
}
<view class="dialog-input {{ showBorder ? 'dialog-input--border' : '' }}">
<view class="dialog-input__content">
<view class="dialog-input__title">
<text class="dialog-input__label">{{ label }}</text><text wx:if="{{ required }}" class="dialog-input__required">*</text>
</view>
<view class="dialog-input__field {{ disabled ? 'dialog-input__field--disabled' : '' }}">
<text class="dialog-input__text {{ !localValue ? 'dialog-input__text--placeholder' : '' }}">{{ localValue || placeholder }}</text>
<image wx:if="{{ showEditIcon && !disabled }}"
class="dialog-input__icon"
src="{{ editIcon }}"
mode="aspectFit"
catchtap="handleEditIconTap" />
</view>
<view wx:if="{{ showChangedTips && warningTips }}"
class="dialog-input__dialog-alert dialog-input__outer-alert">
<van-icon name="warning" color="#FF9D0A" /><text class="dialog-input__dialog-alert-text">{{ warningTips }}</text>
</view>
<text wx:else class="dialog-input__tips">{{ defaultTips }}</text>
</view>
</view>
<van-dialog use-slot
use-title-slot
use-confirm-button-slot
use-cancel-button-slot
show-cancel-button
show="{{ popupVisible }}"
width="var(--fontSize622)"
custom-class="dialog-input__van-dialog"
lock-scroll
catchtouchmove="noScroll"
close-on-click-overlay="{{ false }}"
bind:close="handleClosePopup">
<view slot="title" class="dialog-input__dialog-title">
修改{{ label }}
</view>
<view class="dialog-input__dialog-body">
<view class="dialog-input__dialog-form">
<view class="dialog-input__dialog-label-row">
<text class="dialog-input__dialog-label">{{ label }}</text><text wx:if="{{ required }}" class="dialog-input__dialog-required">*</text>
</view>
<view class="dialog-input__dialog-input-wrap">
<input class="dialog-input__dialog-input"
type="{{ type }}"
value="{{ tempValue }}"
maxlength="{{ maxlength }}"
placeholder="{{ placeholder }}"
placeholder-class="dialog-input__placeholder"
focus
bindinput="handleDialogInput"
always-embed />
</view>
<view wx:if="{{ dialogValueChanged && warningTips }}"
class="dialog-input__dialog-alert">
<van-icon name="warning" color="#FF9D0A" /><text class="dialog-input__dialog-alert-text">{{ warningTips }}</text>
</view>
</view>
</view>
<view slot="cancel-button"
class="dialog-input__dialog-footer-btn dialog-input__dialog-footer-btn--close"
bindtap="handleClosePopup">
关闭
</view>
<view slot="confirm-button"
class="dialog-input__dialog-footer-btn"
bindtap="handleConfirmChange">
确认修改
</view>
</van-dialog>
...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
"usingComponents": { "usingComponents": {
"review-status": "./components/reviewStatus/reviewStatus", "review-status": "./components/reviewStatus/reviewStatus",
"van-loading": "@vant/weapp/loading/index", "van-loading": "@vant/weapp/loading/index",
"van-collapse": "@vant/weapp/collapse/index",
"van-collapse-item": "@vant/weapp/collapse-item/index",
"van-image": "@vant/weapp/image/index",
"dialog-input": "./components/dialogInput/dialogInput",
"label-refund-status": "./components/labelRefundStatus/labelRefundStatus" "label-refund-status": "./components/labelRefundStatus/labelRefundStatus"
} }
} }
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!