新增用户下单获取手机号功能
This commit is contained in:
parent
d3c488c8d1
commit
c6cd07b711
|
@ -19,7 +19,7 @@ const install = (Vue, vm) => {
|
||||||
// },
|
// },
|
||||||
// });
|
// });
|
||||||
Vue.prototype.$u.http.setConfig({
|
Vue.prototype.$u.http.setConfig({
|
||||||
// baseUrl: 'http://192.168.2.81:10002',
|
// baseUrl: 'http://192.168.2.106:10002',
|
||||||
baseUrl: 'https://kg.chuangtewl.com/prod-api',
|
baseUrl: 'https://kg.chuangtewl.com/prod-api',
|
||||||
// loadingText: '努力加载中~',
|
// loadingText: '努力加载中~',
|
||||||
// loadingTime: 1000,
|
// loadingTime: 1000,
|
||||||
|
@ -101,7 +101,7 @@ const install = (Vue, vm) => {
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
wx.login({
|
wx.login({
|
||||||
success(res) {
|
success(res) {
|
||||||
if (res.code) {
|
if (res.code) {
|
||||||
|
|
|
@ -53,15 +53,6 @@
|
||||||
<view class="card_left">
|
<view class="card_left">
|
||||||
<view class="txt" style="font-size: 28rpx;">
|
<view class="txt" style="font-size: 28rpx;">
|
||||||
<text>{{row.name}} </text>
|
<text>{{row.name}} </text>
|
||||||
<!-- <text v-if="row.value != null">
|
|
||||||
(通电时长:{{row.value}}
|
|
||||||
<text v-if="row.timeUnit == 1">日</text>
|
|
||||||
<text v-if="row.timeUnit == 2">时</text>
|
|
||||||
<text v-if="row.timeUnit == 3">分钟</text>
|
|
||||||
<text v-if="row.timeUnit == 4">秒</text>
|
|
||||||
)</text>
|
|
||||||
<text v-else>(智能计时)</text>
|
|
||||||
<text>¥{{row.price}}</text> -->
|
|
||||||
<view class="">
|
<view class="">
|
||||||
<text style="margin-top: 10rpx;" v-if="row.feeType == 1">计时收费</text>
|
<text style="margin-top: 10rpx;" v-if="row.feeType == 1">计时收费</text>
|
||||||
<text style="margin-top: 10rpx;" v-if="row.feeType == 2">按量收费</text>
|
<text style="margin-top: 10rpx;" v-if="row.feeType == 2">按量收费</text>
|
||||||
|
@ -70,10 +61,12 @@
|
||||||
(<text style="margin-top: 10rpx;" v-if="row.feeMode == 1">单次收费</text>
|
(<text style="margin-top: 10rpx;" v-if="row.feeMode == 1">单次收费</text>
|
||||||
<text style="margin-top: 10rpx;" v-if="row.feeMode == 2">智能收费</text>)
|
<text style="margin-top: 10rpx;" v-if="row.feeMode == 2">智能收费</text>)
|
||||||
<text style="width: 20rpx;display: inline-block;"></text>
|
<text style="width: 20rpx;display: inline-block;"></text>
|
||||||
<text style="margin-top: 10rpx;" v-if="row.timeUnit == 2 && row.feeType != 3 && row.feeType != 4">{{row.value}}时 {{row.price}}元</text>
|
|
||||||
<text style="margin-top: 10rpx;" v-if="row.timeUnit == 3 && row.feeType != 3 && row.feeType != 4">{{row.value}}分 {{row.price}}元</text>
|
|
||||||
<text style="margin-top: 10rpx;" v-if="row.timeUnit == 4 && row.feeType != 3 && row.feeType != 4">{{row.value}}秒 {{row.price}}元</text>
|
|
||||||
<text style="margin-top: 10rpx;margin-left: 6rpx;" v-if="row.feeMode == 2">押金{{row.deposit}}元</text>
|
<text style="margin-top: 10rpx;margin-left: 6rpx;" v-if="row.feeMode == 2">押金{{row.deposit}}元</text>
|
||||||
|
<text v-else>
|
||||||
|
<text style="margin-top: 10rpx;" v-if="row.timeUnit == 2 && row.feeType != 3 && row.feeType != 4">{{row.value}}时 {{row.price}}元</text>
|
||||||
|
<text style="margin-top: 10rpx;" v-if="row.timeUnit == 3 && row.feeType != 3 && row.feeType != 4">{{row.value}}分 {{row.price}}元</text>
|
||||||
|
<text style="margin-top: 10rpx;" v-if="row.timeUnit == 4 && row.feeType != 3 && row.feeType != 4">{{row.value}}秒 {{row.price}}元</text>
|
||||||
|
</text>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="ccc">
|
<view class="ccc">
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="botwz">
|
<view class="botwz">
|
||||||
<!-- 点击刷新实时信息 -->
|
<!-- 点击刷新实时信息 -->
|
||||||
<view @click="shuaxin" style="width: 100%;display: flex;color: #fff;justify-content: center;align-items: center;padding-top:40rpx;padding-bottom: 30rpx;box-sizing: border-box;">
|
<view @click="shuaxin(1)" style="width: 100%;display: flex;color: #fff;justify-content: center;align-items: center;padding-top:40rpx;padding-bottom: 30rpx;box-sizing: border-box;">
|
||||||
点击刷新实时信息
|
点击刷新实时信息
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -94,11 +94,14 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="qian">
|
<view class="qian">
|
||||||
<view class="yajin">
|
<view class="yajin">
|
||||||
<text v-if="detaobj.suitFeeType == 1">{{detaobj.suitTime == null ? '--' : detaobj.suitTime}}<text
|
|
||||||
v-if="detaobj.suitTimeUnit == 2">时</text> <text v-if="detaobj.suitTimeUnit == 3">分钟</text>
|
|
||||||
<text v-if="detaobj.suitTimeUnit == 4">秒</text></text>
|
|
||||||
<text v-if="detaobj.suitFeeType == 2">{{detaobj.suitTime}}度</text>
|
|
||||||
<text v-if="detaobj.suitFeeMode == 2">押金</text>
|
<text v-if="detaobj.suitFeeMode == 2">押金</text>
|
||||||
|
<text v-else>
|
||||||
|
<text v-if="detaobj.suitFeeType == 1">{{detaobj.suitTime == null ? '--' : detaobj.suitTime}}<text
|
||||||
|
v-if="detaobj.suitTimeUnit == 2">时</text> <text v-if="detaobj.suitTimeUnit == 3">分钟</text>
|
||||||
|
<text v-if="detaobj.suitTimeUnit == 4">秒</text></text>
|
||||||
|
<text v-if="detaobj.suitFeeType == 2">{{detaobj.suitTime}}度</text>
|
||||||
|
</text>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
<view class="yuan" v-if="detaobj.suitFeeMode == 2">
|
<view class="yuan" v-if="detaobj.suitFeeMode == 2">
|
||||||
{{detaobj.suitDeposit == null ? '--' : detaobj.suitDeposit}}元
|
{{detaobj.suitDeposit == null ? '--' : detaobj.suitDeposit}}元
|
||||||
|
@ -226,6 +229,24 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="mask" v-if="trueboxfalg"></view>
|
<view class="mask" v-if="trueboxfalg"></view>
|
||||||
|
|
||||||
|
|
||||||
|
<view class="tip_box" v-if="czflag">
|
||||||
|
<view class="top">
|
||||||
|
<view class="txt">
|
||||||
|
系统检测该设备未联网或者为蓝牙版本,金额充值失败,请靠近设备进行蓝牙充值
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="bot">
|
||||||
|
<view class="bot_left" @click="czflag = false">
|
||||||
|
取消
|
||||||
|
</view>
|
||||||
|
<view class="bot_right" @click="tocz()">
|
||||||
|
蓝牙充值
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
</view>
|
||||||
|
<view class="masks" v-if="czflag"></view>
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
|
@ -262,6 +283,7 @@
|
||||||
"水表",
|
"水表",
|
||||||
|
|
||||||
],
|
],
|
||||||
|
czflag:false,
|
||||||
curtitidx: 0,
|
curtitidx: 0,
|
||||||
id: '',
|
id: '',
|
||||||
timeday: '',
|
timeday: '',
|
||||||
|
@ -296,7 +318,9 @@
|
||||||
suitStartEle: '',
|
suitStartEle: '',
|
||||||
sbobj: {},
|
sbobj: {},
|
||||||
jieshufalg:false,
|
jieshufalg:false,
|
||||||
channelId:''
|
channelId:'',
|
||||||
|
dingobj: '',
|
||||||
|
timerone:null
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
@ -309,8 +333,11 @@
|
||||||
this.opflag = option.flag
|
this.opflag = option.flag
|
||||||
}
|
}
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
this.shuaxin()
|
// this.shuaxin()
|
||||||
|
// this.gethuidaio()
|
||||||
|
this.startTimerone()
|
||||||
},1500)
|
},1500)
|
||||||
|
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// 计算剩余时间
|
// 计算剩余时间
|
||||||
|
@ -335,6 +362,8 @@
|
||||||
},
|
},
|
||||||
onUnload: function() {
|
onUnload: function() {
|
||||||
console.log("unload ");
|
console.log("unload ");
|
||||||
|
clearInterval(this.timerone);
|
||||||
|
this.timerone= null
|
||||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
||||||
wx.closeBLEConnection({
|
wx.closeBLEConnection({
|
||||||
deviceId: this.deviceId,
|
deviceId: this.deviceId,
|
||||||
|
@ -359,6 +388,7 @@
|
||||||
onShow() {
|
onShow() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.startTimers()
|
this.startTimers()
|
||||||
|
this.gethuidaio()
|
||||||
if (this.id) {
|
if (this.id) {
|
||||||
//判断有没有id 没有的话则直接返回首页
|
//判断有没有id 没有的话则直接返回首页
|
||||||
} else {
|
} else {
|
||||||
|
@ -366,7 +396,7 @@
|
||||||
url: '/pages/shouye/index'
|
url: '/pages/shouye/index'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, 100)
|
}, 1000)
|
||||||
},
|
},
|
||||||
onHide() {
|
onHide() {
|
||||||
this.stopTimer();
|
this.stopTimer();
|
||||||
|
@ -383,6 +413,37 @@
|
||||||
this.stopTimer();
|
this.stopTimer();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
startTimerone() {
|
||||||
|
// 清除之前可能存在的定时器,防止重复设置
|
||||||
|
clearInterval(this.timerone);
|
||||||
|
this.timerone = setInterval(() => {
|
||||||
|
this.shuaxin()
|
||||||
|
this.gethuidaio()
|
||||||
|
}, 2000);
|
||||||
|
},
|
||||||
|
// 判断是否充值失败 充值失败启用蓝牙离线充值
|
||||||
|
gethuidaio() {
|
||||||
|
this.$u.get('/app/bill/recharge/device/fail/list').then(res => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
if (res.data.length > 0) {
|
||||||
|
this.czflag = true
|
||||||
|
this.dingobj = res.data
|
||||||
|
clearInterval(this.timerone);
|
||||||
|
this.timerone= null
|
||||||
|
} else {
|
||||||
|
uni.removeStorageSync('time')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 点击进行蓝牙离线充值
|
||||||
|
tocz() {
|
||||||
|
this.czflag = false
|
||||||
|
uni.navigateTo({
|
||||||
|
url: '/page_fenbao/chongzhi?dingobj=' + JSON.stringify(this.dingobj)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
// 点击拨打客服电话
|
// 点击拨打客服电话
|
||||||
btncall(){
|
btncall(){
|
||||||
let phoneNumber = ''
|
let phoneNumber = ''
|
||||||
|
@ -543,16 +604,18 @@
|
||||||
|
|
||||||
|
|
||||||
// 点击进行强刷数据
|
// 点击进行强刷数据
|
||||||
shuaxin(){
|
shuaxin(txt){
|
||||||
this.$u.get(`/app/device/${this.sbid}/refreshIot`).then((res) => {
|
this.$u.get(`/app/device/${this.sbid}/refreshIot`).then((res) => {
|
||||||
if(res.code == 200){
|
if(res.code == 200){
|
||||||
this.getDevice()
|
this.getDevice()
|
||||||
this.getsb()
|
this.getsb()
|
||||||
uni.showToast({
|
if(txt == 1){
|
||||||
title: res.msg,
|
uni.showToast({
|
||||||
icon: 'success',
|
title: res.msg,
|
||||||
duration: 1500
|
icon: 'success',
|
||||||
})
|
duration: 1500
|
||||||
|
})
|
||||||
|
}
|
||||||
}else{
|
}else{
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
|
@ -1102,7 +1165,7 @@
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取设备详情
|
// 获取订单详情
|
||||||
getDevice() {
|
getDevice() {
|
||||||
this.$u.get(`/app/bill/byNo/${this.id}`).then(res => {
|
this.$u.get(`/app/bill/byNo/${this.id}`).then(res => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
|
@ -1112,6 +1175,10 @@
|
||||||
this.detaobj = res.data
|
this.detaobj = res.data
|
||||||
this.billId = res.data.billId
|
this.billId = res.data.billId
|
||||||
this.orderno = res.data.billNo
|
this.orderno = res.data.billNo
|
||||||
|
if(res.data.deviceRechargeStatus == 1){
|
||||||
|
clearInterval(this.timerone);
|
||||||
|
this.timerone = null
|
||||||
|
}
|
||||||
this.getprice()
|
this.getprice()
|
||||||
let dateTimeString = res.data.suitStartTime // 示例时间字符串
|
let dateTimeString = res.data.suitStartTime // 示例时间字符串
|
||||||
this.timeDifferenceString = this.calculateTimeDifference(dateTimeString); // 调用函数
|
this.timeDifferenceString = this.calculateTimeDifference(dateTimeString); // 调用函数
|
||||||
|
@ -1805,7 +1872,72 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.masks {
|
||||||
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
|
position: fixed;
|
||||||
|
top: 0;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
background-color: #000;
|
||||||
|
opacity: .6;
|
||||||
|
z-index: 998;
|
||||||
|
}
|
||||||
|
.tip_box {
|
||||||
|
position: fixed;
|
||||||
|
left: 72rpx;
|
||||||
|
top: 700rpx;
|
||||||
|
width: 610rpx;
|
||||||
|
background: #F7FAFE;
|
||||||
|
border-radius: 30rpx 30rpx 30rpx 30rpx;
|
||||||
|
z-index: 10000000;
|
||||||
|
|
||||||
|
.top {
|
||||||
|
padding: 52rpx 38rpx 42rpx 36rpx;
|
||||||
|
|
||||||
|
.txt {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 32rpx;
|
||||||
|
color: #3D3D3D;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.bot {
|
||||||
|
border-top: 2rpx solid #D8D8D8;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: nowrap;
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
|
.bot_left {
|
||||||
|
width: 50%;
|
||||||
|
height: 98rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #3D3D3D;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bot_right {
|
||||||
|
width: 50%;
|
||||||
|
height: 98rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
border-left: 2rpx solid #D8D8D8;
|
||||||
|
font-weight: 500;
|
||||||
|
font-size: 36rpx;
|
||||||
|
color: #8883F0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
.page {
|
.page {
|
||||||
.zhuhu {
|
.zhuhu {
|
||||||
margin-top: 60rpx;
|
margin-top: 60rpx;
|
||||||
|
|
|
@ -116,10 +116,14 @@
|
||||||
<u-checkbox v-model="checked" @change="checkboxChange" active-color="#8883F0 ">我已同意
|
<u-checkbox v-model="checked" @change="checkboxChange" active-color="#8883F0 ">我已同意
|
||||||
</u-checkbox><text @click="btnyonghu">《用户服务协议》</text> <text @click="btnyinsi">《隐私政策》</text>
|
</u-checkbox><text @click="btnyonghu">《用户服务协议》</text> <text @click="btnyinsi">《隐私政策》</text>
|
||||||
</u-checkbox-group>
|
</u-checkbox-group>
|
||||||
<view class="zf" @click="btnzhifu" v-if="zhifuflag">
|
<!-- <view class="zf" v-else>
|
||||||
立即支付
|
立即支付
|
||||||
</view>
|
</view> -->
|
||||||
<view class="zf" v-else>
|
<!-- 获取手机号 -->
|
||||||
|
<button class="zf" v-if="telslag" open-type="getPhoneNumber" @getphonenumber="getPhoneNumber">
|
||||||
|
立即支付
|
||||||
|
</button>
|
||||||
|
<view class="zf" @click="btnzhifu" v-else>
|
||||||
立即支付
|
立即支付
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
@ -148,11 +152,12 @@
|
||||||
<view v-if="swindleflag" class="" style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #000;opacity: .5;z-index: 98;"></view>
|
<view v-if="swindleflag" class="" style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #000;opacity: .5;z-index: 98;"></view>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
var xBlufi = require("@/page_components/blufi/xBlufi.js");
|
var xBlufi = require("@/page_components/blufi/xBlufi.js");
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
@ -192,7 +197,10 @@
|
||||||
payNo:'',
|
payNo:'',
|
||||||
q:'',
|
q:'',
|
||||||
channelId:'',
|
channelId:'',
|
||||||
swindleflag:true
|
swindleflag:true,
|
||||||
|
phonenumber:'',
|
||||||
|
mchShowBillMobile:'',
|
||||||
|
telslag:false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(option) {
|
onLoad(option) {
|
||||||
|
@ -235,6 +243,7 @@
|
||||||
if (this.id != '') {
|
if (this.id != '') {
|
||||||
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.phonenumber = res.data.phonenumber
|
||||||
this.getone()
|
this.getone()
|
||||||
} else {
|
} else {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
|
@ -411,6 +420,12 @@
|
||||||
this.deviceobj = res.data
|
this.deviceobj = res.data
|
||||||
this.zfobj = res.data.suitList[0]
|
this.zfobj = res.data.suitList[0]
|
||||||
let targetDateStr = this.deviceobj.expireTime
|
let targetDateStr = this.deviceobj.expireTime
|
||||||
|
this.mchShowBillMobile = res.data.mchShowBillMobile
|
||||||
|
if(this.mchShowBillMobile == true && this.phonenumber == ''){
|
||||||
|
this.telslag = true
|
||||||
|
}else{
|
||||||
|
this.telslag = false
|
||||||
|
}
|
||||||
if(targetDateStr != null){
|
if(targetDateStr != null){
|
||||||
let targetParts = targetDateStr.split(/[- :]/)
|
let targetParts = targetDateStr.split(/[- :]/)
|
||||||
let targetDate = new Date(targetParts[0], targetParts[1] - 1, targetParts[2], targetParts[3], targetParts[4], targetParts[5])
|
let targetDate = new Date(targetParts[0], targetParts[1] - 1, targetParts[2], targetParts[3], targetParts[4], targetParts[5])
|
||||||
|
@ -456,7 +471,30 @@
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
duration: 1000
|
duration: 1000
|
||||||
})
|
})
|
||||||
} else if (this.onlineStatus == 1) {
|
}else if(this.mchShowBillMobile == true && this.phonenumber == ''){
|
||||||
|
this.getPhoneNumber()
|
||||||
|
}else {
|
||||||
|
this.getzhifu()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 获取手机号
|
||||||
|
getPhoneNumber(e){
|
||||||
|
// console.log(e,'121212');
|
||||||
|
this.$u.put(`/app/user/bindWxMobile?mobileCode=${e.detail.code}`).then(res =>{
|
||||||
|
if(res.code == 200){
|
||||||
|
this.getzhifu()
|
||||||
|
}else{
|
||||||
|
uni.showToast({
|
||||||
|
title: res.msg,
|
||||||
|
icon: 'none',
|
||||||
|
duration: 1000
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 支付
|
||||||
|
getzhifu(){
|
||||||
|
if (this.onlineStatus == 1) {
|
||||||
uni.showLoading({
|
uni.showLoading({
|
||||||
title: '准备支付中...'
|
title: '准备支付中...'
|
||||||
})
|
})
|
||||||
|
@ -761,46 +799,6 @@
|
||||||
this.zhifuflag = true
|
this.zhifuflag = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
// that.$u.get('/app/bill/recharge/device/fail/list').then(res => {
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// // console.log('获取订单状态',res);
|
|
||||||
// let dingobj = res.data[0].billNo
|
|
||||||
// // console.log(dingobj,'订单号');
|
|
||||||
// uni.getNetworkType({
|
|
||||||
// success(res) {
|
|
||||||
// if (res.networkType !== 'none') {
|
|
||||||
// uni.getConnectedBluetoothDevices({
|
|
||||||
// success(res) {
|
|
||||||
// xBlufi.notifySendCustomData({
|
|
||||||
// customData: "time@" + that.jine
|
|
||||||
// })
|
|
||||||
// },
|
|
||||||
// fail(err) {
|
|
||||||
// console.error('获取已连接蓝牙设备信息失败:',err)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// that.$u.get(`/app/bill/recharge/${dingobj}/bluetoothSuccess`).then(res => {
|
|
||||||
// if (res.code == 200) {
|
|
||||||
// this.zhifuflag = true
|
|
||||||
// console.log('蓝牙离线充值成功')
|
|
||||||
// setTimeout(() => {
|
|
||||||
// uni.reLaunch({
|
|
||||||
// url: '/pages/shouye/index'
|
|
||||||
// })
|
|
||||||
// },1000)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// } else {
|
|
||||||
// console.log('手机未连接网络')
|
|
||||||
// // this.baiflag = false
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// 11111111111111111111111
|
|
||||||
// 支付成功逻辑
|
|
||||||
// uni.setStorageSync('time', that.expireTimeStr)
|
|
||||||
}else{
|
}else{
|
||||||
let data = {
|
let data = {
|
||||||
billNo:that.orderno,
|
billNo:that.orderno,
|
||||||
|
@ -923,6 +921,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
startLoading() {
|
startLoading() {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
const intervalId = setInterval(() => {
|
const intervalId = setInterval(() => {
|
||||||
|
|
|
@ -378,11 +378,11 @@
|
||||||
if (this.dotShowInterval) {
|
if (this.dotShowInterval) {
|
||||||
clearInterval(this.dotShowInterval);
|
clearInterval(this.dotShowInterval);
|
||||||
}
|
}
|
||||||
console.log("unload ");
|
// console.log("unload ");
|
||||||
xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
// xBlufi.listenDeviceMsgEvent(false, this.funListenDeviceMsgEvent);
|
||||||
wx.closeBLEConnection({
|
// wx.closeBLEConnection({
|
||||||
deviceId: this.objlist.deviceId,
|
// deviceId: this.objlist.deviceId,
|
||||||
})
|
// })
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// 开始闪烁动画
|
// 开始闪烁动画
|
||||||
|
|
|
@ -197,7 +197,6 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="">
|
<view class="">
|
||||||
|
|
||||||
<view class="cont" @click="topage(5)" v-if="modelId.some(tag => tag == 2)">
|
<view class="cont" @click="topage(5)" v-if="modelId.some(tag => tag == 2)">
|
||||||
<view class="top">
|
<view class="top">
|
||||||
<image style="width: 44rpx;height: 44rpx;"
|
<image style="width: 44rpx;height: 44rpx;"
|
||||||
|
@ -307,6 +306,7 @@
|
||||||
<view v-if="btnmsk"
|
<view v-if="btnmsk"
|
||||||
style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #000;opacity: .1;z-index: 999;">
|
style="width: 100%;height: 100vh;position: fixed;top: 0;left: 0;background-color: #000;opacity: .1;z-index: 999;">
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
@ -320,7 +320,7 @@
|
||||||
components: {
|
components: {
|
||||||
uniEcCanvas
|
uniEcCanvas
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
suitSurplus:'',
|
suitSurplus:'',
|
||||||
showflag: false,
|
showflag: false,
|
||||||
|
@ -975,7 +975,7 @@
|
||||||
url: '/page_user/cbRecord?id=' + this.id
|
url: '/page_user/cbRecord?id=' + this.id
|
||||||
})
|
})
|
||||||
} else if (num == 1) {
|
} else if (num == 1) {
|
||||||
console.log(this.deviceInfo.onlineStatus, 'this.deviceInfo.onlineStatusthis.deviceInfo.onlineStatus');
|
// console.log(this.deviceInfo.onlineStatus, 'this.deviceInfo.onlineStatusthis.deviceInfo.onlineStatus');
|
||||||
if (this.deviceInfo.onlineStatus == 1) {
|
if (this.deviceInfo.onlineStatus == 1) {
|
||||||
let that = this
|
let that = this
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
|
@ -987,22 +987,18 @@
|
||||||
//归零
|
//归零
|
||||||
that.$u.put(`/app/device/${that.id}/reset`).then((res) => {
|
that.$u.put(`/app/device/${that.id}/reset`).then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
// console.log(res.data);
|
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
icon: 'none',
|
icon: 'success',
|
||||||
duration: 2000
|
|
||||||
})
|
|
||||||
that.getshuax()
|
|
||||||
that.deviceInfo.status = 1
|
|
||||||
that.imgflag = false
|
|
||||||
that.tdtxt = '关闭'
|
|
||||||
} else if (res.msg == '设备剩余时间不足,无需归零') {
|
|
||||||
uni.showToast({
|
|
||||||
title: '设备剩余时间不足,无需归零',
|
|
||||||
icon: 'none',
|
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
|
that.getDevice(that.id)
|
||||||
|
setTimeout(()=>{
|
||||||
|
that.deviceInfo.status = 1
|
||||||
|
that.imgflag = false
|
||||||
|
that.tdtxt = '关闭'
|
||||||
|
},1000)
|
||||||
|
// that.getshuax()
|
||||||
} else if (res.code == 500) {
|
} else if (res.code == 500) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
|
@ -1283,14 +1279,14 @@
|
||||||
duration: 2000
|
duration: 2000
|
||||||
})
|
})
|
||||||
// this.getshuax()
|
// this.getshuax()
|
||||||
this.getDevice(this.id)
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
this.getshuax()
|
||||||
this.cztime = ''
|
this.cztime = ''
|
||||||
this.danwei = ''
|
this.danwei = ''
|
||||||
this.deviceInfo.status = 2
|
this.deviceInfo.status = 2
|
||||||
this.tdtxt = '开启'
|
this.tdtxt = '开启'
|
||||||
this.imgflag = true
|
this.imgflag = true
|
||||||
}, 1000)
|
}, 2000)
|
||||||
} else if (res.code == 500) {
|
} else if (res.code == 500) {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg,
|
title: res.msg,
|
||||||
|
@ -1390,8 +1386,6 @@
|
||||||
this.vipflag = false
|
this.vipflag = false
|
||||||
this.cztime = ''
|
this.cztime = ''
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
funListenDeviceMsgEvent: function(options) {
|
funListenDeviceMsgEvent: function(options) {
|
||||||
switch (options.type) {
|
switch (options.type) {
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
|
case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_MY_DATA:
|
||||||
|
@ -1424,14 +1418,9 @@
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
|
case xBlufi.XBLUFI_TYPE.TYPE_CONNECTED:
|
||||||
// console.log("连接回调:" + JSON.stringify(options))
|
|
||||||
if (options.result) {
|
if (options.result) {
|
||||||
this.bluetoothflag = false
|
this.bluetoothflag = false
|
||||||
uni.hideLoading();
|
uni.hideLoading();
|
||||||
// uni.showToast({
|
|
||||||
// title: '连接成功',
|
|
||||||
// icon: 'none'
|
|
||||||
// });
|
|
||||||
{
|
{
|
||||||
console.log("连接回调options.data.deviceId:" + options.data.deviceId,
|
console.log("连接回调options.data.deviceId:" + options.data.deviceId,
|
||||||
"连接回调options.data.name:" + options.data.name)
|
"连接回调options.data.name:" + options.data.name)
|
||||||
|
@ -1440,11 +1429,6 @@
|
||||||
this.shibaiflag = true
|
this.shibaiflag = true
|
||||||
this.bluetoothflag = false
|
this.bluetoothflag = false
|
||||||
uni.hideLoading()
|
uni.hideLoading()
|
||||||
// uni.showToast({
|
|
||||||
// title: '设备离线或不在范围内',
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 2000
|
|
||||||
// })
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -1506,28 +1490,6 @@
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// parseCustomData(data) {
|
|
||||||
// // 将字符串按照 "@" 分割成数组
|
|
||||||
// const dataArray = data.split('@')
|
|
||||||
|
|
||||||
// // 根据约定,解析各个字段的值
|
|
||||||
// const voltage = parseFloat(dataArray[0].substring(1)) // 去除前缀 "V",并将字符串转换为浮点数
|
|
||||||
// const switchState = dataArray[1].substring(1)// 去除前缀 "S"
|
|
||||||
// const current = parseFloat(dataArray[2].substring(1)) // 去除前缀 "A",并将字符串转换为浮点数
|
|
||||||
// const power = parseFloat(dataArray[4].substring(1)) // 去除前缀 "P",并将字符串转换为浮点数
|
|
||||||
// const remainingPower = parseFloat(dataArray[5].substring(1)) // 去除前缀 "M",并将字符串转换为浮点数
|
|
||||||
// const setMode = dataArray[6].substring(1) // 去除前缀 "T"
|
|
||||||
|
|
||||||
// // 返回解析后的数据对象
|
|
||||||
// return {
|
|
||||||
// voltage,
|
|
||||||
// switchState,
|
|
||||||
// current,
|
|
||||||
// power,
|
|
||||||
// remainingPower,
|
|
||||||
// setMode
|
|
||||||
// };
|
|
||||||
// },
|
|
||||||
parseCustomData(data) {
|
parseCustomData(data) {
|
||||||
// 将字符串按照 "@" 分割成数组
|
// 将字符串按照 "@" 分割成数组
|
||||||
const dataArray = data.split('@');
|
const dataArray = data.split('@');
|
||||||
|
@ -1612,7 +1574,7 @@
|
||||||
.lanyalx {
|
.lanyalx {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-size: 28rpx;
|
font-size: 26rpx;
|
||||||
width: 196rpx;
|
width: 196rpx;
|
||||||
height: 40rpx;
|
height: 40rpx;
|
||||||
line-height: 40rpx;
|
line-height: 40rpx;
|
||||||
|
@ -1748,7 +1710,7 @@
|
||||||
padding-bottom: 22rpx;
|
padding-bottom: 22rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
/deep/ .u-icon__icon {
|
/deep/ .uicon-nav-back {
|
||||||
padding-bottom: 22rpx;
|
padding-bottom: 22rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,7 +232,7 @@
|
||||||
}
|
}
|
||||||
this.isLoading = false
|
this.isLoading = false
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
|
@ -389,13 +389,7 @@
|
||||||
|
|
||||||
page {
|
page {
|
||||||
background-color: #F7FAFE !important;
|
background-color: #F7FAFE !important;
|
||||||
// position: fixed;
|
|
||||||
// top: 0;
|
|
||||||
// left: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.pages {
|
|
||||||
// padding: 0 40rpx;
|
|
||||||
// box-sizing: border-box;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
|
@ -74,7 +74,7 @@
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/ui06lcaul58Y3ianRZAZ" mode=""></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/ui06lcaul58Y3ianRZAZ" mode=""></image>
|
||||||
<view class="txt">订单统计</view>
|
<view class="txt">订单统计</view>
|
||||||
</view>
|
</view>
|
||||||
<view class="botcard" @click="topage(4)">
|
<view class="botcard" @click="topage(4)" v-if="false">
|
||||||
<image src="https://api.ccttiot.com/smartmeter/img/static/uKewAY8xvJN04yFpGEjl" mode=""></image>
|
<image src="https://api.ccttiot.com/smartmeter/img/static/uKewAY8xvJN04yFpGEjl" mode=""></image>
|
||||||
<view class="txt">安全中心</view>
|
<view class="txt">安全中心</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
|
@ -466,7 +466,7 @@
|
||||||
} else if (num == 6) {
|
} else if (num == 6) {
|
||||||
this.$u.get("/app/user/userInfo").then((res) => {
|
this.$u.get("/app/user/userInfo").then((res) => {
|
||||||
if (res.code == 200) {
|
if (res.code == 200) {
|
||||||
if(res.data.deviceCount == 0){
|
if(res.data.deviceCount == 0){
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '您当前暂无设备,没有权限进入',
|
title: '您当前暂无设备,没有权限进入',
|
||||||
icon: 'none',
|
icon: 'none',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user