123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <template>
- <view class="container">
- <uni-card class="card card2" v-for="(item, index) in policyList" :key="index" @click="policyBtn(item)">
- <image class="cover" :src="item.url"></image>
- <h2>{{ item.title }}</h2>
- <text class="cardText">{{ item.text }}</text>
- </uni-card>
- </view>
- </template>
- <script>
- import requestLogin from '../../api/login.js';
- export default {
- data() {
- return {
- policyList: []
- }
- },
- async mounted() {
- const config = await requestLogin.getJson();
- const { list, bannerList, policyList } = config.data;
- this.policyList = policyList;
- },
- onShow: function() {},
- methods: {
- policyBtn(e) {
- uni.navigateTo({ url: e.path });
- },
- },
- // 页面生命周期中onReachBottom(页面滚动到底部的事件)
- onReachBottom() {}
- }
- </script>
- <style>
- .container {
- display: flex;
- flex-wrap: wrap;
- }
- .card {
- display: block;
- margin: 10px;
- width: 27%;
- }
- .cover {
- display: block;
- width: 40px;
- height: 40px;
- margin: 5px auto;
- }
- .uni-card {
- padding: 0 !important;
- margin: 0 !important;
- }
- .uni-card__content {
- padding: 0 !important;
- }
- h2 {
- font-weight: 700;
- width: 100%;
- text-align: center;
- font-size: 16px;
- }
- .cardText {
- display: block;
- width: 100%;
- text-align: center;
- font-size: 12px;
- margin-bottom: 5px;
- color: #999;
- }
- </style>
|