From 4e8ffcd56fb28b100e48832f92048090c024bce7 Mon Sep 17 00:00:00 2001 From: "3321822538@qq.com" <3321822538@qq.com> Date: Fri, 14 Jun 2024 18:35:45 +0800 Subject: [PATCH] aaa --- pages/fengxiang/index.vue | 40 +++++++------ pages/wode/index.vue | 9 ++- pagesFengChang/addfengchang/index.vue | 58 ++++++++++--------- .../pages/fengxiangDetail/index.vue | 3 +- .../pages/fengxiangDetailtwo/index.vue | 3 +- pagesWode/wode-personal/idnex.vue | 22 ++++--- 6 files changed, 75 insertions(+), 60 deletions(-) diff --git a/pages/fengxiang/index.vue b/pages/fengxiang/index.vue index 3f44097..8500c6d 100644 --- a/pages/fengxiang/index.vue +++ b/pages/fengxiang/index.vue @@ -365,9 +365,10 @@ // 将索引赋值给this.currentindex this.currentindex = index; this.pageData('', this.checkid) - } else { - this.getfengchangList() - } + } + // else { + // this.getfengchangList() + // } // }, 300); // this.refresh(); // 设置定时刷新 @@ -794,13 +795,15 @@ qrcode } }).then(res => { + console.log(res,'resresres'); if (res.statusCode == 200) { wx.setStorageSync('user_id', res.data.data[0].user_id); this.total = res.data.total - if (this.total > 0) { - this.masks = false - } else { + if (res.data.total == 0) { + this.listData = [] this.masks = true + } else { + this.masks = false } if (res.data.data.length > 0) { // 有数据,追加到列表 @@ -817,18 +820,18 @@ }) uniqueData.sort((a, b) => { if (a.status_text !== b.status_text) { - return a.status_text === '在线' ? -1 : 1; + return a.status_text === '在线' ? -1 : 1 } - const numA = Number(a.name); - const numB = Number(b.name); + const numA = Number(a.name) + const numB = Number(b.name) if (!isNaN(numA) && !isNaN(numB)) { - return numA - numB; + return numA - numB } else if (!isNaN(numA)) { - return -1; + return -1 } else if (!isNaN(numB)) { - return 1; + return 1 } else { - return a.name.localeCompare(b.name); + return a.name.localeCompare(b.name) } }); this.listData = uniqueData @@ -837,8 +840,8 @@ let uniqueIds = new Set() let uniqueData = filteredData.filter(item => { if (!uniqueIds.has(item.id)) { - uniqueIds.add(item.id); - return true; + uniqueIds.add(item.id) + return true } return false }) @@ -909,8 +912,7 @@ } if(event.weight == '0KG'){ this.listData = [] - // this.masks = true - console.log(this.listData); + this.masks = true } uni.showLoading({ title: '加载中', @@ -928,9 +930,9 @@ this.currentindex = index } - setTimeout(() => { + // setTimeout(() => { this.refresh() - }, 1000) + // }, 1000) }, }, }; diff --git a/pages/wode/index.vue b/pages/wode/index.vue index 5e34b06..d6bf1b8 100644 --- a/pages/wode/index.vue +++ b/pages/wode/index.vue @@ -4,9 +4,9 @@ - - - + + + @@ -66,7 +66,7 @@ import request from '../../utils/request' props: {}, data() { return { - userImage:'', + userImage:'a', tokenflag:false }; }, @@ -81,7 +81,6 @@ import request from '../../utils/request' this.tokenflag = true this.userImage = res.data.data.avatar }else{ - console.log(1010); this.tokenflag = false this.userImage = 'https://api.ccttiot.com/smartmeter/img/static/usaBta7T92keDZwpiqjM' } diff --git a/pagesFengChang/addfengchang/index.vue b/pagesFengChang/addfengchang/index.vue index 1c1150d..86871d9 100644 --- a/pagesFengChang/addfengchang/index.vue +++ b/pagesFengChang/addfengchang/index.vue @@ -20,15 +20,18 @@ - + 具体位置 - + {{form.address}} + - + 蜂种 @@ -57,7 +60,8 @@ 照片 - + @@ -82,7 +86,7 @@ data() { return { - baseurl:'', + baseurl: '', form: { bee_type_text: '', area_id: '', @@ -143,7 +147,7 @@ this.sourcelist() this.getdataList() }, - + methods: { sourcelist() { @@ -162,16 +166,20 @@ }); return res }, + gotomap() { uni.chooseLocation({ + initialLocation: { + latitude: '39.91389', + longitude: '116.40783', // 北京的经纬度作为示例 + }, success: (res) => { console.log(res); this.form.lng = res.longitude this.form.lat = res.latitude - this.form.address = res.address + this.form.address = res.name }, fail: function(err) { - // 检查错误消息,看是否是用户取消了位置选择 if (err.errMsg && err.errMsg.indexOf('chooseLocation:cancel') === 0) { uni.showToast({ title: '您取消了位置选择', @@ -179,18 +187,15 @@ }); } else { console.log('选择位置失败', err); - // 处理其他失败情况 } }, - }); - // console.log("跳转到地图") - // uni.navigateTo({ - // url: '/pagesFengChang/components/map', - // }) + }) }, - + // console.log("跳转到地图") + // uni.navigateTo({ + // url: '/pagesFengChang/components/map', + // }) submit() { - console.log(this.form) this.form.images = this.uploadfileList.map(item => item).join(',') if (this.form.id) { request.put("/api/apiary/update/" + this.form.id, this.form).then(res => { @@ -217,7 +222,6 @@ } }) } - }, // 删除图片 @@ -278,7 +282,7 @@ filePath: url, name: 'file', success: (res) => { - console.log(res,'0000'); + console.log(res, '0000'); try { // 确保服务器返回的是JSON字符串 const res2 = JSON.parse(res.data); @@ -302,13 +306,13 @@ // 注意这里不需要返回a,因为uni.uploadFile是一个异步操作 }); }, - + // const axios = require('axios'); // const FormData = require('form-data'); // const fs = require('fs'); // let data = new FormData(); // data.append('file', fs.createReadStream('/C:/Users/12607/Downloads/oi4OG5FQXQpRERqBguILQQ9OtNQE (1).jpg')); - + // let config = { //   method: 'post', //   maxBodyLength: Infinity, @@ -319,7 +323,7 @@ //   }, //   data : data // }; - + // axios.request(config) // .then((response) => { //   console.log(JSON.stringify(response.data)); @@ -375,13 +379,15 @@ onLoad(option) { if (option.info) { this.form = JSON.parse(option.info) - if(this.form.images){ + if (this.form.images) { let imagesArray = this.form.images.split(','); - let prefixedImagesArray = imagesArray.map(imagePath => ({url: `${imagePath.trim()}`})); - this.fileList1 = prefixedImagesArray + let prefixedImagesArray = imagesArray.map(imagePath => ({ + url: `${imagePath.trim()}` + })); + this.fileList1 = prefixedImagesArray } - - console.log(this.fileList1); + + console.log(this.fileList1); this.title = '编辑蜂场' } else { this.title = '添加蜂场' diff --git a/pagesFengXiang/pages/fengxiangDetail/index.vue b/pagesFengXiang/pages/fengxiangDetail/index.vue index 85c8620..fd608c5 100644 --- a/pagesFengXiang/pages/fengxiangDetail/index.vue +++ b/pagesFengXiang/pages/fengxiangDetail/index.vue @@ -1106,12 +1106,13 @@ bottom: 0rpx; width: 100%; text-align: center; - height: 599rpx; + height: 580rpx; background: #ccc; opacity: .5; color: red; font-size: 32rpx; font-weight: 600; + padding-top: 20rpx; } .flex-taxt { display: flex; diff --git a/pagesFengXiang/pages/fengxiangDetailtwo/index.vue b/pagesFengXiang/pages/fengxiangDetailtwo/index.vue index 160bffd..dc0f57a 100644 --- a/pagesFengXiang/pages/fengxiangDetailtwo/index.vue +++ b/pagesFengXiang/pages/fengxiangDetailtwo/index.vue @@ -1091,12 +1091,13 @@ bottom: 0rpx; width: 100%; text-align: center; - height: 599rpx; + height: 580rpx; background: #ccc; opacity: .5; color: red; font-size: 32rpx; font-weight: 600; + padding-top: 20rpx; } .image_7 { diff --git a/pagesWode/wode-personal/idnex.vue b/pagesWode/wode-personal/idnex.vue index 61fee30..9fa35a5 100644 --- a/pagesWode/wode-personal/idnex.vue +++ b/pagesWode/wode-personal/idnex.vue @@ -3,9 +3,12 @@ - - - + @@ -70,9 +73,9 @@ - + @@ -155,7 +158,7 @@ ['深圳', '厦门', '上海', '拉萨'], ['得州', '华盛顿', '纽约', '阿拉斯加'] ], - userImage: '' + userImage: 'a' }; }, onShow() { @@ -422,6 +425,7 @@ height: 144rpx; border-radius: 50%; overflow: hidden; + position: relative; } .image-box-t { @@ -458,8 +462,10 @@ } .image_6 { - width: 100%; - height: 100%; + width: 144rpx; + height: 144rpx; + position: absolute; + left: 0; } .font {