TalentService-mobile/pages/home/component/functions.vue

74 lines
1.4 KiB
Vue
Raw Normal View History

2024-10-27 00:26:19 +08:00
<template>
<scroll-view class='scroll-list' scroll-x>
2024-10-31 21:24:54 +08:00
<view class="list-item" @click="showDetail(item.name)" v-for="(item,index) in list" :key="index">
2024-10-27 00:26:19 +08:00
<view class="item">
2024-10-31 21:24:54 +08:00
<image :src="getIcon(item.name)"></image>
<text>{{ item.name }}</text>
2024-10-27 00:26:19 +08:00
</view>
</view>
</scroll-view>
</template>
<script>
2024-10-31 21:24:54 +08:00
import configService from "@/common/config.service";
2024-10-27 00:26:19 +08:00
export default{
props:{
list:{
type: Array,
default: [
2024-10-31 21:24:54 +08:00
{name:'人才政策'},
{name:'人才服务'},
{name:'资源对接'}
2024-10-27 00:26:19 +08:00
]
2024-10-31 21:24:54 +08:00
},
moduleName:{
type: String,
default: '人才模块'
2024-10-27 00:26:19 +08:00
}
},
data(){
return{
}
},
methods:{
2024-10-31 21:24:54 +08:00
showDetail(name = '介绍'){
2024-10-27 00:26:19 +08:00
uni.navigateTo({
2024-10-31 21:24:54 +08:00
url: `/pages/article/richDetail?title=${name}&moduleName=${this.moduleName}`
2024-10-27 00:26:19 +08:00
})
2024-10-31 21:24:54 +08:00
},
getIcon(name){
// console.log(configService.ip+'upload/20241028/'+name+'.png')
return encodeURI(configService.ip+'upload/20241028/'+name+'.png');
2024-10-27 00:26:19 +08:00
}
}
}
</script>
<style scoped lang="scss">
.scroll-list{
height: 200rpx;
width: 100%;
white-space: nowrap;
.list-item{
display: inline-block;
width: 120rpx;
margin-left: 100rpx;
.item{
display: flex;
flex-direction: column;
align-items: center;
image{
width: 100rpx;
height: 100rpx;
}
text{
margin-top: 10rpx;
color: #000;
font-weight: bold;
font-size: 30rpx;
}
}
}
}
</style>