| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <template>
- <view>
- <view style="position: fixed;z-index: 100;">
- <uni-nav-bar @clickLeft="clickLeft" left-icon="back" left-text="返回" :title="title"></uni-nav-bar>
- </view>
- <view class="particulars">
- <view class="particulars_item" v-for="(item,index) in content" :key="index" @click="introduce(item.id)">
- <image :src="item.img_urls" mode="" class="imgs"></image>
- <p>{{item.name}}</p>
- </view>
- </view>
- </view>
- </template>
- <style lang="scss">
- .particulars{
- width: 100%;
- position: relative;
- top: 88rpx;
- display: flex;
- flex-wrap: wrap;
- .particulars_item{
- width: 50%;
- padding: 20rpx;
- box-sizing: border-box;
- .imgs{
- width: 100%;
- height: 220rpx;
- }
- p{
- font-size: 24rpx;
- }
- }
- }
- </style>
- <script>
- export default {
- data() {
- return {
- title:'',
- content:[],
- data:{
- code:null,
- page:null
- }
- }
- },
- methods: {
- async getCooperation(data) {
- const res = await this.$myRequest({
- url: '/api/api_gateway?method=pest.pests.pests_search',
- data:{
- code:data.code,
- page:data.page
- }
- })
- this.content=this.content.concat(res.data)
- },
- clickLeft(){
- uni.navigateTo({
- url:"./index"
- })
- },
- introduce(id){
- uni.navigateTo({
- url:"./introduce?id="+id+"&title="+this.title
- })
- }
- },
- onLoad(option){
- this.title=option.name
- if(option.name=="虫情百科"){
- this.data.code=2
- this.data.page=1
- this.getCooperation(this.data)
- }else{
- this.data.code=1
- this.data.page=1
- this.getCooperation(this.data)
- }
- },
- onReachBottom() {
- this.data.page++
- this.getCooperation(this.data)
- }
- }
- </script>
- <style>
- </style>
|