diff --git a/pages.json b/pages.json index b90850d..bbc9e28 100644 --- a/pages.json +++ b/pages.json @@ -144,6 +144,14 @@ "navigationStyle": "custom" } }, + { + "path": "pages/deviceManagement/deviceManagement", + "style" : + { + "navigationBarTitleText" : "设备管理", + "navigationStyle": "custom" + } + }, { "path": "pages/cashWithdrow/cashWithdrow", "style" : diff --git a/pages/cashWithdrow/cashWithdrow.vue b/pages/cashWithdrow/cashWithdrow.vue index f67ddf4..a387478 100644 --- a/pages/cashWithdrow/cashWithdrow.vue +++ b/pages/cashWithdrow/cashWithdrow.vue @@ -2,6 +2,7 @@ + 提现金额 @@ -25,12 +26,14 @@ \ No newline at end of file diff --git a/pages/homePage/homePage.vue b/pages/homePage/homePage.vue index f62e4f9..df636e8 100644 --- a/pages/homePage/homePage.vue +++ b/pages/homePage/homePage.vue @@ -73,35 +73,37 @@ 领取蜂箱 - - - - - - - - - {{item.name}} - - - 还差{{item.groupNumber}}人 + + + + + + + - - - + + {{item.name}} + + + 还差{{item.groupNumber}}人 + + + + + + {{ percent + '%' }} - {{ percent + '%' }} - - - - 领养类型: - {{item.beehiveType}} - - - 领养时间: - {{item.createTime}} + + + 领养类型: + {{item.beehiveType}} + + + 领养时间: + {{item.createTime}} + @@ -142,9 +144,7 @@ onShow(() => { onMounted(() => { getSwiperList() getInfoData() - if (getToken()) { - getInfoDataList() - } + }) const swiperList=ref(['/static/images/轮播图(1).png','/static/images/轮播图(1).png']) const infoData=ref({}) @@ -242,10 +242,26 @@ const gotoMyBeehive = (item) => { // 接收当前item参数 }); }; // 领取蜂箱跳转 -const collectBee=()=>{ +const collectBee = () => { + if (!getToken()) { + uni.showModal({ + title: '提示', + content: '请先登录', + success: (res) => { + if (res.confirm) { + uni.navigateTo({ + url: '/pages/login/login' + }) + } + } + }) + return + }else{ uni.navigateTo({ - url: '/pages/homePage/collectBee' - }); + url: '/pages/homePage/collectBee' + }); + } + } @@ -254,7 +270,7 @@ const collectBee=()=>{ diff --git a/pages/myPage/myPage.vue b/pages/myPage/myPage.vue index 4e4eba5..91795cb 100644 --- a/pages/myPage/myPage.vue +++ b/pages/myPage/myPage.vue @@ -12,7 +12,18 @@ - + + + + {{userInfo.nickname||'暂未登陆' }} @@ -245,21 +256,27 @@ const gotoOrderList = () => { } // 跳转蜂农入住 const gotoBeeFarmerJion = () => { - if (!getToken()) { - uni.showModal({ - title: '提示', - content: '请先登录', - success: (res) => { - if (res.confirm) { - uni.navigateTo({ url: '/pages/login/login' }) + if (!getToken()) { + uni.showModal({ + title: '提示', + content: '请先登录', + success: (res) => { + if (res.confirm) { + uni.navigateTo({ url: '/pages/login/login' }) + } + } + }) + } else { + if (userInfo.value.isBeefarmer) { + uni.navigateTo({ + url: '/pages/deviceManagement/deviceManagement' + }) + } else { + uni.navigateTo({ + url: '/pages/beeFarmerJion/beeFarmerJion' + }) } - } - }) - }else{ - uni.navigateTo({ - url: '/pages/beeFarmerJion/beeFarmerJion' - }) - } + } } // 跳转智能养蜂 const gotoSmartBee = () => { diff --git a/pages/shoppingMall/shopDetails.vue b/pages/shoppingMall/shopDetails.vue index 45c1358..6fde8d1 100644 --- a/pages/shoppingMall/shopDetails.vue +++ b/pages/shoppingMall/shopDetails.vue @@ -78,29 +78,42 @@ //添加物品 const buyBtn = async () => { - + if (!getToken()) { + uni.showModal({ + title: '提示', + content: '请先登录', + success: (res) => { + if (res.confirm) { + uni.navigateTo({ + url: '/pages/login/login' + }) + } + } + }) + return + } + try { const res = await request({ url: '/app-api/trade/cart/add', showLoading: true, - method:'post', - data:{ - skuId:commodityDetails.value.id, - count:'1' - }, - header: { - 'Authorization': `Bearer ${getToken()}` - } + method:'post', + data:{ + skuId:commodityDetails.value.id, + count:'1' + }, + header: { + 'Authorization': `Bearer ${getToken()}` + } }) if (res.code === 0 || res.code === 200) { - uni.navigateTo({ - url: '/pages/shoppingCart/shoppingCart' - }) + uni.navigateTo({ + url: '/pages/shoppingCart/shoppingCart' + }) } else { throw new Error(res.msg || '数据异常') } - } - catch (err) { + } catch (err) { console.error('获取商场数据失败:', err) } } diff --git a/pages/shoppingMall/shoppingMall.vue b/pages/shoppingMall/shoppingMall.vue index 64fce8e..7c8243f 100644 --- a/pages/shoppingMall/shoppingMall.vue +++ b/pages/shoppingMall/shoppingMall.vue @@ -94,7 +94,7 @@ onMounted(() => {