diff --git a/App.vue b/App.vue
index d612907..df2cc9c 100644
--- a/App.vue
+++ b/App.vue
@@ -264,6 +264,8 @@
// 模拟微信登录(仅用于本地测试)
mockAccountLogin(username, password) {
+ // uni.setStorageSync('token', "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwczovL3h1a291c2h1bml1LjExNS5sYW5neWUubmV0L2FwaS9jdXN0b21lci9sb2dpbi1ieS13ZWNoYXQtY29kZSIsImlhdCI6MTc2OTM4OTc4NiwiZXhwIjoxNzY5MzkzMzg2LCJuYmYiOjE3NjkzODk3ODYsImp0aSI6IjRTM085ZlF4RTF0bkhOeFoiLCJzdWIiOiIxNiIsInBydiI6IjFkMGEwMjBhY2Y1YzRiNmM0OTc5ODlkZjFhYmYwZmJkNGU4YzhkNjMifQ.FA77-z6ETJqbsN2O7RD-xcR9NsKVxkk3GN5GGeJBu8g")
+ // return;
uni.request({
url: API.LOGIN_ACCOUNT,
method: 'GET',
diff --git a/config/index.js b/config/index.js
index 3b3fd2e..4e05df9 100644
--- a/config/index.js
+++ b/config/index.js
@@ -36,7 +36,8 @@ export const API = {
GET_DAILY_RESERVATION_DEADLINE: `${BASE_URL}/api/customer/setting/get-daily-reservation-deadline`,
GET_GEOFENCE_BY_DIRECTION: `${BASE_URL}/api/customer/geofence/get-by-direction`,
GET_WATER_LEVEL: `${BASE_URL}/api/customer/setting/get-water-level`,
- GET_UNIT_PRICE: `${BASE_URL}/api/customer/setting/get-unit-price`,
+ // GET_UNIT_PRICE: `${BASE_URL}/api/customer/setting/get-unit-price`,
+ GET_UNIT_PRICE: `${BASE_URL}/api/customer/setting/get-price`,
GET_SHIP_INSPECTION_EXAMPLES: `${BASE_URL}/api/customer/setting/get-ship-inspection-examples`,
PROFILE_SEND_PHONE_CODE: `${BASE_URL}/api/customer/profile/send-phone-code`,
}
\ No newline at end of file
diff --git a/pages.json b/pages.json
index 6603d76..6d79b07 100644
--- a/pages.json
+++ b/pages.json
@@ -183,4 +183,4 @@
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
}
-}
\ No newline at end of file
+}
diff --git a/pages/index/ship_add.vue b/pages/index/ship_add.vue
index de8bce5..b361018 100644
--- a/pages/index/ship_add.vue
+++ b/pages/index/ship_add.vue
@@ -98,10 +98,12 @@
/>
吨
-
+
总长度
@@ -419,8 +421,7 @@ export default {
};
},
onLoad(options) {
- // 获取单价和计算规则
- this.fetchUnitPrice();
+
this.fetchShipInspectionExample();
// 获取船舶属性枚举
this.fetchShipPropertyEnum().then((success) => {
@@ -435,6 +436,8 @@ export default {
// 编辑模式:优先通过 id 从后端获取详情
if (options && options.edit === "1") {
this.isEdit = true;
+ // 获取单价和计算规则
+ // this.fetchUnitPrice();
if (options.id) {
// 通过 id 请求详情
this.fetchShipDetailForEdit(options.id);
@@ -494,18 +497,16 @@ export default {
});
if (res.data && res.data.errcode === 0) {
const data = res.data.data;
- this.unitPrice = data.unit_price || "";
- this.calculationDescription = data.calculation_description || "";
+ this.unitPrice = data.price || "";
+ this.calculationDescription = data.price_desc || "";
}
},
// 计算单次过闸收费
- totalPriceText() {
- const unit = Number(this.unitPrice);
- const ton = Number(this.form?.ton);
- if (isNaN(unit) || isNaN(ton)) return "-";
- const total = (unit * ton).toFixed(2);
- return `${total}元(单价${unit} * 载重${ton}吨)`;
- },
+ // totalPriceText() {
+ // const unit = Number(this.unitPrice);
+ // if (isNaN(unit)) return "-";
+ // return `${unit}元(${this.calculationDescription})`;
+ // },
async fetchShipInspectionExample() {
const token = uni.getStorageSync("token");
if (!token) {
diff --git a/pages/index/ship_detail.vue b/pages/index/ship_detail.vue
index e3ac6e2..915c738 100644
--- a/pages/index/ship_detail.vue
+++ b/pages/index/ship_detail.vue
@@ -14,7 +14,11 @@
船舶参数
载重吨位{{ ship.total_tonnage }}
- 单次过闸收费{{ totalPriceText() }}
+ 单次过闸收费
+
+ {{ unitPrice }}元{{ calculationDescription }}
+
+
总长度{{ ship.total_length }}
总宽{{ ship.total_width }}
型深{{ ship.molded_depth }}
@@ -109,18 +113,18 @@ export default {
})
if (res.data && res.data.errcode === 0) {
const data = res.data.data;
- this.unitPrice = data.unit_price || '';
- this.calculationDescription = data.calculation_description || '';
+ this.unitPrice = data.price || '';
+ this.calculationDescription = data.price_desc || '';
}
},
// 计算单次过闸收费
- totalPriceText() {
- const unit = Number(this.unitPrice);
- const ton = Number(this.ship?.total_tonnage);
- if (isNaN(unit) || isNaN(ton)) return '-';
- const total = (unit * ton).toFixed(2);
- return `${total}元(单价${unit} * 载重${ton}吨)`;
- },
+ // totalPriceText() {
+ // const unit = Number(this.unitPrice);
+ // // const ton = Number(this.ship?.total_tonnage);
+ // if (isNaN(unit)) return '-';
+ // // const total = (unit * ton).toFixed(2);
+ // return `${unit}元(${this.calculationDescription})`;
+ // },
getShipTypeName(type) {
if (!Array.isArray(this.shipTypeEnum)) return type;
const found = this.shipTypeEnum.find(item => item.value === type?.toString());
diff --git a/pages/order/pay_order_detail.vue b/pages/order/pay_order_detail.vue
index eb33721..232f33f 100644
--- a/pages/order/pay_order_detail.vue
+++ b/pages/order/pay_order_detail.vue
@@ -67,7 +67,9 @@
>
单次过闸收费
- {{ totalPriceText() }}
+
+ {{ unitPrice }}元{{ calculationDescription }}
+
类型
单次过闸收费
- {{ totalPriceText() }}
+
+ {{ unitPrice }}元{{ calculationDescription }}
+
类型
@@ -182,20 +184,18 @@ export default {
})
if (res.data && res.data.errcode === 0) {
const data = res.data.data;
- this.unitPrice = data.unit_price || '';
- this.calculationDescription = data.calculation_description || '';
+ this.unitPrice = data.price || '';
+ this.calculationDescription = data.price_desc || '';
}
},
// 计算单次过闸费用
- totalPriceText() {
- const unit = Number(this.unitPrice);
- const ton = Number(this.currentShip?.total_tonnage);
- if (isNaN(unit) || isNaN(ton)) {
- return '-';
- }
- const total = (unit * ton).toFixed(2);
- return `${total}元(单价${unit} * 载重${ton}吨)`;
- },
+ // totalPriceText() {
+ // const unit = Number(this.unitPrice);
+ // if (isNaN(unit)) {
+ // return '-';
+ // }
+ // return `${unit}元(${this.calculationDescription})`;
+ // },
// 获取用户位置
getUserLocation() {
// #ifdef H5
diff --git a/unpackage/dist/build/web/index.html b/unpackage/dist/build/web/index.html
index 7f2cd9d..c75431f 100644
--- a/unpackage/dist/build/web/index.html
+++ b/unpackage/dist/build/web/index.html
@@ -1,2 +1,2 @@
胥口闸站购票
\ No newline at end of file
+ document.write('')