123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <template>
- <block>
- <view class="item" v-for="(item,index) in list" :key='index' @tap="toPage" :data-id='item.id' data-url='/pages/article/detail'>
- <image :src="item.image" mode=""></image>
- <view class="">
- 八十一坊标题文字描述文案内容标题文字描述
- 文案内容
- </view>
- </view>
- </block>
- </template>
- <script module="parse" lang="wxs">
- module.exports = {
- filterNum: function(value) {
- var value = value + ''
- console.log(value)
- var card = value.replace(getRegExp('(/^(\d{4})\d+(\d{4})$/)', 'g'), '$1 **** **** $2')
- return card
- }
- }
- </script>
- <script>
- // pages/tabbar/index/index.js
- var app = getApp();
- export default {
- data() {
- return {
- navIndex: 0,
- list: [
- // {
- // account: "hhD",
- // bank_name: "农业银行",
- // card_no: "6228481561378773113",
- // card_no_end: "3113",
- // create_time: "1659088920",
- // id: "7",
- // is_default: "0",
- // status: "1",
- // uniacid: "3",
- // update_time: "1659088920",
- // user_id: "1"
- // }
- ],
- loaded: false,
- page: 1,
- type: '',
- pageSize: 10
- };
- },
- onLoad: function(options) {
- },
- onShow() {
- this.init()
- this.getlist();
- },
- onPullDownRefresh: function() {},
- onReachBottom: function() {
- this.loaded || this.getlist();
- },
- onShareAppMessage: function() {},
- methods: {
- toPage(e) {
- app.globalData.toPage(e);
- },
- init() {
- this.page = 1
- this.loaded = false
- this.list = []
- },
- async getlist() {
- var that = this;
- let res = await this.$api.request('/article/index', 'GET', {
- page: this.page,
- pagesize: this.pageSize
- });
- console.log(res)
- if (res) {
- if (res.length > 0) {
- this.list = this.list.concat(res);
- this.page++;
- } else {
- this.loaded = true
- this.$api.msg('没有更多数据');
- }
- }
- }
- }
- };
- </script>
- <style>
- page {
- background: #F5F5F5;
- }
- .item {
- background: #fff;
- border-radius: 12rpx;
- overflow: hidden;
- margin: 30rpx;
- }
-
- .item>view{
- width: 100%;
- padding: 30rpx 30rpx 50rpx 30rpx;
- font-size: 34rpx;
- color: #010101;
- }
-
- .item>image{
- width: 100%;
- height: 400rpx;
- }
-
- </style>
|