@@ -28,6 +28,11 @@ | |||
"style": { | |||
"navigationBarTitleText": "消息" | |||
} | |||
},{ | |||
"path": "pages/main/plan/plan", | |||
"style": { | |||
"navigationBarTitleText": "计划" | |||
} | |||
}, | |||
{ | |||
"path": "pages/main/task/page2/scan_review", | |||
@@ -5,7 +5,7 @@ | |||
<view v-if="tabberPageLoadFlag[0]" :style="{ | |||
display: currentTabbarIndex === 0 ? '' : 'none' | |||
}"> | |||
<scroll-view class="custom-tabbar-page" scroll-y :scroll-top="scrollTop" @scroll="scroll" | |||
<scroll-view ref="scrollView1" class="custom-tabbar-page" scroll-y="true" :scroll-top="scrollTop" @scroll="scroll" | |||
:refresher-threshold="10" enable-back-to-top @scrolltolower="tabbarPageScrollLower"> | |||
<home ref="home"></home> | |||
</scroll-view> | |||
@@ -14,8 +14,9 @@ | |||
<view v-if="tabberPageLoadFlag[1]" :style="{ | |||
display: currentTabbarIndex === 1 ? '' : 'none' | |||
}"> | |||
<scroll-view class="custom-tabbar-page" :refresher-threshold="10" scroll-y enable-back-to-top | |||
@scrolltolower="tabbarPageScrollLower"> | |||
<scroll-view class="custom-tabbar-page" scroll-y="true" :scroll-top="scrollTop" @scroll="scroll" | |||
:refresher-threshold="10" enable-back-to-top | |||
@scrolltolower="tabbarPageScrollLower" > | |||
<message ref="message"></message> | |||
</scroll-view> | |||
</view> | |||
@@ -23,7 +24,7 @@ | |||
<view v-if="tabberPageLoadFlag[2]" :style="{ | |||
display: currentTabbarIndex === 2 ? '' : 'none' | |||
}"> | |||
<scroll-view class="custom-tabbar-page" :refresher-threshold="10" scroll-y enable-back-to-top | |||
<scroll-view class="custom-tabbar-page" :scroll-top="scrollTop" @scroll="scroll" :refresher-threshold="10" scroll-y enable-back-to-top | |||
@scrolltolower="tabbarPageScrollLower"> | |||
<task ref="task"></task> | |||
</scroll-view> | |||
@@ -32,26 +33,26 @@ | |||
<view v-if="tabberPageLoadFlag[3]" :style="{ | |||
display: currentTabbarIndex === 3 ? '' : 'none' | |||
}"> | |||
<scroll-view class="custom-tabbar-page" :refresher-threshold="10" scroll-y enable-back-to-top | |||
<scroll-view class="custom-tabbar-page" :scroll-top="scrollTop" @scroll="scroll" :refresher-threshold="10" scroll-y enable-back-to-top | |||
@scrolltolower="tabbarPageScrollLower"> | |||
<!-- <profile ref="profile"></profile> --> | |||
<plan ref="plan"></plan> | |||
</scroll-view> | |||
</view> | |||
<view v-if="tabberPageLoadFlag[4]" :style="{ | |||
display: currentTabbarIndex === 4 ? '' : 'none' | |||
}"> | |||
<scroll-view class="custom-tabbar-page" :refresher-threshold="10" scroll-y enable-back-to-top | |||
<scroll-view class="custom-tabbar-page" :scroll-top="scrollTop" @scroll="scroll" :refresher-threshold="10" scroll-y enable-back-to-top | |||
@scrolltolower="tabbarPageScrollLower"> | |||
<my ref="my"></my> | |||
</scroll-view> | |||
</view> | |||
<!-- 右上角形式的tabbar按钮--> | |||
<view class="" v-if="currentTabbarIndex === 2"> | |||
<view class="" v-if="currentTabbarIndex != 4"> | |||
<view class="icon15__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur button-2" | |||
@tap.stop="handleBtnClick"> | |||
<text class="tn-icon-scan tn-color-blue"></text> | |||
<text class=" tn-color-blue" :class="['tn-icon-'+[currentTabbarIndex===2?'scan':'refresh']]"></text> | |||
</view> | |||
</view> | |||
@@ -154,7 +155,7 @@ | |||
import Task from './main/task/task.vue'; | |||
import Message from './main/message/message.vue'; | |||
import Home from './main/home/home.vue'; | |||
import Task4 from './main/task/task.vue'; | |||
import Plan from './main/plan/plan.vue'; | |||
import my from './main/my/my.vue'; | |||
export default { | |||
@@ -170,7 +171,7 @@ | |||
Task, | |||
Message, | |||
Home, | |||
Task4, | |||
Plan, | |||
my | |||
}, | |||
data() { | |||
@@ -209,6 +210,15 @@ | |||
tabbarPageScrollLower(e) { | |||
if (this.currentTabbarIndex === 1) { | |||
this.$refs.message.reachBottom() | |||
}else if (this.currentTabbarIndex === 3) { | |||
this.$refs.plan.reachBottom() | |||
} | |||
}, | |||
tabbarPageScrollTop(){ | |||
if (this.currentTabbarIndex === 1) { | |||
this.$refs.message.reachBottom() | |||
}else if (this.currentTabbarIndex === 3) { | |||
this.$refs.plan.reachBottom() | |||
} | |||
}, | |||
@@ -247,9 +257,30 @@ | |||
this.oldScrollTop = e.detail.scrollTop | |||
}, | |||
handleBtnClick(e) { | |||
console.log('扫码复核') | |||
wx.vibrateShort(); | |||
this.$refs.task.openSan() | |||
if(this.currentTabbarIndex == 2){ | |||
console.log('扫码复核') | |||
wx.vibrateShort(); | |||
this.$refs.task.openSan() | |||
}else if(this.currentTabbarIndex == 0){ | |||
this.scrollTop = this.oldScrollTop | |||
this.$nextTick(function() { | |||
this.scrollTop = 0 | |||
}); | |||
this.$refs.home.refresh() | |||
}else if(this.currentTabbarIndex == 1){ | |||
this.scrollTop = this.oldScrollTop | |||
this.$nextTick(function() { | |||
this.scrollTop = 0 | |||
}); | |||
this.$refs.message.refresh() | |||
}else if(this.currentTabbarIndex == 3){ | |||
this.scrollTop = this.oldScrollTop | |||
this.$nextTick(function() { | |||
this.scrollTop = 0 | |||
}); | |||
this.$refs.plan.refresh() | |||
} | |||
}, | |||
} | |||
@@ -16,6 +16,9 @@ | |||
<div class="meteor1"></div> | |||
<div class="meteor2"></div> | |||
<div class="meteor3"></div> | |||
<div class="meteor4"></div> | |||
<div class="meteor5"></div> | |||
<div class="meteor6"></div> | |||
</view> | |||
<view class="login login-fixed"> | |||
@@ -596,8 +599,84 @@ | |||
} | |||
} | |||
.meteor4 { | |||
width: 4px; | |||
height: 48px; | |||
background: linear-gradient(0deg, $color 0, transparent 100%); | |||
position: absolute; | |||
top: 70px; | |||
transform: rotate(45deg); | |||
right: 100px; | |||
opacity: 0; | |||
animation: streak 4s linear infinite; | |||
//伪类实现发光头部 | |||
&::after { | |||
content: ""; | |||
position: absolute; | |||
width: 6px; | |||
height: 6px; | |||
border-radius: 50%; | |||
background: $color; | |||
filter: blur(1.8px); | |||
box-shadow: 0px -1px -1px 5px transparent; | |||
bottom: -4px; | |||
left: 50%; | |||
transform: translate(-50%); | |||
} | |||
} | |||
.meteor5 { | |||
width: 3px; | |||
height: 36px; | |||
background: linear-gradient(0deg, $color 0, transparent 100%); | |||
position: absolute; | |||
top: 270px; | |||
transform: rotate(45deg); | |||
right: 100px; | |||
opacity: 0; | |||
animation-delay: 2s; | |||
animation: streak 2.5s linear infinite; | |||
//伪类实现发光头部 | |||
&::after { | |||
content: ""; | |||
position: absolute; | |||
width: 6px; | |||
height: 6px; | |||
border-radius: 50%; | |||
background: $color; | |||
filter: blur(1.8px); | |||
box-shadow: 0px -1px -1px 5px transparent; | |||
bottom: -4px; | |||
left: 50%; | |||
transform: translate(-50%); | |||
} | |||
} | |||
.meteor6 { | |||
width: 2px; | |||
height: 36px; | |||
background: linear-gradient(0deg, $color 0, transparent 100%); | |||
position: absolute; | |||
top: 170px; | |||
transform: rotate(45deg); | |||
right: 100px; | |||
animation-delay: 0.5s; | |||
opacity: 0; | |||
animation: streak 2.2s linear infinite; | |||
//伪类实现发光头部 | |||
&::after { | |||
content: ""; | |||
position: absolute; | |||
width: 6px; | |||
height: 6px; | |||
border-radius: 50%; | |||
background: $color; | |||
filter: blur(1.8px); | |||
box-shadow: 0px -1px -1px 5px transparent; | |||
bottom: -4px; | |||
left: 50%; | |||
transform: translate(-50%); | |||
} | |||
} | |||
@keyframes streak { | |||
0% { | |||
transform: rotate(50deg) translateY(-100px) scale(0.5); | |||
@@ -96,7 +96,6 @@ | |||
ProgressBar | |||
}, | |||
data(){ | |||
return { | |||
CircleData, | |||
ProductRateData, | |||
@@ -108,6 +107,13 @@ | |||
} | |||
}, | |||
methods:{ | |||
refresh(){ | |||
uni.showLoading(); | |||
setTimeout(() => { | |||
this.delayload = true; | |||
uni.hideLoading(); | |||
}, 1000) | |||
}, | |||
finishProcess(totalNum,finishNum){ | |||
if(totalNum==0){ | |||
return 0; | |||
@@ -1,25 +1,26 @@ | |||
<template> | |||
<view class="pages-a"> | |||
<view class=" bg-frosted-glass" :style="{height: 150+vuex_custom_bar_height+'rpx'}"></view> | |||
<!-- tabs --> | |||
<view class="tabs-fixed tn-bg-white"> | |||
<view class="tn-flex tn-padding-top-sm" | |||
:style="{marginTop: vuex_custom_bar_height + 'rpx'}"> | |||
<view class="tabs-fixed "> | |||
<view class="tn-flex tn-padding-top-sm " | |||
:style="{marginTop: vuex_custom_bar_height-30 + 'rpx'}"> | |||
<view style="width: 100vw;overflow: hidden;"> | |||
<tn-tabs class="" :list="scrollList" :current="current" :isScroll="false" activeColor="#3668FC" :bold="true" | |||
:fontSize="32" :top="30" :badgeOffset="[20, 100]" :barWidth="80" @change="tabChange" backgroundColor="#FFFFFF" | |||
<tn-tabs class="tab-bg" :list="scrollList" :current="current" :isScroll="false" activeColor="#3668FC" :bold="true" | |||
:fontSize="32" :top="30" :badgeOffset="[20, 100]" :barWidth="80" @change="tabChange" | |||
:height="100"></tn-tabs> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="top_title" :style="{marginTop: vuex_custom_bar_height + 'rpx'}"> | |||
<view class="top_title" :style="{marginTop: vuex_custom_bar_height-10 + 'rpx'}"> | |||
设备报警 | |||
</view> | |||
<view class="mask-to-read" :style="{marginTop: vuex_custom_bar_height+20 + 'rpx'}" @tap.stop="maskToRead"> | |||
<view class="mask-to-read" :style="{marginTop: vuex_custom_bar_height+0 + 'rpx'}" @tap.stop="maskToRead"> | |||
全部标为已读 | |||
</view> | |||
<!-- 页面内容 --> | |||
<view class="tn-padding" :style="{marginTop: vuex_custom_bar_height+optionHeight+50 + 'rpx'}"> | |||
<view class="tn-padding content" :style="{marginTop: vuex_custom_bar_height+optionHeight+50 + 'rpx'}"> | |||
<view v-show="current === 0 && isLogin" style="position: relative;" @click="handleMessageClick(item, index)" | |||
class="article-shadow tn-bg-white tn-padding tn-margin-bottom" v-for="(item, index) in messageList" | |||
:key="item.id"> | |||
@@ -40,7 +41,7 @@ | |||
</view> | |||
<view v-show="current === 1 && isLogin" style="position: relative;" @click="handleMessageClick(item, index)" | |||
class="article-shadow tn-bg-white tn-padding tn-margin-bottom" v-for="(item, index) in resultMessageList" | |||
class="article-shadow tn-bg-white tn-padding tn-margin-bottom" v-for="(item, index) in historyMessageList" | |||
:key="item.id"> | |||
<view class="tn-text-ellipsis tn-text-bold" style="color: #080808;font-size: 26rpx;"> | |||
{{item.content}} | |||
@@ -132,14 +133,14 @@ | |||
page: 1, | |||
size: 10 | |||
}, | |||
resMessageQuery: { | |||
hisMessageQuery: { | |||
page: 1, | |||
size: 10 | |||
}, | |||
messageList: [], | |||
resultMessageList: [], | |||
historyMessageList: [], | |||
loadmore: true, | |||
resultLoadmore: true, | |||
hostoryLoadmore: true, | |||
showTipModal: false, | |||
message: '', | |||
deviceName: '', | |||
@@ -172,7 +173,7 @@ | |||
mounted() { | |||
this.isLogin = this.vuex_user.hasLogin | |||
this.getToDoMessageList() | |||
this.getResultMessageList() | |||
this.gethistoryMessageList() | |||
this.$nextTick(() => { | |||
const query = uni.createSelectorQuery().in(this) | |||
query.select('.tabs-fixed').boundingClientRect(data => { | |||
@@ -214,7 +215,7 @@ | |||
this.messageList.forEach((item, index)=>{ | |||
item.status = 1 | |||
}) | |||
this.resultMessageList.forEach((item, index)=>{ | |||
this.historyMessageList.forEach((item, index)=>{ | |||
item.status = 1 | |||
}) | |||
this.scrollList[0].count = 0 | |||
@@ -222,8 +223,11 @@ | |||
}, | |||
getToDoMessageList() { | |||
console.log("getToDoMessageList") | |||
if(!this.vuex_user.hasLogin){ | |||
return | |||
} | |||
this.$refs.loading.open() | |||
if(this.isTest && this.vuex_user.hasLogin){ | |||
if(this.isTest){ | |||
setTimeout(()=>{ | |||
this.messageList = [{ | |||
id:1, | |||
@@ -239,7 +243,7 @@ | |||
content:'异常加热故障信息' | |||
} | |||
] | |||
this.resultMessageList = [{ | |||
this.historyMessageList = [{ | |||
id:11, | |||
status:0,//0未读 | |||
deviceName:'机器人r221', | |||
@@ -275,10 +279,34 @@ | |||
deviceName:'炒锅c2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', | |||
createTime:'2024/12/9 09:25:11', | |||
content:'异常加热故障信息xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |||
},{ | |||
id:22, | |||
status:0,//0未读 | |||
deviceName:'炒锅c112', | |||
createTime:'2024/12/10 13:19:59', | |||
content:'异常加热故障信息' | |||
},{ | |||
id:23, | |||
status:0,//0未读 | |||
deviceName:'炒锅c2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', | |||
createTime:'2024/12/9 09:25:11', | |||
content:'异常加热故障信息xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |||
},{ | |||
id:22, | |||
status:0,//0未读 | |||
deviceName:'炒锅c112', | |||
createTime:'2024/12/10 13:19:59', | |||
content:'异常加热故障信息' | |||
},{ | |||
id:23, | |||
status:0,//0未读 | |||
deviceName:'炒锅c2xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', | |||
createTime:'2024/12/9 09:25:11', | |||
content:'异常加热故障信息xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' | |||
} | |||
] | |||
this.scrollList[0].count = this.messageList.length | |||
this.scrollList[1].count = this.resultMessageList.length | |||
this.scrollList[1].count = this.historyMessageList.length | |||
this.$refs.loading.close() | |||
this.$store.state.hasMessage = true | |||
},500); | |||
@@ -309,7 +337,7 @@ | |||
} | |||
}, | |||
getResultMessageList() { | |||
gethistoryMessageList() { | |||
this.$refs.loading.open() | |||
if(this.isTest && this.vuex_user.hasLogin){ | |||
setTimeout(()=>{ | |||
@@ -321,7 +349,7 @@ | |||
let list = res.pageInfo.pageData | |||
this.scrollList[0].count = res.todoCount | |||
this.scrollList[1].count = res.resultCount | |||
this.resultMessageList = list | |||
this.historyMessageList = list | |||
this.$refs.loading.close() | |||
this.isLogin = true | |||
}).catch(e => { | |||
@@ -350,10 +378,16 @@ | |||
} else if (this.current === 1) { | |||
this.resultListReachBottom() | |||
} | |||
}, | |||
fresh(){ | |||
}, | |||
todoListReachBottom() { | |||
console.log("todoListReachBottom") | |||
if(this.isTest && this.vuex_user.hasLogin){ | |||
if(!this.vuex_user.hasLogin){ | |||
return | |||
} | |||
if(this.isTest){ | |||
if(this.messageList.length>8){ | |||
return | |||
} | |||
@@ -416,8 +450,11 @@ | |||
}, | |||
resultListReachBottom() { | |||
console.log("resultListReachBottom") | |||
if(this.isTest && this.vuex_user.hasLogin){ | |||
if(this.resultMessageList.length>15){ | |||
if(!this.vuex_user.hasLogin){ | |||
return | |||
} | |||
if(this.isTest){ | |||
if(this.historyMessageList.length>15){ | |||
return | |||
} | |||
this.status = 'loading' | |||
@@ -453,27 +490,27 @@ | |||
content:'异常加热故障信息' | |||
} | |||
] | |||
this.resultMessageList.push(...data1) | |||
this.historyMessageList.push(...data1) | |||
this.scrollList[1].count += data1.length | |||
this.$store.state.hasMessage = true | |||
},500) | |||
return | |||
} | |||
if (this.resultLoadmore) { | |||
this.resMessageQuery.page += 1 | |||
if (this.hostoryLoadmore) { | |||
this.hisMessageQuery.page += 1 | |||
this.status = 'loading' | |||
queryMyMessageListApi(this.resMessageQuery.page, this.resMessageQuery.size, 'RESULT').then(res => { | |||
queryMyMessageListApi(this.hisMessageQuery.page, this.hisMessageQuery.size, 'RESULT').then(res => { | |||
let list = res.pageInfo.pageData | |||
if (list.length !== 0) { | |||
this.resultMessageList.push(...list) | |||
this.historyMessageList.push(...list) | |||
} else { | |||
this.resultLoadmore = false | |||
this.hostoryLoadmore = false | |||
} | |||
this.status = 'nomore' | |||
}).catch(e => { | |||
// console.log(e); | |||
this.status = 'nomore' | |||
this.resultLoadmore = false | |||
this.hostoryLoadmore = false | |||
}) | |||
} | |||
}, | |||
@@ -485,7 +522,10 @@ | |||
this.showTipModal = true | |||
}, | |||
handleModalCancel() { | |||
if(this.isTest && this.vuex_user.hasLogin){ | |||
if(!this.vuex_user.hasLogin){ | |||
return | |||
} | |||
if(this.isTest){ | |||
if (this.current === 0) { | |||
// todo设为已读 | |||
if(this.messageList[this.currentMessageIndex].status === 0){ | |||
@@ -496,8 +536,8 @@ | |||
} | |||
} else if (this.current === 1) { | |||
// result设为已读 | |||
if(this.resultMessageList[this.currentMessageIndex].status === 0){ | |||
this.resultMessageList[this.currentMessageIndex].status = 1 | |||
if(this.historyMessageList[this.currentMessageIndex].status === 0){ | |||
this.historyMessageList[this.currentMessageIndex].status = 1 | |||
if(this.scrollList[1].count>0){ | |||
this.scrollList[1].count -= 1 | |||
} | |||
@@ -517,7 +557,7 @@ | |||
} | |||
} else if (this.current === 1) { | |||
// result设为已读 | |||
this.resultMessageList[this.currentMessageIndex].readState = 1 | |||
this.historyMessageList[this.currentMessageIndex].readState = 1 | |||
if(this.scrollList[1].count>0){ | |||
this.scrollList[1].count -= 1 | |||
} | |||
@@ -542,12 +582,12 @@ | |||
return | |||
} | |||
this.messageQuery.page = 1 | |||
this.resMessageQuery.page = 1 | |||
this.hisMessageQuery.page = 1 | |||
this.getToDoMessageList() | |||
this.getResultMessageList() | |||
this.gethistoryMessageList() | |||
this.current = 0 | |||
this.loadmore = true | |||
this.resultLoadmore = true | |||
this.hostoryLoadmore = true | |||
}, | |||
// buildSocketConnect() { | |||
// let that = this | |||
@@ -664,7 +704,6 @@ | |||
.pages-a { | |||
width: 100%; | |||
height: 100%; | |||
position: relative; | |||
} | |||
/* 底部安全边距 start*/ | |||
@@ -729,6 +768,28 @@ | |||
border-radius: 15rpx; | |||
box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(85, 170, 255, 0.2); | |||
// position: relative; | |||
box-sizing: border-box; | |||
} | |||
/* 背景毛玻璃 start */ | |||
.bg-frosted-glass { | |||
position: fixed; | |||
left: 0; | |||
top: 0; | |||
width: 100%; | |||
height: 200rpx; | |||
// background-color: rgba(212, 235, 255, 0.5); | |||
background: linear-gradient(0deg, #c5d5ff, #d4ebff, #d4ebff, #d4ebff); | |||
backdrop-filter: blur(20rpx); | |||
z-index: 11; | |||
-webkit-backdrop-filter: blur(20rpx); | |||
} | |||
.tab-bg{ | |||
background-color: rgba(0, 0, 0, 0); | |||
background:rgba(0, 0, 0, 0); | |||
z-index: 11; | |||
} | |||
.content{ | |||
position: relative; | |||
overflow: hidden; | |||
} | |||
</style> |
@@ -116,7 +116,7 @@ | |||
<view class="left-icon tn-main-gradient-teal"> | |||
<text class="tn-icon-set-fill tn-color-white"/> | |||
</view> | |||
<view class="left-text">物料统计设置</view> | |||
<view class="left-text">全局设置</view> | |||
</view> | |||
<view class="right"> | |||
<text class="tn-icon-right tn-color-gray"/> | |||
@@ -0,0 +1,601 @@ | |||
<template> | |||
<view class="pages-a"> | |||
<view class=" bg-frosted-glass" :style="{height: 150+vuex_custom_bar_height+'rpx'}"></view> | |||
<!-- tabs --> | |||
<view class="tabs-fixed "> | |||
<view class="tn-flex tn-padding-top-sm " | |||
:style="{marginTop: vuex_custom_bar_height-30 + 'rpx'}"> | |||
<view style="width: 100vw;overflow: hidden;"> | |||
<tn-tabs class="tab-bg" :list="scrollList" :current="current" :isScroll="false" activeColor="#3668FC" :bold="true" | |||
:fontSize="32" :top="30" :badgeOffset="[20, 100]" :barWidth="80" @change="tabChange" | |||
:height="100"></tn-tabs> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="top_title" :style="{marginTop: vuex_custom_bar_height-10 + 'rpx'}"> | |||
计划列表 | |||
</view> | |||
<!-- 页面内容 --> | |||
<view class="tn-padding" :style="{marginTop: vuex_custom_bar_height+optionHeight+50 + 'rpx'}"> | |||
<view v-show="isLogin" style="position: relative;" @click="handleMessageClick(item, index)" | |||
class="article-shadow tn-bg-white tn-padding tn-margin-bottom" v-for="(item, index) in dataStatusList" | |||
:key="item.id"> | |||
<view style="margin-top: 0rpx;" class="text-container-row tn-color-gray tn-text-sm tn-text-ellipsis"> | |||
<view class="text-half-left tn-text-ellipsis tn-text-bold" style="color: #080808;font-size: 26rpx;"> | |||
{{item.title}} | |||
</view> | |||
<view class="text-half-right-status tn-text-bold" | |||
:class="['status-' + item.status + '-color']" style="font-size: 26rpx;"> | |||
{{getStatusText(item.status)}} | |||
</view> | |||
</view> | |||
<view class="tn-text-ellipsis tn-text-bold tn-color-gray" style="font-size: 26rpx;margin-top: 20rpx;"> | |||
编号:{{item.id}} | |||
</view> | |||
<view style="margin-top: 10rpx;" class="text-container-row tn-color-gray tn-text-sm tn-text-ellipsis"> | |||
<view class="tn-text-ellipsis tn-text-bold tn-color-gray" style="font-size: 26rpx;"> | |||
总数:{{item.totalNum}} | |||
</view> | |||
<view class="tn-text-ellipsis tn-text-bold status-0-color" style="font-size: 26rpx;margin-left: 50rpx;"> | |||
已完成:{{item.finishNum}} | |||
</view> | |||
</view> | |||
<view style="margin-top: 10rpx;" class="text-container-colum tn-color-gray tn-text-sm tn-text-ellipsis"> | |||
<view class="text-half-left"> | |||
<text class="tn-icon-time" style="padding-right: 6rpx;"></text>计划开始时间:{{item.startTime | dateFormat}} | |||
</view> | |||
<view class="text-half-left" style=" margin-top: 10rpx;"> | |||
<text class="tn-icon-time" style="padding-right: 6rpx;"></text> 计划截至时间:{{item.stopTime | dateFormat}} | |||
</view> | |||
</view> | |||
<view class="tn-text-ellipsis tn-color-gray" style="font-size: 26rpx;margin-top: 10rpx;"> | |||
</text>计划负责人:{{item.manager}}</text> | |||
</view> | |||
</view> | |||
<tn-load-more v-if="isLogin" :status='status'></tn-load-more> | |||
<tn-empty v-else text="请先登录" mode="data" :imgWidth="200" :imgHeight="200"></tn-empty> | |||
</view> | |||
<w-loading text="拼命处理中..." mask="true" click="true" ref="loading"></w-loading> | |||
<tn-toast ref="toast"></tn-toast> | |||
<view class='tn-tabbar-height'></view> | |||
<view class="bg-tabbar-shadow"></view> | |||
</view> | |||
</template> | |||
<script> | |||
import { | |||
queryMydataListApi | |||
} from '@/api/message.js' | |||
import { | |||
dateShow | |||
} from '@/utils/index.js' | |||
import indexConfig from '@/config/index.config.js' | |||
export default { | |||
data() { | |||
return { | |||
isTest:true, | |||
show: true, | |||
current: 0, | |||
scrollList: [ | |||
{ | |||
name: '进行中', | |||
count: 0 | |||
}, | |||
{ | |||
name: '未开始', | |||
count: 0 | |||
}, | |||
{ | |||
name: '已结束', | |||
count: 0 | |||
} | |||
], | |||
messageQuery: { | |||
page: 1, | |||
size: 10 | |||
}, | |||
dataList: [], | |||
dataStatusList: [], | |||
loadmore: true, | |||
status: 'nomore', | |||
isLogin: true, | |||
optionHeight: 0, | |||
} | |||
}, | |||
filters: { | |||
dateFormat(date) { | |||
return dateShow(date, 'yyyy年MM月dd日 hh:mm') | |||
} | |||
}, | |||
mounted() { | |||
this.isLogin = this.vuex_user.hasLogin | |||
this.getdataList() | |||
this.$nextTick(() => { | |||
const query = uni.createSelectorQuery().in(this) | |||
query.select('.tabs-fixed').boundingClientRect(data => { | |||
this.optionHeight = Math.ceil(data.height) | |||
}) | |||
query.exec() | |||
}) | |||
// 初始化websocket相关 | |||
// this.buildSocketConnect().then(() => { | |||
// this.sendSocketMsg() | |||
// this.socketOnClose() | |||
// }).catch((e) => {}) | |||
}, | |||
methods: { | |||
getStatusText(status,finishNum,totalNum){ | |||
if(status==0){ | |||
return '进行中' | |||
}else if(status==1){ | |||
return '待启动' | |||
}else if(status==2){ | |||
return '已结束' | |||
} | |||
}, | |||
homeOnShow() { | |||
this.isLogin = this.vuex_user.hasLogin | |||
if (!this.vuex_user.hasLogin) { | |||
this.list = ['请先登录'] | |||
} | |||
}, | |||
tn(page) { | |||
this.$Router.push(page) | |||
}, | |||
getdataList() { | |||
console.log("getdataList") | |||
if(!this.vuex_user.hasLogin){ | |||
return | |||
} | |||
this.$refs.loading.open() | |||
if(this.isTest){ | |||
setTimeout(()=>{ | |||
this.dataList = [{ | |||
id:'165468795', | |||
title:'XXXXXXxxxxxxxxxxxxxxxxxxxxxxxxxxxXXXXXx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:0,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:13, | |||
totalNum:30, | |||
manager:'张三' | |||
},{ | |||
id:'165468795', | |||
title:'XXXXXXXXxxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:0,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:3, | |||
totalNum:30, | |||
manager:'' | |||
},{ | |||
id:'165468795', | |||
title:'XXXxxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:0,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:13, | |||
totalNum:30, | |||
manager:'张三' | |||
},{ | |||
id:'165468795', | |||
title:'xxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:0,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:3, | |||
totalNum:30, | |||
manager:'李四' | |||
},{ | |||
id:'165468795', | |||
title:'xxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:1,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:0, | |||
totalNum:30 | |||
},{ | |||
id:'165468795', | |||
title:'xxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:1,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:0, | |||
totalNum:30 | |||
},{ | |||
id:'165468795', | |||
title:'xxxxxxxxxxxxxxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:2,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:30, | |||
totalNum:30 | |||
} | |||
] | |||
this.dataStatusList = [] | |||
this.dataList.forEach(item => { | |||
if(this.current==0){ | |||
if(item.status==0){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==1){ | |||
if(item.status==1){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==2){ | |||
if(item.status==2){ | |||
this.dataStatusList.push(item) | |||
} | |||
} | |||
}) | |||
this.$refs.loading.close() | |||
this.$store.state.hasMessage = true | |||
},500); | |||
}else{ | |||
queryMydataListApi(this.messageQuery.page, this.messageQuery.size).then(res => { | |||
let list = res.pageInfo.pageData | |||
this.dataList = list | |||
this.dataStatusList=[] | |||
list.forEach(item => { | |||
if(this.current==0){ | |||
if(item.status==0){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==1){ | |||
if(item.status==1){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==2){ | |||
if(item.status==2){ | |||
this.dataStatusList.push(item) | |||
} | |||
} | |||
}) | |||
this.$refs.loading.close() | |||
this.isLogin = true | |||
}).catch(e => { | |||
// console.log(e); | |||
this.$refs.loading.close() | |||
if (uni.getStorageSync("token")) { | |||
this.isLogin = true | |||
} else { | |||
this.isLogin = false | |||
} | |||
}) | |||
} | |||
}, | |||
tabChange(index) { | |||
this.current = index | |||
this.dataStatusList=[] | |||
this.dataList.forEach(item => { | |||
if(this.current==0){ | |||
if(item.status==0){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==1){ | |||
if(item.status==1){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==2){ | |||
if(item.status==2){ | |||
this.dataStatusList.push(item) | |||
} | |||
} | |||
}) | |||
}, | |||
reachBottom() { | |||
this.todoListReachBottom() | |||
}, | |||
todoListReachBottom() { | |||
console.log("todoListReachBottom") | |||
if(!this.vuex_user.hasLogin){ | |||
return | |||
} | |||
if(this.isTest){ | |||
this.status = 'loading' | |||
this.$refs.toast.show({ | |||
title: '加载更多', | |||
duration: 1000 | |||
}) | |||
setTimeout(()=>{ | |||
this.status = 'nomore' | |||
let data1 = [{ | |||
id:'165468795', | |||
title:'xxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:0,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:13, | |||
totalNum:30 | |||
},{ | |||
id:'165468795', | |||
title:'xxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:0,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:3, | |||
totalNum:30 | |||
},{ | |||
id:'165468795', | |||
title:'xxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:1,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:0, | |||
totalNum:30 | |||
},{ | |||
id:'165468795', | |||
title:'xxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:1,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:0, | |||
totalNum:30 | |||
},{ | |||
id:'165468795', | |||
title:'xxxxxxxxxxxxxxx', | |||
startTime:'2024/12/10', | |||
stopTime:'2024/12/30', | |||
status:2,//0未开始 1进行中 2结束 | |||
content:'xxxxxx', | |||
finishNum:30, | |||
totalNum:30 | |||
} | |||
] | |||
this.dataList.push(...data1) | |||
data1.forEach(item => { | |||
if(this.current==0){ | |||
if(item.status==0){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==1){ | |||
if(item.status==1){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==2){ | |||
if(item.status==2){ | |||
this.dataStatusList.push(item) | |||
} | |||
} | |||
}) | |||
},500) | |||
return | |||
} | |||
if (this.loadmore) { | |||
this.messageQuery.page += 1 | |||
this.status = 'loading' | |||
queryMydataListApi(this.messageQuery.page, this.messageQuery.size).then(res => { | |||
let list = res.pageInfo.pageData | |||
if (list.length !== 0) { | |||
this.dataList.push(...list) | |||
list.forEach(item => { | |||
if(this.current==0){ | |||
if(item.status==0){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==1){ | |||
if(item.status==1){ | |||
this.dataStatusList.push(item) | |||
} | |||
}else if(this.current==2){ | |||
if(item.status==2){ | |||
this.dataStatusList.push(item) | |||
} | |||
} | |||
}) | |||
} else { | |||
this.loadmore = false | |||
} | |||
this.status = 'nomore' | |||
}).catch(e => { | |||
// console.log(e); | |||
this.status = 'nomore' | |||
this.loadmore = false | |||
}) | |||
} | |||
}, | |||
refresh() { | |||
if (!this.isLogin) { | |||
this.$refs.toast.show({ | |||
title: '请登录', | |||
duration: 1000 | |||
}) | |||
if(this.isLogin) | |||
return | |||
} | |||
this.messageQuery.page = 1 | |||
this.getdataList() | |||
this.current = 0 | |||
this.loadmore = true | |||
}, | |||
} | |||
} | |||
</script> | |||
<style lang="scss" scoped> | |||
.tab-padding{ | |||
padding-top: 20rpx; | |||
} | |||
.badge{ | |||
z-index: 10; | |||
} | |||
.text-container-row { | |||
display: flex; /* 启用 Flexbox 布局 */ | |||
flex-direction: row; /* 子元素水平排列 */ | |||
width: 100%; /* 容器宽度设为 100% */ | |||
} | |||
.text-container-colum { | |||
display: flex; /* 启用 Flexbox 布局 */ | |||
flex-direction: column; /* 子元素水平排列 */ | |||
width: 100%; /* 容器宽度设为 100% */ | |||
} | |||
.text-half-left { | |||
flex: 1; /* 子元素平分容器宽度 */ | |||
padding-right: 20rpx; | |||
text-align: start; /* 可选:文本居中显示 */ | |||
box-sizing: border-box; /* 可选:包含内边距和边框在宽度内 */ | |||
} | |||
.text-half-right { | |||
flex: 1; /* 子元素平分容器宽度 */ | |||
text-align: end; /* 可选:文本居中显示 */ | |||
box-sizing: border-box; /* 可选:包含内边距和边框在宽度内 */ | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
} | |||
.text-half-right-status { | |||
flex: 0.3; /* 子元素平分容器宽度 */ | |||
text-align: end; /* 可选:文本居中显示 */ | |||
box-sizing: border-box; /* 可选:包含内边距和边框在宽度内 */ | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
} | |||
.top_title{ | |||
color: black; | |||
-webkit-background-clip: text; | |||
position: fixed; | |||
top: 0; | |||
display: flex; | |||
justify-content: center; | |||
height: 100rpx; | |||
margin: 0rpx ; | |||
font-size: 38rpx; | |||
z-index: 9999999; | |||
text-align: center; | |||
width: 100%; | |||
} | |||
.mask-to-read{ | |||
color: black; | |||
-webkit-background-clip: text; | |||
position: fixed; | |||
top: 0; | |||
display: flex; | |||
height: 100rpx; | |||
margin: 50rpx 20rpx 10rpx; | |||
height: 50rpx; | |||
font-size: 28rpx; | |||
z-index: 9999999; | |||
} | |||
.pages-a { | |||
width: 100%; | |||
height: 100%; | |||
position: relative; | |||
} | |||
/* 底部安全边距 start*/ | |||
.tn-tabbar-height { | |||
min-height: 120rpx; | |||
height: calc(140rpx + env(safe-area-inset-bottom) / 2); | |||
height: calc(140rpx + constant(safe-area-inset-bottom)); | |||
} | |||
/* 底部tabbar假阴影 start*/ | |||
.bg-tabbar-shadow { | |||
// background-image: repeating-linear-gradient(to top, rgba(0,0,0,0.1) 10rpx, rgba(255,255,255,0) , rgba(255,255,255,0)); | |||
box-shadow: 0rpx 0rpx 400rpx 0rpx rgba(0, 0, 0, 0.25); | |||
position: fixed; | |||
bottom: calc(0rpx + env(safe-area-inset-bottom) / 2); | |||
bottom: calc(0rpx + constant(safe-area-inset-bottom)); | |||
height: 60rpx; | |||
width: 100vw; | |||
z-index: 0; | |||
} | |||
.tabs-fixed { | |||
position: fixed; | |||
top: 0; | |||
width: 100%; | |||
transition: all 0.25s ease-out; | |||
z-index: 11; | |||
} | |||
.logo-image { | |||
z-index: 9999 !important; | |||
width: 65rpx; | |||
height: 65rpx; | |||
position: relative; | |||
} | |||
.logo-pic { | |||
z-index: 9999 !important; | |||
background-size: cover; | |||
background-repeat: no-repeat; | |||
// background-attachment:fixed; | |||
background-position: top; | |||
border-radius: 50%; | |||
} | |||
/* 旋转 */ | |||
.png-sussuspension1 { | |||
animation: suspension1 12s ease-in-out infinite; | |||
} | |||
@keyframes suspension1 { | |||
0% { | |||
transform: rotate(0deg); | |||
} | |||
100% { | |||
transform: rotate(360deg); | |||
} | |||
} | |||
.article-shadow { | |||
border-radius: 15rpx; | |||
box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(85, 170, 255, 0.2); | |||
// position: relative; | |||
} | |||
/* 背景毛玻璃 start */ | |||
.bg-frosted-glass { | |||
position: fixed; | |||
left: 0; | |||
top: 0; | |||
width: 100%; | |||
height: 200rpx; | |||
// background-color: rgba(212, 235, 255, 0.5); | |||
background: linear-gradient(0deg, #c5d5ff, #d4ebff, #d4ebff, #d4ebff); | |||
backdrop-filter: blur(20rpx); | |||
z-index: 11; | |||
-webkit-backdrop-filter: blur(20rpx); | |||
} | |||
.tab-bg{ | |||
background-color: rgba(0, 0, 0, 0); | |||
background:rgba(0, 0, 0, 0); | |||
} | |||
.status-0-color{ | |||
color: coral; | |||
} | |||
.status-1-color{ | |||
color: green; | |||
} | |||
.status-2-color{ | |||
color: gray; | |||
} | |||
</style> |
@@ -34,7 +34,7 @@ const store = new Vuex.Store({ | |||
// 如果上面从本地获取的lifeData对象下有对应的属性,就赋值给state中对应的变量 | |||
// 加上vuex_前缀,是防止变量名冲突,也让人一目了然 | |||
vuex_user: lifeData.vuex_user ? lifeData.vuex_user : | |||
{forcedLogin: false, hasLogin: false, userId: '', userName: '游客', warehouse: '', | |||
{forcedLogin: false, hasLogin: true, userId: '', userName: '游客', warehouse: '', | |||
companyName:'请登录',factoryId:''}, | |||
vuex_token: lifeData.vuex_token ? lifeData.vuex_token : {accessToken: '', refreshToken: ''}, | |||
// 如果vuex_version无需保存到本地永久存储,无需lifeData.vuex_version方式 | |||
@@ -1,8 +1,8 @@ | |||
var isReady=false;var onReadyCallbacks=[]; | |||
var isServiceReady=false;var onServiceReadyCallbacks=[]; | |||
var __uniConfig = {"pages":["pages/index","pages/main/home/home","pages/main/task/task","pages/main/message/message","pages/main/task/page2/scan_review","pages/login/login","pages/main/my/my","pages/main/my/page2/about"],"window":{"navigationStyle":"custom","navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"TestApp","compilerVersion":"4.41","entryPagePath":"pages/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; | |||
var __uniRoutes = [{"path":"/pages/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"主页","onReachBottomDistance":50}},{"path":"/pages/main/home/home","meta":{},"window":{"navigationBarTitleText":"统计页","onReachBottomDistance":50}},{"path":"/pages/main/task/task","meta":{},"window":{"navigationBarTitleText":"任务"}},{"path":"/pages/main/message/message","meta":{},"window":{"navigationBarTitleText":"消息"}},{"path":"/pages/main/task/page2/scan_review","meta":{},"window":{"navigationBarTitleText":"扫码复核"}},{"path":"/pages/login/login","meta":{},"window":{"navigationBarTitleText":"登录"}},{"path":"/pages/main/my/my","meta":{},"window":{"navigationBarTitleText":"我的"}},{"path":"/pages/main/my/page2/about","meta":{},"window":{"navigationBarTitleText":"关于"}}]; | |||
var __uniConfig = {"pages":["pages/index","pages/main/home/home","pages/main/task/task","pages/main/message/message","pages/main/plan/plan","pages/main/task/page2/scan_review","pages/login/login","pages/main/my/my","pages/main/my/page2/about"],"window":{"navigationStyle":"custom","navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8"},"darkmode":false,"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"TestApp","compilerVersion":"4.41","entryPagePath":"pages/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}}; | |||
var __uniRoutes = [{"path":"/pages/index","meta":{"isQuit":true},"window":{"navigationBarTitleText":"主页","onReachBottomDistance":50}},{"path":"/pages/main/home/home","meta":{},"window":{"navigationBarTitleText":"统计页","onReachBottomDistance":50}},{"path":"/pages/main/task/task","meta":{},"window":{"navigationBarTitleText":"任务"}},{"path":"/pages/main/message/message","meta":{},"window":{"navigationBarTitleText":"消息"}},{"path":"/pages/main/plan/plan","meta":{},"window":{"navigationBarTitleText":"计划"}},{"path":"/pages/main/task/page2/scan_review","meta":{},"window":{"navigationBarTitleText":"扫码复核"}},{"path":"/pages/login/login","meta":{},"window":{"navigationBarTitleText":"登录"}},{"path":"/pages/main/my/my","meta":{},"window":{"navigationBarTitleText":"我的"}},{"path":"/pages/main/my/page2/about","meta":{},"window":{"navigationBarTitleText":"关于"}}]; | |||
__uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); | |||
__uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}}); | |||
service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}}); |