This commit is contained in:
3321822538@qq.com 2024-09-06 18:03:19 +08:00
parent 11604b86f6
commit dd66d10bdb
7 changed files with 368 additions and 329 deletions

View File

@ -4,16 +4,16 @@
:custom-back="btns" title-size='36' height='50' id="navbar">
</u-navbar>
<!-- <view class="dltop">
<view class="dltop">
<view class="dian_list">
<view class="">
--
{{sbobj.voltage == undefined ? '--' : sbobj.voltage}}
</view>
<view class="">
--
{{sbobj.electricity == undefined ? '--' : sbobj.electricity}}
</view>
<view class="">
--
{{sbobj.realTimePower == undefined ? '--' : sbobj.realTimePower}}
</view>
</view>
<view class="dian_list">
@ -28,9 +28,10 @@
</view>
</view>
<view class="botwz">
点击刷新实时信息
<!-- 点击刷新实时信息 -->
历史总用电量{{totalElectriQuantity}}
</view>
</view> -->
</view>
<view class="time_list">
<view class="time_top">
@ -180,7 +181,7 @@
</view> -->
<view class="" v-if="detaobj.suitFeeMode == 2">
<view class="">
<view class="jieshu" v-if="jieshuflag">
<text v-if="detaobj.status == 1">立即支付</text>
<text v-else>结束订单</text>
@ -274,7 +275,8 @@
temperature:null,
du:'',
totalElectriQuantity:'',
suitStartEle :''
suitStartEle :'',
sbobj:{}
}
},
onLoad(option) {
@ -400,299 +402,325 @@
})
},
btnjieshu(){
this.getsb()
this.trueboxfalg = true
},
btnbox() {
this.trueboxfalg = false
this.jieshuflag = true
if (this.onlineStatus == 1) {
if (this.detaobj.suitFeeType == 1 || this.detaobj.suitFeeType == 2) {
let data = {
billId: this.billId
}
this.$u.put(`/app/bill/endSmartUse`, data).then(res => {
if (res.code == 200) {
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
this.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
}, 1500)
} else {
this.getDevice()
this.jieshuflag = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else {
if (this.detaobj.status == 1) {
this.$u.get(`/app/pay/wx/${this.orderno}`).then((res) => {
if (res.code == 200) {
let that = this
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.payParams.timeStamp,
nonceStr: res.data.payParams.nonceStr,
package: res.data.payParams.packageVal,
signType: res.data.payParams.signType,
paySign: res.data.payParams.paySign,
success: (res) => {
that.$u.put(`/app/bill/${that.orderno}/refreshPayResult`)
.then(res => {})
//
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
that.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
}, 1500)
},
fail(err) {
that.getDevice()
that.jieshuflag = false
//
uni.showToast({
title: '支付失败',
icon: 'none',
duration: 2000
});
}
})
}
})
} else {
let data = {
billId: this.billId
}
this.$u.put(`/app/bill/endTimingUse`, data).then(res => {
if (res.code == 200) {
this.$u.get(`/app/pay/wx/${this.orderno}`).then((res) => {
if (res.code == 200) {
let that = this
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.payParams.timeStamp,
nonceStr: res.data.payParams.nonceStr,
package: res.data.payParams.packageVal,
signType: res.data.payParams.signType,
paySign: res.data.payParams.paySign,
success: (res) => {
that.$u.put(
`/app/bill/${that.orderno}/refreshPayResult`
).then(res => {})
//
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
that.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
}, 1500)
},
fail(err) {
that.jieshuflag = false
//
uni.showToast({
title: '支付失败',
icon: 'none',
duration: 2000
});
}
})
}
})
} else {
this.getDevice()
this.jieshuflag = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
}
if(this.detaobj.suitFeeMode == 1){
let data = {
billId: this.billId
}
} else {
// console.log(this.temperature,'this.temperature');
if (this.temperature == null) {
uni.showLoading({
title: '切换中'
})
let that = this
xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
if (that.devicesList.length > 0) {
xBlufi.notifyConnectBle({
isStart: true,
deviceId: that.deviceId,
name: that.name
})
}
}, 2000)
uni.showModal({
title: '温馨提示',
content: `检测到该设备未联网,为您切换为蓝牙模式,支付的时候靠近该设备,并打开蓝牙`,
showCancel: false,
success: function (res) {
}
})
}else{
if(this.detaobj.suitFeeType == 1 || this.detaobj.suitFeeType == 2){
let data = {
billId: this.billId,
totalEle:this.temperature
}
this.$u.put(`/app/bill/endSmartUse`, data).then(res => {
if (res.code == 200) {
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(()=> {
xBlufi.notifySendCustomData({
customData: 'close'
})
setTimeout(() => {
this.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
},1000)
},1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:',err)
}
})
} else {
console.log('手机未连接网络')
// this.baiflag = false
}
}
})
} else {
this.jieshuflag = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
this.$u.put(`/app/bill/endUse`, data).then(res => {
if(res.code == 200){
uni.showModal({
title: '提示',
content: '您确定要提前结束订单吗,将不会产生任何退款和赔偿?',
success: function(res) {
if (res.confirm) {
uni.reLaunch({
url:'/pages/shouye/index'
})
}
}
})
}else{
let data = {
billId: this.billId,
totalEle:this.temperature
}
this.$u.put(`/app/bill/endTimingUse`, data).then(res => {
if (res.code == 200) {
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(()=> {
xBlufi.notifySendCustomData({
customData: 'close'
})
setTimeout(() => {
that.$u.get(`/app/pay/wx/${that.orderno}`).then((res) => {
if (res.code == 200) {
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.payParams.timeStamp,
nonceStr: res.data.payParams.nonceStr,
package: res.data.payParams.packageVal,
signType: res.data.payParams.signType,
paySign: res.data.payParams.paySign,
success: (res) => {
that.$u.put(
`/app/bill/${that.orderno}/refreshPayResult`
).then(res => {})
//
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
that.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
}, 1500)
},
fail(err) {
that.jieshuflag = false
//
uni.showToast({
title: '支付失败',
icon: 'none',
duration: 2000
});
}
})
}
})
},1000)
},1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:',err)
}
})
} else {
console.log('手机未连接网络')
// this.baiflag = false
}
}
})
} else {
this.getDevice()
this.jieshuflag = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
})
}
}
})
}else{
this.getsb()
this.trueboxfalg = true
}
},
btnbox() {
this.trueboxfalg = false
this.jieshuflag = true
if (this.onlineStatus == 1) {
if (this.detaobj.suitFeeType == 1 || this.detaobj.suitFeeType == 2) {
let data = {
billId: this.billId
}
this.$u.put(`/app/bill/endUse`, data).then(res => {
if (res.code == 200) {
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
this.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
}, 1500)
} else {
this.getDevice()
this.jieshuflag = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
} else {
if (this.detaobj.status == 1) {
this.$u.get(`/app/pay/wx/${this.orderno}`).then((res) => {
if (res.code == 200) {
let that = this
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.payParams.timeStamp,
nonceStr: res.data.payParams.nonceStr,
package: res.data.payParams.packageVal,
signType: res.data.payParams.signType,
paySign: res.data.payParams.paySign,
success: (res) => {
that.$u.put(`/app/bill/${that.orderno}/refreshPayResult`)
.then(res => {})
//
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
that.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
}, 1500)
},
fail(err) {
that.getDevice()
that.jieshuflag = false
//
uni.showToast({
title: '支付失败',
icon: 'none',
duration: 2000
});
}
})
}
})
} else {
let data = {
billId: this.billId
}
this.$u.put(`/app/bill/endUse`, data).then(res => {
if (res.code == 200) {
this.$u.get(`/app/pay/wx/${this.orderno}`).then((res) => {
if (res.code == 200) {
let that = this
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.payParams.timeStamp,
nonceStr: res.data.payParams.nonceStr,
package: res.data.payParams.packageVal,
signType: res.data.payParams.signType,
paySign: res.data.payParams.paySign,
success: (res) => {
that.$u.put(
`/app/bill/${that.orderno}/refreshPayResult`
).then(res => {})
//
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
that.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
}, 1500)
},
fail(err) {
that.jieshuflag = false
//
uni.showToast({
title: '支付失败',
icon: 'none',
duration: 2000
});
}
})
}
})
} else {
this.getDevice()
this.jieshuflag = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
}
}
} else {
// console.log(this.temperature,'this.temperature');
if (this.temperature == null) {
uni.showLoading({
title: '切换中'
})
let that = this
xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, that.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({
'isStart': true
})
setTimeout(() => {
xBlufi.notifyStartDiscoverBle({
'isStart': false
})
if (that.devicesList.length > 0) {
xBlufi.notifyConnectBle({
isStart: true,
deviceId: that.deviceId,
name: that.name
})
}
}, 2000)
uni.showModal({
title: '温馨提示',
content: `检测到该设备未联网,为您切换为蓝牙模式,支付的时候靠近该设备,并打开蓝牙`,
showCancel: false,
success: function (res) {
}
})
}else{
if(this.detaobj.suitFeeType == 1 || this.detaobj.suitFeeType == 2){
let data = {
billId: this.billId,
totalEle:this.temperature
}
this.$u.put(`/app/bill/endUse`, data).then(res => {
if (res.code == 200) {
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(()=> {
xBlufi.notifySendCustomData({
customData: 'close'
})
setTimeout(() => {
this.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
},1000)
},1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:',err)
}
})
} else {
console.log('手机未连接网络')
// this.baiflag = false
}
}
})
} else {
this.jieshuflag = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
}else{
let data = {
billId: this.billId,
totalEle:this.temperature
}
this.$u.put(`/app/bill/endUse`, data).then(res => {
if (res.code == 200) {
let that = this
uni.getNetworkType({
success(res) {
if (res.networkType !== 'none') {
uni.getConnectedBluetoothDevices({
success(res) {
setTimeout(()=> {
xBlufi.notifySendCustomData({
customData: 'close'
})
setTimeout(() => {
that.$u.get(`/app/pay/wx/${that.orderno}`).then((res) => {
if (res.code == 200) {
uni.requestPayment({
provider: 'wxpay',
timeStamp: res.data.payParams.timeStamp,
nonceStr: res.data.payParams.nonceStr,
package: res.data.payParams.packageVal,
signType: res.data.payParams.signType,
paySign: res.data.payParams.paySign,
success: (res) => {
that.$u.put(
`/app/bill/${that.orderno}/refreshPayResult`
).then(res => {})
//
uni.showToast({
title: res.msg,
icon: 'success',
duration: 1000
})
setTimeout(() => {
that.jieshuflag = false
uni.reLaunch({
url: '/pages/shouye/index'
})
}, 1500)
},
fail(err) {
that.jieshuflag = false
//
uni.showToast({
title: '支付失败',
icon: 'none',
duration: 2000
});
}
})
}
})
},1000)
},1500)
},
fail(err) {
console.error('获取已连接蓝牙设备信息失败:',err)
}
})
} else {
console.log('手机未连接网络')
// this.baiflag = false
}
}
})
} else {
this.getDevice()
this.jieshuflag = false
uni.showToast({
title: res.msg,
icon: 'none',
duration: 2000
})
}
})
}
}
}
},
//
@ -771,6 +799,7 @@
getsb() {
this.$u.get(`/app/device/${this.sbid}`).then(res => {
if (res.code == 200) {
this.sbobj = res.data
this.onlineStatus = res.data.onlineStatus
this.qrResult = res.data.mac
this.totalElectriQuantity = res.data.totalElectriQuantity

View File

@ -184,7 +184,7 @@
} else if (res.code == 500) {
uni.showToast({
title: res.msg,
icon: 'success',
icon: 'none',
duration: 1000
})
this.btnmsk = false

View File

@ -1,6 +1,6 @@
<template>
<view class="page">
<u-navbar title="常见问题" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36'
<u-navbar :title="tit" :border-bottom="false" :background="bgc" title-color='#fff' back-icon-color="#fff" title-size='36'
height='50'></u-navbar>
<view class="serch">
<u-search placeholder="搜索问题" height="72" :showAction="false" v-model="keyword" @change="sousuo" shape="square"></u-search>
@ -40,10 +40,16 @@
listitem: [],
huanindex: 1,
keyword: '',
flag:false
flag:false,
tit:''
}
},
onLoad() {
onLoad(option) {
if(option.id){
this.tit = '帮助中心'
}else{
this.tit = '常见问题'
}
this.getfenlei()
setTimeout(() => {
this.getlists()
@ -124,13 +130,11 @@
this.current = index;
this.getlists()
}
},
getlists() {
this.$u.get('/app/article/list?classifyId=' + this.classifyId + '&pageNum=' + 1 + '&pageSize=' + 6).then(
res => {
if (res.code == 200) {
this.listitem = res.rows
// console.log(this.listitem);
}

View File

@ -23,9 +23,9 @@
<view class="" style="color: #8883F0;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
蓝牙强度:{{item.RSSI}}
</view>
<!-- <view @click="btnshows(item,index)" style="color: #8883F0;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
<view @click="btnshows(item,index)" style="color: #8883F0;margin-top: 10rpx;margin-bottom: 10rpx;text-align: left;">
型号选择:{{item.xuanz == undefined ? '--' : item.xuanz}}
</view> -->
</view>
</view>
<view class="rt">
<!-- <text style="margin-bottom: 10rpx;" :id="item.deviceId" @tap="createBLEConnections(item)">响铃</text> -->

View File

@ -128,7 +128,7 @@
</view>
<view class="bot">收费方式</view>
</view>
<view class="cont" @click="topage(5)" v-if="modelId != 34">
<view class="cont" @click="topage(5)" v-if="!modelId.some(tag => tag == 3)">
<view class="top">
<image style="width: 58rpx;height: 58rpx;"
src="https://api.ccttiot.com/smartmeter/img/static/uik9veDG6pMVG5M1Vxze" mode="">
@ -284,7 +284,7 @@
timer: null,
url: "",
deviceNo: '',
modelid:''
modelId:[]
}
},
onLoad(option) {
@ -662,13 +662,14 @@
this.$u.get("/app/device/" + id).then((res) => {
if (res.code == 200) {
this.deviceInfo = res.data
res.data.modelTags.forEach(item => {
if(item == 3){
this.modelid = 34
}else{
this.modelis = item
}
})
this.modelId = res.data.modelTags
// res.data.modelTags.forEach(item => {
// if(item == 3){
// return this.modelId = 34
// }else{
// this.modelId = item
// }
// })
this.storeId = res.data.storeId
this.deviceNo = res.data.deviceNo
// this.qrResult = 'CTKG-' + res.data.mac

View File

@ -5,6 +5,9 @@
<view class="card">
<view class="icon">
<view class="tit">
设备主图
</view>
<view class="imgbox" v-if="userImgs">
<view style="border: 0;outline: none;width: 143rpx;padding-left: 0rpx;height: 143rpx;border-radius: 16rpx;margin: auto;" @click="getImage">
<image style="border-radius: 10rpx;" :src="userImgs" mode="aspectFit"></image>
@ -76,13 +79,13 @@
</view>
</view>
</view>
<view class="li" v-if="listobj.modelId != 34">
<view class="li" v-if="!modelId.some(tag => tag == 3)" style="border-bottom: 0;">
<view class="tit">
WiFi名称
</view>
<view class="info">
<view class="txt">
{{listobj.wifi == null ? '' : listobj.wifi}}
{{listobj.wifi == null || listobj.wifi == '创特物联TP' ? '--' : listobj.wifi}}
</view>
</view>
</view>
@ -233,7 +236,7 @@
userImgs:'',
url:'',
token:'',
modelid:''
modelId:''
}
},
onLoad(option) {
@ -542,13 +545,7 @@
this.$u.get("/app/device/" + id).then((res) => {
if (res.code == 200) {
this.listobj = res.data
res.data.modelTags.forEach(item => {
if(item == 3){
this.modelid = 34
}else{
this.modelis = item
}
})
this.modelId = res.data.modelTags
}
})
}
@ -577,7 +574,7 @@
bottom: 230rpx;
width: 632rpx;
height: 90rpx;
background-color: red;
background-color: #8883f0;
text-align: center;
line-height: 90rpx;
font-size: 36rpx;
@ -788,9 +785,17 @@
}
}
.icon {
.tit{
padding-top: 50rpx;
box-sizing: border-box;
font-size: 32rpx;
}
margin-top: 40rpx;
margin-bottom: 30rpx;
display: flex;
justify-content: space-between;
.imgbox {
margin-left: 300rpx;
image {
width: 142rpx;
height: 142rpx;

View File

@ -16,10 +16,10 @@
</view>
</view>
<view class="">
<view class="botcard" @click="btnsblr">
<!-- <view class="botcard" @click="btnsblr"> -->
<!-- <image src="https://api.ccttiot.com/smartmeter/img/static/uYWpW30vIQ6M4svb7Vnb"></image> -->
<view class="txt">设备录入</view>
</view>
<!-- <view class="txt">设备录入</view> -->
<!-- </view> -->
</view>
</view>
<!-- <view class="tit">
@ -77,10 +77,10 @@
<image src="https://api.ccttiot.com/smartmeter/img/static/uYOquvGtfb1sm5F60NgJ" mode=""></image>
<view class="txt">商家合作</view>
</view> -->
<!-- <view class="botcard" @click="topage(2)">
<view class="botcard" @click="topage(2)">
<image src="https://api.ccttiot.com/smartmeter/img/static/u6qVTFXdkQKEqE1y0J4o" mode=""></image>
<view class="txt">常见问题</view>
</view> -->
<view class="txt">帮助中心</view>
</view>
<!-- <view class="botcard" @click="topage(3)">
<image src="https://api.ccttiot.com/smartmeter/img/static/uGlrjkSOTDXMFuuRb03l" mode=""></image>
<view class="txt">意见反馈</view>
@ -175,7 +175,7 @@
})
}else if(num==2){
uni.navigateTo({
url:'/page_fenbao/statulist/question/index'
url:'/page_fenbao/statulist/question/index?id=' + 1
})
}else if(num==3){
uni.navigateTo({