aaa
This commit is contained in:
parent
cb90f69cbd
commit
4e8ffcd56f
|
@ -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)
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
<view class="flex-1 section">
|
||||
<view class="group">
|
||||
<view class="group-zi">
|
||||
<view class="image-r">
|
||||
<image v-if="userImage" class="self-center image_5" :src="userImage"/>
|
||||
<image v-else class="self-center image_5" src="https://api.ccttiot.com/smartmeter/img/static/usaBta7T92keDZwpiqjM"/>
|
||||
<view class="image-r" style="background-color: #efefef;">
|
||||
<image class="self-center image_5" :src="userImage"/>
|
||||
<!-- <image v-else class="self-center image_5" src="https://api.ccttiot.com/smartmeter/img/static/usaBta7T92keDZwpiqjM"/> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="self-stretch group_2 mt-73">
|
||||
|
@ -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'
|
||||
}
|
||||
|
|
|
@ -20,15 +20,18 @@
|
|||
</view>
|
||||
</view>
|
||||
<!-- 具体位置 -->
|
||||
<view>
|
||||
<view style="position: relative;">
|
||||
<view class="text-box">具体位置</view>
|
||||
<view @click="gotomap">
|
||||
<view>
|
||||
<u--input class="input-b" shape="circle" placeholder="请选择具体位置" border="surround"
|
||||
v-model="form.address">{{form.address}}</u--input>
|
||||
<!-- <view class="input-b">{{form.lng}},{{form.lat}}</view> -->
|
||||
</view>
|
||||
<image @click="gotomap"
|
||||
style="width: 32rpx;height: 32rpx;position: absolute;bottom: 20rpx;right: 20rpx;z-index: 99;"
|
||||
src="https://api.ccttiot.com/smartmeter/img/static/uf92QyUtzafEwjjjcwOl" mode=""></image>
|
||||
</view>
|
||||
<!-- 蜂种 -->
|
||||
<!-- 蜂种 -->
|
||||
<view>
|
||||
<view class="text-box">蜂种</view>
|
||||
<view @click="showfengzhong = true">
|
||||
|
@ -57,7 +60,8 @@
|
|||
<view>
|
||||
<view class="text-box">照片</view>
|
||||
<view>
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple :maxCount="10"></u-upload>
|
||||
<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" multiple
|
||||
:maxCount="10"></u-upload>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -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 = '添加蜂场'
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -3,9 +3,12 @@
|
|||
<view class="flex-col page">
|
||||
<view class="flex-col flex-1 section">
|
||||
<view class="image-box-t">
|
||||
<view class="img-t">
|
||||
<image class="shrink-0 image_6" :src="userImage" />
|
||||
</view>
|
||||
<button class="img-t" open-type="chooseAvatar" @chooseavatar="chooseavatar" style="background-color: #efefef;">
|
||||
<!-- <button > -->
|
||||
<image v-if="userImage" class="shrink-0 image_6" :src="userImage"/>
|
||||
<!-- </button> -->
|
||||
<!-- <image v-else class="self-center image_5" src="https://api.ccttiot.com/smartmeter/img/static/usaBta7T92keDZwpiqjM"/> -->
|
||||
</button>
|
||||
<view class="text_3-box" >
|
||||
<!-- <button open-type="chooseAvatar" @chooseavatar="chooseavatar"
|
||||
class="font text_3">更换头像</button> -->
|
||||
|
@ -70,9 +73,9 @@
|
|||
<image class="ml-16 shrink-0 image_5" src="../../static/wode-youjianto.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view @click="userout" class="flex-col justify-start items-center self-stretch text-wrapper">
|
||||
<!-- <view @click="userout" class="flex-col justify-start items-center self-stretch text-wrapper">
|
||||
<text class="text_12">注销登录</text>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
<!-- 弹出层 -->
|
||||
<view>
|
||||
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user