diff --git a/page_user/kefu.vue b/page_user/kefu.vue index 6594339..54980bb 100644 --- a/page_user/kefu.vue +++ b/page_user/kefu.vue @@ -17,24 +17,16 @@ - - 猜你想问 - - - - 费用问题 - - - - 使用问题 - + + {{item.classifyName}} + - - 怎么使用蓝牙版浇花器? - - + + {{item.title}} + + @@ -45,7 +37,7 @@ - 000-260-1559 + {{tel}} 立即拨打 @@ -64,8 +56,12 @@ bgc: { backgroundColor: "#fff", }, - active:1, - flag:false + active:0, + flag:false, + fllist:[], + classifyId:'', + wzlist:[], + tel:'' } }, // 分享到好友(会话) @@ -85,16 +81,23 @@ } }, onLoad() { - + this.getfenlist() }, methods:{ // 点击切换高亮 - btntab(num){ - this.active = num + btntab(index){ + this.active = index + this.classifyId = this.fllist[index].classifyId + this.getwzlist() }, // 点击拨打电话 btndh(){ this.flag = true + this.$u.get("/app/getServerPhone").then(res => { + if(res.code == 200){ + this.tel = res.data + } + }) }, // 点击隐藏拨打电话 btnyc(){ @@ -118,11 +121,34 @@ }) }, // 点击详情 - btnitem(){ + btnitem(articleId){ uni.navigateTo({ - url:'/page_user/kefuxq' + url:'/page_user/kefuxq?classifyId=' + articleId }) - } + }, + + //获取分类列表 + getfenlist(){ + this.$u.get("/app/articleClassify/list").then(res => { + if(res.code == 200){ + this.fllist = res.data + this.classifyId = res.data[0].classifyId + this.getwzlist() + } + }) + }, + // 获取分类文章列表 + getwzlist(){ + let data = { + classifyId:this.classifyId + } + this.$u.get("/app/article/list?pageNum=1&pageSize=999").then(res => { + if(res.code == 200){ + this.wzlist = res.rows + } + }) + }, + } } @@ -232,7 +258,7 @@ align-items: center; font-size: 28rpx; color: #3D3D3D; - margin-bottom: 64rpx; + margin-bottom: 34rpx; image{ width: 42rpx; diff --git a/page_user/kefuxq.vue b/page_user/kefuxq.vue index 2cb0df1..28a99da 100644 --- a/page_user/kefuxq.vue +++ b/page_user/kefuxq.vue @@ -1,9 +1,11 @@ @@ -16,7 +18,8 @@ backgroundColor: "#fff", }, active:1, - flag:false + flag:false, + obj:{} } }, // 分享到好友(会话) @@ -35,8 +38,13 @@ path: '/pages/index/index' } }, - onLoad() { - + onLoad(option) { + this.classifyId = option.classifyId + this.$u.get(`app/article/${this.classifyId}`).then(res => { + if(res.code == 200){ + this.obj = res.data + } + }) }, methods:{ diff --git a/page_user/opinion.vue b/page_user/opinion.vue index 8454507..524274e 100644 --- a/page_user/opinion.vue +++ b/page_user/opinion.vue @@ -42,7 +42,7 @@ - + @@ -56,7 +56,7 @@ 联系方式 - + @@ -85,7 +85,8 @@ imglist: [], token: '', contact: '', - stause:false + stause:false, + picdomain:'' } }, computed: { @@ -109,22 +110,10 @@ }, onLoad() { - // this.getQiniuToken() + this.getQiniuToken() // this.getstause() }, methods: { - getstause() { - - this.$u.get('/app/config/wa').then((res) => { - if (res.code == 200) { - console.log(res) - this.stause = res.data - if (this.stause == true) { - - } - } - }) - }, hidePlaceholder() { this.placeholderVisible = false; }, @@ -149,23 +138,30 @@ icon: 'none', duration: 2000 }); - } else { + } else if (this.contact == '') { + uni.showToast({ + title: '请输入联系方式', + icon: 'none', + duration: 2000 + }); + } else { var imgString = this.imglist.join(','); let data = { type: this.cutidx, - content: this.textValue, - picture: imgString, - contact: this.contact + issueDescription: this.textValue, + uploadedImage: imgString, + contactInfo: this.contact } - console.log(data, 'dadada'); - this.$u.post("/app/complaint", data).then((res) => { + this.$u.post("/app/feedback", data).then((res) => { if (res.code == 200) { - // this.token=res.token uni.showToast({ title: '提交成功', - icon: 'none', + icon: 'success', duration: 2000 - }); + }) + setTimeout(()=>{ + uni.navigateBack() + },1500) } }); } @@ -189,12 +185,11 @@ success: function(res) { console.log(res, 'resres'); let str = JSON.parse(res.data) - console.log(str.key) - _this.userImgs = 'https://api.ccttiot.com/' + str.key + _this.userImgs = _this.picdomain + '/' + str.key console.log(_this.userImgs) _this.imglist.push(_this.userImgs) } - }); + }) } }) }, @@ -203,6 +198,7 @@ this.$u.get("/common/qiniu/uploadInfo").then((res) => { if (res.code == 200) { this.token = res.token + this.picdomain = res.domain } }) }, @@ -220,8 +216,11 @@ font-size: 36rpx; line-height: 84rpx; text-align: center; - margin-top: 164rpx; border-radius: 50rpx; + position: fixed; + left: 50%; + transform: translateX(-50%); + bottom: 80rpx; } .bjimg{ width: 100%; @@ -340,6 +339,7 @@ image { width: 142rpx; height: 142rpx; + border-radius: 10rpx; } } } diff --git a/page_user/photo.vue b/page_user/photo.vue index 2ecfdee..bdbfbe1 100644 --- a/page_user/photo.vue +++ b/page_user/photo.vue @@ -69,10 +69,15 @@ onShow() { this.maskpic = '' }, + onUnload(){ + uni.switchTab({ + url:'/pages/index/index' + }) + }, methods: { // 获取用户信息 getinfo() { - this.$u.get(`/app/profile`).then((res) => { + this.$u.get(`/appVerify/profile`).then((res) => { if (res.code == 200) { this.userid = res.data.userId } diff --git a/page_user/photoxq.vue b/page_user/photoxq.vue index 92fe33c..655c5c4 100644 --- a/page_user/photoxq.vue +++ b/page_user/photoxq.vue @@ -107,7 +107,7 @@ } else if(this.list.complexity == 6){ this.text = '非常困难' } - if(res.data.maintenanceFocus != null || re.data.maintenanceFocus.length > 0){ + if(res.data.maintenanceFocus != null || res.data.maintenanceFocus.length > 0){ this.parseData(res.data.maintenanceFocus) } } else { diff --git a/pages/index/index.vue b/pages/index/index.vue index cd08aa4..31780af 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -248,8 +248,8 @@ methods: { // 雨水感应 btnyushui(){ - let that = this - if(that.yschecked == true){ + if(this.yschecked == true){ + let that = this uni.getNetworkType({ success(res) { if (res.networkType !== 'none') { @@ -464,13 +464,13 @@ } break; case xBlufi.XBLUFI_TYPE.TYPE_RECIEVE_CUSTON_DATA: + console.log("1收到设备发来的自定义数据结果:", options.data); this.ver_data = this.parseCustomData(options.data) - console.log("1收到设备发来的自定义数据结果:", options.data); break; case xBlufi.XBLUFI_TYPE.TYPE_GET_DEVICE_LISTS_STOP: if (options.result) { let uniqueDevicesList = Array.from(new Set(this.devicesList)); - let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 5) === "WATER"); + let filteredDevices = uniqueDevicesList.filter(device => device.name.substring(0, 5) === "WATER") // 将过滤后的数组重新赋值给 this.devicesList this.devicesList = filteredDevices; } @@ -481,14 +481,15 @@ title: '蓝牙未开启', icon: 'none', duration: 3000 - }); + }) return } else { } - break; + break } }, + // 从蓝牙拿到数据进行解析 parseCustomData(data) { // 将字符串按照 "@" 分割成数组 @@ -507,7 +508,7 @@ power, remainingPower, setMode - }; + } }, } } diff --git a/pages/login/denglu.vue b/pages/login/denglu.vue index 3f907e8..cc89424 100644 --- a/pages/login/denglu.vue +++ b/pages/login/denglu.vue @@ -42,7 +42,6 @@ - diff --git a/pages/login/zhuce.vue b/pages/login/zhuce.vue index 754cd48..955f1f9 100644 --- a/pages/login/zhuce.vue +++ b/pages/login/zhuce.vue @@ -45,7 +45,7 @@ 我已阅读并同意 用户协议隐私政策 - + 注册并登录 @@ -54,9 +54,12 @@ - + + @@ -102,6 +105,76 @@ clearInterval(this.timer); }, methods:{ + // 注册并登录 + btnzhuce(){ + if(this.tel == ''){ + uni.showToast({ + title: '手机号不能为空', + icon: 'none', + duration: 2000 + }) + }else if(this.yzm == ''){ + uni.showToast({ + title: '验证码不能为空', + icon: 'none', + duration: 2000 + }) + }else if(this.password == ''){ + uni.showToast({ + title: '密码不能为空', + icon: 'none', + duration: 2000 + }) + }else if(this.checked == false){ + uni.showToast({ + title: '请同意用户协议和政策', + icon: 'none', + duration: 2000 + }) + }else{ + + } + }, + + // 点击微信一键登录 + getPhoneNumber(e) { + this.jsCode = e.detail.code + let that = this; + const wxLoginAsync = () => { + return new Promise((resolve, reject) => { + wx.login({ + success(res) { + if (res.code) { + that.mobileCode = res.code + let data = { + jsCode: e.detail.code, + mobileCode: res.code, + } + resolve(data); + } else { + reject(res.errMsg) + } + }, + fail(err) { + reject(err) + } + }) + }) + } + wxLoginAsync().then(async (data) => { + this.$u.post(`/wxlogin?mobileCode=${this.jsCode}&jsCode=${this.mobileCode}`, data).then((res) => { + if (res.code == 200) { + wx.setStorageSync('token', res.token); + uni.switchTab({ + url:'/pages/index/index' + }) + } + }) + }).catch((err) => { + console.error(err) + }) + }, + btn(num){ if(num == 1){ this.txt = 'txt' @@ -133,6 +206,7 @@ // 点击获取验证码 btnhuoqu(){ this.startCountdown() + this.$u.get(`appCaptcha?phone=${this.tel}&type=2`).then(res => {}) }, // 点击跳转到立即登录页 btnljdl(){ @@ -169,6 +243,15 @@ height: 64rpx; margin: auto; margin-top: 30rpx; + border-radius: 50%; + position: relative; + image{ + width: 64rpx; + height: 64rpx; + position: absolute; + top: 0; + left: 0; + } } .wxlogo{ font-size: 32rpx; diff --git a/pages/my.vue b/pages/my.vue index 0119f60..e3d1863 100644 --- a/pages/my.vue +++ b/pages/my.vue @@ -91,7 +91,7 @@ methods: { // 获取用户信息 getinfo() { - this.$u.get(`/app/profile`).then((res) => { + this.$u.get(`//appVerify/profile`).then((res) => { if (res.code == 200) { this.userobj = res.data this.imageSrc = res.data.avatar @@ -124,7 +124,7 @@ let data = { img:that.imageSrc } - that.$u.get(`/appVerify/avatar?img=${that.imageSrc}`,data).then(res => { + that.$u.get(`/appVerify/avatar`,data).then(res => { }) } @@ -163,7 +163,14 @@ title: '提示', content: '您确定要退出登录吗?', success: function (res) { - if (res.confirm) { + if (res.confirm) { + uni.clearStorage().then(() => { + // 成功清空所有本地存储 + console.log('所有本地存储数据已清空'); + }).catch((error) => { + // 处理错误 + console.error('清空本地存储失败', error); + }) uni.reLaunch({ url:'/pages/login/login' })