style:设备详情页采用动态设备数据
This commit is contained in:
+2
-2
@@ -6988,9 +6988,9 @@ function isConsoleWritable() {
|
||||
return isWritable;
|
||||
}
|
||||
function initRuntimeSocketService() {
|
||||
const hosts = "192.168.10.13,127.0.0.1";
|
||||
const hosts = "192.168.10.30,127.0.0.1";
|
||||
const port = "8090";
|
||||
const id = "mp-weixin_4_oLdt";
|
||||
const id = "mp-weixin_wcZ9WZ";
|
||||
const lazy = typeof swan !== "undefined";
|
||||
let restoreError = lazy ? () => {
|
||||
} : initOnError();
|
||||
|
||||
+30
-26
@@ -8,6 +8,7 @@ const _sfc_main = {
|
||||
setup(__props) {
|
||||
const deviceInfo = common_vendor.ref({});
|
||||
const deviceId = common_vendor.ref("");
|
||||
const deviceFeeConfig = common_vendor.ref({});
|
||||
const deviceLocation = common_vendor.ref("一号教学楼大厅");
|
||||
const batteryLevel = common_vendor.ref(95);
|
||||
const hasActiveOrder = common_vendor.ref(false);
|
||||
@@ -21,7 +22,7 @@ const _sfc_main = {
|
||||
common_vendor.onLoad((options) => {
|
||||
deviceId.value = options.deviceNo;
|
||||
checkOrderStatus();
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:199", options.deviceNo);
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:200", options.deviceNo);
|
||||
fetchDeviceInfo();
|
||||
});
|
||||
common_vendor.onMounted(() => {
|
||||
@@ -30,18 +31,18 @@ const _sfc_main = {
|
||||
const checkUserPhone = async () => {
|
||||
try {
|
||||
const userInfoRes = await util_index.getUserInfo();
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:210", userInfoRes.data.phone, "getUserInfoPhone");
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:211", 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:219", "获取用户信息失败:", error);
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:220", "获取用户信息失败:", error);
|
||||
}
|
||||
};
|
||||
const onGetPhoneNumber = (e) => {
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:225", "getPhoneNumber event:", e.detail);
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:226", "getPhoneNumber event:", e.detail);
|
||||
if (e.detail.errMsg && e.detail.errMsg.includes("deny")) {
|
||||
common_vendor.index.showToast({
|
||||
title: "需要授权手机号才能使用设备",
|
||||
@@ -53,13 +54,13 @@ const _sfc_main = {
|
||||
common_vendor.index.showLoading({
|
||||
title: "获取中..."
|
||||
});
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:242", "获取到的授权code:", e.detail.code);
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:243", "获取到的授权code:", e.detail.code);
|
||||
try {
|
||||
util_index.getUserPhoneNumber(e.detail.code).then((res) => {
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:248", "获取手机号API响应原始数据:", JSON.stringify(res));
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:249", "获取手机号API响应原始数据:", JSON.stringify(res));
|
||||
common_vendor.index.hideLoading();
|
||||
if (!res) {
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:253", "API返回数据为空");
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:254", "API返回数据为空");
|
||||
common_vendor.index.showModal({
|
||||
title: "数据异常",
|
||||
content: "API返回为空",
|
||||
@@ -67,8 +68,8 @@ const _sfc_main = {
|
||||
});
|
||||
return;
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:263", "响应code:", res.code, "响应类型:", typeof res.code);
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:264", "是否有data:", !!res.data, "是否有phone:", res.data && !!res.data.phone);
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:264", "响应code:", res.code, "响应类型:", typeof res.code);
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:265", "是否有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;
|
||||
@@ -77,7 +78,7 @@ const _sfc_main = {
|
||||
icon: "success"
|
||||
});
|
||||
} else {
|
||||
common_vendor.index.__f__("warn", "at pages/device/detail.vue:276", "获取手机号响应异常:", res.msg || "未知错误");
|
||||
common_vendor.index.__f__("warn", "at pages/device/detail.vue:277", "获取手机号响应异常:", res.msg || "未知错误");
|
||||
common_vendor.index.showModal({
|
||||
title: "获取手机号异常",
|
||||
content: `状态码: ${res.code}, 消息: ${res.msg || "无"}`,
|
||||
@@ -86,7 +87,7 @@ const _sfc_main = {
|
||||
}
|
||||
}).catch((err) => {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:286", "获取手机号码失败(catch):", err);
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:287", "获取手机号码失败(catch):", err);
|
||||
let errMsg = err.message || err.toString();
|
||||
common_vendor.index.showModal({
|
||||
title: "获取手机号失败",
|
||||
@@ -96,7 +97,7 @@ const _sfc_main = {
|
||||
});
|
||||
} catch (outerError) {
|
||||
common_vendor.index.hideLoading();
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:298", "获取手机号外部错误:", outerError);
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:299", "获取手机号外部错误:", outerError);
|
||||
common_vendor.index.showModal({
|
||||
title: "意外错误",
|
||||
content: "处理过程发生异常: " + (outerError.message || outerError),
|
||||
@@ -128,6 +129,8 @@ const _sfc_main = {
|
||||
deviceStatus.class = "offline";
|
||||
}
|
||||
}
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:337", "feeconfig", deviceInfo.value.feeConfig);
|
||||
deviceFeeConfig.value = JSON.parse(deviceInfo.value.feeConfig)[0] || {};
|
||||
}
|
||||
};
|
||||
const showLoginTip = () => {
|
||||
@@ -207,17 +210,17 @@ const _sfc_main = {
|
||||
packagePrice: parseFloat(selectedPkg.price)
|
||||
});
|
||||
if (updateRes.code !== 200) {
|
||||
common_vendor.index.__f__("warn", "at pages/device/detail.vue:441", "更新订单套餐信息失败:", updateRes.msg);
|
||||
common_vendor.index.__f__("warn", "at pages/device/detail.vue:445", "更新订单套餐信息失败:", updateRes.msg);
|
||||
} else {
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:444", "订单套餐信息已提前更新");
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:448", "订单套餐信息已提前更新");
|
||||
}
|
||||
} catch (updateError) {
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:447", "更新订单套餐信息时出错:", updateError);
|
||||
common_vendor.index.__f__("error", "at pages/device/detail.vue:451", "更新订单套餐信息时出错:", 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:456", res);
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:460", res);
|
||||
const deposit = parseFloat(deviceInfo.value.depositAmount);
|
||||
const packagePrice = parseFloat(selectedPkg.price);
|
||||
const totalAmount = (deposit + packagePrice).toFixed(2);
|
||||
@@ -234,7 +237,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:484", res2.data.orderStatus);
|
||||
common_vendor.index.__f__("log", "at pages/device/detail.vue:488", res2.data.orderStatus);
|
||||
if (res2.data.orderStatus == "in_used") {
|
||||
common_vendor.index.showToast({
|
||||
title: "设备租借成功",
|
||||
@@ -291,17 +294,18 @@ const _sfc_main = {
|
||||
f: common_assets._imports_1$2,
|
||||
g: batteryLevel.value < 20 ? 1 : "",
|
||||
h: common_vendor.t(batteryLevel.value),
|
||||
i: common_vendor.t(hasActiveOrder.value ? "归还设备" : "免押租借"),
|
||||
j: hasActiveOrder.value ? 1 : "",
|
||||
k: common_vendor.o(($event) => handleRent("wx-score-pay")),
|
||||
l: common_assets._imports_0$2,
|
||||
m: common_vendor.o(($event) => handleRent("wx-pay")),
|
||||
n: showPhoneAuthPopup.value
|
||||
i: common_vendor.t(deviceFeeConfig.value.maxHourPrice),
|
||||
j: common_vendor.t(deviceInfo.value.depositAmount),
|
||||
k: common_vendor.t(hasActiveOrder.value ? "归还设备" : "免押租借"),
|
||||
l: hasActiveOrder.value ? 1 : "",
|
||||
m: common_vendor.o(($event) => handleRent("wx-score-pay")),
|
||||
n: common_assets._imports_0$2,
|
||||
o: showPhoneAuthPopup.value
|
||||
}, showPhoneAuthPopup.value ? {
|
||||
o: common_vendor.o(() => {
|
||||
p: common_vendor.o(() => {
|
||||
}),
|
||||
p: common_vendor.o(onGetPhoneNumber),
|
||||
q: common_vendor.o(($event) => showPhoneAuthPopup.value = false)
|
||||
q: common_vendor.o(onGetPhoneNumber),
|
||||
r: common_vendor.o(($event) => showPhoneAuthPopup.value = false)
|
||||
} : {});
|
||||
};
|
||||
}
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
<view class="container data-v-d65de3a7"><view class="device-header data-v-d65de3a7"><view class="{{['device-status-card', 'data-v-d65de3a7', b]}}"><view class="status-indicator data-v-d65de3a7"></view><text class="status-text data-v-d65de3a7">{{a}}</text></view><view class="device-title data-v-d65de3a7"><text class="name data-v-d65de3a7">共享风扇</text><view class="device-meta data-v-d65de3a7"><text class="id-label data-v-d65de3a7">设备号:</text><text class="id-value data-v-d65de3a7">{{c}}</text></view></view></view><view class="card device-info-card data-v-d65de3a7"><view class="card-row data-v-d65de3a7"><view class="card-item data-v-d65de3a7"><view class="item-icon location-icon data-v-d65de3a7"><image class="data-v-d65de3a7" src="{{d}}" mode="aspectFill" style="width:45rpx;height:45rpx"></image></view><view class="item-content data-v-d65de3a7"><text class="item-label data-v-d65de3a7">当前位置</text><text class="item-value data-v-d65de3a7">{{e}}</text></view></view><view class="card-item data-v-d65de3a7"><view class="{{['item-icon', 'battery-icon', 'data-v-d65de3a7', g && 'battery-low']}}"><image class="data-v-d65de3a7" src="{{f}}" mode="aspectFill" style="width:45rpx;height:45rpx"></image></view><view class="item-content data-v-d65de3a7"><text class="item-label data-v-d65de3a7">电池电量</text><text class="item-value data-v-d65de3a7">{{h}}%</text></view></view></view></view><view class="card pricing-card data-v-d65de3a7"><view class="card-header data-v-d65de3a7"><text class="card-title data-v-d65de3a7">计费规则</text></view><view class="pricing-banner data-v-d65de3a7"><view class="pricing-main data-v-d65de3a7"><text class="price data-v-d65de3a7">¥5.00</text><text class="unit data-v-d65de3a7">/小时</text></view><text class="cap-price data-v-d65de3a7">封顶 ¥99</text></view><view class="pricing-rules data-v-d65de3a7"><view class="rule-item data-v-d65de3a7"><view class="rule-dot data-v-d65de3a7"></view><text class="rule-text data-v-d65de3a7">不足60分钟按60分钟计费</text></view><view class="rule-item data-v-d65de3a7"><view class="rule-dot data-v-d65de3a7"></view><text class="rule-text data-v-d65de3a7">持续计费至99元视为买断</text></view></view></view><view class="card notice-card data-v-d65de3a7"><view class="card-header data-v-d65de3a7"><text class="card-title data-v-d65de3a7">使用须知</text></view><view class="notice-items data-v-d65de3a7"><view class="notice-item data-v-d65de3a7"><view class="notice-dot data-v-d65de3a7"></view><text class="notice-text data-v-d65de3a7">请在使用前检查设备是否完好</text></view><view class="notice-item data-v-d65de3a7"><view class="notice-dot data-v-d65de3a7"></view><text class="notice-text data-v-d65de3a7">请在指定区域内使用设备</text></view><view class="notice-item data-v-d65de3a7"><view class="notice-dot data-v-d65de3a7"></view><text class="notice-text data-v-d65de3a7">归还时请确保设备完好,避免损坏</text></view></view></view><view class="footer data-v-d65de3a7"><button class="{{['rent-button', 'data-v-d65de3a7', j && 'return-button']}}" bindtap="{{k}}"><text class="data-v-d65de3a7">{{i}}</text></button><view class="wechat-credit data-v-d65de3a7"><image src="{{l}}" mode="aspectFit" class="wx-icon data-v-d65de3a7"></image><view class="credit-text data-v-d65de3a7"><text class="data-v-d65de3a7">微信支付分</text><text class="credit-divider data-v-d65de3a7">|</text><text class="credit-score data-v-d65de3a7">550分及以上优享</text></view></view><view class=" data-v-d65de3a7" style="align-items:center;align-content:center;text-align:center;line-height:50rpx" bindtap="{{m}}"> 无法免押点这里></view></view><view wx:if="{{n}}" class="phone-auth-popup data-v-d65de3a7"><view class="popup-mask data-v-d65de3a7" catchtap="{{o}}"></view><view class="popup-content data-v-d65de3a7"><view class="popup-header data-v-d65de3a7"><text class="popup-title data-v-d65de3a7">授权获取手机号</text></view><view class="popup-body data-v-d65de3a7"><view class="auth-desc data-v-d65de3a7"><text class="data-v-d65de3a7">为了提供更好的服务,需要授权获取您的手机号</text></view><button class="auth-btn data-v-d65de3a7" open-type="getPhoneNumber" bindgetphonenumber="{{p}}"> 一键获取手机号 </button><view class="auth-cancel data-v-d65de3a7" bindtap="{{q}}"><text class="data-v-d65de3a7">暂不授权</text></view></view></view></view></view>
|
||||
<view class="container data-v-d65de3a7"><view class="device-header data-v-d65de3a7"><view class="{{['device-status-card', 'data-v-d65de3a7', b]}}"><view class="status-indicator data-v-d65de3a7"></view><text class="status-text data-v-d65de3a7">{{a}}</text></view><view class="device-title data-v-d65de3a7"><text class="name data-v-d65de3a7">共享风扇</text><view class="device-meta data-v-d65de3a7"><text class="id-label data-v-d65de3a7">设备号:</text><text class="id-value data-v-d65de3a7">{{c}}</text></view></view></view><view class="card device-info-card data-v-d65de3a7"><view class="card-row data-v-d65de3a7"><view class="card-item data-v-d65de3a7"><view class="item-icon location-icon data-v-d65de3a7"><image class="data-v-d65de3a7" src="{{d}}" mode="aspectFill" style="width:45rpx;height:45rpx"></image></view><view class="item-content data-v-d65de3a7"><text class="item-label data-v-d65de3a7">当前位置</text><text class="item-value data-v-d65de3a7">{{e}}</text></view></view><view class="card-item data-v-d65de3a7"><view class="{{['item-icon', 'battery-icon', 'data-v-d65de3a7', g && 'battery-low']}}"><image class="data-v-d65de3a7" src="{{f}}" mode="aspectFill" style="width:45rpx;height:45rpx"></image></view><view class="item-content data-v-d65de3a7"><text class="item-label data-v-d65de3a7">电池电量</text><text class="item-value data-v-d65de3a7">{{h}}%</text></view></view></view></view><view class="card pricing-card data-v-d65de3a7"><view class="card-header data-v-d65de3a7"><text class="card-title data-v-d65de3a7">计费规则</text></view><view class="pricing-banner data-v-d65de3a7"><view class="pricing-main data-v-d65de3a7"><text class="price data-v-d65de3a7">¥{{i}}</text><text class="unit data-v-d65de3a7">/小时</text></view><text class="cap-price data-v-d65de3a7">封顶 ¥{{j}}</text></view><view class="pricing-rules data-v-d65de3a7"><view class="rule-item data-v-d65de3a7"><view class="rule-dot data-v-d65de3a7"></view><text class="rule-text data-v-d65de3a7">不足60分钟按60分钟计费</text></view><view class="rule-item data-v-d65de3a7"><view class="rule-dot data-v-d65de3a7"></view><text class="rule-text data-v-d65de3a7">持续计费至99元视为买断</text></view></view></view><view class="card notice-card data-v-d65de3a7"><view class="card-header data-v-d65de3a7"><text class="card-title data-v-d65de3a7">使用须知</text></view><view class="notice-items data-v-d65de3a7"><view class="notice-item data-v-d65de3a7"><view class="notice-dot data-v-d65de3a7"></view><text class="notice-text data-v-d65de3a7">请在使用前检查设备是否完好</text></view><view class="notice-item data-v-d65de3a7"><view class="notice-dot data-v-d65de3a7"></view><text class="notice-text data-v-d65de3a7">请在指定区域内使用设备</text></view><view class="notice-item data-v-d65de3a7"><view class="notice-dot data-v-d65de3a7"></view><text class="notice-text data-v-d65de3a7">归还时请确保设备完好,避免损坏</text></view></view></view><view class="footer data-v-d65de3a7"><button class="{{['rent-button', 'data-v-d65de3a7', l && 'return-button']}}" bindtap="{{m}}"><text class="data-v-d65de3a7">{{k}}</text></button><view class="wechat-credit data-v-d65de3a7"><image src="{{n}}" mode="aspectFit" class="wx-icon data-v-d65de3a7"></image><view class="credit-text data-v-d65de3a7"><text class="data-v-d65de3a7">微信支付分</text><text class="credit-divider data-v-d65de3a7">|</text><text class="credit-score data-v-d65de3a7">550分及以上优享</text></view></view></view><view wx:if="{{o}}" class="phone-auth-popup data-v-d65de3a7"><view class="popup-mask data-v-d65de3a7" catchtap="{{p}}"></view><view class="popup-content data-v-d65de3a7"><view class="popup-header data-v-d65de3a7"><text class="popup-title data-v-d65de3a7">授权获取手机号</text></view><view class="popup-body data-v-d65de3a7"><view class="auth-desc data-v-d65de3a7"><text class="data-v-d65de3a7">为了提供更好的服务,需要授权获取您的手机号</text></view><button class="auth-btn data-v-d65de3a7" open-type="getPhoneNumber" bindgetphonenumber="{{q}}"> 一键获取手机号 </button><view class="auth-cancel data-v-d65de3a7" bindtap="{{r}}"><text class="data-v-d65de3a7">暂不授权</text></view></view></view></view></view>
|
||||
Reference in New Issue
Block a user