Blame view

pages/funeralproblem/funeralproblem.vue 2.14 KB
1f3f2378   起风了   我的第一次
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
  <template>
  	<view class="page">
  		<pyh-nv ref="nv" :config="nvConfig"></pyh-nv>
  		<view class="listBox" :style="{'padding-top':(pageTop+'px')}">
  		<view class="content">
  		<view class="address-list">
  			<view class="list" v-for="(item,index) in list" :key="index">
  				<view class="name-phone">
  					<view class="name">
  						<text>{{item.title}}</text>
  					</view>
  					<view class="edit" @click="tzdetail(item)">
  						<image src="../../static/right2.png"></image>
  					</view>
  				</view>
  				<view class="address">
  					<text>{{item.absrtact}}</text>
  				</view>
  			</view>
  		</view>
  		</view>
  		</view>
  	</view>
  </template>
  
  <script>
  	export default {
  		data() {
  			return {
  				nvConfig:{
  					title:"常见问题",
  					bgColor:"#ffffff",
  					color:"#000000",
  					fixedAssist:{
  						hide:true,
  					},
  				},
  				page:{
  					pageNum:1,
  					pageSize:10,
  					category:"11"
  				},
  				total:0,
  				list:[],
  			};
  		},
  		onPageScroll(e) {this.$refs.nv.pageScroll(e)},
  		computed:{
  			pageTop(){return parseInt(88*uni.getSystemInfoSync().windowWidth/750) + uni.getSystemInfoSync().statusBarHeight}
  		},
  		onShow() {
  			this.getfbgl();
  		},
  		methods: {
  			getfbgl(){
  				this.API.getfbgl(this.page).then(res=>{
  					console.log("res",res);
  					this.fl(res.rows,"常见问题问答")
  					console.log('获取发布信息',this.list);
  					this.total = res.total
  				})
  			},
  			fl(item,flid){
  				var info = []
  				for(let i = 0;i < item.length;i++){
  					console.log(1);
  					console.log(item[i].category,flid);
  					if(item[i].category == flid){
  						this.list.push(item[i])
  					}
  				}
  				return info
  			},
  			tzdetail(item){
  				console.log("ress",item);
  				uni.navigateTo({
  					url:'/pages/xxdetail/xxdetail?info=' + JSON.stringify(item)
  				})
  			}
  		},
  		onReachBottom() {
  			var page = parseInt(this.total / 10 );
  			var s = parseInt(this.total % 10 );
  			console.log(page,s);
  			if(s > 0){
  				page = page + 1
  			}
  			if(page > 0){
  				if(this.page.pageNum < page){
  					this.page.pageNum = this.page.pageNum + 1
  					this.getfbgl();
  				}else{
  					console.log("没有了");
  				}
  			}
  		},
  	}
  </script>
  
  <style scoped lang="scss">
  	@import 'funeralproblem.scss';
  </style>