| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- <template>
- <view>
- <!-- 图片及其他 -->
- <view v-if="detail.url">
- <view class="wrap" v-if="detail.url">
- <u-image @click="upImg(detail.url)" :src="detail.url" mode="widthFix"></u-image>
- </view>
- <u-card title="习性" margin="0 0 30rpx 0" v-if="detail.habits">
- <view class="textContent" slot="body">
- {{detail.habits || ''}}
- </view>
- </u-card>
- <u-card title="防治方法" margin="0 0 30rpx 0" v-if="detail.prevention">
- <view class="textContent" slot="body">
- {{detail.prevention || ''}}
- </view>
- </u-card>
- </view>
- <view class="empyt" v-else>
- <u-icon name="info-circle-fill" color="#ff9900" size="48"></u-icon>
- <text>暂无介绍,正在补充中~</text>
- </view>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- detail: {
- }
- }
- },
- methods: {
- upImg(src) {
- uni.previewImage({
- urls: src,
- })
- },
- },
- onLoad(options) {
- this.detail = JSON.parse(options.pestName);
- uni.setNavigationBarTitle({
- title: `${this.detail.title}介绍`
- });
- },
- }
- </script>
- <style lang="scss">
- page {
- background: #f7f8fc;
- padding: 25rpx;
- }
- .wrap {
- width: 100%;
- margin-bottom: 30rpx;
- .u-image {
- display: block;
- margin: 0 auto;
- width: 730rpx;
- height: 450rpx;
- border-radius: 5px;
- }
- }
- .u-card{
- margin-bottom: 30rpx;
- }
- .u-card__body{
- border-top: 2rpx solid #e4e7ed;
- }
- .empyt{
- display: flex;
- height: 80vh;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- }
- </style>
|