This commit is contained in:
3321822538@qq.com 2024-06-14 19:22:34 +08:00
parent 0b023c2a3b
commit a9d108e752
2 changed files with 57 additions and 27 deletions

View File

@ -1,9 +1,12 @@
<template> <template>
<view class="page"> <view class="page">
<!-- <u-navbar :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" <!-- <u-navbar :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff"
title-size='36' height='50'></u-navbar> --> title-size='36' height='50'></u-navbar> -->
<view class="title"> <view class="title">
{{deviceobj.deviceName}} {{deviceobj.deviceName}}
<view class="wz">
该设备还剩余时长{{expireTimeStr + 1}}分钟
</view>
</view> </view>
<view class="box"> <view class="box">
<view class="tit"> <view class="tit">
@ -32,14 +35,15 @@
<view class="tits" style="margin-top: 10rpx;"> <view class="tits" style="margin-top: 10rpx;">
套餐说明 套餐说明
</view> </view>
<view class="wz">
该设备还剩余时长{{expireTimeStr + 1}}分钟
</view>
<view class=""> <view class="">
{{item.description == null ? '无' : item.description}} {{item.description == null ? '无' : item.description}}
</view> </view>
<view class="wz"> <view class="wz" v-if="deviceobj.storeContactMobile == null">
联系客服2562356565 联系客服<text style="color: #8883F0;" @click="call">{{deviceobj.userMobile}}</text>
</view>
<view class="wz" v-else>
联系客服<text style="color: #8883F0;" @click="call">{{deviceobj.storeContactMobile}}</text>
</view> </view>
</view> </view>
@ -83,7 +87,6 @@
} }
}, },
onLoad(option) { onLoad(option) {
console.log(option.q)
if (option.q) { if (option.q) {
function getQueryParam(url, paramName) { function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`); let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
@ -97,13 +100,11 @@
this.startTimer() this.startTimer()
this.gettaoc() this.gettaoc()
this.getmac() this.getmac()
this.gettrue()
} else { } else {
this.id = option.id this.id = option.id
this.startTimer() this.startTimer()
this.gettaoc() this.gettaoc()
this.getmac() this.getmac()
this.gettrue()
} }
// //
xBlufi.initXBlufi(1) xBlufi.initXBlufi(1)
@ -128,10 +129,10 @@
}, },
onShow() { onShow() {
this.getuserinfo()
if (this.orderno) { if (this.orderno) {
this.gethuidaio() this.gethuidaio()
} }
this.getuserinfo()
}, },
onUnload: function() { onUnload: function() {
if (this.timer) { if (this.timer) {
@ -156,22 +157,45 @@
}); });
}, },
methods: { methods: {
gettrue(){ call() {
let phoneNumber = ''
if(this.deviceobj.storeContactMobile == null){
phoneNumber = this.deviceobj.userMobile
}else{
phoneNumber = this.deviceobj.storeContactMobile
}
uni.makePhoneCall({
phoneNumber: phoneNumber,
success: function(res) {
console.log('拨打电话成功', res);
},
fail: function(err) {
console.error('拨打电话失败', err);
uni.showToast({
title: '拨打电话失败',
icon: 'none'
})
}
})
},
gettrue() {
this.$u.get("/app/device/isBind?deviceNo=" + this.id).then((res) => { this.$u.get("/app/device/isBind?deviceNo=" + this.id).then((res) => {
if (res.data == false) { if (res.data == false) {
uni.navigateTo({ uni.navigateTo({
url:'/pages/shouye/index?flag=' + true + '&id=' + this.id url: '/pages/shouye/index?flag=' + true + '&id=' + this.id
}) })
} }
}) })
}, },
getuserinfo() { getuserinfo() {
this.$u.get("/app/user/userInfo").then((res) => { this.$u.get("/app/user/userInfo").then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.gettrue()
} else { } else {
uni.navigateTo({ uni.navigateTo({
url:'/pages/login/login?id=' + 1 url: '/pages/login/login?id=' + 1
}) })
} }
}) })
@ -244,7 +268,7 @@
uni.reLaunch({ uni.reLaunch({
url: '/pages/shouye/index' url: '/pages/shouye/index'
}) })
uni.setStorageSync('time',that.expireTimeStr) uni.setStorageSync('time', that.expireTimeStr)
}, },
fail(err) { fail(err) {
// //
@ -293,7 +317,7 @@
} }
} }
}) })
}else{ } else {
let that = this let that = this
let data = { let data = {
deviceNo: that.id, deviceNo: that.id,
@ -324,7 +348,7 @@
uni.reLaunch({ uni.reLaunch({
url: '/pages/shouye/index' url: '/pages/shouye/index'
}) })
uni.setStorageSync('time',that.expireTimeStr) uni.setStorageSync('time', that.expireTimeStr)
}, },
fail(err) { fail(err) {
// //
@ -456,7 +480,7 @@
// padding-bottom: 41rpx; // padding-bottom: 41rpx;
// } // }
page { page {
// background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0) 100%); background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
} }
.active { .active {
@ -531,9 +555,15 @@
padding-left: 32rpx; padding-left: 32rpx;
font-weight: 600; font-weight: 600;
font-size: 40rpx; font-size: 40rpx;
color: #383838; color: #fff;
margin-bottom: 30rpx; margin-bottom: 30rpx;
margin-top: 110rpx; margin-top: 110rpx;
.wz {
font-weight: 400;
font-size: 32rpx;
margin-top: 30rpx;
}
} }
.box { .box {
@ -573,7 +603,7 @@
.shuom { .shuom {
width: 648rpx; width: 648rpx;
height: 286rpx; height: 230rpx;
background: #FFFFFF; background: #FFFFFF;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1); box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(42, 130, 228, 0.1);
filter: blur(0px); filter: blur(0px);

View File

@ -144,9 +144,9 @@
} }
}) })
} else if (res.cancel) { } else if (res.cancel) {
uni.navigateTo({ // uni.navigateTo({
url: '/pages/shouye/index' // url: '/pages/shouye/index'
}) // })
} }
} }
}) })