feat():头像修改

master
李神峰 2024-11-07 10:29:29 +08:00
parent c65d846ada
commit 7aeb4aa5a0
13 changed files with 294 additions and 832 deletions

View File

@ -15,8 +15,6 @@
</div> </div>
</div> </div>
<div class="right"> <div class="right">
<!-- <div>{{ monthDay }}</div>
<div>{{ dataType[dayOfWeek] }}</div> -->
<u-icon name="bell-fill" size="30" color="#fff" @click="todetailmessgae()"> <u-icon name="bell-fill" size="30" color="#fff" @click="todetailmessgae()">
</u-icon> </u-icon>
@ -26,7 +24,8 @@
<!-- nav --> <!-- nav -->
<view class="navBar" style="display: flex;flex-wrap: wrap;"> <view class="navBar" style="display: flex;flex-wrap: wrap;">
<div class="navList" v-for="(item, index) in getNavList" :key="index"> <div class="navList" v-for="(item, index) in getNavList" :key="index">
<div @click="myNavigateTo(item.url,item.value)" style="display:flex;flex-direction: column;align-items: center;"> <div @click="myNavigateTo(item.url,item.value)"
style="display:flex;flex-direction: column;align-items: center;">
<div class="navIcon"> <div class="navIcon">
<image style="width: 100%; height: 100%" :src="item.icon" mode="aspectFit"></image> <image style="width: 100%; height: 100%" :src="item.icon" mode="aspectFit"></image>
<div class="readStatus" v-show=" <div class="readStatus" v-show="
@ -39,22 +38,10 @@
</div> </div>
</view> </view>
<view class="warn"> <view class="warn">
<!-- <image
style="
width: 18rpx;
height: 22rpx;
margin-right: 16rpx;
vertical-align: middle;
"
src="../../static/tabs/ld.png"
mode="aspectFit"
></image
><span style="color: #000">当前防汛应急响应</span>
<span style="color: #59a7ff">{{ !level || !yjStatus ? '无' : level }}</span> -->
<sk-info /> <sk-info />
</view> </view>
<view class="warn" v-for="item in Ylzlist"> <view class="warn" v-for="item in Ylzlist" :key="item.stnm">
<ylz-list :item='item'/> <ylz-list :item='item' />
</view> </view>
<view class="info_24" <view class="info_24"
@ -66,30 +53,9 @@
</template> </template>
<script> <script>
const dataType = {
Monday: '星期一',
Tuesday: '星期二',
Wednesday: '星期三',
Thursday: '星期四',
Friday: '星期五',
Saturday: '星期六',
Sunday: '星期天'
}
import moment from 'moment' import moment from 'moment'
import {
level
} from '../../pages/utils/dicType'
import {
disType
} from '../utils/dicType.js'
import drpOption from './chartOption.js'
import {
restm
} from '../utils/tool'
import SkInfo from '../skInfo/index.vue' import SkInfo from '../skInfo/index.vue'
import YlzList from '../ylzList/index.vue' import YlzList from '../ylzList/index.vue'
export default { export default {
components: { components: {
SkInfo, SkInfo,
@ -97,99 +63,40 @@
}, },
data() { data() {
return { return {
Ylzlist:[], Ylzlist: [],
monthDay: '',
dayOfWeek: '',
dataType,
userList: uni.getStorageSync('value').data, userList: uni.getStorageSync('value').data,
changeBool: false,
tableData: [],
loading: false,
list: {},
date: '',
ydate: '',
showTextTypeTab: 1,
tableData: {},
tm: '',
level: '',
yjStatus: 0,
// limit: disType(uni.getStorageSync('value').adcd),
limit: 1, limit: 1,
value1: 3,
rainChartData: [],
formData: {
stm: moment()
.subtract(1, 'days')
.startOf('day')
.set({
hour: 8,
minute: 0
}),
etm: moment().startOf('day').set({
hour: 8,
minute: 0
})
},
rainChartData: [],
chartData: {},
current: 0,
hdList: [],
skList: [],
readStatus: false, // readStatus: false, //
readYjStatus: false, // readYjStatus: false, //
dispatchStatus: false, // dispatchStatus: false, //
default_src: uni.getStorageSync('avatar'), default_src: uni.getStorageSync('avatar'),
imgList: {}, messagelist: [],
imgtm: moment().format('YYYYMMDD'), ylzList: [],
imgData: [],
imgHours: '',
imgHourstm: [],
imgHoursList: {
url: ''
},
interval: null,
numPic: 0,
allStatus: false,
messagelist:[],
ylzList:[],
} }
}, },
onPullDownRefresh() { onPullDownRefresh() {
// this.getSwiperList() setTimeout(function () {
this.getOverview()
this.getDataTime()
this.getResponseLevel()
this.getDispatchStatus()
this.getReadStatus()
if (this.limit == 1) {
this.getYjRead()
// this.getInterval()
this.getImgs()
this.getHoursImg()
}
setTimeout(function() {
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();
}, 1000); }, 1000);
}, },
computed: { computed: {
getNavList() { getNavList() {
return [ return [{
{
value: '巡查任务', value: '巡查任务',
key: 1, key: 1,
icon: '../../static/tabs/yujing_icon@2x2.png', icon: '../../static/tabs/xcrw.png',
url: '/pages/xcrw/index' url: '/pages/xcrw/index'
}, },
{ {
value: '维修养护', value: '维修养护',
key: 2, key: 2,
icon: '../../static/tabs/yujing_icon@2x2.png', icon: '../../static/tabs/wxyh.png',
url: '/pages/wxyh/index' url: '/pages/wxyh/index'
}, },
{ {
value: '问题处理', value: '问题处理',
key: 3, key: 3,
icon: '../../static/tabs/yujing_icon@2x2.png', icon: '../../static/tabs/wtcl.png',
url: '/pages/wtcl/index' url: '/pages/wtcl/index'
}, },
{ {
@ -198,80 +105,42 @@
icon: '../../static/tabs/yujing_icon@2x2.png', icon: '../../static/tabs/yujing_icon@2x2.png',
url: '/pages/yj/index' url: '/pages/yj/index'
}, },
{ {
value: '视频监控', value: '视频监控',
key: 5, key: 5,
icon: '../../static/tabs/yujing_icon@2x2.png', icon: '../../static/tabs/spjk.png',
url: '/pages/spjk/index' url: '/pages/spjk/index'
}, },
{ {
value: '生态流量监控', value: '生态流量监控',
key: 6, key: 6,
icon: '../../static/tabs/yujing_icon@2x2.png', icon: '../../static/tabs/stlljk.png',
url: '/pages/stlljk/index' url: '/pages/stlljk/index'
}, },
{ {
value: '安全监测', value: '安全监测',
key: 7, key: 7,
icon: '../../static/tabs/yujing_icon@2x2.png', icon: '../../static/tabs/aqjc.png',
url: '/pages/aqjc/index' url: '/pages/aqjc/index'
}, },
] ]
} }
}, },
watch: {
rainChartData(newValue) {
this.chartData = {
...drpOption(newValue)
}
},
limit: {
handler(newValue) {
if (!newValue) {
this.getRainList()
}
},
immediate: true
},
current: {
handler(newValue) {
if (newValue == 0) {
this.getHdList()
} else {
this.getSkList()
}
},
immediate: true
},
allStatus: {
handler(newValue) {
const newArr = this.getNavList()
},
immediate: true
}
},
methods: { methods: {
getYlzList(){ getYlzList() {
uni.$http.post('/gunshiApp/xyt/stPptnRReal/list').then(res => { uni.$http.post('/gunshiApp/xyt/stPptnRReal/list').then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.Ylzlist = res.data.data this.Ylzlist = res.data.data
} }
}) })
}, },
getList() { getList() {
console.log(111);
uni.$http.post('/gunshiApp/xyt/messageCenter/list', { uni.$http.post('/gunshiApp/xyt/messageCenter/list', {
start:'', start: '',
end:'' end: ''
}).then(res => { }).then(res => {
if (res.data.code == 200) { if (res.data.code == 200) {
this.messagelist = res.data.data this.messagelist = res.data.data
} }
}) })
}, },
@ -280,176 +149,7 @@
url: '/pages/messageList/index' url: '/pages/messageList/index'
}) })
}, },
async getImgs() {
let h = moment().format('HH')
let m = moment().format('mm')
uni.request({
url: 'http://223.75.53.124:8005/grb/latest',
success: res => {
const myTm = res.data.data.tm
if (myTm) {
uni.request({
url: 'http://223.75.53.124:8005/grb/rainimglist',
data: {
tm: moment(myTm).format('YYYYMMDDHH')
},
success: res => {
console.log(res.data.data)
this.imgList = res.data.data
// let inx = restm(h)
// this.imgHours = res.data.data.imgHours[inx]
let tm = moment().add(1, 'days').format('MM月DD日')
let tm2 = moment().format('MM月DD日')
this.imgData = [`${tm2}08时`, `${tm}08时`]
// this.imgHourstm = [`${tm2}${h + 1}`, `${tm2}${h + 2}`]
}
})
}
}
})
},
getTmData() {
let hn = this.numPic > 0 ? this.numPic : 1
let h = moment().subtract(hn, 'hours').format()
let m = moment().format('mm')
console.log('hhh--', h, m, this.numPic)
let tms = null,
mm = null
let h1 = Number(h) - 1
if (h1 < 9) {
h1 = Number(h) - this.numPic
}
if (h1 < 10) {
h1 = `0${h1}`
}
if (m > 30) {
h1 = Number(h) - 1
let m1 = h > 10 ? h : `0${h}`
tms = `${this.imgtm}${m1}30`
mm = '30'
} else if (m < 10) {
tms = `${this.imgtm}${h1}`
mm = '00'
} else {
tms = `${this.imgtm}${h1}30`
mm = '30'
}
},
async getHoursImg() {
let h = moment().format('HH')
let m = moment().format('mm')
console.log('hhh--', h, m, this.numPic)
let tms = null,
mm = null
let h1 = Number(h) - 1
if (h1 < 10) {
let t = Number(h1) - Number(this.numPic)
h1 = `0${t}`
}
if (m > 30) {
h1 = Number(h) - 1
let t3 = Number(h) - this.numPic
if (this.numPic <= 0) {
let m3 = h1 > 10 ? h1 : `0${h1}`
tms = `${this.imgtm}${m3}30`
} else {
t3 = t3 < 10 ? `0${t3}` : t3
tms = `${this.imgtm}${t3}30`
}
mm = '30'
} else if (m < 10) {
tms = `${this.imgtm}${h1}00`
mm = '00'
} else {
tms = `${this.imgtm}${h1}30`
mm = '30'
}
console.log('小时', h1)
console.log('需要参数', tms)
uni.request({
url: 'http://223.75.53.124:8005/radar/latest',
success: res => {
let tm = moment(res.data.data.tm);
let subfix = '?rainFile=' + res.data.data.rainFile;
let url =
`http://shqxjs.cloudowr.cn/yj_folder/rain/radar/${tm.format('YYYYMM')}/${tm.format('DD')}/${tm.format('YYYYMMDDHHmm')}+00.02.jpg${subfix}`;
console.log(222222222227, url)
console.log('pic---', tms, res.data.data)
this.imgHoursList = {
'url': url
}
let m = moment().format('MM月DD日')
console.log('am222', this.imgHoursList)
let m1 = Number(h1) + 2
this.imgHourstm = [`${m}${h1}${mm}`, `${m}${m1}${mm}`]
if (url == null) {
this.numPic++
setTimeout(() => {
this.getHoursImg()
}, 10 * 1000)
} else {
this.numPic = 0
return
}
}
})
},
// async getInterval () {
// this.interval = setInterval(() => {
// this.getHoursImg()
// }, 60 * 1000)
// },
async getYjRead() {
try {
const {
data
} = await uni.$http.get(
'/gunshiApp/xfflood/current/situation/flag'
)
if (data.code == 200) {
this.readYjStatus = data.data
}
} catch (error) {
uni.$showMsg()
}
},
async getReadStatus() {
try {
const {
data
} = await uni.$http.get(
'/gunshiApp/xfflood/xfProjectRun/has/read'
)
if (data.code == 200) {
this.readStatus = Object.values(data.data).some(item => item == true)
}
} catch (error) {
uni.$showMsg()
}
},
async getDispatchStatus() {
try {
const res = await uni.$http.post('/gunshiApp/xfflood/xfEmerDispatchR/app/list', {
status: 1,
dispatchTypeList: ["0", "1"]
})
if (res.data.code == 200) {
this.dispatchStatus = res.data.data.length > 0 ? true : false
}
} catch (error) {
console.log(error);
}
},
async setInsert(menu2) { async setInsert(menu2) {
try { try {
const params = { const params = {
@ -458,287 +158,28 @@
menu1: '首页', menu1: '首页',
menu2: menu2 || '首页', menu2: menu2 || '首页',
} }
const { const {
data data
} = await uni.$http.post('/gunshiApp/xfflood/visitMenuLog/insert', params) } = await uni.$http.post('/gunshiApp/xfflood/visitMenuLog/insert', params)
console.log('用户行为', params, data)
} catch (error) {} } catch (error) {}
}, },
jumpHdDetail(params) {
uni.navigateTo({
url: `/pages/hdDetail/hdDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&wrz=${params.wrz}&grz=${params.grz}`
})
},
jumpSkDetail(params) {
uni.navigateTo({
url: `/pages/skDetail/skDetail?stcd=${params.stcd}&stnm=${params.stnm}&source=${params.source}&afsltdz=${params.afsltdz}&flLowLimLev=${params.flLowLimLev}&desFloodLev=${params.desFloodLev}&calFloodLev=${params.calFloodLev}&resCode=${params.resCode}`
})
},
async getSkList() {
try {
const {
data
} = await uni.$http.post(
'/gunshiApp/xfflood/reservoir/water/list', {
sources: ['SW', 'SK'],
adcd: uni.getStorageSync('value').adcd
}
)
if (data.code == 200) {
this.skList = data.data
}
} catch (error) {
uni.$showMsg()
}
},
async getHdList() {
try {
const {
data
} = await uni.$http.post(
'/gunshiApp/xfflood/river/water/list', {
sources: ['SH', 'SW'],
adcd: uni.getStorageSync('value').adcd
}
)
if (data.code == 200) {
this.hdList = data.data
}
} catch (error) {
uni.$showMsg()
}
},
subChange(e) {
this.current = e
},
async getRainList() {
try {
const {
data
} = await uni.$http.post(
'/gunshiApp/xfflood/real/rain/home/list', {
start: this.formData.stm.format('YYYY-MM-DD HH:mm:ss'),
end: this.formData.etm.format('YYYY-MM-DD HH:00:00')
}
)
if (data.code == 200) {
console.log('rainChartData0,', data)
this.rainChartData = data.data
}
} catch (error) {
uni.$showMsg()
}
},
changeTime(params) {
let tmValue = []
if (params === 1) {
tmValue = [
moment()
.subtract(1, 'days')
.startOf('day')
.set({
hour: 8,
minute: 0
}),
moment()
]
} else if (params === 2) {
tmValue = [
moment().startOf('day').set({
hour: 8,
minute: 0
}),
moment()
]
} else if (params === 3) {
tmValue = [
moment()
.subtract(1, 'days')
.startOf('day')
.set({
hour: 8,
minute: 0
}),
moment().startOf('day').set({
hour: 8,
minute: 0
})
]
} else if (params === 4) {
tmValue = [moment().subtract(1, 'hours'), moment()]
} else if (params === 5) {
tmValue = [moment().subtract(3, 'hours'), moment()]
} else if (params === 6) {
tmValue = [moment().subtract(6, 'hours'), moment()]
} else if (params === 7) {
tmValue = [moment().subtract(12, 'hours'), moment()]
} else if (params === 8) {
tmValue = [moment().subtract(24, 'hours'), moment()]
}
this.formData.stm = tmValue[0]
this.formData.etm = tmValue[1]
this.getRainList()
},
todetail(val) {
console.log('val', val)
if (val == 1) {
uni.navigateTo({
url: '/pages/rain/index'
})
}
if (val == 3) {
uni.navigateTo({
url: '/pages/gqzq/index'
})
}
},
tabChange(val) {
this.showTextTypeTab = val
if (val == 1) {
this.getWeather()
} else {
this.getWeatherArea()
}
},
changeTable(val) {
this.changeBool = !this.changeBool
if (val) {
this.getWeather()
}
console.log('this.changeBool', this.changeBool)
},
// /weather/area
async getWeatherArea() {
try {
const res = await uni.$http.post('/gunshiApp/xfflood/weather/area', {
tm: this.tm
})
console.log('--44-', res)
this.tableData = res
// this.userList = res.data
// console.log('--333-', this.tableData)
} catch (e) {
uni.$showMsg()
}
},
// /weather/res
async getWeather() {
try {
const res = await uni.$http.post('/gunshiApp/xfflood/weather/res', {
tm: this.tm
})
console.log('--3-', res)
this.tableData = res
// this.userList = res.data
console.log('--333-', this.tableData)
} catch (e) {
uni.$showMsg()
}
},
async getSwiperList() {
try {
const res = await uni.$http.get('/gunshiApp/xfflood/getLoginInfo')
console.log('--1-', res.data)
this.userList = res.data
console.log('--1-', this.userList)
} catch (e) {
uni.$showMsg()
}
},
async getOverview() {
try {
let res = await uni.$http.get('/gunshiApp/xfflood/real/rain/overview')
console.log('--2-', res)
this.list = res.data
console.log('--2-', res)
} catch (e) {
uni.$showMsg()
}
},
getDataTime() {
this.monthDay = moment().format('MM月DD日')
this.dayOfWeek = moment().format('dddd')
this.date = moment().format('MM月DD日HH时')
this.ydate = moment().subtract(1, 'days').format('MM月DD日HH时')
console.log('moment11', this.date, this.ydate)
let d1 = moment().format('YYYYMMDD')
let h1 = moment().format('HH') >= 20 ? '20' : '08'
this.tm = d1 + h1
},
async getResponseLevel() {
try {
const {
data
} = await uni.$http.post(
'/gunshiApp/xfflood/xfEmerRespR/page', {
pageSo: {
pageSize: 10,
pageNumber: 1
},
year: moment().format('YYYY')
}
)
if (data.code == 200) {
if (data.data.records.length > 0) {
console.log('1111111data', data)
this.level = level(data.data.records[0].level)
this.yjStatus = data.data.records[0].status
} else {
this.level = '无'
}
}
} catch (e) {
uni.$showMsg()
}
},
myNavigateTo(url, menu2) { myNavigateTo(url, menu2) {
uni.navigateTo({ uni.navigateTo({
url: url // url: url //
}) })
console.log(url);
this.setInsert(menu2) this.setInsert(menu2)
} }
//
}, },
onLoad() { onLoad() {
// this.getSwiperList()
this.getOverview()
this.getDataTime()
this.getResponseLevel()
this.getList() this.getList()
this.getYlzList() this.getYlzList()
this.userList = uni.getStorageSync('value') this.userList = uni.getStorageSync('value')
console.log(this.userList.userName, uni.getStorageSync('value'), '=============777777');
}, },
onShow() { onShow() {
this.getReadStatus()
this.getResponseLevel()
this.getDispatchStatus()
this.setInsert() this.setInsert()
// this.userList=uni.getStorageSync('value')
//
// console.log(this.userList.userName,uni.getStorageSync('value'),'=============777777');
if (this.limit == 1) {
this.getYjRead()
// this.getInterval()
this.getImgs()
this.getHoursImg()
}
} }
// onUnload () {
// clearInterval(this.interval)
// this.interval = null
// }
} }
</script> </script>
@ -821,55 +262,11 @@
text-align: left; text-align: left;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
/* 24小时 */
.chartChange {
text-align: center;
margin: 16rpx 0;
}
.chart_tit {
width: 129rpx;
height: 43rpx;
background: #d3e1ff;
border-radius: 20rpx;
color: #3380ff;
}
.chart_tit image {
margin-right: 10rpx;
width: 36rpx;
height: 30rpx;
}
.table_h {
display: flex;
text-align: center;
height: 24px;
/* position: absolute;
top: 0;
right: 0; */
}
/* info_24 */
.info_24 { .info_24 {
padding: 15px; padding: 15px;
background-color: #fff; background-color: #fff;
margin-bottom: 12rpx; margin-bottom: 12rpx;
} }
.heart {
display: flex;
justify-content: space-between;
align-items: center;
}
.fl {
display: flex;
justify-content: space-between;
align-items: center;
}
.title .line { .title .line {
border: 2px solid #3380ff; border: 2px solid #3380ff;
border-radius: 3rpx; border-radius: 3rpx;

View File

@ -26,11 +26,7 @@
<script> <script>
import CryptoJS from 'crypto-js' import CryptoJS from 'crypto-js'
import { const imgUrl = uni.getStorageSync("imgUrl");
onMounted
} from "vue"
let checked = false
const url = "http://223.75.53.141:9102/test.by-lyf.tmp"
export default { export default {
data() { data() {
return { return {
@ -55,6 +51,19 @@
checked = !checked checked = !checked
formData.checked = !formData.checked formData.checked = !formData.checked
}, },
// async getImgFlow(avatar){
// if(!avatar) {
// uni.setStorageSync("avatar",'../../static/tabs/touxiang.png')
// return
// }
// try {
// const {data} = await uni.$http.get(`/gunshiApp/xyt/common/download/resource?resource=${avatar}`)
// const url = fileChange(data)
// uni.setStorageSync("avatar",url)
// } catch (error) {
// }
// },
login(formData) { login(formData) {
//loading //loading
uni.showLoading({ uni.showLoading({
@ -101,12 +110,8 @@
if (res.data.token) { if (res.data.token) {
uni.setStorageSync('Gs-Token', res.data.token) uni.setStorageSync('Gs-Token', res.data.token)
uni.$http.get('/gunshiApp/xyt/getInfo').then(res => { uni.$http.get('/gunshiApp/xyt/getInfo').then(res => {
// let avatarUrl = res.data.user.avatar ? url + res.data.user.avatar : '../../static/tabs/touxiang.png'; // this.getImgFlow(res.data.user.avatar)
let avatarUrl = res.data.user.avatar ? url + '/gunshiApp/common/1/ResPlanB/微信图片_20240420225339_1723542338744.jpg' : '../../static/tabs/touxiang.png';
console.log("avatarUrl",avatarUrl);
uni.setStorageSync('value', res.data.user) uni.setStorageSync('value', res.data.user)
uni.setStorageSync('avatar', avatarUrl)
setTimeout(function () { setTimeout(function () {
uni.hideLoading() uni.hideLoading()
uni.reLaunch({ uni.reLaunch({

View File

@ -2,12 +2,8 @@
<view class="container"> <view class="container">
<view class="userInfo"> <view class="userInfo">
<div class="icon"> <div class="icon">
<image <image class="image-left" style="width: 100%; height: 100%" :src="default_src" mode="aspectFill">
class="image-left" </image>
style="width: 100%; height: 100%"
:src="default_src"
mode="aspectFill"
></image>
</div> </div>
<div class="user"> <div class="user">
<div class="username">{{this.userList.nickName}}</div> <div class="username">{{this.userList.nickName}}</div>
@ -15,15 +11,11 @@
</div> </div>
</view> </view>
<view class="funcBar"> <view class="funcBar">
<div class="funcList" v-for="(item, index) in func" :key="index" > <div class="funcList" v-for="(item, index) in func" :key="index">
<div @click="navigateToSubPage(index)"> <div @click="navigateToSubPage(index)">
<div class="funcIcon"> <div class="funcIcon">
<image <image class="icon-left" style="width: 100%; height: 100%" :src="item.img" mode="aspectFit">
class="icon-left" </image>
style="width: 100%; height: 100%"
:src="item.img"
mode="aspectFit"
></image>
</div> </div>
<div class="funcTxt">{{ item.name }}</div> <div class="funcTxt">{{ item.name }}</div>
</div> </div>
@ -45,31 +37,37 @@
</template> </template>
<script> <script>
const func = [ const func = [{
{img: '../../static/images/info.png', name: '个人信息', url:'/pages/personInfo/personInfo'}, img: '../../static/images/info.png',
{img: '../../static/images/password.png', name: '修改密码', url:'/pages/modifyPassword/modifyPassword'}, name: '个人信息',
url: '/pages/personInfo/personInfo'
},
{
img: '../../static/images/password.png',
name: '修改密码',
url: '/pages/modifyPassword/modifyPassword'
},
] ]
export default { export default {
data() { data() {
return { return {
userList: uni.getStorageSync('value'), userList: uni.getStorageSync('value'),
username:'', username: '',
userresponse:'防汛办', userresponse: '防汛办',
version:'011.14.23', version: '011.14.23',
func: func, func: func,
default_src: uni.getStorageSync('avatar'), default_src: uni.getStorageSync('avatar'),
} }
}, },
methods: { methods: {
navigateToSubPage(index){ navigateToSubPage(index) {
uni.navigateTo({ uni.navigateTo({
url: func[index].url, url: func[index].url,
animationType:'pop-in', animationType: 'pop-in',
}) })
}, },
logout() {
logout(){ if (uni.getStorageSync('loginChecked') === true) {
if(uni.getStorageSync('loginChecked')===true){
uni.redirectTo({ uni.redirectTo({
url: '/pages/login/login' url: '/pages/login/login'
}) })
@ -79,26 +77,28 @@
uni.removeStorageSync('Gs-Token') uni.removeStorageSync('Gs-Token')
uni.removeStorageSync('value') uni.removeStorageSync('value')
uni.removeStorageSync('password') uni.removeStorageSync('password')
uni.removeStorageSync('avatar')
uni.redirectTo({ uni.redirectTo({
url: '/pages/login/login' url: '/pages/login/login'
}) })
} }
} }
} },
} }
</script> </script>
<style> <style>
.container{ .container {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
height: 100vh; height: 100vh;
width: 100vw; width: 100vw;
background-color: #f3f5f8; background-color: #f3f5f8;
} }
.userInfo{
.userInfo {
border-radius: 5px; border-radius: 5px;
display: flex; display: flex;
flex-direction: row; flex-direction: row;
@ -109,9 +109,10 @@
width: 95%; width: 95%;
height: 15vh; height: 15vh;
background-color: #fff; background-color: #fff;
} }
.icon{
.icon {
width: 50px; width: 50px;
height: 50px; height: 50px;
border-radius: 50%; border-radius: 50%;
@ -121,22 +122,26 @@
color: #007afd; color: #007afd;
line-height: 50px; line-height: 50px;
} }
.image-left{
.image-left {
width: 80px; width: 80px;
height: 80px; height: 80px;
border-radius: 50%; border-radius: 50%;
} }
.user{
.user {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
margin-left: 6vw; margin-left: 6vw;
} }
.username{
.username {
font-size: 20px; font-size: 20px;
font-weight: bold; font-weight: bold;
margin-bottom: 1vh; margin-bottom: 1vh;
} }
.funcIcon{
.funcIcon {
width: 50px; width: 50px;
height: 50px; height: 50px;
margin-left: 4px; margin-left: 4px;
@ -145,6 +150,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
} }
.funcBar { .funcBar {
border-radius: 5px; border-radius: 5px;
margin-bottom: 2vh; margin-bottom: 2vh;
@ -156,12 +162,14 @@
height: 15vh; height: 15vh;
background-color: #fff; background-color: #fff;
} }
.funcList { .funcList {
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
margin: 2vw; margin: 2vw;
} }
.version{
.version {
margin-left: 2vw; margin-left: 2vw;
border-radius: 5px; border-radius: 5px;
display: flex; display: flex;
@ -169,37 +177,44 @@
width: 95%; width: 95%;
height: 8vh; height: 8vh;
background-color: #fff; background-color: #fff;
} }
.content{
.content {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
} }
.left{
width:100px; .left {
width: 100px;
text-align: start; text-align: start;
margin-left: 1vw; margin-left: 1vw;
line-height: 8vh; line-height: 8vh;
} }
.icon-left{
.icon-left {
align-items: center; align-items: center;
width: 30px; width: 30px;
/* background-color: red; */ /* background-color: red; */
} }
.mid{
.mid {
flex: 1; flex: 1;
line-height: 8vh; line-height: 8vh;
} }
.right{
width:100px; .right {
width: 100px;
text-align: end; text-align: end;
line-height: 8vh; line-height: 8vh;
margin-right: 10px; margin-right: 10px;
} }
.null{
.null {
height: 45vh; height: 45vh;
} }
.button{
.button {
border-radius: 10px; border-radius: 10px;
display: flex; display: flex;
justify-content: center; justify-content: center;
@ -210,4 +225,4 @@
color: white; color: white;
background-color: #007afd; background-color: #007afd;
} }
</style> </style>

View File

@ -80,6 +80,9 @@
'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token') 'Authorization': 'Bearer ' + uni.getStorageSync('Gs-Token')
}, },
success: (res) => { success: (res) => {
const imgUrl = JSON.parse(res.data).imgUrl;
this.getImgFlow(imgUrl)
// uni.setStorageSync("imgUrl",imgUrl)
uni.$showMsg("上传成功") uni.$showMsg("上传成功")
}, },
}) })
@ -93,6 +96,20 @@
} }
}); });
}, },
getImgFlow(imgUrl) {
uni.request({
url: 'http://local.gunshiiot.com:18083' +
`/gunshiApp/xyt/common/download/resource?resource=${imgUrl}`,
responseType: 'arraybuffer',
success: (res) => {
// arraybufferBase64
let base64 = uni.arrayBufferToBase64(res.data);
const p = 'data:image/png;base64,' + base64;
uni.setStorageSync("avatar",p)
}
})
},
modifyValue(item) { modifyValue(item) {
console.log(item); console.log(item);
@ -139,7 +156,6 @@
=await uni.$http.put('/gunshiApp/xyt/system/user/profile', new_userList); =await uni.$http.put('/gunshiApp/xyt/system/user/profile', new_userList);
if (data.code == 200) { if (data.code == 200) {
uni.setStorageSync('value', new_userList) uni.setStorageSync('value', new_userList)
uni.setStorageSync('avatar', new_userList.avatar)
uni.reLaunch({ uni.reLaunch({
url: '/pages/mypage/mypage' url: '/pages/mypage/mypage'
}) })

View File

@ -62,3 +62,22 @@ export const adnmZhen = adcd => {
} }
return nameMap[`${adcd.substr(0, 9)}000000`] return nameMap[`${adcd.substr(0, 9)}000000`]
} }
export const fileChange = (file) => {
let target= ''
let blob = new Blob([file]);
console.log("blobblob",blob);
let url = window.URL.createObjectURL(blob);
// let reader = new FileReader(blob);
// console.log("reader",reader);
// reader.readAsDataURL(url);
// reader.onload = function (e) {
// target=e.target.result
// }
console.log("target",url);
return url
}

View File

@ -1,172 +1,182 @@
<template> <template>
<view :style="{height:'100vh',overflow:'auto'}"> <view :style="{height:'100vh',overflow:'auto'}">
<u-navbar :title="123" :autoBack="true" :titleStyle="{ <u-navbar :title="stnm" :autoBack="true" :titleStyle="{
fontSize:'18px' fontSize:'18px'
}" :height='40' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'> }" :height='40' :safeAreaInsetTop=true leftIconSize='20' leftIconColor='rgb(153, 153, 153)'>
</u-navbar> </u-navbar>
<view class="tab-bar" style="margin-top:70px"> <view class="tab-bar" style="margin-top:70px">
<view class="jcsj" @click="activeOne = 0" :class="{'active':activeOne == 0}"> <view class="jcsj" @click="activeOne = 0" :class="{'active':activeOne == 0}">
监测数据 监测数据
</view>
<view class="tjsj" @click="activeOne = 1" :class="{'active':activeOne == 1}">
统计数据
</view>
</view>
<view style="padding:10px" v-if="activeOne == 0">
<view class="time-ranger" >
<view class="start-time">
<text>开始时间</text>
<text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{stm}}</text>
</view>
<view class="end-time">
<text>结束时间</text>
<text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{etm}}</text>
<view class="search-btn" @click="searchHandle">
搜索
</view>
</view>
</view>
<view class="ylz-chart-area">
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" />
</view>
<view class="ylz-table-area">
<YlzTable :tableData="ylzData"></YlzTable>
</view>
</view> </view>
<view v-if="activeOne == 1" style="padding:10px"> <view class="tjsj" @click="activeOne = 1" :class="{'active':activeOne == 1}">
<Table></Table> 统计数据
</view> </view>
<u-datetime-picker </view>
:show="showTime" <view style="padding:10px" v-if="activeOne == 0">
v-model="startTime" <view class="time-ranger">
mode="datetime" <view class="start-time">
@confirm="handleStartTime" <text>开始时间</text>
@cancel="showTime=false" <text @click="showTime=true" style="margin-left:15%;color:#3399ef">{{stm}}</text>
></u-datetime-picker> </view>
<u-datetime-picker <view class="end-time">
:show="showTime1" <text>结束时间</text>
v-model="endTime" <text @click="showTime1=true" style="margin:0 15%;color:#3399ef">{{etm}}</text>
mode="datetime" <view class="search-btn" @click="searchHandle">
@confirm="handleEndTime" 搜索
@cancel="showTime1=false" </view>
></u-datetime-picker> </view>
</view>
</view>
<view class="ylz-chart-area">
<qiun-data-charts :chartData="chartData.chartData" :echartsApp="true" :eopts="chartData.eopts" />
</view>
<view class="ylz-table-area">
<YlzTable :tableData="ylzData"></YlzTable>
</view>
</view>
<view v-if="activeOne == 1" style="padding:10px">
<Table></Table>
</view>
<u-datetime-picker :show="showTime" v-model="startTime" mode="datetime" @confirm="handleStartTime"
@cancel="showTime=false"></u-datetime-picker>
<u-datetime-picker :show="showTime1" v-model="endTime" mode="datetime" @confirm="handleEndTime"
@cancel="showTime1=false"></u-datetime-picker>
</view>
</template> </template>
<script> <script>
import moment from'moment'; import moment from 'moment';
import Table from "./tjsjTable.vue" import Table from "./tjsjTable.vue"
import YlzTable from "./jcTable.vue" import YlzTable from "./jcTable.vue"
import drpOptions from './jcOptions' import drpOptions from './jcOptions'
const stm = moment().subtract(7, 'days').set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm"); const stm = moment().subtract(7, 'days').set({
const etm = moment().set({minute: 0, second: 0}).format("YYYY-MM-DD HH:mm"); minute: 0,
export default { second: 0
components:{ }).format("YYYY-MM-DD HH:mm");
Table, const etm = moment().set({
YlzTable minute: 0,
}, second: 0
data() { }).format("YYYY-MM-DD HH:mm");
return { export default {
startTime:stm, components: {
endTime:etm, Table,
stm, YlzTable
etm, },
showTime:false, data() {
showTime1:false, return {
activeOne:0, startTime: stm,
ylzData:[], endTime: etm,
chartData1:{}, stm,
chartData:{} etm,
} showTime: false,
}, showTime1: false,
methods: { activeOne: 0,
ylzData: [],
chartData1: {},
chartData: {},
stnm:'',
}
},
methods: {
// //
async getrainInfo(){ async getrainInfo() {
try { try {
const {data} = await uni.$http.post( const {
"/gunshiApp/xyt/attResBase/rainBasinDivision/queryStStbprpPerHour/StcdAndStartTimeAndEndTime",{ data
stcd:"716164061", } = await uni.$http.post(
startTime:moment(this.stm).format("YYYY-MM-DD HH:mm:ss"), "/gunshiApp/xyt/attResBase/rainBasinDivision/queryStStbprpPerHour/StcdAndStartTimeAndEndTime", {
endTime:moment(this.etm).format("YYYY-MM-DD HH:mm:ss") stcd: "716164061",
}) startTime: moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
if(data.code == 200){ endTime: moment(this.etm).format("YYYY-MM-DD HH:mm:ss")
this.ylzData = data.data; })
} if (data.code == 200) {
} catch (error) { this.ylzData = data.data;
uni.$showMsg(); }
} } catch (error) {
}, uni.$showMsg();
}
},
// //
async getrainChartInfo(){ async getrainChartInfo() {
try { try {
const {data} = await uni.$http.post( const {
"/gunshiApp/xyt/attResBase/rainBasinDivision/queryStStbprpPerHourChart/StcdAndStartTimeAndEndTime",{ data
stcd:"716164061", } = await uni.$http.post(
startTime:moment(this.stm).format("YYYY-MM-DD HH:mm:ss"), "/gunshiApp/xyt/attResBase/rainBasinDivision/queryStStbprpPerHourChart/StcdAndStartTimeAndEndTime", {
endTime:moment(this.etm).format("YYYY-MM-DD HH:mm:ss") stcd: "716164061",
}) startTime: moment(this.stm).format("YYYY-MM-DD HH:mm:ss"),
endTime: moment(this.etm).format("YYYY-MM-DD HH:mm:ss")
if(data.code == 200){ })
this.chartData1 = {...data.data}
} if (data.code == 200) {
} catch (error) { this.chartData1 = {
uni.$showMsg(); ...data.data
} }
}, }
handleStartTime(e){ } catch (error) {
let time = moment(e.value).format("YYYY-MM-DD HH:mm") uni.$showMsg();
this.stm = time }
this.showTime = false },
}, handleStartTime(e) {
handleEndTime(e){ let time = moment(e.value).format("YYYY-MM-DD HH:mm")
let time = moment(e.value).format("YYYY-MM-DD HH:mm") this.stm = time
this.etm = time; this.showTime = false
this.showTime1 = false },
}, handleEndTime(e) {
let time = moment(e.value).format("YYYY-MM-DD HH:mm")
searchHandle(){ this.etm = time;
this.showTime1 = false
},
searchHandle() {
this.getrainInfo(); this.getrainInfo();
this.getrainChartInfo(); this.getrainChartInfo();
} }
}, },
watch:{ watch: {
chartData1(n,o){ chartData1(n, o) {
this.chartData = {...drpOptions(n)} this.chartData = {
...drpOptions(n)
}
}
},
onLoad(options){
this.stnm = options.stnm
},
mounted() {
this.getrainInfo();
this.getrainChartInfo();
} }
},
mounted() {
this.getrainInfo();
this.getrainChartInfo();
} }
}
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.time-ranger{ .time-ranger {
margin-bottom: 10px; margin-bottom: 10px;
.start-time, .end-time{
display: flex; .start-time,
align-items: center; .end-time {
padding: 10px 0; display: flex;
border-bottom: 1px solid #dfdfdf; align-items: center;
padding: 10px 0;
border-bottom: 1px solid #dfdfdf;
}
} }
.tab-bar {
display: flex;
justify-content: space-around;
padding: 10px 40px;
border-bottom: 1px solid #dfdfdf;
} }
.tab-bar{
display: flex; .active {
justify-content: space-around; color: #39a6ff;
padding: 10px 40px;
border-bottom: 1px solid #dfdfdf;
} }
.active{
color: #39a6ff; .ylz-chart-area {
}
.ylz-chart-area{
width: 100%; width: 100%;
height: 230px; height: 230px;
} }
.ylz-chart-table{
}
</style> </style>

View File

@ -58,7 +58,7 @@
}, },
toDetail(){ toDetail(){
uni.navigateTo({ uni.navigateTo({
url:'/pages/ylzList/detail/index' url:`/pages/ylzList/detail/index?stnm=${this.item.stnm}`
}) })
}, },
}, },

BIN
static/tabs/aqjc.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
static/tabs/spjk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

BIN
static/tabs/stlljk.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
static/tabs/wtcl.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

BIN
static/tabs/wxyh.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

BIN
static/tabs/xcrw.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB