提交法律援助和财税援助,调整我的页面
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { getAidList } from "../../service/system";
|
||||
import { alertInfo, alertSuccess } from "../../utils/index";
|
||||
import { alertInfo, alertSuccess, loadingFunc } from "../../utils/index";
|
||||
import request from '../../utils/request'
|
||||
|
||||
const { OK } = request;
|
||||
@@ -32,7 +32,9 @@ Component({
|
||||
},
|
||||
lifetimes: {
|
||||
attached() {
|
||||
this.init()
|
||||
loadingFunc(async () => {
|
||||
await this.init();
|
||||
})
|
||||
}
|
||||
},
|
||||
/**
|
||||
@@ -42,16 +44,14 @@ Component({
|
||||
async init() {
|
||||
const { type, page, size } = this.data;
|
||||
const { code, message, data = [], total } = await getAidList(page, size, type);
|
||||
console.log('data', data)
|
||||
if (code !== OK) {
|
||||
alertInfo(message)
|
||||
return
|
||||
}
|
||||
this.setData({
|
||||
list: data,
|
||||
total
|
||||
}, () => {
|
||||
console.log("this.data", this.data)
|
||||
total,
|
||||
totalPage: Math.ceil(total / size)
|
||||
})
|
||||
},
|
||||
onRefresh() {
|
||||
@@ -69,10 +69,21 @@ Component({
|
||||
url: `/pages/aid/detail/index?id=${id}&type=${type}`,
|
||||
})
|
||||
},
|
||||
consult() {
|
||||
consult(e) {
|
||||
const { id = "" } = e.currentTarget.dataset;
|
||||
const { type } = this.data;
|
||||
wx.navigateTo({
|
||||
url: `/pages/aid/consult/index?id=${this.data.type}`,
|
||||
url: `/pages/aid/consult/index?id=${id}&type=${type}`,
|
||||
})
|
||||
}
|
||||
},
|
||||
async onChangePage(e) {
|
||||
const page = e.detail.currentIndex;
|
||||
const that = this;
|
||||
this.setData({
|
||||
page
|
||||
}, () => {
|
||||
that.init();
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
@@ -4,6 +4,7 @@
|
||||
"Banner": "/components/banner/index",
|
||||
"van-image": "@vant/weapp/image/index",
|
||||
"empty": "/components/empty/index",
|
||||
"van-icon": "@vant/weapp/icon/index"
|
||||
"van-icon": "@vant/weapp/icon/index",
|
||||
"pagination": "/components/pagination/index"
|
||||
}
|
||||
}
|
@@ -3,7 +3,7 @@
|
||||
<div class="title">行业精英</div>
|
||||
<view wx:if="{{list.length}}">
|
||||
<view wx:for="{{list}}" wx:key="id" >
|
||||
<view class="userInfoItem" mut-bind:tap="jumpToDetail" data-id="{{item.id}}">
|
||||
<view class="userInfoItem" bind:tap="jumpToDetail" data-id="{{item.id}}">
|
||||
<view class="content">
|
||||
<van-image
|
||||
width="200rpx"
|
||||
@@ -17,13 +17,18 @@
|
||||
<view class="userLevel"> {{ item.level }} </view>
|
||||
</view>
|
||||
<view class="synopsis"> {{item.synopsis}}{{item.synopsis}} {{item.synopsis}} </view>
|
||||
<view class="connect" bind:tap="consult">
|
||||
<van-icon name="service-o" />
|
||||
<view style="margin-left: 10rpx;"> 在线咨询 </view>
|
||||
<view class="connect" catch:tap="consult" data-id="{{item.id}}">
|
||||
<van-icon name="service-o" color="#1989fa" />
|
||||
<view style="margin-left: 10rpx;color: #1989fa;"> 在线咨询 </view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<pagination
|
||||
currentIndex="{{page}}"
|
||||
totalPage="{{totalPage}}"
|
||||
bind:pagingChange="onChangePage"
|
||||
/>
|
||||
</view>
|
||||
<empty wx:else bind:refresh="onRefresh" />
|
@@ -41,4 +41,18 @@
|
||||
.connect {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
.userName {
|
||||
width: 150rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.userLevel {
|
||||
width: 250rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
Reference in New Issue
Block a user