From 247b2582ab497335d1c232a35cf03f9b73b7e67a Mon Sep 17 00:00:00 2001
From: "3321822538@qq.com" <3321822538@qq.com>
Date: Mon, 22 Jul 2024 18:03:27 +0800
Subject: [PATCH] =?UTF-8?q?=E6=AD=A3=E5=9C=A8=E5=AE=8C=E5=96=84=20wifi?=
=?UTF-8?q?=E8=BF=9E=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
common/http.interceptor.js | 4 +-
page_components/bindsz.vue | 126 ++++++--
page_components/fuwu/index.vue | 10 +-
page_components/newtaocan.vue | 3 +
page_components/wifilist/index.vue | 236 ++++++++++++++-
page_fenbao/statulist/myshop/shopxx/index.vue | 6 +
page_fenbao/statulist/taocanlist/index.vue | 113 ++++----
page_fenbao/zhuce.vue | 130 +++++----
page_user/HM-dragSorts/HM-dragSorts.vue | 12 +-
page_user/fenzu.vue | 15 +-
page_user/sbdetail.vue | 62 ++--
page_user/setting.vue | 2 +-
pages/index/index.vue | 16 +-
pages/my.vue | 4 +-
pages/shouye/index.vue | 271 ++++++++++--------
15 files changed, 691 insertions(+), 319 deletions(-)
diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index 7b25644..52fb418 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -20,8 +20,8 @@ const install = (Vue, vm) => {
// },
// });
Vue.prototype.$u.http.setConfig({
- // baseUrl: 'http://192.168.2.143:10002',
- baseUrl: 'https://kg.chuangtewl.com/prod-api',
+ baseUrl: 'http://192.168.2.143:10002',
+ // baseUrl: 'https://kg.chuangtewl.com/prod-api',
loadingText: '努力加载中~',
loadingTime: 1000,
// 设置自定义头部content-type
diff --git a/page_components/bindsz.vue b/page_components/bindsz.vue
index 55ddac2..7036974 100644
--- a/page_components/bindsz.vue
+++ b/page_components/bindsz.vue
@@ -3,6 +3,20 @@
+
+
+
+
+
+
+
+
+
+
设备名称
@@ -48,7 +62,7 @@
- Wifi配网
+ WiFi配网
@@ -224,7 +238,9 @@
name:'',
deviceId:'',
isMch:false,
- taocan:''
+ taocan:'',
+ token:'',
+ userImgs:''
}
},
onLoad(option) {
@@ -236,6 +252,7 @@
},
onShow() {
this.taocan = ''
+ this.getQiniuToken()
this.getgroup()
this.getuserinfo()
this.getao()
@@ -257,10 +274,64 @@
}
},
methods: {
+ // 修改图片
+ getImage(e) {
+ let _this = this
+ let math = 'static/' + _this.$u.guid(20)
+ uni.chooseImage({
+ count: 9,
+ type: 'all',
+ success(res) {
+ // console.log(res);
+ const tempFilePaths = res.tempFilePaths[0]
+ wx.uploadFile({
+ url: 'https://up-z2.qiniup.com',
+ name: 'file',
+ filePath: tempFilePaths,
+ formData: {
+ token: _this.token, //后端返回的token
+ key: 'smartmeter/img/' + math
+ },
+ success: function(res) {
+ console.log(res, 'resres');
+ let str = JSON.parse(res.data)
+ _this.userImgs = 'https://api.ccttiot.com/' + str.key
+ let data = {
+ deviceId:_this.id,
+ customPicture:_this.userImgs
+ }
+ _this.$u.put('/app/device', data).then((res) => {
+ if (res.code == 200) {
+ this.getDevice()
+ uni.showToast({
+ title: '操作成功',
+ icon: 'none',
+ duration: 2000
+ })
+ }
+ })
+ }
+ })
+ }
+ })
+ },
+ // 获取上传七牛云token
+ getQiniuToken() {
+ this.$u.get("/common/qiniu/uploadInfo").then((res) => {
+ if (res.code == 200) {
+ this.token = res.token
+ }
+ })
+ },
+
getao(){
this.$u.get(`/app/suit/listByDeviceId/${this.id}`).then(res => {
if(res.code == 200){
- if(res.data.length > 0){
+ if(res.data.length <= 1){
+ res.data.forEach(item => {
+ this.taocan += item.name
+ })
+ }else{
res.data.forEach(item => {
this.taocan += item.name + ','
})
@@ -271,7 +342,7 @@
// 点击设置套餐
btntc(){
uni.navigateTo({
- url:'/page_components/newtaocan?id=' + this.id
+ url:'/page_fenbao/statulist/taocanlist/index?id=' + this.id
})
},
// 获取当前用户信息
@@ -284,6 +355,9 @@
},
// 点击wifi进行配网
btnwifi(){
+ uni.showLoading({
+ title: '蓝牙连接中...'
+ })
if(this.deviceId == ''){
xBlufi.initXBlufi(1);
xBlufi.listenDeviceMsgEvent(true, this.funListenDeviceMsgEvent);
@@ -325,23 +399,27 @@
uni.removeStorageSync('mac');
let systemInfo = uni.getSystemInfoSync();
if (systemInfo.platform == 'android') {
+ uni.hideLoading()
// 当前设备是 Android
uni.navigateTo({
url: '/page_components/wifilist/index?deviceId=' +this.deviceId + '&name=' +this.name
})
} else if (systemInfo.platform == 'ios') {
+ uni.hideLoading()
// 当前设备是 iOS
uni.navigateTo({
url: '/page_fenbao/device/wifivideo?deviceId=' +this.deviceId + '&name=' +this.name
})
}
}else if(res.msg == '设备编号和mac不能同时为空'){
+ uni.hideLoading()
uni.showToast({
- title: '未找到设备',
+ title: '未连接到设备,请查看蓝牙是否打开以及在设备范围内',
icon: 'none',
duration: 2000
});
} else {
+ uni.hideLoading()
uni.showToast({
title: res.msg,
icon: 'none',
@@ -384,7 +462,7 @@
}
}else if(res.msg == '设备编号和mac不能同时为空'){
uni.showToast({
- title: '未找到设备',
+ title: '未连接到设备,请查看蓝牙是否打开以及在设备范围内',
icon: 'none',
duration: 2000
});
@@ -629,6 +707,9 @@
this.$u.get("/app/device/" + id).then((res) => {
if (res.code == 200) {
this.listobj = res.data
+ if(res.data.customPicture){
+ this.userImgs = res.data.customPicture
+ }
}
})
},
@@ -689,11 +770,11 @@
case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_START:
if (!options.result) {
console.log("蓝牙未开启", options);
- uni.showToast({
- title: '蓝牙未开启',
- icon: 'none',
- duration: 3000
- });
+ // uni.showToast({
+ // title: '蓝牙未开启',
+ // icon: 'none',
+ // duration: 3000
+ // });
return
} else {
// this.searching = true
@@ -819,8 +900,8 @@
font-size: 32rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
- color: #FFFFFF;
- background-color: #2A82E4;
+ color: #000;
+ background-color:#fff;
}
.btn1 {
@@ -831,8 +912,8 @@
font-size: 32rpx;
font-family: HarmonyOS Sans SC, HarmonyOS Sans SC;
font-weight: 400;
- color: #000;
- background-color: #fff;
+ color: #fff;
+ background-color: #8883F0;
border: 1rpx solid #ccc;
}
}
@@ -933,7 +1014,7 @@
font-size: 36rpx;
font-family: Source Han Sans, Source Han Sans;
font-weight: 400;
- color: #2A82E4;
+ color: #8883F0;
}
}
@@ -978,4 +1059,17 @@
}
}
}
+ .icon {
+ // display: flex;
+ // flex-wrap: wrap;
+ // align-items: center;
+ margin-top: 40rpx;
+ .imgbox {
+ // width: 33%;
+ image {
+ width: 142rpx;
+ height: 142rpx;
+ }
+ }
+ }
\ No newline at end of file
diff --git a/page_components/fuwu/index.vue b/page_components/fuwu/index.vue
index 149d626..340c316 100644
--- a/page_components/fuwu/index.vue
+++ b/page_components/fuwu/index.vue
@@ -4,14 +4,14 @@
title-size='36' height='50'> -->
- {{deviceobj.deviceName == undefined ? '--' : deviceobj.deviceName}}
+ {{deviceobj.deviceName == undefined ? '--' : deviceobj.deviceName}}
-
+
联系客服:{{deviceobj.userMobile == undefined ? '--' : deviceobj.userMobile}}
-
+
联系客服:{{deviceobj.storeContactMobile == undefined ? '--' : deviceobj.storeContactMobile}}
@@ -57,7 +57,7 @@
v-for="(item,index) in deviceobj.suitList" :key="index" @click="btnactive(item)">
- {{item.name.length > 5 ? item.name.substring(0,5) + '...' : item.name}}
+ {{item.name.length > 4 ? item.name.substring(0,4) + '...' : item.name}}
{{item.value}} 日 时 分钟 秒
@@ -821,7 +821,7 @@
color: #fff;
margin-bottom: 30rpx;
margin-top: 110rpx;
- height: 200rpx;
+ height: 126rpx;
.wz {
font-weight: 400;
diff --git a/page_components/newtaocan.vue b/page_components/newtaocan.vue
index 8a84cde..db028da 100644
--- a/page_components/newtaocan.vue
+++ b/page_components/newtaocan.vue
@@ -4,6 +4,9 @@
height='50'>
+
+ 左滑可删除指定套餐
+
diff --git a/page_components/wifilist/index.vue b/page_components/wifilist/index.vue
index 780e85c..a18cec4 100644
--- a/page_components/wifilist/index.vue
+++ b/page_components/wifilist/index.vue
@@ -7,8 +7,10 @@
WIFI选择
-
- 请选择您需要连接的2.4Gwifi名称
+
+ 请选择您需要连接的2.4GwiFi名称
+
+ 刷新
@@ -61,6 +63,7 @@