页面切图
This commit is contained in:
126
pages/project/detail.vue
Normal file
126
pages/project/detail.vue
Normal file
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading' noPadding>
|
||||
<view slot='body'>
|
||||
<view class='detail'>
|
||||
<view class="header">
|
||||
<view class="header-title">{{ project }}</view>
|
||||
<view class="header-des">项目详情。。。。。。。。</view>
|
||||
</view>
|
||||
<view class="nav">
|
||||
<view class="nav-menu " :class="{ 'nav-menu-active': navMenuActive == index }"
|
||||
v-for="(item, index) in navMenuList" :key="index" @click="navMenuClick(index)">{{ item.text }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="content" :style="{ minHeight: 'calc(100vh - ' + navHeight + 'px)' }">
|
||||
<view v-show="navMenuActive == 0">
|
||||
<uni-card title="基础设备" sub-title="副标题" extra="APF" v-for="item in 10" :key="item" @click="jump"
|
||||
thumbnail="/static/real_time_data.png">
|
||||
<text>设备基础信息 </text>
|
||||
</uni-card>
|
||||
</view>
|
||||
<view style="padding: 0 20rpx" v-show="navMenuActive == 1">
|
||||
<uni-list>
|
||||
<uni-list-item title="张三" note="2023-02-10 14:55" thumb="/static/head.png" thumb-size="lg">
|
||||
<template v-slot:footer>
|
||||
<view class="footer-btn mt20" style="background:#e47470" @click="del">移除</view>
|
||||
<!-- <view class="footer-btn mt20 ml10" @click="goUserDetail">查看</view> -->
|
||||
</template>
|
||||
</uni-list-item>
|
||||
<uni-list-item title="李四" note="2023-02-10 14:55" thumb="/static/head.png" thumb-size="lg">
|
||||
<template v-slot:footer>
|
||||
<view class="footer-btn mt20" style="background:#e47470" @click="del">移除</view>
|
||||
<!-- <view class="footer-btn mt20 ml10" @click="goUserDetail">查看</view> -->
|
||||
</template>
|
||||
</uni-list-item>
|
||||
</uni-list>
|
||||
</view>
|
||||
<uni-load-more status="nomore"></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
project: '',
|
||||
navMenuList: [{
|
||||
text: '设备列表'
|
||||
}, {
|
||||
text: '子用户列表'
|
||||
}],
|
||||
navMenuActive: 0
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
navMenuClick (index) {
|
||||
this.navMenuActive = index
|
||||
},
|
||||
goUserDetail () {
|
||||
uni.navigateTo({
|
||||
url: '/pages/mine/userDetail'
|
||||
})
|
||||
},
|
||||
del () {
|
||||
console.log('del');
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确定要移除该成员吗?',
|
||||
success: function (res) {
|
||||
if (res.confirm) {
|
||||
console.log('用户点击确定')
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad (option) {
|
||||
this.project = option.project
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery().select('.nav').boundingClientRect((rect) => {
|
||||
this.navHeight = rect.height
|
||||
}).exec()
|
||||
}, 1000);
|
||||
// uni.setNavigationBarTitle({ title: this.project })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.detail {
|
||||
.content {
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 20rpx 20rpx 0;
|
||||
|
||||
.header-title {
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.header-des {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.footer-btn {
|
||||
padding: 0 20rpx;
|
||||
height: 50rpx;
|
||||
background-color: #007aff;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
120
pages/project/list.vue
Normal file
120
pages/project/list.vue
Normal file
@@ -0,0 +1,120 @@
|
||||
<template>
|
||||
<view :loading="loading">
|
||||
<!-- <uni-nav-bar left-icon="left" right-icon="cart" title="标题" /> -->
|
||||
<uni-nav-bar dark :fixed="true" status-bar left-icon="left" rightIcon="plusempty" background-color="#fff"
|
||||
color="#111" title="项目管理" @clickLeft="back" @clickRight="add" />
|
||||
<view class="message">
|
||||
<view class="message-nav" @click="jump('监测')">
|
||||
<view class="message-nav-label">监测</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="message-nav" @click="jump('治理')">
|
||||
<view class="message-nav-label">治理</view>
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
<view class="message-nav" @click="jump('用能')">
|
||||
<view class="message-nav-label">用能</view>
|
||||
<!-- <uni-badge text="3"></uni-badge> -->
|
||||
<uni-icons type="forward" color="#aaa" size="20"></uni-icons>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init () {
|
||||
},
|
||||
back () {
|
||||
uni.navigateBack()
|
||||
},
|
||||
add () {
|
||||
uni.navigateTo({
|
||||
url: `/pages/project/new`
|
||||
})
|
||||
},
|
||||
upgrade (code) {
|
||||
console.log(code);
|
||||
uni.showToast({
|
||||
title: '升级成功',
|
||||
icon: 'none'
|
||||
})
|
||||
},
|
||||
jump (type) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/project/detail?project=${type}`
|
||||
})
|
||||
}
|
||||
},
|
||||
onLoad () {
|
||||
this.init()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.message {
|
||||
padding-top: 20rpx;
|
||||
|
||||
.message-header {
|
||||
padding: 200rpx 34rpx 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
margin-bottom: 20rpx;
|
||||
box-shadow: 0 4rpx 8rpx #e7e7e74c;
|
||||
|
||||
.message-header-head {
|
||||
margin-right: 30rpx;
|
||||
height: 128rpx;
|
||||
width: 128rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.message-header-name {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 36rpx;
|
||||
color: #111;
|
||||
font-weight: 700;
|
||||
|
||||
.tag {
|
||||
margin-top: 10rpx;
|
||||
font-size: 24rpx;
|
||||
color: #aaa;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.message-nav {
|
||||
padding: 34rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background: $uni-theme-white;
|
||||
border-bottom: 1rpx solid #e8e8e8;
|
||||
|
||||
&-icon {
|
||||
margin-right: 30rpx;
|
||||
height: 44rpx;
|
||||
width: 44rpx;
|
||||
border-radius: $uni-theme-radius;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
&-label {
|
||||
margin-right: 30rpx;
|
||||
flex: 1;
|
||||
font-size: 28rpx;
|
||||
color: #111;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
102
pages/project/new.vue
Normal file
102
pages/project/new.vue
Normal file
@@ -0,0 +1,102 @@
|
||||
<template>
|
||||
<Cn-page :loading='loading'>
|
||||
<view slot='body'>
|
||||
<view class='new'>
|
||||
<view class="content">
|
||||
<uni-forms :label-width="80">
|
||||
<uni-forms-item label="项目名称">
|
||||
<uni-easyinput type="number" v-model="formData.name" placeholder="请输入项目名称" />
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="区域">
|
||||
<view style="display:flex;">
|
||||
<uni-easyinput :clearable="false" type="textarea" autoHeight v-model="formData.address"
|
||||
placeholder="请输入区域信息" />
|
||||
<uni-icons type="location" color="#007aff" size="26" class="ml20"
|
||||
@click="chooseLocation"></uni-icons>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
<uni-forms-item label="描述">
|
||||
<uni-easyinput type="textarea" v-model="formData.name" placeholder="请输入项目描述" />
|
||||
</uni-forms-item>
|
||||
<uni-file-picker title="请上传拓扑图" :sourceType="['album']"></uni-file-picker>
|
||||
</uni-forms>
|
||||
</view>
|
||||
<view class="btn-wrap">
|
||||
<view class="btn-wrap-item" @click="submit"> 提交 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
data () {
|
||||
return {
|
||||
loading: false,
|
||||
formData: {
|
||||
name: '',
|
||||
gplot: ''
|
||||
},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
chooseLocation () {
|
||||
uni.chooseLocation({
|
||||
success: function (res) {
|
||||
this.address = res.name
|
||||
console.log('位置名称:' + res.name);
|
||||
console.log('详细地址:' + res.address);
|
||||
console.log('纬度:' + res.latitude);
|
||||
console.log('经度:' + res.longitude);
|
||||
}
|
||||
});
|
||||
},
|
||||
submit () {
|
||||
this.$util.toast('项目创建成功')
|
||||
setTimeout(() => {
|
||||
uni.navigateBack({ delta: 1 })
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang='scss'>
|
||||
.new {
|
||||
padding: 34rpx;
|
||||
|
||||
.content {
|
||||
.content-des {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
margin-bottom: 20rpx;
|
||||
padding: 34rpx;
|
||||
background: $uni-theme-white;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
|
||||
.btn-wrap {
|
||||
margin-top: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
|
||||
.btn-wrap-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex: 1;
|
||||
background: $uni-theme-blue;
|
||||
color: #fff;
|
||||
height: 80rpx;
|
||||
border-radius: 12rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/deep/ .uni-drawer__content {
|
||||
width: 100vw !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user