| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <template>
- <!-- 病虫害百科 -->
- <view>
- <ui-search placeholder="请输入害虫名字" @confirm="searchLampList"></ui-search>
- <ui-tabs :list="tabs" :active="tabValue"></ui-tabs>
- <!-- 病虫害百科列表 -->
- <view class="page-panel pest-panel">
- <block v-for="(item,index) in pestList" :key="index">
- <view class="pest-item">
- <image class="pic" mode="aspectFill" :src="item.img_urls"></image>
- <view class="row-center p-10">
- <text class="text">{{item.name}}</text>
- </view>
- </view>
- </block>
- </view>
- </view>
- </template>
- <script>
- import {
- loadPestList
- } from '@/api/pest.js'
- export default {
- data() {
- return {
- // 病虫害百科列表
- pestList: [],
- tabValue: 1, // 当前状态
- // 搜索条件列表
- params: {
- code: 1,
- page: 1,
- page_size: 8,
- pest_name: ''
- },
- // tabs列表
- tabs: [{
- text: '虫害百科',
- value: 1
- }, {
- text: '病虫害百科',
- value: 2
- }, ]
- };
- },
- onLoad() {
- this.getPestList();
- },
- methods: {
- // 获取虫害列表
- async getPestList() {
- let res = await loadPestList(this.params);
- }
- }
- }
- </script>
- <style lang="scss">
- // 病虫害百科面板
- .pest-panel {
- display: flex;
- flex-wrap: wrap;
- padding: 24rpx;
- }
- // 病虫害百科列表项
- .pest-item {
- width: 336rpx;
- margin-right: 28rpx;
- margin-bottom: 24rpx;
- border-radius: 12rpx;
- border: 1rpx solid #F1F1F1;
- &:nth-child(2n) {
- margin-right: 0;
- }
- .pic {
- display: block;
- width: 336rpx;
- height: 255rpx;
- border-radius: 4rpx;
- }
- .text {
- font-size: 20rpx;
- color: #666666;
- }
- .tips {
- width: 24rpx;
- height: 24rpx;
- background: #07F546;
- border-radius: 100%;
- }
- }
- </style>
|