|
@@ -20,7 +20,7 @@
|
|
|
<text v-else>停止设备</text>
|
|
<text v-else>停止设备</text>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view class=device-body_guide>
|
|
|
|
|
|
|
+ <view class="device-body_guide">
|
|
|
<view>●点击上方【启动设备】按钮启动设备;
|
|
<view>●点击上方【启动设备】按钮启动设备;
|
|
|
</view>
|
|
</view>
|
|
|
<view>●设备启动后,请在设备功能面板按下功能按键以选择服务项目;
|
|
<view>●设备启动后,请在设备功能面板按下功能按键以选择服务项目;
|
|
@@ -34,8 +34,17 @@
|
|
|
|
|
|
|
|
</view>
|
|
</view>
|
|
|
<!-- <view class="device-body_ops-time">{{ state.time }}</view>-->
|
|
<!-- <view class="device-body_ops-time">{{ state.time }}</view>-->
|
|
|
|
|
+
|
|
|
|
|
+ <view class="device-body_recharge">
|
|
|
|
|
+ <uv-button
|
|
|
|
|
+ type="default"
|
|
|
|
|
+ color="#19A497"
|
|
|
|
|
+ @click="handleGotoRechage">充值
|
|
|
|
|
+ </uv-button>
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
<login-bar class="w100 text-center"></login-bar>
|
|
<login-bar class="w100 text-center"></login-bar>
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
@@ -52,11 +61,12 @@ const initState = () => ({
|
|
|
device: {
|
|
device: {
|
|
|
functions: [],
|
|
functions: [],
|
|
|
deviceName: '',
|
|
deviceName: '',
|
|
|
- state: ''
|
|
|
|
|
|
|
+ state: '',
|
|
|
|
|
+ stationId: ''
|
|
|
},
|
|
},
|
|
|
time: "00:00:00",
|
|
time: "00:00:00",
|
|
|
start: new Date(),
|
|
start: new Date(),
|
|
|
- deviceId:null
|
|
|
|
|
|
|
+ deviceId: null
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
const state = reactive(initState())
|
|
const state = reactive(initState())
|
|
@@ -77,7 +87,7 @@ onLoad((options: any) => {
|
|
|
console.log(query, scanTime)
|
|
console.log(query, scanTime)
|
|
|
if (query) {
|
|
if (query) {
|
|
|
id = query.split("#")[1].split("?")[0]
|
|
id = query.split("#")[1].split("?")[0]
|
|
|
- state.deviceId =id;
|
|
|
|
|
|
|
+ state.deviceId = id;
|
|
|
} else {
|
|
} else {
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -87,10 +97,10 @@ onLoad((options: any) => {
|
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
loadDeviceDetail(id);
|
|
loadDeviceDetail(id);
|
|
|
}, 200)
|
|
}, 200)
|
|
|
- }).catch(e=>{
|
|
|
|
|
|
|
+ }).catch(e => {
|
|
|
console.error("onLoad 校验登录失败,自动跳转登录页")
|
|
console.error("onLoad 校验登录失败,自动跳转登录页")
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url:`/pages-user/login/index?shortId=${state.deviceId}&redirectUrl=/pages-wash/device/index`
|
|
|
|
|
|
|
+ url: `/pages-user/login/index?shortId=${state.deviceId}&redirectUrl=/pages-wash/device/index`
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
});
|
|
});
|
|
@@ -101,23 +111,23 @@ onShow(() => {
|
|
|
// uni.showToast({
|
|
// uni.showToast({
|
|
|
// title:'onShow,'
|
|
// title:'onShow,'
|
|
|
// })
|
|
// })
|
|
|
- checkLogin().then(()=>{
|
|
|
|
|
|
|
+ checkLogin().then(() => {
|
|
|
// uni.showToast({
|
|
// uni.showToast({
|
|
|
// title:'onShow,loaded'
|
|
// title:'onShow,loaded'
|
|
|
// })
|
|
// })
|
|
|
if (!state.deviceId) {
|
|
if (!state.deviceId) {
|
|
|
- console.log("deviceId",getApp<any>().globalData.deviceId)
|
|
|
|
|
|
|
+ console.log("deviceId", getApp<any>().globalData.deviceId)
|
|
|
let deviceId = getApp<any>().globalData.deviceId;
|
|
let deviceId = getApp<any>().globalData.deviceId;
|
|
|
if (deviceId) {
|
|
if (deviceId) {
|
|
|
loadDeviceDetail(deviceId);
|
|
loadDeviceDetail(deviceId);
|
|
|
}
|
|
}
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
loadDeviceDetail(state.deviceId);
|
|
loadDeviceDetail(state.deviceId);
|
|
|
}
|
|
}
|
|
|
- }).catch(e=>{
|
|
|
|
|
|
|
+ }).catch(e => {
|
|
|
console.error("校验登录失败,自动跳转登录页")
|
|
console.error("校验登录失败,自动跳转登录页")
|
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
|
- url:`/pages-user/login/index?shortId=${state.deviceId}&redirectUrl=/pages-wash/device/index`
|
|
|
|
|
|
|
+ url: `/pages-user/login/index?shortId=${state.deviceId}&redirectUrl=/pages-wash/device/index`
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
|
|
@@ -125,12 +135,11 @@ onShow(() => {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
-
|
|
|
|
|
const addListener = () => {
|
|
const addListener = () => {
|
|
|
uni.$on('login', function (data) {
|
|
uni.$on('login', function (data) {
|
|
|
- if(state.deviceId && data.isLogin){
|
|
|
|
|
- loadDeviceDetail(state.deviceId);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (state.deviceId && data.isLogin) {
|
|
|
|
|
+ loadDeviceDetail(state.deviceId);
|
|
|
|
|
+ }
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
uni.$on('logout', function (data) {
|
|
uni.$on('logout', function (data) {
|
|
@@ -144,9 +153,9 @@ const removeListener = () => {
|
|
|
|
|
|
|
|
|
|
|
|
|
const loadDeviceDetail = (id: any) => {
|
|
const loadDeviceDetail = (id: any) => {
|
|
|
- state.deviceId =id;
|
|
|
|
|
|
|
+ state.deviceId = id;
|
|
|
let ft = fetchToken();
|
|
let ft = fetchToken();
|
|
|
- console.log("device token ",ft)
|
|
|
|
|
|
|
+ console.log("device token ", ft)
|
|
|
get(`/wash-device/queryDevice/${id}`).then((res: any) => {
|
|
get(`/wash-device/queryDevice/${id}`).then((res: any) => {
|
|
|
if (res.currentUserId && res.currentUserId != getApp<any>().globalData.user.id) {
|
|
if (res.currentUserId && res.currentUserId != getApp<any>().globalData.user.id) {
|
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -229,6 +238,13 @@ const countTime = () => {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
+const handleGotoRechage = () => {
|
|
|
|
|
+ console.log(state.device.stationId)
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: `/pages-user/wallet/recharge?stationId=${state.device.stationId}`
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
<style lang="scss" scoped>
|
|
@@ -272,6 +288,12 @@ const countTime = () => {
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
align-content: center;
|
|
align-content: center;
|
|
|
|
|
|
|
|
|
|
+ &_recharge {
|
|
|
|
|
+ margin-top: 30px;
|
|
|
|
|
+ width: 96%;
|
|
|
|
|
+ height: 36px;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
&_ops {
|
|
&_ops {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
justify-content: center;
|
|
justify-content: center;
|