Sprinkler-app/page_user/photoxq.vue

303 lines
6.2 KiB
Vue
Raw Normal View History

2024-10-09 16:52:44 +08:00
<template>
<view class="page">
<u-navbar :is-back="true" title='识图' title-color="#000" :border-bottom="false" :background="bgc"
id="navbar">
</u-navbar>
<view class="top_page">
2024-10-17 18:00:05 +08:00
<view class="title">{{list.plantName == null ? '--' : list.plantName}}</view>
2024-10-09 16:52:44 +08:00
<view class="other_name">
2024-10-17 18:00:05 +08:00
又名{{list.alias == null ? '--' : list.alias}}
2024-10-09 16:52:44 +08:00
</view>
<view class="cont">
<view class="cont_left">
<view class="cont_left_tit">
难易程度
</view>
<view class="cont_left_txt">
2024-10-17 18:00:05 +08:00
{{text == null ? '--' : text}}
2024-10-09 16:52:44 +08:00
</view>
<view class="cont_left_tit" style="margin-top: 40rpx;">
功能
</view>
<view class="cont_left_txt">
2024-10-17 18:00:05 +08:00
{{list.funcStr == null ? '--' : list.funcStr}}
2024-10-09 16:52:44 +08:00
</view>
<view class="cont_left_tit" style="margin-top: 40rpx;">
适合空间
</view>
<view class="cont_left_txt">
2024-10-17 18:00:05 +08:00
{{list.fitSpaceStr == null ? '--' : list.fitSpaceStr}}
2024-10-09 16:52:44 +08:00
</view>
</view>
<view class="cont_right">
2024-11-02 17:59:26 +08:00
<image :src="list.picture" mode="aspectFill"></image>
2024-10-09 16:52:44 +08:00
</view>
</view>
</view>
<view class="bot_page">
<view class="tit" style="margin-top: 0rpx;">
养护重点
</view>
<view class="txt">
2024-11-07 17:44:29 +08:00
{{list.maintenanceFocus == undefined ? '' : list.maintenanceFocus}}
<!-- <view class="" v-for="(item,index) in formattedList" :key="index">
2024-10-17 18:00:05 +08:00
{{item}}
2024-11-07 17:44:29 +08:00
</view> -->
2024-10-09 16:52:44 +08:00
</view>
</view>
<view class="about">
<view class="tit">
关于
</view>
<view class="cont">
2024-10-17 18:00:05 +08:00
{{list.introduce == null ? '--' : list.introduce}}
2024-10-09 16:52:44 +08:00
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
bgc: {
backgroundColor: "#fff",
},
2024-10-17 18:00:05 +08:00
plantId:'',
text:'',
list:[]
2024-10-09 16:52:44 +08:00
}
},
2024-10-18 17:59:38 +08:00
// 分享到好友(会话)
onShareAppMessage: function() {
return {
title: '绿小能',
path: '/pages/index/index'
}
},
// 分享到朋友圈
onShareTimeline: function() {
return {
title: '绿小能',
query: '',
path: '/pages/index/index'
}
},
2024-10-09 16:52:44 +08:00
onLoad(option) {
2024-10-17 18:00:05 +08:00
this.plantId = option.plantId
this.getxq()
2024-10-09 16:52:44 +08:00
},
methods: {
2024-10-17 18:00:05 +08:00
getxq(){
this.$u.get(`/plant/plant/${this.plantId}`).then((res) => {
if (res.code == 200) {
this.list = res.data
if (this.list.complexity == 1) {
this.text = '非常容易'
} else if (this.list.complexity == 2) {
this.text = '比较容易'
} else if (this.list.complexity == 3) {
this.text = '一般'
} else if (this.list.complexity == 4) {
this.text = '有点困难'
} else if (this.list.complexity == 5) {
this.text = '比较困难'
} else if(this.list.complexity == 6){
this.text = '非常困难'
}
2024-11-07 17:44:29 +08:00
// if(res.data.maintenanceFocus != null || res.data.maintenanceFocus.length > 0){
// this.parseData(res.data.maintenanceFocus)
// }
2024-10-17 18:00:05 +08:00
} else {
uni.showToast({
title: res.msg,
icon: 'none',
duration: 1000
})
}
})
},
2024-11-07 17:44:29 +08:00
// parseData(text) {
// // 根据换行符分割文本为数组
// const items = text.split('\n')
// // 遍历每个条目,并添加序号
// items.forEach((item, index) => {
// // 去除条目前后的空白字符
// const trimmedItem = item.trim()
// // 如果条目不为空,则添加到格式化列表中,并添加序号
// if (trimmedItem) {
// this.formattedList.push(`${trimmedItem}`)
// }
// })
// },
2024-10-09 16:52:44 +08:00
}
}
</script>
<style lang="scss">
/deep/ .u-title{
margin-bottom: 22rpx;
}
/deep/ .uicon-nav-back{
margin-bottom: 22rpx;
}
.about{
margin-top: 56rpx;
padding: 0 32rpx;
box-sizing: border-box;
.tit{
font-size: 40rpx;
color: #3D3D3D;
font-weight: 600;
}
.cont{
margin-top: 24rpx;
font-size: 28rpx;
color: #3D3D3D;
}
}
.activesc{
background-color: #999 !important;
}
.shouc {
width: 100%;
padding: 0rpx 100rpx;
box-sizing: border-box;
position: fixed;
left: 50%;
transform: translateX(-50%);
bottom: 80rpx;
text-align: center;
text {
display: inline-block;
width: 200rpx;
background-color: #3dada9;
color: #fff;
height: 60rpx;
line-height: 60rpx;
text-align: center;
border-radius:50rpx;
}
}
.container {
width: 100%;
height: 100vh;
background-color: #fff;
position: fixed;
top: 0;
left: 0;
padding-top: 50rpx;
box-sizing: border-box;
}
page {
padding-bottom: 200rpx;
box-sizing: border-box;
background: #fff;
}
.top_page {
background: #fff;
padding: 0 32rpx;
padding-bottom: 28rpx;
.title {
margin-top: 23rpx;
font-size: 80rpx;
// font-weight: 400;
letter-spacing: 0rpx;
line-height: 88rpx;
color: rgba(80, 86, 90, 1);
}
.other_name {
margin-top: 8rpx;
font-size: 40rpx;
letter-spacing: 0rpx;
line-height: 48rpx;
color: rgba(119, 128, 141, 1);
}
.cont {
margin-top: 82rpx;
margin-bottom: 28rpx;
display: flex;
flex-wrap: nowrap;
align-items: flex-start;
.cont_left {
display: flex;
flex-wrap: wrap;
// margin-right: 40rpx;
// align-items: baseline;
width: 50%;
.cont_left_tit {
font-size: 28rpx;
// font-weight: 400;
letter-spacing: 0.56rpx;
line-height: 36rpx;
color: #3D3D3D;
}
.cont_left_txt {
margin-top: 10rpx;
width: 294rpx;
font-size: 32rpx;
// font-weight: 600;
letter-spacing: 0.64rpx;
line-height: 40rpx;
color: #50565A;
}
}
.cont_right {
width: 320rpx;
height: 320rpx;
margin-right: 20rpx;
box-sizing: border-box;
2024-10-17 18:00:05 +08:00
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
border-radius: 50%;
2024-10-09 16:52:44 +08:00
image {
background-size: cover;
border-radius: 50%;
width: 100%;
height: 100%;
}
}
}
}
.bot_page {
padding: 23rpx 32rpx 0rpx 32rpx;
.tit {
font-size: 40rpx;
font-weight: 700;
letter-spacing: 0rpx;
line-height: 40rpx;
color:#48893B;
margin-bottom: 40rpx;
}
.txt {
// margin-top: 24rpx;
width: 100%;
margin-top: 12rpx;
font-size: 32rpx;
font-weight: 400;
letter-spacing: 0.64rpx;
line-height: 40rpx;
color:#48893B;
}
}
</style>