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 this.showloading=false
uni.hideLoading() uni.hideLoading()
} }
}) })
// console.log(res.data.data) // console.log(res.data.data)

View File

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

View File

@ -156,7 +156,8 @@
</view> </view>
<view class="charts-box" > <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" /> <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>
</view> </view>
<!-- 折线 --> <!-- 折线 -->
@ -468,6 +469,11 @@
clearInterval(this.intervalId); clearInterval(this.intervalId);
}, },
methods: { methods: {
djdl(){
uni.navigateTo({
url:'/pages/login/index'
})
},
topage(num) { topage(num) {
if (this.tokenflag == true) { if (this.tokenflag == true) {
if (num == 1) { if (num == 1) {

View File

@ -790,6 +790,7 @@
// //
onLoad(option) { onLoad(option) {
console.log(option); console.log(option);
this.getuserid()
if (option.scene) { if (option.scene) {
let sceneValue = option.scene let sceneValue = option.scene
let decodedValue = decodeURIComponent(sceneValue); let decodedValue = decodeURIComponent(sceneValue);
@ -805,7 +806,7 @@
} else { } else {
this.id = option.id this.id = option.id
if (!wx.getStorageSync('userToken')) { if (!wx.getStorageSync('userToken')) {
uni.navigateTo({ uni.reLaunch({
url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id
}) })
} else { } else {
@ -819,6 +820,19 @@
}, },
methods: { 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() { fenlampbut() {
if (this.switchk) { if (this.switchk) {
this.switchk = false this.switchk = false
@ -869,13 +883,13 @@
listDataFn() { listDataFn() {
request.get('/api/beehive/detail/' + this.id, {}).then(res => { request.get('/api/beehive/detail/' + this.id, {}).then(res => {
this.idss = res.data.data.id this.idss = res.data.data.id
this.user_id = res.data.data.user_id // this.user_id = res.data.data.user_id
console.log(wx.getStorageSync('user_id'),this.user_id); // console.log(wx.getStorageSync('user_id'),this.user_id);
if (wx.getStorageSync('user_id') != this.user_id) { // if (wx.getStorageSync('user_id') != this.user_id) {
uni.navigateTo({ // uni.reLaunch({
url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id // url: '/pagesFengXiang/pages/fengxiangDetailtwo/index?id=' + this.id
}) // })
} // }
this.getServerDatas() this.getServerDatas()
console.log(res); console.log(res);
this.listdata = { this.listdata = {

View File

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