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:
+41
-33
@@ -195,13 +195,13 @@
|
||||
const showPhoneAuthPopup = ref(false)
|
||||
|
||||
// 生命周期 onLoad 钩子
|
||||
onLoad(async(options) => {
|
||||
onLoad(async (options) => {
|
||||
if (options.deviceNo != uni.getStorageSync('deviceId') || !uni.getStorageSync('deviceId')) {
|
||||
deviceId.value = options.deviceNo
|
||||
uni.setStorageSync('deviceId', options.deviceNo)
|
||||
} else {
|
||||
deviceId.value = uni.getStorageSync('deviceId')
|
||||
// uni.removeStorageSync('deviceId')
|
||||
// uni.removeStorageSync('deviceId')
|
||||
}
|
||||
await checkOrderStatus()
|
||||
await fetchDeviceInfo()
|
||||
@@ -209,6 +209,7 @@
|
||||
|
||||
onMounted(async () => {
|
||||
await checkUserPhone()
|
||||
await fetchDeviceInfo()
|
||||
})
|
||||
|
||||
// onShow(async () => {
|
||||
@@ -344,9 +345,15 @@
|
||||
deviceStatus.class = 'offline'
|
||||
}
|
||||
}
|
||||
console.log('feeconfig', deviceInfo.value.feeConfig);
|
||||
if (deviceInfo.value.feeConfig) {
|
||||
deviceFeeConfig.value = JSON.parse(deviceInfo.value.feeConfig)[0] || {}
|
||||
} else {
|
||||
deviceFeeConfig.value = {
|
||||
maxHourPrice: '5.00',
|
||||
}
|
||||
discount.value = '99.00'
|
||||
}
|
||||
|
||||
deviceFeeConfig.value = JSON.parse(deviceInfo.value.feeConfig)[0] || {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -434,33 +441,34 @@
|
||||
|
||||
// 获取后端返回的订单信息
|
||||
const order = rentResult.data
|
||||
console.log('订单信息',order);
|
||||
|
||||
// --- 统一:先更新订单套餐信息 ---
|
||||
try {
|
||||
let packageTimeMinutes = 0;
|
||||
if (selectedPkg.time.includes('小时')) {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time) * 60;
|
||||
} else if (selectedPkg.time.includes('分钟')) {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time);
|
||||
} else {
|
||||
packageTimeMinutes = parseInt(selectedPkg.time) * 60; // 默认按小时处理
|
||||
}
|
||||
// // --- 统一:先更新订单套餐信息 ---
|
||||
// try {
|
||||
// let packageTimeMinutes = 0;
|
||||
// if (selectedPkg.time.includes('小时')) {
|
||||
// packageTimeMinutes = parseInt(selectedPkg.time) * 60;
|
||||
// } else if (selectedPkg.time.includes('分钟')) {
|
||||
// packageTimeMinutes = parseInt(selectedPkg.time);
|
||||
// } else {
|
||||
// packageTimeMinutes = parseInt(selectedPkg.time) * 60; // 默认按小时处理
|
||||
// }
|
||||
|
||||
const updateRes = await updateOrderPackage({
|
||||
orderId: order.orderId,
|
||||
packageTime: packageTimeMinutes,
|
||||
packagePrice: parseFloat(selectedPkg.price)
|
||||
});
|
||||
if (updateRes.code !== 200) {
|
||||
console.warn("更新订单套餐信息失败:", updateRes.msg);
|
||||
// 这里可以选择是否提示用户或阻止流程,当前不阻止
|
||||
} else {
|
||||
console.log("订单套餐信息已提前更新");
|
||||
}
|
||||
} catch (updateError) {
|
||||
console.error("更新订单套餐信息时出错:", updateError);
|
||||
// 即使更新失败,也继续流程
|
||||
}
|
||||
// const updateRes = await updateOrderPackage({
|
||||
// orderId: order.orderId,
|
||||
// packageTime: packageTimeMinutes,
|
||||
// packagePrice: parseFloat(selectedPkg.price)
|
||||
// });
|
||||
// if (updateRes.code !== 200) {
|
||||
// console.warn("更新订单套餐信息失败:", updateRes.msg);
|
||||
// // 这里可以选择是否提示用户或阻止流程,当前不阻止
|
||||
// } else {
|
||||
// console.log("订单套餐信息已提前更新");
|
||||
// }
|
||||
// } catch (updateError) {
|
||||
// console.error("更新订单套餐信息时出错:", updateError);
|
||||
// // 即使更新失败,也继续流程
|
||||
// }
|
||||
// --- 套餐信息更新结束 ---
|
||||
|
||||
if (payWay == 'wx-pay') {
|
||||
@@ -469,16 +477,16 @@
|
||||
const res = await getOrderByOrderNo(order.orderNo);
|
||||
console.log(res);
|
||||
// --- 新增:计算总金额 ---
|
||||
const deposit = parseFloat(deviceInfo.value.depositAmount);
|
||||
const packagePrice = parseFloat(selectedPkg.price);
|
||||
const totalAmount = (deposit + packagePrice).toFixed(2);
|
||||
const deposit = parseFloat(order.depositAmount);
|
||||
const packagePrice = parseFloat(order.unitPrice);
|
||||
const totalAmount = deposit.toFixed(2);
|
||||
// --- 计算结束 ---
|
||||
|
||||
uni.hideLoading()
|
||||
|
||||
// 跳转到订单支付页面,传递订单ID、套餐信息和总金额
|
||||
uni.redirectTo({
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTimeHours=${selectedPkg.time.replace('小时', '')}&packagePrice=${selectedPkg.price}&totalAmount=${totalAmount}&depositAmount=${depositAmount.value}${deviceInfo.value && deviceInfo.value.feeConfig ? '&feeConfig=' + encodeURIComponent(deviceInfo.value.feeConfig) : ''}`
|
||||
url: `/pages/order/payment?orderId=${order.orderId}&packageTimeHours=${selectedPkg.time.replace('小时', '')}&packagePrice=${packagePrice}&totalAmount=${totalAmount}&depositAmount=${depositAmount.value}${deviceInfo.value && deviceInfo.value.feeConfig ? '&feeConfig=' + encodeURIComponent(deviceInfo.value.feeConfig) : ''}`
|
||||
})
|
||||
|
||||
} else if (payWay == 'wx-score-pay') {
|
||||
|
||||
+42
-40
@@ -1,50 +1,52 @@
|
||||
<template>
|
||||
<view class="feedback-container">
|
||||
<!-- 问题类型选择 -->
|
||||
<view class="type-section">
|
||||
<view class="section-title">问题类型</view>
|
||||
<view class="type-grid">
|
||||
<view v-for="(type, index) in types" :key="index" class="type-item"
|
||||
:class="{ active: selectedType === index }" @click="selectType(index)">
|
||||
{{ type }}
|
||||
<form>
|
||||
<!-- 问题类型选择 -->
|
||||
<view class="type-section">
|
||||
<view class="section-title">问题类型</view>
|
||||
<view class="type-grid">
|
||||
<view v-for="(type, index) in types" :key="index" class="type-item"
|
||||
:class="{ active: selectedType === index }" @click="selectType(index)">
|
||||
{{ type }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 问题描述 -->
|
||||
<view class="description-section">
|
||||
<view class="section-title">问题描述</view>
|
||||
<textarea class="description-input" v-model="description" placeholder="请详细描述您遇到的问题,以便我们更好地为您解决"
|
||||
maxlength="500" />
|
||||
<view class="word-count">{{ description.length }}/500</view>
|
||||
</view>
|
||||
|
||||
<!-- 图片上传 -->
|
||||
<view class="upload-section">
|
||||
<view class="section-title">图片上传(选填)</view>
|
||||
<view class="upload-grid">
|
||||
<view class="upload-item" v-for="(img, index) in images" :key="index">
|
||||
<image :src="img" mode="aspectFill" />
|
||||
<view class="delete-btn" @click="deleteImage(index)">×</view>
|
||||
</view>
|
||||
<view class="upload-btn" @click="chooseImage" v-if="images.length < 3">
|
||||
<text class="plus">+</text>
|
||||
<text class="tip">上传图片</text>
|
||||
</view>
|
||||
<!-- 问题描述 -->
|
||||
<view class="description-section">
|
||||
<view class="section-title">问题描述</view>
|
||||
<textarea class="description-input" v-model="description" placeholder="请详细描述您遇到的问题,以便我们更好地为您解决"
|
||||
maxlength="500" name="description" />
|
||||
<view class="word-count">{{ description.length }}/500</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 联系方式 -->
|
||||
<view class="contact-section">
|
||||
<view class="section-title">联系方式</view>
|
||||
<input class="contact-input" v-model="contact" placeholder="请留下您的手机号,方便我们联系您" type="number"
|
||||
maxlength="11" />
|
||||
</view>
|
||||
<!-- 图片上传 -->
|
||||
<!-- <view class="upload-section">
|
||||
<view class="section-title">图片上传(选填)</view>
|
||||
<view class="upload-grid">
|
||||
<view class="upload-item" v-for="(img, index) in images" :key="index">
|
||||
<image :src="img" mode="aspectFill" />
|
||||
<view class="delete-btn" @click="deleteImage(index)">×</view>
|
||||
</view>
|
||||
<view class="upload-btn" @click="chooseImage" v-if="images.length < 3">
|
||||
<text class="plus">+</text>
|
||||
<text class="tip">上传图片</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="submit-section">
|
||||
<button class="submit-btn" @click="submitFeedback">提交反馈</button>
|
||||
</view>
|
||||
<!-- 联系方式 -->
|
||||
<view class="contact-section">
|
||||
<view class="section-title">联系方式</view>
|
||||
<input class="contact-input" v-model="contact" placeholder="请留下您的手机号,方便我们联系您" type="number"
|
||||
maxlength="11" name="contact" />
|
||||
</view>
|
||||
|
||||
<!-- 提交按钮 -->
|
||||
<view class="submit-section">
|
||||
<view class="submit-btn" @click="submitFeedback">提交反馈</view>
|
||||
</view>
|
||||
</form>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -122,7 +124,7 @@
|
||||
type: paramsType.value,
|
||||
content: description.value,
|
||||
phone: contact.value,
|
||||
images: images.value
|
||||
// images: images.value
|
||||
}
|
||||
const res = await addUserFeedback(feedbackData);
|
||||
if (res.code == 200) {
|
||||
|
||||
Reference in New Issue
Block a user