feat(config): 添加本地调试地址配置项

在 `config/url.js` 中新增了本地调试地址 `"http://127.0.0.1:8080"` 的注释配置,便于开发人员快速切换调试环境。

fix(device): 修复设备详情页费用配置解析逻辑

在 `pages/device/detail.vue` 中增强了对 `feeConfig` 字段的判断,防止因字段不存在导致页面报错,并设置默认值以提升用户体验。同时调整了订单创建后的套餐信息更新逻辑,暂时将其注释以便后续排查问题。

refactor(device): 调整订单金额计算方式

修改订单金额计算逻辑,从原来的押金加套餐价改为仅使用押金部分作为总价展示,并修正跳转支付页面时传递的价格参数为实际单位价格。

feat(feedback): 反馈页面增加联系方式输入框

在 `pages/feedback/index.vue` 表单中添加了联系方式输入框,支持用户填写手机号码用于后续客服联系,并将图片上传功能临时隐藏待优化。

chore(build): 更新构建产物中的 JS 文件内容

同步更新了打包目录下相关 JS 构建文件的内容,包括 `user.js` 和 `detail.js` 等,确保与源代码变更一致。
This commit is contained in:
2025-10-04 16:57:42 +08:00
parent 703f80ad75
commit f5742048d1
20 changed files with 133 additions and 138 deletions
+26 -19
View File
@@ -31,22 +31,23 @@ const _sfc_main = {
});
common_vendor.onMounted(async () => {
await checkUserPhone();
await fetchDeviceInfo();
});
const checkUserPhone = async () => {
try {
const userInfoRes = await util_index.getUserInfo();
common_vendor.index.__f__("log", "at pages/device/detail.vue:221", userInfoRes.data.phone, "getUserInfoPhone");
common_vendor.index.__f__("log", "at pages/device/detail.vue:222", userInfoRes.data.phone, "getUserInfoPhone");
if (userInfoRes.code == 200 && userInfoRes.data && userInfoRes.data.phone) {
phoneNumber.value = userInfoRes.data.phone;
} else {
showPhoneAuthPopup.value = true;
}
} catch (error) {
common_vendor.index.__f__("error", "at pages/device/detail.vue:230", "获取用户信息失败:", error);
common_vendor.index.__f__("error", "at pages/device/detail.vue:231", "获取用户信息失败:", error);
}
};
const onGetPhoneNumber = (e) => {
common_vendor.index.__f__("log", "at pages/device/detail.vue:236", "getPhoneNumber event:", e.detail);
common_vendor.index.__f__("log", "at pages/device/detail.vue:237", "getPhoneNumber event:", e.detail);
if (e.detail.errMsg && e.detail.errMsg.includes("deny")) {
common_vendor.index.showToast({
title: "需要授权手机号才能使用设备",
@@ -58,13 +59,13 @@ const _sfc_main = {
common_vendor.index.showLoading({
title: "获取中..."
});
common_vendor.index.__f__("log", "at pages/device/detail.vue:253", "获取到的授权code:", e.detail.code);
common_vendor.index.__f__("log", "at pages/device/detail.vue:254", "获取到的授权code:", e.detail.code);
try {
util_index.getUserPhoneNumber(e.detail.code).then((res) => {
common_vendor.index.__f__("log", "at pages/device/detail.vue:259", "获取手机号API响应原始数据:", JSON.stringify(res));
common_vendor.index.__f__("log", "at pages/device/detail.vue:260", "获取手机号API响应原始数据:", JSON.stringify(res));
common_vendor.index.hideLoading();
if (!res) {
common_vendor.index.__f__("error", "at pages/device/detail.vue:264", "API返回数据为空");
common_vendor.index.__f__("error", "at pages/device/detail.vue:265", "API返回数据为空");
common_vendor.index.showModal({
title: "数据异常",
content: "API返回为空",
@@ -72,8 +73,8 @@ const _sfc_main = {
});
return;
}
common_vendor.index.__f__("log", "at pages/device/detail.vue:274", "响应code:", res.code, "响应类型:", typeof res.code);
common_vendor.index.__f__("log", "at pages/device/detail.vue:275", "是否有data:", !!res.data, "是否有phone:", res.data && !!res.data.phone);
common_vendor.index.__f__("log", "at pages/device/detail.vue:275", "响应code:", res.code, "响应类型:", typeof res.code);
common_vendor.index.__f__("log", "at pages/device/detail.vue:276", "是否有data:", !!res.data, "是否有phone:", res.data && !!res.data.phone);
if (res.code == 200 && res.data && res.data.phoneNumber) {
phoneNumber.value = res.data.phoneNumber;
showPhoneAuthPopup.value = false;
@@ -82,7 +83,7 @@ const _sfc_main = {
icon: "success"
});
} else {
common_vendor.index.__f__("warn", "at pages/device/detail.vue:287", "获取手机号响应异常:", res.msg || "未知错误");
common_vendor.index.__f__("warn", "at pages/device/detail.vue:288", "获取手机号响应异常:", res.msg || "未知错误");
common_vendor.index.showModal({
title: "获取手机号异常",
content: `状态码: ${res.code}, 消息: ${res.msg || "无"}`,
@@ -91,7 +92,7 @@ const _sfc_main = {
}
}).catch((err) => {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/device/detail.vue:297", "获取手机号码失败(catch):", err);
common_vendor.index.__f__("error", "at pages/device/detail.vue:298", "获取手机号码失败(catch):", err);
let errMsg = err.message || err.toString();
common_vendor.index.showModal({
title: "获取手机号失败",
@@ -101,7 +102,7 @@ const _sfc_main = {
});
} catch (outerError) {
common_vendor.index.hideLoading();
common_vendor.index.__f__("error", "at pages/device/detail.vue:309", "获取手机号外部错误:", outerError);
common_vendor.index.__f__("error", "at pages/device/detail.vue:310", "获取手机号外部错误:", outerError);
common_vendor.index.showModal({
title: "意外错误",
content: "处理过程发生异常: " + (outerError.message || outerError),
@@ -133,8 +134,14 @@ const _sfc_main = {
deviceStatus.class = "offline";
}
}
common_vendor.index.__f__("log", "at pages/device/detail.vue:347", "feeconfig", deviceInfo.value.feeConfig);
deviceFeeConfig.value = JSON.parse(deviceInfo.value.feeConfig)[0] || {};
if (deviceInfo.value.feeConfig) {
deviceFeeConfig.value = JSON.parse(deviceInfo.value.feeConfig)[0] || {};
} else {
deviceFeeConfig.value = {
maxHourPrice: "5.00"
};
discount.value = "99.00";
}
}
};
const showLoginTip = () => {
@@ -194,7 +201,7 @@ const _sfc_main = {
common_vendor.index.showLoading({
title: "处理中"
});
common_vendor.index.__f__("log", "at pages/device/detail.vue:428", deviceId.value);
common_vendor.index.__f__("log", "at pages/device/detail.vue:435", deviceId.value);
const rentResult = await config_user.rentPowerBank(deviceId.value, phoneNumber.value);
if (rentResult.code !== 200) {
throw new Error(rentResult.msg || "设备租借失败");
@@ -215,17 +222,17 @@ const _sfc_main = {
packagePrice: parseFloat(selectedPkg.price)
});
if (updateRes.code !== 200) {
common_vendor.index.__f__("warn", "at pages/device/detail.vue:455", "更新订单套餐信息失败:", updateRes.msg);
common_vendor.index.__f__("warn", "at pages/device/detail.vue:462", "更新订单套餐信息失败:", updateRes.msg);
} else {
common_vendor.index.__f__("log", "at pages/device/detail.vue:458", "订单套餐信息已提前更新");
common_vendor.index.__f__("log", "at pages/device/detail.vue:465", "订单套餐信息已提前更新");
}
} catch (updateError) {
common_vendor.index.__f__("error", "at pages/device/detail.vue:461", "更新订单套餐信息时出错:", updateError);
common_vendor.index.__f__("error", "at pages/device/detail.vue:468", "更新订单套餐信息时出错:", updateError);
}
if (payWay == "wx-pay") {
common_vendor.index.hideLoading();
const res = await config_user.getOrderByOrderNo(order.orderNo);
common_vendor.index.__f__("log", "at pages/device/detail.vue:470", res);
common_vendor.index.__f__("log", "at pages/device/detail.vue:477", res);
const deposit = parseFloat(deviceInfo.value.depositAmount);
const packagePrice = parseFloat(selectedPkg.price);
const totalAmount = (deposit + packagePrice).toFixed(2);
@@ -242,7 +249,7 @@ const _sfc_main = {
const payResult = await util_index.initiateWeChatScorePayment(res);
if (payResult.errCode == "0") {
const res2 = await config_user.getOrderByOrderNoScorePayStatus(order.orderNo);
common_vendor.index.__f__("log", "at pages/device/detail.vue:498", res2.data.orderStatus);
common_vendor.index.__f__("log", "at pages/device/detail.vue:505", res2.data.orderStatus);
if (res2.data.orderStatus == "in_used") {
common_vendor.index.showToast({
title: "设备租借成功",
+8 -30
View File
@@ -8,22 +8,11 @@ const _sfc_main = {
const selectedType = common_vendor.ref(-1);
const paramsType = common_vendor.ref("");
const description = common_vendor.ref("");
const images = common_vendor.ref([]);
common_vendor.ref([]);
const contact = common_vendor.ref("");
const selectType = (index) => {
selectedType.value = index;
};
const chooseImage = () => {
common_vendor.index.chooseImage({
count: 3 - images.value.length,
success: (res) => {
images.value = [...images.value, ...res.tempFilePaths];
}
});
};
const deleteImage = (index) => {
images.value.splice(index, 1);
};
const submitFeedback = async () => {
if (selectedType.value === -1) {
common_vendor.index.showToast({
@@ -54,8 +43,8 @@ const _sfc_main = {
const feedbackData = {
type: paramsType.value,
content: description.value,
phone: contact.value,
images: images.value
phone: contact.value
// images: images.value
};
const res = await config_user.addUserFeedback(feedbackData);
if (res.code == 200) {
@@ -71,7 +60,7 @@ const _sfc_main = {
}
};
return (_ctx, _cache) => {
return common_vendor.e({
return {
a: common_vendor.f(types.value, (type, index, i0) => {
return {
a: common_vendor.t(type),
@@ -83,21 +72,10 @@ const _sfc_main = {
b: description.value,
c: common_vendor.o(($event) => description.value = $event.detail.value),
d: common_vendor.t(description.value.length),
e: common_vendor.f(images.value, (img, index, i0) => {
return {
a: img,
b: common_vendor.o(($event) => deleteImage(index), index),
c: index
};
}),
f: images.value.length < 3
}, images.value.length < 3 ? {
g: common_vendor.o(chooseImage)
} : {}, {
h: contact.value,
i: common_vendor.o(($event) => contact.value = $event.detail.value),
j: common_vendor.o(submitFeedback)
});
e: contact.value,
f: common_vendor.o(($event) => contact.value = $event.detail.value),
g: common_vendor.o(submitFeedback)
};
};
}
};
+1 -1
View File
@@ -1 +1 @@
<view class="feedback-container data-v-2aa7bac2"><view class="type-section data-v-2aa7bac2"><view class="section-title data-v-2aa7bac2">问题类型</view><view class="type-grid data-v-2aa7bac2"><view wx:for="{{a}}" wx:for-item="type" wx:key="b" class="{{['type-item', 'data-v-2aa7bac2', type.c && 'active']}}" bindtap="{{type.d}}">{{type.a}}</view></view></view><view class="description-section data-v-2aa7bac2"><view class="section-title data-v-2aa7bac2">问题描述</view><block wx:if="{{r0}}"><textarea class="description-input data-v-2aa7bac2" placeholder="请详细描述您遇到的问题,以便我们更好地为您解决" maxlength="500" value="{{b}}" bindinput="{{c}}"/></block><view class="word-count data-v-2aa7bac2">{{d}}/500</view></view><view class="upload-section data-v-2aa7bac2"><view class="section-title data-v-2aa7bac2">图片上传(选填)</view><view class="upload-grid data-v-2aa7bac2"><view wx:for="{{e}}" wx:for-item="img" wx:key="c" class="upload-item data-v-2aa7bac2"><image class="data-v-2aa7bac2" src="{{img.a}}" mode="aspectFill"/><view class="delete-btn data-v-2aa7bac2" bindtap="{{img.b}}">×</view></view><view wx:if="{{f}}" class="upload-btn data-v-2aa7bac2" bindtap="{{g}}"><text class="plus data-v-2aa7bac2">+</text><text class="tip data-v-2aa7bac2">上传图片</text></view></view></view><view class="contact-section data-v-2aa7bac2"><view class="section-title data-v-2aa7bac2">联系方式</view><input class="contact-input data-v-2aa7bac2" placeholder="请留下您的手机号,方便我们联系您" type="number" maxlength="11" value="{{h}}" bindinput="{{i}}"/></view><view class="submit-section data-v-2aa7bac2"><button class="submit-btn data-v-2aa7bac2" bindtap="{{j}}">提交反馈</button></view></view>
<view class="feedback-container data-v-2aa7bac2"><form class="data-v-2aa7bac2"><view class="type-section data-v-2aa7bac2"><view class="section-title data-v-2aa7bac2">问题类型</view><view class="type-grid data-v-2aa7bac2"><view wx:for="{{a}}" wx:for-item="type" wx:key="b" class="{{['type-item', 'data-v-2aa7bac2', type.c && 'active']}}" bindtap="{{type.d}}">{{type.a}}</view></view></view><view class="description-section data-v-2aa7bac2"><view class="section-title data-v-2aa7bac2">问题描述</view><block wx:if="{{r0}}"><textarea class="description-input data-v-2aa7bac2" placeholder="请详细描述您遇到的问题,以便我们更好地为您解决" maxlength="500" name="description" value="{{b}}" bindinput="{{c}}"/></block><view class="word-count data-v-2aa7bac2">{{d}}/500</view></view><view class="contact-section data-v-2aa7bac2"><view class="section-title data-v-2aa7bac2">联系方式</view><input class="contact-input data-v-2aa7bac2" placeholder="请留下您的手机号,方便我们联系您" type="number" maxlength="11" name="contact" value="{{e}}" bindinput="{{f}}"/></view><view class="submit-section data-v-2aa7bac2"><view class="submit-btn data-v-2aa7bac2" bindtap="{{g}}">提交反馈</view></view></form></view>