Commit 2ccaeaca by chenwq

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

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