This commit is contained in:
3321822538@qq.com 2024-05-30 17:24:10 +08:00
parent 53901aec4f
commit 63cf0b1e50
8 changed files with 173 additions and 170 deletions
common
page_components/fuwu
page_fenbao/statulist
fault/yichang
myshop/shopdetail
page_user
pages/shouye

View File

@ -21,7 +21,7 @@ const install = (Vue, vm) => {
// }); // });
Vue.prototype.$u.http.setConfig({ Vue.prototype.$u.http.setConfig({
// baseUrl: 'http://192.168.2.184:3000/dev-api', // baseUrl: 'http://192.168.2.184:3000/dev-api',
baseUrl: 'https://kaiguan.chuantewulian.cn/prod-api', baseUrl: 'https://kg.chuantewulian.cn/prod-api',
loadingText: '努力加载中~', loadingText: '努力加载中~',
loadingTime: 1000, loadingTime: 1000,
// 设置自定义头部content-type // 设置自定义头部content-type

View File

@ -85,7 +85,7 @@
} }
let sceneValue = option.q let sceneValue = option.q
let decodedValue = decodeURIComponent(sceneValue); let decodedValue = decodeURIComponent(sceneValue);
this.id = getQueryParam(decodedValue, 'deviceNo') this.id = getQueryParam(decodedValue, 's')
console.log(this.id) console.log(this.id)
this.startTimer() this.startTimer()
this.gettaoc() this.gettaoc()

View File

@ -79,7 +79,7 @@
} }
let sceneValue = res.result let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue); let decodedValue = decodeURIComponent(sceneValue);
this.deviceNo = getQueryParam(decodedValue, 'deviceNo') this.deviceNo = getQueryParam(decodedValue, 's')
// this.deviceNo = res.result; // this.deviceNo = res.result;
}, },
fail: err => { fail: err => {

View File

@ -180,14 +180,10 @@
} }
let sceneValue = res.result let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue); let decodedValue = decodeURIComponent(sceneValue);
let id = getQueryParam(decodedValue, 'deviceNo') let id = getQueryParam(decodedValue, 's')
this.$u.get(`/app/device/${id}/bySn`).then((res) => { this.$u.get(`/app/device/${id}/bySn`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
this.qrResult = 'CTKG-' + res.data.mac this.qrResult = 'CTKG-' + res.data.mac
// console.log(this.qrResult);
// uni.navigateTo({
// url:'/page_fenbao/device/lianjie?mac=' + this.qrResult + '&storeId=' + this.storeId
// })
xBlufi.initXBlufi(1); xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent); xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
xBlufi.notifyStartDiscoverBle({ xBlufi.notifyStartDiscoverBle({
@ -243,7 +239,8 @@
} else { } else {
uni.showToast({ uni.showToast({
title: '没有发现设备', title: '没有发现设备',
icon: 'none' icon: 'none',
duration:2000
}); });
} }
break; break;

View File

@ -180,7 +180,7 @@
} }
let sceneValue = res.result let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue); let decodedValue = decodeURIComponent(sceneValue);
let id = getQueryParam(decodedValue, 'deviceNo') let id = getQueryParam(decodedValue, 's')
this.$u.get(`/app/device/${id}/withSuitList`).then((res) =>{ this.$u.get(`/app/device/${id}/withSuitList`).then((res) =>{
if(res.code == 200){ if(res.code == 200){
uni.navigateTo({ uni.navigateTo({

View File

@ -188,11 +188,11 @@
token: '', token: '',
userImgs: '', userImgs: '',
imgflag: true, imgflag: true,
mac:"", mac: "",
name:'', name: '',
deviceId:'', deviceId: '',
storeId:'', storeId: '',
qrResult:'' qrResult: ''
} }
}, },
onLoad(option) { onLoad(option) {
@ -322,7 +322,7 @@
icon: 'success', icon: 'success',
duration: 2000 duration: 2000
}) })
}else if(res.code == 500){ } else if (res.code == 500) {
uni.showToast({ uni.showToast({
title: '设备不在线', title: '设备不在线',
icon: 'none', icon: 'none',
@ -491,8 +491,8 @@
if (device.name == this.qrResult) { if (device.name == this.qrResult) {
this.deviceId = device.deviceId this.deviceId = device.deviceId
this.name = device.name this.name = device.name
this.mac = device.name.slice(5,17) this.mac = device.name.slice(5, 17)
console.log(this.mac,'macmacmac'); console.log(this.mac, 'macmacmac');
this.devicesList = uniqueDevicesList; this.devicesList = uniqueDevicesList;
} }
@ -517,8 +517,8 @@
name = this.name.slice(index + 1); name = this.name.slice(index + 1);
} }
let data = { let data = {
storeId:this.storeId, storeId: this.storeId,
mac:this.mac mac: this.mac
} }
this.$u.put('/app/device/bind', data).then((res) => { this.$u.put('/app/device/bind', data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -533,20 +533,24 @@
uni.showModal({ uni.showModal({
title: '提示', title: '提示',
content: '你已绑定成功,需前去配网吗?', content: '你已绑定成功,需前去配网吗?',
success: function (res) { success: function(res) {
if (res.confirm) { if (res.confirm) {
let systemInfo = uni.getSystemInfoSync(); let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform === 'android') { if (systemInfo.platform === 'android') {
// Android // Android
uni.navigateTo({ uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' + options url: '/page_components/wifilist/index?deviceId=' +
.data.deviceId + '&name=' + options.data.name options
.data.deviceId + '&name=' +
options.data.name
}) })
} else if (systemInfo.platform === 'ios') { } else if (systemInfo.platform === 'ios') {
// iOS // iOS
uni.navigateTo({ uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' + options url: '/page_fenbao/device/wifivideo?deviceId=' +
.data.deviceId + '&name=' + options.data.name options
.data.deviceId + '&name=' +
options.data.name
}) })
} }
} else if (res.cancel) { } else if (res.cancel) {
@ -554,7 +558,7 @@
} }
} }
}) })
}else if(res.code == 500){ } else if (res.code == 500) {
uni.showToast({ uni.showToast({
title: '该设备已被绑定', title: '该设备已被绑定',
icon: 'none', icon: 'none',
@ -768,6 +772,7 @@
padding-left: 80rpx; padding-left: 80rpx;
padding-right: 120rpx; padding-right: 120rpx;
box-sizing: border-box; box-sizing: border-box;
.cont { .cont {
.tit { .tit {
font-size: 28rpx; font-size: 28rpx;

View File

@ -109,7 +109,7 @@
} }
let sceneValue = res.result let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue); let decodedValue = decodeURIComponent(sceneValue);
this.qrResult = getQueryParam(decodedValue, 'deviceNo') this.qrResult = getQueryParam(decodedValue, 's')
// this.qrResult = res.result; // // this.qrResult = res.result; //
}, },
fail: err => { fail: err => {

View File

@ -216,7 +216,8 @@
} }
let sceneValue = res.result let sceneValue = res.result
let decodedValue = decodeURIComponent(sceneValue); let decodedValue = decodeURIComponent(sceneValue);
let id = getQueryParam(decodedValue, 'deviceNo') let id = getQueryParam(decodedValue, 's')
console.log(res,id);
this.$u.get(`/app/device/${id}/withSuitList`).then((res) => { this.$u.get(`/app/device/${id}/withSuitList`).then((res) => {
if (res.code == 200) { if (res.code == 200) {
uni.navigateTo({ uni.navigateTo({