This commit is contained in:
3321822538@qq.com 2024-06-14 18:51:43 +08:00
parent ba6b85fe31
commit 0b023c2a3b
14 changed files with 220 additions and 99 deletions

View File

@ -1,9 +1,9 @@
<template>
<view class="page">
<u-navbar title="充值" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff"
title-size='36' height='50'></u-navbar>
<!-- <u-navbar :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff"
title-size='36' height='50'></u-navbar> -->
<view class="title">
设备名称{{deviceobj.deviceName}}
{{deviceobj.deviceName}}
</view>
<view class="box">
<view class="tit">
@ -29,11 +29,11 @@
<view class="shuom" v-for="(item,index) in deviceobj.suitList" :key="index"
v-if="indexactive == item.suitId">
<view class="tits">
<view class="tits" style="margin-top: 10rpx;">
套餐说明
</view>
<view class="wz">
该设备还剩余时长{{expireTimeStr}}分钟
该设备还剩余时长{{expireTimeStr + 1}}分钟
</view>
<view class="">
{{item.description == null ? '无' : item.description}}
@ -83,6 +83,7 @@
}
},
onLoad(option) {
console.log(option.q)
if (option.q) {
function getQueryParam(url, paramName) {
let regex = new RegExp(`[?&]${paramName}=([^&]*)`);
@ -96,11 +97,13 @@
this.startTimer()
this.gettaoc()
this.getmac()
this.gettrue()
} else {
this.id = option.id
this.startTimer()
this.gettaoc()
this.getmac()
this.gettrue()
}
//
xBlufi.initXBlufi(1)
@ -128,6 +131,7 @@
if (this.orderno) {
this.gethuidaio()
}
this.getuserinfo()
},
onUnload: function() {
if (this.timer) {
@ -152,6 +156,26 @@
});
},
methods: {
gettrue(){
this.$u.get("/app/device/isBind?deviceNo=" + this.id).then((res) => {
if (res.data == false) {
uni.navigateTo({
url:'/pages/shouye/index?flag=' + true + '&id=' + this.id
})
}
})
},
getuserinfo() {
this.$u.get("/app/user/userInfo").then((res) => {
if (res.code == 200) {
} else {
uni.navigateTo({
url:'/pages/login/login?id=' + 1
})
}
})
},
startTimer() {
this.timer = setInterval(() => {
this.gettaoc();
@ -220,8 +244,7 @@
uni.reLaunch({
url: '/pages/shouye/index'
})
uni.setStorageSync('time',
that.expireTimeStr)
uni.setStorageSync('time',that.expireTimeStr)
},
fail(err) {
//
@ -301,8 +324,7 @@
uni.reLaunch({
url: '/pages/shouye/index'
})
uni.setStorageSync('time',
that.expireTimeStr)
uni.setStorageSync('time',that.expireTimeStr)
},
fail(err) {
//
@ -434,7 +456,7 @@
// padding-bottom: 41rpx;
// }
page {
background: linear-gradient(180deg, #8883F0 0%, rgba(255, 255, 255, 0) 100%);
// background: linear-gradient(180deg, #fff 0%, rgba(255, 255, 255, 0) 100%);
}
.active {
@ -511,6 +533,7 @@
font-size: 40rpx;
color: #383838;
margin-bottom: 30rpx;
margin-top: 110rpx;
}
.box {

View File

@ -24,7 +24,7 @@
使用中
</view>
<view class="sta_txt" v-if="item.status==1" style="color:seagreen;">
正常
空闲
</view>
</view>
<view class="card_left_no">
@ -67,12 +67,13 @@
isLoading: false,
noMoreData: false,
total: 0,
showflag:false
showflag:false,
}
},
onLoad(option) {
this.storeId = option.storeId
this.getlist()
},
methods: {
swiperchange(e) {
@ -156,7 +157,7 @@
display: flex;
margin-top: 20rpx;
width: 658rpx;
height: 282rpx;
height: 250rpx;
background: #fff;
box-shadow: 0rpx 16rpx 40rpx 0rpx rgba(255, 255, 255, 0);
border-radius: 24rpx 24rpx 24rpx 24rpx;
@ -211,7 +212,7 @@
image {
width: 180rpx;
height: 200rpx;
height: 180rpx;
border-radius: 20rpx;
}
}

View File

@ -17,7 +17,7 @@
</view>
<view class="photos">
<!-- <image src="../../../static/image/a1.png" mode=""></image> -->
<u-icon name="file-text" color="#8883F0" size="40"></u-icon>
<u-icon name="file-text" color="#8883F0" size="50"></u-icon>
<textarea name="" placeholder="详细输入您想了解的信息" id="" v-model="cont" cols="30" rows="10"></textarea>
</view>
@ -38,7 +38,22 @@
cont:''
}
},
onShow() {
this.getuserinfo()
},
methods: {
getuserinfo() {
this.$u.get("/app/user/userInfo").then((res) => {
if (res.code == 200) {
} else {
uni.navigateTo({
url:'/pages/login/login'
})
}
})
},
btnshenq(){
if(this.name == ''){
uni.showToast({

View File

@ -37,18 +37,19 @@
<view class="but"> <input type="text" placeholder="请输入联系电话" v-model="lxphone" /> </view>
</view>
<view class="jinwei">
<view class="tit"> 经纬度</view>
<view class="tit"> 详细地址</view>
<view class="but">
<input type="text" :placeholder="latitude" disabled="true" />
<input type="text" :placeholder="longitude" disabled="true" />
<u-icon name="map-fill" style="position: absolute;top: 44rpx;right: 22rpx;z-index: 99;"
<!-- <input type="text" v-model="latitude" disabled="true" style="color: #666;" />
<input type="text" v-model="longitude" disabled="true" style="color: #666;" /> -->
<input type="text" placeholder="请输入详细地址" v-model="xqdz" />
<u-icon name="map-fill" style="position: absolute;top: 20rpx;right: 22rpx;z-index: 99;"
size="32" @click="btnjwd"></u-icon>
</view>
</view>
<view class="listval">
<!-- <view class="listval">
<view class="tit"> 详细地址</view>
<view class="but"> <input type="text" placeholder="请输入详细地址" v-model="xqdz" /> </view>
</view>
</view> -->
<view class="icon">
<view class="list_box">
<view class="lt">
@ -251,15 +252,9 @@
icon: 'none',
duration: 1000
});
} else if (this.latitude == '请输入纬度') {
}else if (this.longitude == '请输入经度') {
uni.showToast({
title: '请输入纬度',
icon: 'none',
duration: 1000
});
} else if (this.longitude == '请输入经度') {
uni.showToast({
title: '请输入经度',
title: '请点击地图图标选择地址',
icon: 'none',
duration: 1000
});
@ -337,6 +332,7 @@
success: (res) => {
this.latitude = res.latitude;
this.longitude = res.longitude;
this.xqdz = res.name
},
fail: function(err) {
console.log('选择位置失败', err);
@ -421,7 +417,7 @@
.list {
width: 680rpx;
height: 1180rpx;
height: 1020rpx;
background: #FFFFFF;
border-radius: 24rpx 24rpx 24rpx 24rpx;
margin: auto;
@ -489,24 +485,25 @@
display: flex;
justify-content: space-between;
margin-top: 34rpx;
.tit {
margin-top: 40rpx;
margin-top: 10rpx;
font-size: 32rpx;
color: #3D3D3D;
}
.but {
width: 462rpx;
height: 140rpx;
height: 70rpx;
background: #F0F0F0;
border-radius: 12rpx 12rpx 12rpx 12rpx;
position: relative;
input {
height: 70rpx;
line-height: 70rpx;
padding-left: 22rpx;
padding-right: 72rpx;
}
}
}

View File

@ -24,7 +24,7 @@
使用中
</view>
<view class="sta_txt" v-if="item.status==1" style="color:seagreen;">
正常
空闲
</view>
</view>
<view class="card_left_no">

View File

@ -284,18 +284,12 @@
if (systemInfo.platform === 'android') {
// Android
uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' +
options
.data.deviceId + '&name=' +
options.data.name
url: '/page_components/wifilist/index?deviceId=' +options.data.deviceId + '&name=' +options.data.name
})
} else if (systemInfo.platform === 'ios') {
// iOS
uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +
options
.data.deviceId + '&name=' +
options.data.name
url: '/page_fenbao/device/wifivideo?deviceId=' +options.data.deviceId + '&name=' +options.data.name
})
}
} else if (res.cancel) {

View File

@ -37,18 +37,19 @@
<view class="but"> <input type="text" placeholder="请输入联系电话" v-model="lxphone" /> </view>
</view>
<view class="jinwei">
<view class="tit"> 经纬度</view>
<view class="tit"> 详细地址</view>
<view class="but">
<input type="text" v-model="latitude" disabled="true" style="color: #666;" />
<input type="text" v-model="longitude" disabled="true" style="color: #666;" />
<u-icon name="map-fill" style="position: absolute;top: 44rpx;right: 22rpx;z-index: 99;"
<!-- <input type="text" v-model="latitude" disabled="true" style="color: #666;" />
<input type="text" v-model="longitude" disabled="true" style="color: #666;" /> -->
<input type="text" placeholder="请输入详细地址" v-model="xqdz" />
<u-icon name="map-fill" style="position: absolute;top: 20rpx;right: 22rpx;z-index: 99;"
size="32" @click="btnjwd"></u-icon>
</view>
</view>
<view class="listval">
<!-- <view class="listval">
<view class="tit"> 详细地址</view>
<view class="but"> <input type="text" placeholder="请输入详细地址" v-model="xqdz" /> </view>
</view>
</view> -->
<view class="icon">
<view class="list_box">
<view class="lt">
@ -227,15 +228,9 @@
icon: 'none',
duration: 1000
});
} else if (this.latitude == '请输入纬度') {
uni.showToast({
title: '请输入纬度',
icon: 'none',
duration: 1000
});
} else if (this.longitude == '请输入经度') {
uni.showToast({
title: '请输入经度',
title: '请点击地图图标选择位置',
icon: 'none',
duration: 1000
});
@ -302,6 +297,7 @@
success: (res) => {
this.latitude = res.latitude;
this.longitude = res.longitude;
this.xqdz = res.name
},
fail: function(err) {
//
@ -385,7 +381,7 @@
.list {
width: 680rpx;
height: 1180rpx;
height: 1020rpx;
background: #FFFFFF;
border-radius: 24rpx 24rpx 24rpx 24rpx;
margin: auto;
@ -456,14 +452,14 @@
margin-top: 34rpx;
.tit {
margin-top: 40rpx;
margin-top: 10rpx;
font-size: 32rpx;
color: #3D3D3D;
}
.but {
width: 462rpx;
height: 140rpx;
height: 70rpx;
background: #F0F0F0;
border-radius: 12rpx 12rpx 12rpx 12rpx;
position: relative;
@ -472,6 +468,7 @@
height: 70rpx;
line-height: 70rpx;
padding-left: 22rpx;
padding-right: 72rpx;
}
}
}

View File

@ -351,14 +351,14 @@
.moshi {
position: fixed;
bottom: 37vh;
bottom: 38vh;
left: 30rpx;
z-index: 99;
width: 100%;
image {
width: 210rpx;
height: 74rpx !important;
width: 230rpx;
height: 80rpx !important;
}
.img {

View File

@ -375,23 +375,29 @@
this.deviceInfo = res.data
this.storeId = res.data.storeId
this.qrResult = 'CTKG-' + res.data.mac
if (res.data.customPicture != '自定义图片路径') {
if (res.data.customPicture != null) {
this.imglist = res.data.customPicture
} else {
this.imglist = res.data.picture
}
let expireTimeStr = this.deviceInfo.expireTime
let expireTimeParts = expireTimeStr.split(" ");
let expireDateParts = expireTimeParts[0].split("-");
let expireTimePartsTime = expireTimeParts[1].split(":");
let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[2],expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2])
let now = new Date();
let differenceInMs = expireDate - now;
if (differenceInMs <= 0) {
if(this.deviceInfo.expireTime == null){
this.timeday = 0
} else {
this.timeday = Math.abs(Math.floor(differenceInMs / (1000 * 60)));
}else{
let expireTimeStr = this.deviceInfo.expireTime
let expireTimeParts = expireTimeStr.split(" ");
let expireDateParts = expireTimeParts[0].split("-");
let expireTimePartsTime = expireTimeParts[1].split(":");
let expireDate = new Date(expireDateParts[0], expireDateParts[1] - 1, expireDateParts[2],expireTimePartsTime[0], expireTimePartsTime[1], expireTimePartsTime[2])
let now = new Date();
let differenceInMs = expireDate - now;
if (differenceInMs <= 0) {
this.timeday = 0
} else {
this.timeday = Math.abs(Math.floor(differenceInMs / (1000 * 60)));
}
}
this.loadings = true
}
});

View File

@ -67,6 +67,10 @@
</view>
</view>
</view>
<view class="li" style="padding-left: 40%;font-size: 32rpx;" @click="deldevice()">
解除绑定
</view>
</view>
<u-mask :show="showloading"></u-mask>
@ -153,9 +157,9 @@
</view>
</view>
</u-popup>
<view class="btn" @click="deldevice()">
<!-- <view class="btn" @click="deldevice()">
解除绑定
</view>
</view> -->
<!-- 选择店铺 -->
<u-select v-model="showshop" :list="wateringList" @confirm="confirms"></u-select>

View File

@ -98,7 +98,7 @@
使用中
</view>
<view class="sta_txt" v-if="item.status==1" style="color:seagreen;">
正常
空闲
</view>
</view>
<view class="card_left_no">
@ -1366,6 +1366,7 @@
image {
width: 180rpx;
height: 180rpx;
border-radius: 10rpx;
}
}
}

View File

@ -29,10 +29,13 @@
</view>
<button class="button" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber"
style="margin-top: 330rpx;margin-left: -10rpx;">
style="margin-top: 280rpx;margin-left: -10rpx;">
授权登录
</button>
</view>
<button class="button" style="margin-top: 50rpx;margin-left: -10rpx;" @click="btnbudl">
暂不授权登录
</button>
</view>
</view>
</view>
</template>
@ -47,7 +50,13 @@
tittxt: "授权登录",
chooseType: true,
usertype: '',
login: false
login: false,
id:''
}
},
onLoad(option) {
if(option.id){
this.id = option.id
}
},
methods: {
@ -94,11 +103,21 @@
},
async ceshi() {
this.$u.get("/app/user/userInfo").then((res) => {
uni.navigateTo({
url: '/pages/shouye/index'
})
if(this.id == 1){
uni.navigateBack()
}else{
uni.navigateTo({
url: '/pages/shouye/index'
})
}
})
},
btnbudl(){
uni.navigateTo({
url: '/pages/shouye/index'
})
}
}
}
</script>

View File

@ -100,10 +100,57 @@
bgc: {
backgroundColor: "#8883F0",
},
deviceobj:{}
};
},
onLoad() {
// this.initOtherCovers(); //
onLoad(option) {
if (option.flag) {
let id = option.id
this.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
if (res.code == 200) {
this.deviceobj = res.data;
}
})
let that = this
uni.showModal({
title: '提示',
content: '该设备未被绑定,你需进行绑定吗?',
success: function(res) {
if (res.confirm) {
let data = {
deviceNo: id
}
that.$u.put("/app/device/bind", data).then(res => {
if (res.code == 200) {
uni.showModal({
title: '提示',
content: '绑定成功,需前去设置吗?',
success: function(res) {
if (res.confirm) {
uni.navigateTo({
url: '/page_user/sbdetail?id=' +that.deviceobj.deviceId
})
} else if (res.cancel) {
}
}
})
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
})
}
})
} else if (res.cancel) {
uni.navigateTo({
url: '/pages/shouye/index'
})
}
}
})
}
},
onShow() {
this.logins()
@ -474,16 +521,19 @@
.dateactive {
background: #E1F3ED;
}
page {
background: linear-gradient(180deg, #8883F0 10%, rgba(255, 255, 255, 0) 100%);
border-radius: 0rpx 0rpx 0rpx 0rpx;
}
.page {
width: 750rpx;
padding-left: 34rpx;
padding-right: 34rpx;
box-sizing: border-box;
height: 100%;
.tip_box {
position: fixed;
left: 72rpx;
@ -734,7 +784,8 @@
left: -34rpx;
padding-top: 22rpx;
border-radius: 54rpx 54rpx 0 0;
margin-top: 20rpx;
margin-top: 20rpx;
view {
text-align: center;
width: 676rpx;
@ -781,8 +832,8 @@
width: 642rpx;
height: 812rpx;
margin: auto;
border-radius: 30rpx;
overflow: hidden;
border-radius: 30rpx;
overflow: hidden;
}
.tubiao {

View File

@ -26,7 +26,7 @@
</view>
</view>
<view class="list" style="padding-bottom: 240rpx;">
<view class="card_list" v-for="(item,index) in timelist" :key="index">
<view class="card_list" v-for="(item,index) in timelists" :key="index">
<view class="left">
{{yeartime.year + '年' + yeartime.month + '月' + item.createDay + '日'}}
</view>
@ -62,16 +62,16 @@
</view>
</view>
<view class="list" style="padding-bottom: 120rpx;">
<view class="card_list" v-for="(item,index) in timelist" :key="index">
<!-- <view class="list" style="padding-bottom: 120rpx;">
<view class="card_list" v-for="(item,index) in timelists" :key="index">
<view class="left">
{{yeartime.year + '年' + yeartime.month + '月' + item.createDay + '日'}}
{{item.createYear + '年' + item.createMonth + '月' + item.createDay + '日'}}
</view>
<view class="right">
{{item.usedElectriQuantity}}
</view>
</view>
</view>
</view> -->
</view>
<tab-bar :indexs='1'></tab-bar>
</view>
@ -116,8 +116,9 @@
deviceId: '',
userType: '',
totalRecharge: 0,
dateday:'',
timelists:'',
monthdui:''
}
},
onLoad() {
@ -146,6 +147,8 @@
const now = new Date();
this.yeartime.year = now.getFullYear()
this.yeartime.month = now.getMonth() + 1
this.monthdui = this.yeartime.month
this.dateday = String(now.getDate()).padStart(2, '0')
this.gettime()
},
methods: {
@ -172,10 +175,19 @@
this.$u.get('app/bill/landlordCount', data).then((res) => {
if (res.code == 200) {
this.timelist = res.data
this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.map(item => item.recharge);
this.chartday = this.timelist.map(item => item.createDay + '日');
if(this.monthdui != this.yeartime.month){
this.timelists = this.timelist
this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.map(item => item.recharge);
this.chartday = this.timelist.map(item => item.createDay + '日');
}else{
this.timelists = this.timelist.slice(0, 14)
this.timelists.reverse()
this.totalRecharge = res.totalRecharge
this.chartData = this.timelist.slice(0, this.dateday).map(item => item.recharge)
this.chartday = this.timelist.slice(0, this.dateday).map(item => item.createDay + '日');
}
this.loging = true
for (let i = 0; i < this.timelist.length; i++) {
this.recharge += this.timelist[i].recharge
@ -185,6 +197,7 @@
}
})
},
gettimes() {
let data = {