吉光研途前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

88 lines
1.7 KiB

<template>
<view class="page__view">
<!-- 导航栏 -->
<navbar :title="title" leftClick @leftClick="$utils.navigateBack" />
<view class="list">
<view class="list-item"
v-for="item in list"
:key="item.id"
@click="jumpToDetail(item.id, item.title)"
>
<image class="list-item-bg" :src="item.image" mode="scaleToFill"></image>
</view>
</view>
</view>
</template>
<script>
import mixinsList from '@/mixins/list.js'
export default {
mixins: [mixinsList],
data() {
return {
title: '搜索',
keyword: '',
queryParams: {
pageNo: 1,
pageSize: 10,
categoryId: '',
title: '',
},
mixinsListApi: 'queryServiceArticleList',
}
},
onLoad(arg) {
const { categoryId, title } = arg
this.title = title
this.queryParams.categoryId = categoryId
this.getData()
},
methods: {
search() {
this.queryParams.pageNo = 1
this.queryParams.pageSize = 10
this.queryParams.title = this.keyword
this.getData()
},
jumpToDetail(articleId) {
uni.navigateTo({
url: `/pages_order/serve/index?articleId=${articleId}`
})
},
},
}
</script>
<style scoped lang="scss">
.list {
margin: 49rpx 18rpx 17rpx 18rpx;
&-item {
position: relative;
font-size: 0;
border-radius: 25rpx;
overflow: hidden;
box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
& + & {
margin-top: 32rpx;
}
&-bg {
$w: calc(100vw - 18rpx*2);
width: $w;
height: calc(#{$w} * 179 / 714);
}
}
}
</style>