Commit 2ccaeaca by chenwq

优化环境配置,更新域名和请求逻辑;调整编辑申请功能,支持重新发拍;修复车牌号字段的禁用逻辑;更新项目私有配置以启用 URL 检查

1 parent 47161e0d
import { preReleaseAppId } from '~/config'
const target = ['ip', 'dev', 'uat', 'prod', 'preRelease']
let envIndex = 1
let envIndex = 2
/**
*
......@@ -52,9 +52,9 @@ if (systemInfo.platform != 'devtools') {
const domain = {
ip: 'http://192.168.1.125:6906',
dev: 'http://192.168.1.125:6906',
uat: 'https://aus.test.glsx.com.cn',
preRelease: 'https://aus.beta.glsx.com.cn',
prod: 'https://aus.glsx.com.cn'
uat: 'https://aus-lot.test.glsx.com.cn',
preRelease: 'https://aus-lot.beta.glsx.com.cn',
prod: 'https://aus-lot.glsx.com.cn'
}[target[envIndex]]
const pathEnum = {
......
......@@ -43,17 +43,15 @@ Component({
type: Boolean,
value: false,
observer: function (newVal) {
// 根据 isEdit 状态设置车牌号字段的 disabled 属性
// const { secondObj } = this.data;
// const licensePlateField = secondObj.customerFormList.find(
// (item) => item.name === "licensePlate",
// );
// if (licensePlateField) {
// licensePlateField.disabled = newVal;
// this.setData({
// secondObj: secondObj,
// });
// }
const { secondObj } = this.data;
if (secondObj && secondObj.customerFormList) {
secondObj.customerFormList.forEach((item) => {
if (item.type && item.type !== 'title') {
item.disabled = !newVal;
}
});
this.setData({ secondObj });
}
},
},
},
......
......@@ -7,7 +7,11 @@ Page({
*/
data: {
title: "新增申请",
optType: "add", // add | edit
/** add
* edit
* republish 重新发拍,当发拍单的vehicleId 为null或者 为0的时候,需要进入编辑页面重新编辑,调用编辑保存接口保存即可
* */
optType: "add",
step: "first", // first | second | third | fourth
currentStep: 1, // 当前步骤:1-基本信息 | 2-车辆详情 | 3-价格设置 | 4-照片上传
isEdit: true,
......@@ -33,7 +37,7 @@ Page({
title: params.optType == "edit" ? "编辑申请" : "新增申请",
optType: params.optType || "add",
});
if (params.optType == "edit") {
if (params.optType != "add") {
this.getDetail();
}
});
......@@ -82,7 +86,7 @@ Page({
onShareAppMessage() {},
dealReturnData() {
let { formData } = this.data;
let { formData, optType } = this.data;
const selectAttrList = [
{
name: "transmissionType",
......@@ -108,11 +112,23 @@ Page({
selectAttrList.forEach((attr) => {
if (formData[attr.name]) {
formData[`${attr.name}Name`] = constantList[attr.listName].find(
(item) => item.value == formData[attr.name]
)?.name;
(item) => item.value == formData[attr.name],
)?.name;
}
});
formData.carCityName = formData.provinceName + " " + formData.cityName;
formData.carCityName = formData.provinceName + " " + formData.cityName;
if (optType == "republish") {
if (formData.vehicleId == null || formData.vehicleId == 0) {
this.setData({
optType: "edit",
title: "编辑申请",
});
} else {
this.setData({
isEdit: false,
});
}
}
this.setData({
formData,
});
......@@ -125,12 +141,12 @@ Page({
homeApi
.getAuctionDetail({ id })
.then((res) => {
wx.hideLoading();
this.setData({
formData: res || {},
});
this.dealReturnData();
console.log("获取详情:", res);
wx.hideLoading();
})
.catch(() => {
wx.hideLoading();
......@@ -204,13 +220,29 @@ Page({
*/
saveOrderData(actionType) {
if (this.data.isRequesting) return;
this.setData({ isRequesting: true });
const { formData, currentStep } = this.data;
const { formData, currentStep, optType } = this.data;
// 按需求:true=提交发拍,false=保存草稿/上一步/下一步
const isSubmit = actionType === "submit";
// 当 optType 为 republish 且不是最终提交时,只做本地步骤切换,不调用接口
if (optType === "republish" && !isSubmit) {
const stepMap = { 1: "first", 2: "second", 3: "third", 4: "fourth" };
if (actionType === "draft") {
wx.p.router.goHome();
} else if (actionType === "prev") {
const prevNum = currentStep - 1;
this.setData({ currentStep: prevNum, step: stepMap[prevNum] });
} else if (actionType === "next") {
const nextNum = currentStep + 1;
this.setData({ currentStep: nextNum, step: stepMap[nextNum] });
}
return;
}
this.setData({ isRequesting: true });
const params = {
...formData,
id: formData.id || null, // 假设数据里已经存有 id, 新增即为null
......
......@@ -43,7 +43,6 @@ Page({
onLoad(options) {
// let { height, padding_bottom } = wx.p.store.get("navBarSystem");
// this.setData({ navHeight: height });
this.getList();
},
navbarReady(e) {
let { height } = e.detail;
......@@ -57,6 +56,7 @@ Page({
selected: 0,
});
}
this.getList();
},
onSearchChange(e) {
this.setData({ keyword: e.detail });
......@@ -153,8 +153,10 @@ Page({
},
// 重新发拍
republish(e) {
const id = e.detail && e.detail.id ? e.detail.id : e.currentTarget.dataset.id;
wx.p.router.go(`/packageIndex/pages/editOrder/index/index?id=${id}`);
wx.p.router.go(`/packageIndex/pages/editOrder/index/index`, {
id: e.detail && e.detail.id ? e.detail.id : e.currentTarget.dataset.id,
optType: "republish",
});
},
// 新增发拍单
addAuction() {
......
......@@ -2,7 +2,7 @@
"libVersion": "3.15.2",
"projectname": "uplus-fapai-mp",
"setting": {
"urlCheck": false,
"urlCheck": true,
"coverView": true,
"lazyloadPlaceholderEnable": false,
"skylineRenderEnable": false,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!