This commit is contained in:
3321822538@qq.com 2024-05-17 18:11:32 +08:00
parent ca38c78719
commit ee33abc2c8
5 changed files with 64 additions and 38 deletions

View File

@ -275,7 +275,6 @@
this.showloading=false
uni.hideLoading()
}
})
// console.log(res.data.data)

View File

@ -411,7 +411,6 @@
// uni.hideLoading()
})
setTimeout(() => {
uni.hideLoading()
setTimeout(() => {
request.get('/api/beehive/detail/' + item.id, {}).then(res => {
const newData = res.data.data;
@ -426,7 +425,8 @@
}
})
}, 500)
}, 4000)
uni.hideLoading()
}, 6000)
} else {
uni.showToast({
icon: "none",
@ -581,28 +581,35 @@
mask: true
})
request.post('/api/beehive/removePeel/' + item.id, {}).then(res => {
uni.hideLoading()
// that.loadData()
request.get('/api/beehive/detail/' + item.id, {}).then(res => {
const newData = res.data.data; //
// id
const existingItem = this.listData.find(item => item.id ===
newData.id);
if (existingItem) {
//
const index = this.listData.indexOf(existingItem);
this.listData.splice(index, 1,
newData); //
} else {
//
this.listData.push(newData);
}
console.log(this.listData, 101010);
})
uni.showToast({
icon: "none",
title: res.data.msg
})
request.get('/api/beehive/detail/' + item.id, {}).then(res => {
const newData = res.data.data;
const existingItem = that.listData.find(item => item.id === newData.id);
if (existingItem) {
//
const index = that.listData.indexOf(existingItem);
that.listData.splice(index, 1, newData);
} else {
that.listData.push(newData);
}
// uni.hideLoading()
})
setTimeout(() => {
setTimeout(() => {
request.get('/api/beehive/detail/' + item.id, {}).then(res => {
const newData = res.data.data;
const existingItem = that.listData.find(item => item.id === newData
.id);
if (existingItem) {
//
const index = that.listData.indexOf(existingItem);
that.listData.splice(index, 1, newData);
} else {
that.listData.push(newData);
}
})
}, 500)
uni.hideLoading()
}, 6000)
})
} else if (res.cancel) {}

View File

@ -156,7 +156,8 @@
</view>
<view class="charts-box" >
<qiun-data-charts v-if="logoflag" type="column" :opts="optsZhu" :chartData="chartDataZhu" :errorShow="false" :errorReload="false" :animation="false" :tooltipShow="false" :tapLegend="false" />
<view class="" v-else style="color: #ccc;font-size: 36rpx;width: 100%;text-align: center;margin-top: 50rpx;">暂无蜂箱...</view>
<view class="" v-else style="color: #ccc;font-size: 36rpx;width: 100%;text-align: center;margin-top: 50rpx;">暂无蜂箱...
<view @click="djdl" style="width: 200rpx;height: 80rpx;text-align: center;line-height: 80rpx;background-color: #3CA272;margin: auto;margin-top: 30rpx;border-radius: 30rpx;color: #fff;padding: 0rpx 20rpx;box-sizing: border-box;">点击登录</view> </view>
</view>
</view>
<!-- 折线 -->
@ -468,6 +469,11 @@
clearInterval(this.intervalId);
},
methods: {
djdl(){
uni.navigateTo({
url:'/pages/login/index'
})
},
topage(num) {
if (this.tokenflag == true) {
if (num == 1) {

View File

@ -790,6 +790,7 @@
//
onLoad(option) {
console.log(option);
this.getuserid()
if (option.scene) {
let sceneValue = option.scene
let decodedValue = decodeURIComponent(sceneValue);
@ -805,7 +806,7 @@
} else {
this.id = option.id
if (!wx.getStorageSync('userToken')) {
uni.navigateTo({
uni.reLaunch({
url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id
})
} else {
@ -816,9 +817,22 @@
}
},
onShow() {
},
methods: {
getuserid(){
let page = 1
let qrcode = ''
request.get('/api/apiary/index', {page,qrcode}).then(res => {
this.user_id = res.data.data[0].user_id
console.log(wx.getStorageSync('user_id'),this.user_id);
if (wx.getStorageSync('user_id') != this.user_id) {
uni.reLaunch({
url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id
})
}
})
},
fenlampbut() {
if (this.switchk) {
this.switchk = false
@ -869,13 +883,13 @@
listDataFn() {
request.get('/api/beehive/detail/' + this.id, {}).then(res => {
this.idss = res.data.data.id
this.user_id = res.data.data.user_id
console.log(wx.getStorageSync('user_id'),this.user_id);
if (wx.getStorageSync('user_id') != this.user_id) {
uni.navigateTo({
url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id
})
}
// this.user_id = res.data.data.user_id
// console.log(wx.getStorageSync('user_id'),this.user_id);
// if (wx.getStorageSync('user_id') != this.user_id) {
// uni.reLaunch({
// url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id
// })
// }
this.getServerDatas()
console.log(res);
this.listdata = {

View File

@ -221,10 +221,10 @@
markers: [{
latitude: null,
longitude: null,
width: 25,
height: 25,
width: 15,
height: 15,
id: 0,
iconPath: '../../../static/dwicon.png',
iconPath: '../../../static/a11.png',
}],
},
// 线1