zhongmianzixun.vue
2.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
<template>
<view class="contaniner">
<view class="list">
<view class="listitem flex" v-for="(item,index) in zixunlist" :key="index" @click="zixundetail(item.id)" >
<view class="listright" >
<image :src="item.image" mode=""></image>
</view>
<view class="listleft">
<view class="top commontwo">{{item.name}}</view>
<view class="leftbottom flexone">
<view class="botleft">{{item.author}}</view>
<view class="botright">{{item.publishtime}}</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import app from "../../App.vue";
export default {
data() {
return {
page:1,
zixunlist:[],
showpull:false
}
},
onLoad() {
this.getzixunlist()
},
methods: {
// 获取中面咨讯
getzixunlist() {
let that = this;
var url = 'article/get_list';
var params = {
page:that.page,
}
app.post(url, params, "post").then((res) => {
console.log(res);
that.zixunlist=that.zixunlist.concat(res.data.data)
if(that.page>1){
if(res.data.data.length==0){
that.showpull=true
}
}
}).catch((err) => {
console.log(err)
})
},
//选择优惠券
zixundetail(id){
uni.navigateTo({
url:"/pages/luntan/zhongmianzixundetail?zixunid="+id
})
},
surecoupon(){
uni.navigateBack({
checked:true
})
}
},
onReachBottom() {
let newpage=this.page;
newpage++;
this.page=newpage;
if(this.showpull==false){
this.getzixunlist()
}
}
}
</script>
<style>
.list{
padding: 0 32rpx;
box-sizing: border-box;
}
.listitem {
padding: 36rpx 0;
box-sizing: border-box;
border-bottom: 1rpx solid #f5f5f5;
}
.listleft{
margin-left: 32rpx;
}
.listright {
width: 218rpx;
height: 156rpx;
font-size: 0;
}
.listright image{
width:100%;
height:100%
}
.top {
font-size: 32rpx;
font-weight: bold;
width: 436rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.botleft {
color: #C29445;
font-size: 24rpx;
}
.botright {
color: #8c9198;
font-size: 24rpx;
margin-left: 24rpx;
}
.leftbottom{
margin-top:20rpx
}
</style>