联调app
This commit is contained in:
@@ -1,273 +1,273 @@
|
||||
<template>
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body">
|
||||
<view class="detail">
|
||||
<view class="header">
|
||||
<view class="header-title"
|
||||
>{{ engineering.name }}
|
||||
<!-- <view class="header-title-extra">用能</view> -->
|
||||
</view>
|
||||
<view class="header-des-mini mb10"
|
||||
>{{ engineering.provinceName + engineering.cityName }} {{ engineering.createTime }}</view
|
||||
>
|
||||
<view class="header-des">工程描述:{{ engineering.description }} </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="item.name"
|
||||
extra="🔍"
|
||||
@click="jumpProject(item)"
|
||||
v-for="(item, index) in store.data"
|
||||
:key="index"
|
||||
>
|
||||
<view class="term-list-bottom">
|
||||
<view class="term-list-bottom-item">
|
||||
<view>设备个数</view>
|
||||
<view>{{ item.devNum }}</view>
|
||||
</view>
|
||||
<view class="term-list-bottom-item">
|
||||
<view>创建时间</view>
|
||||
<view>{{ item.createTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<Cn-empty v-if="store.empty"></Cn-empty>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
</view>
|
||||
<view style="padding: 0 20rpx" v-show="navMenuActive == 2">
|
||||
<image
|
||||
class="gplot gplot-box"
|
||||
mode="aspectFill"
|
||||
src="/static/test2.pic.png"
|
||||
v-for="(item, key) in 3"
|
||||
:key="key"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<uni-fab
|
||||
ref="fab"
|
||||
direction="vertical"
|
||||
horizontal="right"
|
||||
vertical="bottom"
|
||||
:content="content"
|
||||
@trigger="trigger"
|
||||
v-if="content.length"
|
||||
/>
|
||||
<uni-popup ref="share" type="share" background-color="#fff">
|
||||
<uni-popup-share title="分享到"></uni-popup-share>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import list from '../../common/js/list'
|
||||
import { deleteEngineering } from '../../common/api/engineering'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
engineering: '',
|
||||
navMenuList: [
|
||||
{
|
||||
text: '项目',
|
||||
},
|
||||
// {
|
||||
// text: '拓扑图',
|
||||
// },
|
||||
],
|
||||
content: [
|
||||
// {
|
||||
// iconPath: '/static/share.png',
|
||||
// text: '编辑',
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/delate.png',
|
||||
// text: '删除',
|
||||
// },
|
||||
],
|
||||
navHeight: 0,
|
||||
navMenuActive: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
trigger(e) {
|
||||
console.log(this.$refs)
|
||||
if (e.item.text == '移交') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gc/transfer',
|
||||
})
|
||||
} else if (e.item.text == '分享') {
|
||||
this.$refs.share.open()
|
||||
} else if (e.item.text == '编辑') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new?engineering=' + encodeURIComponent(JSON.stringify(this.engineering)),
|
||||
})
|
||||
} else if (e.item.text == '删除') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '删除工程后不可恢复,是否继续?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
deleteEngineering(this.engineering.id).then((res) => {
|
||||
this.$util.toast('删除成功')
|
||||
this.$util.refreshPrePage()
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
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('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
goDevice() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail',
|
||||
})
|
||||
},
|
||||
jumpProject(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/detail?project=' + encodeURIComponent(JSON.stringify(item)),
|
||||
})
|
||||
},
|
||||
init() {
|
||||
this.store = this.DataSource('/cs-device-boot/project/queryProject')
|
||||
this.store.params.engineeringId = this.engineering.id
|
||||
this.store.reload()
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
this.engineering = JSON.parse(decodeURIComponent(option.engineering))
|
||||
let userInfo = uni.getStorageSync('userInfo')
|
||||
if (userInfo.authorities == 'engineering_user' || userInfo.authorities == 'app_vip_user') {
|
||||
this.content.push(
|
||||
{
|
||||
iconPath: '/static/share.png',
|
||||
text: '编辑',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/delate.png',
|
||||
text: '删除',
|
||||
},
|
||||
)
|
||||
}
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect) => {
|
||||
this.navHeight = rect.height
|
||||
})
|
||||
.exec()
|
||||
}, 1000)
|
||||
this.init()
|
||||
// uni.setNavigationBarTitle({ title: this.engineering })
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.detail {
|
||||
.content {
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 20rpx 20rpx 0;
|
||||
|
||||
.header-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.header-title-extra {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
padding-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.header-des {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.header-des-mini {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-btn {
|
||||
padding: 0 20rpx;
|
||||
height: 50rpx;
|
||||
background-color: #007aff;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.gplot {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
border: 8rpx solid #ccc;
|
||||
}
|
||||
|
||||
.term-list-bottom {
|
||||
.term-list-bottom-item {
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// view:first-of-type{
|
||||
// color: #111;
|
||||
// }
|
||||
}
|
||||
|
||||
.term-list-bottom-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<Cn-page :loading="loading" noPadding>
|
||||
<view slot="body">
|
||||
<view class="detail">
|
||||
<view class="header">
|
||||
<view class="header-title"
|
||||
>{{ engineering.name }}
|
||||
<!-- <view class="header-title-extra">用能</view> -->
|
||||
</view>
|
||||
<view class="header-des-mini mb10"
|
||||
>{{ engineering.provinceName + engineering.cityName }} {{ engineering.createTime }}</view
|
||||
>
|
||||
<view class="header-des">工程描述:{{ engineering.description }} </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="item.name"
|
||||
extra="🔍"
|
||||
@click="jumpProject(item)"
|
||||
v-for="(item, index) in store.data"
|
||||
:key="index"
|
||||
>
|
||||
<view class="term-list-bottom">
|
||||
<view class="term-list-bottom-item">
|
||||
<view>设备个数</view>
|
||||
<view>{{ item.devNum }}</view>
|
||||
</view>
|
||||
<view class="term-list-bottom-item">
|
||||
<view>创建时间</view>
|
||||
<view>{{ item.createTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<Cn-empty v-if="store.empty"></Cn-empty>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
</view>
|
||||
<view style="padding: 0 20rpx" v-show="navMenuActive == 2">
|
||||
<image
|
||||
class="gplot gplot-box"
|
||||
mode="aspectFill"
|
||||
src="/static/test2.pic.png"
|
||||
v-for="(item, key) in 3"
|
||||
:key="key"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<uni-fab
|
||||
ref="fab"
|
||||
direction="vertical"
|
||||
horizontal="right"
|
||||
vertical="bottom"
|
||||
:content="content"
|
||||
@trigger="trigger"
|
||||
v-if="content.length"
|
||||
/>
|
||||
<uni-popup ref="share" type="share" background-color="#fff">
|
||||
<uni-popup-share title="分享到"></uni-popup-share>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</Cn-page>
|
||||
</template>
|
||||
<script>
|
||||
import list from '../../common/js/list'
|
||||
import { deleteEngineering } from '../../common/api/engineering'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
engineering: '',
|
||||
navMenuList: [
|
||||
{
|
||||
text: '项目',
|
||||
},
|
||||
// {
|
||||
// text: '拓扑图',
|
||||
// },
|
||||
],
|
||||
content: [
|
||||
// {
|
||||
// iconPath: '/static/share.png',
|
||||
// text: '编辑',
|
||||
// },
|
||||
// {
|
||||
// iconPath: '/static/delate.png',
|
||||
// text: '删除',
|
||||
// },
|
||||
],
|
||||
navHeight: 0,
|
||||
navMenuActive: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
trigger(e) {
|
||||
console.log(this.$refs)
|
||||
if (e.item.text == '移交') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/gc/transfer',
|
||||
})
|
||||
} else if (e.item.text == '分享') {
|
||||
this.$refs.share.open()
|
||||
} else if (e.item.text == '编辑') {
|
||||
uni.navigateTo({
|
||||
url: '/pages/engineering/new?engineering=' + encodeURIComponent(JSON.stringify(this.engineering)),
|
||||
})
|
||||
} else if (e.item.text == '删除') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '删除工程后不可恢复,是否继续?',
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
deleteEngineering(this.engineering.id).then((res) => {
|
||||
this.$util.toast('删除成功')
|
||||
this.$util.refreshPrePage()
|
||||
})
|
||||
} else if (res.cancel) {
|
||||
console.log('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
}
|
||||
},
|
||||
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('用户点击取消')
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
goDevice() {
|
||||
uni.navigateTo({
|
||||
url: '/pages/device/APF/detail',
|
||||
})
|
||||
},
|
||||
jumpProject(item) {
|
||||
uni.navigateTo({
|
||||
url: '/pages/project/detail?project=' + encodeURIComponent(JSON.stringify(item)),
|
||||
})
|
||||
},
|
||||
init() {
|
||||
this.store = this.DataSource('/cs-device-boot/project/queryProject')
|
||||
this.store.params.engineeringId = this.engineering.id
|
||||
this.store.reload()
|
||||
},
|
||||
},
|
||||
onLoad(option) {
|
||||
this.engineering = JSON.parse(decodeURIComponent(option.engineering))
|
||||
let userInfo = uni.getStorageSync('userInfo')
|
||||
if (userInfo.authorities == 'engineering_user' || userInfo.authorities == 'app_vip_user') {
|
||||
this.content.push(
|
||||
{
|
||||
iconPath: '/static/share.png',
|
||||
text: '编辑',
|
||||
},
|
||||
{
|
||||
iconPath: '/static/delate.png',
|
||||
text: '删除',
|
||||
},
|
||||
)
|
||||
}
|
||||
setTimeout(() => {
|
||||
// 获取nav高度
|
||||
uni.createSelectorQuery()
|
||||
.select('.nav')
|
||||
.boundingClientRect((rect) => {
|
||||
this.navHeight = rect.height
|
||||
})
|
||||
.exec()
|
||||
}, 1000)
|
||||
this.init()
|
||||
// uni.setNavigationBarTitle({ title: this.engineering })
|
||||
},
|
||||
}
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.detail {
|
||||
.content {
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.header {
|
||||
padding: 20rpx 20rpx 0;
|
||||
|
||||
.header-title {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: 40rpx;
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.header-title-extra {
|
||||
font-size: 24rpx;
|
||||
color: #666;
|
||||
padding-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.header-des {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
.header-des-mini {
|
||||
font-size: 24rpx;
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
.footer-btn {
|
||||
padding: 0 20rpx;
|
||||
height: 50rpx;
|
||||
background-color: #007aff;
|
||||
font-size: 24rpx;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 50rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.gplot {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
border: 8rpx solid #ccc;
|
||||
}
|
||||
|
||||
.term-list-bottom {
|
||||
.term-list-bottom-item {
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// view:first-of-type{
|
||||
// color: #111;
|
||||
// }
|
||||
}
|
||||
|
||||
.term-list-bottom-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,188 +1,188 @@
|
||||
<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="
|
||||
userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'
|
||||
? 'plusempty'
|
||||
: ''
|
||||
"
|
||||
background-color="#fff"
|
||||
color="#111"
|
||||
title="工程管理"
|
||||
@clickLeft="back"
|
||||
@clickRight="add"
|
||||
/>
|
||||
<uni-search-bar
|
||||
v-model="store.params.name"
|
||||
clearButton="none"
|
||||
bgColor="#fff"
|
||||
placeholder="请输入关键词"
|
||||
@input="store.search()"
|
||||
></uni-search-bar>
|
||||
<view class="message">
|
||||
<uni-card
|
||||
:title="item.name"
|
||||
extra="🔍"
|
||||
@click="jump(item)"
|
||||
v-for="(item, index) in store.data"
|
||||
:style="{ marginTop: index === 0 ? '0' : '' }"
|
||||
:key="index"
|
||||
>
|
||||
<view class="term-list-bottom">
|
||||
<view class="term-list-bottom-item">
|
||||
<view>区域</view>
|
||||
<view>{{ item.provinceName + item.cityName }}</view>
|
||||
</view>
|
||||
<view class="term-list-bottom-item">
|
||||
<view>创建时间</view>
|
||||
<view>{{ item.createTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import list from '../../common/js/list'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.store = this.DataSource('/cs-device-boot/engineering/queryEngineeringPage')
|
||||
this.store.params.name = ''
|
||||
this.store.reload()
|
||||
this.store.firstCallBack = (res) => {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', this.store.data[0])
|
||||
} else {
|
||||
this.store.data.forEach((item) => {
|
||||
if (item.id == engineering.id) {
|
||||
uni.setStorageSync('engineering', item)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
add() {
|
||||
if (this.userInfo.authorities === 'app_vip_user' || this.userInfo.authorities === 'engineering_user') {
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/new`,
|
||||
})
|
||||
}
|
||||
},
|
||||
upgrade(code) {
|
||||
console.log(code)
|
||||
uni.showToast({
|
||||
title: '升级成功',
|
||||
icon: 'none',
|
||||
})
|
||||
},
|
||||
jump(engineering) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/detail?engineering=${encodeURIComponent(JSON.stringify(engineering))}`,
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.init()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.message {
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.term-list-bottom {
|
||||
.term-list-bottom-item {
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// view:first-of-type{
|
||||
// color: #111;
|
||||
// }
|
||||
}
|
||||
|
||||
.term-list-bottom-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<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="
|
||||
userInfo.authorities === 'app_vip_user' || userInfo.authorities === 'engineering_user'
|
||||
? 'plusempty'
|
||||
: ''
|
||||
"
|
||||
background-color="#fff"
|
||||
color="#111"
|
||||
title="工程管理"
|
||||
@clickLeft="back"
|
||||
@clickRight="add"
|
||||
/>
|
||||
<uni-search-bar
|
||||
v-model="store.params.name"
|
||||
clearButton="none"
|
||||
bgColor="#fff"
|
||||
placeholder="请输入关键词"
|
||||
@input="store.search()"
|
||||
></uni-search-bar>
|
||||
<view class="message">
|
||||
<uni-card
|
||||
:title="item.name"
|
||||
extra="🔍"
|
||||
@click="jump(item)"
|
||||
v-for="(item, index) in store.data"
|
||||
:style="{ marginTop: index === 0 ? '0' : '' }"
|
||||
:key="index"
|
||||
>
|
||||
<view class="term-list-bottom">
|
||||
<view class="term-list-bottom-item">
|
||||
<view>区域</view>
|
||||
<view>{{ item.provinceName + item.cityName }}</view>
|
||||
</view>
|
||||
<view class="term-list-bottom-item">
|
||||
<view>创建时间</view>
|
||||
<view>{{ item.createTime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
<Cn-empty v-if="store.empty" style="padding-top: 400rpx"></Cn-empty>
|
||||
<uni-load-more
|
||||
v-if="store.status == 'loading' || (store.data && store.data.length > 0)"
|
||||
:status="store.status"
|
||||
></uni-load-more>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import list from '../../common/js/list'
|
||||
|
||||
export default {
|
||||
mixins: [list],
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
userInfo: {},
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.userInfo = uni.getStorageSync(this.$cacheKey.userInfo)
|
||||
this.store = this.DataSource('/cs-device-boot/engineering/queryEngineeringPage')
|
||||
this.store.params.name = ''
|
||||
this.store.reload()
|
||||
this.store.firstCallBack = (res) => {
|
||||
let engineering = uni.getStorageSync('engineering')
|
||||
if (!engineering) {
|
||||
uni.setStorageSync('engineering', this.store.data[0])
|
||||
} else {
|
||||
this.store.data.forEach((item) => {
|
||||
if (item.id == engineering.id) {
|
||||
uni.setStorageSync('engineering', item)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
back() {
|
||||
uni.navigateBack()
|
||||
},
|
||||
add() {
|
||||
if (this.userInfo.authorities === 'app_vip_user' || this.userInfo.authorities === 'engineering_user') {
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/new`,
|
||||
})
|
||||
}
|
||||
},
|
||||
upgrade(code) {
|
||||
console.log(code)
|
||||
uni.showToast({
|
||||
title: '升级成功',
|
||||
icon: 'none',
|
||||
})
|
||||
},
|
||||
jump(engineering) {
|
||||
uni.navigateTo({
|
||||
url: `/pages/engineering/detail?engineering=${encodeURIComponent(JSON.stringify(engineering))}`,
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
onLoad() {
|
||||
this.init()
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.message {
|
||||
.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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.term-list-bottom {
|
||||
.term-list-bottom-item {
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
// view:first-of-type{
|
||||
// color: #111;
|
||||
// }
|
||||
}
|
||||
|
||||
.term-list-bottom-item:last-of-type {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user