123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <template>
- <view class="classify">
- <view class="classify-li" v-for="(item, index) in list" :key="index" @click="downLoad(item.link)">
- <image class="classify-li__img" :src="url+item.imgPath" alt=""></image>
- <view class="classify-li__text">
- {{ item.text }}
- </view>
- </view>
- </view>
- </template>
- <script>
- export default {
- name: 'Classify1',
- props: {
- list: {
- type: Array,
- default: () => []
- },
- url: {
- type: String,
- }
- },
- data() {
- return {
- baseURL: uni.$BASE_URL
- }
- },
- methods: {
- // 打开自定义链接
- openCustomLink(link = '') {
- console.log(`link: ${link}`)
- },
- downLoad(item) {
- if (item) {
- let url = encodeURIComponent(item)
- uni.navigateTo({
- url: '../../pages/home/myWebView?url=' + url
- })
- }
- },
- }
- }
- </script>
- <style scoped lang="scss">
- .classify {
- display: flex;
- justify-content: flex-start;
- flex-wrap: wrap;
- padding: 14upx 24upx 8rpx;
- .classify-li {
- flex: 0 0 20%;
- font-size: 24upx;
- &__img {
- display: block;
- width: 98upx;
- height: 98upx;
- margin: auto;
- }
- &__text {
- display: block;
- color: #5a5a5a;
- text-align: center;
- margin: 8upx 0 14upx 0;
- }
- }
- }
- </style>
|